]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
config.status now opens log after option processing
authorStepan Kasal <kasal@ucw.cz>
Tue, 23 Aug 2005 09:26:03 +0000 (09:26 +0000)
committerStepan Kasal <kasal@ucw.cz>
Tue, 23 Aug 2005 09:26:03 +0000 (09:26 +0000)
ChangeLog
lib/autoconf/status.m4

index 26a1bf51d820c69c3c2fba69732581cd54808d4f..2d87d4f1e49365f28870b111d75452c484347fc8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2005-08-23  Stepan Kasal  <kasal@ucw.cz>
 
        * lib/autoconf/general.m4 (_AC_DEFINE_Q): Strip the parameter list
-       before passing the macro name to AH_TEMPLATE.
+         before passing the macro name to AH_TEMPLATE.
+
+       * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): config.status
+         now opens log after option processing; in particular, --version
+         and --help do not touch config.log.
 
        * Makefile.maint: Revert the change from 2005-08-12.
 
index bf71570ccf95bc47f8b1b66856794e2c3920f0b2..2d2a71b989a170de843b48ddf3e8b7615098fad0 100644 (file)
@@ -1053,6 +1053,8 @@ AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
 # shells die.  Unfortunately the limit is not known precisely...
 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
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
 # Generated by $as_me.
@@ -1074,16 +1076,10 @@ dnl of configure, not config.status.
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-cat >&AS_MESSAGE_LOG_FD <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
 $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
 generated by m4_PACKAGE_STRING.  Invocation command line was
@@ -1094,13 +1090,13 @@ generated by m4_PACKAGE_STRING.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $[0] $[@]
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&AS_MESSAGE_LOG_FD
-echo >&AS_MESSAGE_LOG_FD
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
-# Files that config.status was made for.
 cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
 m4_ifdef([_AC_SEEN_CONFIG(FILES)],
 [config_files="$ac_config_files"
 ])dnl
@@ -1113,10 +1109,10 @@ m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
 m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
 [config_commands="$ac_config_commands"
 ])dnl
+
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -1158,8 +1154,8 @@ $config_commands
 
 ])dnl
 Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
@@ -1170,11 +1166,12 @@ configured by $[0], generated by m4_PACKAGE_STRING,
 Copyright (C) 2005 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
+
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
 [INSTALL='$INSTALL'
-])dnl
+])
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -1189,15 +1186,11 @@ do
     ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$[1]
     ac_optarg=$[2]
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$[1]
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
@@ -1234,7 +1227,8 @@ Try `$[0] --help' for more information.]);;
   -*) AC_MSG_ERROR([unrecognized option: $[1]
 Try `$[0] --help' for more information.]) ;;
 
-  *) ac_config_targets="$ac_config_targets $[1]" ;;
+  *) ac_config_targets="$ac_config_targets $[1]"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -1247,6 +1241,15 @@ if $ac_cs_silent; then
   ac_configure_extra_args="$ac_configure_extra_args --silent"
 fi
 
+dnl Open the log:
+m4_rename([_AC_save_AS_MESSAGE_LOG_FD], [AS_MESSAGE_LOG_FD])dnl
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+  echo "$ac_log"
+} >&AS_MESSAGE_LOG_FD
+
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then