autoconf-patches
[Top][All Lists]
Advanced

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

Re: AC_TRY_COMPILE() annoyances with 2.63b


From: Eric Blake
Subject: Re: AC_TRY_COMPILE() annoyances with 2.63b
Date: Tue, 14 Apr 2009 20:27:46 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

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

According to Mike Frysinger on 4/14/2009 8:11 PM:
> well, is there any real need to preserve the exit value of the if statement ? 
>  
> in other words, past implementations of autoconf didnt preserve it and it 
> isnt 
> like anyone complained.  the old generated code:

for AC_TRY_COMPILE, but not for other clients of AS_IF

> .......
> else
>   echo "$as_me: failed program was:" >&5
> sed 's/^/| /' conftest.$ac_ext >&5
> 
>       <stuff from user 4th arg -- $? is now set to exit value of `sed`, not 
> the if>

The AC_RUN_IFELSE test in the testsuite if a valid test that showed
someone caring about the exit status:

AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 2])],
              [AC_MSG_ERROR([saw `return 2' as a success])],
              [estatus=$?
test $estatus != 2 &&
  AC_MSG_ERROR([did not get as 2 exit status: $estatus])])

When running a test program, you really can care about $?, more than just
the fact that you hit the else branch of the AS_IF.

- --
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

iEYEARECAAYFAknlRiEACgkQ84KuGfSFAYB4JwCeJWmD9evGI7ZhFqv27McI/2rx
nl0AoKOIRcxV+R62/chriojOYhLuhs3/
=Ox6l
-----END PGP SIGNATURE-----




reply via email to

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