[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: |
Fri, 26 May 2006 15:33:22 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Stepan Kasal <address@hidden> writes:
> It was probably a mistake that I haven't tried harder to review the
> patch, sorry.
No problem. I reviewed it myself, took your and Ralf's comments into
account, and installed the following slightly-more-conservative and
better-documented patch.
Getting the 'eval' stuff under control ought to be fairly high
priority, as otherwise arbitrary shell commands might be executed
inadvertently.
2006-05-26 Paul Eggert <address@hidden>
* NEWS: Mention that AC_TRY_COMMAND and AC_TRY_EVAL may be removed.
* doc/autoconf.texi (Special Chars in Variables): New section.
(Preset Output Variables): Warn about special chars in CPPFLAGS.
(Installation Directory Variables): Quote $(datadir) better.
(Limitations of Builtins): Describe some of eval's trickiness.
* lib/autoconf/c.m4 (AC_PROG_CC_C_O): Simplify quoting.
* lib/autoconf/fortram.m4 (_AC_PROG_FC_V_OUTPUT): Likewise.
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Put leading space
in front of every arg, not just trailing args. Quote apostrophes.
(_AC_EVAL_ECHO): New macro.
(_AC_EVAL, AC_EVAL_STDERR): Use it. Quote arg of eval.
(AC_TRY_EVAL, AC_TRY_COMMAND): Mention that these macros might get
removed.
(_AC_LINK_IFELSE): Use proper rule for shell continuation lines,
exposed by quoting of eval argument. Put the command on line line
so it logs better.
* lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF): Use eval more safely.
(_AC_PATH_X, AC_PATH_X): Quote more safely.
* lib/autoconf/programs.m4 (AC_PROG_MAKE_SET): Use eval more safely.
* lib/autoconf/specific.m4 (AC_SYS_LONG_FILE_NAMES): Don't use eval.
* lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS): Minor style change.
Handle special chars in prefix, ac_srcdir, ac_aux_dir.
Use eval more safely.
(_AC_OUTPUT_CONFIG_STATUS): Adjust to above changes.
* lib/m4sugar/m4sh.m4 (AS_VAR_GET): Note that this API needs
to be replaced.
* tests/base.at (AC_TRY_COMMAND): Use proper rule for shell continuation
lines, exposed by quoting of eval argument.
Index: NEWS
===================================================================
RCS file: /cvsroot/autoconf/autoconf/NEWS,v
retrieving revision 1.372
diff -p -u -r1.372 NEWS
--- NEWS 22 May 2006 15:54:09 -0000 1.372
+++ NEWS 26 May 2006 22:28:17 -0000
@@ -1,5 +1,9 @@
* Major changes in Autoconf 2.59d
+** AC_TRY_COMMAND, AC_TRY_EVAL
+ These never-documented macros have been marked with a comment
+ saying that they may be removed in a future release.
+
** ac_config_guess, ac_config_sub, ac_configure
These never-documented variables have been marked with a comment
saying that we intend to remove them in a future release.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1025
diff -p -u -r1.1025 autoconf.texi
--- doc/autoconf.texi 26 May 2006 17:25:36 -0000 1.1025
+++ doc/autoconf.texi 26 May 2006 22:28:18 -0000
@@ -410,6 +410,7 @@ Results of Tests
* Defining Symbols:: Defining C preprocessor symbols
* Setting Output Variables:: Replacing variables in output files
+* Special Chars in Variables:: Characters to beware of in variables
* Caching Results:: Speeding up subsequent @command{configure} runs
* Printing Messages:: Notifying @command{configure} users
@@ -2219,6 +2220,8 @@ miscellaneous options for the C and C++
it is not set in the environment when @command{configure} runs, the default
value is empty. @command{configure} uses this variable when compiling or
preprocessing programs to test for C and C++ features.
address@hidden Chars in Variables}, for limitations that @code{CPPFLAGS}
+might run into.
@end defvar
@defvar CXXFLAGS
@@ -2520,7 +2523,8 @@ Makefiles. For instance, instead of try
in @file{configure} and hard-coding it in Makefiles using
e.g., @samp{AC_DEFINE_UNQUOTED([DATADIR], ["$datadir"], [Data directory.])},
you should add
address@hidden"$(datadir)"} to your @code{CPPFLAGS}.
address@hidden'$(datadir)'} to your Makefile's definition of
address@hidden (@code{AM_CPPFLAGS} if you are also using Automake).
Similarly, you should not rely on @code{AC_CONFIG_FILES} to replace
@code{datadir} and friends in your shell scripts and other files, rather
@@ -7889,6 +7893,7 @@ print a message letting the user know th
@menu
* Defining Symbols:: Defining C preprocessor symbols
* Setting Output Variables:: Replacing variables in output files
+* Special Chars in Variables:: Characters to beware of in variables
* Caching Results:: Speeding up subsequent @command{configure} runs
* Printing Messages:: Notifying @command{configure} users
@end menu
@@ -8137,6 +8142,35 @@ running /bin/sh ./configure undeclared_v
@end itemize
@end defmac
address@hidden Special Chars in Variables
address@hidden Special Characters in Output Variables
address@hidden Output variables, special characters in
+
+Many output variables are intended to be evaluated both by
address@hidden and by the shell. Some characters are expanded
+differently in these two contexts, so to avoid confusion these
+variables' values should not contain any of the following characters:
+
address@hidden
+" # $ & ' ( ) * ; < > ? [ \ ^ ` |
address@hidden example
+
+Also, these variables' values should neither contain newlines, nor start
+with @samp{~}, nor contain white space or @samp{:} immediately followed
+by @samp{~}. The values can contain nonempty sequences of white space
+characters like tabs and spaces, but each such sequence might
+arbitrarily be replaced by a single space during substitution.
+
+These restrictions apply both to the values that @command{configure}
+computes, and to the values set directly by the user. For example, the
+following invocations of @command{configure} are problematic, since they
+attempt to use special characters within @code{CPPFLAGS}:
+
address@hidden
+CPPFLAGS='-DOUCH="&\"#$*?"' ./configure
+
+./configure CPPFLAGS='-DOUCH="&\"#$*?"'
address@hidden example
@node Caching Results
@section Caching Results
@@ -10905,12 +10939,12 @@ the following:
@end example
Also, file names should not begin with @samp{~} or @samp{-}, and should
-not contain @samp{-} immediately after @samp{/}.
+contain neither @samp{-} immediately after @samp{/} nor @samp{~}
+immediately after @samp{:}.
These restrictions apply not only to the files that you distribute, but
also to the absolute file names of your source, build, and destination
-directories. Autoconf-generated @command{configure} scripts warn of
-violations to the above restrictions.
+directories.
On some Posix-like platforms, @samp{!} and @samp{^} are special too, so
they should be avoided.
@@ -11958,6 +11992,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, @command{eval} 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 valid, @samp{eval $cmd} might not work as intended,
+since it causes field splitting and file name expansion to occur twice,
+once for the @command{eval} and once for the command itself. It is
+therefore safer to use @samp{eval "$cmd"}. For example, if @var{cmd}
+has the value @samp{cat test?.c}, @samp{eval $cmd} might expand to the
+equivalent of @samp{cat test;.c} if there happens to be a file named
address@hidden;.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
address@hidden "$cmd"} rather than @samp{eval $cmd}.
+
+However, suppose that you want to output the text of the evaluated
+command just before executing it. Assuming the previous example,
address@hidden "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.227
diff -p -u -r1.227 c.m4
--- lib/autoconf/c.m4 26 May 2006 17:23:02 -0000 1.227
+++ lib/autoconf/c.m4 26 May 2006 22:28:18 -0000
@@ -666,7 +666,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.208
diff -p -u -r1.208 fortran.m4
--- lib/autoconf/fortran.m4 26 May 2006 17:23:02 -0000 1.208
+++ lib/autoconf/fortran.m4 26 May 2006 22:28:18 -0000
@@ -527,8 +527,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 26 May 2006 22:28:18 -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
@@ -2140,33 +2143,58 @@ 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 If the string contains '${', '"', '`', or '\', then escape
+dnl $, ", `, and \. This is a hack, but it is safe and it also
+dnl typically expands substrings like '$CC', which is what we want.
+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.
+# This macro is dangerous, and should not be used outside Autoconf, since not
+# every shell command will work due to problems with eval and quoting,
+# and the rules for exactly what does work are tricky.
+# This macro may be removed in a future release.
AC_DEFUN([AC_TRY_EVAL],
[_AC_EVAL([$$1])])
# AC_TRY_COMMAND(COMMAND)
# -----------------------
+# Like AC_TRY_EVAL, but execute the string COMMAND instead.
+# This macro is dangerous, and should not be used outside Autoconf, since not
+# every shell command will work due to problems with eval and quoting,
+# and the rules for exactly what does work are tricky.
+# This macro may be removed in a future release.
AC_DEFUN([AC_TRY_COMMAND],
[{ ac_try='$1'
_AC_EVAL([$ac_try]); }])
@@ -2278,8 +2306,7 @@ 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 +2346,7 @@ 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 26 May 2006 22:28:18 -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 26 May 2006 22:28:18 -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 26 May 2006 22:28:18 -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 26 May 2006 22:28:18 -0000
@@ -930,7 +930,7 @@ 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
@@ -966,7 +966,11 @@ if test "$no_recursion" != yes; then
# Always prepend --prefix to ensure using the same prefix
# in subdir configurations.
- ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
+ ac_arg="--prefix=$prefix"
+ case $ac_arg in
+ *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ ac_sub_configure_args="$ac_arg $ac_sub_configure_args"
ac_popdir=`pwd`
for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
@@ -985,12 +989,12 @@ 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_sub_configure=$ac_srcdir/configure.gnu
elif test -f "$ac_srcdir/configure"; then
- ac_sub_configure="$SHELL '$ac_srcdir/configure'"
+ 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_sub_configure=$ac_aux_dir/configure
else
AC_MSG_WARN([no configuration information is in $ac_dir])
ac_sub_configure=
@@ -1005,9 +1009,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])
+ AC_MSG_NOTICE([running $SHELL $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 \
+ eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
--cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
fi
@@ -1213,7 +1217,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 +1305,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 26 May 2006 22:28:19 -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 26 May 2006 22:28:19 -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 26 May 2006 22:28:19 -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
- Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/25
- Re: Debian-specific Autoconf patches, Paul Eggert, 2006/05/25
- 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 <=
- 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
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/30
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/30
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/30
- Re: Debian-specific Autoconf patches, Ralf Wildenhues, 2006/05/30