2008-03-24 10:19:36 +00:00
|
|
|
# Find a POSIX-conforming shell.
|
|
|
|
|
update from gnulib
* build-aux/mktempd (rand_bytes, mktempd):
* build-aux/useless-if-before-free (FILE):
* build-aux/vc-list-files:
* gnulib/lib/.cvsignore:
* gnulib/lib/Makefile.am:
* gnulib/lib/poll.c (poll):
* gnulib/lib/stdbool.in.h (_GL_STDBOOL_H, true):
* gnulib/lib/stdio-impl.h (fp_, fp_ub):
* gnulib/lib/stdio.in.h (vasprintf, obstack_printf)
(obstack_vprintf):
* gnulib/lib/vasnprintf.c (_GNU_SOURCE, sprintf, IF_LINT, exp)
(remainder, scale10_round_decimal_long_double)
(scale10_round_decimal_double, pad_ourselves):
* gnulib/m4/gnulib-cache.m4:
* gnulib/m4/gnulib-common.m4 (gl_MODULE_INDICATOR):
* gnulib/m4/gnulib-tool.m4 (gl_LOCAL_DIR, gl_M4_BASE, gl_PO_BASE)
(gl_DOC_BASE, gl_TESTS_BASE, gl_WITH_TESTS, gl_LIB, gl_LGPL)
(gl_MAKEFILE_NAME, gl_MACRO_PREFIX, gl_PO_DOMAIN, gl_VC_FILES):
* gnulib/m4/lock.m4 (gl_LOCK_EARLY_BODY, gl_PREREQ_LOCK)
(gl_DISABLE_THREADS):
* gnulib/m4/onceonly.m4:
* gnulib/m4/posix-shell.m4 (gl_POSIX_SHELL):
* gnulib/m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS):
* gnulib/tests/test-getaddrinfo.c (ENABLE_DEBUGGING, dbgprintf)
(simple):
* gnulib/tests/test-stdint.c (UINTMAX_MAX, or):
* gnulib/tests/test-vc-list-files-cvs.sh (compare):
* gnulib/tests/test-vc-list-files-git.sh (compare):
2008-08-07 09:42:29 +00:00
|
|
|
# Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
2008-03-24 10:19:36 +00:00
|
|
|
|
|
|
|
# This file is free software; the Free Software Foundation
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
# Written by Paul Eggert.
|
|
|
|
|
|
|
|
# If a POSIX-conforming shell can be found, set POSIX_SHELL and
|
|
|
|
# PREFERABLY_POSIX_SHELL to it. If not, set POSIX_SHELL to the
|
|
|
|
# empty string and PREFERABLY_POSIX_SHELL to '/bin/sh'.
|
|
|
|
|
|
|
|
AC_DEFUN([gl_POSIX_SHELL],
|
|
|
|
[
|
|
|
|
AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell],
|
update from gnulib
* build-aux/mktempd (rand_bytes, mktempd):
* build-aux/useless-if-before-free (FILE):
* build-aux/vc-list-files:
* gnulib/lib/.cvsignore:
* gnulib/lib/Makefile.am:
* gnulib/lib/poll.c (poll):
* gnulib/lib/stdbool.in.h (_GL_STDBOOL_H, true):
* gnulib/lib/stdio-impl.h (fp_, fp_ub):
* gnulib/lib/stdio.in.h (vasprintf, obstack_printf)
(obstack_vprintf):
* gnulib/lib/vasnprintf.c (_GNU_SOURCE, sprintf, IF_LINT, exp)
(remainder, scale10_round_decimal_long_double)
(scale10_round_decimal_double, pad_ourselves):
* gnulib/m4/gnulib-cache.m4:
* gnulib/m4/gnulib-common.m4 (gl_MODULE_INDICATOR):
* gnulib/m4/gnulib-tool.m4 (gl_LOCAL_DIR, gl_M4_BASE, gl_PO_BASE)
(gl_DOC_BASE, gl_TESTS_BASE, gl_WITH_TESTS, gl_LIB, gl_LGPL)
(gl_MAKEFILE_NAME, gl_MACRO_PREFIX, gl_PO_DOMAIN, gl_VC_FILES):
* gnulib/m4/lock.m4 (gl_LOCK_EARLY_BODY, gl_PREREQ_LOCK)
(gl_DISABLE_THREADS):
* gnulib/m4/onceonly.m4:
* gnulib/m4/posix-shell.m4 (gl_POSIX_SHELL):
* gnulib/m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS):
* gnulib/tests/test-getaddrinfo.c (ENABLE_DEBUGGING, dbgprintf)
(simple):
* gnulib/tests/test-stdint.c (UINTMAX_MAX, or):
* gnulib/tests/test-vc-list-files-cvs.sh (compare):
* gnulib/tests/test-vc-list-files-git.sh (compare):
2008-08-07 09:42:29 +00:00
|
|
|
[gl_test_posix_shell_script='
|
2008-03-24 10:19:36 +00:00
|
|
|
func_return () {
|
|
|
|
(exit [$]1)
|
|
|
|
}
|
|
|
|
func_success () {
|
|
|
|
func_return 0
|
|
|
|
}
|
|
|
|
func_failure () {
|
|
|
|
func_return 1
|
|
|
|
}
|
|
|
|
func_ret_success () {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
func_ret_failure () {
|
|
|
|
return 1
|
|
|
|
}
|
2008-10-28 17:47:12 +00:00
|
|
|
subshell_umask_sanity () {
|
|
|
|
(umask 22; (umask 0); test $(umask) -eq 22)
|
|
|
|
}
|
2008-03-24 10:19:36 +00:00
|
|
|
test "[$](echo foo)" = foo &&
|
|
|
|
func_success &&
|
|
|
|
! func_failure &&
|
|
|
|
func_ret_success &&
|
|
|
|
! func_ret_failure &&
|
2008-10-28 17:47:12 +00:00
|
|
|
(set x && func_ret_success y && test x = "[$]1") &&
|
|
|
|
subshell_umask_sanity
|
2008-03-24 10:19:36 +00:00
|
|
|
'
|
|
|
|
for gl_cv_posix_shell in \
|
|
|
|
"$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do
|
|
|
|
case $gl_cv_posix_shell in
|
|
|
|
/*)
|
update from gnulib
* build-aux/mktempd (rand_bytes, mktempd):
* build-aux/useless-if-before-free (FILE):
* build-aux/vc-list-files:
* gnulib/lib/.cvsignore:
* gnulib/lib/Makefile.am:
* gnulib/lib/poll.c (poll):
* gnulib/lib/stdbool.in.h (_GL_STDBOOL_H, true):
* gnulib/lib/stdio-impl.h (fp_, fp_ub):
* gnulib/lib/stdio.in.h (vasprintf, obstack_printf)
(obstack_vprintf):
* gnulib/lib/vasnprintf.c (_GNU_SOURCE, sprintf, IF_LINT, exp)
(remainder, scale10_round_decimal_long_double)
(scale10_round_decimal_double, pad_ourselves):
* gnulib/m4/gnulib-cache.m4:
* gnulib/m4/gnulib-common.m4 (gl_MODULE_INDICATOR):
* gnulib/m4/gnulib-tool.m4 (gl_LOCAL_DIR, gl_M4_BASE, gl_PO_BASE)
(gl_DOC_BASE, gl_TESTS_BASE, gl_WITH_TESTS, gl_LIB, gl_LGPL)
(gl_MAKEFILE_NAME, gl_MACRO_PREFIX, gl_PO_DOMAIN, gl_VC_FILES):
* gnulib/m4/lock.m4 (gl_LOCK_EARLY_BODY, gl_PREREQ_LOCK)
(gl_DISABLE_THREADS):
* gnulib/m4/onceonly.m4:
* gnulib/m4/posix-shell.m4 (gl_POSIX_SHELL):
* gnulib/m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS):
* gnulib/tests/test-getaddrinfo.c (ENABLE_DEBUGGING, dbgprintf)
(simple):
* gnulib/tests/test-stdint.c (UINTMAX_MAX, or):
* gnulib/tests/test-vc-list-files-cvs.sh (compare):
* gnulib/tests/test-vc-list-files-git.sh (compare):
2008-08-07 09:42:29 +00:00
|
|
|
"$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \
|
|
|
|
&& break;;
|
2008-03-24 10:19:36 +00:00
|
|
|
esac
|
|
|
|
done])
|
|
|
|
|
|
|
|
if test "$gl_cv_posix_shell" != no; then
|
|
|
|
POSIX_SHELL=$gl_cv_posix_shell
|
|
|
|
PREFERABLY_POSIX_SHELL=$POSIX_SHELL
|
|
|
|
else
|
|
|
|
POSIX_SHELL=
|
|
|
|
PREFERABLY_POSIX_SHELL=/bin/sh
|
|
|
|
fi
|
|
|
|
AC_SUBST([POSIX_SHELL])
|
|
|
|
AC_SUBST([PREFERABLY_POSIX_SHELL])
|
|
|
|
])
|