[Top][All Lists]

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

Re: use of AC_TRY_EVAL broken

From: Eric Blake
Subject: Re: use of AC_TRY_EVAL broken
Date: Sat, 01 Nov 2008 11:09:48 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080914 Thunderbird/ Mnenhy/

Hash: SHA1

According to Bruno Haible on 10/24/2008 3:28 PM:
> Ralf Wildenhues wrote:
>> a suggestion for a new name: AC_EVAL_IFELSE.
> There's actually two cases to consider, if you want to make it easy to use
> for the developer:
>   - the case of a command that should be executed and logged,
>   - the case of a variable that contains a command that should be executed and
>     logged,
> If the second one is AC_EVAL_IFELSE, what would be the name of the first one
> (without EVAL)?

The old (undocumented and unsafe) names are AC_TRY_EVAL and
AC_TRY_COMMAND.  Internally, the safe variants forward to either
_AC_DO_VAR(cmd) (expands to eval $cmd) or _AC_DO_TOKENS($cmd blah)
(equivalent to running $cmd blah).

One other thing to point out is that it AC_COMPILE_IFELSE and friends have
a (currently undocumented) feature that if the first argument is empty,
then it compiles the program previously built by AC_LANG_CONFTEST, and the
user is responsible for calling 'rm -f conftest.$ac_ext' after the macro
ends (hmm, we need to wrap that cleanup in a macro, rather than exposing
$ac_ext).  But that means you can build a program once, then pass it
through several compile attempts, which seems like it was one of the use
cases driving this conversation (for example, see my proposed patch for

What if we create and document the following macro names:

AC_COMMAND_IFELSE(command with args, if-true, if-false)
AC_EVAL_IFELSE(variable, if-true, if-false)

where AC_EVAL_IFELSE([variable]) is shorthand for AC_COMMAND_IFELSE([eval
"$variable"])?  Does that solve the immediate need?

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

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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