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