autoconf-patches
[Top][All Lists]
Advanced

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

13-trap-log.patch


From: Akim Demaille
Subject: 13-trap-log.patch
Date: Sun, 21 Jan 2001 17:59:05 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        * acgeneral.m4 (AC_INIT, AC_OUTPUT): Don't take care of completing
        the log.
        (_AC_INIT_PREPARE): Do it in the trap 0.
        
Index: acgeneral.m4
--- acgeneral.m4 Fri, 19 Jan 2001 20:59:30 +0100 akim (ace/27_acgeneral. 
1.169.8.121 644)
+++ acgeneral.m4 Sun, 21 Jan 2001 09:57:01 +0100 akim (ace/27_acgeneral. 
1.169.8.121 644)
@@ -716,7 +716,7 @@ m4_define([_AC_INIT_DEFAULTS_FDS],
 # ---------------------
 # At the end of configure, dump some useful information in the
 # log, even if AC_OUTPUT was not called.
-AC_DEFUN([_AC_INIT_LOG_COMPLETE],
+m4_define([_AC_INIT_LOG_COMPLETE],
 [# Save into config.log some information that might help in debugging.
 cat <<_ACEOF >&AS_MESSAGE_LOG_FD
 
@@ -776,7 +776,6 @@ m4_define([_AC_INIT_DEFAULTS],
 ## ------------ ##
 
 EOF
-m4_wrap([AC_EXPAND_ONCE([_AC_INIT_LOG_COMPLETE])[]])dnl
 
 _AC_INIT_DEFAULTS_FDS
 #
@@ -1452,8 +1451,30 @@ m4_define([_AC_INIT_PREPARE],
 done
 
 # When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
 trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  echo cat <<_ACEOF >&AS_MESSAGE_LOG_FD
+  echo >&AS_MESSAGE_LOG_FD
+  echo "## ----------------- ##" >&AS_MESSAGE_LOG_FD
+  echo "## Cache variables.  ##" >&AS_MESSAGE_LOG_FD
+  echo "## ----------------- ##" >&AS_MESSAGE_LOG_FD
+  echo >&AS_MESSAGE_LOG_FD
+  m4_patsubst(m4_patsubst(m4_dquote(m4_defn([_AC_CACHE_DUMP])),
+                          [^ *\(#.*\)?
+]),
+              ['], ['"'"']) >&AS_MESSAGE_LOG_FD
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&AS_MESSAGE_LOG_FD
+    echo "## ------------ ##" >&AS_MESSAGE_LOG_FD
+    echo "## confdefs.h.  ##" >&AS_MESSAGE_LOG_FD
+    echo "## ------------ ##" >&AS_MESSAGE_LOG_FD
+    echo >&AS_MESSAGE_LOG_FD
+    cat conftest.log >&AS_MESSAGE_LOG_FD
+  fi
+  (echo; echo) >&AS_MESSAGE_LOG_FD
   test "$ac_signal" != 0 &&
     echo "$as_me: caught signal $ac_signal" >&AS_MESSAGE_LOG_FD
   echo "$as_me: exit $exit_status" >&AS_MESSAGE_LOG_FD
@@ -1461,7 +1482,7 @@ m4_define([_AC_INIT_PREPARE],
     exit $exit_status
      ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_status=$?; ac_signal='$ac_signal'; exit $ac_status' $ac_signal
+  trap 'ac_status=$?; ac_signal='$ac_signal'; AS_EXIT([$ac_status])' $ac_signal
 done
 ac_signal=0
 
@@ -3769,8 +3790,6 @@ m4_define([AC_OUTPUT],
 
 dnl Commands to run before creating config.status.
 AC_OUTPUT_COMMANDS_PRE()dnl
-
-AC_EXPAND_ONCE([_AC_INIT_LOG_COMPLETE])
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
Index: doc/autoconf.texi
--- doc/autoconf.texi Wed, 17 Jan 2001 21:51:05 +0100 akim (ace/16_autoconf.t 
1.61.2.103 644)
+++ doc/autoconf.texi Sun, 21 Jan 2001 09:52:05 +0100 akim (ace/16_autoconf.t 
1.61.2.103 644)
@@ -5975,7 +5975,7 @@ @node Limitations of Builtins, Limitatio
 and pass 42 as exit status for Bash.
 
 The shell in FreeBSD 4.0 has the following bug: @samp{$?} is reset to 0
-by empty lines if the code in inside trap.
+by empty lines if the code is inside trap.
 
 @example
 $ trap 'false



reply via email to

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