From 441078402919f6f0dd677cad18d55c7a89d294fc Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Mon, 13 Sep 2021 10:08:15 -0400 Subject: [PATCH] more updates for autoconf-2.71: removing usage of AC_TRY_RUN --- CWRU/CWRU.chlog | 94 +++++ aclocal.m4 | 555 +++++++++--------------- config.h.in | 6 +- configure | 956 ++++++++++++++++-------------------------- configure.ac | 52 +-- doc/bash.1 | 3 +- doc/bashref.texi | 6 +- externs.h | 6 +- include/typemax.h | 4 +- lib/readline/search.c | 8 + lib/sh/fmtullong.c | 2 +- lib/sh/snprintf.c | 20 +- lib/sh/strtoimax.c | 10 +- lib/sh/strtol.c | 2 +- lib/sh/strtoll.c | 4 +- lib/sh/strtoull.c | 4 +- lib/sh/strtoumax.c | 10 +- 17 files changed, 724 insertions(+), 1018 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 0ce18ae4..eb4f4b0e 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -1895,4 +1895,98 @@ lib/sh/strftime.c unconditionally in case it defines time_t. From a report by Ori Sky Farrell + 9/9 + --- +lib/readline/search.c + - rl_history_search_internal: set rl_undo_list to NULL after calling + rl_maybe_save_line, since it will be restored one way or another + after the search completes, and we don't want it to be freed twice + - rl_history_search_internal: leave the current history offset at the + position of the last matching history entry. This means that things + like ^P will start back from that history entry, ^N will move + forward from there, and operate-and-get-next will work like it does + with incremental searches. Reported by Vandrus Zoltán + + 9/10 + ---- +aclocal.m4 + - BASH_C_LONG_LONG: removed + - BASH_TYPE_LONG_DOUBLE: removed + - BASH_TYPE_LONG_LONG,BASH_TYPE_UNSIGNED_LONG_LONG: removed + - BASH_FUNC_CTYPE_NONASCII: removed + - BASH_SYS_SIGNAL_VINTAGE,BASH_SYS_REINSTALL_SIGHANDLERS: don't + require AC_TYPE_SIGNAL, use void instead of RETSIGTYPE + - BASH_TYPE_SIGHANDLER: removed + +configure.ac,aclocal.m4,config.h.in + - BASH_TYPE_LONG_LONG: removed, call AC_TYPE_LONG_LONG_INT directly, + change #define to HAVE_LONG_LONG_INT + - BASH_TYPE_UNSIGNED_LONG_LONG: removed, call AC_TYPE_UNSIGNED_LONG_LONG_INT + directly, change #define to HAVE_UNSIGNED_LONG_LONG_INT + +externs.h,include/typemax.h,lib/sh/{fmtullong,snprintf,strtoimax,strtoll, +strtoull,strtoumax}.c + - HAVE_LONG_LONG -> HAVE_LONG_LONG_INT + - HAVE_UNSIGNED_LONG_LONG -> HAVE_UNSIGNED_LONG_LONG_INT + +configure.ac + - AC_TRY_COMPILE -> AC_COMPILE_IFELSE + - BASH_CHECK_TYPE (intmax_t) -> AC_TYPE_INTMAX_T + - BASH_CHECK_TYPE (uintmax_t) -> AC_TYPE_UINTMAX_T + - BASH_CHECK_TYPE (sig_atomic_t): removed + +aclocal.m4 + - BASH_FUNC_STRSIGNAL: changed to use AC_LINK_IFELSE + - BASH_FUNC_LSTAT: changed to use AC_LINK_IFELSE + - BASH_FUNC_SBRK: changed to use AC_LINK_IFELSE and AC_RUN_IFELSE, + fixed typo + - BASH_CHECK_SPEED_T: changed to use AC_COMPILE_IFELSE + - BASH_TYPE_SIG_ATOMIC_T: use BASH_CHECK_TYPE instead of AC_CHECK_TYPE + - BASH_STRUCT_DIRENT: new macro, like _AC_STRUCT_DIRENT but public and + sets a different bash-specific shell variable + - BASH_STRUCT_DIRENT_D_{INO,FILENO,NAMLEN}: call BASH_STRUCT_DIRENT + with a different first argument instead of using inline code and + AC_TRY_COMPILE + + 9/11 + ---- +[prayers for the victims of 9/11/2001] + +aclocal.m4 + - BASH_CHECK_DECL: just call AC_CHECK_DECLS and use the default + includes, which includes the files we used to specify + - BASH_FUNC_INET_ATON: changed to use AC_LINK_IFELSE + - BASH_STRUCT_WEXITSTATUS_OFFSET: changed to use AC_RUN_IFELSE + - BASH_FUNC_OPENDIR_CHECK: changed to use AC_RUN_IFELSE + - BASH_FUNC_ULIMIT_MAXFDS: changed to use AC_RUN_IFELSE + - BASH_UNDER_SYS_SIGLIST: changed to use AC_RUN_IFELSE + - BASH_SYS_SIGLIST: changed to use AC_RUN_IFELSE + - BASH_FUNC_DUP2_CLOEXEC_CHECK: changed to use AC_RUN_IFELSE + - BASH_FUNC_GETENV: changed to use AC_RUN_IFELSE + - BASH_FUNC_GETCWD: changed to use AC_RUN_IFELSE + - BASH_FUNC_FNMATCH_EXTMATCH: changed to use AC_RUN_IFELSE + - BASH_FUNC_POSIX_SETJMP: changed to use AC_RUN_IFELSE + - BASH_FUNC_STRCOLL: changed to use AC_RUN_IFELSE + - BASH_FUNC_PRINTF_A_FORMAT: changed to use AC_RUN_IFELSE + - BASH_SYS_PGRP_SYNC: changed to use AC_RUN_IFELSE + - BASH_SYS_SIGNAL_VINTAGE: changed to use AC_RUN_IFELSE + - BASH_SYS_NAMED_PIPES: changed to use AC_RUN_IFELSE + - BASH_CHECK_RTSIGS: changed to use AC_RUN_IFELSE + - BASH_CHECK_MULTIBYTE: changed to use AC_RUN_IFELSE + - RL_LIB_READLINE_VERSION: changed to use AC_RUN_IFELSE + - BASH_CHECK_WCONTINUED: changed to use AC_RUN_IFELSE + - BASH_FUNC_SNPRINTF: changed to use AC_RUN_IFELSE + - BASH_FUNC_VSNPRINTF: changed to use AC_RUN_IFELSE + - BASH_FUNC_FNMATCH_EQUIV_FALLBACK: changed to use AC_RUN_IFELSE + - BASH_DECL_PRINTF: changed to use AC_RUN_IFELSE + - BASH_TYPE_RLIMIT: rewrote to avoid quad_t, now uses AC_COMPILE_IFELSE + to determine whether rlim_t is available, otherwise determines the + value of RLIMTYPE based on sizeof(rlim.rlim_cur): int, long, or + long long + - BASH_SIZEOF_RLIMIT,BASH_SIZEOF_QUAD_T: helper macros for + BASH_TYPE_RLIMIT in the case that rlim_t is not present + +configure.ac + - BASH_CHECK_DECL -> AC_CHECK_DECLS + - quad_t: use AC_CHECK_TYPE (new style) instead of BASH_CHECK_TYPE diff --git a/aclocal.m4 b/aclocal.m4 index be478a27..562f36e2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,55 +4,6 @@ dnl dnl Some derived from PDKSH 5.1.3 autoconf tests dnl -AC_DEFUN(BASH_C_LONG_LONG, -[AC_CACHE_CHECK(for long long, ac_cv_c_long_long, -[if test "$GCC" = yes; then - ac_cv_c_long_long=yes -else -AC_TRY_RUN([ -#include -int -main() -{ -long long foo = 0; -exit(sizeof(long long) < sizeof(long)); -} -], ac_cv_c_long_long=yes, ac_cv_c_long_long=no) -fi]) -if test $ac_cv_c_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG, 1, [Define if the `long long' type works.]) -fi -]) - -dnl -dnl This is very similar to AC_C_LONG_DOUBLE, with the fix for IRIX -dnl (< changed to <=) added. -dnl -AC_DEFUN(BASH_C_LONG_DOUBLE, -[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, -[if test "$GCC" = yes; then - ac_cv_c_long_double=yes -else -AC_TRY_RUN([ -#include -int -main() -{ - /* The Stardent Vistra knows sizeof(long double), but does not - support it. */ - long double foo = 0.0; - /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ - /* On IRIX 5.3, the compiler converts long double to double with a warning, - but compiles this successfully. */ - exit(sizeof(long double) <= sizeof(double)); -} -], ac_cv_c_long_double=yes, ac_cv_c_long_double=no) -fi]) -if test $ac_cv_c_long_double = yes; then - AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if the `long double' type works.]) -fi -]) - dnl dnl Check for . This is separated out so that it can be dnl AC_REQUIREd. @@ -108,30 +59,13 @@ dnl AC_DEFUN(BASH_CHECK_DECL, [ AC_REQUIRE([BASH_HEADER_INTTYPES]) -AC_CACHE_CHECK([for declaration of $1], bash_cv_decl_$1, -[AC_TRY_LINK( -[ -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif -], -[return !$1;], -bash_cv_decl_$1=yes, bash_cv_decl_$1=no)]) -bash_tr_func=HAVE_DECL_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_$1 = yes; then - AC_DEFINE_UNQUOTED($bash_tr_func, 1) -else - AC_DEFINE_UNQUOTED($bash_tr_func, 0) -fi +AC_CHECK_DECLS([$1]) ]) AC_DEFUN(BASH_DECL_PRINTF, [AC_MSG_CHECKING(for declaration of printf in ) AC_CACHE_VAL(bash_cv_printf_declared, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef __STDC__ typedef int (*_bashfunc)(const char *, ...); @@ -146,7 +80,7 @@ _bashfunc pf; pf = (_bashfunc) printf; exit(pf == 0); } -], bash_cv_printf_declared=yes, bash_cv_printf_declared=no, +]])], [bash_cv_printf_declared=yes], [bash_cv_printf_declared=no], [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes) bash_cv_printf_declared=yes] )]) @@ -191,7 +125,7 @@ AC_DEFUN(BASH_UNDER_SYS_SIGLIST, [AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST]) AC_MSG_CHECKING([for _sys_siglist in system C library]) AC_CACHE_VAL(bash_cv_under_sys_siglist, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #ifdef HAVE_UNISTD_H @@ -206,10 +140,12 @@ main() { char *msg = (char *)_sys_siglist[2]; exit(msg == 0); -}], - bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no, +} +]])], + [bash_cv_under_sys_siglist=yes], [bash_cv_under_sys_siglist=no], [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no) - bash_cv_under_sys_siglist=no])]) + bash_cv_under_sys_siglist=no] +)]) AC_MSG_RESULT($bash_cv_under_sys_siglist) if test $bash_cv_under_sys_siglist = yes; then AC_DEFINE(HAVE_UNDER_SYS_SIGLIST) @@ -231,7 +167,7 @@ AC_DEFUN(BASH_SYS_SIGLIST, [AC_REQUIRE([BASH_DECL_SYS_SIGLIST]) AC_MSG_CHECKING([for sys_siglist in system C library]) AC_CACHE_VAL(bash_cv_sys_siglist, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #ifdef HAVE_UNISTD_H @@ -246,10 +182,11 @@ main() { char *msg = sys_siglist[2]; exit(msg == 0); -}], - bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no, +} +]])], [bash_cv_sys_siglist=yes], [bash_cv_sys_siglist=no], [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no) - bash_cv_sys_siglist=no])]) + bash_cv_sys_siglist=no] +)]) AC_MSG_RESULT($bash_cv_sys_siglist) if test $bash_cv_sys_siglist = yes; then AC_DEFINE(HAVE_SYS_SIGLIST) @@ -291,7 +228,7 @@ dnl AC_DEFUN(BASH_FUNC_DUP2_CLOEXEC_CHECK, [AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag) AC_CACHE_VAL(bash_cv_dup2_broken, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -309,10 +246,10 @@ main() /* fl will be 1 if dup2 did not reset the close-on-exec flag. */ exit(fl != 1); } -], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no, +]])], [bash_cv_dup2_broken=yes], [bash_cv_dup2_broken=no], [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no) - bash_cv_dup2_broken=no]) -]) + bash_cv_dup2_broken=no] +)]) AC_MSG_RESULT($bash_cv_dup2_broken) if test $bash_cv_dup2_broken = yes; then AC_DEFINE(DUP2_BROKEN) @@ -322,11 +259,12 @@ fi AC_DEFUN(BASH_FUNC_STRSIGNAL, [AC_MSG_CHECKING([for the existence of strsignal]) AC_CACHE_VAL(bash_cv_have_strsignal, -[AC_TRY_LINK([#include +[AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include #include -#include ], -[char *s = (char *)strsignal(2);], - bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)]) +#include ]], +[[char *s = (char *)strsignal(2);]])], + [bash_cv_have_strsignal=yes], [bash_cv_have_strsignal=no])]) AC_MSG_RESULT($bash_cv_have_strsignal) if test $bash_cv_have_strsignal = yes; then AC_DEFINE(HAVE_STRSIGNAL) @@ -338,7 +276,7 @@ AC_DEFUN(BASH_FUNC_OPENDIR_CHECK, [AC_REQUIRE([AC_HEADER_DIRENT])dnl AC_MSG_CHECKING(if opendir() opens non-directories) AC_CACHE_VAL(bash_cv_opendir_not_robust, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -381,7 +319,8 @@ dir = opendir("bash-aclocal/not_a_directory"); unlink("bash-aclocal/not_a_directory"); rmdir("bash-aclocal"); exit (dir == 0); -}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no, +} +]])], [bash_cv_opendir_not_robust=yes], [bash_cv_opendir_not_robust=no], [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no) bash_cv_opendir_not_robust=no] )]) @@ -391,26 +330,6 @@ AC_DEFINE(OPENDIR_NOT_ROBUST) fi ]) -dnl -AC_DEFUN(BASH_TYPE_SIGHANDLER, -[AC_MSG_CHECKING([whether signal handlers are of type void]) -AC_CACHE_VAL(bash_cv_void_sighandler, -[AC_TRY_COMPILE([#include -#include -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" -#endif -void (*signal ()) ();], -[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl -AC_MSG_RESULT($bash_cv_void_sighandler) -if test $bash_cv_void_sighandler = yes; then -AC_DEFINE(VOID_SIGHANDLER) -fi -]) - dnl dnl A signed 16-bit integer quantity dnl @@ -498,82 +417,98 @@ else fi ]) -AC_DEFUN(BASH_TYPE_LONG_LONG, -[ -AC_CACHE_CHECK([for long long], bash_cv_type_long_long, -[AC_TRY_LINK([ -long long ll = 1; int i = 63;], -[ -long long llm = (long long) -1; -return ll << i | ll >> i | llm / ll | llm % ll; -], bash_cv_type_long_long='long long', bash_cv_type_long_long='long')]) -if test "$bash_cv_type_long_long" = 'long long'; then - AC_DEFINE(HAVE_LONG_LONG, 1) -fi -]) - -AC_DEFUN(BASH_TYPE_UNSIGNED_LONG_LONG, -[ -AC_CACHE_CHECK([for unsigned long long], bash_cv_type_unsigned_long_long, -[AC_TRY_LINK([ -unsigned long long ull = 1; int i = 63;], -[ -unsigned long long ullmax = (unsigned long long) -1; -return ull << i | ull >> i | ullmax / ull | ullmax % ull; -], bash_cv_type_unsigned_long_long='unsigned long long', - bash_cv_type_unsigned_long_long='unsigned long')]) -if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then - AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1) -fi -]) - -dnl -dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0) -dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use -dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify -dnl matters, this just checks for rlim_t, quad_t, or long. -dnl -AC_DEFUN(BASH_TYPE_RLIMIT, -[AC_MSG_CHECKING(for size and type of struct rlimit fields) -AC_CACHE_VAL(bash_cv_type_rlimit, -[AC_TRY_COMPILE([#include -#include ], -[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[ -AC_TRY_RUN([ -#include +AC_DEFUN(BASH_SIZEOF_RLIMIT, +[AC_MSG_CHECKING(for size of struct rlimit fields) +AC_CACHE_VAL(bash_cv_sizeof_rlim_cur, +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#ifdef HAVE_SYS_TIME_H #include -#include +#endif #include -int +#include main() { -#ifdef HAVE_QUAD_T - struct rlimit rl; - if (sizeof(rl.rlim_cur) == sizeof(quad_t)) - exit(0); -#endif - exit(1); -}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long, - [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long) - bash_cv_type_rlimit=long])]) +struct rlimit r; +exit(sizeof (r.rlim_cur)); +} +]])], [bash_cv_sizeof_rlim_cur=$?], [bash_cv_sizeof_rlim_cur=$?], + [AC_MSG_WARN(cannot check size of rlimit fields if cross compiling -- defaulting to long) + bash_cv_sizeof_rlim_cur=$ac_cv_sizeof_long] +)]) +AC_MSG_RESULT($bash_cv_sizeof_rlim_cur) ]) -AC_MSG_RESULT($bash_cv_type_rlimit) -if test $bash_cv_type_rlimit = quad_t; then -AC_DEFINE(RLIMTYPE, quad_t) -elif test $bash_cv_type_rlimit = rlim_t; then -AC_DEFINE(RLIMTYPE, rlim_t) + +AC_DEFUN(BASH_SIZEOF_QUAD_T, +[AC_MSG_CHECKING(for size of quad_t) +AC_CACHE_VAL(bash_cv_sizeof_quad_t, +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif + +main() +{ +#if HAVE_QUAD_T +quad_t x; +exit(sizeof (x)); +#else +exit (0); +#endif +} +]])], [bash_cv_sizeof_quad_t=$?], [bash_cv_sizeof_quad_t=$?], + [AC_MSG_WARN(cannot check size of quad_t if cross compiling -- defaulting to 0) + bash_cv_sizeof_quad_t=0] +)]) +AC_MSG_RESULT($bash_cv_sizeof_quad_t) +]) + +dnl +dnl Type of struct rlimit fields: updated to check POSIX rlim_t and +dnl if it doesn't exist determine the best guess based on sizeof(r.rlim_cur) +dnl +AC_DEFUN(BASH_TYPE_RLIMIT, +[AC_MSG_CHECKING(for type of struct rlimit fields) +AC_CACHE_VAL(bash_cv_type_rlimit, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include ]], +[[rlim_t xxx;]] +)], + [bash_cv_type_rlimit=rlim_t], [ +BASH_SIZEOF_RLIMIT +BASH_SIZEOF_QUAD_T +if test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_long; then + bash_cv_type_rlimit='unsigned long' +elif test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_long_long; then + bash_cv_type_rlimit='unsigned long long' +elif test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_int; then + bash_cv_type_rlimit='unsigned int' +elif test $bash_cv_sizeof_rlim_cur = $bash_cv_sizeof_quad_t; then + bash_cv_type_rlimit='quad_t' +else + bash_cv_type_rlimit='unsigned long' fi +] +)]) +AC_MSG_RESULT($bash_cv_type_rlimit) +AC_DEFINE_UNQUOTED([RLIMTYPE], [$bash_cv_type_rlimit]) ]) AC_DEFUN(BASH_TYPE_SIG_ATOMIC_T, [AC_CACHE_CHECK([for sig_atomic_t in signal.h], ac_cv_have_sig_atomic_t, -[AC_TRY_LINK([ -#include -],[ sig_atomic_t x; ], -ac_cv_have_sig_atomic_t=yes, ac_cv_have_sig_atomic_t=no)]) +[AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ #include ]], + [[ sig_atomic_t x; ]])], + [ac_cv_have_sig_atomic_t=yes],[ac_cv_have_sig_atomic_t=no])]) if test "$ac_cv_have_sig_atomic_t" = "no" then - AC_CHECK_TYPE(sig_atomic_t,int) + BASH_CHECK_TYPE(sig_atomic_t, [#include ], int) fi ]) @@ -581,11 +516,13 @@ AC_DEFUN(BASH_FUNC_LSTAT, [dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an dnl inline function in . AC_CACHE_CHECK([for lstat], bash_cv_func_lstat, -[AC_TRY_LINK([ -#include -#include -],[ lstat(".",(struct stat *)0); ], -bash_cv_func_lstat=yes, bash_cv_func_lstat=no)]) +[AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ + #include + #include + ]], + [[ lstat(".",(struct stat *)0); ]])], + [bash_cv_func_lstat=yes],[bash_cv_func_lstat=no])]) if test $bash_cv_func_lstat = yes; then AC_DEFINE(HAVE_LSTAT) fi @@ -594,12 +531,12 @@ fi AC_DEFUN(BASH_FUNC_INET_ATON, [ AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton, -[AC_TRY_LINK([ +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include -struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ], -bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)]) +struct in_addr ap;]], [[ inet_aton("127.0.0.1", &ap); ]])], +[bash_cv_func_inet_aton=yes], [bash_cv_func_inet_aton=no])]) if test $bash_cv_func_inet_aton = yes; then AC_DEFINE(HAVE_INET_ATON) else @@ -610,7 +547,7 @@ fi AC_DEFUN(BASH_FUNC_GETENV, [AC_MSG_CHECKING(to see if getenv can be redefined) AC_CACHE_VAL(bash_cv_getenv_redef, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_UNISTD_H # include #endif @@ -643,7 +580,7 @@ exit(1); s = getenv("ABCDE"); exit(s == 0); /* force optimizer to leave getenv in */ } -], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no, +]])], [bash_cv_getenv_redef=yes], [bash_cv_getenv_redef=no], [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes) bash_cv_getenv_redef=yes] )]) @@ -718,7 +655,7 @@ fi AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS, [AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize) AC_CACHE_VAL(bash_cv_ulimit_maxfds, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_ULIMIT_H #include @@ -729,7 +666,7 @@ main() long maxfds = ulimit(4, 0L); exit (maxfds == -1L); } -], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no, +]])], [bash_cv_ulimit_maxfds=yes], [bash_cv_ulimit_maxfds=no], [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no) bash_cv_ulimit_maxfds=no] )]) @@ -742,7 +679,7 @@ fi AC_DEFUN(BASH_FUNC_GETCWD, [AC_MSG_CHECKING([if getcwd() will dynamically allocate memory with 0 size]) AC_CACHE_VAL(bash_cv_getcwd_malloc, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_UNISTD_H #include @@ -756,7 +693,7 @@ main() xpwd = getcwd(0, 0); exit (xpwd == 0); } -], bash_cv_getcwd_malloc=yes, bash_cv_getcwd_malloc=no, +]])], [bash_cv_getcwd_malloc=yes], [bash_cv_getcwd_malloc=no], [AC_MSG_WARN(cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no) bash_cv_getcwd_malloc=no] )]) @@ -796,7 +733,7 @@ fi AC_DEFUN(BASH_FUNC_FNMATCH_EXTMATCH, [AC_MSG_CHECKING(if fnmatch does extended pattern matching with FNM_EXTMATCH) AC_CACHE_VAL(bash_cv_fnm_extmatch, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int @@ -808,10 +745,10 @@ main() return (1); #endif } -], bash_cv_fnm_extmatch=yes, bash_cv_fnm_extmatch=no, +]])], [bash_cv_fnm_extmatch=yes], [bash_cv_fnm_extmatch=no], [AC_MSG_WARN(cannot check FNM_EXTMATCH if cross compiling -- defaulting to no) - bash_cv_fnm_extmatch=no]) -]) + bash_cv_fnm_extmatch=no] +)]) AC_MSG_RESULT($bash_cv_fnm_extmatch) if test $bash_cv_fnm_extmatch = yes; then AC_DEFINE(HAVE_LIBC_FNM_EXTMATCH) @@ -822,7 +759,7 @@ AC_DEFUN(BASH_FUNC_POSIX_SETJMP, [AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp) AC_CACHE_VAL(bash_cv_func_sigsetjmp, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_UNISTD_H #include #endif @@ -861,7 +798,8 @@ sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); siglongjmp(xx, 10); exit(1); #endif -}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing, +} +]])], [bash_cv_func_sigsetjmp=present], [bash_cv_func_sigsetjmp=missing], [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing) bash_cv_func_sigsetjmp=missing] )]) @@ -872,10 +810,9 @@ fi ]) AC_DEFUN(BASH_FUNC_STRCOLL, -[ -AC_MSG_CHECKING(whether or not strcoll and strcmp differ) +[AC_MSG_CHECKING(whether or not strcoll and strcmp differ) AC_CACHE_VAL(bash_cv_func_strcoll_broken, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #if defined (HAVE_LOCALE_H) #include @@ -913,7 +850,7 @@ char *v[]; in the default locale. */ exit (r1 > 0 && r2 > 0); } -], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no, +]])], [bash_cv_func_strcoll_broken=yes], [bash_cv_func_strcoll_broken=no], [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no) bash_cv_func_strcoll_broken=no] )]) @@ -926,7 +863,7 @@ fi AC_DEFUN(BASH_FUNC_PRINTF_A_FORMAT, [AC_MSG_CHECKING([for printf floating point output in hex notation]) AC_CACHE_VAL(bash_cv_printf_a_format, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -940,7 +877,7 @@ main() sprintf(abuf, "%A", y); exit(strchr(abuf, 'P') == (char *)0); } -], bash_cv_printf_a_format=yes, bash_cv_printf_a_format=no, +]])], [bash_cv_printf_a_format=yes], [bash_cv_printf_a_format=no], [AC_MSG_WARN(cannot check printf if cross compiling -- defaulting to no) bash_cv_printf_a_format=no] )]) @@ -1090,11 +1027,12 @@ if test $bash_cv_have_socklib = yes; then fi ]) -AC_DEFUN(BASH_STRUCT_DIRENT_D_INO, -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(for struct dirent.d_ino) -AC_CACHE_VAL(bash_cv_dirent_has_dino, -[AC_TRY_COMPILE([ +dnl like _AC_STRUCT_DIRENT(MEMBER) but public +AC_DEFUN(BASH_STRUCT_DIRENT, +[ +AC_REQUIRE([AC_HEADER_DIRENT]) +AC_CHECK_MEMBERS(struct dirent.$1, bash_cv_dirent_has_$1=yes, bash_cv_dirent_has_$1=no, +[[ #include #include #ifdef HAVE_UNISTD_H @@ -1114,11 +1052,15 @@ AC_CACHE_VAL(bash_cv_dirent_has_dino, # include # endif #endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = d.d_ino; -], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)]) -AC_MSG_RESULT($bash_cv_dirent_has_dino) -if test $bash_cv_dirent_has_dino = yes; then +]]) +]) + +AC_DEFUN(BASH_STRUCT_DIRENT_D_INO, +[AC_REQUIRE([AC_HEADER_DIRENT]) +AC_MSG_CHECKING(for struct dirent.d_ino) +AC_CACHE_VAL(bash_cv_dirent_has_d_ino, [BASH_STRUCT_DIRENT([d_ino])]) +AC_MSG_RESULT($bash_cv_dirent_has_d_ino) +if test $bash_cv_dirent_has_d_ino = yes; then AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO) fi ]) @@ -1126,30 +1068,7 @@ fi AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO, [AC_REQUIRE([AC_HEADER_DIRENT]) AC_MSG_CHECKING(for struct dirent.d_fileno) -AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, -[AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ -#if defined(HAVE_DIRENT_H) -# include -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* SYSNDIR */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* SYSDIR */ -# ifdef HAVE_NDIR_H -# include -# endif -#endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = d.d_fileno; -], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)]) +AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, [BASH_STRUCT_DIRENT([d_fileno])]) AC_MSG_RESULT($bash_cv_dirent_has_d_fileno) if test $bash_cv_dirent_has_d_fileno = yes; then AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO) @@ -1159,30 +1078,7 @@ fi AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN, [AC_REQUIRE([AC_HEADER_DIRENT]) AC_MSG_CHECKING(for struct dirent.d_namlen) -AC_CACHE_VAL(bash_cv_dirent_has_d_namlen, -[AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ -#if defined(HAVE_DIRENT_H) -# include -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* SYSNDIR */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* SYSDIR */ -# ifdef HAVE_NDIR_H -# include -# endif -#endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = d.d_namlen; -], bash_cv_dirent_has_d_namlen=yes, bash_cv_dirent_has_d_namlen=no)]) +AC_CACHE_VAL(bash_cv_dirent_has_d_namlen, [BASH_STRUCT_DIRENT([d_namlen])]) AC_MSG_RESULT($bash_cv_dirent_has_d_namlen) if test $bash_cv_dirent_has_d_namlen = yes; then AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN) @@ -1249,8 +1145,7 @@ fi dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) AC_DEFUN(BASH_SYS_SIGNAL_VINTAGE, -[AC_REQUIRE([AC_TYPE_SIGNAL]) -AC_MSG_CHECKING(for type of signal functions) +[AC_MSG_CHECKING(for type of signal functions) AC_CACHE_VAL(bash_cv_signal_vintage, [ AC_TRY_LINK([#include ],[ @@ -1268,7 +1163,7 @@ AC_CACHE_VAL(bash_cv_signal_vintage, [ AC_TRY_LINK([ #include - RETSIGTYPE foo() { }], [ + void foo() { }], [ int mask = sigmask(SIGINT); sigset(SIGINT, foo); sigrelse(SIGINT); sighold(SIGINT); sigpause(SIGINT); @@ -1292,7 +1187,7 @@ AC_DEFUN(BASH_SYS_PGRP_SYNC, [AC_REQUIRE([AC_FUNC_GETPGRP]) AC_MSG_CHECKING(whether pgrps need synchronization) AC_CACHE_VAL(bash_cv_pgrp_pipe, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_UNISTD_H # include #endif @@ -1345,10 +1240,10 @@ main() wait(&status); exit(ok ? 0 : 5); } -], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes, +]])], [bash_cv_pgrp_pipe=no], [bash_cv_pgrp_pipe=yes], [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no) - bash_cv_pgrp_pipe=no]) -]) + bash_cv_pgrp_pipe=no] +)]) AC_MSG_RESULT($bash_cv_pgrp_pipe) if test $bash_cv_pgrp_pipe = yes; then AC_DEFINE(PGRP_PIPE) @@ -1356,18 +1251,17 @@ fi ]) AC_DEFUN(BASH_SYS_REINSTALL_SIGHANDLERS, -[AC_REQUIRE([AC_TYPE_SIGNAL]) -AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) +[AC_REQUIRE([BASH_SYS_SIGNAL_VINTAGE]) AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked]) AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_UNISTD_H #include #endif #include -typedef RETSIGTYPE sigfunc(); +typedef void sigfunc(); volatile int nsigint; @@ -1389,7 +1283,7 @@ set_signal_handler(sig, handler) #define set_signal_handler(s, h) signal(s, h) #endif -RETSIGTYPE +void sigint(s) int s; { @@ -1405,7 +1299,7 @@ main() kill((int)getpid(), SIGINT); exit(nsigint != 2); } -], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes, +]])], [bash_cv_must_reinstall_sighandlers=no], [bash_cv_must_reinstall_sighandlers=yes], [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no) bash_cv_must_reinstall_sighandlers=no] )]) @@ -1474,7 +1368,7 @@ dnl this requires a previous check for mkfifo, but that is awkward to specify AC_DEFUN(BASH_SYS_NAMED_PIPES, [AC_MSG_CHECKING(for presence of named pipes) AC_CACHE_VAL(bash_cv_sys_named_pipes, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #ifdef HAVE_UNISTD_H @@ -1514,7 +1408,8 @@ close(fd); unlink ("bash-aclocal/sh-np-autoconf"); rmdir ("bash-aclocal"); exit(0); -}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing, +} +]])], [bash_cv_sys_named_pipes=present], [bash_cv_sys_named_pipes=missing], [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing) bash_cv_sys_named_pipes=missing] )]) @@ -1588,8 +1483,11 @@ dnl AC_DEFUN(BASH_CHECK_SPEED_T, [AC_MSG_CHECKING(for speed_t in sys/types.h) AC_CACHE_VAL(bash_cv_speed_t_in_sys_types, -[AC_TRY_COMPILE([#include ], [speed_t x;], - bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)]) +[AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[speed_t x;]])], + [bash_cv_speed_t_in_sys_types=yes],[bash_cv_speed_t_in_sys_types=no])]) AC_MSG_RESULT($bash_cv_speed_t_in_sys_types) if test $bash_cv_speed_t_in_sys_types = yes; then AC_DEFINE(SPEED_T_IN_SYS_TYPES) @@ -1672,7 +1570,8 @@ AC_CACHE_VAL(bash_cv_kernel_rlimit, [ int f; f = RLIMIT_DATA; -], bash_cv_kernel_rlimit=no, +], +[bash_cv_kernel_rlimit=no], [AC_TRY_COMPILE([ #include #define _KERNEL @@ -1682,7 +1581,8 @@ AC_CACHE_VAL(bash_cv_kernel_rlimit, [ int f; f = RLIMIT_DATA; -], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)] +], [bash_cv_kernel_rlimit=yes], [bash_cv_kernel_rlimit=no] +)] )]) AC_MSG_RESULT($bash_cv_kernel_rlimit) if test $bash_cv_kernel_rlimit = yes; then @@ -1713,7 +1613,7 @@ fi]) AC_DEFUN(BASH_CHECK_RTSIGS, [AC_MSG_CHECKING(for unusable real-time signals due to large values) AC_CACHE_VAL(bash_cv_unusable_rtsigs, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -1733,7 +1633,8 @@ main () #endif exit(rtmin < n_sigs); -}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no, +} +]])], [bash_cv_unusable_rtsigs=yes], [bash_cv_unusable_rtsigs=no], [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes) bash_cv_unusable_rtsigs=yes] )]) @@ -1829,7 +1730,7 @@ fi dnl check for broken wcwidth AC_CACHE_CHECK([for wcwidth broken with unicode combining characters], bash_cv_wcwidth_broken, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -1848,8 +1749,9 @@ char **v; w = wcwidth (0x0301); exit (w == 0); /* exit 0 if wcwidth broken */ } -], -bash_cv_wcwidth_broken=yes, bash_cv_wcwidth_broken=no, bash_cv_wcwidth_broken=no)]) +]])], [bash_cv_wcwidth_broken=yes], [bash_cv_wcwidth_broken=no], + [bash_cv_wcwidth_broken=no] +)]) if test "$bash_cv_wcwidth_broken" = yes; then AC_DEFINE(WCWIDTH_BROKEN, 1, [wcwidth is usually not broken]) fi @@ -1899,7 +1801,7 @@ CFLAGS="$CFLAGS -I${ac_cv_rl_includedir}" LDFLAGS="$LDFLAGS -L${ac_cv_rl_libdir}" AC_CACHE_VAL(ac_cv_rl_version, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -1920,10 +1822,11 @@ main() fclose(fp); exit(0); } -], -ac_cv_rl_version=`cat conftest.rlv`, -ac_cv_rl_version='0.0', -ac_cv_rl_version='8.0')]) +]])], +[ac_cv_rl_version=`cat conftest.rlv`], +[ac_cv_rl_version='0.0'], +[ac_cv_rl_version='8.0'] +)]) CFLAGS="$_save_CFLAGS" LDFLAGS="$_save_LDFLAGS" @@ -1986,57 +1889,11 @@ AC_MSG_RESULT($ac_cv_rl_version) fi ]) -AC_DEFUN(BASH_FUNC_CTYPE_NONASCII, -[ -AC_MSG_CHECKING(whether the ctype macros accept non-ascii characters) -AC_CACHE_VAL(bash_cv_func_ctype_nonascii, -[AC_TRY_RUN([ -#ifdef HAVE_LOCALE_H -#include -#endif -#include -#include -#include - -int -main(c, v) -int c; -char *v[]; -{ - char *deflocale; - unsigned char x; - int r1, r2; - -#ifdef HAVE_SETLOCALE - /* We take a shot here. If that locale is not known, try the - system default. We try this one because '\342' (226) is - known to be a printable character in that locale. */ - deflocale = setlocale(LC_ALL, "en_US.ISO8859-1"); - if (deflocale == 0) - deflocale = setlocale(LC_ALL, ""); -#endif - - x = '\342'; - r1 = isprint(x); - x -= 128; - r2 = isprint(x); - exit (r1 == 0 || r2 == 0); -} -], bash_cv_func_ctype_nonascii=yes, bash_cv_func_ctype_nonascii=no, - [AC_MSG_WARN(cannot check ctype macros if cross compiling -- defaulting to no) - bash_cv_func_ctype_nonascii=no] -)]) -AC_MSG_RESULT($bash_cv_func_ctype_nonascii) -if test $bash_cv_func_ctype_nonascii = yes; then -AC_DEFINE(CTYPE_NON_ASCII) -fi -]) - AC_DEFUN(BASH_CHECK_WCONTINUED, [ AC_MSG_CHECKING(whether WCONTINUED flag to waitpid is unavailable or available but broken) AC_CACHE_VAL(bash_cv_wcontinued_broken, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -2057,7 +1914,7 @@ main() else exit (0); } -], bash_cv_wcontinued_broken=no,bash_cv_wcontinued_broken=yes, +]])], [bash_cv_wcontinued_broken=no], [bash_cv_wcontinued_broken=yes], [AC_MSG_WARN(cannot check WCONTINUED if cross compiling -- defaulting to no) bash_cv_wcontinued_broken=no] )]) @@ -2110,7 +1967,7 @@ AC_DEFUN([BASH_FUNC_SNPRINTF], AC_CHECK_FUNCS_ONCE([snprintf]) if test X$ac_cv_func_snprintf = Xyes; then AC_CACHE_CHECK([for standard-conformant snprintf], [bash_cv_func_snprintf], - [AC_TRY_RUN([ + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include @@ -2121,7 +1978,7 @@ main() n = snprintf (0, 0, "%s", "0123456"); exit(n != 7); } -], bash_cv_func_snprintf=yes, bash_cv_func_snprintf=no, +]])], [bash_cv_func_snprintf=yes], [bash_cv_func_snprintf=no], [AC_MSG_WARN([cannot check standard snprintf if cross-compiling]) bash_cv_func_snprintf=yes] )]) @@ -2140,7 +1997,7 @@ AC_DEFUN([BASH_FUNC_VSNPRINTF], AC_CHECK_FUNCS_ONCE([vsnprintf]) if test X$ac_cv_func_vsnprintf = Xyes; then AC_CACHE_CHECK([for standard-conformant vsnprintf], [bash_cv_func_vsnprintf], - [AC_TRY_RUN([ + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #if HAVE_STDARG_H #include #else @@ -2178,7 +2035,7 @@ main() n = foo("%s", "0123456"); exit(n != 7); } -], bash_cv_func_vsnprintf=yes, bash_cv_func_vsnprintf=no, +]])], [bash_cv_func_vsnprintf=yes], [bash_cv_func_vsnprintf=no], [AC_MSG_WARN([cannot check standard vsnprintf if cross-compiling]) bash_cv_func_vsnprintf=yes] )]) @@ -2195,7 +2052,7 @@ main() 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_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include @@ -2229,7 +2086,7 @@ main(c, v) exit (254); } -], bash_cv_wexitstatus_offset=0, bash_cv_wexitstatus_offset=$?, +]])], [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] )]) @@ -2245,13 +2102,15 @@ AC_DEFUN([BASH_FUNC_SBRK], [ AC_MSG_CHECKING([for sbrk]) AC_CACHE_VAL(ac_cv_func_sbrk, - [AC_TRY_LINK([#include ], - [ void *x = sbrk (4096); ], - ac_cv_func_sbrk=yes, ac_cv_func_sbrk=no)]) + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[ void *x = sbrk (4096); ]])], + [ac_cv_func_sbrk=yes],[ac_cv_func_sbrk=no])]) AC_MSG_RESULT($ac_cv_func_sbrk) if test X$ac_cv_func_sbrk = Xyes; then AC_CACHE_CHECK([for working sbrk], [bash_cv_func_sbrk], - [AC_TRY_RUN([ + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include @@ -2263,10 +2122,9 @@ main(int c, char **v) x = sbrk (4096); exit ((x == (void *)-1) ? 1 : 0); } -], bash_cv_func_sbrk=yes, bash_cv_func_snprintf=sbrk, - [AC_MSG_WARN([cannot check working sbrk if cross-compiling]) - bash_cv_func_sbrk=yes] -)]) +]])],[bash_cv_func_sbrk=yes],[bash_cv_func_sbrk=no],[AC_MSG_WARN([cannot check working sbrk if cross-compiling]) + bash_cv_func_sbrk=yes +])]) if test $bash_cv_func_sbrk = no; then ac_cv_func_sbrk=no fi @@ -2280,7 +2138,7 @@ main(int c, char **v) AC_DEFUN(BASH_FUNC_FNMATCH_EQUIV_FALLBACK, [AC_MSG_CHECKING(whether fnmatch can be used to check bracket equivalence classes) AC_CACHE_VAL(bash_cv_fnmatch_equiv_fallback, -[AC_TRY_RUN([ +[AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include @@ -2300,8 +2158,7 @@ main (int c, char **v) exit (0); exit (1); } - -], bash_cv_fnmatch_equiv_fallback=yes, bash_cv_fnmatch_equiv_fallback=no, +]])], [bash_cv_fnmatch_equiv_fallback=yes], [bash_cv_fnmatch_equiv_fallback=no], [AC_MSG_WARN(cannot check fnmatch if cross compiling -- defaulting to no) bash_cv_fnmatch_equiv_fallback=no] )]) diff --git a/config.h.in b/config.h.in index a531fccd..73dbbc24 100644 --- a/config.h.in +++ b/config.h.in @@ -210,10 +210,10 @@ #undef __CHAR_UNSIGNED__ -/* Define if the compiler supports `long long' variables. */ -#undef HAVE_LONG_LONG +/* Define if the compiler supports `long long int' variables. */ +#undef HAVE_LONG_LONG_INT -#undef HAVE_UNSIGNED_LONG_LONG +#undef HAVE_UNSIGNED_LONG_LONG_INT /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/configure b/configure index bb4cb3b8..e879409a 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac for Bash 5.1, version 5.028. +# From configure.ac for Bash 5.1, version 5.031. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for bash 5.1-maint. # @@ -5048,7 +5048,6 @@ then : fi - # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : @@ -5979,6 +5978,7 @@ else $as_nop if test "$cross_compiling" = yes then : ac_cv_rl_version='8.0' + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14829,7 +14829,6 @@ esac fi - ac_fn_c_check_func "$LINENO" "__setostype" "ac_cv_func___setostype" if test "x$ac_cv_func___setostype" = xyes then : @@ -15665,6 +15664,7 @@ int main (void) { long double r; char *foo, bar; r = strtold(foo, &bar); + ; return 0; } @@ -15690,281 +15690,59 @@ printf "%s\n" "$bash_cv_strtold_broken" >&6; } fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoimax" >&5 -printf %s "checking for declaration of strtoimax... " >&6; } -if test ${bash_cv_decl_strtoimax+y} +ac_fn_check_decl "$LINENO" "strtoimax" "ac_cv_have_decl_strtoimax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoimax" = xyes then : - printf %s "(cached) " >&6 + ac_have_decl=1 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRTOIMAX $ac_have_decl" >>confdefs.h -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtoimax; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +ac_fn_check_decl "$LINENO" "strtol" "ac_cv_have_decl_strtol" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtol" = xyes then : - bash_cv_decl_strtoimax=yes + ac_have_decl=1 else $as_nop - bash_cv_decl_strtoimax=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoimax" >&5 -printf "%s\n" "$bash_cv_decl_strtoimax" >&6; } -bash_tr_func=HAVE_DECL_`echo strtoimax | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtoimax = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h +printf "%s\n" "#define HAVE_DECL_STRTOL $ac_have_decl" >>confdefs.h -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtol" >&5 -printf %s "checking for declaration of strtol... " >&6; } -if test ${bash_cv_decl_strtol+y} +ac_fn_check_decl "$LINENO" "strtoll" "ac_cv_have_decl_strtoll" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoll" = xyes then : - printf %s "(cached) " >&6 + ac_have_decl=1 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRTOLL $ac_have_decl" >>confdefs.h -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtol; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +ac_fn_check_decl "$LINENO" "strtoul" "ac_cv_have_decl_strtoul" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoul" = xyes then : - bash_cv_decl_strtol=yes + ac_have_decl=1 else $as_nop - bash_cv_decl_strtol=no + ac_have_decl=0 fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtol" >&5 -printf "%s\n" "$bash_cv_decl_strtol" >&6; } -bash_tr_func=HAVE_DECL_`echo strtol | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtol = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h +printf "%s\n" "#define HAVE_DECL_STRTOUL $ac_have_decl" >>confdefs.h -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoll" >&5 -printf %s "checking for declaration of strtoll... " >&6; } -if test ${bash_cv_decl_strtoll+y} +ac_fn_check_decl "$LINENO" "strtoull" "ac_cv_have_decl_strtoull" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoull" = xyes then : - printf %s "(cached) " >&6 + ac_have_decl=1 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRTOULL $ac_have_decl" >>confdefs.h -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtoll; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" +ac_fn_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strtoumax" = xyes then : - bash_cv_decl_strtoll=yes + ac_have_decl=1 else $as_nop - bash_cv_decl_strtoll=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoll" >&5 -printf "%s\n" "$bash_cv_decl_strtoll" >&6; } -bash_tr_func=HAVE_DECL_`echo strtoll | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtoll = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h - -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoul" >&5 -printf %s "checking for declaration of strtoul... " >&6; } -if test ${bash_cv_decl_strtoul+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtoul; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - bash_cv_decl_strtoul=yes -else $as_nop - bash_cv_decl_strtoul=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoul" >&5 -printf "%s\n" "$bash_cv_decl_strtoul" >&6; } -bash_tr_func=HAVE_DECL_`echo strtoul | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtoul = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h - -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoull" >&5 -printf %s "checking for declaration of strtoull... " >&6; } -if test ${bash_cv_decl_strtoull+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtoull; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - bash_cv_decl_strtoull=yes -else $as_nop - bash_cv_decl_strtoull=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoull" >&5 -printf "%s\n" "$bash_cv_decl_strtoull" >&6; } -bash_tr_func=HAVE_DECL_`echo strtoull | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtoull = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h - -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declaration of strtoumax" >&5 -printf %s "checking for declaration of strtoumax... " >&6; } -if test ${bash_cv_decl_strtoumax+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_STDLIB_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -int -main (void) -{ -return !strtoumax; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - bash_cv_decl_strtoumax=yes -else $as_nop - bash_cv_decl_strtoumax=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_decl_strtoumax" >&5 -printf "%s\n" "$bash_cv_decl_strtoumax" >&6; } -bash_tr_func=HAVE_DECL_`echo strtoumax | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` -if test $bash_cv_decl_strtoumax = yes; then - printf "%s\n" "#define $bash_tr_func 1" >>confdefs.h - -else - printf "%s\n" "#define $bash_tr_func 0" >>confdefs.h - + ac_have_decl=0 fi +printf "%s\n" "#define HAVE_DECL_STRTOUMAX $ac_have_decl" >>confdefs.h @@ -16826,6 +16604,7 @@ else $as_nop if test "$cross_compiling" = yes then : bash_cv_wcwidth_broken=no + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17490,80 +17269,130 @@ fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long" >&5 -printf %s "checking for long long... " >&6; } -if test ${bash_cv_type_long_long+y} + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +printf %s "checking for long long int... " >&6; } +if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 +else $as_nop + ac_cv_type_long_long_int=yes + case $ac_prog_cc_stdc in + no | c89) ;; + *) + ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int + if test $ac_cv_type_long_long_int = yes; then + if test "$cross_compiling" = yes +then : + : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -long long ll = 1; int i = 63; +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int main (void) { - -long long llm = (long long) -1; -return ll << i | ll >> i | llm / ll | llm % ll; - +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_run "$LINENO" then : - bash_cv_type_long_long='long long' + else $as_nop - bash_cv_type_long_long='long' + ac_cv_type_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_long_long" >&5 -printf "%s\n" "$bash_cv_type_long_long" >&6; } -if test "$bash_cv_type_long_long" = 'long long'; then - printf "%s\n" "#define HAVE_LONG_LONG 1" >>confdefs.h - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi;; + esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long" >&5 -printf %s "checking for unsigned long long... " >&6; } -if test ${bash_cv_type_unsigned_long_long+y} +printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 +printf %s "checking for unsigned long long int... " >&6; } +if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_type_unsigned_long_long_int=yes + case $ac_prog_cc_stdc in + no | c89) ;; + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -unsigned long long ull = 1; int i = 63; + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main (void) { - -unsigned long long ullmax = (unsigned long long) -1; -return ull << i | ull >> i | ullmax / ull | ullmax % ull; - +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } + _ACEOF if ac_fn_c_try_link "$LINENO" then : - bash_cv_type_unsigned_long_long='unsigned long long' + else $as_nop - bash_cv_type_unsigned_long_long='unsigned long' + ac_cv_type_unsigned_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext;; + esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_unsigned_long_long" >&5 -printf "%s\n" "$bash_cv_type_unsigned_long_long" >&6; } -if test "$bash_cv_type_unsigned_long_long" = 'unsigned long long'; then - printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 +printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then -fi +printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h + + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t in signal.h" >&5 @@ -17574,9 +17403,7 @@ then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include - + #include int main (void) { @@ -17598,13 +17425,48 @@ fi printf "%s\n" "$ac_cv_have_sig_atomic_t" >&6; } if test "$ac_cv_have_sig_atomic_t" = "no" then - ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "$ac_includes_default" -if test "x$ac_cv_type_sig_atomic_t" = xyes + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t" >&5 +printf %s "checking for sig_atomic_t... " >&6; } +if test ${bash_cv_type_sig_atomic_t+y} then : - + printf %s "(cached) " >&6 else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_STDLIB_H +#include +#endif +#if HAVE_STDDEF_H +#include +#endif +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif +#include -printf "%s\n" "#define sig_atomic_t int" >>confdefs.h +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "sig_atomic_t" >/dev/null 2>&1 +then : + bash_cv_type_sig_atomic_t=yes +else $as_nop + bash_cv_type_sig_atomic_t=no +fi +rm -rf conftest* + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_sig_atomic_t" >&5 +printf "%s\n" "$bash_cv_type_sig_atomic_t" >&6; } + +if test $bash_cv_type_sig_atomic_t = no; then + printf "%s\n" "#define sig_atomic_t int" >>confdefs.h fi @@ -18230,8 +18092,8 @@ else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include + #include + #include int main (void) @@ -18270,6 +18132,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check dup2 if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check dup2 if cross compiling -- defaulting to no" >&2;} bash_cv_dup2_broken=no + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18303,7 +18166,6 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dup2_broken" >&5 @@ -18325,6 +18187,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check pgrp synchronization if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check pgrp synchronization if cross compiling -- defaulting to no" >&2;} bash_cv_pgrp_pipe=no + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18393,7 +18256,6 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_pgrp_pipe" >&5 @@ -18403,40 +18265,6 @@ printf "%s\n" "#define PGRP_PIPE 1" >>confdefs.h fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -printf %s "checking return type of signal handlers... " >&6; } -if test ${ac_cv_type_signal+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main (void) -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_type_signal=int -else $as_nop - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -printf "%s\n" "$ac_cv_type_signal" >&6; } - -printf "%s\n" "#define RETSIGTYPE $ac_cv_type_signal" >>confdefs.h - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for type of signal functions" >&5 printf %s "checking for type of signal functions... " >&6; } if test ${bash_cv_signal_vintage+y} @@ -18489,7 +18317,7 @@ else $as_nop /* end confdefs.h. */ #include - RETSIGTYPE foo() { } + void foo() { } int main (void) { @@ -18599,6 +18427,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for sys_siglist if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check for sys_siglist if cross compiling -- defaulting to no" >&2;} bash_cv_sys_siglist=no + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18618,6 +18447,7 @@ main() char *msg = sys_siglist[2]; exit(msg == 0); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -18687,6 +18517,7 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for _sys_siglist if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check for _sys_siglist if cross compiling -- defaulting to no" >&2;} bash_cv_under_sys_siglist=no + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18706,6 +18537,7 @@ main() char *msg = (char *)_sys_siglist[2]; exit(msg == 0); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -18817,189 +18649,6 @@ if test $bash_cv_type_sigset_t = no; then fi - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t" >&5 -printf %s "checking for sig_atomic_t... " >&6; } -if test ${bash_cv_type_sig_atomic_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STDDEF_H -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif -#if HAVE_STDINT_H -#include -#endif -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sig_atomic_t" >/dev/null 2>&1 -then : - bash_cv_type_sig_atomic_t=yes -else $as_nop - bash_cv_type_sig_atomic_t=no -fi -rm -rf conftest* - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_sig_atomic_t" >&5 -printf "%s\n" "$bash_cv_type_sig_atomic_t" >&6; } - -if test $bash_cv_type_sig_atomic_t = no; then - printf "%s\n" "#define sig_atomic_t int" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for quad_t" >&5 -printf %s "checking for quad_t... " >&6; } -if test ${bash_cv_type_quad_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STDDEF_H -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif -#if HAVE_STDINT_H -#include -#endif - - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "quad_t" >/dev/null 2>&1 -then : - bash_cv_type_quad_t=yes -else $as_nop - bash_cv_type_quad_t=no -fi -rm -rf conftest* - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_quad_t" >&5 -printf "%s\n" "$bash_cv_type_quad_t" >&6; } -if test $bash_cv_type_quad_t = yes; then - printf "%s\n" "#define HAVE_QUAD_T 1" >>confdefs.h - - fi -if test $bash_cv_type_quad_t = no; then - printf "%s\n" "#define quad_t long" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 -printf %s "checking for intmax_t... " >&6; } -if test ${bash_cv_type_intmax_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STDDEF_H -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif -#if HAVE_STDINT_H -#include -#endif - - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "intmax_t" >/dev/null 2>&1 -then : - bash_cv_type_intmax_t=yes -else $as_nop - bash_cv_type_intmax_t=no -fi -rm -rf conftest* - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_intmax_t" >&5 -printf "%s\n" "$bash_cv_type_intmax_t" >&6; } - -if test $bash_cv_type_intmax_t = no; then - printf "%s\n" "#define intmax_t $bash_cv_type_long_long" >>confdefs.h - -fi - - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uintmax_t" >&5 -printf %s "checking for uintmax_t... " >&6; } -if test ${bash_cv_type_uintmax_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STDDEF_H -#include -#endif -#if HAVE_INTTYPES_H -#include -#endif -#if HAVE_STDINT_H -#include -#endif - - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uintmax_t" >/dev/null 2>&1 -then : - bash_cv_type_uintmax_t=yes -else $as_nop - bash_cv_type_uintmax_t=no -fi -rm -rf conftest* - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_uintmax_t" >&5 -printf "%s\n" "$bash_cv_type_uintmax_t" >&6; } - -if test $bash_cv_type_uintmax_t = no; then - printf "%s\n" "#define uintmax_t $bash_cv_type_unsigned_long_long" >>confdefs.h - -fi - if test "$ac_cv_header_sys_socket_h" = "yes"; then @@ -19050,20 +18699,30 @@ if test $bash_cv_type_socklen_t = no; then fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for size and type of struct rlimit fields" >&5 -printf %s "checking for size and type of struct rlimit fields... " >&6; } + +ac_fn_c_check_type "$LINENO" "quad_t" "ac_cv_type_quad_t" "$ac_includes_default" +if test "x$ac_cv_type_quad_t" = xyes +then : + printf "%s\n" "#define HAVE_QUAD_T 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for type of struct rlimit fields" >&5 +printf %s "checking for type of struct rlimit fields... " >&6; } if test ${bash_cv_type_rlimit+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #include #include int main (void) { rlim_t xxx; + ; return 0; } @@ -19073,56 +18732,160 @@ then : bash_cv_type_rlimit=rlim_t else $as_nop -if test "$cross_compiling" = yes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for size of struct rlimit fields" >&5 +printf %s "checking for size of struct rlimit fields... " >&6; } +if test ${bash_cv_sizeof_rlim_cur+y} then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check quad_t if cross compiling -- defaulting to long" >&5 -printf "%s\n" "$as_me: WARNING: cannot check quad_t if cross compiling -- defaulting to long" >&2;} - bash_cv_type_rlimit=long + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check size of rlimit fields if cross compiling -- defaulting to long" >&5 +printf "%s\n" "$as_me: WARNING: cannot check size of rlimit fields if cross compiling -- defaulting to long" >&2;} + bash_cv_sizeof_rlim_cur=$ac_cv_sizeof_long + else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef HAVE_SYS_TIME_H #include -#include +#endif #include -int +#include main() { -#ifdef HAVE_QUAD_T - struct rlimit rl; - if (sizeof(rl.rlim_cur) == sizeof(quad_t)) - exit(0); -#endif - exit(1); +struct rlimit r; +exit(sizeof (r.rlim_cur)); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : - bash_cv_type_rlimit=quad_t + bash_cv_sizeof_rlim_cur=$? else $as_nop - bash_cv_type_rlimit=long + bash_cv_sizeof_rlim_cur=$? fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sizeof_rlim_cur" >&5 +printf "%s\n" "$bash_cv_sizeof_rlim_cur" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for size of quad_t" >&5 +printf %s "checking for size of quad_t... " >&6; } +if test ${bash_cv_sizeof_quad_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check size of quad_t if cross compiling -- defaulting to 0" >&5 +printf "%s\n" "$as_me: WARNING: cannot check size of quad_t if cross compiling -- defaulting to 0" >&2;} + bash_cv_sizeof_quad_t=0 + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_INTTYPES_H +#include +#endif +#if HAVE_STDINT_H +#include +#endif + +main() +{ +#if HAVE_QUAD_T +quad_t x; +exit(sizeof (x)); +#else +exit (0); +#endif +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + bash_cv_sizeof_quad_t=$? +else $as_nop + bash_cv_sizeof_quad_t=$? +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_sizeof_quad_t" >&5 +printf "%s\n" "$bash_cv_sizeof_quad_t" >&6; } + +if test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_long; then + bash_cv_type_rlimit='unsigned long' +elif test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_long_long; then + bash_cv_type_rlimit='unsigned long long' +elif test $bash_cv_sizeof_rlim_cur = $ac_cv_sizeof_int; then + bash_cv_type_rlimit='unsigned int' +elif test $bash_cv_sizeof_rlim_cur = $bash_cv_sizeof_quad_t; then + bash_cv_type_rlimit='quad_t' +else + bash_cv_type_rlimit='unsigned long' +fi + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_rlimit" >&5 printf "%s\n" "$bash_cv_type_rlimit" >&6; } -if test $bash_cv_type_rlimit = quad_t; then -printf "%s\n" "#define RLIMTYPE quad_t" >>confdefs.h +printf "%s\n" "#define RLIMTYPE $bash_cv_type_rlimit" >>confdefs.h -elif test $bash_cv_type_rlimit = rlim_t; then -printf "%s\n" "#define RLIMTYPE rlim_t" >>confdefs.h + + + + + ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default" +if test "x$ac_cv_type_intmax_t" = xyes +then : + +printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h + +else $as_nop + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long int' \ + || ac_type='long int' + +printf "%s\n" "#define intmax_t $ac_type" >>confdefs.h fi + + + ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default" +if test "x$ac_cv_type_uintmax_t" = xyes +then : + +printf "%s\n" "#define HAVE_UINTMAX_T 1" >>confdefs.h + +else $as_nop + test $ac_cv_type_unsigned_long_long_int = yes \ + && ac_type='unsigned long long int' \ + || ac_type='unsigned long int' + +printf "%s\n" "#define uintmax_t $ac_type" >>confdefs.h + +fi + + + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. @@ -19186,13 +18949,13 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent.d_ino" >&5 printf %s "checking for struct dirent.d_ino... " >&6; } -if test ${bash_cv_dirent_has_dino+y} +if test ${bash_cv_dirent_has_d_ino+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + +ac_fn_c_check_member "$LINENO" "struct dirent" "d_ino" "ac_cv_member_struct_dirent_d_ino" " #include #include #ifdef HAVE_UNISTD_H @@ -19213,28 +18976,23 @@ else $as_nop # endif #endif /* HAVE_DIRENT_H */ -int -main (void) -{ - -struct dirent d; int z; z = d.d_ino; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +" +if test "x$ac_cv_member_struct_dirent_d_ino" = xyes then : - bash_cv_dirent_has_dino=yes + +printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h + +bash_cv_dirent_has_d_ino=yes else $as_nop - bash_cv_dirent_has_dino=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + bash_cv_dirent_has_d_ino=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_dino" >&5 -printf "%s\n" "$bash_cv_dirent_has_dino" >&6; } -if test $bash_cv_dirent_has_dino = yes; then + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_ino" >&5 +printf "%s\n" "$bash_cv_dirent_has_d_ino" >&6; } +if test $bash_cv_dirent_has_d_ino = yes; then printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h fi @@ -19246,9 +19004,9 @@ if test ${bash_cv_dirent_has_d_fileno+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + +ac_fn_c_check_member "$LINENO" "struct dirent" "d_fileno" "ac_cv_member_struct_dirent_d_fileno" " #include #include #ifdef HAVE_UNISTD_H @@ -19269,23 +19027,18 @@ else $as_nop # endif #endif /* HAVE_DIRENT_H */ -int -main (void) -{ - -struct dirent d; int z; z = d.d_fileno; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +" +if test "x$ac_cv_member_struct_dirent_d_fileno" = xyes then : - bash_cv_dirent_has_d_fileno=yes + +printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h + +bash_cv_dirent_has_d_fileno=yes else $as_nop bash_cv_dirent_has_d_fileno=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_fileno" >&5 @@ -19302,9 +19055,9 @@ if test ${bash_cv_dirent_has_d_namlen+y} then : printf %s "(cached) " >&6 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + +ac_fn_c_check_member "$LINENO" "struct dirent" "d_namlen" "ac_cv_member_struct_dirent_d_namlen" " #include #include #ifdef HAVE_UNISTD_H @@ -19325,23 +19078,18 @@ else $as_nop # endif #endif /* HAVE_DIRENT_H */ -int -main (void) -{ - -struct dirent d; int z; z = d.d_namlen; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +" +if test "x$ac_cv_member_struct_dirent_d_namlen" = xyes then : - bash_cv_dirent_has_d_namlen=yes + +printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" >>confdefs.h + +bash_cv_dirent_has_d_namlen=yes else $as_nop bash_cv_dirent_has_d_namlen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_namlen" >&5 @@ -19961,7 +19709,7 @@ if ac_fn_c_try_run "$LINENO" then : bash_cv_func_sbrk=yes else $as_nop - bash_cv_func_snprintf=sbrk + bash_cv_func_sbrk=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -20076,6 +19824,7 @@ unlink("bash-aclocal/not_a_directory"); rmdir("bash-aclocal"); exit (dir == 0); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -20342,6 +20091,7 @@ siglongjmp(xx, 10); exit(1); #endif } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -20362,7 +20112,6 @@ printf "%s\n" "#define HAVE_POSIX_SIGSETJMP 1" >>confdefs.h fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether or not strcoll and strcmp differ" >&5 printf %s "checking whether or not strcoll and strcmp differ... " >&6; } if test ${bash_cv_func_strcoll_broken+y} @@ -20780,7 +20529,6 @@ main (int c, char **v) exit (1); } - _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -20807,7 +20555,6 @@ printf "%s\n" "#define FNMATCH_EQUIV_FALLBACK $bash_cv_fnmatch_equiv_value" >>co - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if signal handlers must be reinstalled when invoked" >&5 printf %s "checking if signal handlers must be reinstalled when invoked... " >&6; } if test ${bash_cv_must_reinstall_sighandlers+y} @@ -20830,7 +20577,7 @@ else $as_nop #endif #include -typedef RETSIGTYPE sigfunc(); +typedef void sigfunc(); volatile int nsigint; @@ -20852,7 +20599,7 @@ set_signal_handler(sig, handler) #define set_signal_handler(s, h) signal(s, h) #endif -RETSIGTYPE +void sigint(s) int s; { @@ -21021,6 +20768,7 @@ unlink ("bash-aclocal/sh-np-autoconf"); rmdir ("bash-aclocal"); exit(0); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -21337,6 +21085,7 @@ main () exit(rtmin < n_sigs); } + _ACEOF if ac_fn_c_try_run "$LINENO" then : @@ -21421,6 +21170,7 @@ then : bash_cv_kernel_rlimit=yes else $as_nop bash_cv_kernel_rlimit=no + fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext diff --git a/configure.ac b/configure.ac index 076166dc..e4294934 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script. # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_REVISION([for Bash 5.1, version 5.028])dnl +AC_REVISION([for Bash 5.1, version 5.031])dnl define(bashvers, 5.1) define(relstatus, maint) @@ -29,8 +29,7 @@ define(relstatus, maint) AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) dnl make sure we are using a recent autoconf version -dnl we could consider making this 2.68 or 2.69 -AC_PREREQ(2.63) +AC_PREREQ(2.69) AC_CONFIG_SRCDIR(shell.h) dnl where to find install.sh, config.sub, and config.guess @@ -430,7 +429,6 @@ fi dnl test for Unix variants AC_USE_SYSTEM_EXTENSIONS - AC_SYS_LARGEFILE dnl BEGIN changes for cross-building (currently cygwin, minGW, and @@ -820,15 +818,12 @@ if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then AC_LIBOBJ(vprint) fi -dnl signal stuff -dnl AC_TYPE_SIGNAL - dnl checks for certain version-specific system calls and libc functions AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE)) AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3)) dnl checks for missing libc functions -AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING)) +AC_CHECK_FUNC(mkfifo, AC_DEFINE(HAVE_MKFIFO), AC_DEFINE(MKFIFO_MISSING)) dnl checks for system calls AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \ @@ -864,8 +859,6 @@ AC_CHECK_DECLS([confstr]) AC_CHECK_DECLS([printf]) AC_CHECK_DECLS([sbrk]) AC_CHECK_DECLS([setregid]) -dnl AC_CHECK_DECLS[(setresuid]) -dnl AC_CHECK_DECLS[(setresgid]) AC_CHECK_DECLS([strcpy]) AC_CHECK_DECLS([strsignal]) @@ -875,12 +868,13 @@ dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3) AC_CHECK_DECLS([strtold], [ AC_MSG_CHECKING([for broken strtold]) AC_CACHE_VAL(bash_cv_strtold_broken, - [AC_TRY_COMPILE( - [#include ], - [long double r; char *foo, bar; r = strtold(foo, &bar);], - bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes, - [AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)]) - ] + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[long double r; char *foo, bar; r = strtold(foo, &bar);]] + )], + [bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes]) + ] ) AC_MSG_RESULT($bash_cv_strtold_broken) if test "$bash_cv_strtold_broken" = "yes" ; then @@ -888,12 +882,12 @@ AC_CHECK_DECLS([strtold], [ fi ]) -BASH_CHECK_DECL(strtoimax) -BASH_CHECK_DECL(strtol) -BASH_CHECK_DECL(strtoll) -BASH_CHECK_DECL(strtoul) -BASH_CHECK_DECL(strtoull) -BASH_CHECK_DECL(strtoumax) +AC_CHECK_DECLS(strtoimax) +AC_CHECK_DECLS(strtol) +AC_CHECK_DECLS(strtoll) +AC_CHECK_DECLS(strtoul) +AC_CHECK_DECLS(strtoull) +AC_CHECK_DECLS(strtoumax) AC_FUNC_MKTIME @@ -963,8 +957,8 @@ AC_TYPE_UINTPTR_T AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(time_t, long) -BASH_TYPE_LONG_LONG -BASH_TYPE_UNSIGNED_LONG_LONG +AC_TYPE_LONG_LONG_INT +AC_TYPE_UNSIGNED_LONG_LONG_INT BASH_TYPE_SIG_ATOMIC_T @@ -1013,18 +1007,18 @@ BASH_SYS_SIGLIST BASH_UNDER_SYS_SIGLIST dnl various system types -dnl BASH_TYPE_SIGHANDLER BASH_CHECK_TYPE(clock_t, [#include ], long) BASH_CHECK_TYPE(sigset_t, [#include ], int) -BASH_CHECK_TYPE(sig_atomic_t, [#include ], int) -BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T) -BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long) -BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long) if test "$ac_cv_header_sys_socket_h" = "yes"; then BASH_CHECK_TYPE(socklen_t, [#include ], [unsigned int], HAVE_SOCKLEN_T) fi + +AC_CHECK_TYPE(quad_t, AC_DEFINE([HAVE_QUAD_T], [1]), [], ) BASH_TYPE_RLIMIT +AC_TYPE_INTMAX_T +AC_TYPE_UINTMAX_T + AC_CHECK_SIZEOF(intmax_t, 8) dnl presence and contents of structures used by system calls diff --git a/doc/bash.1 b/doc/bash.1 index dbc2d4bc..08feea3a 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -4908,7 +4908,8 @@ to the command are set to the arguments given, if any. If this execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a \fIshell script\fP, a file -containing shell commands, and the shell creates a +containing shell commands, and the shell creates a +new instance of itself to execute it. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked diff --git a/doc/bashref.texi b/doc/bashref.texi index 61db0207..274c0589 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -3483,8 +3483,10 @@ are unset. A shell script may be made executable by using the @code{chmod} command to turn on the execute bit. When Bash finds such a file while -searching the @env{$PATH} for a command, it creates a subshell to -execute it. In other words, executing +searching the @env{$PATH} for a command, it creates a +new instance of itself +to execute it. +In other words, executing @example filename @var{arguments} @end example diff --git a/externs.h b/externs.h index 7d704d97..20abd84f 100644 --- a/externs.h +++ b/externs.h @@ -212,7 +212,7 @@ extern void dprintf PARAMS((int, const char *, ...)) __attribute__((__format__ extern char *fmtulong PARAMS((unsigned long int, int, char *, size_t, int)); /* Declarations for functions defined in lib/sh/fmtulong.c */ -#if defined (HAVE_LONG_LONG) +#if defined (HAVE_LONG_LONG_INT) extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int)); #endif @@ -441,7 +441,7 @@ extern long strtol PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtoll.c */ -#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOLL +#if defined (HAVE_LONG_LONG_INT) && !HAVE_DECL_STRTOLL extern long long strtoll PARAMS((const char *, char **, int)); #endif @@ -451,7 +451,7 @@ extern unsigned long strtoul PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtoull.c */ -#if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOULL +#if defined (HAVE_UNSIGNED_LONG_LONG_INT) && !HAVE_DECL_STRTOULL extern unsigned long long strtoull PARAMS((const char *, char **, int)); #endif diff --git a/include/typemax.h b/include/typemax.h index 62ea4e18..e5d7d8cf 100644 --- a/include/typemax.h +++ b/include/typemax.h @@ -54,7 +54,7 @@ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) #endif -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT # ifndef LLONG_MAX # define LLONG_MAX TYPE_MAXIMUM(long long int) # define LLONG_MIN TYPE_MINIMUM(long long int) @@ -84,7 +84,7 @@ #endif /* workaround for gcc bug in versions < 2.7 */ -#if defined (HAVE_LONG_LONG) && __GNUC__ == 2 && __GNUC_MINOR__ < 7 +#if defined (HAVE_LONG_LONG_INT) && __GNUC__ == 2 && __GNUC_MINOR__ < 7 static const unsigned long long int maxquad = ULLONG_MAX; # undef ULLONG_MAX # define ULLONG_MAX maxquad diff --git a/lib/readline/search.c b/lib/readline/search.c index ea5b61b2..325d51ec 100644 --- a/lib/readline/search.c +++ b/lib/readline/search.c @@ -526,6 +526,9 @@ rl_history_search_internal (int count, int dir) char *t; rl_maybe_save_line (); + /* This will either be restored from the saved line or set from the + found history line. */ + rl_undo_list = 0; temp = (HIST_ENTRY *)NULL; /* Search COUNT times through the history for a line matching @@ -579,6 +582,11 @@ rl_history_search_internal (int count, int dir) /* Copy the line we found into the current line buffer. */ make_history_line_current (temp); + /* Make sure we set the current history position to the last line found so + we can do things like operate-and-get-next from here. This is similar to + how incremental search behaves. */ + history_set_pos (rl_history_search_pos); /* XXX */ + /* decide where to put rl_point -- need to change this for pattern search */ if (rl_history_search_flags & ANCHORED_SEARCH) rl_point = rl_history_search_len; /* easy case */ diff --git a/lib/sh/fmtullong.c b/lib/sh/fmtullong.c index 97a1dc18..46eaf509 100644 --- a/lib/sh/fmtullong.c +++ b/lib/sh/fmtullong.c @@ -20,7 +20,7 @@ #include -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT #define LONG long long #define UNSIGNED_LONG unsigned long long diff --git a/lib/sh/snprintf.c b/lib/sh/snprintf.c index 406a3a50..1f0f4c73 100644 --- a/lib/sh/snprintf.c +++ b/lib/sh/snprintf.c @@ -70,7 +70,7 @@ #endif #if defined(DRIVER) && !defined(HAVE_CONFIG_H) -#define HAVE_LONG_LONG +#define HAVE_LONG_LONG_INT #define HAVE_LONG_DOUBLE #ifdef __linux__ #define HAVE_PRINTF_A_FORMAT @@ -286,7 +286,7 @@ static void floating PARAMS((struct DATA *, double)); static void exponent PARAMS((struct DATA *, double)); #endif static void number PARAMS((struct DATA *, unsigned long, int)); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT static void lnumber PARAMS((struct DATA *, unsigned long long, int)); #endif static void pointer PARAMS((struct DATA *, unsigned long)); @@ -767,7 +767,7 @@ number(p, d, base) FREE (t); } -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT /* * identical to number() but works for `long long' */ @@ -1262,7 +1262,7 @@ vsnprintf_internal(data, string, length, format, args) long double ld; /* for later */ #endif unsigned long ul; -#ifdef HAVE_LONG_LONG +#ifdef HAVE_UNSIGNED_LONG_LONG_INT unsigned long long ull; #endif int state, i, c, n; @@ -1486,7 +1486,7 @@ conv_break: /* FALLTHROUGH */ case 'u': STAR_ARGS(data); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (data->flags & PF_LONGLONG) { ull = GETARG (unsigned long long); @@ -1506,7 +1506,7 @@ conv_break: case 'd': /* decimal */ case 'i': STAR_ARGS(data); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (data->flags & PF_LONGLONG) { ull = GETARG (long long); @@ -1522,7 +1522,7 @@ conv_break: break; case 'o': /* octal */ STAR_ARGS(data); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (data->flags & PF_LONGLONG) { ull = GETARG (unsigned long long); @@ -1539,7 +1539,7 @@ conv_break: case 'x': case 'X': /* hexadecimal */ STAR_ARGS(data); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (data->flags & PF_LONGLONG) { ull = GETARG (unsigned long long); @@ -1602,7 +1602,7 @@ conv_break: state = 0; break; case 'n': -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT if (data->flags & PF_LONGLONG) *(GETARG (long long *)) = data->counter; else @@ -2082,7 +2082,7 @@ main() printf("<%s>\n", holder); printf("<%s>\n\n", h); -#ifdef HAVE_LONG_LONG +#ifdef HAVE_LONG_LONG_INT printf ("<%%llu> LLONG_MAX+1\n"); i = snprintf(holder, 100, "%llu", (unsigned long long)(LLONG_MAX)+1); i = asprintf(&h, "%llu", (unsigned long long)(LLONG_MAX)+1); diff --git a/lib/sh/strtoimax.c b/lib/sh/strtoimax.c index 676e02ef..584fa0ba 100644 --- a/lib/sh/strtoimax.c +++ b/lib/sh/strtoimax.c @@ -51,7 +51,7 @@ extern long strtol PARAMS((const char *, char **, int)); #ifndef HAVE_DECL_STRTOLL "this configure-time declaration test was not run" #endif -#if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG +#if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG_INT extern long long strtoll PARAMS((const char *, char **, int)); #endif @@ -65,7 +65,7 @@ strtoimax (ptr, endptr, base) char **endptr; int base; { -#if HAVE_LONG_LONG +#if HAVE_LONG_LONG_INT verify(size_is_that_of_long_or_long_long, (sizeof (intmax_t) == sizeof (long) || sizeof (intmax_t) == sizeof (long long))); @@ -86,20 +86,20 @@ main () { char *p, *endptr; intmax_t x; -#if HAVE_LONG_LONG +#if HAVE_LONG_LONG_INT long long y; #endif long z; printf ("sizeof intmax_t: %d\n", sizeof (intmax_t)); -#if HAVE_LONG_LONG +#if HAVE_LONG_LONG_INT printf ("sizeof long long: %d\n", sizeof (long long)); #endif printf ("sizeof long: %d\n", sizeof (long)); x = strtoimax("42", &endptr, 10); -#if HAVE_LONG_LONG +#if HAVE_LONG_LONG_INT y = strtoll("42", &endptr, 10); #else y = -1; diff --git a/lib/sh/strtol.c b/lib/sh/strtol.c index 8aa74788..c839a97c 100644 --- a/lib/sh/strtol.c +++ b/lib/sh/strtol.c @@ -20,7 +20,7 @@ #include -#if !defined (HAVE_STRTOL) +#if !HAVE_STRTOL #include #include diff --git a/lib/sh/strtoll.c b/lib/sh/strtoll.c index f6060eef..f90300b9 100644 --- a/lib/sh/strtoll.c +++ b/lib/sh/strtoll.c @@ -20,11 +20,11 @@ #include -#if defined (HAVE_LONG_LONG) && !defined (HAVE_STRTOLL) +#if defined (HAVE_LONG_LONG_INT) && !HAVE_STRTOLL #define QUAD 1 #undef HAVE_STRTOL #include "strtol.c" -#endif /* HAVE_LONG_LONG && !HAVE_STRTOLL */ +#endif /* HAVE_LONG_LONG_INT && !HAVE_STRTOLL */ diff --git a/lib/sh/strtoull.c b/lib/sh/strtoull.c index 02ddebb9..fe6592e5 100644 --- a/lib/sh/strtoull.c +++ b/lib/sh/strtoull.c @@ -20,7 +20,7 @@ #include -#if defined (HAVE_LONG_LONG) && !defined (HAVE_STRTOULL) +#if defined (HAVE_UNSIGNED_LONG_LONG_INT) && !HAVE_STRTOULL #define QUAD 1 #define UNSIGNED 1 @@ -28,4 +28,4 @@ #include "strtol.c" -#endif /* HAVE_LONG_LONG && !HAVE_STRTOULL */ +#endif /* HAVE_UNSIGNED_LONG_LONG_INT && !HAVE_STRTOULL */ diff --git a/lib/sh/strtoumax.c b/lib/sh/strtoumax.c index 0247e57b..2e26efcf 100644 --- a/lib/sh/strtoumax.c +++ b/lib/sh/strtoumax.c @@ -51,7 +51,7 @@ extern unsigned long strtoul PARAMS((const char *, char **, int)); #ifndef HAVE_DECL_STRTOULL "this configure-time declaration test was not run" #endif -#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG +#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG_INT extern unsigned long long strtoull PARAMS((const char *, char **, int)); #endif @@ -65,7 +65,7 @@ strtoumax (ptr, endptr, base) char **endptr; int base; { -#if HAVE_UNSIGNED_LONG_LONG +#if HAVE_UNSIGNED_LONG_LONG_INT verify (size_is_that_of_unsigned_long_or_unsigned_long_long, (sizeof (uintmax_t) == sizeof (unsigned long) || sizeof (uintmax_t) == sizeof (unsigned long long))); @@ -86,20 +86,20 @@ main () { char *p, *endptr; uintmax_t x; -#if HAVE_UNSIGNED_LONG_LONG +#if HAVE_UNSIGNED_LONG_LONG_INT unsigned long long y; #endif unsigned long z; printf ("sizeof uintmax_t: %d\n", sizeof (uintmax_t)); -#if HAVE_UNSIGNED_LONG_LONG +#if HAVE_UNSIGNED_LONG_LONG_INT printf ("sizeof unsigned long long: %d\n", sizeof (unsigned long long)); #endif printf ("sizeof unsigned long: %d\n", sizeof (unsigned long)); x = strtoumax("42", &endptr, 10); -#if HAVE_LONG_LONG +#if HAVE_LONG_LONG_INT y = strtoull("42", &endptr, 10); #else y = 0;