[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for argument quoting when invoking sub-configures.
From: |
Tim Van Holder |
Subject: |
Patch for argument quoting when invoking sub-configures. |
Date: |
Mon, 15 Jan 2001 19:17:48 +0100 |
The patch below quotes the adjusted --srcdir and --cache-file options
we pass to sub-configures, just as they are quoted for use in
config.status.
Note that the situation where cache-file or srcdir are quoted will
currently result in them being passed _twice_ to the sub-configure,
as the case structure at the start of _AC_OUTPUT_SUBDIRS won't match
'--srcdir=* or '--cache-file=*'.
2001-01-15 Tim Van Holder <address@hidden>
* acgeneral.m4 (_AC_OUTPUT_SUBDIRS): If necessary, quote the --srcdir
and --cache-file options we add when running sub-configures.
diff -u -r --new-file --show-function-line='^[A-Za-z_]'
autoconf-2.49b.gnu/acgeneral.m4 autoconf-2.49b/acgeneral.m4
--- autoconf-2.49b.gnu/acgeneral.m4 Wed Dec 6 14:44:12 2000
+++ autoconf-2.49b/acgeneral.m4 Sun Jan 7 01:32:34 2001
@@ -4661,9 +4755,9 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
# Check for guested configure; otherwise get Cygnus style configure.
if test -f $ac_sub_srcdir/configure.gnu; then
- ac_sub_configure="$SHELL $ac_sub_srcdir/configure.gnu"
+ ac_sub_configure="$SHELL '$ac_sub_srcdir/configure.gnu'"
elif test -f $ac_sub_srcdir/configure; then
- ac_sub_configure="$SHELL $ac_sub_srcdir/configure"
+ ac_sub_configure="$SHELL '$ac_sub_srcdir/configure'"
elif test -f $ac_sub_srcdir/configure.in; then
ac_sub_configure=$ac_configure
else
@@ -4686,9 +4780,26 @@ AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
esac
])dnl
- AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args
--cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir])
+ # Since we're fabricating the --srcdir option, quote it like
+ # like we normally would.
+ case $ac_sub_srcdir in
+[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
+ ac_sub_srcdir=`echo "$ac_sub_srcdir" | sed "s/'/'\\\\\\\\''/g"`
+ ac_sub_srcdir_opt="'--srcdir=$ac_sub_srcdir'" ;;
+ *) ac_sub_srcdir_opt="--srcdir=$ac_sub_srcdir" ;;
+ esac
+
+ # Same goes for --cache-file
+ case $ac_sub_cache_file in
+[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
+ ac_sub_cache_file=`echo "$ac_sub_cache_file" | sed "s/'/'\\\\\\\\''/g"`
+ ac_sub_cache_opt="'--cache-file=$ac_sub_cache_file'" ;;
+ *) ac_sub_cache_opt="--cache-file=$ac_sub_cache_file" ;;
+ esac
+
+ AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args
$ac_sub_srcdir_opt $ac_sub_cache_opt])
# The eval makes quoting arguments work.
- if eval $ac_sub_configure $ac_sub_configure_args
--cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ if eval $ac_sub_configure $ac_sub_configure_args $ac_sub_srcdir_opt
$ac_sub_cache_opt
then :
else
AC_MSG_ERROR([$ac_sub_configure failed for $ac_subdir])
- Patch for argument quoting when invoking sub-configures.,
Tim Van Holder <=