[toplevel] Fix quoting of TOPLEVEL_CONFIGURE_ARGUMENTS

Richard Sandiford richard@codesourcery.com
Wed Mar 21 19:26:00 GMT 2007


The top-level configure stores a copy of the original arguments
in TOPLEVEL_CONFIGURE_ARGUMENTS, which is then used for things
like gcc --verbose.  AIUI, you're supposed to be able to cut-&-paste
the gcc --verbose and use them as configure arguments in another build.

The code seems to be based on the autoconf 2.5x ac_configure_args code,
but I noticed two problems: (1) the glob isn't m4-quoted, so ends up
in configure without the square brackets; and (2) unlike the autoconf
version, it doesn't treat single quotes a special character.

Fixed with the patch below.  Bootstrapped & regression-tested
on x86_64-linux-gnu.  OK to install?

(I've included the auto-generated output too to show the effect
of the m4 quoting fix.)

Richard


	* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix m4 quoting
	of glob.  Quote arguments with single quotes too.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 123107)
+++ configure.ac	(working copy)
@@ -92,7 +92,7 @@ set -- "$progname" "$@"
 for ac_arg
 do
   case "$ac_arg" in
-  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  *" "*|*"	"*|*[[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']]*)
     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
     # if the argument is of the form -foo=baz, quote the baz part only
     ac_arg=`echo "'$ac_arg'" | sed "s/^'\([[-a-zA-Z0-9]]*=\)/\\1'/"` ;;
Index: configure
===================================================================
--- configure	(revision 123107)
+++ configure	(working copy)
@@ -1768,7 +1768,7 @@ set -- "$progname" "$@"
 for ac_arg
 do
   case "$ac_arg" in
-  *" "*|*"	"*|*\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?*)
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']*)
     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
     # if the argument is of the form -foo=baz, quote the baz part only
     ac_arg=`echo "'$ac_arg'" | sed "s/^'\([-a-zA-Z0-9]*=\)/\\1'/"` ;;



More information about the Binutils mailing list