2 dnl Configure script for bash-2.05
4 dnl report bugs to chet@po.cwru.edu
6 dnl Process this file with autoconf to produce a configure script.
8 # Copyright (C) 1987-2001 Free Software Foundation, Inc.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2, or (at your option)
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 AC_REVISION([for Bash 2.05a, version 2.128, from autoconf version] AC_ACVERSION)dnl
27 AC_INIT(bash, 2.05a, bug-bash@gnu.org)
29 dnl make sure we are using a recent autoconf version
32 AC_CONFIG_SRCDIR(shell.h)
33 dnl where to find install.sh, config.sub, and config.guess
34 AC_CONFIG_AUX_DIR(./support)
35 AC_CONFIG_HEADERS(config.h)
37 dnl checks for version info
40 dnl canonicalize the host and os so we can do some tricky things before
44 dnl configure defaults
50 opt_with_installed_readline=no
54 dnl some systems should be configured without the bash malloc by default
55 dnl and some need a special compiler or loader
56 dnl look in the NOTES file for more
57 case "${host_cpu}-${host_os}" in
58 alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux
59 *[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays
60 *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines
61 sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2
62 sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
63 mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
64 m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
65 sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
66 #*-freebsd*) opt_bash_malloc=no ;; # they claim it's better
67 *-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
68 *-aix*) opt_bash_malloc=no ;; # AIX machines
69 *-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
70 *-macos*) opt_bash_malloc=no ;; # Apple MacOS X
71 *-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X)
72 *-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X)
73 *-dgux*) opt_bash_malloc=no ;; # DG/UX machines
74 *-qnx*) opt_bash_malloc=no ;; # QNX 4.2
75 *-machten4) opt_bash_malloc=no ;; # MachTen 4.x
76 *-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
77 *-beos*) opt_bash_malloc=no ;; # they say it's suitable
78 *-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
79 *-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
82 dnl arguments to configure
84 AC_ARG_WITH(afs, --with-afs if you are running AFS, opt_afs=$withval)
85 AC_ARG_WITH(bash-malloc, --with-bash-malloc use the Bash version of malloc,opt_bash_malloc=$withval)
86 AC_ARG_WITH(curses, --with-curses use the curses library instead of the termcap library,opt_curses=$withval)
87 AC_ARG_WITH(gnu-malloc, --with-gnu-malloc synonym for --with-bash-malloc,opt_bash_malloc=$withval)
88 AC_ARG_WITH(installed-readline, --with-installed-readline use a version of the readline library that is already installed, opt_with_installed_readline=$withval)
89 AC_ARG_WITH(purecov, --with-purecov configure to postprocess with pure coverage, opt_purecov=$withval)
90 AC_ARG_WITH(purify, --with-purify configure to postprocess with purify, opt_purify=$withval)
92 if test "$opt_bash_malloc" = yes; then
97 MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a'
98 MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)'
99 MALLOC_DEP='$(MALLOC_LIBRARY)'
101 AC_DEFINE(USING_BASH_MALLOC)
109 if test "$opt_purify" = yes; then
115 if test "$opt_purecov" = yes; then
116 PURIFY="${PURIFY}purecov"
119 if test "$opt_afs" = yes; then
123 if test "$opt_curses" = yes; then
127 dnl optional shell features in config.h.in
128 opt_minimal_config=no
137 opt_process_subst=yes
138 opt_prompt_decoding=yes
141 opt_array_variables=yes
143 opt_extended_glob=yes
144 opt_brace_expansion=yes
145 opt_disabled_builtins=no
146 opt_command_timing=yes
149 opt_arith_for_command=yes
154 dnl options that affect how bash is compiled and linked
158 dnl argument parsing for optional features
159 AC_ARG_ENABLE(minimal-config, --enable-minimal-config a minimal sh-like configuration, opt_minimal_config=$enableval)
161 dnl a minimal configuration turns everything off, but features can be
162 dnl added individually
163 if test $opt_minimal_config = yes; then
164 opt_job_control=no opt_alias=no opt_readline=no
165 opt_history=no opt_bang_history=no opt_dirstack=no
166 opt_restricted=no opt_process_subst=no opt_prompt_decoding=no
167 opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no
168 opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
169 opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
170 opt_net_redirs=no opt_progcomp=no
173 AC_ARG_ENABLE(alias, --enable-alias enable shell aliases, opt_alias=$enableval)
174 AC_ARG_ENABLE(arith-for-command, --enable-arith-for-command enable arithmetic for command, opt_arith_for_command=$enableval)
175 AC_ARG_ENABLE(array-variables, --enable-array-variables include shell array variables, opt_array_variables=$enableval)
176 AC_ARG_ENABLE(bang-history, --enable-bang-history turn on csh-style history substitution, opt_bang_history=$enableval)
177 AC_ARG_ENABLE(brace-expansion, --enable-brace-expansion include brace expansion, opt_brace_expansion=$enableval)
178 AC_ARG_ENABLE(command-timing, --enable-command-timing enable the time reserved word and command timing, opt_command_timing=$enableval)
179 AC_ARG_ENABLE(cond-command, --enable-cond-command enable the conditional command, opt_cond_command=$enableval)
180 AC_ARG_ENABLE(directory-stack, --enable-directory-stack enable builtins pushd/popd/dirs, opt_dirstack=$enableval)
181 AC_ARG_ENABLE(disabled-builtins, --enable-disabled-builtins allow disabled builtins to still be invoked, opt_disabled_builtins=$enableval)
182 AC_ARG_ENABLE(dparen-arithmetic, [--enable-dparen-arithmetic include ((...)) command], opt_dparen_arith=$enableval)
183 AC_ARG_ENABLE(extended-glob, --enable-extended-glob include ksh-style extended pattern matching, opt_extended_glob=$enableval)
184 AC_ARG_ENABLE(help-builtin, --enable-help-builtin include the help builtin, opt_help=$enableval)
185 AC_ARG_ENABLE(history, --enable-history turn on command history, opt_history=$enableval)
186 AC_ARG_ENABLE(job-control, --enable-job-control enable job control features, opt_job_control=$enableval)
187 AC_ARG_ENABLE(largefile, --enable-largefile enable support for large files, opt_largefile=$enableval)
188 AC_ARG_ENABLE(net-redirections, --enable-net-redirections enable /dev/tcp/host/port redirection, opt_net_redirs=$enableval)
189 AC_ARG_ENABLE(process-substitution, --enable-process-substitution enable process substitution, opt_process_subst=$enableval)
190 AC_ARG_ENABLE(progcomp, --enable-progcomp enable programmable completion and the complete builtin, opt_progcomp=$enableval)
191 AC_ARG_ENABLE(prompt-string-decoding, --enable-prompt-string-decoding turn on escape character decoding in prompts, opt_prompt_decoding=$enableval)
192 AC_ARG_ENABLE(readline, --enable-readline turn on command line editing, opt_readline=$enableval)
193 AC_ARG_ENABLE(restricted, --enable-restricted enable a restricted shell, opt_restricted=$enableval)
194 AC_ARG_ENABLE(select, --enable-select include select command, opt_select=$enableval)
195 AC_ARG_ENABLE(usg-echo-default, --enable-usg-echo-default a synonym for --enable-xpg-echo-default, opt_xpg_echo=$enableval)
196 AC_ARG_ENABLE(xpg-echo-default, --enable-xpg-echo-default make the echo builtin expand escape sequences by default, opt_xpg_echo=$enableval)
198 dnl options that alter how bash is compiled and linked
199 AC_ARG_ENABLE(profiling, --enable-profiling allow profiling with gprof, opt_profiling=$enableval)
200 AC_ARG_ENABLE(static-link, --enable-static-link [link bash statically, for use as a root shell], opt_static_link=$enableval)
202 dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs
204 dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs
205 dnl to be run before we can check the version of an already-installed readline
208 if test $opt_alias = yes; then
211 if test $opt_dirstack = yes; then
212 AC_DEFINE(PUSHD_AND_POPD)
214 if test $opt_restricted = yes; then
215 AC_DEFINE(RESTRICTED_SHELL)
217 if test $opt_process_subst = yes; then
218 AC_DEFINE(PROCESS_SUBSTITUTION)
220 if test $opt_prompt_decoding = yes; then
221 AC_DEFINE(PROMPT_STRING_DECODE)
223 if test $opt_select = yes; then
224 AC_DEFINE(SELECT_COMMAND)
226 if test $opt_help = yes; then
227 AC_DEFINE(HELP_BUILTIN)
229 if test $opt_array_variables = yes; then
230 AC_DEFINE(ARRAY_VARS)
232 if test $opt_dparen_arith = yes; then
233 AC_DEFINE(DPAREN_ARITHMETIC)
235 if test $opt_brace_expansion = yes; then
236 AC_DEFINE(BRACE_EXPANSION)
238 if test $opt_disabled_builtins = yes; then
239 AC_DEFINE(DISABLED_BUILTINS)
241 if test $opt_command_timing = yes; then
242 AC_DEFINE(COMMAND_TIMING)
244 if test $opt_xpg_echo = yes ; then
245 AC_DEFINE(DEFAULT_ECHO_TO_XPG)
247 if test $opt_extended_glob = yes ; then
248 AC_DEFINE(EXTENDED_GLOB)
250 if test $opt_cond_command = yes ; then
251 AC_DEFINE(COND_COMMAND)
253 if test $opt_arith_for_command = yes; then
254 AC_DEFINE(ARITH_FOR_COMMAND)
256 if test $opt_net_redirs = yes; then
257 AC_DEFINE(NETWORK_REDIRECTIONS)
259 if test $opt_progcomp = yes; then
260 AC_DEFINE(PROGRAMMABLE_COMPLETION)
263 if test "$opt_minimal_config" = yes; then
264 TESTSCRIPT=run-minimal
269 dnl now substitute in the values generated by arguments
272 AC_SUBST(MALLOC_TARGET)
276 AC_SUBST(MALLOC_LIBRARY)
277 AC_SUBST(MALLOC_LDFLAGS)
283 echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}"
286 dnl compilation checks
287 dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a
288 dnl different environment
291 dnl test for Unix variants
295 dnl test for non-Unix variants
301 dnl BEGIN changes for cross-building for cygwin and BeOS
303 SIGNAMES_H=lsignames.h
305 dnl load up the cross-building cache file -- add more cases and cache
306 dnl files as necessary
308 dnl Note that host and target machine are the same, and different than the
310 dnl Set SIGNAMES_H based on whether or not we're cross-compiling.
312 if test "x$cross_compiling" = "xyes"; then
315 cross_cache=${srcdir}/cross-build/cygwin32.cache
316 SIGNAMES_H='$(srcdir)/cross-build/win32sig.h'
319 cross_cache=${srcdir}/cross-build/x86-beos.cache
320 SIGNAMES_H='${srcdir}/cross-build/beos-sig.h'
322 *) echo "configure: cross-compiling for $host is not supported" >&2
325 if test -n "${cross_cache}" && test -r "${cross_cache}"; then
326 echo "loading cross-build cache file ${cross_cache}"
333 if test -z "$CC_FOR_BUILD"; then
334 if test "x$cross_compiling" = "xno"; then
340 AC_SUBST(CC_FOR_BUILD)
342 dnl END changes for cross-building
344 dnl We want these before the checks, so the checks can modify their values.
345 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
347 dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
348 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
350 dnl handle options that alter how bash is compiled and linked
351 dnl these must come after the test for cc/gcc
352 if test "$opt_profiling" = "yes"; then
356 *) opt_static_link=yes ;;
360 if test "$opt_static_link" = yes; then
361 # if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2
362 if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then
366 *) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental
376 AC_PROG_GCC_TRADITIONAL
378 dnl BEGIN READLINE and HISTORY LIBRARY SECTION
379 dnl prepare to allow bash to be linked against an already-installed readline
381 dnl first test that the readline version is new enough to link bash against
382 if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no"
384 echo opt_with_installed_readline = $opt_with_installed_readline
385 # If the user specified --with-installed-readline=PREFIX and PREFIX
386 # is not `yes', set ac_cv_rl_prefix to PREFIX
387 test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline
389 RL_LIB_READLINE_VERSION
391 case "$ac_cv_rl_version" in
392 4.[[2-9]]*|5*|6*|7*|8*|9*) ;;
393 *) opt_with_installed_readline=no
394 AC_MSG_WARN(installed readline library is too old to be linked with bash)
395 AC_MSG_WARN(using private bash version)
400 if test $opt_readline = yes; then
402 READLINE_LIB=-lreadline
403 if test "$opt_with_installed_readline" != "no" ; then
404 case "$RL_INCLUDEDIR" in
406 *) RL_INCLUDE='-I${RL_INCLUDEDIR}'
410 RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
411 READLINE_DEP='$(READLINE_LIBRARY)'
414 RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
415 READLINE_LIB= READLINE_DEP=
417 if test $opt_history = yes || test $opt_bang_history = yes; then
418 if test $opt_history = yes; then
421 if test $opt_bang_history = yes; then
422 AC_DEFINE(BANG_HISTORY)
424 HISTORY_LIB=-lhistory
425 if test "$opt_with_installed_readline" != "no"; then
426 HIST_LIBDIR=$RL_LIBDIR
428 case "$RL_INCLUDEDIR" in
430 *) RL_INCLUDE='-I${RL_INCLUDEDIR}'
433 HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
434 HISTORY_DEP='$(HISTORY_LIBRARY)'
437 HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
438 HISTORY_LIB= HISTORY_DEP=
440 AC_SUBST(READLINE_LIB)
441 AC_SUBST(READLINE_DEP)
443 AC_SUBST(RL_INCLUDEDIR)
445 AC_SUBST(HISTORY_LIB)
446 AC_SUBST(HISTORY_DEP)
447 AC_SUBST(HIST_LIBDIR)
449 dnl END READLINE and HISTORY LIBRARY SECTION
451 dnl programs needed by the build and install process
453 AC_CHECK_PROG(AR, ar, , ar)
454 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
455 dnl This allows people to set it when running configure or make
456 test -n "$ARFLAGS" || ARFLAGS="cr"
462 opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
463 *) MAKE_SHELL=/bin/sh ;;
467 dnl Turn on any extensions available in the GNU C library.
468 AC_DEFINE(_GNU_SOURCE, 1)
470 dnl C compiler characteristics
485 AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
486 memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
487 stddef.h stdint.h netdb.h grp.h strings.h)
488 AC_CHECK_HEADERS(sys/ptem.h sys/pte.h sys/stream.h sys/select.h sys/file.h \
489 sys/resource.h sys/param.h sys/socket.h \
490 sys/time.h sys/times.h sys/wait.h)
491 AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
493 dnl special checks for libc functions
496 AC_FUNC_SETVBUF_REVERSED
500 dnl if we're not using the bash malloc but require the C alloca, set things
501 dnl up to build a libmalloc.a containing only alloca.o
503 if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then
507 MALLOC_LIB='-lmalloc'
508 MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a'
509 MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)'
510 MALLOC_DEP='$(MALLOC_LIBRARY)'
513 dnl if vprintf is not in libc, see if it's defined in stdio.h
514 if test "$ac_cv_func_vprintf" = no; then
515 AC_MSG_CHECKING(for declaration of vprintf in stdio.h)
516 AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes)
517 AC_MSG_RESULT($ac_cv_func_vprintf)
518 if test $ac_cv_func_vprintf = yes; then
519 AC_DEFINE(HAVE_VPRINTF)
523 if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then
530 dnl checks for certain version-specific system calls and libc functions
531 AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE))
532 AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3))
534 dnl checks for missing libc functions
535 AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING))
537 dnl checks for system calls
538 AC_CHECK_FUNCS(dup2 select getdtablesize getgroups gethostname \
539 setdtablesize getpagesize killpg lstat getpeername sbrk \
540 getrlimit getrusage gettimeofday waitpid tcgetpgrp \
542 AC_REPLACE_FUNCS(rename)
544 dnl checks for c library functions
545 AC_CHECK_FUNCS(bcopy bzero confstr sysconf pathconf setenv putenv \
546 setlinebuf setvbuf setlocale strchr tcgetattr uname \
547 ulimit tzset siginterrupt memmove ttyname times \
548 getaddrinfo gethostbyname getservbyname inet_aton \
549 vsnprintf snprintf vasprintf asprintf fnmatch)
550 AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
551 AC_REPLACE_FUNCS(getcwd strcasecmp strerror strpbrk strtod)
552 AC_REPLACE_FUNCS(strtol strtoul strtoll strtoull strtoimax strtoumax)
554 AC_CHECK_DECLS([strtold])
555 AC_CHECK_DECLS([confstr])
556 AC_CHECK_DECLS([sbrk])
557 AC_CHECK_DECLS([printf])
558 AC_CHECK_DECLS([strsignal])
560 BASH_CHECK_DECL(strtoimax)
561 BASH_CHECK_DECL(strtol)
562 BASH_CHECK_DECL(strtoll)
563 BASH_CHECK_DECL(strtoul)
564 BASH_CHECK_DECL(strtoull)
565 BASH_CHECK_DECL(strtoumax)
567 dnl checks for locale functions
568 AC_CHECK_HEADERS(libintl.h)
569 AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
571 dnl check for GNU libintl if gettext/textdomain/bindtextdomain
572 dnl are not found in libc
573 if test "$ac_cv_func_bindtextdomain" = "no"; then
574 AC_CHECK_LIB(intl,bindtextdomain)
575 if test "$ac_cv_lib_intl" = "yes"; then
576 AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
580 dnl checks for the dynamic loading library functions in libc and libdl
581 if test "$opt_static_link" != yes; then
582 AC_CHECK_LIB(dl, dlopen)
583 AC_CHECK_FUNCS(dlopen dlclose dlsym)
586 dnl this defines SYS_SIGLIST_DECLARED
589 dnl network functions -- check for inet_aton again
590 if test "$ac_cv_func_inet_aton" != 'yes'; then
595 dnl this is reportedly no longer necessary for irix[56].?
597 irix4*) AC_CHECK_LIB(sun, getpwent) ;;
600 dnl check for getpeername in the socket library only if it's not in libc
601 if test "$ac_cv_func_getpeername" = no; then
602 BASH_CHECK_LIB_SOCKET
604 dnl check for gethostbyname in socket libraries if it's not in libc
605 if test "$ac_cv_func_gethostbyname" = no; then
606 BASH_FUNC_GETHOSTBYNAME
616 AC_CHECK_TYPE(ssize_t, int)
617 AC_CHECK_TYPE(time_t, long)
620 BASH_TYPE_UNSIGNED_LONG_LONG
624 AC_CHECK_SIZEOF(char, 1)
625 AC_CHECK_SIZEOF(short, 2)
626 AC_CHECK_SIZEOF(int, 4)
627 AC_CHECK_SIZEOF(long, 4)
628 AC_CHECK_SIZEOF(char *, 4)
629 AC_CHECK_SIZEOF(double, 8)
630 AC_CHECK_SIZEOF([long long], 8)
632 AC_CHECK_TYPE(u_int, [unsigned int])
633 AC_CHECK_TYPE(u_long, [unsigned long])
648 if test $ac_cv_sys_interpreter = yes; then
649 AC_DEFINE(HAVE_HASH_BANG_EXEC)
652 dnl Miscellaneous Bash tests
653 if test "$ac_cv_func_lstat" = "no"; then
657 dnl behavior of system calls and library functions
658 BASH_FUNC_DUP2_CLOEXEC_CHECK
660 BASH_SYS_SIGNAL_VINTAGE
662 dnl checking for the presence of certain library symbols
665 BASH_UNDER_SYS_SIGLIST
667 dnl various system types
669 BASH_CHECK_TYPE(clock_t, [#include <sys/times.h>], long)
670 BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int)
671 BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T)
672 BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long)
673 BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long)
674 if test "$ac_cv_header_sys_socket_h" = "yes"; then
675 BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], int, HAVE_SOCKLEN_T)
679 dnl presence and contents of structures used by system calls
680 BASH_STRUCT_TERMIOS_LDISC
681 BASH_STRUCT_TERMIO_LDISC
682 BASH_STRUCT_DIRENT_D_INO
683 BASH_STRUCT_DIRENT_D_FILENO
686 AC_CHECK_MEMBERS([struct stat.st_blocks])
688 dnl presence and behavior of C library functions
690 BASH_FUNC_OPENDIR_CHECK
691 BASH_FUNC_ULIMIT_MAXFDS
693 if test "$ac_func_getcwd" = "yes"; then
696 BASH_FUNC_POSIX_SETJMP
699 dnl I have removed this check. The existing libc FNM_EXTMATCH implementation
700 dnl (glibc-2.2.4) disagrees with bash on the matching of incorrectly-formed
701 dnl patterns (bash treats them as strings or characters to be matched without
702 dnl any special meaning) and has one outright bug: a[X-]b should match
703 dnl both a-b and aXb.
705 dnl Once Ulrich and I get together on this, the check can return
709 dnl BASH_FUNC_FNMATCH_EXTMATCH
711 BASH_FUNC_PRINTF_A_FORMAT
713 dnl presence and behavior of OS functions
714 BASH_SYS_REINSTALL_SIGHANDLERS
715 BASH_SYS_JOB_CONTROL_MISSING
718 dnl presence of certain CPP defines
725 BASH_CHECK_GETPW_FUNCS
727 BASH_CHECK_SYS_SIGLIST
731 hpux*) BASH_CHECK_KERNEL_RLIMIT ;;
734 if test "$opt_readline" = yes; then
737 aix*) prefer_curses=yes ;;
739 BASH_CHECK_LIB_TERMCAP
741 AC_SUBST(TERMCAP_LIB)
742 AC_SUBST(TERMCAP_DEP)
746 BASH_SYS_DEFAULT_MAIL_DIR
748 if test "$bash_cv_job_control_missing" = missing; then
752 if test "$opt_job_control" = yes; then
753 AC_DEFINE(JOB_CONTROL)
761 dnl Defines that we want to propagate to the Makefiles in subdirectories,
762 dnl like glob and readline
766 dnl use this section to possibly define more cpp variables, specify local
767 dnl libraries, and specify any additional local cc flags
769 dnl this should really go away someday
772 sysv4.2*) AC_DEFINE(SVR4_2)
774 sysv4*) AC_DEFINE(SVR4) ;;
775 sysv5*) AC_DEFINE(SVR5) ;;
776 hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
777 hpux*) LOCAL_CFLAGS=-DHPUX ;;
778 dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
779 isc*) LOCAL_CFLAGS=-Disc386 ;;
780 rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
781 darwin*) LOCAL_CFLAGS=-DMACOSX ;;
782 sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
783 sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
784 sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
785 sunos4*) LOCAL_CFLAGS=-DSunOS4 ;;
786 solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;;
787 lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
788 linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
789 *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;;
790 powerux*) LOCAL_LIBS="-lgen" ;;
791 cygwin*) LOCAL_LIBS="-luser32" ;;
792 opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO" ;;
795 dnl Stanza for OS/compiler pair-specific flags
796 case "${host_os}-${CC}" in
797 aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;;
798 aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;
799 bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux
802 dnl FreeBSD-3.x can have either a.out or ELF
805 if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then
806 LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
808 freebsdelf*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
812 *cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it
815 case "$host_cpu-$host_os" in
816 ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;;
819 case "$host_cpu-$host_vendor-$host_os" in
820 m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;;
821 mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;;
825 # Shared object configuration section. These values are generated by
826 # ${srcdir}/support/shobj-conf
828 if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf
830 AC_MSG_CHECKING(shared object configuration for loadable builtins)
831 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
833 AC_SUBST(SHOBJ_CFLAGS)
835 AC_SUBST(SHOBJ_LDFLAGS)
836 AC_SUBST(SHOBJ_XLDFLAGS)
838 AC_SUBST(SHOBJ_STATUS)
839 AC_MSG_RESULT($SHOBJ_STATUS)
842 # try to create a directory tree if the source is elsewhere
843 # this should be packaged into a script accessible via ${srcdir}/support
846 *) for d in doc tests support lib examples; do # dirs
847 test -d $d || mkdir $d
849 for ld in readline glob tilde malloc sh termcap; do # libdirs
850 test -d lib/$ld || mkdir lib/$ld
852 test -d examples/loadables || mkdir examples/loadables # loadable builtins
853 test -d examples/loadables/perl || mkdir examples/loadables/perl
859 AC_SUBST(PROFILE_FLAGS)
871 AC_SUBST(host_vendor)
875 AC_SUBST(LOCAL_CFLAGS)
876 AC_SUBST(LOCAL_LDFLAGS)
879 #AC_SUBST(ALLOCA_SOURCE)
880 #AC_SUBST(ALLOCA_OBJECT)
882 AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
883 lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \
884 lib/tilde/Makefile doc/Makefile support/Makefile \
885 examples/loadables/Makefile examples/loadables/perl/Makefile],
887 # Makefile uses this timestamp file to record whether config.h is up to date.
888 echo timestamp > stamp-h