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