mirror of
git://git.sv.gnu.org/autoconf
synced 2024-12-03 02:00:36 +08:00
7c1b2b4c78
(AS_INIT): Output shell initialization there. Removed optional parameter. Expand _AS_SHELL_FN_SPY. (AS_INIT_WITH_SHELL_FN): Removed. (_AS_SHELL_FN_SPY): New macro. (AS_DETECT_REQUIRED, AS_DETECT_SUGGESTED): New macros. (AS_SHELL_SANITIZE): Remove loop to find better shell and documentation for the parameter. (_AS_DETECT_BETTER_SHELL): Move it here. (_AS_SHELL_FN_WORK): Remove shell invocation, reformat. (_AS_RUN): Move it here, support testing with eval. (AS_REQUIRE_SHELL_FN): Require shell functions when it is used. (_AS_LINENO_WORKS): Put around braces, we do not trigger the bash bug anymore. * lib/autotest/general.m4: Document M4SH-SANITIZE, do not use AS_INIT_WITH_SHELL_FN. * bin/autoconf.in, tests/wrapper.in: Regenerated.
365 lines
7.3 KiB
Bash
Executable File
365 lines
7.3 KiB
Bash
Executable File
#! /bin/sh
|
|
## --------------------- ##
|
|
## M4sh Initialization. ##
|
|
## --------------------- ##
|
|
|
|
# Be Bourne compatible
|
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
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+"$@"}'='"$@"'
|
|
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
|
|
set -o posix
|
|
fi
|
|
DUALCASE=1; export DUALCASE # for MKS sh
|
|
|
|
|
|
# PATH needs CR
|
|
# Avoid depending upon Character Ranges.
|
|
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
|
|
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
|
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
|
|
as_cr_digits='0123456789'
|
|
as_cr_alnum=$as_cr_Letters$as_cr_digits
|
|
|
|
# The user is always right.
|
|
if test "${PATH_SEPARATOR+set}" != set; then
|
|
echo "#! /bin/sh" >conf$$.sh
|
|
echo "exit 0" >>conf$$.sh
|
|
chmod +x conf$$.sh
|
|
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
|
|
PATH_SEPARATOR=';'
|
|
else
|
|
PATH_SEPARATOR=:
|
|
fi
|
|
rm -f conf$$.sh
|
|
fi
|
|
|
|
# Support unset when possible.
|
|
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
|
|
as_unset=unset
|
|
else
|
|
as_unset=false
|
|
fi
|
|
|
|
|
|
# Find who we are. Look in the path if we contain no path at all
|
|
# relative or not.
|
|
case $0 in
|
|
*[\\/]* ) as_myself=$0 ;;
|
|
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
|
for as_dir in $PATH
|
|
do
|
|
IFS=$as_save_IFS
|
|
test -z "$as_dir" && as_dir=.
|
|
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
|
|
done
|
|
|
|
;;
|
|
esac
|
|
# We did not find ourselves, most probably we were run as `sh COMMAND'
|
|
# in which case we are not to be found in the path.
|
|
if test "x$as_myself" = x; then
|
|
as_myself=$0
|
|
fi
|
|
if test ! -f "$as_myself"; then
|
|
{ echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
|
|
{ (exit 1); exit 1; }; }
|
|
fi
|
|
|
|
# Work around bugs in pre-3.0 UWIN ksh.
|
|
$as_unset ENV MAIL MAILPATH
|
|
PS1='$ '
|
|
PS2='> '
|
|
PS4='+ '
|
|
|
|
# NLS nuisances.
|
|
for as_var in \
|
|
LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
|
|
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
|
|
LC_TELEPHONE LC_TIME
|
|
do
|
|
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
|
|
eval $as_var=C; export $as_var
|
|
else
|
|
$as_unset $as_var
|
|
fi
|
|
done
|
|
|
|
# Required to use basename.
|
|
if expr a : '\(a\)' >/dev/null 2>&1; then
|
|
as_expr=expr
|
|
else
|
|
as_expr=false
|
|
fi
|
|
|
|
if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
|
|
as_basename=basename
|
|
else
|
|
as_basename=false
|
|
fi
|
|
|
|
|
|
# Name of the executable.
|
|
as_me=`$as_basename "$0" ||
|
|
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
|
|
X"$0" : 'X\(//\)$' \| \
|
|
X"$0" : 'X\(/\)$' \| \
|
|
. : '\(.\)' 2>/dev/null ||
|
|
echo X/"$0" |
|
|
sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
|
|
/^X\/\(\/\/\)$/{ s//\1/; q; }
|
|
/^X\/\(\/\).*/{ s//\1/; q; }
|
|
s/.*/./; q'`
|
|
|
|
|
|
|
|
if test "x$CONFIG_SHELL" = x; then
|
|
if (eval ":") 2>/dev/null; then
|
|
as_have_required=yes
|
|
else
|
|
as_have_required=no
|
|
fi
|
|
|
|
if test $as_have_required = yes && (eval ":
|
|
(func_return () {
|
|
(exit \$1)
|
|
}
|
|
func_success () {
|
|
func_return 0
|
|
}
|
|
func_failure () {
|
|
func_return 1
|
|
}
|
|
func_ret_success () {
|
|
return 0
|
|
}
|
|
func_ret_failure () {
|
|
return 1
|
|
}
|
|
|
|
exitcode=0
|
|
if func_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_failure succeeded.
|
|
fi
|
|
|
|
if func_failure; then
|
|
exitcode=1
|
|
echo func_success failed.
|
|
fi
|
|
|
|
if func_ret_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_ret_success failed.
|
|
fi
|
|
|
|
if func_ret_failure; then
|
|
exitcode=1
|
|
echo func_ret_failure succeeded.
|
|
fi
|
|
|
|
test \$exitcode = 0) || { (exit 1); exit 1; }
|
|
") 2> /dev/null; then
|
|
:
|
|
else
|
|
as_candidate_shells="$SHELL"
|
|
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
|
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
|
|
do
|
|
IFS=$as_save_IFS
|
|
test -z "$as_dir" && as_dir=.
|
|
case $as_dir in
|
|
/*)
|
|
for as_base in sh bash ksh sh5; do
|
|
as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
|
|
done
|
|
esac
|
|
done
|
|
|
|
|
|
for as_shell in $as_candidate_shells; do
|
|
if { $as_shell 2> /dev/null <<\_ASEOF
|
|
# Be Bourne compatible
|
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
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+"$@"}'='"$@"'
|
|
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
|
|
set -o posix
|
|
fi
|
|
DUALCASE=1; export DUALCASE # for MKS sh
|
|
|
|
:
|
|
_ASEOF
|
|
}; then
|
|
CONFIG_SHELL=$as_shell
|
|
as_have_required=yes
|
|
if { $as_shell 2> /dev/null <<\_ASEOF
|
|
# Be Bourne compatible
|
|
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
|
|
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+"$@"}'='"$@"'
|
|
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
|
|
set -o posix
|
|
fi
|
|
DUALCASE=1; export DUALCASE # for MKS sh
|
|
|
|
:
|
|
(func_return () {
|
|
(exit $1)
|
|
}
|
|
func_success () {
|
|
func_return 0
|
|
}
|
|
func_failure () {
|
|
func_return 1
|
|
}
|
|
func_ret_success () {
|
|
return 0
|
|
}
|
|
func_ret_failure () {
|
|
return 1
|
|
}
|
|
|
|
exitcode=0
|
|
if func_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_failure succeeded.
|
|
fi
|
|
|
|
if func_failure; then
|
|
exitcode=1
|
|
echo func_success failed.
|
|
fi
|
|
|
|
if func_ret_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_ret_success failed.
|
|
fi
|
|
|
|
if func_ret_failure; then
|
|
exitcode=1
|
|
echo func_ret_failure succeeded.
|
|
fi
|
|
|
|
test $exitcode = 0) || { (exit 1); exit 1; }
|
|
|
|
_ASEOF
|
|
}; then
|
|
break
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test "x$CONFIG_SHELL" != x; then
|
|
$as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
|
|
$as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
|
|
export CONFIG_SHELL
|
|
exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
|
|
fi
|
|
|
|
|
|
if test $as_have_required = no; then
|
|
echo This script requires a shell more modern than all the
|
|
echo shells that I found on your system. Please install a
|
|
echo modern shell, or manually run the script under such a
|
|
echo shell if you do have one.
|
|
{ (exit 1); exit 1; }
|
|
fi
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
(eval "func_return () {
|
|
(exit \$1)
|
|
}
|
|
func_success () {
|
|
func_return 0
|
|
}
|
|
func_failure () {
|
|
func_return 1
|
|
}
|
|
func_ret_success () {
|
|
return 0
|
|
}
|
|
func_ret_failure () {
|
|
return 1
|
|
}
|
|
|
|
exitcode=0
|
|
if func_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_failure succeeded.
|
|
fi
|
|
|
|
if func_failure; then
|
|
exitcode=1
|
|
echo func_success failed.
|
|
fi
|
|
|
|
if func_ret_success; then
|
|
:
|
|
else
|
|
exitcode=1
|
|
echo func_ret_success failed.
|
|
fi
|
|
|
|
if func_ret_failure; then
|
|
exitcode=1
|
|
echo func_ret_failure succeeded.
|
|
fi
|
|
|
|
test \$exitcode = 0") || {
|
|
echo No shell found that supports shell functions.
|
|
echo Please tell autoconf@gnu.org about your system,
|
|
echo including any error possibly output before this
|
|
echo message
|
|
}
|
|
|
|
|
|
testdir=@abs_top_builddir@/tests
|
|
AUTOCONF=$testdir/autoconf
|
|
AUTOHEADER=$testdir/autoheader
|
|
AUTOM4TE=$testdir/autom4te
|
|
AUTOM4TE_CFG=@abs_top_builddir@/lib/autom4te.cfg
|
|
autom4te_perllibdir=@abs_top_srcdir@/lib
|
|
export AUTOCONF AUTOHEADER AUTOM4TE AUTOM4TE_CFG autom4te_perllibdir
|
|
|
|
case $as_me in
|
|
ifnames)
|
|
# Does not have lib files.
|
|
exec @abs_top_builddir@/bin/$as_me ${1+"$@"}
|
|
;;
|
|
*)
|
|
# We might need files from the build tree (frozen files), in
|
|
# addition of src files.
|
|
exec @abs_top_builddir@/bin/$as_me \
|
|
-B @abs_top_builddir@/lib \
|
|
-B @abs_top_srcdir@/lib ${1+"$@"}
|
|
esac
|
|
exit 1
|