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