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