more updates for autoconf-2.71: removing usage of AC_TRY_RUN

This commit is contained in:
Chet Ramey
2021-09-13 10:08:15 -04:00
parent a67031fe11
commit 4410784029
17 changed files with 724 additions and 1018 deletions
+94
View File
@@ -1895,4 +1895,98 @@ lib/sh/strftime.c
unconditionally in case it defines time_t. From a report by
Ori Sky Farrell <bash@ori.mx>
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
<vandrus.zoltan@gmail.com>
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
Vendored
+206 -349
View File
@@ -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 <stdlib.h>
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 <stdlib.h>
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 <inttypes.h>. 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 <stdlib.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#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 <stdio.h>)
AC_CACHE_VAL(bash_cv_printf_declared,
[AC_TRY_RUN([
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#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 <sys/types.h>
#include <signal.h>
#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 <sys/types.h>
#include <signal.h>
#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 <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -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 <sys/types.h>
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <sys/types.h>
#include <signal.h>
#include <string.h>],
[char *s = (char *)strsignal(2);],
bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
#include <string.h>]],
[[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 <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
@@ -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 <sys/types.h>
#include <signal.h>
#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 <sys/types.h>
#include <sys/resource.h>],
[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
AC_TRY_RUN([
#include <sys/types.h>
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 <sys/time.h>
#include <sys/resource.h>
#endif
#include <stdlib.h>
int
#include <sys/resource.h>
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 <sys/types.h>
#include <stdlib.h>
#if HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#if HAVE_STDINT_H
#include <stdint.h>
#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 <sys/types.h>
#include <sys/resource.h>]],
[[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 <signal.h>
],[ 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 <signal.h> ]],
[[ 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 <signal.h>], 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 <sys/stat.h>.
AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
[AC_TRY_LINK([
#include <sys/types.h>
#include <sys/stat.h>
],[ lstat(".",(struct stat *)0); ],
bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/stat.h>
]],
[[ 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 <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
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 <unistd.h>
#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 <stdlib.h>
#ifdef HAVE_ULIMIT_H
#include <ulimit.h>
@@ -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 <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -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 <fnmatch.h>
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 <unistd.h>
#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 <stdio.h>
#if defined (HAVE_LOCALE_H)
#include <locale.h>
@@ -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 <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -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 <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
@@ -1114,11 +1052,15 @@ AC_CACHE_VAL(bash_cv_dirent_has_dino,
# include <ndir.h>
# 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 <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if defined(HAVE_DIRENT_H)
# include <dirent.h>
#else
# define dirent direct
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* SYSNDIR */
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* SYSDIR */
# ifdef HAVE_NDIR_H
# include <ndir.h>
# 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 <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if defined(HAVE_DIRENT_H)
# include <dirent.h>
#else
# define dirent direct
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* SYSNDIR */
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* SYSDIR */
# ifdef HAVE_NDIR_H
# include <ndir.h>
# 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 <signal.h>],[
@@ -1268,7 +1163,7 @@ AC_CACHE_VAL(bash_cv_signal_vintage,
[
AC_TRY_LINK([
#include <signal.h>
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 <unistd.h>
#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 <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
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 <sys/types.h>
#include <sys/stat.h>
#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 <sys/types.h>], [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 <sys/types.h>]],
[[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 <sys/types.h>
#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 <sys/types.h>
#include <signal.h>
#include <stdlib.h>
@@ -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 <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -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 <stdio.h>
#include <readline/readline.h>
#include <stdlib.h>
@@ -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 <locale.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
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 <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -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 <stdio.h>
#include <stdlib.h>
@@ -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 <stdarg.h>
#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 <stdlib.h>
#include <unistd.h>
@@ -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 <unistd.h>],
[ void *x = sbrk (4096); ],
ac_cv_func_sbrk=yes, ac_cv_func_sbrk=no)])
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <unistd.h>]],
[[ 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 <stdlib.h>
#include <unistd.h>
@@ -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 <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@@ -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]
)])
+3 -3
View File
@@ -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
Vendored
+353 -603
View File
File diff suppressed because it is too large Load Diff
+23 -29
View File
@@ -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 <http://www.gnu.org/licenses/>.
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 <stdlib.h>],
[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 <stdlib.h>]],
[[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 <sys/times.h>], long)
BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int)
BASH_CHECK_TYPE(sig_atomic_t, [#include <signal.h>], 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 <sys/socket.h>], [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
+2 -1
View File
@@ -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
+4 -2
View File
@@ -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
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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
+8
View File
@@ -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 */
+1 -1
View File
@@ -20,7 +20,7 @@
#include <config.h>
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG_INT
#define LONG long long
#define UNSIGNED_LONG unsigned long long
+10 -10
View File
@@ -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);
+5 -5
View File
@@ -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;
+1 -1
View File
@@ -20,7 +20,7 @@
#include <config.h>
#if !defined (HAVE_STRTOL)
#if !HAVE_STRTOL
#include <chartypes.h>
#include <errno.h>
+2 -2
View File
@@ -20,11 +20,11 @@
#include <config.h>
#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 */
+2 -2
View File
@@ -20,7 +20,7 @@
#include <config.h>
#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 */
+5 -5
View File
@@ -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;