]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Remove three forks per _AC_RUN_LOG_STDERR in the common case.
authorPaolo Bonzini <bonzini@gnu.org>
Thu, 6 Nov 2008 10:42:39 +0000 (11:42 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Thu, 6 Nov 2008 14:23:59 +0000 (15:23 +0100)
* 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.

ChangeLog
lib/autoconf/general.m4

index 8ba86ef3758aa97f78787729ab6a2b50e153a2be..37e69c794eddf9003d365fa7851fa189f81a8c27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-06  Paolo Bonzini  <bonzini@gnu.org>
+
+       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  <bonzini@gnu.org>
 
        Change `present but cannot be compiled' behavior to use compiler result.
index de4de3396a935b4476a19a556e705175a52d81fd..4ae4d47640fba6345e7a44466fbb39e6764b6edf 100644 (file)
@@ -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 quotesdouble-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; }])