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 programs are able to redeclare getpw functions)
1069 AC_CACHE_VAL(bash_cv_can_redecl_getpw,
1070 [AC_TRY_COMPILE([#include <sys/types.h>
1072 extern struct passwd *getpwent();
1073 extern struct passwd *getpwuid();
1074 extern struct passwd *getpwnam();],
1075 [struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
1076 bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
1077 AC_MSG_RESULT($bash_cv_can_redecl_getpw)
1078 if test $bash_cv_can_redecl_getpw = no; then
1079 AC_DEFINE(HAVE_GETPW_DECLS)
1083 AC_DEFUN(BASH_CHECK_DEV_FD,
1084 [AC_MSG_CHECKING(whether /dev/fd is available)
1085 AC_CACHE_VAL(bash_cv_dev_fd,
1086 [if test -d /dev/fd && test -r /dev/fd/0; then
1087 bash_cv_dev_fd=standard
1088 elif test -d /proc/self/fd && test -r /proc/self/fd/0; then
1089 bash_cv_dev_fd=whacky
1091 bash_cv_dev_fd=absent
1094 AC_MSG_RESULT($bash_cv_dev_fd)
1095 if test $bash_cv_dev_fd = "standard"; then
1096 AC_DEFINE(HAVE_DEV_FD)
1097 AC_DEFINE(DEV_FD_PREFIX, "/dev/fd/")
1098 elif test $bash_cv_dev_fd = "whacky"; then
1099 AC_DEFINE(HAVE_DEV_FD)
1100 AC_DEFINE(DEV_FD_PREFIX, "/proc/self/fd/")
1104 AC_DEFUN(BASH_CHECK_DEV_STDIN,
1105 [AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
1106 AC_CACHE_VAL(bash_cv_dev_stdin,
1107 [if test -d /dev/fd && test -r /dev/stdin; then
1108 bash_cv_dev_stdin=present
1109 elif test -d /proc/self/fd && test -r /dev/stdin; then
1110 bash_cv_dev_stdin=present
1112 bash_cv_dev_stdin=absent
1115 AC_MSG_RESULT($bash_cv_dev_stdin)
1116 if test $bash_cv_dev_stdin = "present"; then
1117 AC_DEFINE(HAVE_DEV_STDIN)
1122 dnl Check for the presence of getpeername in libsocket.
1123 dnl If libsocket is present, check for libnsl and add it to LIBS if
1124 dnl it's there, since most systems with libsocket require linking
1125 dnl with libnsl as well. This should only be called if getpeername
1126 dnl was not found in libc.
1128 dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
1131 AC_DEFUN(BASH_CHECK_SOCKLIB,
1133 if test "X$bash_cv_have_socklib" = "X"; then
1136 AC_MSG_CHECKING(for socket library)
1139 AC_CACHE_VAL(bash_cv_have_socklib,
1140 [AC_CHECK_LIB(socket, getpeername,
1141 bash_cv_have_socklib=yes, bash_cv_have_socklib=no, -lnsl)])
1142 if test "X$_bash_needmsg" = Xyes; then
1143 AC_MSG_RESULT($bash_cv_have_socklib)
1146 if test $bash_cv_have_socklib = yes; then
1147 # check for libnsl, add it to LIBS if present
1148 if test "X$bash_cv_have_libnsl" = "X"; then
1151 AC_MSG_CHECKING(for libnsl)
1154 AC_CACHE_VAL(bash_cv_have_libnsl,
1155 [AC_CHECK_LIB(nsl, t_open,
1156 bash_cv_have_libnsl=yes, bash_cv_have_libnsl=no)])
1157 if test "X$_bash_needmsg" = Xyes; then
1158 AC_MSG_RESULT($bash_cv_have_libnsl)
1161 if test $bash_cv_have_libnsl = yes; then
1162 LIBS="-lsocket -lnsl $LIBS"
1164 LIBS="-lsocket $LIBS"
1166 AC_DEFINE(HAVE_LIBSOCKET)
1167 AC_DEFINE(HAVE_GETPEERNAME)
1172 dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
1173 dnl system, we can't use AC_PREREQ
1175 AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
1176 [if test "X$bash_cv_have_gethostbyname" = "X"; then
1179 AC_MSG_CHECKING(for gethostbyname in socket library)
1182 AC_CACHE_VAL(bash_cv_have_gethostbyname,
1183 [AC_TRY_LINK([#include <netdb.h>],
1184 [ struct hostent *hp;
1185 hp = gethostbyname("localhost");
1186 ], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
1188 if test "X$_bash_needmsg" = Xyes; then
1189 AC_MSG_CHECKING(for gethostbyname in socket library)
1191 AC_MSG_RESULT($bash_cv_have_gethostbyname)
1192 if test "$bash_cv_have_gethostbyname" = yes; then
1193 AC_DEFINE(HAVE_GETHOSTBYNAME)
1197 AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
1198 [AC_MSG_CHECKING(for default mail directory)
1199 AC_CACHE_VAL(bash_cv_mail_dir,
1200 [if test -d /var/mail; then
1201 bash_cv_mail_dir=/var/mail
1202 elif test -d /usr/mail; then
1203 bash_cv_mail_dir=/usr/mail
1204 elif test -d /var/spool/mail; then
1205 bash_cv_mail_dir=/var/spool/mail
1206 elif test -d /usr/spool/mail; then
1207 bash_cv_mail_dir=/usr/spool/mail
1209 bash_cv_mail_dir=unknown
1212 AC_MSG_RESULT($bash_cv_mail_dir)
1213 if test $bash_cv_mail_dir = "/var/mail"; then
1214 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/mail")
1215 elif test $bash_cv_mail_dir = "/usr/mail"; then
1216 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/usr/mail")
1217 elif test $bash_cv_mail_dir = "/var/spool/mail"; then
1218 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/spool/mail")
1219 elif test $bash_cv_mail_dir = "/usr/spool/mail"; then
1220 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/usr/spool/mail")
1222 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "unknown")
1227 dnl Check if HPUX needs _KERNEL defined for RLIMIT_* definitions
1229 AC_DEFUN(BASH_KERNEL_RLIMIT_CHECK,
1230 [AC_MSG_CHECKING([whether $host_os needs _KERNEL for RLIMIT defines])
1231 AC_CACHE_VAL(bash_cv_kernel_rlimit,
1233 #include <sys/types.h>
1234 #include <sys/resource.h>
1239 ], bash_cv_kernel_rlimit=no,
1241 #include <sys/types.h>
1243 #include <sys/resource.h>
1249 ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1251 AC_MSG_RESULT($bash_cv_kernel_rlimit)
1252 if test $bash_cv_kernel_rlimit = yes; then
1253 AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1257 AC_DEFUN(BASH_FUNC_STRCOLL,
1259 AC_MSG_CHECKING(whether or not strcoll and strcmp differ)
1260 AC_CACHE_VAL(bash_cv_func_strcoll_broken,
1263 #if defined (HAVE_LOCALE_H)
1272 char *deflocale, *defcoll;
1274 #ifdef HAVE_SETLOCALE
1275 deflocale = setlocale(LC_ALL, "");
1276 defcoll = setlocale(LC_COLLATE, "");
1280 /* These two values are taken from tests/glob-test. */
1281 r1 = strcoll("abd", "aXd");
1285 r2 = strcmp("abd", "aXd");
1287 /* These two should both be greater than 0. It is permissible for
1288 a system to return different values, as long as the sign is the
1291 /* Exit with 1 (failure) if these two values are both > 0, since
1292 this tests whether strcoll(3) is broken with respect to strcmp(3)
1293 in the default locale. */
1294 exit (r1 > 0 && r2 > 0);
1296 ], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
1297 [AC_MSG_WARN(cannot check strcoll if cross compiling -- defaulting to no)
1298 bash_cv_func_strcoll_broken=no]
1300 AC_MSG_RESULT($bash_cv_func_strcoll_broken)
1301 if test $bash_cv_func_strcoll_broken = yes; then
1302 AC_DEFINE(STRCOLL_BROKEN)
1307 dnl If available, use support for large files unless the user specified
1308 dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables (<eggert@twinsun.com>
1309 dnl via GNU patch 2.5)
1311 AC_DEFUN(BASH_LARGE_FILE_SUPPORT,
1312 [AC_MSG_CHECKING(whether large file support needs explicit enabling)
1316 ac_shellvars='CPPFLAGS LDFLAGS LIBS'
1317 for ac_shellvar in $ac_shellvars; do
1318 case $ac_shellvar in
1319 CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;;
1320 *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;;
1322 eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
1323 (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
1324 ac_getconf=`getconf $ac_lfsvar`
1325 ac_getconf64=`getconf $ac_lfs64var`
1326 ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64
1327 eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64"
1329 case "$ac_result$ac_getconfs" in
1330 yes) ac_result=no ;;
1332 case "$ac_result$ac_set" in
1333 yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
1335 AC_MSG_RESULT($ac_result)
1338 for ac_shellvar in $ac_shellvars; do
1339 eval $ac_shellvar=\$ac_test_$ac_shellvar
1345 dnl AC_SYS_RESTARTABLE_SYSCALLS tests only for restarted system calls
1346 dnl after a signal handler has been installed with signal(). Since
1347 dnl Bash uses sigaction() if it is available, we need to check whether
1348 dnl or not a signal handler installed with sigaction and SA_RESTART
1349 dnl causes system calls to be restarted after the signal is caught
1351 AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS,
1352 [AC_REQUIRE([BASH_SIGNAL_CHECK])
1353 AC_CACHE_CHECK(for restartable system calls with posix sigaction,
1354 bash_cv_sys_restartable_syscalls,
1356 [/* Exit 0 (true) if wait returns something other than -1,
1357 i.e. the pid of the child, which means that wait was restarted
1358 after getting the signal. */
1359 #include <sys/types.h>
1361 static int caught = 0;
1362 void ucatch (isig) int isig; { caught = 1; }
1365 #if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
1368 struct sigaction act, oact;
1371 act.sa_handler = ucatch;
1372 /* Might want to add SA_RESTART here, but bash's set_signal_handler
1375 sigemptyset(&act.sa_mask);
1376 sigemptyset(&oact.sa_mask);
1378 /* A possible race condition here, but in practice it never happens. */
1379 if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
1380 sigaction(SIGINT, &act, &oact);
1382 if (status == -1) wait(&i);
1383 exit (status == -1);
1386 ], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
1387 AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
1389 if test $bash_cv_sys_restartable_syscalls = yes; then
1390 AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
1394 dnl Check for 64-bit off_t -- used for malloc alignment
1396 dnl C does not allow duplicate case labels, so the compile will fail if
1397 dnl sizeof(off_t) is > 4.
1399 AC_DEFUN(BASH_CHECK_OFF_T_64,
1400 [AC_CACHE_CHECK(for 64-bit off_t, bash_cv_off_t_64,
1402 #ifdef HAVE_UNISTD_H
1405 #include <sys/types.h>
1407 switch (0) case 0: case (sizeof (off_t) <= 4):;
1408 ], bash_cv_off_t_64=no, bash_cv_off_t_64=yes))
1409 if test $bash_cv_off_t_64 = yes; then
1410 AC_DEFINE(HAVE_OFF_T_64)
1413 AC_DEFUN(BASH_STRUCT_TIMEVAL,
1414 [AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
1415 AC_CACHE_VAL(bash_cv_struct_timeval,
1417 AC_EGREP_HEADER(struct timeval, sys/time.h,
1418 bash_cv_struct_timeval=yes,
1419 AC_EGREP_HEADER(struct timeval, time.h,
1420 bash_cv_struct_timeval=yes,
1421 bash_cv_struct_timeval=no))
1423 AC_MSG_RESULT($bash_cv_struct_timeval)
1424 if test $bash_cv_struct_timeval = yes; then
1425 AC_DEFINE(HAVE_TIMEVAL)