]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
More than one argument to `configure' builds a broken
authorAkim Demaille <akim@epita.fr>
Mon, 22 May 2000 08:05:40 +0000 (08:05 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 22 May 2000 08:05:40 +0000 (08:05 +0000)
`config.status'.  Fix and test.

* acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Use
`$ac_configure_args' directly, no via a tmp variable.
* tests/torture.m4 (command line interface): Test with more than
one argument.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
tests/torture.m4

index e497cbc1a9be0ef2b43be2d71c90e5672cd2467a..b92e00d27132c4eeb85d38e7c325b27f8900daff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-05-22  Akim Demaille  <akim@epita.fr>
+
+       More than one argument to `configure' builds a broken
+       `config.status'.  Fix and test.
+
+       * acgeneral.m4 (_AC_OUTPUT_CONFIG_STATUS): Use
+       `$ac_configure_args' directly, no via a tmp variable.
+       * tests/torture.m4 (command line interface): Test with more than
+       one argument.
+
 2000-05-19  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (AC_MSG_WARN): s/warning/WARNING/.
index 491804fcff6dc87bebf3b131e26ada5417e943dc..a8ec73aca661c7ef0d6e6806c198cedceefbe07f 100644 (file)
@@ -3857,19 +3857,14 @@ AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
 # shells die.  Unfortunately the limit is not known precisely...
 define([_AC_OUTPUT_CONFIG_STATUS],
 [echo creating $CONFIG_STATUS
-cat >$CONFIG_STATUS <<EOF
+cat >$CONFIG_STATUS <<\EOF
 #! /bin/sh
 # Generated automatically by configure.
 # Run this file to recreate the current configuration.
 # Compiler output produced by configure, useful for debugging
 # configure, is in ./config.log if it exists.
 
-configure=$[0]
-configure_args=$ac_configure_args
 debug=false
-EOF
-
-cat >>$CONFIG_STATUS <<\EOF
 me=`echo "$[0]" | sed -e 's,.*/,,'`
 SHELL=${CONFIG_SHELL-/bin/sh}
 
@@ -3930,12 +3925,12 @@ Report bugs to <bug-autoconf@gnu.org>."
 EOF
 
 dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-dnl so uname gets run too.
+dnl so uname gets run too.  Use two double quotes for font-lock.
 cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 $CONFIG_STATUS generated by autoconf version AC_ACVERSION.
 Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
-  $configure $configure_arg"
+  `echo "[$]0 $ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
 
 ac_given_srcdir=$srcdir
 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
@@ -3966,15 +3961,14 @@ do
   esac
 
   case "$[1]" in
-
   # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-dnl The following line is extremely suspicious: there are double quotes
-dnl inside a "`...`" (which is not portable).  But it is actually safe,
-dnl since we are in an unquoted here doc, which will skip the outer pair
-dnl of double quotes, and only eval the back quotes.
-    echo "running $SHELL $configure $configure_args --no-create --no-recursion"
-    exec $SHELL $configure $configure_args --no-create --no-recursion ;;
+    echo "running $SHELL $[0] " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $[0] $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
index 491804fcff6dc87bebf3b131e26ada5417e943dc..a8ec73aca661c7ef0d6e6806c198cedceefbe07f 100644 (file)
@@ -3857,19 +3857,14 @@ AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
 # shells die.  Unfortunately the limit is not known precisely...
 define([_AC_OUTPUT_CONFIG_STATUS],
 [echo creating $CONFIG_STATUS
-cat >$CONFIG_STATUS <<EOF
+cat >$CONFIG_STATUS <<\EOF
 #! /bin/sh
 # Generated automatically by configure.
 # Run this file to recreate the current configuration.
 # Compiler output produced by configure, useful for debugging
 # configure, is in ./config.log if it exists.
 
-configure=$[0]
-configure_args=$ac_configure_args
 debug=false
-EOF
-
-cat >>$CONFIG_STATUS <<\EOF
 me=`echo "$[0]" | sed -e 's,.*/,,'`
 SHELL=${CONFIG_SHELL-/bin/sh}
 
@@ -3930,12 +3925,12 @@ Report bugs to <bug-autoconf@gnu.org>."
 EOF
 
 dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-dnl so uname gets run too.
+dnl so uname gets run too.  Use two double quotes for font-lock.
 cat >>$CONFIG_STATUS <<EOF
 ac_cs_version="\\
 $CONFIG_STATUS generated by autoconf version AC_ACVERSION.
 Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
-  $configure $configure_arg"
+  `echo "[$]0 $ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`"
 
 ac_given_srcdir=$srcdir
 AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
@@ -3966,15 +3961,14 @@ do
   esac
 
   case "$[1]" in
-
   # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-dnl The following line is extremely suspicious: there are double quotes
-dnl inside a "`...`" (which is not portable).  But it is actually safe,
-dnl since we are in an unquoted here doc, which will skip the outer pair
-dnl of double quotes, and only eval the back quotes.
-    echo "running $SHELL $configure $configure_args --no-create --no-recursion"
-    exec $SHELL $configure $configure_args --no-create --no-recursion ;;
+    echo "running $SHELL $[0] " $ac_configure_args " --no-create --no-recursion"
+    exec $SHELL $[0] $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
   --version | --vers* | -V )
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
index 9d5416e22496fac6ead47089c26da4be50e646c1..3fe3140e72ad16f7e45ef7a624b7e291c7d94e20 100644 (file)
@@ -103,33 +103,35 @@ AT_CLEANUP(dummy)
 ## interface.                                             ##
 ## ------------------------------------------------------ ##
 
-# We run `./configure result=val' and verify that (i) `configure'
-# correctly receives `val' and (ii) correctly passes it to
-# `config.status', which we check by running `config.status --recheck'
-# (which *must* preserve the value of `result').
+# We run `./configure one=val1 --enable-two=val2 --with-three=val3'
+# and verify that (i) `configure' correctly receives the arguments and
+# (ii) correctly passes them to `config.status', which we check by
+# running `config.status --recheck'.
 
 AT_SETUP(command line interface)
 
 AT_DATA(configure.in,
 [[AC_INIT
-echo "result=$result"
+echo "result=$one$enable_two$with_three"
 AC_OUTPUT
 ]])
 
 AT_CHECK([../autoconf -m .. -l $at_srcdir], 0,, ignore)
 
-AT_CHECK([./configure result=result | sed -n -e 's/^result=//p'], 0,
-         [result
+AT_CHECK([./configure one=one --enable-two=two --with-three=three |
+          sed -n -e 's/^result=//p'], 0,
+         [onetwothree
 ], ignore)
 AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
-         [result
+         [onetwothree
 ], ignore)
 
-AT_CHECK([./configure result="\"'$" | sed -n -e 's/^result=//p'], 0,
-         ["'$
+AT_CHECK([./configure one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
+          sed -n -e 's/^result=//p'], 0,
+         ["'$ " ' $ "'$
 ], ignore)
 AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
-         ["'$
+         ["'$ " ' $ "'$
 ], ignore)
 
 AT_CLEANUP(configure config.status config.log config.cache)