Re: Last configure args

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

 



* Akim Demaille wrote on Tue, Jan 04, 2005 at 10:45:17AM CET:
> >>> "Ralf" == Ralf Wildenhues <Ralf.Wildenhues@xxxxxx> writes:
> 
>  > Might be nice to have the information reusable as well
>  > (--config comes to mind).  See below.
> 
> The idea is nice, but the way to use --config should be documented: in
> particular how to split properly the output when some arguments
> include spaces and other special characters.

How about this patch, with autoconf.texi slightly updated?

Regards,
Ralf

	* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): New option
	`--config' for config.status, to output the configuration command
	suitable for reuse with `eval'.
	* doc/autoconf.texi (config.status Invocation): Document it.


Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.861
diff -u -r1.861 autoconf.texi
--- doc/autoconf.texi	4 Jan 2005 23:50:01 -0000	1.861
+++ doc/autoconf.texi	5 Jan 2005 10:22:44 -0000
@@ -13506,6 +13506,32 @@
 @itemx -V
 Print the version number of Autoconf and exit.
 
+@item --config
+Print the command to recreate the current configuration.
+The output is quoted such that it is reusable for a shell within @code{eval}:
+
+@example
+eval `./config.status --config`
+@end example
+
+is synonymous to
+
+@example
+./config.status --recheck && ./config.status
+@end example
+
+and recreates the current configuration.  To create a new build tree with
+a slightly modified configuration, commands like
+
+@example
+mkdir build-debug && cd build-debug
+eval set `../build-opt/config.status --config`
+shift
+path/to/configure "$@@" CFLAGS="-g"
+@end example
+
+could be used.
+
 @item --silent
 @itemx --quiet
 @itemx -q
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.48
diff -u -r1.48 status.m4
--- lib/autoconf/status.m4	21 Dec 2004 14:24:01 -0000	1.48
+++ lib/autoconf/status.m4	5 Jan 2005 10:22:44 -0000
@@ -1348,6 +1348,7 @@
 
   -h, --help       print this help, then exit
   -V, --version    print version number, then exit
+      --config     print configuration
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -1384,11 +1385,13 @@
 _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_configure="$[0]"
+ac_cs_config="`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
 ac_cs_version="\\
 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING,
-  with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
+configured by \$ac_cs_configure, generated by m4_PACKAGE_STRING,
+  with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2004 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
@@ -1432,6 +1435,8 @@
     ac_cs_recheck=: ;;
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
+  --config | --conf* )
+    echo "$ac_cs_configure $ac_cs_config"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
     AC_MSG_ERROR([ambiguous option: $[1]


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux