2 dnl Configure script for readline library
6 dnl Process this file with autoconf to produce a configure script.
7 AC_REVISION([for Readline 4.3, version 2.45, from autoconf version] AC_ACVERSION)
11 dnl make sure we are using a recent autoconf version
14 AC_CONFIG_SRCDIR(readline.h)
15 dnl 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
37 AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
40 echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
43 # We want these before the checks, so the checks can modify their values.
44 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
51 dnl BEGIN changes for CYGNUS cross-building for Cygwin
53 dnl load up the cross-building cache file -- add more cases and cache
54 dnl files as necessary
55 if test "x$cross_compiling" = "xyes"; then
58 cross_cache=${srcdir}/cross-build/cygwin.cache
59 if test -r "${cross_cache}"; then
60 echo "loading cross-build cache file ${cross_cache}"
63 LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
66 *) echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
71 if test "x$cross_compiling" = "xyes"; then
72 CROSS_COMPILING_FLAG=-DCROSS_COMPILING
76 AC_SUBST(CROSS_COMPILING_FLAG)
78 if test -z "$CC_FOR_BUILD"; then
79 if test "x$cross_compiling" = "xno"; then
85 AC_SUBST(CC_FOR_BUILD)
87 dnl END changes for CYGNUS cross-building for Cygwin
89 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
90 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
92 AC_PROG_GCC_TRADITIONAL
94 AC_CHECK_PROG(AR, ar, , ar)
95 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
96 dnl This allows people to set it when running configure or make
97 test -n "$ARFLAGS" || ARFLAGS="cr"
110 AC_CHECK_TYPE(ssize_t, int)
115 AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
116 strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
120 AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
121 limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
122 termcap.h termios.h termio.h sys/file.h locale.h memory.h )
124 BASH_SYS_SIGNAL_VINTAGE
125 BASH_SYS_REINSTALL_SIGHANDLERS
127 BASH_FUNC_POSIX_SETJMP
131 BASH_CHECK_GETPW_FUNCS
140 BASH_STRUCT_DIRENT_D_INO
141 BASH_STRUCT_DIRENT_D_FILENO
145 aix*) prefer_curses=yes ;;
147 BASH_CHECK_LIB_TERMCAP
148 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
149 if test "$prefer_curses" = yes; then
152 TERMCAP_LIB=-ltermcap #default
159 *cray*) LOCAL_CFLAGS=-DCRAY ;;
160 *s390*) LOCAL_CFLAGS=-fsigned-char ;;
164 isc*) LOCAL_CFLAGS=-Disc386 ;;
167 # shared library configuration section
169 # Shared object configuration section. These values are generated by
170 # ${srcdir}/support/shobj-conf
172 if test -f ${srcdir}/support/shobj-conf; then
173 AC_MSG_CHECKING(configuration for building shared libraries)
174 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
176 AC_SUBST(SHOBJ_CFLAGS)
178 AC_SUBST(SHOBJ_LDFLAGS)
179 AC_SUBST(SHOBJ_XLDFLAGS)
181 AC_SUBST(SHOBJ_STATUS)
182 AC_SUBST(SHLIB_STATUS)
183 AC_SUBST(SHLIB_XLDFLAGS)
184 AC_SUBST(SHLIB_LIBSUFF)
185 AC_SUBST(SHLIB_LIBVERSION)
187 AC_MSG_RESULT($SHLIB_STATUS)
189 # SHLIB_STATUS is either `supported' or `unsupported'. If it's
190 # `unsupported', turn off any default shared library building
191 if test "$SHLIB_STATUS" = 'unsupported'; then
195 # shared library versioning
196 # quoted for m4 so I can use character classes
197 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
198 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
199 AC_SUBST(SHLIB_MAJOR)
200 AC_SUBST(SHLIB_MINOR)
203 if test "$opt_static_libs" = "yes"; then
205 STATIC_INSTALL_TARGET=install-static
207 if test "$opt_shared_libs" = "yes"; then
209 SHARED_INSTALL_TARGET=install-shared
212 AC_SUBST(STATIC_TARGET)
213 AC_SUBST(SHARED_TARGET)
214 AC_SUBST(STATIC_INSTALL_TARGET)
215 AC_SUBST(SHARED_INSTALL_TARGET)
218 msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
219 *) BUILD_DIR=`pwd` ;;
225 AC_SUBST(LOCAL_CFLAGS)
226 AC_SUBST(LOCAL_LDFLAGS)
237 AC_SUBST(TERMCAP_LIB)
239 AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
241 # Makefile uses this timestamp file to record whether config.h is up to date.