f09f4e57766a986e44e23b05876837d62bdae200
[deliverable/binutils-gdb.git] / readline / configure.in
1 dnl
2 dnl Configure script for readline library
3 dnl
4 dnl report bugs to chet@po.cwru.edu
5 dnl
6 dnl 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
23 AC_REVISION([for Readline 6.2, version 2.67])
24
25 m4_include([../config/override.m4])
26
27 AC_INIT(readline, 6.2, bug-readline@gnu.org)
28
29 dnl make sure we are using a recent autoconf version
30 AC_PREREQ(2.50)
31
32 AC_CONFIG_SRCDIR(readline.h)
33 dnl GDB LOCAL
34 dnl AC_CONFIG_AUX_DIR(./support)
35 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
36 AC_CONFIG_HEADERS(config.h)
37
38 dnl update the value of RL_READLINE_VERSION in readline.h when this changes
39 LIBVERSION=6.2
40
41 AC_CANONICAL_HOST
42
43 dnl configure defaults
44 opt_curses=no
45 opt_purify=no
46
47 dnl arguments to configure
48 AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
49 AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval)
50
51 if test "$opt_curses" = "yes"; then
52 prefer_curses=yes
53 fi
54
55 if test "$opt_purify" = yes; then
56 PURIFY="purify"
57 else
58 PURIFY=
59 fi
60
61 dnl option parsing for optional features
62 opt_multibyte=yes
63 opt_static_libs=yes
64 opt_shared_libs=no
65
66 AC_ARG_ENABLE(multibyte, AC_HELP_STRING([--enable-multibyte], [enable multibyte characters if OS supports them]), opt_multibyte=$enableval)
67 dnl AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
68 AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
69
70 if test $opt_multibyte = no; then
71 AC_DEFINE(NO_MULTIBYTE_SUPPORT)
72 fi
73
74 dnl load up the cross-building cache file -- add more cases and cache
75 dnl files as necessary
76
77 dnl Note that host and target machine are the same, and different than the
78 dnl build machine.
79
80 CROSS_COMPILE=
81 if 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)
102 fi
103
104 echo ""
105 echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
106 echo ""
107
108 # We want these before the checks, so the checks can modify their values.
109 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
110
111 AC_PROG_MAKE_SET
112 AC_PROG_CC
113 dnl AC_AIX
114 AC_MINIX
115
116 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
117 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
118
119 AC_PROG_GCC_TRADITIONAL
120 AC_PROG_INSTALL
121 AC_CHECK_PROG(AR, ar, , ar)
122 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
123 dnl This allows people to set it when running configure or make
124 test -n "$ARFLAGS" || ARFLAGS="cr"
125 AC_PROG_RANLIB
126
127 MAKE_SHELL=/bin/sh
128 AC_SUBST(MAKE_SHELL)
129
130 AC_C_CONST
131 AC_C_PROTOTYPES
132 AC_C_CHAR_UNSIGNED
133 AC_C_VOLATILE
134
135 AC_TYPE_SIGNAL
136
137 AC_TYPE_SIZE_T
138 AC_CHECK_TYPE(ssize_t, int)
139
140 AC_HEADER_STDC
141
142 AC_HEADER_STAT
143 AC_HEADER_DIRENT
144
145 AC_CHECK_FUNCS(fcntl kill lstat)
146 AC_CHECK_FUNCS(memmove putenv select setenv setlocale \
147 strcasecmp strpbrk tcgetattr vsnprintf)
148 AC_CHECK_FUNCS(isascii isxdigit)
149 AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
150
151 AC_FUNC_STRCOLL
152
153 AC_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)
155 AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h)
156
157 AC_CHECK_HEADERS(sys/ptem.h,,,
158 [[
159 #if HAVE_SYS_STREAM_H
160 # include <sys/stream.h>
161 #endif
162 ]])
163
164 AC_SYS_LARGEFILE
165
166 BASH_SYS_SIGNAL_VINTAGE
167 BASH_SYS_REINSTALL_SIGHANDLERS
168
169 BASH_FUNC_POSIX_SETJMP
170 BASH_FUNC_LSTAT
171 BASH_FUNC_STRCOLL
172 BASH_FUNC_CTYPE_NONASCII
173
174 BASH_CHECK_GETPW_FUNCS
175
176 AC_HEADER_TIOCGWINSZ
177
178 BASH_TYPE_SIG_ATOMIC_T
179 BASH_TYPE_SIGHANDLER
180
181 BASH_HAVE_TIOCSTAT
182 BASH_HAVE_FIONREAD
183 BASH_CHECK_SPEED_T
184 BASH_STRUCT_WINSIZE
185 BASH_STRUCT_DIRENT_D_INO
186 BASH_STRUCT_DIRENT_D_FILENO
187
188 dnl yuck
189 case "$host_os" in
190 aix*) prefer_curses=yes ;;
191 esac
192 BASH_CHECK_LIB_TERMCAP
193 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
194 if test "$prefer_curses" = yes; then
195 TERMCAP_LIB=-lcurses
196 else
197 TERMCAP_LIB=-ltermcap #default
198 fi
199 fi
200
201 BASH_CHECK_MULTIBYTE
202
203 case "$host_cpu" in
204 *cray*) LOCAL_CFLAGS=-DCRAY ;;
205 *s390*) LOCAL_CFLAGS=-fsigned-char ;;
206 esac
207
208 case "$host_os" in
209 isc*) LOCAL_CFLAGS=-Disc386 ;;
210 esac
211
212 # shared library configuration section
213 #
214 # Shared object configuration section. These values are generated by
215 # ${srcdir}/support/shobj-conf
216 #
217 if test -f ${srcdir}/support/shobj-conf; then
218 AC_MSG_CHECKING(configuration for building shared libraries)
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
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)
235 AC_SUBST(SHLIB_DOT)
236 AC_SUBST(SHLIB_LIBPREF)
237 AC_SUBST(SHLIB_LIBSUFF)
238 AC_SUBST(SHLIB_LIBVERSION)
239 AC_SUBST(SHLIB_DLLVERSION)
240 AC_SUBST(SHLIB_LIBS)
241 AC_MSG_RESULT($SHLIB_STATUS)
242
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
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)
255 fi
256
257 if test "$opt_static_libs" = "yes"; then
258 STATIC_TARGET=static
259 STATIC_INSTALL_TARGET=install-static
260 fi
261 if test "$opt_shared_libs" = "yes"; then
262 SHARED_TARGET=shared
263 SHARED_INSTALL_TARGET=install-shared
264 fi
265
266 AC_SUBST(STATIC_TARGET)
267 AC_SUBST(SHARED_TARGET)
268 AC_SUBST(STATIC_INSTALL_TARGET)
269 AC_SUBST(SHARED_INSTALL_TARGET)
270
271 case "$host_os" in
272 msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
273 *) BUILD_DIR=`pwd` ;;
274 esac
275
276 case "$BUILD_DIR" in
277 *\ *) BUILD_DIR=`echo "$BUILD_DIR" | sed 's: :\\\\ :g'` ;;
278 *) ;;
279 esac
280
281 AC_SUBST(PURIFY)
282 AC_SUBST(BUILD_DIR)
283
284 AC_SUBST(CFLAGS)
285 AC_SUBST(LOCAL_CFLAGS)
286 AC_SUBST(LOCAL_LDFLAGS)
287 AC_SUBST(LOCAL_DEFS)
288
289 AC_SUBST(AR)
290 AC_SUBST(ARFLAGS)
291
292 AC_SUBST(host_cpu)
293 AC_SUBST(host_os)
294
295 AC_SUBST(LIBVERSION)
296
297 AC_SUBST(TERMCAP_LIB)
298
299 AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
300 [
301 # Makefile uses this timestamp file to record whether config.h is up to date.
302 echo > stamp-h
303 ])
This page took 0.045487 seconds and 3 git commands to generate.