+2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Autoconf-generated shell scripts no longer export BIN_SH,
+ due to configuration hassles with this. See Tonya Underwood's report
+ <http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00003.html>.
+ * doc/autoconf.texi (Special Shell Variables): Likewise.
+
+2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
+ Stepan Kasal <kasal@ucw.cz>
+
+ * lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Don't set BIN_SH.
+ (_AS_DETECT_BETTER_SHELL): Don't look in /usr/bin/posix.
+
+2006-10-11 Stepan Kasal <kasal@ucw.cz>
+
+ * lib/m4sugar/m4sh.m4 (AS_BOURNE_COMPATIBLE): Move the
+ initialization which is not inherited through the environment
+ (_AS_BOURNE_COMPATIBLE): ... to this new macro.
+ (_AS_RUN): Call _AS_BOURNE_COMPATIBLE, not AS_BOURNE_COMPATIBLE.
+
2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
* doc/autoconf.texi (Limitations of Usual Tools): Describe
# --------------------
# Try to be as Bourne and/or POSIX as possible.
#
-# FIXME: The assignment to BIN_SH is dubious; see
+# This does not set BIN_SH, due to the problems described in
# <http://lists.gnu.org/archive/html/autoconf-patches/2006-03/msg00081.html>.
-# It might be better to remove it, but first please see
+# People who need BIN_SH should set it in their environment before invoking
+# configure; apparently this would include UnixWare, as described in
# <http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00025.html>.
m4_define([AS_BOURNE_COMPATIBLE],
-[# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
+[# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+_$0
+])
+
+# _AS_BOURNE_COMPATIBLE
+# ---------------------
+# This is the part of AS_BOURNE_COMPATIBLE which has to be repeated inside
+# each instance.
+m4_define([_AS_BOURNE_COMPATIBLE],
+[AS_IF([test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1],
+ [emulate sh
NULLCMD=:
[#] Zsh 3.x and 4.x performs word splitting on ${1+"$[@]"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$[@]"}'='"$[@]"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
+ setopt NO_GLOB_SUBST],
+ [AS_CASE([`(set -o) 2>/dev/null`], [*posix*], [set -o posix])])
])
m4_define([_AS_RUN],
[m4_ifval([$2],
[{ $2 <<\_ASEOF
-AS_BOURNE_COMPATIBLE
+_AS_BOURNE_COMPATIBLE
$1
_ASEOF
}],
# The real workhorse for detecting a shell with the correct
# features.
#
-# FIXME: The '/usr/bin/posix' below works around a shell bug in OSF
-# <http://lists.gnu.org/archive/html/autoconf-patches/2006-03/msg00081.html>
-# but this causes a regression on OpenServer 6.0.0
+# In previous versions, we prepended /usr/posix/bin to the path, but that
+# caused a regression on OpenServer 6.0.0
# <http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00017.html>
-# The code should test for the OSF bug directly rather than look at
-# /usr/bin/posix here.
+# and on HP-UX 11.11, see the failure of test 120 in
+# <http://lists.gnu.org/archive/html/bug-autoconf/2006-10/msg00003.html>
#
-# FIXME: The 'test -f "$as_shell.exe"' works around a problem in OS/2
-# <http://lists.gnu.org/archive/html/autoconf/2006-06/msg00038.html>
-# but we should replace the two test -f calls with a single AS_EXECUTABLE_P.
+# FIXME: The code should test for the OSF bug described in
+# <http://lists.gnu.org/archive/html/autoconf-patches/2006-03/msg00081.html>.
#
m4_defun_once([_AS_DETECT_BETTER_SHELL],
[m4_wrap([m4_divert_text([M4SH-SANITIZE], [
_AS_RUN([_AS_DETECT_SUGGESTED_BODY]) 2> /dev/null],
[],
[as_candidate_shells=
- _AS_PATH_WALK([/usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+ _AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
[case $as_dir in
/*)
for as_base in sh bash ksh sh5; do