From: Paolo Bonzini Date: Thu, 6 Nov 2008 10:42:39 +0000 (+0100) Subject: Remove three forks per _AC_RUN_LOG_STDERR in the common case. X-Git-Tag: v2.63b~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=359be416a7aa33dc6d65d1c6271925e6dd72b99e;p=thirdparty%2Fautoconf.git Remove three forks per _AC_RUN_LOG_STDERR in the common case. * lib/autoconf/general.m4 (_AC_RUN_LOG_STDERR): Avoid grep/rm/cat sequence when the program's stderr was empty, while providing a conftest.err file even in that case. (_AC_CACHE_DUMP): Fix mismatched parenthesis. --- diff --git a/ChangeLog b/ChangeLog index 8ba86ef37..37e69c794 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-06 Paolo Bonzini + + Remove three forks per _AC_RUN_LOG_STDERR in the common case. + * lib/autoconf/general.m4 (_AC_RUN_LOG_STDERR): Avoid grep/rm/cat + sequence when the program's stderr was empty, while providing a + conftest.err file even in that case. + (_AC_CACHE_DUMP): Fix mismatched parenthesis. + 2008-11-06 Paolo Bonzini Change `present but cannot be compiled' behavior to use compiler result. diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index de4de3396..4ae4d4764 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1929,7 +1929,7 @@ m4_define([_AC_CACHE_DUMP], (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote + # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ ["s/'/'\\\\''/g; @@ -2253,11 +2253,13 @@ AC_DEFUN([_AC_RUN_LOG], # in AS_IF constructs. AC_DEFUN([_AC_RUN_LOG_STDERR], [{ { $2; } >&AS_MESSAGE_LOG_FD - ($1) 2>conftest.er1 + ($1) 2>conftest.err ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&AS_MESSAGE_LOG_FD + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&AS_MESSAGE_LOG_FD + mv -f conftest.er1 conftest.err + fi _AS_ECHO_LOG([\$? = $ac_status]) test $ac_status = 0; }])