This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[toplevel] Fix quoting of TOPLEVEL_CONFIGURE_ARGUMENTS
- From: Richard Sandiford <richard at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: binutils at sourceware dot org
- Date: Wed, 21 Mar 2007 19:26:06 +0000
- Subject: [toplevel] Fix quoting of TOPLEVEL_CONFIGURE_ARGUMENTS
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'/"` ;;