diff options
author | Måns Rullgård <mans@mansr.com> | 2006-11-14 22:48:20 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2006-11-14 22:48:20 +0000 |
commit | c21d6325ab01e53af1319bbdbe8bb634015c4a23 (patch) | |
tree | 7941cc948e5b642e9ee980e72fa0f4c4bd7b3cca /configure | |
parent | 2dbe0bd45fbdff99f2fd50c1a7fee3bc5ce96cee (diff) | |
download | ffmpeg-c21d6325ab01e53af1319bbdbe8bb634015c4a23.tar.gz |
improve broken shell detection, and give a better error message
Originally committed as revision 7077 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 30 |
1 files changed, 24 insertions, 6 deletions
@@ -4,17 +4,35 @@ # # 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 (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null if test "$?" != 0; then - if test "x$FFMPEG_CONFIGURE_EXEC" = x; then - FFMPEG_CONFIGURE_EXEC=1 - export FFMPEG_CONFIGURE_EXEC - exec bash "$0" "$@" - exec ksh "$0" "$@" - exec /usr/xpg4/bin/sh "$0" "$@" + export FF_CONF_EXEC + if test "0$FF_CONF_EXEC" -lt 1; then + FF_CONF_EXEC=1 + try_exec bash "$0" "$@" + fi + 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 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 fi |