Hello,
I was annoyed by the fact that when I call
"builddir/config.status --version"
config.log is created in the current directory.
So I wrote the following patch; OK to commit?
Have a nice day,
Stepan
2005-08-04 Stepan Kasal <[EMAIL PROTECTED]>
* 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.
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.72
diff -u -r1.72 status.m4
--- lib/autoconf/status.m4 26 Jul 2005 10:14:25 -0000 1.72
+++ lib/autoconf/status.m4 4 Aug 2005 15:06:21 -0000
@@ -1048,6 +1048,8 @@
# 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.
@@ -1069,16 +1071,10 @@
_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
@@ -1089,13 +1085,13 @@
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $[0] [EMAIL PROTECTED]
-_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
@@ -1108,10 +1104,10 @@
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.
@@ -1153,8 +1149,8 @@
])dnl
Report bugs to <[email protected]>."
-_ACEOF
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
@@ -1165,11 +1161,12 @@
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
@@ -1184,15 +1181,11 @@
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
@@ -1229,7 +1222,8 @@
-*) 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
@@ -1241,6 +1235,15 @@
exec AS_MESSAGE_FD>/dev/null
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