autoconf
[Top][All Lists]
Advanced

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

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


From: Vincent Torri
Subject: Re: test in a m4 macro and variable created from pushdef
Date: Fri, 10 Aug 2007 07:51:00 +0200 (CEST)



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




reply via email to

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