* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct
[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
5bdf8622
DJ
8# Copyright (C) 1987-2005 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 2, or (at your option)
13# 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, write to the Free Software
22# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23# 02111-1307, USA.
24
25AC_REVISION([for Readline 5.1, version 2.59])
26
27AC_INIT(readline, 5.1-release, 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
5bdf8622 39LIBVERSION=5.1
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
80if test "x$cross_compiling" = "xyes"; then
81 case "${host}" in
82 *-cygwin*)
83 cross_cache=${srcdir}/cross-build/cygwin.cache
84 ;;
85 *-mingw*)
86 cross_cache=${srcdir}/cross-build/mingw.cache
87 ;;
88 i[[3456]]86-*-beos*)
89 cross_cache=${srcdir}/cross-build/x86-beos.cache
90 ;;
91 *) echo "configure: cross-compiling for $host is not supported" >&2
92 ;;
93 esac
94 if test -n "${cross_cache}" && test -r "${cross_cache}"; then
95 echo "loading cross-build cache file ${cross_cache}"
96 . ${cross_cache}
97 fi
98 unset cross_cache
99 CROSS_COMPILE='-DCROSS_COMPILING'
100 AC_SUBST(CROSS_COMPILE)
101fi
102
9255ee31
EZ
103echo ""
104echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
105echo ""
106
d60d9f65
SS
107# We want these before the checks, so the checks can modify their values.
108test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
109
9255ee31 110AC_PROG_MAKE_SET
d60d9f65 111AC_PROG_CC
1b17e766 112dnl AC_AIX
d60d9f65
SS
113AC_MINIX
114
d60d9f65 115dnl BEGIN changes for CYGNUS cross-building for Cygwin
5bdf8622
DJ
116dnl NOTE: Some of these changes may no longer be necessary.
117
d60d9f65
SS
118dnl load up the cross-building cache file -- add more cases and cache
119dnl files as necessary
120if test "x$cross_compiling" = "xyes"; then
121 case "${host}" in
122 *-cygwin*)
123 cross_cache=${srcdir}/cross-build/cygwin.cache
d60d9f65 124 LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
d60d9f65 125 ;;
430b7832
MM
126 *-mingw32*)
127 cross_cache=${srcdir}/cross-build/mingw.cache
128 ;;
d60d9f65
SS
129 *) echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
130 ;;
131 esac
430b7832
MM
132
133 if test "x$cross_cache" != "x"; then
134 if test -r "${cross_cache}"; then
135 echo "loading cross-build cache file ${cross_cache}"
136 . ${cross_cache}
137 fi
138 unset cross_cache
139 fi
d60d9f65 140fi
5bdf8622 141
d60d9f65
SS
142if test -z "$CC_FOR_BUILD"; then
143 if test "x$cross_compiling" = "xno"; then
144 CC_FOR_BUILD='$(CC)'
145 else
146 CC_FOR_BUILD=gcc
147 fi
148fi
149AC_SUBST(CC_FOR_BUILD)
150
151dnl END changes for CYGNUS cross-building for Cygwin
152
d60d9f65
SS
153# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
154test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
155
156AC_PROG_GCC_TRADITIONAL
157AC_PROG_INSTALL
9255ee31 158AC_CHECK_PROG(AR, ar, , ar)
c862e87b
JM
159dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
160dnl This allows people to set it when running configure or make
161test -n "$ARFLAGS" || ARFLAGS="cr"
d60d9f65
SS
162AC_PROG_RANLIB
163
c862e87b
JM
164MAKE_SHELL=/bin/sh
165AC_SUBST(MAKE_SHELL)
166
9255ee31
EZ
167AC_C_CONST
168AC_C_PROTOTYPES
169AC_C_CHAR_UNSIGNED
170
171AC_TYPE_SIGNAL
172
173AC_TYPE_SIZE_T
174AC_CHECK_TYPE(ssize_t, int)
d60d9f65 175
5bdf8622
DJ
176AC_HEADER_STDC
177
d60d9f65
SS
178AC_HEADER_STAT
179AC_HEADER_DIRENT
180
5bdf8622
DJ
181AC_CHECK_FUNCS(fcntl kill lstat)
182AC_CHECK_FUNCS(memmove putenv select setenv setlocale \
183 strcasecmp strpbrk tcgetattr vsnprintf)
184AC_CHECK_FUNCS(isascii isxdigit)
185AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
d60d9f65
SS
186
187AC_FUNC_STRCOLL
188
5bdf8622
DJ
189AC_CHECK_HEADERS(fcntl.h unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
190 limits.h locale.h pwd.h memory.h termcap.h termios.h termio.h)
191AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h)
192
193AC_CHECK_HEADERS(sys/ptem.h,,,
194[[
195#if HAVE_SYS_STREAM_H
196# include <sys/stream.h>
197#endif
198]])
d60d9f65 199
9255ee31
EZ
200BASH_SYS_SIGNAL_VINTAGE
201BASH_SYS_REINSTALL_SIGHANDLERS
d60d9f65
SS
202
203BASH_FUNC_POSIX_SETJMP
204BASH_FUNC_LSTAT
d60d9f65 205BASH_FUNC_STRCOLL
5bdf8622 206BASH_FUNC_CTYPE_NONASCII
d60d9f65 207
9255ee31
EZ
208BASH_CHECK_GETPW_FUNCS
209
210AC_HEADER_TIOCGWINSZ
211
d60d9f65 212BASH_TYPE_SIGHANDLER
d60d9f65
SS
213BASH_HAVE_TIOCSTAT
214BASH_HAVE_FIONREAD
9255ee31 215BASH_CHECK_SPEED_T
d60d9f65
SS
216BASH_STRUCT_WINSIZE
217BASH_STRUCT_DIRENT_D_INO
218BASH_STRUCT_DIRENT_D_FILENO
219
220dnl yuck
221case "$host_os" in
222aix*) prefer_curses=yes ;;
223esac
224BASH_CHECK_LIB_TERMCAP
225if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
9255ee31
EZ
226 if test "$prefer_curses" = yes; then
227 TERMCAP_LIB=-lcurses
228 else
229 TERMCAP_LIB=-ltermcap #default
230 fi
d60d9f65
SS
231fi
232
9255ee31
EZ
233BASH_CHECK_MULTIBYTE
234
d60d9f65
SS
235case "$host_cpu" in
236*cray*) LOCAL_CFLAGS=-DCRAY ;;
9255ee31 237*s390*) LOCAL_CFLAGS=-fsigned-char ;;
d60d9f65
SS
238esac
239
240case "$host_os" in
241isc*) LOCAL_CFLAGS=-Disc386 ;;
242esac
243
c862e87b
JM
244# shared library configuration section
245#
246# Shared object configuration section. These values are generated by
247# ${srcdir}/support/shobj-conf
248#
249if test -f ${srcdir}/support/shobj-conf; then
250 AC_MSG_CHECKING(configuration for building shared libraries)
5bdf8622
DJ
251 eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
252
253# case "$SHLIB_LIBS" in
254# *curses*|*termcap*|*termlib*) ;;
255# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
256# esac
257
c862e87b
JM
258 AC_SUBST(SHOBJ_CC)
259 AC_SUBST(SHOBJ_CFLAGS)
260 AC_SUBST(SHOBJ_LD)
261 AC_SUBST(SHOBJ_LDFLAGS)
262 AC_SUBST(SHOBJ_XLDFLAGS)
263 AC_SUBST(SHOBJ_LIBS)
264 AC_SUBST(SHOBJ_STATUS)
265 AC_SUBST(SHLIB_STATUS)
266 AC_SUBST(SHLIB_XLDFLAGS)
5bdf8622
DJ
267 AC_SUBST(SHLIB_DOT)
268 AC_SUBST(SHLIB_LIBPREF)
c862e87b
JM
269 AC_SUBST(SHLIB_LIBSUFF)
270 AC_SUBST(SHLIB_LIBVERSION)
5bdf8622 271 AC_SUBST(SHLIB_DLLVERSION)
c862e87b
JM
272 AC_SUBST(SHLIB_LIBS)
273 AC_MSG_RESULT($SHLIB_STATUS)
1b17e766 274
9255ee31
EZ
275 # SHLIB_STATUS is either `supported' or `unsupported'. If it's
276 # `unsupported', turn off any default shared library building
277 if test "$SHLIB_STATUS" = 'unsupported'; then
278 opt_shared_libs=no
279 fi
280
1b17e766
EZ
281 # shared library versioning
282 # quoted for m4 so I can use character classes
283 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
284 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
285 AC_SUBST(SHLIB_MAJOR)
286 AC_SUBST(SHLIB_MINOR)
c862e87b
JM
287fi
288
9255ee31
EZ
289if test "$opt_static_libs" = "yes"; then
290 STATIC_TARGET=static
291 STATIC_INSTALL_TARGET=install-static
292fi
293if test "$opt_shared_libs" = "yes"; then
294 SHARED_TARGET=shared
295 SHARED_INSTALL_TARGET=install-shared
296fi
297
298AC_SUBST(STATIC_TARGET)
299AC_SUBST(SHARED_TARGET)
300AC_SUBST(STATIC_INSTALL_TARGET)
301AC_SUBST(SHARED_INSTALL_TARGET)
302
1b17e766
EZ
303case "$host_os" in
304msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
305*) BUILD_DIR=`pwd` ;;
306esac
307
5bdf8622
DJ
308case "$BUILD_DIR" in
309*\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
310*) ;;
311esac
312
313AC_SUBST(PURIFY)
d60d9f65
SS
314AC_SUBST(BUILD_DIR)
315
316AC_SUBST(CFLAGS)
317AC_SUBST(LOCAL_CFLAGS)
318AC_SUBST(LOCAL_LDFLAGS)
319AC_SUBST(LOCAL_DEFS)
320
c862e87b
JM
321AC_SUBST(AR)
322AC_SUBST(ARFLAGS)
323
d60d9f65
SS
324AC_SUBST(host_cpu)
325AC_SUBST(host_os)
326
327AC_SUBST(LIBVERSION)
328
329AC_SUBST(TERMCAP_LIB)
330
c862e87b 331AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
d60d9f65
SS
332[
333# Makefile uses this timestamp file to record whether config.h is up to date.
334echo > stamp-h
335])
This page took 0.358127 seconds and 4 git commands to generate.