Deleted Added
full compact
aclocal.m4 (26497) aclocal.m4 (35486)
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6dnl
7dnl Check if dup2() does not clear the close on exec flag
8dnl

--- 12 unchanged lines hidden (view full) ---

21 fd2 = dup2(fd1, 1);
22 if (fd2 < 0)
23 exit(2);
24 fl = fcntl(fd2, 1, 0);
25 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
26 exit(fl != 1);
27}
28], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
1dnl
2dnl Bash specific tests
3dnl
4dnl Some derived from PDKSH 5.1.3 autoconf tests
5dnl
6dnl
7dnl Check if dup2() does not clear the close on exec flag
8dnl

--- 12 unchanged lines hidden (view full) ---

21 fd2 = dup2(fd1, 1);
22 if (fd2 < 0)
23 exit(2);
24 fl = fcntl(fd2, 1, 0);
25 /* fl will be 1 if dup2 did not reset the close-on-exec flag. */
26 exit(fl != 1);
27}
28], bash_cv_dup2_broken=yes, bash_cv_dup2_broken=no,
29 AC_MSG_ERROR(cannot check dup2 if cross compiling))
29 [AC_MSG_ERROR(cannot check dup2 if cross compiling -- defaulting to no)
30 bash_cv_dup2_broken=no])
30])
31AC_MSG_RESULT($bash_cv_dup2_broken)
32if test $bash_cv_dup2_broken = yes; then
33AC_DEFINE(DUP2_BROKEN)
34fi
35])
36
37dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)

--- 85 unchanged lines hidden (view full) ---

123 close(fds[1]);
124 if (read(fds[0], &ok, 1) != 1)
125 exit(4);
126 wait(&status);
127 wait(&status);
128 exit(ok ? 0 : 5);
129}
130], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
31])
32AC_MSG_RESULT($bash_cv_dup2_broken)
33if test $bash_cv_dup2_broken = yes; then
34AC_DEFINE(DUP2_BROKEN)
35fi
36])
37
38dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)

--- 85 unchanged lines hidden (view full) ---

124 close(fds[1]);
125 if (read(fds[0], &ok, 1) != 1)
126 exit(4);
127 wait(&status);
128 wait(&status);
129 exit(ok ? 0 : 5);
130}
131], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
131 AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling))
132 [AC_MSG_ERROR(cannot check pgrp synchronization if cross compiling -- defaulting to no)
133 bash_cv_pgrp_pipe=no])
132])
133AC_MSG_RESULT($bash_cv_pgrp_pipe)
134if test $bash_cv_pgrp_pipe = yes; then
135AC_DEFINE(PGRP_PIPE)
136fi
137])
138
139dnl

--- 24 unchanged lines hidden (view full) ---

164dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
165dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
166dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
167dnl matters, this just checks for rlim_t, quad_t, or long.
168dnl
169AC_DEFUN(BASH_RLIMIT_TYPE,
170[AC_MSG_CHECKING(for size and type of struct rlimit fields)
171AC_CACHE_VAL(bash_cv_type_rlimit,
134])
135AC_MSG_RESULT($bash_cv_pgrp_pipe)
136if test $bash_cv_pgrp_pipe = yes; then
137AC_DEFINE(PGRP_PIPE)
138fi
139])
140
141dnl

--- 24 unchanged lines hidden (view full) ---

166dnl Type of struct rlimit fields: some systems (OSF/1, NetBSD, RISC/os 5.0)
167dnl have a rlim_t, others (4.4BSD based systems) use quad_t, others use
168dnl long and still others use int (HP-UX 9.01, SunOS 4.1.3). To simplify
169dnl matters, this just checks for rlim_t, quad_t, or long.
170dnl
171AC_DEFUN(BASH_RLIMIT_TYPE,
172[AC_MSG_CHECKING(for size and type of struct rlimit fields)
173AC_CACHE_VAL(bash_cv_type_rlimit,
172[AC_TRY_COMPILE([#include <sys/types.h>],
174[AC_TRY_COMPILE([#include
175#include <sys/resource.h>],
173[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
174AC_TRY_RUN([
175#include <sys/types.h>
176#include <sys/time.h>
177#include <sys/resource.h>
178main()
179{
180#ifdef HAVE_QUAD_T
181 struct rlimit rl;
182 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
183 exit(0);
184#endif
185 exit(1);
186}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
176[rlim_t xxx;], bash_cv_type_rlimit=rlim_t,[
177AC_TRY_RUN([
178#include <sys/types.h>
179#include <sys/time.h>
180#include <sys/resource.h>
181main()
182{
183#ifdef HAVE_QUAD_T
184 struct rlimit rl;
185 if (sizeof(rl.rlim_cur) == sizeof(quad_t))
186 exit(0);
187#endif
188 exit(1);
189}], bash_cv_type_rlimit=quad_t, bash_cv_type_rlimit=long,
187 AC_MSG_ERROR(cannot check quad_t if cross compiling))])
190 [AC_MSG_ERROR(cannot check quad_t if cross compiling -- defaulting to long)
191 bash_cv_type_rlimit=long])])
188])
189AC_MSG_RESULT($bash_cv_type_rlimit)
190if test $bash_cv_type_rlimit = quad_t; then
191AC_DEFINE(RLIMTYPE, quad_t)
192elif test $bash_cv_type_rlimit = rlim_t; then
193AC_DEFINE(RLIMTYPE, rlim_t)
194fi
195])
196
197dnl
198dnl Check for sys_siglist[] or _sys_siglist[]
199dnl
192])
193AC_MSG_RESULT($bash_cv_type_rlimit)
194if test $bash_cv_type_rlimit = quad_t; then
195AC_DEFINE(RLIMTYPE, quad_t)
196elif test $bash_cv_type_rlimit = rlim_t; then
197AC_DEFINE(RLIMTYPE, rlim_t)
198fi
199])
200
201dnl
202dnl Check for sys_siglist[] or _sys_siglist[]
203dnl
204AC_DEFUN(BASH_DECL_UNDER_SYS_SIGLIST,
205[AC_MSG_CHECKING([for _sys_siglist in signal.h or unistd.h])
206AC_CACHE_VAL(bash_cv_decl_under_sys_siglist,
207[AC_TRY_COMPILE([
208#include <sys/types.h>
209#include <signal.h>
210#ifdef HAVE_UNISTD_H
211#include <unistd.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_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)])])dnl
215AC_MSG_RESULT($bash_cv_decl_under_sys_siglist)
216if test $bash_cv_decl_under_sys_siglist = yes; then
217AC_DEFINE(UNDER_SYS_SIGLIST_DECLARED)
218fi
219])
220
200AC_DEFUN(BASH_UNDER_SYS_SIGLIST,
221AC_DEFUN(BASH_UNDER_SYS_SIGLIST,
201[AC_MSG_CHECKING([for _sys_siglist in system C library])
222[AC_REQUIRE([BASH_DECL_UNDER_SYS_SIGLIST])
223AC_MSG_CHECKING([for _sys_siglist in system C library])
202AC_CACHE_VAL(bash_cv_under_sys_siglist,
203[AC_TRY_RUN([
204#include <sys/types.h>
205#include <signal.h>
206#ifdef HAVE_UNISTD_H
207#include <unistd.h>
208#endif
224AC_CACHE_VAL(bash_cv_under_sys_siglist,
225[AC_TRY_RUN([
226#include <sys/types.h>
227#include <signal.h>
228#ifdef HAVE_UNISTD_H
229#include <unistd.h>
230#endif
209#ifndef _sys_siglist
231#ifndef UNDER_SYS_SIGLIST_DECLARED
210extern char *_sys_siglist[];
211#endif
212main()
213{
232extern char *_sys_siglist[];
233#endif
234main()
235{
214char *msg = _sys_siglist[2];
236char *msg = (char *)_sys_siglist[2];
215exit(msg == 0);
216}],
237exit(msg == 0);
238}],
217bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
218AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling))])dnl
239 bash_cv_under_sys_siglist=yes, bash_cv_under_sys_siglist=no,
240 [AC_MSG_ERROR(cannot check for _sys_siglist[] if cross compiling -- defaulting to no)
241 bash_cv_under_sys_siglist=no])])
219AC_MSG_RESULT($bash_cv_under_sys_siglist)
220if test $bash_cv_under_sys_siglist = yes; then
221AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
222fi
223])
224
225AC_DEFUN(BASH_SYS_SIGLIST,
226[AC_REQUIRE([AC_DECL_SYS_SIGLIST])

--- 8 unchanged lines hidden (view full) ---

235#ifndef SYS_SIGLIST_DECLARED
236extern char *sys_siglist[];
237#endif
238main()
239{
240char *msg = sys_siglist[2];
241exit(msg == 0);
242}],
242AC_MSG_RESULT($bash_cv_under_sys_siglist)
243if test $bash_cv_under_sys_siglist = yes; then
244AC_DEFINE(HAVE_UNDER_SYS_SIGLIST)
245fi
246])
247
248AC_DEFUN(BASH_SYS_SIGLIST,
249[AC_REQUIRE([AC_DECL_SYS_SIGLIST])

--- 8 unchanged lines hidden (view full) ---

258#ifndef SYS_SIGLIST_DECLARED
259extern char *sys_siglist[];
260#endif
261main()
262{
263char *msg = sys_siglist[2];
264exit(msg == 0);
265}],
243bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
244AC_MSG_ERROR(cannot check for sys_siglist if cross compiling))])dnl
266 bash_cv_sys_siglist=yes, bash_cv_sys_siglist=no,
267 [AC_MSG_ERROR(cannot check for sys_siglist if cross compiling -- defaulting to no)
268 bash_cv_sys_siglist=no])])
245AC_MSG_RESULT($bash_cv_sys_siglist)
246if test $bash_cv_sys_siglist = yes; then
247AC_DEFINE(HAVE_SYS_SIGLIST)
248fi
249])
250
251dnl Check for sys_errlist[] and sys_nerr, check for declaration
252AC_DEFUN(BASH_SYS_ERRLIST,

--- 43 unchanged lines hidden (view full) ---

296unlink("/tmp/not_a_directory");
297fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
298write(fd, "\n", 1);
299close(fd);
300dir = opendir("/tmp/not_a_directory");
301unlink("/tmp/not_a_directory");
302exit (dir == 0);
303}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
269AC_MSG_RESULT($bash_cv_sys_siglist)
270if test $bash_cv_sys_siglist = yes; then
271AC_DEFINE(HAVE_SYS_SIGLIST)
272fi
273])
274
275dnl Check for sys_errlist[] and sys_nerr, check for declaration
276AC_DEFUN(BASH_SYS_ERRLIST,

--- 43 unchanged lines hidden (view full) ---

320unlink("/tmp/not_a_directory");
321fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
322write(fd, "\n", 1);
323close(fd);
324dir = opendir("/tmp/not_a_directory");
325unlink("/tmp/not_a_directory");
326exit (dir == 0);
327}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
304 AC_MSG_ERROR(cannot check opendir if cross compiling))])
328 [AC_MSG_ERROR(cannot check opendir if cross compiling -- defaulting to no)
329 bash_cv_opendir_not_robust=no]
330)])
305AC_MSG_RESULT($bash_cv_opendir_not_robust)
306if test $bash_cv_opendir_not_robust = yes; then
307AC_DEFINE(OPENDIR_NOT_ROBUST)
308fi
309])
310
311dnl
312AC_DEFUN(BASH_TYPE_SIGHANDLER,

--- 10 unchanged lines hidden (view full) ---

323void (*signal ()) ();],
324[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
325AC_MSG_RESULT($bash_cv_void_sighandler)
326if test $bash_cv_void_sighandler = yes; then
327AC_DEFINE(VOID_SIGHANDLER)
328fi
329])
330
331AC_MSG_RESULT($bash_cv_opendir_not_robust)
332if test $bash_cv_opendir_not_robust = yes; then
333AC_DEFINE(OPENDIR_NOT_ROBUST)
334fi
335])
336
337dnl
338AC_DEFUN(BASH_TYPE_SIGHANDLER,

--- 10 unchanged lines hidden (view full) ---

349void (*signal ()) ();],
350[int i;], bash_cv_void_sighandler=yes, bash_cv_void_sighandler=no)])dnl
351AC_MSG_RESULT($bash_cv_void_sighandler)
352if test $bash_cv_void_sighandler = yes; then
353AC_DEFINE(VOID_SIGHANDLER)
354fi
355])
356
357AC_DEFUN(BASH_TYPE_INT32_T,
358[
359if test "X$bash_cv_type_int32_t" = "X"; then
360_bash_needmsg=yes
361else
362AC_MSG_CHECKING(which builtin C type is 32 bits wide)
363_bash_needmsg=
364fi
365AC_CACHE_VAL(bash_cv_type_int32_t,
366[AC_TRY_RUN([
367main()
368{
369#if SIZEOF_INT == 4
370exit (0);
371#else
372# if SIZEOF_LONG == 4
373exit (1);
374# else
375# error cannot find 32 bit type...
376# endif
377#endif
378}], bash_cv_type_int32_t=int, bash_cv_type_int32_t=long,
379 [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
380 bash_cv_type_int32_t=int]
381)])
382if test "X$_bash_needmsg" = "Xyes"; then
383AC_MSG_CHECKING(which builtin C type is 32 bits wide)
384fi
385AC_MSG_RESULT($bash_cv_type_int32_t);
386if test "$bash_cv_type_int32_t" = "int"; then
387AC_DEFINE(int32_t, int)
388else
389AC_DEFINE(int32_t, long)
390fi
391])
392
393AC_DEFUN(BASH_TYPE_U_INT32_T,
394[
395if test "X$bash_cv_type_u_int32_t" = "X"; then
396_bash_needmsg=yes
397else
398AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
399_bash_needmsg=
400fi
401AC_CACHE_VAL(bash_cv_type_u_int32_t,
402[AC_TRY_RUN([
403main()
404{
405#if SIZEOF_INT == 4
406exit (0);
407#else
408# if SIZEOF_LONG == 4
409exit (1);
410# else
411# error cannot find 32 bit type...
412# endif
413#endif
414}], bash_cv_type_u_int32_t=int, bash_cv_type_u_int32_t=long,
415 [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
416 bash_cv_type_u_int32_t=int]
417)])
418if test "X$_bash_needmsg" = "Xyes"; then
419AC_MSG_CHECKING(which unsigned builtin C type is 32 bits wide)
420fi
421AC_MSG_RESULT($bash_cv_type_u_int32_t);
422if test "$bash_cv_type_u_int32_t" = "int"; then
423AC_DEFINE(u_int32_t, unsigned int)
424else
425AC_DEFINE(u_int32_t, unsigned long)
426fi
427])
428
429AC_DEFUN(BASH_TYPE_PTRDIFF_T,
430[
431if test "X$bash_cv_type_ptrdiff_t" = "X"; then
432_bash_needmsg=yes
433else
434AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
435_bash_needmsg=
436fi
437AC_CACHE_VAL(bash_cv_type_ptrdiff_t,
438[AC_TRY_RUN([
439main()
440{
441#if SIZEOF_CHAR_P == SIZEOF_INT
442exit (0);
443#else
444# if SIZEOF_CHAR_P == SIZEOF_LONG
445exit (1);
446# else
447# error cannot find type for pointer arithmetic...
448# endif
449#endif
450}], bash_cv_type_ptrdiff_t=int, bash_cv_type_ptrdiff_t=long,
451 [AC_MSG_ERROR(cannot check type sizes if cross-compiling -- defaulting to int)
452 bash_cv_type_ptrdiff_t=int]
453)])
454if test "X$_bash_needmsg" = "Xyes"; then
455AC_MSG_CHECKING(which builtin C type is correct for ptrdiff_t)
456fi
457AC_MSG_RESULT($bash_cv_type_ptrdiff_t);
458if test "$bash_cv_type_ptrdiff_t" = "int"; then
459AC_DEFINE(ptrdiff_t, int)
460else
461AC_DEFINE(ptrdiff_t, long)
462fi
463])
464
331AC_DEFUN(BASH_FUNC_STRSIGNAL,
465AC_DEFUN(BASH_FUNC_STRSIGNAL,
332[AC_MSG_CHECKING([for the existance of strsignal])
466[AC_MSG_CHECKING([for the existence of strsignal])
333AC_CACHE_VAL(bash_cv_have_strsignal,
334[AC_TRY_LINK([#include <sys/types.h>
335#include <signal.h>],
336[char *s = (char *)strsignal(2);],
337 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
338AC_MSG_RESULT($bash_cv_have_strsignal)
339if test $bash_cv_have_strsignal = yes; then
340AC_DEFINE(HAVE_STRSIGNAL)
341fi
342])
343
344AC_DEFUN(BASH_FUNC_LSTAT,
345[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
346dnl inline function in <sys/stat.h>.
347AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
348[AC_TRY_LINK([
349#include <sys/types.h>
350#include <sys/stat.h>
467AC_CACHE_VAL(bash_cv_have_strsignal,
468[AC_TRY_LINK([#include <sys/types.h>
469#include <signal.h>],
470[char *s = (char *)strsignal(2);],
471 bash_cv_have_strsignal=yes, bash_cv_have_strsignal=no)])
472AC_MSG_RESULT($bash_cv_have_strsignal)
473if test $bash_cv_have_strsignal = yes; then
474AC_DEFINE(HAVE_STRSIGNAL)
475fi
476])
477
478AC_DEFUN(BASH_FUNC_LSTAT,
479[dnl Cannot use AC_CHECK_FUNCS(lstat) because Linux defines lstat() as an
480dnl inline function in <sys/stat.h>.
481AC_CACHE_CHECK([for lstat], bash_cv_func_lstat,
482[AC_TRY_LINK([
483#include <sys/types.h>
484#include <sys/stat.h>
351],[ lstat("",(struct stat *)0); ],
485],[ lstat(".",(struct stat *)0); ],
352bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
353if test $bash_cv_func_lstat = yes; then
354 AC_DEFINE(HAVE_LSTAT)
355fi
356])
357
358AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
359[AC_MSG_CHECKING([for a c_line member of struct termios])

--- 49 unchanged lines hidden (view full) ---

409 why not. */
410#if defined (NeXT)
411exit(1);
412#endif
413s = getenv("ABCDE");
414exit(s == 0); /* force optimizer to leave getenv in */
415}
416], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
486bash_cv_func_lstat=yes, bash_cv_func_lstat=no)])
487if test $bash_cv_func_lstat = yes; then
488 AC_DEFINE(HAVE_LSTAT)
489fi
490])
491
492AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
493[AC_MSG_CHECKING([for a c_line member of struct termios])

--- 49 unchanged lines hidden (view full) ---

543 why not. */
544#if defined (NeXT)
545exit(1);
546#endif
547s = getenv("ABCDE");
548exit(s == 0); /* force optimizer to leave getenv in */
549}
550], bash_cv_getenv_redef=yes, bash_cv_getenv_redef=no,
417AC_MSG_ERROR(cannot check getenv redefinition if cross compiling))])
551 [AC_MSG_ERROR(cannot check getenv redefinition if cross compiling -- defaulting to yes)
552 bash_cv_getenv_redef=yes]
553)])
418AC_MSG_RESULT($bash_cv_getenv_redef)
419if test $bash_cv_getenv_redef = yes; then
420AC_DEFINE(CAN_REDEFINE_GETENV)
421fi
422])
423
424AC_DEFUN(BASH_FUNC_PRINTF,
425[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
426AC_CACHE_VAL(bash_cv_printf_declared,
427[AC_TRY_RUN([
428#include <stdio.h>
429#ifdef __STDC__
430typedef int (*_bashfunc)(const char *, ...);
431#else
432typedef int (*_bashfunc)();
433#endif
434main()
435{
436_bashfunc pf;
554AC_MSG_RESULT($bash_cv_getenv_redef)
555if test $bash_cv_getenv_redef = yes; then
556AC_DEFINE(CAN_REDEFINE_GETENV)
557fi
558])
559
560AC_DEFUN(BASH_FUNC_PRINTF,
561[AC_MSG_CHECKING(for declaration of printf in <stdio.h>)
562AC_CACHE_VAL(bash_cv_printf_declared,
563[AC_TRY_RUN([
564#include <stdio.h>
565#ifdef __STDC__
566typedef int (*_bashfunc)(const char *, ...);
567#else
568typedef int (*_bashfunc)();
569#endif
570main()
571{
572_bashfunc pf;
437pf = printf;
573pf = (_bashfunc) printf;
438exit(pf == 0);
439}
574exit(pf == 0);
575}
440],bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
441AC_MSG_ERROR(cannot check printf declaration if cross compiling))])
576], bash_cv_printf_declared=yes, bash_cv_printf_declared=no,
577 [AC_MSG_ERROR(cannot check printf declaration if cross compiling -- defaulting to yes)
578 bash_cv_printf_declared=yes]
579)])
442AC_MSG_RESULT($bash_cv_printf_declared)
443if test $bash_cv_printf_declared = yes; then
444AC_DEFINE(PRINTF_DECLARED)
445fi
446])
447
448AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS,
449[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
450AC_CACHE_VAL(bash_cv_ulimit_maxfds,
451[AC_TRY_RUN([
452main()
453{
454long maxfds = ulimit(4, 0L);
455exit (maxfds == -1L);
456}
580AC_MSG_RESULT($bash_cv_printf_declared)
581if test $bash_cv_printf_declared = yes; then
582AC_DEFINE(PRINTF_DECLARED)
583fi
584])
585
586AC_DEFUN(BASH_FUNC_ULIMIT_MAXFDS,
587[AC_MSG_CHECKING(whether ulimit can substitute for getdtablesize)
588AC_CACHE_VAL(bash_cv_ulimit_maxfds,
589[AC_TRY_RUN([
590main()
591{
592long maxfds = ulimit(4, 0L);
593exit (maxfds == -1L);
594}
457],bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
458AC_MSG_ERROR(cannot check ulimit if cross compiling))])
595], bash_cv_ulimit_maxfds=yes, bash_cv_ulimit_maxfds=no,
596 [AC_MSG_ERROR(cannot check ulimit if cross compiling -- defaulting to no)
597 bash_cv_ulimit_maxfds=no]
598)])
459AC_MSG_RESULT($bash_cv_ulimit_maxfds)
460if test $bash_cv_ulimit_maxfds = yes; then
461AC_DEFINE(ULIMIT_MAXFDS)
462fi
463])
464
465AC_DEFUN(BASH_CHECK_LIB_TERMCAP,
466[

--- 7 unchanged lines hidden (view full) ---

474[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
475 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
476 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
477 bash_cv_termcap_lib=gnutermcap)])])])
478if test "X$_bash_needmsg" = "Xyes"; then
479AC_MSG_CHECKING(which library has the termcap functions)
480fi
481AC_MSG_RESULT(using $bash_cv_termcap_lib)
599AC_MSG_RESULT($bash_cv_ulimit_maxfds)
600if test $bash_cv_ulimit_maxfds = yes; then
601AC_DEFINE(ULIMIT_MAXFDS)
602fi
603])
604
605AC_DEFUN(BASH_CHECK_LIB_TERMCAP,
606[

--- 7 unchanged lines hidden (view full) ---

614[AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap,
615 [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses,
616 [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses,
617 bash_cv_termcap_lib=gnutermcap)])])])
618if test "X$_bash_needmsg" = "Xyes"; then
619AC_MSG_CHECKING(which library has the termcap functions)
620fi
621AC_MSG_RESULT(using $bash_cv_termcap_lib)
482if test $bash_cv_termcap_lib = gnutermcap; then
622if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
483LDFLAGS="$LDFLAGS -L./lib/termcap"
484TERMCAP_LIB="./lib/termcap/libtermcap.a"
485TERMCAP_DEP="./lib/termcap/libtermcap.a"
486elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
487TERMCAP_LIB=-ltermcap
488TERMCAP_DEP=
489elif test $bash_cv_termcap_lib = libncurses; then
490TERMCAP_LIB=-lncurses

--- 54 unchanged lines hidden (view full) ---

545main()
546{
547 char lbuf[32];
548 popen_called = 0;
549 getcwd(lbuf, 32);
550 exit (popen_called);
551}
552], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
623LDFLAGS="$LDFLAGS -L./lib/termcap"
624TERMCAP_LIB="./lib/termcap/libtermcap.a"
625TERMCAP_DEP="./lib/termcap/libtermcap.a"
626elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then
627TERMCAP_LIB=-ltermcap
628TERMCAP_DEP=
629elif test $bash_cv_termcap_lib = libncurses; then
630TERMCAP_LIB=-lncurses

--- 54 unchanged lines hidden (view full) ---

685main()
686{
687 char lbuf[32];
688 popen_called = 0;
689 getcwd(lbuf, 32);
690 exit (popen_called);
691}
692], bash_cv_getcwd_calls_popen=no, bash_cv_getcwd_calls_popen=yes,
553AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling))])
693 [AC_MSG_ERROR(cannot check whether getcwd calls popen if cross compiling -- defaulting to no)
694 bash_cv_getcwd_calls_popen=no]
695)])
554AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
555if test $bash_cv_getcwd_calls_popen = yes; then
556AC_DEFINE(GETCWD_BROKEN)
557fi
558])
559
560AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
561[AC_REQUIRE([AC_HEADER_DIRENT])

--- 105 unchanged lines hidden (view full) ---

667{
668 nsigint = 0;
669 set_signal_handler(SIGINT, sigint);
670 kill((int)getpid(), SIGINT);
671 kill((int)getpid(), SIGINT);
672 exit(nsigint != 2);
673}
674], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
696AC_MSG_RESULT($bash_cv_getcwd_calls_popen)
697if test $bash_cv_getcwd_calls_popen = yes; then
698AC_DEFINE(GETCWD_BROKEN)
699fi
700])
701
702AC_DEFUN(BASH_STRUCT_DIRENT_D_INO,
703[AC_REQUIRE([AC_HEADER_DIRENT])

--- 105 unchanged lines hidden (view full) ---

809{
810 nsigint = 0;
811 set_signal_handler(SIGINT, sigint);
812 kill((int)getpid(), SIGINT);
813 kill((int)getpid(), SIGINT);
814 exit(nsigint != 2);
815}
816], bash_cv_must_reinstall_sighandlers=no, bash_cv_must_reinstall_sighandlers=yes,
675AC_MSG_ERROR(cannot check signal handling if cross compiling))])
817 [AC_MSG_ERROR(cannot check signal handling if cross compiling -- defaulting to no)
818 bash_cv_must_reinstall_sighandlers=no]
819)])
676AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
677if test $bash_cv_must_reinstall_sighandlers = yes; then
678AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
679fi
680])
681
682AC_DEFUN(BASH_FUNC_SBRK_DECLARED,
683[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)

--- 49 unchanged lines hidden (view full) ---

733#endif
734
735/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
736#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
737exit(1);
738#endif
739
740exit(0);
820AC_MSG_RESULT($bash_cv_must_reinstall_sighandlers)
821if test $bash_cv_must_reinstall_sighandlers = yes; then
822AC_DEFINE(MUST_REINSTALL_SIGHANDLERS)
823fi
824])
825
826AC_DEFUN(BASH_FUNC_SBRK_DECLARED,
827[AC_MSG_CHECKING(for declaration of sbrk in <unistd.h>)

--- 49 unchanged lines hidden (view full) ---

877#endif
878
879/* Other systems have TIOCSPGRP/TIOCGPRGP and wait3. */
880#if !defined (_POSIX_VERSION) && !defined (HAVE_WAIT3)
881exit(1);
882#endif
883
884exit(0);
741}],bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
742 AC_MSG_ERROR(cannot check job control if cross-compiling))
743])
885}], bash_cv_job_control_missing=present, bash_cv_job_control_missing=missing,
886 [AC_MSG_ERROR(cannot check job control if cross-compiling -- defaulting to missing)
887 bash_cv_job_control_missing=missing]
888)])
744AC_MSG_RESULT($bash_cv_job_control_missing)
745if test $bash_cv_job_control_missing = missing; then
746AC_DEFINE(JOB_CONTROL_MISSING)
747fi
748])
749
750dnl check whether named pipes are present
751dnl this requires a previous check for mkfifo, but that is awkward to specify

--- 25 unchanged lines hidden (view full) ---

777#endif
778
779fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
780if (fd == -1)
781 exit (1);
782close(fd);
783unlink ("/tmp/sh-np-autoconf");
784exit(0);
889AC_MSG_RESULT($bash_cv_job_control_missing)
890if test $bash_cv_job_control_missing = missing; then
891AC_DEFINE(JOB_CONTROL_MISSING)
892fi
893])
894
895dnl check whether named pipes are present
896dnl this requires a previous check for mkfifo, but that is awkward to specify

--- 25 unchanged lines hidden (view full) ---

922#endif
923
924fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
925if (fd == -1)
926 exit (1);
927close(fd);
928unlink ("/tmp/sh-np-autoconf");
929exit(0);
785}],bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
786 AC_MSG_ERROR(cannot check for named pipes if cross-compiling))
787])
930}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
931 [AC_MSG_ERROR(cannot check for named pipes if cross-compiling -- defaulting to missing)
932 bash_cv_sys_named_pipes=missing]
933)])
788AC_MSG_RESULT($bash_cv_sys_named_pipes)
789if test $bash_cv_sys_named_pipes = missing; then
790AC_DEFINE(NAMED_PIPES_MISSING)
791fi
792])
793
794AC_DEFUN(BASH_FUNC_POSIX_SETJMP,
795[AC_REQUIRE([BASH_SIGNAL_CHECK])

--- 31 unchanged lines hidden (view full) ---

827/* change it */
828sigaddset(&set, SIGINT);
829sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
830
831/* and siglongjmp */
832siglongjmp(xx, 10);
833exit(1);
834#endif
934AC_MSG_RESULT($bash_cv_sys_named_pipes)
935if test $bash_cv_sys_named_pipes = missing; then
936AC_DEFINE(NAMED_PIPES_MISSING)
937fi
938])
939
940AC_DEFUN(BASH_FUNC_POSIX_SETJMP,
941[AC_REQUIRE([BASH_SIGNAL_CHECK])

--- 31 unchanged lines hidden (view full) ---

973/* change it */
974sigaddset(&set, SIGINT);
975sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL);
976
977/* and siglongjmp */
978siglongjmp(xx, 10);
979exit(1);
980#endif
835}],bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
836 AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling))
837])
981}], bash_cv_func_sigsetjmp=present, bash_cv_func_sigsetjmp=missing,
982 [AC_MSG_ERROR(cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to missing)
983 bash_cv_func_sigsetjmp=missing]
984)])
838AC_MSG_RESULT($bash_cv_func_sigsetjmp)
839if test $bash_cv_func_sigsetjmp = present; then
840AC_DEFINE(HAVE_POSIX_SIGSETJMP)
841fi
842])
843
844AC_DEFUN(BASH_HAVE_TIOCGWINSZ,
845[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
846AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
847[AC_TRY_COMPILE([#include <sys/types.h>
848#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
849 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
850AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
851if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
852AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
853fi
854])
855
856AC_DEFUN(BASH_STRUCT_WINSIZE,
985AC_MSG_RESULT($bash_cv_func_sigsetjmp)
986if test $bash_cv_func_sigsetjmp = present; then
987AC_DEFINE(HAVE_POSIX_SIGSETJMP)
988fi
989])
990
991AC_DEFUN(BASH_HAVE_TIOCGWINSZ,
992[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
993AC_CACHE_VAL(bash_cv_tiocgwinsz_in_ioctl,
994[AC_TRY_COMPILE([#include <sys/types.h>
995#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
996 bash_cv_tiocgwinsz_in_ioctl=yes,bash_cv_tiocgwinsz_in_ioctl=no)])
997AC_MSG_RESULT($bash_cv_tiocgwinsz_in_ioctl)
998if test $bash_cv_tiocgwinsz_in_ioctl = yes; then
999AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
1000fi
1001])
1002
1003AC_DEFUN(BASH_STRUCT_WINSIZE,
857[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h)
858AC_CACHE_VAL(bash_cv_struct_winsize_in_ioctl,
1004[AC_MSG_CHECKING(for struct winsize in sys/ioctl.h and termios.h)
1005AC_CACHE_VAL(bash_cv_struct_winsize_header,
859[AC_TRY_COMPILE([#include <sys/types.h>
860#include <sys/ioctl.h>], [struct winsize x;],
1006[AC_TRY_COMPILE([#include <sys/types.h>
1007#include <sys/ioctl.h>], [struct winsize x;],
861 bash_cv_struct_winsize_in_ioctl=yes,bash_cv_struct_winsize_in_ioctl=no)])
862AC_MSG_RESULT($bash_cv_struct_winsize_in_ioctl)
863if test $bash_cv_struct_winsize_in_ioctl = yes; then
864AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1008 bash_cv_struct_winsize_header=ioctl_h,
1009 [AC_TRY_COMPILE([#include <sys/types.h>
1010#include <termios.h>], [struct winsize x;],
1011 bash_cv_struct_winsize_header=termios_h, bash_cv_struct_winsize_header=other)
1012])])
1013if test $bash_cv_struct_winsize_header = ioctl_h; then
1014 AC_MSG_RESULT(sys/ioctl.h)
1015 AC_DEFINE(STRUCT_WINSIZE_IN_SYS_IOCTL)
1016elif test $bash_cv_struct_winsize_header = termios_h; then
1017 AC_MSG_RESULT(termios.h)
1018 AC_DEFINE(STRUCT_WINSIZE_IN_TERMIOS)
1019else
1020 AC_MSG_RESULT(not found)
865fi
866])
867
868AC_DEFUN(BASH_HAVE_TIOCSTAT,
869[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
870AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
871[AC_TRY_COMPILE([#include <sys/types.h>
872#include <sys/ioctl.h>], [int x = TIOCSTAT;],

--- 33 unchanged lines hidden (view full) ---

906fi
907])
908
909AC_DEFUN(BASH_CHECK_GETPW_FUNCS,
910[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
911AC_CACHE_VAL(bash_cv_can_redecl_getpw,
912[AC_TRY_COMPILE([#include <sys/types.h>
913#include <pwd.h>
1021fi
1022])
1023
1024AC_DEFUN(BASH_HAVE_TIOCSTAT,
1025[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
1026AC_CACHE_VAL(bash_cv_tiocstat_in_ioctl,
1027[AC_TRY_COMPILE([#include <sys/types.h>
1028#include <sys/ioctl.h>], [int x = TIOCSTAT;],

--- 33 unchanged lines hidden (view full) ---

1062fi
1063])
1064
1065AC_DEFUN(BASH_CHECK_GETPW_FUNCS,
1066[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
1067AC_CACHE_VAL(bash_cv_can_redecl_getpw,
1068[AC_TRY_COMPILE([#include <sys/types.h>
1069#include <pwd.h>
914extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();],
1070extern struct passwd *getpwent();
1071extern struct passwd *getpwuid();
1072extern struct passwd *getpwnam();],
1073[struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
915 bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
916AC_MSG_RESULT($bash_cv_can_redecl_getpw)
917if test $bash_cv_can_redecl_getpw = no; then
918AC_DEFINE(HAVE_GETPW_DECLS)
919fi
920])
921
922AC_DEFUN(BASH_CHECK_DEV_FD,

--- 66 unchanged lines hidden (view full) ---

989
990AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
991[AC_MSG_CHECKING(for default mail directory)
992AC_CACHE_VAL(bash_cv_mail_dir,
993[if test -d /var/mail; then
994 bash_cv_mail_dir=/var/mail
995 elif test -d /usr/mail; then
996 bash_cv_mail_dir=/usr/mail
1074 bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
1075AC_MSG_RESULT($bash_cv_can_redecl_getpw)
1076if test $bash_cv_can_redecl_getpw = no; then
1077AC_DEFINE(HAVE_GETPW_DECLS)
1078fi
1079])
1080
1081AC_DEFUN(BASH_CHECK_DEV_FD,

--- 66 unchanged lines hidden (view full) ---

1148
1149AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
1150[AC_MSG_CHECKING(for default mail directory)
1151AC_CACHE_VAL(bash_cv_mail_dir,
1152[if test -d /var/mail; then
1153 bash_cv_mail_dir=/var/mail
1154 elif test -d /usr/mail; then
1155 bash_cv_mail_dir=/usr/mail
997 elif test -d /usr/spool/mail; then
998 bash_cv_mail_dir=/usr/spool/mail
999 elif test -d /var/spool/mail; then
1000 bash_cv_mail_dir=/var/spool/mail
1156 elif test -d /var/spool/mail; then
1157 bash_cv_mail_dir=/var/spool/mail
1158 elif test -d /usr/spool/mail; then
1159 bash_cv_mail_dir=/usr/spool/mail
1001 else
1002 bash_cv_mail_dir=unknown
1003 fi
1004])
1005AC_MSG_RESULT($bash_cv_mail_dir)
1006if test $bash_cv_mail_dir = "/var/mail"; then
1007 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/mail")
1008elif test $bash_cv_mail_dir = "/usr/mail"; then

--- 16 unchanged lines hidden (view full) ---

1025[AC_TRY_COMPILE([
1026#include <sys/types.h>
1027#include <sys/resource.h>
1028],
1029[
1030 int f;
1031 f = RLIMIT_DATA;
1032], bash_cv_kernel_rlimit=no,
1160 else
1161 bash_cv_mail_dir=unknown
1162 fi
1163])
1164AC_MSG_RESULT($bash_cv_mail_dir)
1165if test $bash_cv_mail_dir = "/var/mail"; then
1166 AC_DEFINE(DEFAULT_MAIL_DIRECTORY, "/var/mail")
1167elif test $bash_cv_mail_dir = "/usr/mail"; then

--- 16 unchanged lines hidden (view full) ---

1184[AC_TRY_COMPILE([
1185#include <sys/types.h>
1186#include <sys/resource.h>
1187],
1188[
1189 int f;
1190 f = RLIMIT_DATA;
1191], bash_cv_kernel_rlimit=no,
1033 [AC_TRY_COMPILE([
1034 #include <sys/types.h>
1035 #define _KERNEL
1036 #include <sys/resource.h>
1037 #undef _KERNEL
1038 ],
1039 [
1192[AC_TRY_COMPILE([
1193#include
1194#define _KERNEL
1195#include
1196#undef _KERNEL
1197],
1198[
1040 int f;
1041 f = RLIMIT_DATA;
1199 int f;
1200 f = RLIMIT_DATA;
1042 ], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1201], bash_cv_kernel_rlimit=yes, bash_cv_kernel_rlimit=no)]
1043)])
1044AC_MSG_RESULT($bash_cv_kernel_rlimit)
1045if test $bash_cv_kernel_rlimit = yes; then
1046AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1047fi
1048])
1049
1050AC_DEFUN(BASH_FUNC_STRCOLL,

--- 31 unchanged lines hidden (view full) ---

1082 same. */
1083
1084 /* Exit with 1 (failure) if these two values are both > 0, since
1085 this tests whether strcoll(3) is broken with respect to strcmp(3)
1086 in the default locale. */
1087 exit (r1 > 0 && r2 > 0);
1088}
1089], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
1202)])
1203AC_MSG_RESULT($bash_cv_kernel_rlimit)
1204if test $bash_cv_kernel_rlimit = yes; then
1205AC_DEFINE(RLIMIT_NEEDS_KERNEL)
1206fi
1207])
1208
1209AC_DEFUN(BASH_FUNC_STRCOLL,

--- 31 unchanged lines hidden (view full) ---

1241 same. */
1242
1243 /* Exit with 1 (failure) if these two values are both > 0, since
1244 this tests whether strcoll(3) is broken with respect to strcmp(3)
1245 in the default locale. */
1246 exit (r1 > 0 && r2 > 0);
1247}
1248], bash_cv_func_strcoll_broken=yes, bash_cv_func_strcoll_broken=no,
1090 AC_MSG_ERROR(cannot check strcoll if cross compiling))
1091])
1249 [AC_MSG_ERROR(cannot check strcoll if cross compiling -- defaulting to no)
1250 bash_cv_func_strcoll_broken=no]
1251)])
1092AC_MSG_RESULT($bash_cv_func_strcoll_broken)
1093if test $bash_cv_func_strcoll_broken = yes; then
1094AC_DEFINE(STRCOLL_BROKEN)
1095fi
1096])
1252AC_MSG_RESULT($bash_cv_func_strcoll_broken)
1253if test $bash_cv_func_strcoll_broken = yes; then
1254AC_DEFINE(STRCOLL_BROKEN)
1255fi
1256])
1257
1258dnl
1259dnl If available, use support for large files unless the user specified
1260dnl one of the CPPFLAGS, LDFLAGS, or LIBS variables (<eggert@twinsun.com>
1261dnl via GNU patch 2.5)
1262dnl
1263AC_DEFUN(BASH_LARGE_FILE_SUPPORT,
1264[AC_MSG_CHECKING(whether large file support needs explicit enabling)
1265ac_getconfs=''
1266ac_result=yes
1267ac_set=''
1268ac_shellvars='CPPFLAGS LDFLAGS LIBS'
1269for ac_shellvar in $ac_shellvars; do
1270 case $ac_shellvar in
1271 CPPFLAGS) ac_lfsvar=LFS_CFLAGS ac_lfs64var=LFS64_CFLAGS ;;
1272 *) ac_lfsvar=LFS_$ac_shellvar ac_lfs64var=LFS64_$ac_shellvar ;;
1273 esac
1274 eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
1275 (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
1276 ac_getconf=`getconf $ac_lfsvar`
1277 ac_getconf64=`getconf $ac_lfs64var`
1278 ac_getconfs=$ac_getconfs$ac_getconf\ $ac_getconf64
1279 eval ac_test_$ac_shellvar="\$ac_getconf\ \$ac_getconf64"
1280done
1281case "$ac_result$ac_getconfs" in
1282yes) ac_result=no ;;
1283esac
1284case "$ac_result$ac_set" in
1285yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
1286esac
1287AC_MSG_RESULT($ac_result)
1288case $ac_result in
1289yes)
1290 for ac_shellvar in $ac_shellvars; do
1291 eval $ac_shellvar=\$ac_test_$ac_shellvar
1292 done ;;
1293esac
1294])
1295
1296dnl
1297dnl AC_SYS_RESTARTABLE_SYSCALLS tests only for restarted system calls
1298dnl after a signal handler has been installed with signal(). Since
1299dnl Bash uses sigaction() if it is available, we need to check whether
1300dnl or not a signal handler installed with sigaction and SA_RESTART
1301dnl causes system calls to be restarted after the signal is caught
1302dnl
1303AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS,
1304[AC_REQUIRE([BASH_SIGNAL_CHECK])
1305AC_CACHE_CHECK(for restartable system calls with posix sigaction,
1306bash_cv_sys_restartable_syscalls,
1307[AC_TRY_RUN(
1308[/* Exit 0 (true) if wait returns something other than -1,
1309 i.e. the pid of the child, which means that wait was restarted
1310 after getting the signal. */
1311#include <sys/types.h>
1312#include <signal.h>
1313static int caught = 0;
1314void ucatch (isig) int isig; { caught = 1; }
1315main ()
1316{
1317#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
1318 exit (1);
1319#else
1320 struct sigaction act, oact;
1321 int i, status;
1322
1323 act.sa_handler = ucatch;
1324 /* Might want to add SA_RESTART here, but bash's set_signal_handler
1325 does not. */
1326 act.sa_flags = 0;
1327 sigemptyset(&act.sa_mask);
1328 sigemptyset(&oact.sa_mask);
1329 i = fork ();
1330 /* A possible race condition here, but in practice it never happens. */
1331 if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
1332 sigaction(SIGINT, &act, &oact);
1333 status = wait(&i);
1334 if (status == -1) wait(&i);
1335 exit (status == -1);
1336#endif
1337}
1338], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
1339 AC_MSG_ERROR(cannot check restartable syscalls if cross compiling))
1340])
1341if test $bash_cv_sys_restartable_syscalls = yes; then
1342 AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
1343fi
1344])