* config/cygwin.cache: Prime mbstate_t.
[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.
9255ee31 7AC_REVISION([for Readline 4.3, version 2.45, from autoconf version] AC_ACVERSION)
d60d9f65 8
9255ee31 9AC_INIT(readline, 4.3, bug-readline@gnu.org)
d60d9f65
SS
10
11dnl make sure we are using a recent autoconf version
9255ee31 12AC_PREREQ(2.50)
d60d9f65 13
9255ee31 14AC_CONFIG_SRCDIR(readline.h)
d60d9f65 15dnl AC_CONFIG_AUX_DIR(./support)
9255ee31
EZ
16AC_CONFIG_HEADERS(config.h)
17
18dnl update the value of RL_READLINE_VERSION in readline.h when this changes
19LIBVERSION=4.3
d60d9f65
SS
20
21AC_CANONICAL_HOST
22
23dnl configure defaults
24opt_curses=no
d60d9f65
SS
25
26dnl arguments to configure
9255ee31 27AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
d60d9f65
SS
28
29if test "$opt_curses" = "yes"; then
30 prefer_curses=yes
31fi
32
9255ee31
EZ
33dnl option parsing for optional features
34opt_static_libs=yes
35opt_shared_libs=yes
36
37AC_ARG_ENABLE(shared, AC_HELP_STRING([--enable-shared], [build shared libraries [[default=YES]]]), opt_shared_libs=$enableval)
38AC_ARG_ENABLE(static, AC_HELP_STRING([--enable-static], [build static libraries [[default=YES]]]), opt_static_libs=$enableval)
39
40echo ""
41echo "Beginning configuration for readline-$LIBVERSION for ${host_cpu}-${host_vendor}-${host_os}"
42echo ""
43
d60d9f65
SS
44# We want these before the checks, so the checks can modify their values.
45test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
46
9255ee31 47AC_PROG_MAKE_SET
d60d9f65 48AC_PROG_CC
1b17e766 49dnl AC_AIX
d60d9f65
SS
50AC_MINIX
51
d60d9f65
SS
52dnl BEGIN changes for CYGNUS cross-building for Cygwin
53
54dnl load up the cross-building cache file -- add more cases and cache
55dnl files as necessary
56if test "x$cross_compiling" = "xyes"; then
57 case "${host}" in
58 *-cygwin*)
59 cross_cache=${srcdir}/cross-build/cygwin.cache
60 if test -r "${cross_cache}"; then
61 echo "loading cross-build cache file ${cross_cache}"
62 . ${cross_cache}
63 fi
64 LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
65 unset cross_cache
66 ;;
67 *) echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
68 ;;
69 esac
70fi
71
72if test "x$cross_compiling" = "xyes"; then
73 CROSS_COMPILING_FLAG=-DCROSS_COMPILING
74else
75 CROSS_COMPILING_FLAG=
76fi
77AC_SUBST(CROSS_COMPILING_FLAG)
78
79if test -z "$CC_FOR_BUILD"; then
80 if test "x$cross_compiling" = "xno"; then
81 CC_FOR_BUILD='$(CC)'
82 else
83 CC_FOR_BUILD=gcc
84 fi
85fi
86AC_SUBST(CC_FOR_BUILD)
87
88dnl END changes for CYGNUS cross-building for Cygwin
89
d60d9f65
SS
90# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
91test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
92
93AC_PROG_GCC_TRADITIONAL
94AC_PROG_INSTALL
9255ee31 95AC_CHECK_PROG(AR, ar, , ar)
c862e87b
JM
96dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
97dnl This allows people to set it when running configure or make
98test -n "$ARFLAGS" || ARFLAGS="cr"
d60d9f65
SS
99AC_PROG_RANLIB
100
c862e87b
JM
101MAKE_SHELL=/bin/sh
102AC_SUBST(MAKE_SHELL)
103
9255ee31
EZ
104AC_C_CONST
105AC_C_PROTOTYPES
106AC_C_CHAR_UNSIGNED
107
108AC_TYPE_SIGNAL
109
110AC_TYPE_SIZE_T
111AC_CHECK_TYPE(ssize_t, int)
d60d9f65
SS
112
113AC_HEADER_STAT
114AC_HEADER_DIRENT
115
1b17e766 116AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
9255ee31 117 strcasecmp strpbrk tcgetattr vsnprintf isascii isxdigit)
d60d9f65
SS
118
119AC_FUNC_STRCOLL
120
9255ee31
EZ
121AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h strings.h \
122 limits.h sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
123 termcap.h termios.h termio.h sys/file.h locale.h memory.h )
d60d9f65 124
9255ee31
EZ
125BASH_SYS_SIGNAL_VINTAGE
126BASH_SYS_REINSTALL_SIGHANDLERS
d60d9f65
SS
127
128BASH_FUNC_POSIX_SETJMP
129BASH_FUNC_LSTAT
d60d9f65
SS
130BASH_FUNC_STRCOLL
131
9255ee31
EZ
132BASH_CHECK_GETPW_FUNCS
133
134AC_HEADER_TIOCGWINSZ
135
d60d9f65 136BASH_TYPE_SIGHANDLER
d60d9f65
SS
137BASH_HAVE_TIOCSTAT
138BASH_HAVE_FIONREAD
9255ee31 139BASH_CHECK_SPEED_T
d60d9f65
SS
140BASH_STRUCT_WINSIZE
141BASH_STRUCT_DIRENT_D_INO
142BASH_STRUCT_DIRENT_D_FILENO
143
144dnl yuck
145case "$host_os" in
146aix*) prefer_curses=yes ;;
147esac
148BASH_CHECK_LIB_TERMCAP
149if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
9255ee31
EZ
150 if test "$prefer_curses" = yes; then
151 TERMCAP_LIB=-lcurses
152 else
153 TERMCAP_LIB=-ltermcap #default
154 fi
d60d9f65
SS
155fi
156
9255ee31
EZ
157BASH_CHECK_MULTIBYTE
158
d60d9f65
SS
159case "$host_cpu" in
160*cray*) LOCAL_CFLAGS=-DCRAY ;;
9255ee31 161*s390*) LOCAL_CFLAGS=-fsigned-char ;;
d60d9f65
SS
162esac
163
164case "$host_os" in
165isc*) LOCAL_CFLAGS=-Disc386 ;;
166esac
167
c862e87b
JM
168# shared library configuration section
169#
170# Shared object configuration section. These values are generated by
171# ${srcdir}/support/shobj-conf
172#
173if test -f ${srcdir}/support/shobj-conf; then
174 AC_MSG_CHECKING(configuration for building shared libraries)
1b17e766 175 eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
c862e87b
JM
176 AC_SUBST(SHOBJ_CC)
177 AC_SUBST(SHOBJ_CFLAGS)
178 AC_SUBST(SHOBJ_LD)
179 AC_SUBST(SHOBJ_LDFLAGS)
180 AC_SUBST(SHOBJ_XLDFLAGS)
181 AC_SUBST(SHOBJ_LIBS)
182 AC_SUBST(SHOBJ_STATUS)
183 AC_SUBST(SHLIB_STATUS)
184 AC_SUBST(SHLIB_XLDFLAGS)
185 AC_SUBST(SHLIB_LIBSUFF)
186 AC_SUBST(SHLIB_LIBVERSION)
187 AC_SUBST(SHLIB_LIBS)
188 AC_MSG_RESULT($SHLIB_STATUS)
1b17e766 189
9255ee31
EZ
190 # SHLIB_STATUS is either `supported' or `unsupported'. If it's
191 # `unsupported', turn off any default shared library building
192 if test "$SHLIB_STATUS" = 'unsupported'; then
193 opt_shared_libs=no
194 fi
195
1b17e766
EZ
196 # shared library versioning
197 # quoted for m4 so I can use character classes
198 SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
199 SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
200 AC_SUBST(SHLIB_MAJOR)
201 AC_SUBST(SHLIB_MINOR)
c862e87b
JM
202fi
203
9255ee31
EZ
204if test "$opt_static_libs" = "yes"; then
205 STATIC_TARGET=static
206 STATIC_INSTALL_TARGET=install-static
207fi
208if test "$opt_shared_libs" = "yes"; then
209 SHARED_TARGET=shared
210 SHARED_INSTALL_TARGET=install-shared
211fi
212
213AC_SUBST(STATIC_TARGET)
214AC_SUBST(SHARED_TARGET)
215AC_SUBST(STATIC_INSTALL_TARGET)
216AC_SUBST(SHARED_INSTALL_TARGET)
217
1b17e766
EZ
218case "$host_os" in
219msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
220*) BUILD_DIR=`pwd` ;;
221esac
222
d60d9f65
SS
223AC_SUBST(BUILD_DIR)
224
225AC_SUBST(CFLAGS)
226AC_SUBST(LOCAL_CFLAGS)
227AC_SUBST(LOCAL_LDFLAGS)
228AC_SUBST(LOCAL_DEFS)
229
c862e87b
JM
230AC_SUBST(AR)
231AC_SUBST(ARFLAGS)
232
d60d9f65
SS
233AC_SUBST(host_cpu)
234AC_SUBST(host_os)
235
236AC_SUBST(LIBVERSION)
237
238AC_SUBST(TERMCAP_LIB)
239
c862e87b 240AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
d60d9f65
SS
241[
242# Makefile uses this timestamp file to record whether config.h is up to date.
243echo > stamp-h
244])
This page took 0.158912 seconds and 4 git commands to generate.