Commit 265a9184 authored by mru's avatar mru

improve broken shell detection, and give a better error message


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7077 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7d7410a5
...@@ -4,17 +4,35 @@ ...@@ -4,17 +4,35 @@
# #
# make sure we are running under a compatible shell # make sure we are running under a compatible shell
# try to make this part work with most shells
try_exec(){
type "$1" >/dev/null 2>&1 && exec "$@"
}
unset foo unset foo
(: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
if test "$?" != 0; then if test "$?" != 0; then
if test "x$FFMPEG_CONFIGURE_EXEC" = x; then export FF_CONF_EXEC
FFMPEG_CONFIGURE_EXEC=1 if test "0$FF_CONF_EXEC" -lt 1; then
export FFMPEG_CONFIGURE_EXEC FF_CONF_EXEC=1
exec bash "$0" "$@" try_exec bash "$0" "$@"
exec ksh "$0" "$@" fi
exec /usr/xpg4/bin/sh "$0" "$@" if test "0$FF_CONF_EXEC" -lt 2; then
FF_CONF_EXEC=2
try_exec ksh "$0" "$@"
fi
if test "0$FF_CONF_EXEC" -lt 3; then
FF_CONF_EXEC=3
try_exec /usr/xpg4/bin/sh "$0" "$@"
fi fi
echo "No compatible shell script interpreter found." echo "No compatible shell script interpreter found."
echo "This configure script requires a POSIX compatible shell"
echo "such as bash or ksh."
if test "$BASH_VERSION" = '2.04.0(1)-release'; then
echo "This bash version ($BASH_VERSION) is broken on your platform."
echo "Upgrade to a later version if available."
fi
exit 1 exit 1
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment