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 5.0, version 2.52, from autoconf version] AC_ACVERSION)
9 AC_INIT(readline, 5.0-rc1, bug-readline@gnu.org)
11 dnl make sure we are using a recent autoconf version
14 AC_CONFIG_SRCDIR(readline.h)
15 AC_CONFIG_AUX_DIR(./support)
16 AC_CONFIG_HEADERS(config.h)
18 dnl update the value of RL_READLINE_VERSION in readline.h when this changes
23 dnl configure defaults
26 dnl arguments to configure
27 AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
29 if test "$opt_curses" = "yes"; then
33 dnl option parsing for optional features
38 AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
39 AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
40 AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
42 if test $opt_multibyte = no; then
43 AC_DEFINE(NO_MULTIBYTE_SUPPORT)
47 echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
50 # We want these before the checks, so the checks can modify their values.
51 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
58 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
59 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
61 AC_PROG_GCC_TRADITIONAL
63 AC_CHECK_PROG(AR, ar, , ar)
64 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
65 dnl This allows people to set it when running configure or make
66 test -n "$ARFLAGS" || ARFLAGS="cr"
79 AC_CHECK_TYPE(ssize_t, int)
86 AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
87 strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
91 AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
92 limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
93 termcap.h termios.h termio.h sys/file.h locale.h memory.h )
95 BASH_SYS_SIGNAL_VINTAGE
96 BASH_SYS_REINSTALL_SIGHANDLERS
98 BASH_FUNC_POSIX_SETJMP
101 BASH_FUNC_CTYPE_NONASCII
103 BASH_CHECK_GETPW_FUNCS
112 BASH_STRUCT_DIRENT_D_INO
113 BASH_STRUCT_DIRENT_D_FILENO
117 aix*) prefer_curses=yes ;;
119 BASH_CHECK_LIB_TERMCAP
120 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
121 if test "$prefer_curses" = yes; then
124 TERMCAP_LIB=-ltermcap #default
131 *cray*) LOCAL_CFLAGS=-DCRAY ;;
132 *s390*) LOCAL_CFLAGS=-fsigned-char ;;
136 isc*) LOCAL_CFLAGS=-Disc386 ;;
139 # shared library configuration section
141 # Shared object configuration section. These values are generated by
142 # ${srcdir}/support/shobj-conf
144 if test -f ${srcdir}/support/shobj-conf; then
145 AC_MSG_CHECKING(configuration for building shared libraries)
146 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
148 AC_SUBST(SHOBJ_CFLAGS)
150 AC_SUBST(SHOBJ_LDFLAGS)
151 AC_SUBST(SHOBJ_XLDFLAGS)
153 AC_SUBST(SHOBJ_STATUS)
154 AC_SUBST(SHLIB_STATUS)
155 AC_SUBST(SHLIB_XLDFLAGS)
156 AC_SUBST(SHLIB_LIBSUFF)
157 AC_SUBST(SHLIB_LIBVERSION)
159 AC_MSG_RESULT($SHLIB_STATUS)
161 # SHLIB_STATUS is either `supported' or `unsupported'. If it's
162 # `unsupported', turn off any default shared library building
163 if test "$SHLIB_STATUS" = 'unsupported'; then
167 # shared library versioning
168 # quoted for m4 so I can use character classes
169 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
170 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
171 AC_SUBST(SHLIB_MAJOR)
172 AC_SUBST(SHLIB_MINOR)
175 if test "$opt_static_libs" = "yes"; then
177 STATIC_INSTALL_TARGET=install-static
179 if test "$opt_shared_libs" = "yes"; then
181 SHARED_INSTALL_TARGET=install-shared
184 AC_SUBST(STATIC_TARGET)
185 AC_SUBST(SHARED_TARGET)
186 AC_SUBST(STATIC_INSTALL_TARGET)
187 AC_SUBST(SHARED_INSTALL_TARGET)
190 msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
191 *) BUILD_DIR=`pwd` ;;
197 AC_SUBST(LOCAL_CFLAGS)
198 AC_SUBST(LOCAL_LDFLAGS)
209 AC_SUBST(TERMCAP_LIB)
211 AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
213 # Makefile uses this timestamp file to record whether config.h is up to date.