5 # Check for a working (i.e. POSIX-compatible) shell.
6 # Written by Paul Eggert <eggert@twinsun.com>,
7 # from an idea suggested by Albert Chin-A-Young <china@thewrittenword.com>.
8 AC_DEFUN([AC_PROG_SHELL],
9 [AC_MSG_CHECKING([for a POSIX-compliant shell])
10 AC_CACHE_VAL(ac_cv_path_shell,
12 # Test the noclobber option, using the portable POSIX.2 syntax.
24 if ("$SHELL" -c "$ac_command") 2>/dev/null; then
25 ac_cv_path_shell=$SHELL
29 case $ac_cv_path_shell in
31 # Prefer shells that are more likely to be installed in the
32 # same place on all hosts of this platform. Therefore, prefer
33 # shells in /bin and /usr/bin to shells in the installer's
34 # PATH. Also, loop through PATH first and then through
35 # shells, since less-"nice" shells in /bin and /usr/bin are
36 # more likely to be installed than "nicer" shells elsewhere.
37 _AS_PATH_WALK([/bin:/usr/bin:$PATH],
38 [for ac_base in sh bash ksh sh5; do
42 if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
43 ac_cv_path_shell="$as_dir/$ac_base"
48 case $ac_cv_path_shell in
54 AC_MSG_RESULT($ac_cv_path_shell)
55 SHELL=$ac_cv_path_shell
56 if test "$SHELL" = no; then
58 AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX])