Import of readline 4.0
[external/binutils.git] / readline / configure.in
1 dnl
2 dnl Configure script for readline library
3 dnl
4 dnl report bugs to chet@po.cwru.edu
5 dnl
6 dnl Process this file with autoconf to produce a configure script.
7 AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
8 LIBVERSION=4.0
9
10 AC_INIT(readline.h)
11 AC_CONFIG_HEADER(config.h)
12
13 dnl make sure we are using a recent autoconf version
14 AC_PREREQ(2.10)
15
16 AC_CONFIG_AUX_DIR(./support)
17
18 AC_CANONICAL_HOST
19
20 dnl configure defaults
21 opt_curses=no
22 opt_shared=no
23
24 dnl arguments to configure
25 AC_ARG_WITH(curses, --with-curses               use the curses library instead of the termcap library,opt_curses=$withval)
26
27 if test "$opt_curses" = "yes"; then
28         prefer_curses=yes
29 fi
30
31 # We want these before the checks, so the checks can modify their values.
32 test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
33
34 AC_PROG_CC
35 AC_MINIX
36
37 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
38 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
39
40 AC_PROG_GCC_TRADITIONAL
41 AC_PROG_INSTALL
42 AC_CHECK_PROG(AR, ar, ar)
43 dnl Set default for ARFLAGS, since autoconf does not have a macro for it.
44 dnl This allows people to set it when running configure or make
45 test -n "$ARFLAGS" || ARFLAGS="cr"
46 AC_PROG_RANLIB
47
48 MAKE_SHELL=/bin/sh
49 AC_SUBST(MAKE_SHELL)
50
51 AC_RETSIGTYPE
52
53 AC_HEADER_STAT
54 AC_HEADER_DIRENT
55
56 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
57
58 AC_FUNC_STRCOLL
59
60 AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \
61                 sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
62                 termcap.h termios.h termio.h sys/file.h locale.h)
63
64 BASH_SIGNAL_CHECK
65 BASH_REINSTALL_SIGHANDLERS
66
67 BASH_FUNC_POSIX_SETJMP
68 BASH_FUNC_LSTAT
69 BASH_CHECK_GETPW_FUNCS
70 BASH_FUNC_STRCOLL
71
72 BASH_TYPE_SIGHANDLER
73 BASH_HAVE_TIOCGWINSZ
74 BASH_HAVE_TIOCSTAT
75 BASH_HAVE_FIONREAD
76 BASH_MISC_SPEED_T
77 BASH_STRUCT_WINSIZE
78 BASH_STRUCT_DIRENT_D_INO
79 BASH_STRUCT_DIRENT_D_FILENO
80
81 dnl yuck
82 case "$host_os" in
83 aix*)   prefer_curses=yes ;;
84 esac
85 BASH_CHECK_LIB_TERMCAP
86 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
87         TERMCAP_LIB=-ltermcap   #default
88 fi
89
90 case "$host_cpu" in
91 *cray*) LOCAL_CFLAGS=-DCRAY ;;
92 esac
93
94 case "$host_os" in
95 isc*)   LOCAL_CFLAGS=-Disc386 ;;
96 esac
97
98 # shared library configuration section
99 #
100 # Shared object configuration section.  These values are generated by
101 # ${srcdir}/support/shobj-conf
102 #
103 if test -f ${srcdir}/support/shobj-conf; then
104         AC_MSG_CHECKING(configuration for building shared libraries)
105         eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
106         AC_SUBST(SHOBJ_CC)
107         AC_SUBST(SHOBJ_CFLAGS)
108         AC_SUBST(SHOBJ_LD)
109         AC_SUBST(SHOBJ_LDFLAGS)
110         AC_SUBST(SHOBJ_XLDFLAGS)
111         AC_SUBST(SHOBJ_LIBS)
112         AC_SUBST(SHOBJ_STATUS)
113         AC_SUBST(SHLIB_STATUS)
114         AC_SUBST(SHLIB_XLDFLAGS)
115         AC_SUBST(SHLIB_LIBSUFF)
116         AC_SUBST(SHLIB_LIBVERSION)
117         AC_SUBST(SHLIB_LIBS)
118         AC_MSG_RESULT($SHLIB_STATUS)
119 fi
120
121 BUILD_DIR=`pwd`
122 AC_SUBST(BUILD_DIR)
123
124 AC_SUBST(CFLAGS)
125 AC_SUBST(LOCAL_CFLAGS)
126 AC_SUBST(LOCAL_LDFLAGS)
127 AC_SUBST(LOCAL_DEFS)
128
129 AC_SUBST(AR)
130 AC_SUBST(ARFLAGS)
131
132 AC_SUBST(host_cpu)
133 AC_SUBST(host_os)
134
135 AC_SUBST(LIBVERSION)
136
137 AC_SUBST(TERMCAP_LIB)
138
139 AC_OUTPUT([Makefile doc/Makefile examples/Makefile shlib/Makefile],
140 [
141 # Makefile uses this timestamp file to record whether config.h is up to date.
142 echo > stamp-h
143 ])