Re: test in a m4 macro and variable created from pushdef

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

 





On Thu, 9 Aug 2007, Eric Blake wrote:


Needless to say, I only typed a quick answer, rather than trying to test
it.  There are two arguments to AM_CONDITIONAL, so both should be quoted.
Then you have a choice:
 AM_CONDITIONAL([BUILD_DRIVER_[]UP], [...])
calls AM_CONDITIONAL with a string for the first argument; wherever
AM_CONDITIONAL outputs that string, the string is subject to reparsing,
and it is the reparsing that sees that UP is a macro.

When I use:

AM_CONDITIONAL([BUILD_DRIVER_[]UP], test "x${[use_]DOWN[_driver]}" = "xyes")

automake complains:

src/lib/Makefile.am:8: BUILD_DRIVER_BDF does not appear in AM_CONDITIONAL
autoreconf: automake failed with exit status: 1


 AM_CONDITIONAL([BUILD_DRIVER_]UP, [...])
calls AM_CONDITIONAL with a string consisting of UP already expanded (ok
if UP is alphanumeric, but with the potential for m4 syntax confusion if
it contains anything in the character class [][,()].

both solutions:

AM_CONDITIONAL([BUILD_DRIVER_]UP, [test "x${use_]DOWN[_driver}" = "xyes"])
AM_CONDITIONAL([BUILD_DRIVER_]UP, test "x${[use_]DOWN[_driver]}" = "xyes")

are working

Vincent Torri


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux