Remove gdb workaround from readline/emacs_keymap.c
[deliverable/binutils-gdb.git] / readline / configure.ac
CommitLineData
d60d9f65
SS
1dnl
2dnl Configure script for readline library
3dnl
4dnl report bugs to chet@po.cwru.edu
5dnl
6dnl Process this file with autoconf to produce a configure script.
d60d9f65 7
775e241e 8# Copyright (C) 1987-2016 Free Software Foundation, Inc.
5bdf8622 9
cc88a640
JK
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation, either version 3 of the License, or
13# (at your option) any later version.
5bdf8622 14
cc88a640
JK
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
5bdf8622 19
cc88a640
JK
20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
5bdf8622 22
775e241e 23AC_REVISION([for Readline 7.0, version 2.81])
5bdf8622 24
5836a818
PP
25m4_include([../config/override.m4])
26
775e241e 27AC_INIT(readline, 7.0, bug-readline@gnu.org)
d60d9f65
SS
28
29dnl make sure we are using a recent autoconf version
9255ee31 30AC_PREREQ(2.50)
d60d9f65 31
9255ee31 32AC_CONFIG_SRCDIR(readline.h)
5836a818
PP
33dnl GDB LOCAL
34dnl AC_CONFIG_AUX_DIR(./support)
35AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
9255ee31
EZ
36AC_CONFIG_HEADERS(config.h)
37
38dnl update the value of RL_READLINE_VERSION in readline.h when this changes
775e241e 39LIBVERSION=7.0
d60d9f65
SS
40
41AC_CANONICAL_HOST
19ce2a29 42AC_CANONICAL_BUILD
d60d9f65
SS
43
44dnl configure defaults
45opt_curses=no
d60d9f65
SS
46
47dnl arguments to configure
9255ee31 48AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
d60d9f65
SS
49
50if test "$opt_curses" = "yes"; then
51 prefer_curses=yes
52fi
53
9255ee31 54dnl option parsing for optional features
5bdf8622 55opt_multibyte=yes
9255ee31 56opt_static_libs=yes
b558ff04 57opt_shared_libs=no
9255ee31 58
5bdf8622 59AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
5836a818 60dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
9255ee31
EZ
61AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
62
5bdf8622
DJ
63if test $opt_multibyte = no; then
64AC_DEFINE(NO_MULTIBYTE_SUPPORT)
65fi
66
67dnl load up the cross-building cache file -- add more cases and cache
68dnl files as necessary
69
70dnl Note that host and target machine are the same, and different than the
71dnl build machine.
72
eeab5adb 73CROSS_COMPILE=
5bdf8622
DJ
74if test "x$cross_compiling" = "xyes"; then
75 case "${host}" in
76 *-cygwin*)
77 cross_cache=${srcdir}/cross-build/cygwin.cache
78 ;;
79 *-mingw*)
80 cross_cache=${srcdir}/cross-build/mingw.cache
81 ;;
82 i[[3456]]86-*-beos*)
83 cross_cache=${srcdir}/cross-build/x86-beos.cache
84 ;;
85 *) echo "configure: cross-compiling for $host is not supported" >&2
86 ;;
87 esac
88 if test -n "${cross_cache}" && test -r "${cross_cache}"; then
89 echo "loading cross-build cache file ${cross_cache}"
90 . ${cross_cache}
91 fi
92 unset cross_cache
93 CROSS_COMPILE='-DCROSS_COMPILING'
94 AC_SUBST(CROSS_COMPILE)
95fi
96
9255ee31
EZ
97echo ""
98echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
99echo ""
100
d60d9f65
SS
101# We want these before the checks, so the checks can modify their values.
102test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
103
9255ee31 104AC_PROG_MAKE_SET
d60d9f65 105AC_PROG_CC
1b17e766 106dnl AC_AIX
d60d9f65
SS
107AC_MINIX
108
d60d9f65
SS
109# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
110test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
111
112AC_PROG_GCC_TRADITIONAL
113AC_PROG_INSTALL
775e241e 114AC_CHECK_TOOL(AR, ar)
c862e87b
JM
115dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
116dnl This allows people to set it when running configure or make
117test -n "$ARFLAGS" || ARFLAGS="cr"
d60d9f65
SS
118AC_PROG_RANLIB
119
c862e87b
JM
120MAKE_SHELL=/bin/sh
121AC_SUBST(MAKE_SHELL)
122
9255ee31
EZ
123AC_C_CONST
124AC_C_PROTOTYPES
125AC_C_CHAR_UNSIGNED
cc88a640 126AC_C_VOLATILE
9255ee31
EZ
127
128AC_TYPE_SIGNAL
129
130AC_TYPE_SIZE_T
131AC_CHECK_TYPE(ssize_t, int)
d60d9f65 132
5bdf8622
DJ
133AC_HEADER_STDC
134
d60d9f65
SS
135AC_HEADER_STAT
136AC_HEADER_DIRENT
137
775e241e
TT
138AC_CHECK_FUNCS(fcntl kill lstat readlink)
139AC_CHECK_FUNCS(memmove pselect putenv select setenv setlocale \
5bdf8622
DJ
140 strcasecmp strpbrk tcgetattr vsnprintf)
141AC_CHECK_FUNCS(isascii isxdigit)
142AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
d60d9f65 143
775e241e 144AC_FUNC_CHOWN
d60d9f65
SS
145AC_FUNC_STRCOLL
146
775e241e
TT
147AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h stdbool.h \
148 string.h strings.h \
5bdf8622 149 limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
775e241e 150AC_CHECK_HEADERS(sys/ioctl.h sys/pte.h sys/stream.h sys/select.h sys/file.h)
5bdf8622
DJ
151
152AC_CHECK_HEADERS(sys/ptem.h,,,
153[[
154#if HAVE_SYS_STREAM_H
155# include <sys/stream.h>
156#endif
157]])
d60d9f65 158
cc88a640
JK
159AC_SYS_LARGEFILE
160
9255ee31
EZ
161BASH_SYS_SIGNAL_VINTAGE
162BASH_SYS_REINSTALL_SIGHANDLERS
d60d9f65
SS
163
164BASH_FUNC_POSIX_SETJMP
165BASH_FUNC_LSTAT
d60d9f65 166BASH_FUNC_STRCOLL
5bdf8622 167BASH_FUNC_CTYPE_NONASCII
d60d9f65 168
9255ee31
EZ
169BASH_CHECK_GETPW_FUNCS
170
171AC_HEADER_TIOCGWINSZ
172
cc88a640 173BASH_TYPE_SIG_ATOMIC_T
d60d9f65 174BASH_TYPE_SIGHANDLER
cc88a640 175
d60d9f65
SS
176BASH_HAVE_TIOCSTAT
177BASH_HAVE_FIONREAD
9255ee31 178BASH_CHECK_SPEED_T
d60d9f65
SS
179BASH_STRUCT_WINSIZE
180BASH_STRUCT_DIRENT_D_INO
181BASH_STRUCT_DIRENT_D_FILENO
182
775e241e
TT
183AC_CHECK_HEADERS(libaudit.h)
184AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include <linux/audit.h>]])
185
d60d9f65
SS
186dnl yuck
187case "$host_os" in
188aix*) prefer_curses=yes ;;
189esac
190BASH_CHECK_LIB_TERMCAP
191if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
9255ee31
EZ
192 if test "$prefer_curses" = yes; then
193 TERMCAP_LIB=-lcurses
194 else
195 TERMCAP_LIB=-ltermcap #default
196 fi
d60d9f65 197fi
775e241e 198# Windows ncurses installation
7f3c5ec8
EZ
199if test "$TERMCAP_LIB" = "-lncurses"; then
200 AC_CHECK_HEADERS(ncurses/termcap.h)
201fi
d60d9f65 202
9255ee31
EZ
203BASH_CHECK_MULTIBYTE
204
d60d9f65
SS
205case "$host_cpu" in
206*cray*) LOCAL_CFLAGS=-DCRAY ;;
9255ee31 207*s390*) LOCAL_CFLAGS=-fsigned-char ;;
d60d9f65
SS
208esac
209
210case "$host_os" in
211isc*) LOCAL_CFLAGS=-Disc386 ;;
212esac
213
c862e87b
JM
214# shared library configuration section
215#
216# Shared object configuration section. These values are generated by
217# ${srcdir}/support/shobj-conf
218#
219if test -f ${srcdir}/support/shobj-conf; then
220 AC_MSG_CHECKING(configuration for building shared libraries)
5bdf8622
DJ
221 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
222
223# case "$SHLIB_LIBS" in
224# *curses*|*termcap*|*termlib*) ;;
225# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
226# esac
227
c862e87b
JM
228 AC_SUBST(SHOBJ_CC)
229 AC_SUBST(SHOBJ_CFLAGS)
230 AC_SUBST(SHOBJ_LD)
231 AC_SUBST(SHOBJ_LDFLAGS)
232 AC_SUBST(SHOBJ_XLDFLAGS)
233 AC_SUBST(SHOBJ_LIBS)
234 AC_SUBST(SHOBJ_STATUS)
235 AC_SUBST(SHLIB_STATUS)
236 AC_SUBST(SHLIB_XLDFLAGS)
5bdf8622
DJ
237 AC_SUBST(SHLIB_DOT)
238 AC_SUBST(SHLIB_LIBPREF)
c862e87b
JM
239 AC_SUBST(SHLIB_LIBSUFF)
240 AC_SUBST(SHLIB_LIBVERSION)
5bdf8622 241 AC_SUBST(SHLIB_DLLVERSION)
c862e87b
JM
242 AC_SUBST(SHLIB_LIBS)
243 AC_MSG_RESULT($SHLIB_STATUS)
1b17e766 244
9255ee31
EZ
245 # SHLIB_STATUS is either `supported' or `unsupported'. If it's
246 # `unsupported', turn off any default shared library building
247 if test "$SHLIB_STATUS" = 'unsupported'; then
248 opt_shared_libs=no
249 fi
250
1b17e766
EZ
251 # shared library versioning
252 # quoted for m4 so I can use character classes
253 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
254 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
255 AC_SUBST(SHLIB_MAJOR)
256 AC_SUBST(SHLIB_MINOR)
c862e87b
JM
257fi
258
9255ee31
EZ
259if test "$opt_static_libs" = "yes"; then
260 STATIC_TARGET=static
261 STATIC_INSTALL_TARGET=install-static
262fi
263if test "$opt_shared_libs" = "yes"; then
264 SHARED_TARGET=shared
265 SHARED_INSTALL_TARGET=install-shared
266fi
267
268AC_SUBST(STATIC_TARGET)
269AC_SUBST(SHARED_TARGET)
270AC_SUBST(STATIC_INSTALL_TARGET)
271AC_SUBST(SHARED_INSTALL_TARGET)
272
19ce2a29 273case "$build_os" in
1b17e766
EZ
274msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
275*) BUILD_DIR=`pwd` ;;
276esac
277
5bdf8622
DJ
278case "$BUILD_DIR" in
279*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
280*) ;;
281esac
282
d60d9f65
SS
283AC_SUBST(BUILD_DIR)
284
285AC_SUBST(CFLAGS)
286AC_SUBST(LOCAL_CFLAGS)
287AC_SUBST(LOCAL_LDFLAGS)
288AC_SUBST(LOCAL_DEFS)
289
c862e87b
JM
290AC_SUBST(AR)
291AC_SUBST(ARFLAGS)
292
d60d9f65
SS
293AC_SUBST(host_cpu)
294AC_SUBST(host_os)
295
296AC_SUBST(LIBVERSION)
297
298AC_SUBST(TERMCAP_LIB)
299
775e241e 300AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc],
d60d9f65
SS
301[
302# Makefile uses this timestamp file to record whether config.h is up to date.
303echo > stamp-h
304])
This page took 0.905862 seconds and 4 git commands to generate.