autoconf
[Top][All Lists]
Advanced

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

Re: Last configure args


From: Ralf Wildenhues
Subject: Re: Last configure args
Date: Wed, 5 Jan 2005 13:02:06 +0100
User-agent: Mutt/1.4.1i

* Akim Demaille wrote on Tue, Jan 04, 2005 at 10:45:17AM CET:
> >>> "Ralf" == Ralf Wildenhues <address@hidden> 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.
 
address@hidden --config
+Print the command to recreate the current configuration.
+The output is quoted such that it is reusable for a shell within @code{eval}:
+
address@hidden
+eval `./config.status --config`
address@hidden example
+
+is synonymous to
+
address@hidden
+./config.status --recheck && ./config.status
address@hidden example
+
+and recreates the current configuration.  To create a new build tree with
+a slightly modified configuration, commands like
+
address@hidden
+mkdir build-debug && cd build-debug
+eval set `../build-opt/config.status --config`
+shift
+path/to/configure "$@@" CFLAGS="-g"
address@hidden 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]




reply via email to

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