[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Debian-specific Autoconf patches
From: |
Paul Eggert |
Subject: |
Re: Debian-specific Autoconf patches |
Date: |
Thu, 25 May 2006 09:57:02 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Ralf Wildenhues <address@hidden> writes:
> - Was this one fixing a bug, or just for nicer config.log output?
It's definitely a bug. I have fixed it myself, independently, in a
patch I finished preparing yesterday but have not had time to install
yet. The issues are fairly subtle here, but the underyling problem is
that Autoconf's use of 'eval' is unsafe in several places.
Here's a heads-up on the patch, to give you a feeling for what's needed.
I still need to add some comments and ChangeLog entries and whatnot.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1021
diff -p -u -r1.1021 autoconf.texi
--- doc/autoconf.texi 22 May 2006 17:27:50 -0000 1.1021
+++ doc/autoconf.texi 25 May 2006 16:54:57 -0000
@@ -11955,6 +11955,36 @@ EOF
@item @command{eval}
@c -----------------
@prindex @command{eval}
+The @command{eval} command is useful in limited circumstances, e.g.,
+using commands like @samp{eval table_$key=\$value} and @samp{eval
+value=table_$key} to simulate a hash table when the key is known to be
+alphanumeric. However, it is tricky to use on arbitrary arguments, even
+when it is implemented correctly.
+
+It is obviously unwise to use @samp{eval $cmd} if the string value of
address@hidden was derived from an untrustworthy source. But even if the
+string value is known to be valid, @samp{eval $cmd} might not work as
+intended, since it causes globbing to occur twice, once for the
address@hidden and once for the command itself. It is therefore safer
+to use @samp{eval "$cmd"}. For example, if @var{cmd} has the value
address@hidden test?.c}, @samp{eval $cmd} might expand to the equivalent of
address@hidden test;.c} if there happens to be a file named @file{test;.c} in
+the current directory; and this in turn will mistakenly attempt to
+invoke @command{cat} on the file @file{test} and then execute the
+command @command{.c}. To avoid this problem, use @samp{eval "$cmd"}
+rather than @samp{eval $cmd}.
+
+However, suppose that you want to output the text of the command just
+before executing it. Assuming the previous example, @samp{echo
+"Executing: $cmd"} outputs @samp{Executing: cat test?.c}, but this
+output doesn't show the user that @samp{test;.c} is the actual name of
+the copied file. Conversely, @samp{eval "echo Executing: $cmd"} will
+work on this example, but it will fail with @samp{cmd='cat foo >bar'},
+since it will mistakenly replace the contents of @file{bar} by the
+string @samp{cat foo}. No simple, general, and portable solution to
+this problem is known.
+
+You should also be wary of common bugs in @command{eval} implementations.
In some shell implementations (e.g., older @command{ash}, address@hidden 3.8
@command{sh}, @command{pdksh} v5.2.14 99/07/13.2, and @command{zsh}
4.2.5), the arguments of @samp{eval} are evaluated in a context where
Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.226
diff -p -u -r1.226 c.m4
--- lib/autoconf/c.m4 20 May 2006 15:49:27 -0000 1.226
+++ lib/autoconf/c.m4 25 May 2006 16:54:57 -0000
@@ -665,7 +665,7 @@ else
fi
rm -f conftest*
])dnl
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
Index: lib/autoconf/fortran.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/fortran.m4,v
retrieving revision 1.207
diff -p -u -r1.207 fortran.m4
--- lib/autoconf/fortran.m4 20 May 2006 05:39:03 -0000 1.207
+++ lib/autoconf/fortran.m4 25 May 2006 16:54:57 -0000
@@ -526,8 +526,9 @@ AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# flags.
ac_save_FFLAGS=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS m4_default([$1],
[$ac_cv_prog_[]_AC_LANG_ABBREV[]_v])"
-eval ac_link_cmd=\"$ac_link\"
-_AS_ECHO_LOG([$ac_link_cmd])
+eval "set x $ac_link"
+shift
+_AS_ECHO_LOG([$[*]])
ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 |
grep -v 'Driving:'`
echo "$ac_[]_AC_LANG_ABBREV[]_v_output" >&AS_MESSAGE_LOG_FD
_AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.919
diff -p -u -r1.919 general.m4
--- lib/autoconf/general.m4 22 May 2006 15:54:09 -0000 1.919
+++ lib/autoconf/general.m4 25 May 2006 16:54:57 -0000
@@ -1145,7 +1145,6 @@ m4_define([_AC_INIT_PREPARE],
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
-ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -1184,9 +1183,7 @@ dnl exit don't matter.
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
+ ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
@@ -1217,6 +1214,9 @@ trap 'exit_status=$?
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
@@ -1227,6 +1227,9 @@ trap 'exit_status=$?
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
echo "$ac_var='\''$ac_val'\''"
done | sort
echo
@@ -1501,7 +1504,7 @@ for ac_var in $ac_precious_vars; do
*\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
- case " $ac_configure_args " in
+ case "$ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
esac
@@ -2140,25 +2143,40 @@ AC_DEFUN([_AC_RUN_LOG_STDERR],
_AS_ECHO_LOG([\$? = $ac_status])
(exit $ac_status); }])
+# _AC_EVAL_ECHO(COMMAND)
+# ----------------------
+# Echo COMMAND. This is designed to be used just before evaluating COMMAND.
+AC_DEFUN([_AC_EVAL_ECHO],
+[m4_if([$1], [$ac_try], [], [ac_try="$1"
+])dnl
+dnl Expand $, but escape ", `, and \.
+dnl This is a hack, but it matches previous practice.
+case $ac_try in #(
+ *\"* | *\`* | *\\*)
+ ac_script='s/[["`\\]]/\\&/g'
+ ac_try=`echo "$ac_try" | sed "$ac_script"` ;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try\""])
# _AC_EVAL(COMMAND)
# -----------------
# Eval COMMAND, save the exit status in ac_status, and log it.
AC_DEFUN([_AC_EVAL],
-[_AC_RUN_LOG([eval $1],
- [eval echo "$as_me:$LINENO: \"$1\""])])
+[_AC_RUN_LOG([eval "$1"],
+ [_AC_EVAL_ECHO([$1])])])
# _AC_EVAL_STDERR(COMMAND)
# ------------------------
# Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
AC_DEFUN([_AC_EVAL_STDERR],
-[_AC_RUN_LOG_STDERR([eval $1],
- [eval echo "$as_me:$LINENO: \"$1\""])])
+[_AC_RUN_LOG_STDERR([eval "$1"],
+ [_AC_EVAL_ECHO([$1])])])
# AC_TRY_EVAL(VARIABLE)
# ---------------------
+# Evaluate $VARIABLE, which should be a valid shell command.
# The purpose of this macro is to "configure:123: command line"
# written into config.log for every test run.
AC_DEFUN([AC_TRY_EVAL],
@@ -2167,8 +2185,9 @@ AC_DEFUN([AC_TRY_EVAL],
# AC_TRY_COMMAND(COMMAND)
# -----------------------
+# Like AC_TRY_EVAL, but execute the string COMMAND instead.
AC_DEFUN([AC_TRY_COMMAND],
-[{ ac_try='$1'
+[{ ac_try='m4_bpatsubst([$1], ['], ['\\''])'
_AC_EVAL([$ac_try]); }])
@@ -2278,8 +2297,8 @@ m4_define([_AC_COMPILE_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext
AS_IF([_AC_EVAL_STDERR($ac_compile) &&
- AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag"
- || test ! -s conftest.err]) &&
+ AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err]) &&
AC_TRY_COMMAND([test -s conftest.$ac_objext])],
[$2],
[_AC_MSG_LOG_CONFTEST
@@ -2319,8 +2338,8 @@ m4_define([_AC_LINK_IFELSE],
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest.$ac_objext conftest$ac_exeext
AS_IF([_AC_EVAL_STDERR($ac_link) &&
- AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag"
- || test ! -s conftest.err]) &&
+ AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err]) &&
AC_TRY_COMMAND([test -s conftest$ac_exeext])],
[$2],
[_AC_MSG_LOG_CONFTEST
Index: lib/autoconf/libs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/libs.m4,v
retrieving revision 1.16
diff -p -u -r1.16 libs.m4
--- lib/autoconf/libs.m4 19 May 2006 02:57:46 -0000 1.16
+++ lib/autoconf/libs.m4 25 May 2006 16:54:57 -0000
@@ -189,14 +189,19 @@ m4_define([_AC_PATH_X_XMKMF],
rm -f -r conftest.dir
if mkdir conftest.dir; then
cd conftest.dir
- # Make sure to not put "make" in the Imakefile rules, since we grep it out.
cat >Imakefile <<'_ACEOF'
-acfindx:
- @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}";
ac_im_libdir="${LIBDIR}"'
+incroot:
+ @echo incroot='${INCROOT}'
+usrlibdir:
+ @echo usrlibdir='${USRLIBDIR}'
+libdir:
+ @echo libdir='${LIBDIR}'
_ACEOF
if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile;
then
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
- eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ for ac_var in incroot usrlibdir libdir; do
+ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n
's/^$ac_var=//p'\`"
+ done
# Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
for ac_extension in a so sl; do
if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
@@ -313,14 +318,16 @@ AC_DEFUN([_AC_PATH_X],
ac_x_includes=no ac_x_libraries=no
_AC_PATH_X_XMKMF
_AC_PATH_X_DIRECT
-if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
- # Didn't find X anywhere. Cache the known absence of X.
- ac_cv_have_x="have_x=no"
-else
- # Record where we found X for the cache.
- ac_cv_have_x="have_x=yes \
- ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi])dnl
+case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
+ # Didn't find X, or a directory has "'" in its name.
+ ac_cv_have_x="have_x=no";; #(
+ *)
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$ac_x_includes'\
+ ac_x_libraries='$ac_x_libraries'"
+esac])dnl
])
@@ -345,12 +352,11 @@ if test "x$with_x" = xno; then
# The user explicitly disabled X.
have_x=disabled
else
- if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
- # Both variables are already set.
- have_x=yes
- else
- _AC_PATH_X
- fi
+ case $x_includes,$x_libraries in #(
+ *\'*) AC_MSG_ERROR([Cannot use X directory names containing ']);; #(
+ *,NONE | NONE,*) _AC_PATH_X;; #(
+ *) have_x=yes;;
+ esac
eval "$ac_cv_have_x"
fi # $with_x != no
@@ -362,8 +368,9 @@ else
test "x$x_includes" = xNONE && x_includes=$ac_x_includes
test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
# Update the cache value to reflect the command line values.
- ac_cv_have_x="have_x=yes \
- ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$x_includes'\
+ ac_x_libraries='$x_libraries'"
AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
fi
])# AC_PATH_X
Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.56
diff -p -u -r1.56 programs.m4
--- lib/autoconf/programs.m4 22 May 2006 16:27:09 -0000 1.56
+++ lib/autoconf/programs.m4 25 May 2006 16:54:57 -0000
@@ -764,22 +764,22 @@ AN_MAKEVAR([MAKE], [AC_PROG_MAKE_SET])
AN_PROGRAM([make], [AC_PROG_MAKE_SET])
AC_DEFUN([AC_PROG_MAKE_SET],
[AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)])
-set dummy ${MAKE-make}; ac_make=`echo "$[2]" | sed 'y,:./+-,___p_,'`
+set x ${MAKE-make}; ac_make=`echo "$[2]" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
[cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
- @echo 'ac_maketemp=X"$(MAKE)"'
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test "$ac_maketemp" != X ; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
rm -f conftest.make])dnl
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
AC_MSG_RESULT([yes])
SET_MAKE=
else
@@ -819,7 +819,7 @@ AC_DEFUN([AC_PROG_SED],
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" | sed 99q >conftest.sed
- $as_unset ac_script || ac_script=
+ $as_unset ac_script || ac_script=
_AC_PATH_PROG_FEATURE_CHECK(SED, [sed gsed],
[_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
["$ac_path_SED" -f conftest.sed])])])
Index: lib/autoconf/specific.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/specific.m4,v
retrieving revision 1.367
diff -p -u -r1.367 specific.m4
--- lib/autoconf/specific.m4 19 May 2006 02:57:46 -0000 1.367
+++ lib/autoconf/specific.m4 25 May 2006 16:54:57 -0000
@@ -209,20 +209,18 @@ AC_DEFUN([AC_SYS_LONG_FILE_NAMES],
# . the current directory, where building will happen
# $prefix/lib where we will be installing things
# $exec_prefix/lib likewise
-# eval it to expand exec_prefix.
# $TMPDIR if set, where it might want to write temporary files
-# if $TMPDIR is not set:
# /tmp where it might want to write temporary files
# /var/tmp likewise
# /usr/tmp likewise
-if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
- ac_tmpdirs=$TMPDIR
-else
- ac_tmpdirs='/tmp /var/tmp /usr/tmp'
-fi
-for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
- test -d "$ac_dir" || continue
- test -w "$ac_dir" || continue # It is less confusing to not echo anything
here.
+for ac_dir in . "$TMPDIR" /tmp /var/tmp /usr/tmp "$prefix/lib"
"$exec_prefix/lib"; do
+ # Skip $TMPDIR if it is empty or bogus, and skip $exec_prefix/lib
+ # in the usual case where exec_prefix is '${prefix}'.
+ case $ac_dir in #(
+ . | /* | ?:[[\\/]]*) ;; #(
+ *) continue;;
+ esac
+ test -w "$ac_dir/." || continue # It is less confusing to not echo anything
here.
ac_xdir=$ac_dir/cf$$
(umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
ac_tf1=$ac_xdir/conftest9012345
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.108
diff -p -u -r1.108 status.m4
--- lib/autoconf/status.m4 23 May 2006 23:30:57 -0000 1.108
+++ lib/autoconf/status.m4 25 May 2006 16:54:57 -0000
@@ -928,12 +928,12 @@ m4_define([_AC_OUTPUT_SUBDIRS],
if test "$no_recursion" != yes; then
# Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
ac_prev=
- eval set x "$ac_configure_args"
+ eval "set x$ac_configure_args"
shift
for ac_arg
do
+ shift
if test -n "$ac_prev"; then
ac_prev=
continue
@@ -957,16 +957,15 @@ if test "$no_recursion" != yes; then
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
;;
*)
- case $ac_arg in
- *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
+ set x "address@hidden" "$ac_arg"
+ shift ;;
esac
done
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
- ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
+ set x --prefix="$prefix" ${1+"address@hidden"}
+ shift
ac_popdir=`pwd`
for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
@@ -985,12 +984,14 @@ if test "$no_recursion" != yes; then
# Check for guested configure; otherwise get Cygnus style configure.
if test -f "$ac_srcdir/configure.gnu"; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
+ ac_shell=$SHELL
+ ac_sub_configure=$ac_srcdir/configure.gnu
elif test -f "$ac_srcdir/configure"; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure'"
+ ac_shell=$SHELL
+ ac_sub_configure=$ac_srcdir/configure
elif test -f "$ac_srcdir/configure.in"; then
- # This should be Cygnus configure.
- ac_sub_configure="$SHELL '$ac_aux_dir/configure'"
+ ac_shell=
+ ac_sub_configure=$ac_configure
else
AC_MSG_WARN([no configuration information is in $ac_dir])
ac_sub_configure=
@@ -1005,10 +1006,9 @@ if test "$no_recursion" != yes; then
ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
esac
- AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args
--cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
- # The eval makes quoting arguments work.
- eval "$ac_sub_configure $ac_sub_configure_args \
- --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+ AC_MSG_NOTICE([running $ac_shell $ac_sub_configure address@hidden
--cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
+ $ac_shell "$ac_sub_configure" "address@hidden" \
+ --cache-file="$ac_sub_cache_file" --srcdir="$ac_srcdir" ||
AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
fi
@@ -1213,7 +1213,7 @@ ac_cs_version="\\
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING,
- with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\"
+ with options \\"`echo "$ac_configure_args" | sed 's/^ / /;
s/[[\\""\`\$]]/\\\\&/g'`\\"
Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
@@ -1301,10 +1301,10 @@ cat >>$CONFIG_STATUS <<_ACEOF
dnl Check this before opening the log, to avoid a bug on MinGW,
dnl which prohibits the recursive instance from truncating an open log.
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $[0] " $ac_configure_args
\$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
+ echo "running CONFIG_SHELL=$SHELL $SHELL $[0] "$ac_configure_args
\$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
CONFIG_SHELL=$SHELL
export CONFIG_SHELL
- exec $SHELL "$[0]" $ac_configure_args \$ac_configure_extra_args --no-create
--no-recursion
+ exec $SHELL "$[0]"$ac_configure_args \$ac_configure_extra_args --no-create
--no-recursion
fi
_ACEOF
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.187
diff -p -u -r1.187 m4sh.m4
--- lib/m4sugar/m4sh.m4 19 May 2006 02:57:46 -0000 1.187
+++ lib/m4sugar/m4sh.m4 25 May 2006 16:54:57 -0000
@@ -1369,6 +1369,8 @@ m4_define([AS_VAR_SET],
# Get the value of the shell VARIABLE.
# Evaluates to $VARIABLE if there are no indirection in VARIABLE,
# else into the appropriate `eval' sequence.
+# FIXME: This mishandles values that end in newlines, or have backslashes,
+# or are '-n'. Fixing this will require changing the API.
m4_define([AS_VAR_GET],
[AS_LITERAL_IF([$1],
[$$1],
Index: tests/base.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/base.at,v
retrieving revision 1.35
diff -p -u -r1.35 base.at
--- tests/base.at 6 Jul 2005 17:01:52 -0000 1.35
+++ tests/base.at 25 May 2006 16:54:57 -0000
@@ -212,16 +212,16 @@ AT_DATA([configure.ac],
[[AC_INIT
if AC_TRY_COMMAND([(echo "The Cat in the Hat";
- echo "The Hat in the Cat" >&2)
- | grep \^The\ Cat\ in\ the\ Hat\$ >/dev/null]); then
+ echo "The Hat in the Cat" >&2) |
+ grep \^The\ Cat\ in\ the\ Hat\$ >/dev/null]); then
:
else
AC_MSG_ERROR([Didn't see the Cat in the Hat!])
fi
if AC_TRY_COMMAND([(echo "The Cat in the Hat";
- echo "The Hat in the Cat" >&2)
- | grep \^The\ Hat\ in\ the\ Cat\$ >/dev/null]); then
+ echo "The Hat in the Cat" >&2) |
+ grep \^The\ Hat\ in\ the\ Cat\$ >/dev/null]); then
AC_MSG_ERROR([Saw the Hat in the Cat!])
fi
]])
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.62
diff -p -u -r1.62 torture.at
--- tests/torture.at 17 May 2006 02:20:15 -0000 1.62
+++ tests/torture.at 25 May 2006 16:54:58 -0000
@@ -1,6 +1,6 @@
# -*- Autotest -*-
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -1020,3 +1020,35 @@ AT_CHECK([autoreconf -Wall -v -i], 0, [i
AT_CHECK([test -f HeeHee.in])
AT_CLEANUP
+
+
+## ----------------------------------------------------------- ##
+## AC_CONFIG_SUBDIRS and special characters in precious vars. ##
+## ----------------------------------------------------------- ##
+
+AT_SETUP([AC_CONFIG_SUBDIRS and special characters in precious vars])
+AT_KEYWORDS([autoreconf])
+
+mkdir sub
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_PROG_CC
+AC_CONFIG_SUBDIRS([sub])
+AC_OUTPUT
+]])
+
+AT_DATA([sub/configure.ac],
+[[AC_INIT
+AC_PROG_CC
+]])
+
+echo fake > install-sh
+
+AT_CHECK([autoreconf -Wall -v -i], [0], [ignore], [ignore])
+AT_CHECK(
+ [CFLAGS="-O2 -Da='b' -Db=\"!\\\"#\\\$x&'()*;<=>?[\\\\]^\\\`{|}~\"" \
+ ./configure -C],
+ [0], [ignore])
+
+AT_CLEANUP
- Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/25
- Re: Debian-specific Autoconf patches,
Paul Eggert <=
- Re: Debian-specific Autoconf patches, Stepan Kasal, 2006/05/26
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/26
- Re: Debian-specific Autoconf patches, Stepan Kasal, 2006/05/26
- Re: Debian-specific Autoconf patches, Paul Eggert, 2006/05/26
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/27
- Re: Debian-specific Autoconf patches, Paul Eggert, 2006/05/27
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/29
- Re: Debian-specific Autoconf patches, Paul Eggert, 2006/05/30
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/30
- Re: Debian-specific Autoconf patches, Paul Eggert, 2006/05/30