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