2 dnl Configure script for bash-2.04
4 dnl report bugs to chet@po.cwru.edu
6 dnl Process this file with autoconf to produce a configure script.
8 dnl checks for version info
9 AC_REVISION([for Bash 2.04, version 2.77, from autoconf version] AC_ACVERSION)dnl
12 AC_CONFIG_HEADER(config.h)
14 dnl make sure we are using a recent autoconf version
17 dnl where to find install.sh, config.sub, and config.guess
18 AC_CONFIG_AUX_DIR(./support)
20 dnl canonicalize the host and os so we can do some tricky things before
24 dnl configure defaults
31 opt_with_installed_readline=no
35 dnl some systems should be configured without gnu malloc by default
36 dnl and some need a special compiler or loader
37 dnl look in the NOTES file for more
38 case "${host_cpu}-${host_os}" in
39 alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux
40 *[Cc]ray*-*) opt_bash_malloc=no ;; # Crays
41 *-osf1*) opt_bash_malloc=no ;; # other osf/1 machines
42 sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2
43 sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
44 mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
45 m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
46 sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
47 #*-freebsd*) opt_bash_malloc=no ;; # they claim it's better
48 *-aix*) opt_bash_malloc=no ;; # AIX machines
49 *-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
50 *-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody
51 *-dgux*) opt_bash_malloc=no ;; # DG/UX machines
52 *-qnx*) opt_bash_malloc=no ;; # QNX 4.2
53 *-machten4) opt_bash_malloc=no ;; # MachTen 4.x
54 *-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
55 *-beos*) opt_bash_malloc=no ;; # they say it's suitable
56 *-cygwin32*) opt_bash_malloc=no ;; # Cygnus's CYGWIN32 environment
59 dnl arguments to configure
61 AC_ARG_WITH(afs, --with-afs if you are running AFS, opt_afs=$withval)
62 AC_ARG_WITH(bash-malloc, --with-bash-malloc use the Bash version of malloc,opt_bash_malloc=$withval)
63 AC_ARG_WITH(curses, --with-curses use the curses library instead of the termcap library,opt_curses=$withval)
64 AC_ARG_WITH(glibc-malloc, --with-glibc-malloc use the GNU C library version of malloc,opt_glibc_malloc=$withval)
65 AC_ARG_WITH(gnu-malloc, --with-gnu-malloc synonym for --with-bash-malloc,opt_bash_malloc=$withval)
66 AC_ARG_WITH(installed-readline, --with-installed-readline use a version of the readline library that is already installed, opt_with_installed_readline=$withval)
67 AC_ARG_WITH(purecov, --with-purecov configure to postprocess with pure coverage, opt_purecov=$withval)
68 AC_ARG_WITH(purify, --with-purify configure to postprocess with purify, opt_purify=$withval)
70 dnl test for glibc malloc first because it can override the default
71 if test "$opt_glibc_malloc" = yes; then
74 elif test "$opt_bash_malloc" = yes; then
77 AC_DEFINE(USING_BASH_MALLOC)
79 MALLOC_TARGET=stubmalloc
83 if test "$opt_purify" = yes; then
89 if test "$opt_purecov" = yes; then
90 PURIFY="${PURIFY}purecov"
93 if test "$opt_afs" = yes; then
97 if test "$opt_curses" = yes; then
101 dnl optional shell features in config.h.in
102 opt_minimal_config=no
111 opt_process_subst=yes
112 opt_prompt_decoding=yes
115 opt_array_variables=yes
117 opt_extended_glob=yes
118 opt_brace_expansion=yes
119 opt_disabled_builtins=no
120 opt_command_timing=yes
123 opt_arith_for_command=yes
127 dnl options that affect how bash is compiled and linked
131 dnl argument parsing for optional features
132 AC_ARG_ENABLE(minimal-config, --enable-minimal-config a minimal sh-like configuration, opt_minimal_config=$enableval)
134 dnl a minimal configuration turns everything off, but features can be
135 dnl added individually
136 if test $opt_minimal_config = yes; then
137 opt_job_control=no opt_alias=no opt_readline=no
138 opt_history=no opt_bang_history=no opt_dirstack=no
139 opt_restricted=no opt_process_subst=no opt_prompt_decoding=no
140 opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no
141 opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
142 opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
143 opt_net_redirs=no opt_progcomp=no
146 AC_ARG_ENABLE(alias, --enable-alias enable shell aliases, opt_alias=$enableval)
147 AC_ARG_ENABLE(arith-for-command, --enable-arith-for-command enable arithmetic for command, opt_arith_for_command=$enableval)
148 AC_ARG_ENABLE(array-variables, --enable-array-variables include shell array variables, opt_array_variables=$enableval)
149 AC_ARG_ENABLE(bang-history, --enable-bang-history turn on csh-style history substitution, opt_bang_history=$enableval)
150 AC_ARG_ENABLE(brace-expansion, --enable-brace-expansion include brace expansion, opt_brace_expansion=$enableval)
151 AC_ARG_ENABLE(command-timing, --enable-command-timing enable the time reserved word and command timing, opt_command_timing=$enableval)
152 AC_ARG_ENABLE(cond-command, --enable-cond-command enable the conditional command, opt_cond_command=$enableval)
153 AC_ARG_ENABLE(directory-stack, --enable-directory-stack enable builtins pushd/popd/dirs, opt_dirstack=$enableval)
154 AC_ARG_ENABLE(disabled-builtins, --enable-disabled-builtins allow disabled builtins to still be invoked, opt_disabled_builtins=$enableval)
155 AC_ARG_ENABLE(dparen-arithmetic, [--enable-dparen-arithmetic include ((...)) command], opt_dparen_arith=$enableval)
156 AC_ARG_ENABLE(extended-glob, --enable-extended-glob include ksh-style extended pattern matching, opt_extended_glob=$enableval)
157 AC_ARG_ENABLE(help-builtin, --enable-help-builtin include the help builtin, opt_help=$enableval)
158 AC_ARG_ENABLE(history, --enable-history turn on command history, opt_history=$enableval)
159 AC_ARG_ENABLE(job-control, --enable-job-control enable job control features, opt_job_control=$enableval)
160 AC_ARG_ENABLE(net-redirections, --enable-net-redirections enable /dev/tcp/host/port redirection, opt_net_redirs=$enableval)
161 AC_ARG_ENABLE(process-substitution, --enable-process-substitution enable process substitution, opt_process_subst=$enableval)
162 AC_ARG_ENABLE(progcomp, --enable-progcomp enable programmable completion and the complete builtin, opt_progcomp=$enableval)
163 AC_ARG_ENABLE(prompt-string-decoding, --enable-prompt-string-decoding turn on escape character decoding in prompts, opt_prompt_decoding=$enableval)
164 AC_ARG_ENABLE(readline, --enable-readline turn on command line editing, opt_readline=$enableval)
165 AC_ARG_ENABLE(restricted, --enable-restricted enable a restricted shell, opt_restricted=$enableval)
166 AC_ARG_ENABLE(select, --enable-select include select command, opt_select=$enableval)
167 AC_ARG_ENABLE(usg-echo-default, --enable-usg-echo-default a synonym for --enable-xpg-echo-default, opt_xpg_echo=$enableval)
168 AC_ARG_ENABLE(xpg-echo-default, --enable-xpg-echo-default make the echo builtin expand escape sequences by default, opt_xpg_echo=$enableval)
170 dnl options that alter how bash is compiled and linked
171 AC_ARG_ENABLE(profiling, --enable-profiling allow profiling with gprof, opt_profiling=$enableval)
172 AC_ARG_ENABLE(static-link, --enable-static-link [link bash statically, for use as a root shell], opt_static_link=$enableval)
174 dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs
176 dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs
177 dnl to be run before we can check the version of an already-installed readline
180 if test $opt_alias = yes; then
183 if test $opt_dirstack = yes; then
184 AC_DEFINE(PUSHD_AND_POPD)
186 if test $opt_restricted = yes; then
187 AC_DEFINE(RESTRICTED_SHELL)
189 if test $opt_process_subst = yes; then
190 AC_DEFINE(PROCESS_SUBSTITUTION)
192 if test $opt_prompt_decoding = yes; then
193 AC_DEFINE(PROMPT_STRING_DECODE)
195 if test $opt_select = yes; then
196 AC_DEFINE(SELECT_COMMAND)
198 if test $opt_help = yes; then
199 AC_DEFINE(HELP_BUILTIN)
201 if test $opt_array_variables = yes; then
202 AC_DEFINE(ARRAY_VARS)
204 if test $opt_dparen_arith = yes; then
205 AC_DEFINE(DPAREN_ARITHMETIC)
207 if test $opt_brace_expansion = yes; then
208 AC_DEFINE(BRACE_EXPANSION)
210 if test $opt_disabled_builtins = yes; then
211 AC_DEFINE(DISABLED_BUILTINS)
213 if test $opt_command_timing = yes; then
214 AC_DEFINE(COMMAND_TIMING)
216 if test $opt_xpg_echo = yes ; then
217 AC_DEFINE(DEFAULT_ECHO_TO_XPG)
219 if test $opt_extended_glob = yes ; then
220 AC_DEFINE(EXTENDED_GLOB)
222 if test $opt_cond_command = yes ; then
223 AC_DEFINE(COND_COMMAND)
225 if test $opt_arith_for_command = yes; then
226 AC_DEFINE(ARITH_FOR_COMMAND)
228 if test $opt_net_redirs = yes; then
229 AC_DEFINE(NETWORK_REDIRECTIONS)
231 if test $opt_progcomp = yes; then
232 AC_DEFINE(PROGRAMMABLE_COMPLETION)
235 if test "$opt_minimal_config" = yes; then
236 TESTSCRIPT=run-minimal
241 dnl now substitute in the values generated by arguments
244 AC_SUBST(MALLOC_TARGET)
249 dnl Use GNU m4 macros to get the distribution and patchlevel information
250 dnl into configure without requiring the files to be distributed
252 esyscmd(cat _distribution)dnl
254 esyscmd(cat _patchlevel)dnl
256 echo "Beginning configuration for bash-$BASHVERS for ${host_cpu}-${host_vendor}-${host_os}"
258 dnl compilation checks
259 dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a
260 dnl different environment
262 BASH_LARGE_FILE_SUPPORT
264 dnl test for Unix variants
268 dnl test for non-Unix variants
273 dnl BEGIN changes for cross-building for cygwin32 and BeOS
275 SIGNAMES_H=lsignames.h
277 dnl load up the cross-building cache file -- add more cases and cache
278 dnl files as necessary
280 dnl Note that host and target machine are the same, and different than the
282 dnl Set SIGNAMES_H based on whether or not we're cross-compiling.
284 if test "x$cross_compiling" = "xyes"; then
287 cross_cache=${srcdir}/cross-build/cygwin32.cache
288 SIGNAMES_H='$(srcdir)/cross-build/win32sig.h'
291 cross_cache=${srcdir}/cross-build/x86-beos.cache
292 SIGNAMES_H='${srcdir}/cross-build/beos-sig.h'
294 *) echo "configure: cross-compiling for $host is not supported" >&2
297 if test -n "${cross_cache}" && test -r "${cross_cache}"; then
298 echo "loading cross-build cache file ${cross_cache}"
305 if test -z "$CC_FOR_BUILD"; then
306 if test "x$cross_compiling" = "xno"; then
312 AC_SUBST(CC_FOR_BUILD)
314 dnl END changes for cross-building
316 dnl We want these before the checks, so the checks can modify their values.
317 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
319 dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
320 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
322 dnl handle options that alter how bash is compiled and linked
323 dnl these must come after the test for cc/gcc
324 if test "$opt_profiling" = "yes"; then
328 *) opt_static_link=yes ;;
332 if test "$opt_static_link" = yes; then
333 # if we're using gcc, add `-static' to LDFLAGS
334 if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then
344 AC_PROG_GCC_TRADITIONAL
346 dnl BEGIN READLINE and HISTORY LIBRARY SECTION
347 dnl prepare to allow bash to be linked against an already-installed readline
349 dnl first test that the readline version is new enough to link bash against
350 if test "$opt_readline" = yes && test "$opt_with_installed_readline" = "yes"
353 dnl we duplicate some work that's done later here so we can look in
354 dnl the correct directory for the readline library
356 if test -z "$TERMCAP_LIB" ; then
357 BASH_CHECK_LIB_TERMCAP
360 test "x$prefix" = xNONE && _rl_prefix=$ac_default_prefix || _rl_prefix=${prefix}
361 test "x$exec_prefix" = xNONE && _rl_exec_prefix=${_rl_prefix} || _rl_exec_prefix=${exec_prefix}
363 AC_MSG_CHECKING(version of installed readline library)
364 _rl_version=`exec_prefix=${_rl_exec_prefix} ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/rlvers.sh -C "${CC}" -L ${libdir} -T ${TERMCAP_LIB}`
365 AC_MSG_RESULT($_rl_version)
367 case "$_rl_version" in
368 4.[[1-9]]*|5*|6*|7*|8*|9*) ;;
369 *) opt_with_installed_readline=no
370 AC_MSG_WARN(installed readline library is too old to be linked with bash)
371 AC_MSG_WARN(using private bash version)
374 unset _rl_version _rl_prefix _rl_exec_prefix
377 if test $opt_readline = yes; then
379 READLINE_LIB=-lreadline
380 if test "$opt_with_installed_readline" = "yes" ; then
381 RL_LIBDIR='$(libdir)'
383 RL_INCLUDE='-I$(includedir)'
385 RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
386 READLINE_DEP='$(READLINE_LIBRARY)'
389 RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
390 READLINE_LIB= READLINE_DEP=
392 if test $opt_history = yes || test $opt_bang_history = yes; then
393 if test $opt_history = yes; then
396 if test $opt_bang_history = yes; then
397 AC_DEFINE(BANG_HISTORY)
399 HISTORY_LIB=-lhistory
400 if test "$opt_with_installed_readline" = "yes"; then
401 HIST_LIBDIR='$(libdir)'
403 RL_INCLUDE='-I$(includedir)'
405 HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
406 HISTORY_DEP='$(HISTORY_LIBRARY)'
409 HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
410 HISTORY_LIB= HISTORY_DEP=
412 AC_SUBST(READLINE_LIB)
413 AC_SUBST(READLINE_DEP)
416 AC_SUBST(HISTORY_LIB)
417 AC_SUBST(HISTORY_DEP)
418 AC_SUBST(HIST_LIBDIR)
420 dnl END READLINE and HISTORY LIBRARY SECTION
422 dnl programs needed by the build and install process
424 AC_CHECK_PROG(AR, ar, ar)
425 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
426 dnl This allows people to set it when running configure or make
427 test -n "$ARFLAGS" || ARFLAGS="cr"
433 opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
434 *) MAKE_SHELL=/bin/sh ;;
438 dnl special checks for libc functions
441 AC_FUNC_SETVBUF_REVERSED
446 dnl if vprintf is not in libc, see if it's defined in stdio.h
447 if test "$ac_cv_func_vprintf" = no; then
448 AC_MSG_CHECKING(for declaration of vprintf in stdio.h)
449 AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes)
450 AC_MSG_RESULT($ac_cv_func_vprintf)
451 if test $ac_cv_func_vprintf = yes; then
452 AC_DEFINE(HAVE_VPRINTF)
459 dnl checks for certain version-specific system calls and libc functions
460 AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE))
461 AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3))
463 dnl checks for missing libc functions
464 AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING))
466 dnl checks for system calls
467 AC_CHECK_FUNCS(dup2 select getdtablesize getgroups gethostname \
468 setdtablesize getpagesize killpg lstat getpeername sbrk \
469 getrlimit getrusage gettimeofday waitpid tcgetpgrp rename)
471 dnl checks for c library functions
472 AC_CHECK_FUNCS(bcopy bzero confstr getcwd strcasecmp setenv putenv \
473 setlinebuf setlocale strchr strerror strtod strtol \
474 strtoul tcgetattr uname sysconf ulimit times tzset \
475 siginterrupt memmove ttyname gethostbyname inet_aton \
478 dnl checks for locale functions
479 AC_CHECK_HEADERS(libintl.h)
480 AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
482 dnl check for GNU libintl if gettext/textdomain/bindtextdomain
483 dnl are not found in libc
484 if test "$ac_cv_func_bindtextdomain" = "no"; then
485 AC_CHECK_LIB(intl,bindtextdomain)
486 if test "$ac_cv_lib_intl" = "yes"; then
487 AC_CHECK_FUNCS(gettext textdomain bindtextdomain)
491 dnl checks for the dynamic loading library functions in libc and libdl
492 if test "$opt_static_link" != yes; then
493 AC_CHECK_LIB(dl, dlopen)
494 AC_CHECK_FUNCS(dlopen dlclose dlsym)
497 dnl this defines SYS_SIGLIST_DECLARED
504 AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
505 memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
507 AC_CHECK_HEADERS(sys/ptem.h sys/pte.h sys/stream.h sys/select.h sys/file.h \
508 sys/resource.h sys/param.h sys/socket.h \
509 sys/time.h sys/times.h sys/wait.h)
510 AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
512 dnl network functions -- check for inet_aton again
513 if test "$ac_cv_func_inet_aton" != 'yes'; then
518 dnl this is reportedly no longer necessary for irix[56].?
520 irix4*) AC_CHECK_LIB(sun, getpwent) ;;
523 dnl check for getpeername in the socket library only if it's not in libc
524 if test "$ac_cv_func_getpeername" = no; then
527 dnl check for gethostbyname in socket libraries if it's not in libc
528 if test "$ac_cv_func_gethostbyname" = no; then
529 BASH_FUNC_GETHOSTBYNAME
539 AC_CHECK_TYPE(time_t, long)
543 AC_CHECK_SIZEOF(char, 1)
544 AC_CHECK_SIZEOF(short, 2)
545 AC_CHECK_SIZEOF(int, 4)
546 AC_CHECK_SIZEOF(long, 4)
547 AC_CHECK_SIZEOF(char *, 4)
548 AC_CHECK_SIZEOF(double, 8)
550 AC_CHECK_TYPE(u_int, unsigned int)
551 AC_CHECK_TYPE(u_long, unsigned long)
564 dnl C compiler characteristics
569 if test $ac_cv_sys_interpreter = yes; then
570 AC_DEFINE(HAVE_HASH_BANG_EXEC)
572 dnl we use NO_READ_RESTART_ON_SIGNAL
573 AC_SYS_RESTARTABLE_SYSCALLS
575 dnl Miscellaneous Bash tests
576 if test "$ac_cv_func_lstat" = "no"; then
580 dnl behavior of system calls and library functions
581 BASH_DUP2_CLOEXEC_CHECK
585 if test "$ac_cv_sys_restartable_syscalls" = "no"; then
586 BASH_SYS_RESTARTABLE_SYSCALLS
589 dnl checking for the presence of certain library symbols
592 BASH_UNDER_SYS_SIGLIST
594 dnl various system types
596 BASH_CHECK_TYPE(clock_t, [#include <sys/times.h>], long)
597 BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int)
598 BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T)
601 dnl presence and contents of structures used by system calls
602 BASH_STRUCT_TERMIOS_LDISC
603 BASH_STRUCT_TERMIO_LDISC
604 BASH_STRUCT_DIRENT_D_INO
605 BASH_STRUCT_DIRENT_D_FILENO
609 dnl presence and behavior of C library functions
611 BASH_FUNC_OPENDIR_CHECK
613 BASH_FUNC_ULIMIT_MAXFDS
616 BASH_FUNC_SBRK_DECLARED
617 BASH_FUNC_POSIX_SETJMP
620 dnl presence and behavior of OS functions
621 BASH_REINSTALL_SIGHANDLERS
622 BASH_JOB_CONTROL_MISSING
625 dnl presence of certain CPP defines
632 BASH_CHECK_GETPW_FUNCS
636 hpux*) BASH_KERNEL_RLIMIT_CHECK ;;
639 if test "$opt_readline" = yes; then
642 aix*) prefer_curses=yes ;;
644 BASH_CHECK_LIB_TERMCAP
646 AC_SUBST(TERMCAP_LIB)
647 AC_SUBST(TERMCAP_DEP)
651 BASH_DEFAULT_MAIL_DIR
653 if test "$bash_cv_job_control_missing" = missing; then
657 if test "$opt_job_control" = yes; then
658 AC_DEFINE(JOB_CONTROL)
666 dnl Defines that we want to propagate to the Makefiles in subdirectories,
667 dnl like glob and readline
671 dnl use this section to possibly define more cpp variables, specify local
672 dnl libraries, and specify any additional local cc flags
674 dnl this should really go away someday
677 sysv4.2*) AC_DEFINE(SVR4_2)
679 sysv4*) AC_DEFINE(SVR4) ;;
680 sysv5*) AC_DEFINE(SVR5) ;;
681 hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
682 hpux*) LOCAL_CFLAGS=-DHPUX ;;
683 dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
684 isc*) LOCAL_CFLAGS=-Disc386 ;;
685 rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
686 sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
687 sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DNO_MEMSCRAMBLE -DPATH_MAX=1024" ;;
688 sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
689 sunos4*) LOCAL_CFLAGS=-DSunOS4 ;;
690 solaris2.5*) LOCAL_CFLAGS=-DSunOS5 ;;
691 lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
692 linux*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
693 *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s -lunix -lncurses" ;;
694 powerux*) LOCAL_LIBS="-lgen" ;;
695 cygwin32*) LOCAL_LIBS="-luser32" ;;
696 opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG" ;;
699 dnl Stanza for OS/compiler pair-specific flags
700 case "${host_os}-${CC}" in
701 aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;;
702 aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;
703 bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux
706 dnl FreeBSD-3.x can have either a.out or ELF
708 freebsd3*) if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then
709 LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
714 *cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it
717 case "$host_cpu-$host_os" in
718 ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;;
721 case "$host_cpu-$host_vendor-$host_os" in
722 m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;;
723 mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;;
727 # Shared object configuration section. These values are generated by
728 # ${srcdir}/support/shobj-conf
730 if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf
732 AC_MSG_CHECKING(shared object configuration for loadable builtins)
733 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
735 AC_SUBST(SHOBJ_CFLAGS)
737 AC_SUBST(SHOBJ_LDFLAGS)
738 AC_SUBST(SHOBJ_XLDFLAGS)
740 AC_SUBST(SHOBJ_STATUS)
741 AC_MSG_RESULT($SHOBJ_STATUS)
744 # try to create a directory tree if the source is elsewhere
745 # this should be packaged into a script accessible via ${srcdir}/support
748 *) for d in doc tests support lib examples; do # dirs
749 test -d $d || mkdir $d
751 for ld in readline glob tilde malloc sh termcap; do # libdirs
752 test -d lib/$ld || mkdir lib/$ld
754 test -d examples/loadables || mkdir examples/loadables # loadable builtins
755 test -d examples/loadables/perl || mkdir examples/loadables/perl
761 AC_SUBST(PROFILE_FLAGS)
774 AC_SUBST(host_vendor)
778 AC_SUBST(LOCAL_CFLAGS)
779 AC_SUBST(LOCAL_LDFLAGS)
782 #AC_SUBST(ALLOCA_SOURCE)
783 #AC_SUBST(ALLOCA_OBJECT)
785 AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
786 lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \
787 lib/tilde/Makefile doc/Makefile support/Makefile \
788 examples/loadables/Makefile examples/loadables/perl/Makefile],
790 # Makefile uses this timestamp file to record whether config.h is up to date.
791 echo timestamp > stamp-h