+2007-10-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Fix `configure --help=recursive' in unconfigured/read-only trees.
+ * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): Avoid errors when `.'
+ is not writable, use 'cp -p' in this case, in the hope that it
+ will not actually be needed. Still try removing files, in case
+ of other write errors.
+ * lib/autoconf/general.m4 (_AC_INIT_SRCDIR): For ac_confdir,
+ use $as_myself, not $0.
+ (_AC_INIT_HELP): For --help=recursive, if the subdir does not
+ exist, try again in the the source tree. This change assumes
+ that the subpackage configure script is capable of running
+ --help=recursive in the source tree.
+ * tests/torture.at (Configuring subdirectories, Deep Package):
+ Adjust tests to expose both issues, also try invocation as
+ `sh configure ...' and plain `configure ...' with PATH adjusted.
+ * NEWS, THANKS: Update.
+ Report by Hans Ulrich Niedermann.
+
2007-10-16 Paul Eggert <eggert@cs.ucla.edu>
Check for 64-bit int errors in HP-UX 10.20 preprocessor.
command './configure --prefix=/usr/' will still result in an
expanded libdir value of /usr/lib, not /usr//lib.
+** `configure --help=recursive' now works in read-only trees and from
+ unconfigured build trees.
+
** AT_SETUP now handles macro expansions properly when calculating line
length.
H.J. Lu hjl@gnu.org
Hans Aberg haberg@math.su.se
Hans Olsson Hans.Olsson@dna.lth.se
+Hans Ulrich Niedermann hun@n-dimensional.de
Harlan Stenn stenn@whimsy.udel.edu
Henk Krus h.krus@cyclone.nl
Howard Chu hyc@highlandsun.com
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$0" |
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && srcdir=. && test -d "$ac_dir"; } ||
+ continue
ac_builddir=.
case "$ac_dir" in
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`AS_DIRNAME(["$[0]"])`
+ ac_confdir=`AS_DIRNAME(["$as_myself"])`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && srcdir=. && test -d "$ac_dir"; } ||
+ continue
_AC_SRCDIRS(["$ac_dir"])
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
# Don't use conftest.sym to avoid file name issues on DJGPP, where this
# would yield conftest.sym.exe for DJGPP < 2.04. And don't use `conftest'
# as base name to avoid prohibiting concurrency (e.g., concurrent
-# config.statuses).
+# config.statuses). On read-only media, assume 'cp -p' and hope we
+# are just running --help anyway.
m4_defun([_AS_LN_S_PREPARE],
[rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
# Running the outer configure recursively should provide the innermost
# help strings.
+chmod a-w inner/innermost inner .
AT_CHECK([./configure --help=recursive | grep INNER], 0, [ignore])
+chmod u+w . inner inner/innermost
# Running the outer configure should trigger the inner.
AT_CHECK_CONFIGURE
# Running the outer configure recursively should provide the innermost
# help strings.
+chmod a-w inner/innermost inner
AT_CHECK([./configure --help=recursive | grep " INNER "], 0, [ignore])
AT_CHECK([./configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([/bin/sh ./configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([PATH=.$PATH_SEPARATOR$PATH /bin/sh configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([PATH=.$PATH_SEPARATOR$PATH; export PATH; configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+chmod u+w inner inner/innermost
# Running the outer configure should trigger the inner.
AT_CHECK_CONFIGURE([INNERMOST=tsomrenni])
# The same, but from a builddir.
AS_MKDIR_P([builddir])
+chmod a-w builddir inner/innermost inner
+AT_CHECK([cd builddir && ../configure --help=recursive | grep " INNER "], 0, [ignore])
+AT_CHECK([cd builddir && ../configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([cd builddir && /bin/sh ../configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([PATH=`pwd`$PATH_SEPARATOR$PATH; export PATH; cd builddir && configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+chmod u+w builddir inner inner/innermost
AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])
AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,
[[#define INNERMOST build/tsomrenni