# 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; chmod u+w .; } | grep INNER], 0,
+ [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
chmod u+w . inner inner/innermost
# Running the outer configure should trigger the inner.
# 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; export 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])
+AT_CHECK([{ ./configure --help=recursive; chmod u+w .; } | grep " INNER "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w .
+AT_CHECK([{ ./configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w .
+AT_CHECK([{ /bin/sh ./configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w .
+AT_CHECK([PATH=.$PATH_SEPARATOR$PATH; export PATH; { /bin/sh configure --help=recursive; chmod +w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w .
+AT_CHECK([PATH=.$PATH_SEPARATOR$PATH; export PATH; { configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
chmod u+w inner inner/innermost
# Running the outer configure should trigger the inner.
# 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 && { ../configure --help=recursive; chmod u+w .; } | grep " INNER "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w builddir
+AT_CHECK([cd builddir && { ../configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w builddir
+AT_CHECK([cd builddir && { /bin/sh ../configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [ignore])])
+chmod a-w builddir
# Not all shells search $PATH for scripts.
if (cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure --help) >/dev/null 2>&1; then
AT_CHECK([cd builddir && PATH=`pwd`/..$PATH_SEPARATOR$PATH /bin/sh configure --help=recursive | grep " INNERMOST "], 0, [ignore])
fi
-AT_CHECK([PATH=`pwd`$PATH_SEPARATOR$PATH; export PATH; cd builddir && configure --help=recursive | grep " INNERMOST "], 0, [ignore])
+AT_CHECK([PATH=`pwd`$PATH_SEPARATOR$PATH; export PATH; cd builddir && { configure --help=recursive; chmod u+w .; } | grep " INNERMOST "],
+ 0, [ignore], [stderr],
+ [AT_CHECK([grep 'rerun with a POSIX shell' stderr], [], [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,