2 dnl Configure script for readline library
4 dnl report bugs to chet@po.cwru.edu
6 dnl Process this file with autoconf to produce a configure script.
7 AC_REVISION([for Readline 4.2, version 2.26, from autoconf version] AC_ACVERSION)
11 AC_CONFIG_HEADER(config.h)
13 dnl make sure we are using a recent autoconf version
16 AC_CONFIG_AUX_DIR(./support)
20 dnl configure defaults
24 dnl arguments to configure
25 AC_ARG_WITH(curses, --with-curses use the curses library instead of the termcap library,opt_curses=$withval)
27 if test "$opt_curses" = "yes"; then
31 # We want these before the checks, so the checks can modify their values.
32 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
39 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
40 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
42 AC_PROG_GCC_TRADITIONAL
44 AC_CHECK_PROG(AR, ar, ar)
45 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
46 dnl This allows people to set it when running configure or make
47 test -n "$ARFLAGS" || ARFLAGS="cr"
58 AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
63 AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \
64 sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
65 termcap.h termios.h termio.h sys/file.h locale.h)
68 BASH_REINSTALL_SIGHANDLERS
70 BASH_FUNC_POSIX_SETJMP
72 BASH_CHECK_GETPW_FUNCS
81 BASH_STRUCT_DIRENT_D_INO
82 BASH_STRUCT_DIRENT_D_FILENO
86 aix*) prefer_curses=yes ;;
88 BASH_CHECK_LIB_TERMCAP
89 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
90 TERMCAP_LIB=-ltermcap #default
94 *cray*) LOCAL_CFLAGS=-DCRAY ;;
95 *s390*) LOCAL_CFLAGS=-fsigned-char ;;
99 isc*) LOCAL_CFLAGS=-Disc386 ;;
102 # shared library configuration section
104 # Shared object configuration section. These values are generated by
105 # ${srcdir}/support/shobj-conf
107 if test -f ${srcdir}/support/shobj-conf; then
108 AC_MSG_CHECKING(configuration for building shared libraries)
109 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
111 AC_SUBST(SHOBJ_CFLAGS)
113 AC_SUBST(SHOBJ_LDFLAGS)
114 AC_SUBST(SHOBJ_XLDFLAGS)
116 AC_SUBST(SHOBJ_STATUS)
117 AC_SUBST(SHLIB_STATUS)
118 AC_SUBST(SHLIB_XLDFLAGS)
119 AC_SUBST(SHLIB_LIBSUFF)
120 AC_SUBST(SHLIB_LIBVERSION)
122 AC_MSG_RESULT($SHLIB_STATUS)
124 # shared library versioning
125 # quoted for m4 so I can use character classes
126 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
127 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
128 AC_SUBST(SHLIB_MAJOR)
129 AC_SUBST(SHLIB_MINOR)
133 msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
134 *) BUILD_DIR=`pwd` ;;
140 AC_SUBST(LOCAL_CFLAGS)
141 AC_SUBST(LOCAL_LDFLAGS)
152 AC_SUBST(TERMCAP_LIB)
154 AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
156 # Makefile uses this timestamp file to record whether config.h is up to date.