diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:59:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:59:48 +0000 |
commit | 3b9b6d0b8e7f798023c9d109c490449d528fde80 (patch) | |
tree | 2e1c188dd7b8d7475cd163de9ae02c428343669b /m4/ax_posix_shell.m4 | |
parent | Initial commit. (diff) | |
download | bind9-3b9b6d0b8e7f798023c9d109c490449d528fde80.tar.xz bind9-3b9b6d0b8e7f798023c9d109c490449d528fde80.zip |
Adding upstream version 1:9.18.19.upstream/1%9.18.19upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'm4/ax_posix_shell.m4')
-rw-r--r-- | m4/ax_posix_shell.m4 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/m4/ax_posix_shell.m4 b/m4/ax_posix_shell.m4 new file mode 100644 index 0000000..2755fae --- /dev/null +++ b/m4/ax_posix_shell.m4 @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: FSFAP +# +# AX_POSIX_SHELL +# ------------- +# Check for a POSIX-compatible shell. +# +# LICENSE +# +# Copyright (c) 2021 Internet Systems Consortium +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +AC_DEFUN([AX_POSIX_SHELL], + [AC_CACHE_CHECK([for a POSIX-compatible shell], [ac_cv_prog_shell], + [ac_test_shell_script=' + test "$(expr 1 + 1)" = "2" && + test "$(( 1 + 1 ))" = "2" + ' + + for ac_cv_prog_shell in \ + "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do + AS_CASE([$ac_cv_prog_shell], + [/*],[ + AS_IF(["$ac_cv_prog_shell" -c "$ac_test_shell_script" 2>/dev/null], + [break]) + ]) + done + ]) + AS_IF([test "$ac_cv_prog_shell" = "no"], + [SHELL=/bin/sh + AC_MSG_WARN([using $SHELL, even though it does not conform to POSIX]) + ], + [SHELL="$ac_cv_prog_shell" + ]) + AC_SUBST([SHELL]) + ]) |