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