OSDN Git Service

Initial revision
[pf3gnuchains/sourceware.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 2.2, version 2.07, from autoconf version] AC_ACVERSION)
8 LIBVERSION=2.2
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 dnl 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
38 dnl BEGIN changes for CYGNUS cross-building for Cygwin
39  
40 dnl load up the cross-building cache file -- add more cases and cache
41 dnl files as necessary
42 if test "x$cross_compiling" = "xyes"; then
43     case "${host}" in
44     *-cygwin*)
45         cross_cache=${srcdir}/cross-build/cygwin.cache
46         if test -r "${cross_cache}"; then
47             echo "loading cross-build cache file ${cross_cache}"
48             . ${cross_cache}
49         fi
50         LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
51         unset cross_cache
52         ;;
53     *)  echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
54         ;;
55     esac
56 fi
57  
58 if test "x$cross_compiling" = "xyes"; then
59   CROSS_COMPILING_FLAG=-DCROSS_COMPILING
60 else
61   CROSS_COMPILING_FLAG=
62 fi
63 AC_SUBST(CROSS_COMPILING_FLAG)
64  
65 if test -z "$CC_FOR_BUILD"; then
66     if test "x$cross_compiling" = "xno"; then
67         CC_FOR_BUILD='$(CC)'
68     else
69         CC_FOR_BUILD=gcc
70     fi
71 fi
72 AC_SUBST(CC_FOR_BUILD)
73  
74 dnl END changes for CYGNUS cross-building for Cygwin
75
76
77
78 # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
79 test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
80
81 AC_PROG_GCC_TRADITIONAL
82 AC_PROG_INSTALL
83 AC_PROG_RANLIB
84
85 AC_RETSIGTYPE
86
87 AC_HEADER_STAT
88 AC_HEADER_DIRENT
89
90 AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
91
92 AC_FUNC_STRCOLL
93
94 AC_CHECK_HEADERS(unistd.h stdlib.h varargs.h stdarg.h string.h \
95                 sys/ptem.h sys/pte.h sys/stream.h sys/select.h \
96                 termcap.h termios.h termio.h sys/file.h locale.h)
97
98 BASH_SIGNAL_CHECK
99 BASH_REINSTALL_SIGHANDLERS
100
101 BASH_FUNC_POSIX_SETJMP
102 BASH_FUNC_LSTAT
103 BASH_CHECK_GETPW_FUNCS
104 BASH_FUNC_STRCOLL
105
106 BASH_TYPE_SIGHANDLER
107 BASH_HAVE_TIOCGWINSZ
108 BASH_HAVE_TIOCSTAT
109 BASH_HAVE_FIONREAD
110 BASH_MISC_SPEED_T
111 BASH_STRUCT_WINSIZE
112 BASH_STRUCT_DIRENT_D_INO
113 BASH_STRUCT_DIRENT_D_FILENO
114
115 dnl yuck
116 case "$host_os" in
117 aix*)   prefer_curses=yes ;;
118 esac
119 BASH_CHECK_LIB_TERMCAP
120 if test "$TERMCAP_LIB" = "./lib/termcap/libtermcap.a"; then
121         TERMCAP_LIB=-ltermcap   #default
122 fi
123
124 case "$host_cpu" in
125 *cray*) LOCAL_CFLAGS=-DCRAY ;;
126 esac
127
128 case "$host_os" in
129 isc*)   LOCAL_CFLAGS=-Disc386 ;;
130 esac
131
132 BUILD_DIR=`pwd`
133 AC_SUBST(BUILD_DIR)
134
135 AC_SUBST(CFLAGS)
136 AC_SUBST(LOCAL_CFLAGS)
137 AC_SUBST(LOCAL_LDFLAGS)
138 AC_SUBST(LOCAL_DEFS)
139
140 AC_SUBST(host_cpu)
141 AC_SUBST(host_os)
142
143 AC_SUBST(LIBVERSION)
144
145 AC_SUBST(TERMCAP_LIB)
146
147 AC_OUTPUT([Makefile doc/Makefile examples/Makefile],
148 [
149 # Makefile uses this timestamp file to record whether config.h is up to date.
150 echo > stamp-h
151 ])