2 dnl Bash specific tests
4 dnl Some derived from PDKSH 5.1.3 autoconf tests
7 dnl Check if dup2() does not clear the close on exec flag
9 AC_DEFUN(BASH_DUP2_CLOEXEC_CHECK,
10 [AC_MSG_CHECKING(if dup2 fails to clear the close-on-exec flag)
11 AC_CACHE_VAL(bash_cv_dup2_broken,
13 #include <sys/types.h>
18 fd1 = open("/dev/null", 2);
19 if (fcntl(fd1, 2, 1) < 0)
24 fl = fcntl(fd2, 1, 0);
25 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
28 ], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
29 [AC_MSG_WARN(cannot check dup2 if cross compiling -- defaulting to no)
30 bash_cv_dup2_broken=no])
32 AC_MSG_RESULT($bash_cv_dup2_broken)
33 if test $bash_cv_dup2_broken = yes; then
34 AC_DEFINE(DUP2_BROKEN)
38 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
39 AC_DEFUN(BASH_SIGNAL_CHECK,
40 [AC_REQUIRE([AC_TYPE_SIGNAL])
41 AC_MSG_CHECKING(for type of signal functions)
42 AC_CACHE_VAL(bash_cv_signal_vintage,
44 AC_TRY_LINK([#include <signal.h>],[
47 sigemptyset(&ss); sigsuspend(&ss);
48 sigaction(SIGINT, &sa, (struct sigaction *) 0);
49 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
50 ], bash_cv_signal_vintage=posix,
52 AC_TRY_LINK([#include <signal.h>], [
53 int mask = sigmask(SIGINT);
54 sigsetmask(mask); sigblock(mask); sigpause(mask);
55 ], bash_cv_signal_vintage=4.2bsd,
59 RETSIGTYPE foo() { }], [
60 int mask = sigmask(SIGINT);
61 sigset(SIGINT, foo); sigrelse(SIGINT);
62 sighold(SIGINT); sigpause(SIGINT);
63 ], bash_cv_signal_vintage=svr3, bash_cv_signal_vintage=v7
68 AC_MSG_RESULT($bash_cv_signal_vintage)
69 if test "$bash_cv_signal_vintage" = posix; then
70 AC_DEFINE(HAVE_POSIX_SIGNALS)
71 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
72 AC_DEFINE(HAVE_BSD_SIGNALS)
73 elif test "$bash_cv_signal_vintage" = svr3; then
74 AC_DEFINE(HAVE_USG_SIGHOLD)
78 dnl Check if the pgrp of setpgrp() can't be the pid of a zombie process.
79 AC_DEFUN(BASH_PGRP_SYNC,
80 [AC_REQUIRE([AC_FUNC_GETPGRP])
81 AC_MSG_CHECKING(whether pgrps need synchronization)
82 AC_CACHE_VAL(bash_cv_pgrp_pipe,
90 # define getpgID() getpgrp()
92 # define getpgID() getpgrp(0)
93 # define setpgid(x,y) setpgrp(x,y)
95 int pid1, pid2, fds[2];
99 switch (pid1 = fork()) {
103 setpgid(0, getpid());
108 sleep(2); /* let first child die */
113 switch (pid2 = fork()) {
118 ok = getpgID() == pid1;
119 write(fds[1], &ok, 1);
125 if (read(fds[0], &ok, 1) != 1)
131 ], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
132 [AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
133 bash_cv_pgrp_pipe=no])
135 AC_MSG_RESULT($bash_cv_pgrp_pipe)
136 if test $bash_cv_pgrp_pipe = yes; then
142 dnl check for typedef'd symbols in header files, but allow the caller to
143 dnl specify the include files to be checked in addition to the default
145 dnl BASH_CHECK_TYPE(TYPE, HEADERS, DEFAULT[, VALUE-IF-FOUND])
146 AC_DEFUN(BASH_CHECK_TYPE,
147 [AC_REQUIRE([AC_HEADER_STDC])dnl
148 AC_MSG_CHECKING(for $1)
149 AC_CACHE_VAL(bash_cv_type_$1,
150 [AC_EGREP_CPP($1, [#include <sys/types.h>
155 ], bash_cv_type_$1=yes, bash_cv_type_$1=no)])
156 AC_MSG_RESULT($bash_cv_type_$1)
157 ifelse($#, 4, [if test $bash_cv_type_$1 = yes; then
160 if test $bash_cv_type_$1 = no; then
166 dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
167 dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
168 dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
169 dnl matters, this just checks for rlim_t, quad_t, or long.
171 AC_DEFUN(BASH_RLIMIT_TYPE,
172 [AC_MSG_CHECKING(for size and type of struct rlimit fields)
173 AC_CACHE_VAL(bash_cv_type_rlimit,
174 [AC_TRY_COMPILE([#include <sys/types.h>
175 #include <sys/resource.h>],
176 [rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
178 #include <sys/types.h>
179 #include <sys/time.h>
180 #include <sys/resource.h>
185 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
189 }], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
190 [AC_MSG_WARN(cannot check quad_t if cross compiling -- defaulting to long)
191 bash_cv_type_rlimit=long])])
193 AC_MSG_RESULT($bash_cv_type_rlimit)
194 if test $bash_cv_type_rlimit = quad_t; then
195 AC_DEFINE(RLIMTYPE, quad_t)
196 elif test $bash_cv_type_rlimit = rlim_t; then
197 AC_DEFINE(RLIMTYPE, rlim_t)
202 dnl Check for sys_siglist[] or _sys_siglist[]
204 AC_DEFUN(BASH_DECL_UNDER_SYS_SIGLIST,
205 [AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
206 AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
208 #include <sys/types.h>
212 #endif], [ char *msg = _sys_siglist[2]; ],
213 bash_cv_decl_under_sys_siglist=yes, bash_cv_decl_under_sys_siglist=no,
214 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
215 AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
216 if test $bash_cv_decl_under_sys_siglist = yes; then
217 AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
221 AC_DEFUN(BASH_UNDER_SYS_SIGLIST,
222 [AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
223 AC_MSG_CHECKING([for _sys_siglist in system C library])
224 AC_CACHE_VAL(bash_cv_under_sys_siglist,
226 #include <sys/types.h>
231 #ifndef UNDER_SYS_SIGLIST_DECLARED
232 extern char *_sys_siglist[];
236 char *msg = (char *)_sys_siglist[2];
239 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
240 [AC_MSG_WARN(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
241 bash_cv_under_sys_siglist=no])])
242 AC_MSG_RESULT($bash_cv_under_sys_siglist)
243 if test $bash_cv_under_sys_siglist = yes; then
244 AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
248 AC_DEFUN(BASH_SYS_SIGLIST,
249 [AC_REQUIRE([AC_DECL_SYS_SIGLIST])
250 AC_MSG_CHECKING([for sys_siglist in system C library])
251 AC_CACHE_VAL(bash_cv_sys_siglist,
253 #include <sys/types.h>
258 #ifndef SYS_SIGLIST_DECLARED
259 extern char *sys_siglist[];
263 char *msg = sys_siglist[2];
266 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
267 [AC_MSG_WARN(cannot check for sys_siglist if cross compiling -- defaulting to no)
268 bash_cv_sys_siglist=no])])
269 AC_MSG_RESULT($bash_cv_sys_siglist)
270 if test $bash_cv_sys_siglist = yes; then
271 AC_DEFINE(HAVE_SYS_SIGLIST)
275 dnl Check for sys_errlist[] and sys_nerr, check for declaration
276 AC_DEFUN(BASH_SYS_ERRLIST,
277 [AC_MSG_CHECKING([for sys_errlist and sys_nerr])
278 AC_CACHE_VAL(bash_cv_sys_errlist,
279 [AC_TRY_LINK([#include <errno.h>],
280 [extern char *sys_errlist[];
282 char *msg = sys_errlist[sys_nerr - 1];],
283 bash_cv_sys_errlist=yes, bash_cv_sys_errlist=no)])dnl
284 AC_MSG_RESULT($bash_cv_sys_errlist)
285 if test $bash_cv_sys_errlist = yes; then
286 AC_DEFINE(HAVE_SYS_ERRLIST)
290 dnl Check to see if opendir will open non-directories (not a nice thing)
291 AC_DEFUN(BASH_FUNC_OPENDIR_CHECK,
292 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
293 AC_MSG_CHECKING(if opendir() opens non-directories)
294 AC_CACHE_VAL(bash_cv_opendir_not_robust,
297 #include <sys/types.h>
301 #endif /* HAVE_UNISTD_H */
302 #if defined(HAVE_DIRENT_H)
305 # define dirent direct
306 # ifdef HAVE_SYS_NDIR_H
307 # include <sys/ndir.h>
308 # endif /* SYSNDIR */
309 # ifdef HAVE_SYS_DIR_H
310 # include <sys/dir.h>
315 #endif /* HAVE_DIRENT_H */
320 err = mkdir("/tmp/bash-aclocal", 0700);
325 unlink("/tmp/bash-aclocal/not_a_directory");
326 fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
329 dir = opendir("/tmp/bash-aclocal/not_a_directory");
330 unlink("/tmp/bash-aclocal/not_a_directory");
331 rmdir("/tmp/bash-aclocal");
333 }], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
334 [AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
335 bash_cv_opendir_not_robust=no]
337 AC_MSG_RESULT($bash_cv_opendir_not_robust)
338 if test $bash_cv_opendir_not_robust = yes; then
339 AC_DEFINE(OPENDIR_NOT_ROBUST)
344 AC_DEFUN(BASH_TYPE_SIGHANDLER,
345 [AC_MSG_CHECKING([whether signal handlers are of type void])
346 AC_CACHE_VAL(bash_cv_void_sighandler,
347 [AC_TRY_COMPILE([#include <sys/types.h>
355 void (*signal ()) ();],
356 [int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
357 AC_MSG_RESULT($bash_cv_void_sighandler)
358 if test $bash_cv_void_sighandler = yes; then
359 AC_DEFINE(VOID_SIGHANDLER)
364 dnl A signed 16-bit integer quantity
366 AC_DEFUN(BASH_TYPE_BITS16_T,
368 if test "$ac_cv_sizeof_short" = 2; then
369 AC_CHECK_TYPE(bits16_t, short)
370 elif test "$ac_cv_sizeof_char" = 2; then
371 AC_CHECK_TYPE(bits16_t, char)
373 AC_CHECK_TYPE(bits16_t, short)
378 dnl An unsigned 16-bit integer quantity
380 AC_DEFUN(BASH_TYPE_U_BITS16_T,
382 if test "$ac_cv_sizeof_short" = 2; then
383 AC_CHECK_TYPE(u_bits16_t, unsigned short)
384 elif test "$ac_cv_sizeof_char" = 2; then
385 AC_CHECK_TYPE(u_bits16_t, unsigned char)
387 AC_CHECK_TYPE(u_bits16_t, unsigned short)
392 dnl A signed 32-bit integer quantity
394 AC_DEFUN(BASH_TYPE_BITS32_T,
396 if test "$ac_cv_sizeof_int" = 4; then
397 AC_CHECK_TYPE(bits32_t, int)
398 elif test "$ac_cv_sizeof_long" = 4; then
399 AC_CHECK_TYPE(bits32_t, long)
401 AC_CHECK_TYPE(bits32_t, int)
406 dnl An unsigned 32-bit integer quantity
408 AC_DEFUN(BASH_TYPE_U_BITS32_T,
410 if test "$ac_cv_sizeof_int" = 4; then
411 AC_CHECK_TYPE(u_bits32_t, unsigned int)
412 elif test "$ac_cv_sizeof_long" = 4; then
413 AC_CHECK_TYPE(u_bits32_t, unsigned long)
415 AC_CHECK_TYPE(u_bits32_t, unsigned int)
419 AC_DEFUN(BASH_TYPE_PTRDIFF_T,
421 if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_char_p"; then
422 AC_CHECK_TYPE(ptrdiff_t, int)
423 elif test "$ac_cv_sizeof_long" = "$ac_cv_sizeof_char_p"; then
424 AC_CHECK_TYPE(ptrdiff_t, long)
426 AC_CHECK_TYPE(ptrdiff_t, int)
431 dnl A signed 64-bit quantity
433 AC_DEFUN(BASH_TYPE_BITS64_T,
435 if test "$ac_sv_sizeof_char_p" = 8; then
436 AC_CHECK_TYPE(bits64_t, char *)
437 elif test "$ac_cv_sizeof_double" = 8; then
438 AC_CHECK_TYPE(bits64_t, double)
439 elif test "$ac_cv_sizeof_long" = 8; then
440 AC_CHECK_TYPE(bits64_t, long)
442 AC_CHECK_TYPE(bits64_t, double)
446 AC_DEFUN(BASH_FUNC_STRSIGNAL,
447 [AC_MSG_CHECKING([for the existence of strsignal])
448 AC_CACHE_VAL(bash_cv_have_strsignal,
449 [AC_TRY_LINK([#include <sys/types.h>
450 #include <signal.h>],
451 [char *s = (char *)strsignal(2);],
452 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
453 AC_MSG_RESULT($bash_cv_have_strsignal)
454 if test $bash_cv_have_strsignal = yes; then
455 AC_DEFINE(HAVE_STRSIGNAL)
459 AC_DEFUN(BASH_FUNC_LSTAT,
460 [dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
461 dnl inline function in <sys/stat.h>.
462 AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
464 #include <sys/types.h>
465 #include <sys/stat.h>
466 ],[ lstat(".",(struct stat *)0); ],
467 bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
468 if test $bash_cv_func_lstat = yes; then
469 AC_DEFINE(HAVE_LSTAT)
473 AC_DEFUN(BASH_FUNC_INET_ATON,
475 AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
477 #include <sys/types.h>
478 #include <netinet/in.h>
479 #include <arpa/inet.h>
480 struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
481 bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
482 if test $bash_cv_func_inet_aton = yes; then
483 AC_DEFINE(HAVE_INET_ATON)
487 AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
488 [AC_MSG_CHECKING([for a c_line member of struct termios])
489 AC_CACHE_VAL(bash_cv_termios_ldisc,
490 [AC_TRY_COMPILE([#include <sys/types.h>
491 #include <termios.h>],[struct termios t; int i; i = t.c_line;],
492 bash_cv_termios_ldisc=yes, bash_cv_termios_ldisc=no)])dnl
493 AC_MSG_RESULT($bash_cv_termios_ldisc)
494 if test $bash_cv_termios_ldisc = yes; then
495 AC_DEFINE(TERMIOS_LDISC)
499 AC_DEFUN(BASH_STRUCT_TERMIO_LDISC,
500 [AC_MSG_CHECKING([for a c_line member of struct termio])
501 AC_CACHE_VAL(bash_cv_termio_ldisc,
502 [AC_TRY_COMPILE([#include <sys/types.h>
503 #include <termio.h>],[struct termio t; int i; i = t.c_line;],
504 bash_cv_termio_ldisc=yes, bash_cv_termio_ldisc=no)])dnl
505 AC_MSG_RESULT($bash_cv_termio_ldisc)
506 if test $bash_cv_termio_ldisc = yes; then
507 AC_DEFINE(TERMIO_LDISC)
511 AC_DEFUN(BASH_FUNC_GETENV,
512 [AC_MSG_CHECKING(to see if getenv can be redefined)
513 AC_CACHE_VAL(bash_cv_getenv_redef,
525 #if defined (__linux__) || defined (__bsdi__) || defined (convex)
529 #endif /* !__linux__ && !__bsdi__ && !convex */
536 /* The next allows this program to run, but does not allow bash to link
537 when it redefines getenv. I'm not really interested in figuring out
543 exit(s == 0); /* force optimizer to leave getenv in */
545 ], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
546 [AC_MSG_WARN(cannot check getenv redefinition if cross compiling -- defaulting to yes)
547 bash_cv_getenv_redef=yes]
549 AC_MSG_RESULT($bash_cv_getenv_redef)
550 if test $bash_cv_getenv_redef = yes; then
551 AC_DEFINE(CAN_REDEFINE_GETENV)
555 AC_DEFUN(BASH_FUNC_PRINTF,
556 [AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
557 AC_CACHE_VAL(bash_cv_printf_declared,
561 typedef int (*_bashfunc)(const char *, ...);
563 typedef int (*_bashfunc)();
568 pf = (_bashfunc) printf;
571 ], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
572 [AC_MSG_WARN(cannot check printf declaration if cross compiling -- defaulting to yes)
573 bash_cv_printf_declared=yes]
575 AC_MSG_RESULT($bash_cv_printf_declared)
576 if test $bash_cv_printf_declared = yes; then
577 AC_DEFINE(PRINTF_DECLARED)
581 AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS,
582 [AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
583 AC_CACHE_VAL(bash_cv_ulimit_maxfds,
587 long maxfds = ulimit(4, 0L);
588 exit (maxfds == -1L);
590 ], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
591 [AC_MSG_WARN(cannot check ulimit if cross compiling -- defaulting to no)
592 bash_cv_ulimit_maxfds=no]
594 AC_MSG_RESULT($bash_cv_ulimit_maxfds)
595 if test $bash_cv_ulimit_maxfds = yes; then
596 AC_DEFINE(ULIMIT_MAXFDS)
600 AC_DEFUN(BASH_CHECK_LIB_TERMCAP,
602 if test "X$bash_cv_termcap_lib" = "X"; then
605 AC_MSG_CHECKING(which library has the termcap functions)
608 AC_CACHE_VAL(bash_cv_termcap_lib,
609 [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
610 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
611 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
612 bash_cv_termcap_lib=gnutermcap)])])])
613 if test "X$_bash_needmsg" = "Xyes"; then
614 AC_MSG_CHECKING(which library has the termcap functions)
616 AC_MSG_RESULT(using $bash_cv_termcap_lib)
617 if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
618 LDFLAGS="$LDFLAGS -L./lib/termcap"
619 TERMCAP_LIB="./lib/termcap/libtermcap.a"
620 TERMCAP_DEP="./lib/termcap/libtermcap.a"
621 elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
622 TERMCAP_LIB=-ltermcap
624 elif test $bash_cv_termcap_lib = libncurses; then
625 TERMCAP_LIB=-lncurses
633 AC_DEFUN(BASH_FUNC_GETCWD,
634 [AC_MSG_CHECKING([if getcwd() calls popen()])
635 AC_CACHE_VAL(bash_cv_getcwd_calls_popen,
659 FILE *_popen(command, type)
663 return (popen (command, type));
687 ], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
688 [AC_MSG_WARN(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
689 bash_cv_getcwd_calls_popen=no]
691 AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
692 if test $bash_cv_getcwd_calls_popen = yes; then
693 AC_DEFINE(GETCWD_BROKEN)
697 AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
698 [AC_REQUIRE([AC_HEADER_DIRENT])
699 AC_MSG_CHECKING(if struct dirent has a d_ino member)
700 AC_CACHE_VAL(bash_cv_dirent_has_dino,
703 #include <sys/types.h>
706 #endif /* HAVE_UNISTD_H */
707 #if defined(HAVE_DIRENT_H)
710 # define dirent direct
711 # ifdef HAVE_SYS_NDIR_H
712 # include <sys/ndir.h>
713 # endif /* SYSNDIR */
714 # ifdef HAVE_SYS_DIR_H
715 # include <sys/dir.h>
720 #endif /* HAVE_DIRENT_H */
722 struct dirent d; int z; z = d.d_ino;
723 ], bash_cv_dirent_has_dino=yes, bash_cv_dirent_has_dino=no)])
724 AC_MSG_RESULT($bash_cv_dirent_has_dino)
725 if test $bash_cv_dirent_has_dino = yes; then
726 AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
730 AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO,
731 [AC_REQUIRE([AC_HEADER_DIRENT])
732 AC_MSG_CHECKING(if struct dirent has a d_fileno member)
733 AC_CACHE_VAL(bash_cv_dirent_has_d_fileno,
736 #include <sys/types.h>
739 #endif /* HAVE_UNISTD_H */
740 #if defined(HAVE_DIRENT_H)
743 # define dirent direct
744 # ifdef HAVE_SYS_NDIR_H
745 # include <sys/ndir.h>
746 # endif /* SYSNDIR */
747 # ifdef HAVE_SYS_DIR_H
748 # include <sys/dir.h>
753 #endif /* HAVE_DIRENT_H */
755 struct dirent d; int z; z = d.d_fileno;
756 ], bash_cv_dirent_has_d_fileno=yes, bash_cv_dirent_has_d_fileno=no)])
757 AC_MSG_RESULT($bash_cv_dirent_has_d_fileno)
758 if test $bash_cv_dirent_has_d_fileno = yes; then
759 AC_DEFINE(STRUCT_DIRENT_HAS_D_FILENO)
763 AC_DEFUN(BASH_REINSTALL_SIGHANDLERS,
764 [AC_REQUIRE([AC_TYPE_SIGNAL])
765 AC_REQUIRE([BASH_SIGNAL_CHECK])
766 AC_MSG_CHECKING([if signal handlers must be reinstalled when invoked])
767 AC_CACHE_VAL(bash_cv_must_reinstall_sighandlers,
774 typedef RETSIGTYPE sigfunc();
778 #ifdef HAVE_POSIX_SIGNALS
780 set_signal_handler(sig, handler)
784 struct sigaction act, oact;
785 act.sa_handler = handler;
787 sigemptyset (&act.sa_mask);
788 sigemptyset (&oact.sa_mask);
789 sigaction (sig, &act, &oact);
790 return (oact.sa_handler);
793 #define set_signal_handler(s, h) signal(s, h)
806 set_signal_handler(SIGINT, sigint);
807 kill((int)getpid(), SIGINT);
808 kill((int)getpid(), SIGINT);
811 ], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
812 [AC_MSG_WARN(cannot check signal handling if cross compiling -- defaulting to no)
813 bash_cv_must_reinstall_sighandlers=no]
815 AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
816 if test $bash_cv_must_reinstall_sighandlers = yes; then
817 AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
821 AC_DEFUN(BASH_FUNC_SBRK_DECLARED,
822 [AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)
823 AC_CACHE_VAL(bash_cv_sbrk_declared,
824 [AC_EGREP_HEADER(sbrk, unistd.h,
825 bash_cv_sbrk_declared=yes, bash_cv_sbrk_declared=no)])
826 AC_MSG_RESULT($bash_cv_sbrk_declared)
827 if test $bash_cv_sbrk_declared = yes; then
828 AC_DEFINE(SBRK_DECLARED)
832 dnl check that some necessary job control definitions are present
833 AC_DEFUN(BASH_JOB_CONTROL_MISSING,
834 [AC_REQUIRE([BASH_SIGNAL_CHECK])
835 AC_MSG_CHECKING(for presence of necessary job control definitions)
836 AC_CACHE_VAL(bash_cv_job_control_missing,
838 #include <sys/types.h>
839 #ifdef HAVE_SYS_WAIT_H
840 #include <sys/wait.h>
847 /* Add more tests in here as appropriate. */
851 #if !defined (HAVE_POSIX_SIGNALS) && !defined (HAVE_BSD_SIGNALS)
855 /* signals and tty control. */
856 #if !defined (SIGTSTP) || !defined (SIGSTOP) || !defined (SIGCONT)
860 /* process control */
861 #if !defined (WNOHANG) || !defined (WUNTRACED)
865 /* Posix systems have tcgetpgrp and waitpid. */
866 #if defined (_POSIX_VERSION) && !defined (HAVE_TCGETPGRP)
870 #if defined (_POSIX_VERSION) && !defined (HAVE_WAITPID)
874 /* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
875 #if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
880 }], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
881 [AC_MSG_WARN(cannot check job control if cross-compiling -- defaulting to missing)
882 bash_cv_job_control_missing=missing]
884 AC_MSG_RESULT($bash_cv_job_control_missing)
885 if test $bash_cv_job_control_missing = missing; then
886 AC_DEFINE(JOB_CONTROL_MISSING)
890 dnl check whether named pipes are present
891 dnl this requires a previous check for mkfifo, but that is awkward to specify
892 AC_DEFUN(BASH_SYS_NAMED_PIPES,
893 [AC_MSG_CHECKING(for presence of named pipes)
894 AC_CACHE_VAL(bash_cv_sys_named_pipes,
896 #include <sys/types.h>
897 #include <sys/stat.h>
902 /* Add more tests in here as appropriate. */
907 #if defined (HAVE_MKFIFO)
911 #if !defined (S_IFIFO) && (defined (_POSIX_VERSION) && !defined (S_ISFIFO))
918 err = mkdir("/tmp/bash-aclocal", 0700);
923 fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
925 rmdir ("/tmp/bash-aclocal");
929 unlink ("/tmp/bash-aclocal/sh-np-autoconf");
930 rmdir ("/tmp/bash-aclocal");
932 }], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
933 [AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
934 bash_cv_sys_named_pipes=missing]
936 AC_MSG_RESULT($bash_cv_sys_named_pipes)
937 if test $bash_cv_sys_named_pipes = missing; then
938 AC_DEFINE(NAMED_PIPES_MISSING)
942 AC_DEFUN(BASH_FUNC_POSIX_SETJMP,
943 [AC_REQUIRE([BASH_SIGNAL_CHECK])
944 AC_MSG_CHECKING(for presence of POSIX-style sigsetjmp/siglongjmp)
945 AC_CACHE_VAL(bash_cv_func_sigsetjmp,
950 #include <sys/types.h>
956 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
967 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &set);
968 sigprocmask(SIG_BLOCK, (sigset_t *)NULL, &oset);
971 code = sigsetjmp(xx, 1);
973 exit(0); /* could get sigmask and compare to oset here. */
976 sigaddset(&set, SIGINT);
977 sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
983 }], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
984 [AC_MSG_WARN(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
985 bash_cv_func_sigsetjmp=missing]
987 AC_MSG_RESULT($bash_cv_func_sigsetjmp)
988 if test $bash_cv_func_sigsetjmp = present; then
989 AC_DEFINE(HAVE_POSIX_SIGSETJMP)
993 AC_DEFUN(BASH_HAVE_TIOCGWINSZ,
994 [AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
995 AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
996 [AC_TRY_COMPILE([#include <sys/types.h>
997 #include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
998 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
999 AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
1000 if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
1001 AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1005 AC_DEFUN(BASH_STRUCT_WINSIZE,
1006 [AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1007 AC_CACHE_VAL(bash_cv_struct_winsize_header,
1008 [AC_TRY_COMPILE([#include <sys/types.h>
1009 #include <sys/ioctl.h>], [struct winsize x;],
1010 bash_cv_struct_winsize_header=ioctl_h,
1011 [AC_TRY_COMPILE([#include <sys/types.h>
1012 #include <termios.h>], [struct winsize x;],
1013 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1015 if test $bash_cv_struct_winsize_header = ioctl_h; then
1016 AC_MSG_RESULT(sys/ioctl.h)
1017 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1018 elif test $bash_cv_struct_winsize_header = termios_h; then
1019 AC_MSG_RESULT(termios.h)
1020 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1022 AC_MSG_RESULT(not found)
1026 AC_DEFUN(BASH_HAVE_TIOCSTAT,
1027 [AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1028 AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1029 [AC_TRY_COMPILE([#include <sys/types.h>
1030 #include <sys/ioctl.h>], [int x = TIOCSTAT;],
1031 bash_cv_tiocstat_in_ioctl=yes,bash_cv_tiocstat_in_ioctl=no)])
1032 AC_MSG_RESULT($bash_cv_tiocstat_in_ioctl)
1033 if test $bash_cv_tiocstat_in_ioctl = yes; then
1034 AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
1038 AC_DEFUN(BASH_HAVE_FIONREAD,
1039 [AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
1040 AC_CACHE_VAL(bash_cv_fionread_in_ioctl,
1041 [AC_TRY_COMPILE([#include <sys/types.h>
1042 #include <sys/ioctl.h>], [int x = FIONREAD;],
1043 bash_cv_fionread_in_ioctl=yes,bash_cv_fionread_in_ioctl=no)])
1044 AC_MSG_RESULT($bash_cv_fionread_in_ioctl)
1045 if test $bash_cv_fionread_in_ioctl = yes; then
1046 AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
1051 dnl See if speed_t is declared in <sys/types.h>. Some versions of linux
1052 dnl require a definition of speed_t each time <termcap.h> is included,
1053 dnl but you can only get speed_t if you include <termios.h> (on some
1054 dnl versions) or <sys/types.h> (on others).
1056 AC_DEFUN(BASH_MISC_SPEED_T,
1057 [AC_MSG_CHECKING(for speed_t in sys/types.h)
1058 AC_CACHE_VAL(bash_cv_speed_t_in_sys_types,
1059 [AC_TRY_COMPILE([#include <sys/types.h>], [speed_t x;],
1060 bash_cv_speed_t_in_sys_types=yes,bash_cv_speed_t_in_sys_types=no)])
1061 AC_MSG_RESULT($bash_cv_speed_t_in_sys_types)
1062 if test $bash_cv_speed_t_in_sys_types = yes; then
1063 AC_DEFINE(SPEED_T_IN_SYS_TYPES)
1067 AC_DEFUN(BASH_CHECK_GETPW_FUNCS,
1068 [AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1069 AC_CACHE_VAL(bash_cv_getpw_declared,
1070 [AC_EGREP_CPP(getpwuid,
1072 #include <sys/types.h>
1073 #ifdef HAVE_UNISTD_H
1074 # include <unistd.h>
1078 bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1079 AC_MSG_RESULT($bash_cv_getpw_declared)
1080 if test $bash_cv_getpw_declared = yes; then
1081 AC_DEFINE(HAVE_GETPW_DECLS)
1085 AC_DEFUN(BASH_CHECK_DEV_FD,
1086 [AC_MSG_CHECKING(whether /dev/fd is available)
1087 AC_CACHE_VAL(bash_cv_dev_fd,
1088 [if test -d /dev/fd && test -r /dev/fd/0; then
1089 bash_cv_dev_fd=standard
1090 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1091 bash_cv_dev_fd=whacky
1093 bash_cv_dev_fd=absent
1096 AC_MSG_RESULT($bash_cv_dev_fd)
1097 if test $bash_cv_dev_fd = "standard"; then
1098 AC_DEFINE(HAVE_DEV_FD)
1099 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1100 elif test $bash_cv_dev_fd = "whacky"; then
1101 AC_DEFINE(HAVE_DEV_FD)
1102 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1106 AC_DEFUN(BASH_CHECK_DEV_STDIN,
1107 [AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1108 AC_CACHE_VAL(bash_cv_dev_stdin,
1109 [if test -d /dev/fd && test -r /dev/stdin; then
1110 bash_cv_dev_stdin=present
1111 elif test -d /proc/self/fd && test -r /dev/stdin; then
1112 bash_cv_dev_stdin=present
1114 bash_cv_dev_stdin=absent
1117 AC_MSG_RESULT($bash_cv_dev_stdin)
1118 if test $bash_cv_dev_stdin = "present"; then
1119 AC_DEFINE(HAVE_DEV_STDIN)
1124 dnl Check for the presence of getpeername in libsocket.
1125 dnl If libsocket is present, check for libnsl and add it to LIBS if
1126 dnl it's there, since most systems with libsocket require linking
1127 dnl with libnsl as well. This should only be called if getpeername
1128 dnl was not found in libc.
1130 dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1133 AC_DEFUN(BASH_CHECK_SOCKLIB,
1135 if test "X$bash_cv_have_socklib" = "X"; then
1138 AC_MSG_CHECKING(for socket library)
1141 AC_CACHE_VAL(bash_cv_have_socklib,
1142 [AC_CHECK_LIB(socket, getpeername,
1143 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1144 if test "X$_bash_needmsg" = Xyes; then
1145 AC_MSG_RESULT($bash_cv_have_socklib)
1148 if test $bash_cv_have_socklib = yes; then
1149 # check for libnsl, add it to LIBS if present
1150 if test "X$bash_cv_have_libnsl" = "X"; then
1153 AC_MSG_CHECKING(for libnsl)
1156 AC_CACHE_VAL(bash_cv_have_libnsl,
1157 [AC_CHECK_LIB(nsl, t_open,
1158 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1159 if test "X$_bash_needmsg" = Xyes; then
1160 AC_MSG_RESULT($bash_cv_have_libnsl)
1163 if test $bash_cv_have_libnsl = yes; then
1164 LIBS="-lsocket -lnsl $LIBS"
1166 LIBS="-lsocket $LIBS"
1168 AC_DEFINE(HAVE_LIBSOCKET)
1169 AC_DEFINE(HAVE_GETPEERNAME)
1174 dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
1175 dnl system, we can't use AC_PREREQ
1177 AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
1178 [if test "X$bash_cv_have_gethostbyname" = "X"; then
1181 AC_MSG_CHECKING(for gethostbyname in socket library)
1184 AC_CACHE_VAL(bash_cv_have_gethostbyname,
1185 [AC_TRY_LINK([#include <netdb.h>],
1186 [ struct hostent *hp;
1187 hp = gethostbyname("localhost");
1188 ], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
1190 if test "X$_bash_needmsg" = Xyes; then
1191 AC_MSG_CHECKING(for gethostbyname in socket library)
1193 AC_MSG_RESULT($bash_cv_have_gethostbyname)
1194 if test "$bash_cv_have_gethostbyname" = yes; then
1195 AC_DEFINE(HAVE_GETHOSTBYNAME)
1199 AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
1200 [AC_MSG_CHECKING(for default mail directory)
1201 AC_CACHE_VAL(bash_cv_mail_dir,
1202 [if test -d /var/mail; then
1203 bash_cv_mail_dir=/var/mail
1204 elif test -d /usr/mail; then
1205 bash_cv_mail_dir=/usr/mail
1206 elif test -d /var/spool/mail; then
1207 bash_cv_mail_dir=/var/spool/mail
1208 elif test -d /usr/spool/mail; then
1209 bash_cv_mail_dir=/usr/spool/mail
1211 bash_cv_mail_dir=unknown
1214 AC_MSG_RESULT($bash_cv_mail_dir)
1215 if test $bash_cv_mail_dir = "/var/mail"; then
1216 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/mail")
1217 elif test $bash_cv_mail_dir = "/usr/mail"; then
1218 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/usr/mail")
1219 elif test $bash_cv_mail_dir = "/var/spool/mail"; then
1220 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/spool/mail")
1221 elif test $bash_cv_mail_dir = "/usr/spool/mail"; then
1222 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/usr/spool/mail")
1224 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "unknown")
1229 dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1231 AC_DEFUN(BASH_KERNEL_RLIMIT_CHECK,
1232 [AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1233 AC_CACHE_VAL(bash_cv_kernel_rlimit,
1235 #include <sys/types.h>
1236 #include <sys/resource.h>
1241 ], bash_cv_kernel_rlimit=no,
1243 #include <sys/types.h>
1245 #include <sys/resource.h>
1251 ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1253 AC_MSG_RESULT($bash_cv_kernel_rlimit)
1254 if test $bash_cv_kernel_rlimit = yes; then
1255 AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1259 AC_DEFUN(BASH_FUNC_STRCOLL,
1261 AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
1262 AC_CACHE_VAL(bash_cv_func_strcoll_broken,
1265 #if defined (HAVE_LOCALE_H)
1274 char *deflocale, *defcoll;
1276 #ifdef HAVE_SETLOCALE
1277 deflocale = setlocale(LC_ALL, "");
1278 defcoll = setlocale(LC_COLLATE, "");
1282 /* These two values are taken from tests/glob-test. */
1283 r1 = strcoll("abd", "aXd");
1287 r2 = strcmp("abd", "aXd");
1289 /* These two should both be greater than 0. It is permissible for
1290 a system to return different values, as long as the sign is the
1293 /* Exit with 1 (failure) if these two values are both > 0, since
1294 this tests whether strcoll(3) is broken with respect to strcmp(3)
1295 in the default locale. */
1296 exit (r1 > 0 && r2 > 0);
1298 ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
1299 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
1300 bash_cv_func_strcoll_broken=no]
1302 AC_MSG_RESULT($bash_cv_func_strcoll_broken)
1303 if test $bash_cv_func_strcoll_broken = yes; then
1304 AC_DEFINE(STRCOLL_BROKEN)
1309 dnl If available, use support for large files unless the user specified
1310 dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables (<eggert@twinsun.com>
1311 dnl via GNU patch 2.5)
1313 AC_DEFUN(BASH_LARGE_FILE_SUPPORT,
1314 [AC_MSG_CHECKING(whether large file support needs explicit enabling)
1318 ac_shellvars='CPPFLAGS LDFLAGS LIBS'
1319 for ac_shellvar in $ac_shellvars; do
1320 case $ac_shellvar in
1321 CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;;
1322 *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;;
1324 eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
1325 (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
1326 ac_getconf=`getconf $ac_lfsvar`
1327 ac_getconf64=`getconf $ac_lfs64var`
1328 ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64
1329 eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64"
1331 case "$ac_result$ac_getconfs" in
1332 yes) ac_result=no ;;
1334 case "$ac_result$ac_set" in
1335 yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
1337 AC_MSG_RESULT($ac_result)
1340 for ac_shellvar in $ac_shellvars; do
1341 eval $ac_shellvar=\$ac_test_$ac_shellvar
1347 dnl AC_SYS_RESTARTABLE_SYSCALLS tests only for restarted system calls
1348 dnl after a signal handler has been installed with signal(). Since
1349 dnl Bash uses sigaction() if it is available, we need to check whether
1350 dnl or not a signal handler installed with sigaction and SA_RESTART
1351 dnl causes system calls to be restarted after the signal is caught
1353 AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS,
1354 [AC_REQUIRE([BASH_SIGNAL_CHECK])
1355 AC_CACHE_CHECK(whether posix sigaction restarts system calls by default,
1356 bash_cv_sys_restartable_syscalls,
1358 [/* Exit 0 (true) if wait returns something other than -1,
1359 i.e. the pid of the child, which means that wait was restarted
1360 after getting the signal. */
1361 #ifdef HAVE_UNISTD_H
1362 # include <unistd.h>
1364 #include <sys/types.h>
1366 static int caught = 0;
1367 void ucatch (isig) int isig; { caught = 1; }
1370 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
1373 struct sigaction act, oact;
1376 act.sa_handler = ucatch;
1377 /* Might want to add SA_RESTART here, but bash's set_signal_handler
1380 sigemptyset(&act.sa_mask);
1381 sigemptyset(&oact.sa_mask);
1383 /* A possible race condition here, but in practice it never happens. */
1384 if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
1385 sigaction(SIGINT, &act, &oact);
1387 if (status == -1) wait(&i);
1388 exit (status == -1);
1391 ], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
1392 AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
1394 if test $bash_cv_sys_restartable_syscalls = yes; then
1395 AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
1399 dnl Check for 64-bit off_t -- used for malloc alignment
1401 dnl C does not allow duplicate case labels, so the compile will fail if
1402 dnl sizeof(off_t) is > 4.
1404 AC_DEFUN(BASH_CHECK_OFF_T_64,
1405 [AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1407 #ifdef HAVE_UNISTD_H
1410 #include <sys/types.h>
1412 switch (0) case 0: case (sizeof (off_t) <= 4):;
1413 ], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1414 if test $bash_cv_off_t_64 = yes; then
1415 AC_DEFINE(HAVE_OFF_T_64)
1418 AC_DEFUN(BASH_STRUCT_TIMEVAL,
1419 [AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1420 AC_CACHE_VAL(bash_cv_struct_timeval,
1422 AC_EGREP_HEADER(struct timeval, sys/time.h,
1423 bash_cv_struct_timeval=yes,
1424 AC_EGREP_HEADER(struct timeval, time.h,
1425 bash_cv_struct_timeval=yes,
1426 bash_cv_struct_timeval=no))
1428 AC_MSG_RESULT($bash_cv_struct_timeval)
1429 if test $bash_cv_struct_timeval = yes; then
1430 AC_DEFINE(HAVE_TIMEVAL)
1434 AC_DEFUN(BASH_CHECK_RTSIGS,
1435 [AC_MSG_CHECKING(for unusable real-time signals due to large values)
1436 AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1438 #include <sys/types.h>
1447 int n_sigs = 2 * NSIG;
1449 int rtmin = SIGRTMIN;
1454 exit(rtmin < n_sigs);
1455 }], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1456 [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1457 bash_cv_unusable_rtsigs=yes]
1459 AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1460 if test $bash_cv_unusable_rtsigs = yes; then
1461 AC_DEFINE(UNUSABLE_RT_SIGNALS)