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