i-bash/configure.in

1113 lines
33 KiB
Text
Raw Normal View History

1996-12-23 17:02:34 +00:00
dnl
2006-10-10 14:15:34 +00:00
dnl Configure script for bash-3.2
1996-12-23 17:02:34 +00:00
dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
1997-06-05 14:59:13 +00:00
2008-11-18 13:15:12 +00:00
# Copyright (C) 1987-2007 Free Software Foundation, Inc.
2001-11-13 17:56:06 +00:00
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
1996-12-23 17:02:34 +00:00
2006-10-10 14:15:34 +00:00
AC_REVISION([for Bash 3.2, version 3.190])dnl
2001-11-13 17:56:06 +00:00
2006-10-10 14:15:34 +00:00
define(bashvers, 3.2)
2004-07-27 13:29:18 +00:00
define(relstatus, release)
2006-10-10 14:15:34 +00:00
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
1996-12-23 17:02:34 +00:00
dnl make sure we are using a recent autoconf version
2001-11-13 17:56:06 +00:00
AC_PREREQ(2.50)
1996-12-23 17:02:34 +00:00
2001-11-13 17:56:06 +00:00
AC_CONFIG_SRCDIR(shell.h)
1996-12-23 17:02:34 +00:00
dnl where to find install.sh, config.sub, and config.guess
AC_CONFIG_AUX_DIR(./support)
2001-11-13 17:56:06 +00:00
AC_CONFIG_HEADERS(config.h)
dnl checks for version info
2004-07-27 13:29:18 +00:00
BASHVERS=bashvers
RELSTATUS=relstatus
2002-07-17 14:10:11 +00:00
dnl defaults for debug settings
case "$RELSTATUS" in
alp*|bet*|dev*|rc*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
*) DEBUG= MALLOC_DEBUG= ;;
esac
1996-12-23 17:02:34 +00:00
dnl canonicalize the host and os so we can do some tricky things before
dnl parsing options
AC_CANONICAL_HOST
dnl configure defaults
2000-03-17 21:46:59 +00:00
opt_bash_malloc=yes
1996-12-23 17:02:34 +00:00
opt_purify=no
1997-06-05 14:59:13 +00:00
opt_purecov=no
1996-12-23 17:02:34 +00:00
opt_afs=no
1997-06-05 14:59:13 +00:00
opt_curses=no
1999-02-19 17:11:39 +00:00
opt_with_installed_readline=no
1996-12-23 17:02:34 +00:00
2000-03-17 21:46:59 +00:00
#htmldir=
2001-04-06 19:14:31 +00:00
dnl some systems should be configured without the bash malloc by default
1996-12-23 17:02:34 +00:00
dnl and some need a special compiler or loader
dnl look in the NOTES file for more
case "${host_cpu}-${host_os}" in
2000-03-17 21:46:59 +00:00
alpha*-*) opt_bash_malloc=no ;; # alpha running osf/1 or linux
2001-04-06 19:14:31 +00:00
*[[Cc]]ray*-*) opt_bash_malloc=no ;; # Crays
2000-03-17 21:46:59 +00:00
*-osf1*) opt_bash_malloc=no ;; # other osf/1 machines
sparc-svr4*) opt_bash_malloc=no ;; # sparc SVR4, SVR4.2
sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
2005-12-07 14:08:12 +00:00
#*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here
2002-07-17 14:10:11 +00:00
#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree
2001-11-13 17:56:06 +00:00
*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
2000-03-17 21:46:59 +00:00
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
2001-04-06 19:14:31 +00:00
*-macos*) opt_bash_malloc=no ;; # Apple MacOS X
*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X)
*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X)
2000-03-17 21:46:59 +00:00
*-dgux*) opt_bash_malloc=no ;; # DG/UX machines
2005-12-07 14:08:12 +00:00
*-qnx*) opt_bash_malloc=no ;; # QNX 4.2, QNX 6.x
2000-03-17 21:46:59 +00:00
*-machten4) opt_bash_malloc=no ;; # MachTen 4.x
*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
*-beos*) opt_bash_malloc=no ;; # they say it's suitable
2001-04-06 19:14:31 +00:00
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
*-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
1996-12-23 17:02:34 +00:00
esac
2002-07-17 14:10:11 +00:00
# memory scrambling on free()
case "${host_os}" in
sco3.2v5*|sco3.2v4*) opt_memscramble=no ;;
*) opt_memscramble=yes ;;
esac
2004-07-27 13:29:18 +00:00
dnl
dnl macros for the bash debugger
dnl
AM_PATH_LISPDIR
AC_ARG_VAR(DEBUGGER_START_FILE, [location of bash debugger initialization file])
1996-12-23 17:02:34 +00:00
dnl arguments to configure
dnl packages
2002-07-17 14:10:11 +00:00
AC_ARG_WITH(afs, AC_HELP_STRING([--with-afs], [if you are running AFS]), opt_afs=$withval)
AC_ARG_WITH(bash-malloc, AC_HELP_STRING([--with-bash-malloc], [use the Bash version of malloc]), opt_bash_malloc=$withval)
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
AC_ARG_WITH(gnu-malloc, AC_HELP_STRING([--with-gnu-malloc], [synonym for --with-bash-malloc]), opt_bash_malloc=$withval)
AC_ARG_WITH(installed-readline, AC_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval)
AC_ARG_WITH(purecov, AC_HELP_STRING([--with-purecov], [configure to postprocess with pure coverage]), opt_purecov=$withval)
AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval)
1996-12-23 17:02:34 +00:00
2001-11-13 17:56:06 +00:00
if test "$opt_bash_malloc" = yes; then
1997-06-05 14:59:13 +00:00
MALLOC_TARGET=malloc
MALLOC_SRC=malloc.c
2001-11-13 17:56:06 +00:00
MALLOC_LIB='-lmalloc'
MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a'
MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)'
MALLOC_DEP='$(MALLOC_LIBRARY)'
2000-03-17 21:46:59 +00:00
AC_DEFINE(USING_BASH_MALLOC)
1996-12-23 17:02:34 +00:00
else
2001-11-13 17:56:06 +00:00
MALLOC_LIB=
MALLOC_LIBRARY=
MALLOC_LDFLAGS=
MALLOC_DEP=
1996-12-23 17:02:34 +00:00
fi
if test "$opt_purify" = yes; then
1997-06-05 14:59:13 +00:00
PURIFY="purify "
2002-07-17 14:10:11 +00:00
AC_DEFINE(DISABLE_MALLOC_WRAPPERS)
1996-12-23 17:02:34 +00:00
else
PURIFY=
fi
1997-06-05 14:59:13 +00:00
if test "$opt_purecov" = yes; then
PURIFY="${PURIFY}purecov"
fi
1996-12-23 17:02:34 +00:00
if test "$opt_afs" = yes; then
AC_DEFINE(AFS)
fi
1997-06-05 14:59:13 +00:00
if test "$opt_curses" = yes; then
prefer_curses=yes
fi
2004-07-27 13:29:18 +00:00
if test -z "${DEBUGGER_START_FILE}"; then
2006-10-10 14:15:34 +00:00
DEBUGGER_START_FILE=${ac_default_prefix}/share/bashdb/bashdb-main.inc
2004-07-27 13:29:18 +00:00
fi
1996-12-23 17:02:34 +00:00
dnl optional shell features in config.h.in
opt_minimal_config=no
opt_job_control=yes
opt_alias=yes
opt_readline=yes
opt_history=yes
opt_bang_history=yes
opt_dirstack=yes
opt_restricted=yes
opt_process_subst=yes
opt_prompt_decoding=yes
opt_select=yes
opt_help=yes
opt_array_variables=yes
opt_dparen_arith=yes
1998-04-17 19:52:44 +00:00
opt_extended_glob=yes
1996-12-23 17:02:34 +00:00
opt_brace_expansion=yes
opt_disabled_builtins=no
opt_command_timing=yes
2000-03-17 21:46:59 +00:00
opt_xpg_echo=no
2005-12-07 14:08:12 +00:00
opt_strict_posix=no
1998-04-17 19:52:44 +00:00
opt_cond_command=yes
2004-07-27 13:29:18 +00:00
opt_cond_regexp=yes
2000-03-17 21:46:59 +00:00
opt_arith_for_command=yes
opt_net_redirs=yes
opt_progcomp=yes
2002-07-17 14:10:11 +00:00
opt_separate_help=no
2004-07-27 13:29:18 +00:00
opt_multibyte=yes
opt_debugger=yes
2005-12-07 14:08:12 +00:00
opt_single_longdoc_strings=yes
1998-04-17 19:52:44 +00:00
dnl options that affect how bash is compiled and linked
opt_static_link=no
opt_profiling=no
1996-12-23 17:02:34 +00:00
dnl argument parsing for optional features
2002-07-17 14:10:11 +00:00
AC_ARG_ENABLE(minimal-config, AC_HELP_STRING([--enable-minimal-config], [a minimal sh-like configuration]), opt_minimal_config=$enableval)
1996-12-23 17:02:34 +00:00
dnl a minimal configuration turns everything off, but features can be
dnl added individually
if test $opt_minimal_config = yes; then
opt_job_control=no opt_alias=no opt_readline=no
opt_history=no opt_bang_history=no opt_dirstack=no
opt_restricted=no opt_process_subst=no opt_prompt_decoding=no
opt_select=no opt_help=no opt_array_variables=no opt_dparen_arith=no
opt_brace_expansion=no opt_disabled_builtins=no opt_command_timing=no
2000-03-17 21:46:59 +00:00
opt_extended_glob=no opt_cond_command=no opt_arith_for_command=no
2002-07-17 14:10:11 +00:00
opt_net_redirs=no opt_progcomp=no opt_separate_help=no
2004-07-27 13:29:18 +00:00
opt_multibyte=yes opt_cond_regexp=no
2002-07-17 14:10:11 +00:00
fi
AC_ARG_ENABLE(alias, AC_HELP_STRING([--enable-alias], [enable shell aliases]), opt_alias=$enableval)
AC_ARG_ENABLE(arith-for-command, AC_HELP_STRING([--enable-arith-for-command], [enable arithmetic for command]), opt_arith_for_command=$enableval)
AC_ARG_ENABLE(array-variables, AC_HELP_STRING([--enable-array-variables], [include shell array variables]), opt_array_variables=$enableval)
AC_ARG_ENABLE(bang-history, AC_HELP_STRING([--enable-bang-history], [turn on csh-style history substitution]), opt_bang_history=$enableval)
AC_ARG_ENABLE(brace-expansion, AC_HELP_STRING([--enable-brace-expansion], [include brace expansion]), opt_brace_expansion=$enableval)
AC_ARG_ENABLE(command-timing, AC_HELP_STRING([--enable-command-timing], [enable the time reserved word and command timing]), opt_command_timing=$enableval)
AC_ARG_ENABLE(cond-command, AC_HELP_STRING([--enable-cond-command], [enable the conditional command]), opt_cond_command=$enableval)
2004-07-27 13:29:18 +00:00
AC_ARG_ENABLE(cond-regexp, AC_HELP_STRING([--enable-cond-regexp], [enable extgended regular expression matching in conditional commands]), opt_cond_regexp=$enableval)
AC_ARG_ENABLE(debugger, AC_HELP_STRING([--enable-debugger], [enable support for bash debugger]), opt_debugger=$enableval)
2002-07-17 14:10:11 +00:00
AC_ARG_ENABLE(directory-stack, AC_HELP_STRING([--enable-directory-stack], [enable builtins pushd/popd/dirs]), opt_dirstack=$enableval)
AC_ARG_ENABLE(disabled-builtins, AC_HELP_STRING([--enable-disabled-builtins], [allow disabled builtins to still be invoked]), opt_disabled_builtins=$enableval)
AC_ARG_ENABLE(dparen-arithmetic, AC_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval)
AC_ARG_ENABLE(extended-glob, AC_HELP_STRING([--enable-extended-glob], [include ksh-style extended pattern matching]), opt_extended_glob=$enableval)
AC_ARG_ENABLE(help-builtin, AC_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval)
AC_ARG_ENABLE(history, AC_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval)
AC_ARG_ENABLE(job-control, AC_HELP_STRING([--enable-job-control], [enable job control features]), opt_job_control=$enableval)
2004-07-27 13:29:18 +00:00
AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
2002-07-17 14:10:11 +00:00
AC_ARG_ENABLE(net-redirections, AC_HELP_STRING([--enable-net-redirections], [enable /dev/tcp/host/port redirection]), opt_net_redirs=$enableval)
AC_ARG_ENABLE(process-substitution, AC_HELP_STRING([--enable-process-substitution], [enable process substitution]), opt_process_subst=$enableval)
AC_ARG_ENABLE(progcomp, AC_HELP_STRING([--enable-progcomp], [enable programmable completion and the complete builtin]), opt_progcomp=$enableval)
AC_ARG_ENABLE(prompt-string-decoding, AC_HELP_STRING([--enable-prompt-string-decoding], [turn on escape character decoding in prompts]), opt_prompt_decoding=$enableval)
AC_ARG_ENABLE(readline, AC_HELP_STRING([--enable-readline], [turn on command line editing]), opt_readline=$enableval)
AC_ARG_ENABLE(restricted, AC_HELP_STRING([--enable-restricted], [enable a restricted shell]), opt_restricted=$enableval)
AC_ARG_ENABLE(select, AC_HELP_STRING([--enable-select], [include select command]), opt_select=$enableval)
AC_ARG_ENABLE(separate-helpfiles, AC_HELP_STRING([--enable-separate-helpfiles], [use external files for help builtin documentation]), opt_separate_help=$enableval)
2005-12-07 14:08:12 +00:00
AC_ARG_ENABLE(single-help-strings, AC_HELP_STRING([--enable-single-help-strings], [store help documentation as a single string to ease translation]), opt_single_longdoc_strings=$enableval)
AC_ARG_ENABLE(strict-posix-default, AC_HELP_STRING([--enable-strict-posix-default], [configure bash to be posix-conformant by default]), opt_strict_posix=$enableval)
2002-07-17 14:10:11 +00:00
AC_ARG_ENABLE(usg-echo-default, AC_HELP_STRING([--enable-usg-echo-default], [a synonym for --enable-xpg-echo-default]), opt_xpg_echo=$enableval)
AC_ARG_ENABLE(xpg-echo-default, AC_HELP_STRING([--enable-xpg-echo-default], [make the echo builtin expand escape sequences by default]), opt_xpg_echo=$enableval)
1996-12-23 17:02:34 +00:00
1998-04-17 19:52:44 +00:00
dnl options that alter how bash is compiled and linked
2002-07-17 14:10:11 +00:00
AC_ARG_ENABLE(mem-scramble, AC_HELP_STRING([--enable-mem-scramble], [scramble memory on calls to malloc and free]), opt_memscramble=$enableval)
AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling], [allow profiling with gprof]), opt_profiling=$enableval)
AC_ARG_ENABLE(static-link, AC_HELP_STRING([--enable-static-link], [link bash statically, for use as a root shell]), opt_static_link=$enableval)
1998-04-17 19:52:44 +00:00
1996-12-23 17:02:34 +00:00
dnl opt_job_control is handled later, after BASH_JOB_CONTROL_MISSING runs
1999-02-19 17:11:39 +00:00
dnl opt_readline and opt_history are handled later, because AC_PROG_CC needs
dnl to be run before we can check the version of an already-installed readline
dnl library
1996-12-23 17:02:34 +00:00
if test $opt_alias = yes; then
AC_DEFINE(ALIAS)
fi
if test $opt_dirstack = yes; then
AC_DEFINE(PUSHD_AND_POPD)
fi
if test $opt_restricted = yes; then
AC_DEFINE(RESTRICTED_SHELL)
fi
if test $opt_process_subst = yes; then
AC_DEFINE(PROCESS_SUBSTITUTION)
fi
if test $opt_prompt_decoding = yes; then
AC_DEFINE(PROMPT_STRING_DECODE)
fi
if test $opt_select = yes; then
AC_DEFINE(SELECT_COMMAND)
fi
if test $opt_help = yes; then
AC_DEFINE(HELP_BUILTIN)
fi
if test $opt_array_variables = yes; then
AC_DEFINE(ARRAY_VARS)
fi
if test $opt_dparen_arith = yes; then
AC_DEFINE(DPAREN_ARITHMETIC)
fi
if test $opt_brace_expansion = yes; then
AC_DEFINE(BRACE_EXPANSION)
fi
if test $opt_disabled_builtins = yes; then
AC_DEFINE(DISABLED_BUILTINS)
fi
if test $opt_command_timing = yes; then
AC_DEFINE(COMMAND_TIMING)
fi
2000-03-17 21:46:59 +00:00
if test $opt_xpg_echo = yes ; then
AC_DEFINE(DEFAULT_ECHO_TO_XPG)
1996-12-23 17:02:34 +00:00
fi
2005-12-07 14:08:12 +00:00
if test $opt_strict_posix = yes; then
AC_DEFINE(STRICT_POSIX)
fi
1998-04-17 19:52:44 +00:00
if test $opt_extended_glob = yes ; then
AC_DEFINE(EXTENDED_GLOB)
fi
if test $opt_cond_command = yes ; then
AC_DEFINE(COND_COMMAND)
fi
2004-07-27 13:29:18 +00:00
if test $opt_cond_regexp = yes ; then
AC_DEFINE(COND_REGEXP)
fi
2000-03-17 21:46:59 +00:00
if test $opt_arith_for_command = yes; then
AC_DEFINE(ARITH_FOR_COMMAND)
fi
if test $opt_net_redirs = yes; then
AC_DEFINE(NETWORK_REDIRECTIONS)
fi
if test $opt_progcomp = yes; then
AC_DEFINE(PROGRAMMABLE_COMPLETION)
fi
2004-07-27 13:29:18 +00:00
if test $opt_multibyte = no; then
AC_DEFINE(NO_MULTIBYTE_SUPPORT)
fi
if test $opt_debugger = yes; then
AC_DEFINE(DEBUGGER)
fi
1996-12-23 17:02:34 +00:00
2002-07-17 14:10:11 +00:00
if test $opt_memscramble = yes; then
AC_DEFINE(MEMSCRAMBLE)
fi
1997-06-05 14:59:13 +00:00
if test "$opt_minimal_config" = yes; then
TESTSCRIPT=run-minimal
else
TESTSCRIPT=run-all
fi
2002-07-17 14:10:11 +00:00
HELPDIR= HELPDIRDEFINE= HELPINSTALL=
if test "$opt_separate_help" != no; then
if test "$opt_separate_help" = "yes" ; then
HELPDIR='${datadir}/bash'
else
HELPDIR=$opt_separate_help
fi
HELPDIRDEFINE='-H ${HELPDIR}'
HELPINSTALL='install-help'
fi
2005-12-07 14:08:12 +00:00
HELPSTRINGS=
if test "$opt_single_longdoc_strings" != "yes"; then
HELPSTRINGS='-S'
fi
2002-07-17 14:10:11 +00:00
1996-12-23 17:02:34 +00:00
dnl now substitute in the values generated by arguments
1997-06-05 14:59:13 +00:00
AC_SUBST(TESTSCRIPT)
1996-12-23 17:02:34 +00:00
AC_SUBST(PURIFY)
1997-06-05 14:59:13 +00:00
AC_SUBST(MALLOC_TARGET)
1996-12-23 17:02:34 +00:00
AC_SUBST(MALLOC_SRC)
2001-11-13 17:56:06 +00:00
AC_SUBST(MALLOC_LIB)
AC_SUBST(MALLOC_LIBRARY)
AC_SUBST(MALLOC_LDFLAGS)
AC_SUBST(MALLOC_DEP)
2000-03-17 21:46:59 +00:00
2001-11-13 17:56:06 +00:00
AC_SUBST(htmldir)
1997-06-05 14:59:13 +00:00
2002-07-17 14:10:11 +00:00
AC_SUBST(HELPDIR)
AC_SUBST(HELPDIRDEFINE)
AC_SUBST(HELPINSTALL)
2005-12-07 14:08:12 +00:00
AC_SUBST(HELPSTRINGS)
2002-07-17 14:10:11 +00:00
2001-11-13 17:56:06 +00:00
echo ""
2002-07-17 14:10:11 +00:00
echo "Beginning configuration for bash-$BASHVERS-$RELSTATUS for ${host_cpu}-${host_vendor}-${host_os}"
2001-11-13 17:56:06 +00:00
echo ""
1996-12-23 17:02:34 +00:00
dnl compilation checks
1998-04-17 19:52:44 +00:00
dnl AC_PROG_CC sets $cross_compiling to `yes' if cross-compiling for a
dnl different environment
1996-12-23 17:02:34 +00:00
AC_PROG_CC
2000-03-17 21:46:59 +00:00
dnl test for Unix variants
1996-12-23 17:02:34 +00:00
AC_ISC_POSIX
AC_MINIX
2001-11-13 17:56:06 +00:00
AC_SYS_LARGEFILE
2000-03-17 21:46:59 +00:00
2005-12-07 14:08:12 +00:00
dnl BEGIN changes for cross-building (currently cygwin, minGW, and
dnl (obsolete) BeOS)
1999-02-19 17:11:39 +00:00
2006-10-10 14:15:34 +00:00
SIGNAMES_O=
1999-02-19 17:11:39 +00:00
SIGNAMES_H=lsignames.h
1998-04-17 19:52:44 +00:00
dnl load up the cross-building cache file -- add more cases and cache
dnl files as necessary
1999-02-19 17:11:39 +00:00
dnl Note that host and target machine are the same, and different than the
dnl build machine.
dnl Set SIGNAMES_H based on whether or not we're cross-compiling.
2006-10-10 14:15:34 +00:00
CROSS_COMPILE=
1998-04-17 19:52:44 +00:00
if test "x$cross_compiling" = "xyes"; then
case "${host}" in
2001-04-06 19:14:31 +00:00
*-cygwin*)
1998-04-17 19:52:44 +00:00
cross_cache=${srcdir}/cross-build/cygwin32.cache
;;
2005-12-07 14:08:12 +00:00
*-mingw*)
cross_cache=${srcdir}/cross-build/cygwin32.cache
;;
1999-02-19 17:11:39 +00:00
i[[3456]]86-*-beos*)
cross_cache=${srcdir}/cross-build/x86-beos.cache
;;
*) echo "configure: cross-compiling for $host is not supported" >&2
1998-04-17 19:52:44 +00:00
;;
esac
1999-02-19 17:11:39 +00:00
if test -n "${cross_cache}" && test -r "${cross_cache}"; then
echo "loading cross-build cache file ${cross_cache}"
. ${cross_cache}
fi
unset cross_cache
2006-10-10 14:15:34 +00:00
SIGNAMES_O='signames.o'
2005-12-07 14:08:12 +00:00
CROSS_COMPILE='-DCROSS_COMPILING'
AC_SUBST(CROSS_COMPILE)
1998-04-17 19:52:44 +00:00
fi
1999-02-19 17:11:39 +00:00
AC_SUBST(SIGNAMES_H)
2006-10-10 14:15:34 +00:00
AC_SUBST(SIGNAMES_O)
1998-04-17 19:52:44 +00:00
if test -z "$CC_FOR_BUILD"; then
if test "x$cross_compiling" = "xno"; then
CC_FOR_BUILD='$(CC)'
else
CC_FOR_BUILD=gcc
fi
fi
AC_SUBST(CC_FOR_BUILD)
1999-02-19 17:11:39 +00:00
dnl END changes for cross-building
1998-04-17 19:52:44 +00:00
1996-12-23 17:02:34 +00:00
dnl We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2 to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
1998-04-17 19:52:44 +00:00
dnl handle options that alter how bash is compiled and linked
dnl these must come after the test for cc/gcc
if test "$opt_profiling" = "yes"; then
PROFILE_FLAGS=-pg
1999-02-19 17:11:39 +00:00
case "$host_os" in
solaris2*) ;;
*) opt_static_link=yes ;;
esac
2002-07-17 14:10:11 +00:00
DEBUG= MALLOC_DEBUG=
1998-04-17 19:52:44 +00:00
fi
if test "$opt_static_link" = yes; then
2001-11-13 17:56:06 +00:00
# if we're using gcc, add `-static' to LDFLAGS, except on Solaris >= 2
1998-04-17 19:52:44 +00:00
if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then
2001-11-13 17:56:06 +00:00
STATIC_LD="-static"
case "$host_os" in
solaris2*) ;;
*) LDFLAGS="$LDFLAGS -static" ;; # XXX experimental
esac
1998-04-17 19:52:44 +00:00
fi
fi
2004-07-27 13:29:18 +00:00
if test "X$cross_compiling" = "Xno"; then
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-"$CPPFLAGS"}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-'$(LDFLAGS)'}
else
CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-""}
LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
fi
2002-07-17 14:10:11 +00:00
test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
1996-12-23 17:02:34 +00:00
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
1999-02-19 17:11:39 +00:00
AC_SUBST(STATIC_LD)
1996-12-23 17:02:34 +00:00
2002-07-17 14:10:11 +00:00
AC_SUBST(CFLAGS_FOR_BUILD)
AC_SUBST(CPPFLAGS_FOR_BUILD)
AC_SUBST(LDFLAGS_FOR_BUILD)
1996-12-23 17:02:34 +00:00
AC_PROG_GCC_TRADITIONAL
1999-02-19 17:11:39 +00:00
dnl BEGIN READLINE and HISTORY LIBRARY SECTION
dnl prepare to allow bash to be linked against an already-installed readline
dnl first test that the readline version is new enough to link bash against
2001-11-13 17:56:06 +00:00
if test "$opt_readline" = yes && test "$opt_with_installed_readline" != "no"
1999-02-19 17:11:39 +00:00
then
2001-11-13 17:56:06 +00:00
# If the user specified --with-installed-readline=PREFIX and PREFIX
# is not `yes', set ac_cv_rl_prefix to PREFIX
test $opt_with_installed_readline != "yes" && ac_cv_rl_prefix=$opt_with_installed_readline
1999-02-19 17:11:39 +00:00
2001-11-13 17:56:06 +00:00
RL_LIB_READLINE_VERSION
1999-02-19 17:11:39 +00:00
2001-11-13 17:56:06 +00:00
case "$ac_cv_rl_version" in
2004-07-27 13:29:18 +00:00
5*|6*|7*|8*|9*) ;;
1999-02-19 17:11:39 +00:00
*) opt_with_installed_readline=no
AC_MSG_WARN(installed readline library is too old to be linked with bash)
AC_MSG_WARN(using private bash version)
;;
esac
fi
2005-12-07 14:08:12 +00:00
TILDE_LIB=-ltilde
1999-02-19 17:11:39 +00:00
if test $opt_readline = yes; then
AC_DEFINE(READLINE)
2001-11-13 17:56:06 +00:00
if test "$opt_with_installed_readline" != "no" ; then
2004-07-27 13:29:18 +00:00
case "$opt_with_installed_readline" in
yes) RL_INCLUDE= ;;
*) case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;;
esac
;;
2001-11-13 17:56:06 +00:00
esac
1999-02-19 17:11:39 +00:00
READLINE_DEP=
2005-12-07 14:08:12 +00:00
READLINE_LIB=-lreadline
# section for OS versions that don't allow unresolved symbols
# to be compiled into dynamic libraries.
case "$host_os" in
cygwin*) TILDE_LIB= ;;
esac
1999-02-19 17:11:39 +00:00
else
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
READLINE_DEP='$(READLINE_LIBRARY)'
2005-12-07 14:08:12 +00:00
# section for OS versions that ship an older/broken version of
# readline as a standard dynamic library and don't allow a
# static version specified as -llibname to override the
# dynamic version
case "${host_os}" in
2008-11-18 13:15:12 +00:00
darwin[[89]]*) READLINE_LIB='${READLINE_LIBRARY}' ;;
2005-12-07 14:08:12 +00:00
*) READLINE_LIB=-lreadline ;;
esac
1999-02-19 17:11:39 +00:00
fi
else
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
READLINE_LIB= READLINE_DEP=
fi
if test $opt_history = yes || test $opt_bang_history = yes; then
if test $opt_history = yes; then
AC_DEFINE(HISTORY)
fi
if test $opt_bang_history = yes; then
AC_DEFINE(BANG_HISTORY)
fi
2001-11-13 17:56:06 +00:00
if test "$opt_with_installed_readline" != "no"; then
HIST_LIBDIR=$RL_LIBDIR
1999-02-19 17:11:39 +00:00
HISTORY_DEP=
2005-12-07 14:08:12 +00:00
HISTORY_LIB=-lhistory
2004-07-27 13:29:18 +00:00
case "$opt_with_installed_readline" in
yes) RL_INCLUDE= ;;
*) case "$RL_INCLUDEDIR" in
/usr/include) ;;
*) RL_INCLUDE='-I${RL_INCLUDEDIR}' ;;
esac
;;
2001-11-13 17:56:06 +00:00
esac
1999-02-19 17:11:39 +00:00
else
HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
HISTORY_DEP='$(HISTORY_LIBRARY)'
2005-12-07 14:08:12 +00:00
# section for OS versions that ship an older version of
# readline as a standard dynamic library and don't allow a
# static version specified as -llibname to override the
# dynamic version
case "${host_os}" in
darwin8*) HISTORY_LIB='${HISTORY_LIBRARY}' ;;
*) HISTORY_LIB=-lhistory ;;
esac
1999-02-19 17:11:39 +00:00
fi
else
HIST_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
HISTORY_LIB= HISTORY_DEP=
fi
AC_SUBST(READLINE_LIB)
AC_SUBST(READLINE_DEP)
AC_SUBST(RL_LIBDIR)
2001-11-13 17:56:06 +00:00
AC_SUBST(RL_INCLUDEDIR)
1999-02-19 17:11:39 +00:00
AC_SUBST(RL_INCLUDE)
AC_SUBST(HISTORY_LIB)
AC_SUBST(HISTORY_DEP)
AC_SUBST(HIST_LIBDIR)
2005-12-07 14:08:12 +00:00
AC_SUBST(TILDE_LIB)
1999-02-19 17:11:39 +00:00
dnl END READLINE and HISTORY LIBRARY SECTION
1996-12-23 17:02:34 +00:00
dnl programs needed by the build and install process
AC_PROG_INSTALL
2001-11-13 17:56:06 +00:00
AC_CHECK_PROG(AR, ar, , ar)
1999-02-19 17:11:39 +00:00
dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
dnl This allows people to set it when running configure or make
test -n "$ARFLAGS" || ARFLAGS="cr"
1996-12-23 17:02:34 +00:00
AC_PROG_RANLIB
AC_PROG_YACC
AC_PROG_MAKE_SET
1999-02-19 17:11:39 +00:00
case "$host_os" in
2000-03-17 21:46:59 +00:00
opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
1999-02-19 17:11:39 +00:00
*) MAKE_SHELL=/bin/sh ;;
esac
AC_SUBST(MAKE_SHELL)
2005-12-07 14:08:12 +00:00
dnl this is similar to the expanded AC_PROG_RANLIB
if test x$SIZE = x; then
if test x$ac_tool_prefix = x; then
SIZE=size
else
SIZE=${ac_tool_prefix}size
save_IFS=$IFS ; IFS=:
size_found=0
for dir in $PATH; do
if test -x $dir/$SIZE ; then
size_found=1
break
fi
done
if test $size_found -eq 0; then
SIZE=:
fi
IFS=$save_IFS
fi
fi
AC_SUBST(SIZE)
2001-11-13 17:56:06 +00:00
dnl Turn on any extensions available in the GNU C library.
AC_DEFINE(_GNU_SOURCE, 1)
dnl C compiler characteristics
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_C_STRINGIZE
AC_C_LONG_DOUBLE
AC_C_PROTOTYPES
AC_C_CHAR_UNSIGNED
2004-07-27 13:29:18 +00:00
dnl initialize GNU gettext
AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl])
2001-11-13 17:56:06 +00:00
dnl header files
AC_HEADER_DIRENT
AC_HEADER_TIME
BASH_HEADER_INTTYPES
AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
2005-12-07 14:08:12 +00:00
stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h)
AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \
2004-07-27 13:29:18 +00:00
sys/resource.h sys/param.h sys/socket.h sys/stat.h \
sys/time.h sys/times.h sys/types.h sys/wait.h)
2001-11-13 17:56:06 +00:00
AC_CHECK_HEADERS(netinet/in.h arpa/inet.h)
2005-12-07 14:08:12 +00:00
dnl sys/ptem.h requires definitions from sys/stream.h on systems where it
dnl exists
AC_CHECK_HEADER(sys/ptem.h, , ,[[
#if HAVE_SYS_STREAM_H
# include <sys/stream.h>
#endif
]])
1996-12-23 17:02:34 +00:00
dnl special checks for libc functions
AC_FUNC_ALLOCA
AC_FUNC_GETPGRP
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_VPRINTF
AC_FUNC_STRCOLL
2001-11-13 17:56:06 +00:00
dnl if we're not using the bash malloc but require the C alloca, set things
dnl up to build a libmalloc.a containing only alloca.o
if test "$ac_cv_func_alloca_works" = "no" && test "$opt_bash_malloc" = "no"; then
MALLOC_TARGET=alloca
MALLOC_SRC=alloca.c
MALLOC_LIB='-lmalloc'
MALLOC_LIBRARY='$(ALLOC_LIBDIR)/libmalloc.a'
MALLOC_LDFLAGS='-L$(ALLOC_LIBDIR)'
MALLOC_DEP='$(MALLOC_LIBRARY)'
fi
1996-12-23 17:02:34 +00:00
dnl if vprintf is not in libc, see if it's defined in stdio.h
if test "$ac_cv_func_vprintf" = no; then
AC_MSG_CHECKING(for declaration of vprintf in stdio.h)
AC_EGREP_HEADER([[int[ ]*vprintf[^a-zA-Z0-9]]],stdio.h,ac_cv_func_vprintf=yes)
AC_MSG_RESULT($ac_cv_func_vprintf)
if test $ac_cv_func_vprintf = yes; then
AC_DEFINE(HAVE_VPRINTF)
fi
fi
2001-11-13 17:56:06 +00:00
if test "$ac_cv_func_vprintf" = no && test "$ac_cv_func__doprnt" = "yes"; then
AC_LIBOBJ(vprint)
fi
1996-12-23 17:02:34 +00:00
dnl signal stuff
2001-11-13 17:56:06 +00:00
AC_TYPE_SIGNAL
1996-12-23 17:02:34 +00:00
dnl checks for certain version-specific system calls and libc functions
AC_CHECK_FUNC(__setostype, AC_DEFINE(HAVE_SETOSTYPE))
AC_CHECK_FUNC(wait3, AC_DEFINE(HAVE_WAIT3))
2002-07-17 14:10:11 +00:00
AC_CHECK_FUNC(isinf, AC_DEFINE(HAVE_ISINF_IN_LIBC))
2006-10-10 14:15:34 +00:00
AC_CHECK_FUNC(isnan, AC_DEFINE(HAVE_ISNAN_IN_LIBC))
1996-12-23 17:02:34 +00:00
dnl checks for missing libc functions
AC_CHECK_FUNC(mkfifo,AC_DEFINE(HAVE_MKFIFO),AC_DEFINE(MKFIFO_MISSING))
dnl checks for system calls
2006-10-10 14:15:34 +00:00
AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \
getpagesize getpeername getrlimit getrusage gettimeofday \
kill killpg lstat readlink sbrk select setdtablesize \
tcgetpgrp uname ulimit waitpid)
2001-11-13 17:56:06 +00:00
AC_REPLACE_FUNCS(rename)
1996-12-23 17:02:34 +00:00
dnl checks for c library functions
2005-12-07 14:08:12 +00:00
AC_CHECK_FUNCS(bcopy bzero confstr fnmatch \
2002-07-17 14:10:11 +00:00
getaddrinfo gethostbyname getservbyname getservent inet_aton \
2005-12-07 14:08:12 +00:00
memmove pathconf putenv raise regcomp regexec \
setenv setlinebuf setlocale setvbuf siginterrupt strchr \
sysconf tcgetattr times ttyname tzset unsetenv)
AC_CHECK_FUNCS(vsnprintf snprintf vasprintf asprintf)
2001-11-13 17:56:06 +00:00
AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
2005-12-07 14:08:12 +00:00
AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_REPLACE_FUNCS(getcwd memset strcasecmp strerror strftime strnlen strpbrk strstr)
2002-07-17 14:10:11 +00:00
AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax)
2001-11-13 17:56:06 +00:00
AC_CHECK_DECLS([confstr])
AC_CHECK_DECLS([printf])
2002-07-17 14:10:11 +00:00
AC_CHECK_DECLS([sbrk])
2006-10-10 14:15:34 +00:00
AC_CHECK_DECLS([setregid])
2002-07-17 14:10:11 +00:00
AC_CHECK_DECLS([strcpy])
2001-11-13 17:56:06 +00:00
AC_CHECK_DECLS([strsignal])
2004-07-27 13:29:18 +00:00
dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3)
AC_CHECK_DECLS([strtold], [
AC_MSG_CHECKING([for broken strtold])
AC_CACHE_VAL(bash_cv_strtold_broken,
[AC_TRY_COMPILE(
[#include <stdlib.h>],
[int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}],
bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes,
[AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)])
]
)
AC_MSG_RESULT($bash_cv_strtold_broken)
if test "$bash_cv_strtold_broken" = "yes" ; then
AC_DEFINE(STRTOLD_BROKEN)
fi
])
2001-11-13 17:56:06 +00:00
BASH_CHECK_DECL(strtoimax)
BASH_CHECK_DECL(strtol)
BASH_CHECK_DECL(strtoll)
BASH_CHECK_DECL(strtoul)
BASH_CHECK_DECL(strtoull)
BASH_CHECK_DECL(strtoumax)
1996-12-23 17:02:34 +00:00
2002-07-17 14:10:11 +00:00
AC_FUNC_MKTIME
2004-07-27 13:29:18 +00:00
dnl
dnl Checks for lib/intl and related code (uses some of the output from
dnl AM_GNU_GETTEXT)
dnl
1996-12-23 17:02:34 +00:00
2004-07-27 13:29:18 +00:00
AC_CHECK_HEADERS([argz.h errno.h fcntl.h malloc.h stdio_ext.h])
dnl AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify dcgettext mempcpy \
munmap stpcpy strcspn strdup])
INTL_DEP= INTL_INC= LIBINTL_H=
if test "x$USE_INCLUDED_LIBINTL" = "xyes"; then
INTL_DEP='${INTL_LIBDIR}/libintl.a'
INTL_INC='-I${INTL_LIBSRC} -I${INTL_BUILDDIR}'
LIBINTL_H='${INTL_BUILDDIR}/libintl.h'
1996-12-23 17:02:34 +00:00
fi
2004-07-27 13:29:18 +00:00
AC_SUBST(INTL_DEP)
AC_SUBST(INTL_INC)
AC_SUBST(LIBINTL_H)
dnl
dnl End of checks needed by files in lib/intl
dnl
1996-12-23 17:02:34 +00:00
2002-07-17 14:10:11 +00:00
BASH_CHECK_MULTIBYTE
1996-12-23 17:02:34 +00:00
dnl checks for the dynamic loading library functions in libc and libdl
1998-04-17 19:52:44 +00:00
if test "$opt_static_link" != yes; then
1996-12-23 17:02:34 +00:00
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_FUNCS(dlopen dlclose dlsym)
1998-04-17 19:52:44 +00:00
fi
1996-12-23 17:02:34 +00:00
dnl this defines SYS_SIGLIST_DECLARED
AC_DECL_SYS_SIGLIST
2000-03-17 21:46:59 +00:00
dnl network functions -- check for inet_aton again
if test "$ac_cv_func_inet_aton" != 'yes'; then
BASH_FUNC_INET_ATON
fi
1996-12-23 17:02:34 +00:00
dnl libraries
dnl this is reportedly no longer necessary for irix[56].?
2000-03-17 21:46:59 +00:00
case "$host_os" in
irix4*) AC_CHECK_LIB(sun, getpwent) ;;
esac
1997-06-05 14:59:13 +00:00
dnl check for getpeername in the socket library only if it's not in libc
if test "$ac_cv_func_getpeername" = no; then
2001-11-13 17:56:06 +00:00
BASH_CHECK_LIB_SOCKET
1997-06-05 14:59:13 +00:00
fi
2000-03-17 21:46:59 +00:00
dnl check for gethostbyname in socket libraries if it's not in libc
if test "$ac_cv_func_gethostbyname" = no; then
BASH_FUNC_GETHOSTBYNAME
fi
1996-12-23 17:02:34 +00:00
dnl system types
AC_TYPE_GETGROUPS
AC_TYPE_OFF_T
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
2001-11-13 17:56:06 +00:00
AC_CHECK_TYPE(ssize_t, int)
1996-12-23 17:02:34 +00:00
AC_CHECK_TYPE(time_t, long)
2001-11-13 17:56:06 +00:00
BASH_TYPE_LONG_LONG
BASH_TYPE_UNSIGNED_LONG_LONG
1996-12-23 17:02:34 +00:00
AC_TYPE_SIGNAL
2000-03-17 21:46:59 +00:00
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
1999-02-19 17:11:39 +00:00
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(char *, 4)
AC_CHECK_SIZEOF(double, 8)
2001-11-13 17:56:06 +00:00
AC_CHECK_SIZEOF([long long], 8)
1998-04-17 19:52:44 +00:00
2001-11-13 17:56:06 +00:00
AC_CHECK_TYPE(u_int, [unsigned int])
AC_CHECK_TYPE(u_long, [unsigned long])
2000-03-17 21:46:59 +00:00
BASH_TYPE_BITS16_T
BASH_TYPE_U_BITS16_T
BASH_TYPE_BITS32_T
BASH_TYPE_U_BITS32_T
1999-02-19 17:11:39 +00:00
BASH_TYPE_BITS64_T
1998-04-17 19:52:44 +00:00
2000-03-17 21:46:59 +00:00
BASH_TYPE_PTRDIFF_T
1996-12-23 17:02:34 +00:00
dnl structures
AC_HEADER_STAT
dnl system services
AC_SYS_INTERPRETER
if test $ac_cv_sys_interpreter = yes; then
AC_DEFINE(HAVE_HASH_BANG_EXEC)
fi
dnl Miscellaneous Bash tests
if test "$ac_cv_func_lstat" = "no"; then
BASH_FUNC_LSTAT
fi
1997-06-05 14:59:13 +00:00
dnl behavior of system calls and library functions
2004-07-27 13:29:18 +00:00
BASH_FUNC_CTYPE_NONASCII
2001-11-13 17:56:06 +00:00
BASH_FUNC_DUP2_CLOEXEC_CHECK
BASH_SYS_PGRP_SYNC
BASH_SYS_SIGNAL_VINTAGE
1998-04-17 19:52:44 +00:00
1997-06-05 14:59:13 +00:00
dnl checking for the presence of certain library symbols
1996-12-23 17:02:34 +00:00
BASH_SYS_ERRLIST
BASH_SYS_SIGLIST
BASH_UNDER_SYS_SIGLIST
1997-06-05 14:59:13 +00:00
dnl various system types
1996-12-23 17:02:34 +00:00
BASH_TYPE_SIGHANDLER
BASH_CHECK_TYPE(clock_t, [#include <sys/times.h>], long)
BASH_CHECK_TYPE(sigset_t, [#include <signal.h>], int)
BASH_CHECK_TYPE(quad_t, , long, HAVE_QUAD_T)
2001-11-13 17:56:06 +00:00
BASH_CHECK_TYPE(intmax_t, , $bash_cv_type_long_long)
BASH_CHECK_TYPE(uintmax_t, , $bash_cv_type_unsigned_long_long)
if test "$ac_cv_header_sys_socket_h" = "yes"; then
BASH_CHECK_TYPE(socklen_t, [#include <sys/socket.h>], int, HAVE_SOCKLEN_T)
fi
BASH_TYPE_RLIMIT
1997-06-05 14:59:13 +00:00
dnl presence and contents of structures used by system calls
1996-12-23 17:02:34 +00:00
BASH_STRUCT_TERMIOS_LDISC
BASH_STRUCT_TERMIO_LDISC
BASH_STRUCT_DIRENT_D_INO
1997-06-05 14:59:13 +00:00
BASH_STRUCT_DIRENT_D_FILENO
2004-07-27 13:29:18 +00:00
BASH_STRUCT_DIRENT_D_NAMLEN
1997-06-05 14:59:13 +00:00
BASH_STRUCT_WINSIZE
2000-03-17 21:46:59 +00:00
BASH_STRUCT_TIMEVAL
2001-11-13 17:56:06 +00:00
AC_CHECK_MEMBERS([struct stat.st_blocks])
2002-07-17 14:10:11 +00:00
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
2004-07-27 13:29:18 +00:00
BASH_STRUCT_TIMEZONE
1997-06-05 14:59:13 +00:00
dnl presence and behavior of C library functions
1996-12-23 17:02:34 +00:00
BASH_FUNC_STRSIGNAL
BASH_FUNC_OPENDIR_CHECK
BASH_FUNC_ULIMIT_MAXFDS
BASH_FUNC_GETENV
2002-07-17 14:10:11 +00:00
if test "$ac_cv_func_getcwd" = "yes"; then
1996-12-23 17:02:34 +00:00
BASH_FUNC_GETCWD
2001-11-13 17:56:06 +00:00
fi
1996-12-23 17:02:34 +00:00
BASH_FUNC_POSIX_SETJMP
1997-06-05 14:59:13 +00:00
BASH_FUNC_STRCOLL
2002-07-17 14:10:11 +00:00
dnl If putenv or unsetenv is not present, set the right define so the
dnl prototype and declaration in lib/sh/getenv.c will be standard-conformant
if test "$ac_cv_func_putenv" = "yes"; then
BASH_FUNC_STD_PUTENV
else
AC_DEFINE(HAVE_STD_PUTENV)
fi
if test "$ac_cv_func_unsetenv" = "yes"; then
BASH_FUNC_STD_UNSETENV
else
AC_DEFINE(HAVE_STD_UNSETENV)
fi
2001-11-13 17:56:06 +00:00
BASH_FUNC_PRINTF_A_FORMAT
1997-06-05 14:59:13 +00:00
dnl presence and behavior of OS functions
2001-11-13 17:56:06 +00:00
BASH_SYS_REINSTALL_SIGHANDLERS
BASH_SYS_JOB_CONTROL_MISSING
1996-12-23 17:02:34 +00:00
BASH_SYS_NAMED_PIPES
1997-06-05 14:59:13 +00:00
dnl presence of certain CPP defines
2001-11-13 17:56:06 +00:00
AC_HEADER_TIOCGWINSZ
1996-12-23 17:02:34 +00:00
BASH_HAVE_TIOCSTAT
BASH_HAVE_FIONREAD
1997-06-05 14:59:13 +00:00
2005-12-07 14:08:12 +00:00
BASH_CHECK_WCONTINUED
1997-06-05 14:59:13 +00:00
dnl miscellaneous
2001-11-13 17:56:06 +00:00
BASH_CHECK_SPEED_T
1996-12-23 17:02:34 +00:00
BASH_CHECK_GETPW_FUNCS
2001-04-06 19:14:31 +00:00
BASH_CHECK_RTSIGS
2001-11-13 17:56:06 +00:00
BASH_CHECK_SYS_SIGLIST
1996-12-23 17:02:34 +00:00
1997-06-05 14:59:13 +00:00
dnl special checks
1996-12-23 17:02:34 +00:00
case "$host_os" in
2001-11-13 17:56:06 +00:00
hpux*) BASH_CHECK_KERNEL_RLIMIT ;;
1996-12-23 17:02:34 +00:00
esac
if test "$opt_readline" = yes; then
1997-06-05 14:59:13 +00:00
dnl yuck
case "$host_os" in
aix*) prefer_curses=yes ;;
esac
1996-12-23 17:02:34 +00:00
BASH_CHECK_LIB_TERMCAP
fi
AC_SUBST(TERMCAP_LIB)
AC_SUBST(TERMCAP_DEP)
1997-06-05 14:59:13 +00:00
BASH_CHECK_DEV_FD
2000-03-17 21:46:59 +00:00
BASH_CHECK_DEV_STDIN
2001-11-13 17:56:06 +00:00
BASH_SYS_DEFAULT_MAIL_DIR
1996-12-23 17:02:34 +00:00
if test "$bash_cv_job_control_missing" = missing; then
opt_job_control=no
fi
if test "$opt_job_control" = yes; then
AC_DEFINE(JOB_CONTROL)
JOBS_O=jobs.o
else
JOBS_O=nojobs.o
fi
AC_SUBST(JOBS_O)
1997-06-05 14:59:13 +00:00
dnl Defines that we want to propagate to the Makefiles in subdirectories,
dnl like glob and readline
LOCAL_DEFS=-DSHELL
1996-12-23 17:02:34 +00:00
dnl use this section to possibly define more cpp variables, specify local
dnl libraries, and specify any additional local cc flags
dnl
dnl this should really go away someday
1999-02-19 17:11:39 +00:00
case "${host_os}" in
1997-09-22 20:22:27 +00:00
sysv4.2*) AC_DEFINE(SVR4_2)
1996-12-23 17:02:34 +00:00
AC_DEFINE(SVR4) ;;
sysv4*) AC_DEFINE(SVR4) ;;
1999-02-19 17:11:39 +00:00
sysv5*) AC_DEFINE(SVR5) ;;
hpux9*) LOCAL_CFLAGS="-DHPUX9 -DHPUX" ;;
1996-12-23 17:02:34 +00:00
hpux*) LOCAL_CFLAGS=-DHPUX ;;
dgux*) LOCAL_CFLAGS=-D_DGUX_SOURCE; LOCAL_LIBS=-ldgc ;;
2000-03-17 21:46:59 +00:00
isc*) LOCAL_CFLAGS=-Disc386 ;;
rhapsody*) LOCAL_CFLAGS=-DRHAPSODY ;;
2001-11-13 17:56:06 +00:00
darwin*) LOCAL_CFLAGS=-DMACOSX ;;
2002-07-17 14:10:11 +00:00
sco3.2v5*) LOCAL_CFLAGS="-b elf -DWAITPID_BROKEN -DPATH_MAX=1024" ;;
sco3.2v4*) LOCAL_CFLAGS="-DMUST_UNBLOCK_CHLD -DPATH_MAX=1024" ;;
1996-12-23 17:02:34 +00:00
sco3.2*) LOCAL_CFLAGS=-DMUST_UNBLOCK_CHLD ;;
1997-06-05 14:59:13 +00:00
sunos4*) LOCAL_CFLAGS=-DSunOS4 ;;
2008-11-18 13:15:12 +00:00
solaris2.5*) LOCAL_CFLAGS="-DSunOS5 -DSOLARIS" ;;
solaris2*) LOCAL_CFLAGS=-DSOLARIS ;;
1999-02-19 17:11:39 +00:00
lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
2005-12-07 14:08:12 +00:00
linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
case "`uname -r`" in
2.[[456789]]*|3*) AC_DEFINE(PGRP_PIPE) ;;
esac ;;
*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
2002-07-17 14:10:11 +00:00
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
1999-02-19 17:11:39 +00:00
powerux*) LOCAL_LIBS="-lgen" ;;
2004-07-27 13:29:18 +00:00
cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
2005-12-07 14:08:12 +00:00
opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE" ;;
1999-02-19 17:11:39 +00:00
esac
dnl Stanza for OS/compiler pair-specific flags
case "${host_os}-${CC}" in
aix4.2*-*gcc*) LOCAL_LDFLAGS="-Xlinker -bexpall -Xlinker -brtl" ;;
aix4.2*) LOCAL_LDFLAGS="-bexpall -brtl" ;;
bsdi4*-*gcc*) LOCAL_LDFLAGS="-rdynamic" ;; # allow dynamic loading, like Linux
1996-12-23 17:02:34 +00:00
esac
2000-03-17 21:46:59 +00:00
dnl FreeBSD-3.x can have either a.out or ELF
case "${host_os}" in
2001-04-06 19:14:31 +00:00
freebsd[[3-9]]*)
if test -x /usr/bin/objformat && test "`/usr/bin/objformat`" = "elf" ; then
2000-03-17 21:46:59 +00:00
LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
fi ;;
2001-04-06 19:14:31 +00:00
freebsdelf*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
2005-12-07 14:08:12 +00:00
dragonfly*) LOCAL_LDFLAGS=-rdynamic ;; # allow dynamic loading
2000-03-17 21:46:59 +00:00
esac
1996-12-23 17:02:34 +00:00
case "$host_cpu" in
*cray*) LOCAL_CFLAGS="-DCRAY" ;; # shell var so config.h can use it
esac
case "$host_cpu-$host_os" in
ibmrt-*bsd4*) LOCAL_CFLAGS="-ma -U__STDC__" ;;
esac
case "$host_cpu-$host_vendor-$host_os" in
m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;;
mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;;
esac
1999-02-19 17:11:39 +00:00
#
# Shared object configuration section. These values are generated by
# ${srcdir}/support/shobj-conf
#
if test "$ac_cv_func_dlopen" = "yes" && test -f ${srcdir}/support/shobj-conf
then
AC_MSG_CHECKING(shared object configuration for loadable builtins)
2001-04-06 19:14:31 +00:00
eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
1999-02-19 17:11:39 +00:00
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
AC_SUBST(SHOBJ_LDFLAGS)
AC_SUBST(SHOBJ_XLDFLAGS)
AC_SUBST(SHOBJ_LIBS)
AC_SUBST(SHOBJ_STATUS)
AC_MSG_RESULT($SHOBJ_STATUS)
fi
1996-12-23 17:02:34 +00:00
# try to create a directory tree if the source is elsewhere
# this should be packaged into a script accessible via ${srcdir}/support
case "$srcdir" in
.) ;;
1998-04-17 19:52:44 +00:00
*) for d in doc tests support lib examples; do # dirs
1996-12-23 17:02:34 +00:00
test -d $d || mkdir $d
done
1998-04-17 19:52:44 +00:00
for ld in readline glob tilde malloc sh termcap; do # libdirs
1996-12-23 17:02:34 +00:00
test -d lib/$ld || mkdir lib/$ld
done
1998-04-17 19:52:44 +00:00
test -d examples/loadables || mkdir examples/loadables # loadable builtins
2000-03-17 21:46:59 +00:00
test -d examples/loadables/perl || mkdir examples/loadables/perl
1996-12-23 17:02:34 +00:00
;;
esac
BUILD_DIR=`pwd`
2005-12-07 14:08:12 +00:00
case "$BUILD_DIR" in
*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
*) ;;
esac
1996-12-23 17:02:34 +00:00
1998-04-17 19:52:44 +00:00
AC_SUBST(PROFILE_FLAGS)
1996-12-23 17:02:34 +00:00
AC_SUBST(incdir)
AC_SUBST(BUILD_DIR)
AC_SUBST(YACC)
AC_SUBST(AR)
1999-02-19 17:11:39 +00:00
AC_SUBST(ARFLAGS)
1996-12-23 17:02:34 +00:00
1997-06-05 14:59:13 +00:00
AC_SUBST(BASHVERS)
2002-07-17 14:10:11 +00:00
AC_SUBST(RELSTATUS)
AC_SUBST(DEBUG)
AC_SUBST(MALLOC_DEBUG)
1997-06-05 14:59:13 +00:00
1996-12-23 17:02:34 +00:00
AC_SUBST(host_cpu)
1999-02-19 17:11:39 +00:00
AC_SUBST(host_vendor)
1996-12-23 17:02:34 +00:00
AC_SUBST(host_os)
AC_SUBST(LOCAL_LIBS)
AC_SUBST(LOCAL_CFLAGS)
AC_SUBST(LOCAL_LDFLAGS)
1997-06-05 14:59:13 +00:00
AC_SUBST(LOCAL_DEFS)
1996-12-23 17:02:34 +00:00
1997-06-05 14:59:13 +00:00
#AC_SUBST(ALLOCA_SOURCE)
#AC_SUBST(ALLOCA_OBJECT)
1996-12-23 17:02:34 +00:00
AC_OUTPUT([Makefile builtins/Makefile lib/readline/Makefile lib/glob/Makefile \
2004-07-27 13:29:18 +00:00
lib/intl/Makefile \
1998-04-17 19:52:44 +00:00
lib/malloc/Makefile lib/sh/Makefile lib/termcap/Makefile \
2004-07-27 13:29:18 +00:00
lib/tilde/Makefile doc/Makefile support/Makefile po/Makefile.in \
examples/loadables/Makefile examples/loadables/perl/Makefile \
pathnames.h],
1996-12-23 17:02:34 +00:00
[
# Makefile uses this timestamp file to record whether config.h is up to date.
echo timestamp > stamp-h
])