ax_posix_shell.m4 revision 1.1.1.2
1# AX_POSIX_SHELL 2# ------------- 3# Check for a POSIX-compatible shell. 4# 5AC_DEFUN([AX_POSIX_SHELL], 6 [AC_CACHE_CHECK([for a POSIX-compatible shell], [ac_cv_prog_shell], 7 [ac_test_shell_script=' 8 test "$(expr 1 + 1)" = "2" && 9 test "$(( 1 + 1 ))" = "2" 10 ' 11 12 for ac_cv_prog_shell in \ 13 "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do 14 AS_CASE([$ac_cv_prog_shell], 15 [/*],[ 16 AS_IF(["$ac_cv_prog_shell" -c "$ac_test_shell_script" 2>/dev/null], 17 [break]) 18 ]) 19 done 20 ]) 21 AS_IF([test "$ac_cv_prog_shell" = "no"], 22 [SHELL=/bin/sh 23 AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX]) 24 ], 25 [SHELL="$ac_cv_prog_shell" 26 ]) 27 AC_SUBST([SHELL]) 28 ]) 29