From f4b417c62a4f272c4cf9a074d0f7a3a97201f9db Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 17 Apr 2012 11:23:35 +0200 Subject: Update to upstream bash 4.2 This upgrades bash to from 4.1-rc to 4.2-release. See CWRU/changelog for changes. Change-Id: I926269c300cf44fa25964b5b375a148fcf11c4b7 --- aclocal.m4 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'aclocal.m4') diff --git a/aclocal.m4 b/aclocal.m4 index 10a4741..716a043 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1695,8 +1695,10 @@ AC_CHECK_HEADERS(langinfo.h) AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN)) AC_CHECK_FUNC(mbscasecmp, AC_DEFINE(HAVE_MBSCMP)) AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP)) +AC_CHECK_FUNC(mbsnrtowcs, AC_DEFINE(HAVE_MBSNRTOWCS)) AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) + AC_REPLACE_FUNCS(mbschr) AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB)) @@ -1705,6 +1707,8 @@ AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP)) AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH)) AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE)) +AC_REPLACE_FUNCS(wcswidth) + dnl checks for both mbrtowc and mbstate_t AC_FUNC_MBRTOWC if test $ac_cv_func_mbrtowc = yes; then @@ -4115,3 +4119,51 @@ main() [Define if you have a standard-conformant vsnprintf function.]) fi ]) + +AC_DEFUN(BASH_STRUCT_WEXITSTATUS_OFFSET, +[AC_MSG_CHECKING(for offset of exit status in return status from wait) +AC_CACHE_VAL(bash_cv_wexitstatus_offset, +[AC_RUN_IFELSE([ +#include +#include + +#include + +main(c, v) + int c; + char **v; +{ + pid_t pid, p; + int s, i, n; + + s = 0; + pid = fork(); + if (pid == 0) + exit (42); + + /* wait for the process */ + p = wait(&s); + if (p != pid) + exit (255); + + /* crack s */ + for (i = 0; i < (sizeof(s) - 8); i++) + { + n = (s >> i) & 0xff; + if (n == 42) + exit (i); + } + + exit (254); +} +], bash_cv_wexitstatus_offset=0, bash_cv_wexitstatus_offset=$?, + [AC_MSG_WARN(cannot check WEXITSTATUS offset if cross compiling -- defaulting to 0) + bash_cv_wexitstatus_offset=0] +)]) +if test "$bash_cv_wexitstatus_offset" -gt 32 ; then + AC_MSG_WARN(bad exit status from test program -- defaulting to 0) + bash_cv_wexitstatus_offset=0 +fi +AC_MSG_RESULT($bash_cv_wexitstatus_offset) +AC_DEFINE_UNQUOTED([WEXITSTATUS_OFFSET], [$bash_cv_wexitstatus_offset], [Offset of exit status in wait status word]) +]) -- cgit v1.1