autoconf-patches
[Top][All Lists]
Advanced

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

[patch] don't discard previous config.log before necessary


From: Lars J. Aas
Subject: [patch] don't discard previous config.log before necessary
Date: Tue, 13 Feb 2001 14:21:55 +0100
User-agent: Mutt/1.2.5i

This patch fixes the config.log problem of overwriting the previous
config.log even if you just invoke configure --help.  One problem
remains that should be fixed - the temporary log file (conf-log.tmp)
is left behind in the current directory if you run configure --help,
but should be removed when configure exits.  I don't have the overview
of all the exit points, and the removal of this file should probably
be taken care of by a trap?  A separate patch can fix that later.

Cheers,

  Lars J

2001-02-13  Lars J. Aas  <address@hidden>

        * acgeneral.m4 (_AC_INIT_CONFIG_LOG): New macro.
        (AC_MESSAGE_LOG_NAME): Contains current logfile name. Use it.
        (_AC_INIT_DEFAULT_FDS): Start logging to conf-log.tmp.
        (_AC_INIT): Invoke _AC_INIT_CONFIG_LOG after options have
        been parsed.

Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.694
diff -u -r1.694 acgeneral.m4
--- acgeneral.m4        2001/02/07 15:04:52     1.694
+++ acgeneral.m4        2001/02/13 13:01:42
@@ -675,6 +675,7 @@
 
 m4_define([AS_MESSAGE_FD], 6)
 m4_define([AS_MESSAGE_LOG_FD], 5)
+m4_define([AS_MESSAGE_LOG_NAME], [conf-log.tmp])
 # That's how they used to be named.
 AU_ALIAS([AC_FD_CC],  [AS_MESSAGE_LOG_FD])
 AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
@@ -686,11 +687,25 @@
 # 2 errors and warnings
 @%:@ AS_MESSAGE_LOG_FD compiler messages saved in config.log
 @%:@ AS_MESSAGE_FD checking for... messages and results
-exec AS_MESSAGE_LOG_FD>>config.log
+exec AS_MESSAGE_LOG_FD>>AS_MESSAGE_LOG_NAME
 exec AS_MESSAGE_FD>&1
 ])# _AC_INIT_DEFAULTS_FDS
 
 
+# _AC_INIT_CONFIG_LOG
+# -------------------
+# When we know the previous config.log can be discarded, move the new one
+# to config.log.
+m4_define([_AC_INIT_CONFIG_LOG],
+[m4_if([AS_MESSAGE_LOG_NAME], [config.log], [],
+[# discard previous config.log
+rm -f config.log
+mv AS_MESSAGE_LOG_NAME config.log
+m4_define([AS_MESSAGE_LOG_NAME], [config.log])dnl
+exec AS_MESSAGE_LOG_FD>>AS_MESSAGE_LOG_NAME])
+])# _AC_INIT_CONFIG_LOG
+
+
 # _AC_INIT_DEFAULTS
 # -----------------
 # Values which defaults can be set from `configure.ac'.
@@ -708,7 +723,7 @@
 # Name of the executable.
 as_me=`echo "$[0]" | sed 's,.*/,,'`
 
-cat >config.log <<EOF
+cat >AS_MESSAGE_LOG_NAME <<EOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
@@ -717,9 +732,9 @@
  > $[0] address@hidden
 
 EOF
-AS_UNAME >>config.log
+AS_UNAME >>AS_MESSAGE_LOG_NAME
 
-cat >>config.log <<EOF
+cat >>AS_MESSAGE_LOG_NAME <<EOF
 ## ------------ ##
 ## Core tests.  ##
 ## ------------ ##
@@ -1526,6 +1541,7 @@
 _AC_INIT_NOTICE
 _AC_INIT_COPYRIGHT
 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
+_AC_INIT_CONFIG_LOG
 ])
 
 



reply via email to

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