autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 03/12] use a shell function for _AC_LINK_IFELSE


From: Paolo Bonzini
Subject: Re: [PATCH 03/12] use a shell function for _AC_LINK_IFELSE
Date: Thu, 23 Oct 2008 18:11:02 +0200
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Eric Blake wrote:
> Paolo Bonzini <bonzini <at> gnu.org> writes:
> 
>>>   (exit $ac_status); }])
>> in _AC_RUN_LOG_STDERR and _AC_RUN_LOG could also be changed to an
>> ac_func_set_status shell function that does just "return $1".  A
>> candidate for m4sh maybe?
> 
> Absolutely!  Nice catch.  I think an m4sh addition would be nice, whether or 
> not we end up using it in _AC_DO.
> 
>> Or possibly it can also be replaced simply with "test $ac_status != 0",
>> avoiding the zsh bug (even though anyway the buggy shells will be
>> skipped by the better-shell test).
> 
> That would take a more thorough audit to make sure that no one actually tries 
> to parse the different values of $0 after calling _AC_DO and friends.  On the 
> other hand, _AC_DO already saves the 0-255 value of interest in $ac_status, 
> so 
> it shouldn't matter if we collapse $? to a boolean value instead of 
> preserving 
> $ac_status.

A quick

   fgrep '$? ' *

suggests that it's safe, and $ac_status is always used (I also went
through all to AC_DO uses).  Okay?

2008-10-23  Paolo Bonzini  <address@hidden>

        * lib/autoconf/general.m4 (_AC_RUN_LOG, _AC_RUN_LOG_STDERR):
        Return the boolean value of ac_status as the status code.

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 430ddf4..297eafe 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2234,7 +2234,7 @@ AC_DEFUN([_AC_RUN_LOG],
   ($1) 2>&AS_MESSAGE_LOG_FD
   ac_status=$?
   _AS_ECHO_LOG([\$? = $ac_status])
-  (exit $ac_status); }])
+  test $ac_status = 0; }])


 # _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
@@ -2252,7 +2252,7 @@ AC_DEFUN([_AC_RUN_LOG_STDERR],
   rm -f conftest.er1
   cat conftest.err >&AS_MESSAGE_LOG_FD
   _AS_ECHO_LOG([\$? = $ac_status])
-  (exit $ac_status); }])
+  test $ac_status = 0; }])

 # _AC_DO_ECHO(COMMAND)
 # --------------------


Paolo




reply via email to

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