[Top][All Lists]

[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.


  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.
@@ -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_FD>&1
+# -------------------
+# When we know the previous config.log can be discarded, move the new one
+# to 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
 # -----------------
 # Values which defaults can be set from `'.
@@ -708,7 +723,7 @@
 # Name of the executable.
 as_me=`echo "$[0]" | sed 's,.*/,,'`
-cat >config.log <<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
-AS_UNAME >>config.log
-cat >>config.log <<EOF
 ## ------------ ##
 ## Core tests.  ##
 ## ------------ ##
@@ -1526,6 +1541,7 @@
 m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl

reply via email to

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