autoconf-patches
[Top][All Lists]
Advanced

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

Re: Allow inspecting AC_PREPROC_IFELSE output in true branch.


From: Eric Blake
Subject: Re: Allow inspecting AC_PREPROC_IFELSE output in true branch.
Date: Mon, 19 Jul 2010 11:56:38 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 07/19/2010 11:43 AM, Ralf Wildenhues wrote:
> The AC_EGREP_CPP macro already allows to test preprocessor output, but
> this addition can be helpful if you want to answer two questions with
> only one run of the preprocessor.  Also, it is in line with
> AC_COMPILE_IFELSE and AC_LINK_IFELSE allowing inspection of output in
> the if-true branch.

I like it!  Please apply, after addressing one nit...

> IMHO the most dangerous bit of this patch is that I'm unsure why
> AC_EGREP_CPP (aka AC_PROGRAM_EGREP earlier) was introduced in the first
> place, if there was some portability issue formerly that prevented an
> AC_TRY_PREPROC or so.

I'm not entirely sure of the history on this myself, without spending my
time doing more git research.

> +++ b/tests/compile.at
> @@ -295,7 +295,7 @@ AT_DATA([configure.ac],
>  AC_PROG_CC
>  
>  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([int ok;], [])],
> -               [test -f conftest.err || AS_EXIT([1])],
> +               [{ test -f conftest.err && grep ok conftest.i; } || 
> AS_EXIT([1])],

This should use a longer string, more likely to be unique to our
compilation (what if a system header declares a function named choke(),
for instance), so as to avoid false positives.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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