]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Break circular require chain in _AS_LINENO_PREPARE.
authorEric Blake <ebb9@byu.net>
Wed, 15 Oct 2008 22:15:52 +0000 (16:15 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 15 Oct 2008 22:19:04 +0000 (16:19 -0600)
* lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Ensure that logging is
disabled when reporting LINENO failure, since logging requires
LINENO.
* doc/autoconf.texi (Initialization Macros): Recommend m4_pushdef,
not m4_rename, since the latter is undocumented.
* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid
m4_rename, as it does not yet handle pushdef stacks.
Reported by Ralf Wildenhues.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/autoconf.texi
lib/autoconf/status.m4
lib/m4sugar/m4sh.m4

index d4619b9bec91a1924ad43ebf4eab10a75910b914..e627d14fc4f370cf27befb511e56e2b64e7ca771 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-15  Eric Blake  <ebb9@byu.net>
+
+       Break circular require chain in _AS_LINENO_PREPARE.
+       * lib/m4sugar/m4sh.m4 (_AS_LINENO_PREPARE): Ensure that logging is
+       disabled when reporting LINENO failure, since logging requires
+       LINENO.
+       * doc/autoconf.texi (Initialization Macros): Recommend m4_pushdef,
+       not m4_rename, since the latter is undocumented.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Avoid
+       m4_rename, as it does not yet handle pushdef stacks.
+       Reported by Ralf Wildenhues.
+
 2008-10-15  Eric Blake  <ebb9@byu.net>
 
        Cleanups to previous patches.
index b3ffc76669d10b14a84c734507a2380ca01f05c0..43227a6b50a684a26d00c563d9d4871be1d4af30 100644 (file)
@@ -11978,11 +11978,14 @@ Note that @code{AS_INIT_GENERATED} does not emit the entire prolog.
 In particular, a line containing @code{#!$SHELL} must have already been
 emitted to the child script; you should not use @code{#!/bin/sh}, or the
 child script will not use the more modern shell that the parent script
-might have detected.  Currently, the suggested idiom for writing a M4sh
+might have detected.  Likewise, the child script starts life without a
+log file open, so you must temporarily disable any attempts to use the
+log file until after emitting code to open a log within the child.
+Currently, the suggested idiom for writing a M4sh
 shell script from within another script is:
 
 @example
-m4_rename([AS_MESSAGE_LOG_FD], [save_AS_MESSAGE_LOG_FD])dnl
+m4_pushdef([AS_MESSAGE_LOG_FD])dnl
 cat > "@var{file}" <<__EOF__
 #! $SHELL
 # Generated by $as_me.
@@ -11995,7 +11998,7 @@ cat >>"@var{file}" <<\__EOF__
 AS_INIT_GENERATED
 # ...
 __EOF__
-m4_rename([save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
+m4_popdef([AS_MESSAGE_LOG_FD])dnl
 @end example
 
 This, however, may change in the future as the M4sh interface is
index 6d622b9e42487e058913f018619dac012b2fd8d2..26fa2cffbde05377b8e30473657ff5f093443e15 100644 (file)
@@ -1317,7 +1317,7 @@ fi
 m4_define([_AC_OUTPUT_CONFIG_STATUS],
 [AC_MSG_NOTICE([creating $CONFIG_STATUS])
 dnl AS_MESSAGE_LOG_FD is not available yet:
-m4_rename([AS_MESSAGE_LOG_FD], [_AC_save_AS_MESSAGE_LOG_FD])dnl
+m4_pushdef([AS_MESSAGE_LOG_FD])dnl
 cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #! $SHELL
 # Generated by $as_me.
@@ -1541,7 +1541,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 dnl Open the log:
-m4_rename([_AC_save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
+m4_popdef([AS_MESSAGE_LOG_FD])dnl
 exec AS_MESSAGE_LOG_FD>>config.log
 {
   echo
index b42e87fa594a00757cb230f5f51ac9ecb13b8d0c..44c804915f7b97cb1d5ee08c8725534a2861d011 100644 (file)
@@ -953,6 +953,9 @@ m4_defun([_AS_LINENO_PREPARE],
 [AS_REQUIRE([_AS_CR_PREPARE])dnl
 AS_REQUIRE([_AS_ME_PREPARE])dnl
 _AS_DETECT_SUGGESTED([_AS_LINENO_WORKS])dnl
+dnl Even if the logging fd is open, we don't want to use $LINENO in the
+dnl AS_ERROR complaining that LINENO is broken.
+m4_pushdef([AS_MESSAGE_LOG_FD])dnl
 _AS_LINENO_WORKS || {
 
   dnl Create $as_me.lineno as a copy of $as_myself, but with $LINENO
@@ -989,6 +992,7 @@ _AS_LINENO_WORKS || {
   # Exit status is that of the last command.
   exit
 }
+m4_popdef([AS_MESSAGE_LOG_FD])dnl
 ])# _AS_LINENO_PREPARE