You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Ralf S. Engelschall" <rs...@engelschall.com> on 1998/05/02 22:30:29 UTC

[PATCH] config.status

config.status
-------------

Users of GNU Autoconf know that you can use an auto-generated script named
config.status for re-generating the configuration.  Although GNU Autoconf does
it different (there the sed substs are placed in this script) we can also
provide this tiny but nevertheless useful goody in our configure script: We
just record the used command line there. This way running ./config.status
re-generated the configuration.

A sample? Here it is: The command

| $ CC='pgcc' CFLAGS='-O2 -fstrength-reduce -DTEST=\\"etst\\"' ./configure
|   --prefix=/tmp/apache --enable-shared=max

leads to an (again correctly escaped) script:

| #!/bin/sh
| ##
| ##  config.status -- APACI auto-generated configuration restore script
| ##
| ##  Use this shell script to re-run the APACI configure script for
| ##  restoring your configuration. Additional parameters can be supplied.
| ##
| 
| CC="pgcc" \
| CFLAGS="-O2 -fstrength-reduce -DTEST=\\\\\"etst\\\\\"" \
| ./configure \
| "--prefix=/tmp/apache" \
| "--enable-shared=max" \
| $*

I've no strong opinion if we should include this little goody in 1.3b7-dev now
or keep it for 1.3.1-dev (next feature cycle). Hmmm... although it is a
feature it is a very little one and would make no harm to us because it
doesn't change anything. So, yes, we can include it. But we have not if some
of us think we don't want to provide it or it's too risky at this stage. I'm
happy with both: comitting in 1.3b7-dev or 1.3.1-dev.  The decision should be
done by others....

Comments?
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Index: src/CHANGES
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/src/CHANGES,v
retrieving revision 1.806
diff -u -r1.806 CHANGES
--- CHANGES	1998/05/02 11:15:07	1.806
+++ CHANGES	1998/05/02 20:21:07
@@ -1,5 +1,11 @@
 Changes with Apache 1.3b7
 
+  *) Add a tiny but nevertheless useful goody to APACI's configure script: The
+     generation of a config.status script (as GNU Autoconf does) which
+     remembers the used configure command and hence can be used to restore the
+     configuration by just re-running this script.
+     [Ralf S. Engelschall]
+
   *) PORT: Various porting changes to support AIX 3.2, 4.1.5, 4.2 and 4.3.
      Additionally the checks for finding the vendor DSO library were moved
      from mod_so.c to Configure because first it needs $PLAT etc. and second
Index: configure
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/configure,v
retrieving revision 1.22
diff -u -r1.22 configure
--- configure	1998/04/27 13:00:59	1.22
+++ configure	1998/05/02 20:15:24
@@ -234,6 +234,43 @@
 done
 IFS="$OIFS"
 
+#   create config.status script for restoring
+#   the configuration via simple script
+rm -f config.status 2>/dev/null
+echo "#!/bin/sh" >config.status
+echo "##" >>config.status
+echo "##  config.status -- APACI auto-generated configuration restore script" >>config.status
+echo "##" >>config.status
+echo "##  Use this shell script to re-run the APACI configure script for" >>config.status
+echo "##  restoring your configuration. Additional parameters can be supplied." >>config.status
+echo "##" >>config.status
+echo "" >>config.status
+for var in CC OPTIM CFLAGS CFLAGS_SHLIB LDFLAGS LDFLAGS_SHLIB \
+           LDFLAGS_SHLIB_EXPORT LIBS INCLUDES RANLIB; do
+    eval "val=\$$var"
+    if [ ".$val" != . ]; then
+        echo "$var=$val" |\
+        sed -e 's:\(["$\\]\):\\\1:g' \
+            -e "s:\([A-Z]*=\):\\1\":" \
+            -e "s:\$:\" \\\\:" >>config.status
+    fi
+done
+if [ $# -eq 0 ]; then
+    echo "./configure" >>config.status
+else
+    echo "./configure \\" >>config.status
+    for arg
+    do
+        echo "$arg" |\
+        sed -e 's:\(["$\\]\):\\\1:g' \
+            -e "s:^:\":" \
+            -e "s:\$:\" \\\\:" >>config.status
+    done
+fi
+echo "\$*" >>config.status
+echo "" >>config.status
+chmod a+x config.status
+
 ##
 ##  parse argument line options
 ##
Index: Makefile.tmpl
===================================================================
RCS file: /e/apache/REPOS/apache-1.3/Makefile.tmpl,v
retrieving revision 1.29
diff -u -r1.29 Makefile.tmpl
--- Makefile.tmpl	1998/04/27 13:01:00	1.29
+++ Makefile.tmpl	1998/05/02 20:17:53
@@ -441,6 +441,7 @@
 	-$(RM) $(SRC)/apaci
 	@$(RM) $(SRC)/.apaci.build.ok
 	-$(RM) Makefile
+	-$(RM) config.status
 
 #   clean the standard stuff
 distclean-std:

Re: [PATCH] config.status

Posted by Martin Kraemer <Ma...@mch.sni.de>.
On Sat, May 02, 1998 at 11:30:29PM +0200, Ralf S. Engelschall wrote:
> I've no strong opinion if we should include this little goody in 1.3b7-dev now
> or keep it for 1.3.1-dev (next feature cycle). Hmmm... although it is a
> feature it is a very little one and would make no harm to us because it
> doesn't change anything.

Include now. Breaks nothing, leverages frustration when the "old command line"
has to be re-invented. I missed it already.
  +1 from here.

    Martin
-- 
| S I E M E N S |  <Ma...@mch.sni.de>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

Re: [PATCH] config.status

Posted by Brian Behlendorf <br...@hyperreal.org>.
At 10:30 PM 5/2/98 +0200, you wrote:
>config.status

Let's leave it for 1.3.1.

	Brian


--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
pure chewing satisfaction                                  brian@apache.org
                                                        brian@hyperreal.org