autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_DEFUN_ONCE semantics


From: Eric Blake
Subject: Re: AC_DEFUN_ONCE semantics
Date: Tue, 27 Jan 2009 06:04:54 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 1/27/2009 1:11 AM:
>> On the other hand, the manual already said that inside the body of an
>> AC_DEFUN'd macro (such as AS_IF), you should use AC_REQUIRE([foo]), never
>> direct foo.  So if you were already obeying the manual, you should never
>> run into this particular change in semantics.
> 
> I never knew about this, and I actually disagree with it.  (It is
> redundant with the new AC_DEFUN_ONCE).

The statement has existed since 1d037b8 (Oct 11, 2004, 2.59-178), so
macros written for 2.59 were not aware of it:

+Obviously it is not sensible to evaluate a macro defined by
address@hidden in a macro defined by @code{AC_DEFUN}, most of the
+times you will want to use @code{AC_REQUIRE} (@pxref{Prerequisite
+Macros}).

Part of my patch this week was rewording it to the following (which
relaxes the requirement), since you are correct that the original
statement is no longer true:

+Prior to Autoconf 2.64, a macro defined by @code{AC_DEFUN_ONCE} would
+emit a warning if it was directly expanded a second time, so for
+portability, it is better to use @code{AC_REQUIRE} than direct
+invocation of @var{macro-name} inside a macro defined by @code{AC_DEFUN}
+(@pxref{Prerequisite Macros}).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl/BnYACgkQ84KuGfSFAYD1mACgkEJGPwar6UB9NSS96iSgO8T0
zGsAoKFAV68lBr0n6bBurQ9wgz28xje9
=T7yC
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]