comparison configure.in @ 405:fa84be0c4fed

[project @ 1994-04-20 05:53:20 by jwe]
author jwe
date Wed, 20 Apr 1994 05:53:20 +0000
parents 431896eee4db
children 2788276104a0
comparison
equal deleted inserted replaced
404:54741230fb83 405:fa84be0c4fed
1 dnl configure.in
2 dnl
1 dnl Process this file with autoconf to produce a configure script. 3 dnl Process this file with autoconf to produce a configure script.
2 dnl 4 dnl Requires GNU autoconf 1.8 or later.
3 AC_INIT([[src]]/octave.cc)dnl 5 dnl
6 dnl Copyright (C) 1992, 1993, 1994 John W. Eaton
7 dnl
8 dnl This file is part of Octave.
9 dnl
10 dnl Octave is free software; you can redistribute it and/or modify it
11 dnl under the terms of the GNU General Public License as published by the
12 dnl Free Software Foundation; either version 2, or (at your option) any
13 dnl later version.
14 dnl
15 dnl Octave is distributed in the hope that it will be useful, but WITHOUT
16 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 dnl for more details.
19 dnl
20 dnl You should have received a copy of the GNU General Public License
21 dnl along with Octave; see the file COPYING. If not, write to the Free
22 dnl Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23 dnl
24 AC_REVISION($Id: configure.in,v 1.27 1994-04-20 05:53:20 jwe Exp $)dnl
25 AC_PREREQ(1.8)dnl
26 AC_INIT(src/octave.cc)
4 AC_CONFIG_HEADER(config.h)dnl 27 AC_CONFIG_HEADER(config.h)dnl
5 dnl 28 dnl
6 root_srcdir=$srcdir
7 AC_SUBST(root_srcdir)dnl
8 dnl
9 AC_DEFINE(OCTAVE_SOURCE, 1)dnl 29 AC_DEFINE(OCTAVE_SOURCE, 1)dnl
10 dnl 30 dnl
11 dnl See if we were given the target host type. If not, guess. 31 dnl See if we were given the target host type. If not, use
32 dnl config.guess to try to guess the target host type.
12 dnl 33 dnl
13 if test $# -gt 0; then 34 if test $# -gt 0; then
14 TARGET=`eval echo $\{\`echo $#\`\}` 35 TARGET=`eval echo $\{\`echo $#\`\}`
15 case $TARGET in 36 case $TARGET in
16 -*) target_host_type= ;; 37 -*)
17 *) target_host_type=$TARGET ;; 38 target_host_type=
39 ;;
40 *)
41 target_host_type=$TARGET
42 ;;
18 esac 43 esac
19 fi 44 fi
20 dnl 45 dnl
21 if test -z "$target_host_type" -o "$target_host_type" = unknown; then 46 if test -z "$target_host_type" -o "$target_host_type" = unknown; then
22 target_host_type=`sh $srcdir/config.guess` 47 target_host_type=`sh $srcdir/config.guess`
23 if test -z "$target_host_type"; then 48 if test -z "$target_host_type"; then
24 echo "warning: unable to guess system type" 49 AC_WARN([unable to guess system type])
25 target_host_type=unknown 50 target_host_type=unknown
26 fi 51 fi
27 fi 52 fi
53 dnl
54 dnl Use config.sub to come up with a standard vendor-host-os triple.
28 dnl 55 dnl
29 canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1` 56 canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1`
30 status=$? 57 status=$?
31 if test $status -eq 0; then 58 if test $status -eq 0; then
32 echo "configuring Octave for a $target_host_type" 59 echo "configuring Octave for a $target_host_type"
33 else 60 else
34 canonical_host_type=unknown 61 canonical_host_type=unknown
35 echo "configuring Octave for an unknown system type" 62 AC_WARN([configuring Octave for an unknown system type])
36 fi 63 fi
37 AC_SUBST(target_host_type)dnl 64 AC_SUBST(target_host_type)dnl
38 dnl 65 AC_VERBOSE([target_host_type is $target_host_type])
39 dnl Set up to handle --with-FOO options. 66 AC_VERBOSE([canonical_host_type is $canonical_host_type])
67 dnl
68 dnl Allow the user to force us to use f2c.
40 dnl 69 dnl
41 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl 70 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl
42 AC_WITH(dld, use_dld=true, use_dld=false)dnl 71 dnl
72 dnl Allow the user to experiment with dynamic linking using GNU dld.
73 dnl
74 AC_ENABLE(dld, use_dld=true, use_dld=false)dnl
43 dnl 75 dnl
44 DYNAMIC_LD_OBJ= 76 DYNAMIC_LD_OBJ=
45 DLD_DIR= 77 DLD_DIR=
46 LIBDLD= 78 LIBDLD=
47 DLD_OBJECTS='$(DLD_OBJECTS)' 79 DLD_OBJECTS='$(DLD_OBJECTS)'
48 LD_STATIC_FLAG= 80 LD_STATIC_FLAG=
49 if $use_dld; then 81 if $use_dld; then
50 DYNAMIC_LD_OBJ='dynamic-ld.o' 82 DYNAMIC_LD_OBJ='dynamic-ld.o'
83 AC_VERBOSE([setting DYNAMIC_LD_OBJ to $DYNAMIC_LD_OBJ])
51 DLD_DIR=dld 84 DLD_DIR=dld
85 AC_VERBOSE([setting DLD_DIR to $DLD_DIR])
52 LIBDLD='../libdld.a' 86 LIBDLD='../libdld.a'
87 AC_VERBOSE([setting LIBDLD to $LIBDLD])
53 DLD_OBJECTS= : # don't link them in if doing dynamic linking 88 DLD_OBJECTS= : # don't link them in if doing dynamic linking
89 AC_VERBOSE([setting DLD_OBJECTS to $DLD_OBJECTS])
90 LD_STATIC_FLAG=-static
91 AC_VERBOSE([setting LD_STATIC_FLAG to $LD_STATIC_FLAG])
54 AC_DEFINE(WITH_DLD, 1)dnl 92 AC_DEFINE(WITH_DLD, 1)dnl
55 LD_STATIC_FLAG=-static
56 fi 93 fi
57 AC_SUBST(DYNAMIC_LD_OBJ)dnl 94 AC_SUBST(DYNAMIC_LD_OBJ)dnl
58 AC_SUBST(DLD_DIR)dnl 95 AC_SUBST(DLD_DIR)dnl
59 AC_SUBST(LIBDLD)dnl 96 AC_SUBST(LIBDLD)dnl
60 AC_SUBST(DLD_OBJECTS)dnl 97 AC_SUBST(DLD_OBJECTS)dnl
61 AC_SUBST(LD_STATIC_FLAG)dnl 98 AC_SUBST(LD_STATIC_FLAG)dnl
62 dnl 99 dnl
63 echo "checking for npsol" 100 dnl See if the optional nonlinear programming code is present.
101 dnl
102 AC_CHECKING([for npsol])
64 if test -f $srcdir/libcruft/npsol/npsol.f; then 103 if test -f $srcdir/libcruft/npsol/npsol.f; then
65 : 104 :
66 else 105 else
67 AC_DEFINE(NPSOL_MISSING, 1)dnl 106 AC_DEFINE(NPSOL_MISSING, 1)dnl
68 fi 107 fi
69 dnl 108 dnl
70 echo "checking for qpsol" 109 AC_CHECKING([for qpsol])
71 if test -f $srcdir/libcruft/qpsol/qpsol.f; then 110 if test -f $srcdir/libcruft/qpsol/qpsol.f; then
72 : 111 :
73 else 112 else
74 AC_DEFINE(QPSOL_MISSING, 1)dnl 113 AC_DEFINE(QPSOL_MISSING, 1)dnl
75 fi 114 fi
76 dnl 115 dnl
77 echo "checking for fsqp" 116 AC_CHECKING([for fsqp])
78 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then 117 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then
79 : 118 :
80 else 119 else
81 AC_DEFINE(FSQP_MISSING, 1)dnl 120 AC_DEFINE(FSQP_MISSING, 1)dnl
82 fi 121 fi
83 dnl 122 dnl
123 dnl See which C++ compiler to use (we expect to find g++).
124 dnl
125 AC_PROG_CXX
126 AC_PROG_CXXCPP
127 dnl
128 dnl Do special things for g++.
129 dnl
130 ADD_CXX_WALL=false
131 gxx_version=`$CXX -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'`
132 case "$gxx_version" in
133 2.5.*|2.6.*|2.7.*|2.8.*|2.9.*)
134 CXXFLAGS="-g -O"
135 AC_VERBOSE([setting CXXFLAGS to $CXXFLAGS])
136 EXTERNAL_TEMPLATES="-fexternal-templates"
137 AC_VERBOSE([setting EXTERNAL_TEMPLATES to $EXTERNAL_TEMPLATES])
138 ADD_CXX_WALL=true
139 AC_DEFINE(USE_EXTERNAL_TEMPLATES, 1)dnl
140 ;;
141 1.*)
142 AC_WARN([g++ version $gxx_version will not work to compile Octave])
143 ;;
144 *)
145 AC_WARN([Octave has only been tested with g++, and I can't find it])
146 ;;
147 esac
148 dnl
149 AC_SUBST(CXXFLAGS)dnl
150 AC_SUBST(EXTERNAL_TEMPLATES)dnl
151 dnl
152 dnl See which C compiler to use (we expect to find gcc).
153 dnl
84 AC_PROG_CC 154 AC_PROG_CC
155 AC_PROG_CPP
85 AC_GCC_TRADITIONAL 156 AC_GCC_TRADITIONAL
86 AC_MINIX
87 AC_ISC_POSIX
88 AC_AIX
89 AC_DYNIX_SEQ
90 AC_ALLOCA
91 AC_CONST
92 dnl 157 dnl
93 dnl Do special things for gcc. 158 dnl Do special things for gcc.
94 dnl 159 dnl
95 case "$CC" in 160 ADD_CC_WALL=false
96 gcc* | */gcc*) 161 gcc_version=`$CC -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'`
97 CFLAGS="-g -O -Wall" 162 case "$gcc_version" in
163 2.*)
164 CFLAGS="-g -O"
165 AC_VERBOSE([setting CFLAGS to $CFLAGS])
98 LDFLAGS="-g -O" 166 LDFLAGS="-g -O"
99 gcc_version=`gcc -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` 167 AC_VERBOSE([setting LDFLAGS to $LDFLAGS])
100 case "$gcc_version" in 168 ADD_CC_WALL=true
101 1.*) 169 ;;
102 cat << EOF 170 1.*)
103 warning: gcc version $gcc_version is likely to cause problems -- 171 AC_WARN([gcc version $gcc_version is likely to cause problems])
104 you should probably consider getting version 2.x 172 ;;
105 EOF 173 *)
106 ;; 174 AC_WARN([Octave has only been tested with gcc, and I can't find it])
107 esac 175 ;;
108 ;; 176 esac
109 *) 177 dnl
110 cat << EOF
111 warning: found environment variable CC = \`$CC'. If this is not a
112 derivative of GCC, you should probably consider using GCC
113 version 2.x instead.
114 EOF
115 CFLAGS="-g"
116 LDFLAGS="-g"
117 ;;
118 esac
119 AC_SUBST(CFLAGS)dnl 178 AC_SUBST(CFLAGS)dnl
120 AC_SUBST(LDFLAGS)dnl 179 AC_SUBST(LDFLAGS)dnl
121 dnl 180 dnl
122 AC_PROGRAM_CHECK(CXX, g++, g++, [])dnl 181 dnl On Linux systems we need to compile with -mieee-fp to get full
123 if test "$CXX" = g++ ; then 182 dnl support for IEEE floating point.
124 CXXFLAGS="-g -O -Wall"
125 gxx_version=`g++ -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'`
126 case "$gxx_version" in
127 1.*)
128 cat << EOF
129 warning: g++ version $gxx_version is likely to cause problems --
130 you should probably consider getting version 2.x
131 EOF
132 ;;
133 2.5.*|2.6.*|2.7.*|2.8.*|2.9.*)
134 EXTERNAL_TEMPLATES="-fexternal-templates"
135 AC_DEFINE(USE_EXTERNAL_TEMPLATES, 1)dnl
136 ;;
137 esac
138 else
139 cat << EOF
140 warning: Octave has only been tested with g++, and I can't
141 seem to find it.
142 EOF
143 fi
144 AC_SUBST(CXXFLAGS)dnl
145 AC_SUBST(EXTERNAL_TEMPLATES)dnl
146 dnl 183 dnl
147 case "$canonical_host_type" in 184 case "$canonical_host_type" in
148 i386-*-linux | i486-*-linux | i586-*-linux) 185 i386-*-linux | i486-*-linux | i586-*-linux)
149 GCC_IEEE_FP_FLAG="-mieee-fp" 186 GCC_IEEE_FP_FLAG="-mieee-fp"
150 ;; 187 AC_VERBOSE([setting GCC_IEEE_FP_FLAG to $GCC_IEEE_FP_FLAG])
151 esac 188 ;;
189 esac
190 dnl
152 AC_SUBST(GCC_IEEE_FP_FLAG)dnl 191 AC_SUBST(GCC_IEEE_FP_FLAG)dnl
192 dnl
193 dnl Special checks for odd OS specific things.
194 dnl
195 AC_ISC_POSIX
196 AC_MINIX
197 AC_AIX
198 AC_DYNIX_SEQ
199 AC_IRIX_SUN
200 AC_SCO_INTL
201 AC_XENIX_DIR
202 dnl
203 dnl Does the C compiler handle alloca() and const correctly?
204 dnl
205 AC_ALLOCA
206 AC_CONST
153 dnl 207 dnl
154 dnl If we haven't been forced to use f2c, try to find a Fortran compiler 208 dnl If we haven't been forced to use f2c, try to find a Fortran compiler
155 dnl under any one of several common Un*x Fortran compiler names. 209 dnl under any one of several common Un*x Fortran compiler names.
156 dnl Put fc last to avoid confusion with some vendor's /bin/sh fc 210 dnl Put fc last to avoid confusion with some vendor's /bin/sh fc
157 dnl builtin. 211 dnl builtin.
158 dnl 212 dnl
159 dnl xlf : IBM / AIX 213 dnl xlf : IBM / AIX
160 dnl cf77 : Cray / Unicos 214 dnl cf77 : Cray / Unicos
215 dnl g77 : GNU Fortran (someday...)
161 dnl fc : Convex 216 dnl fc : Convex
162 dnl g77 : GNU Fortran (someday...)
163 dnl 217 dnl
164 dnl I don't think the Cray compiler will ever work like f2c... 218 dnl I don't think the Cray compiler will ever work like f2c...
165 dnl 219 dnl
166 if $use_f2c; then 220 if $use_f2c; then
167 true 221 true
168 else 222 else
169 F77= 223 F77=
170 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 fc g77)dnl 224 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 g77 fc)dnl
171 225
172 # If it looks like we have a Fortran compiler, try to determine 226 # If it looks like we have a Fortran compiler, try to determine
173 # whether it might be compatible with f2c. 227 # whether it might be compatible with f2c.
174 228
175 if test -n "$F77"; then 229 if test -n "$F77"; then
176 echo "checking $F77/f2c compatibility" 230 AC_CHECKING([$F77/f2c compatibility])
177 export F77 231 export F77
178 export CC 232 export CC
179 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` 233 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh`
180 status=$? 234 status=$?
181 if test $status -eq 0; then 235 if test $status -eq 0; then
194 if test -z "$F77"; then 248 if test -z "$F77"; then
195 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl 249 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl
196 fi 250 fi
197 dnl 251 dnl
198 F2CFLAGS= 252 F2CFLAGS=
253 AC_VERBOSE([setting F2CFLAGS to $F2CFLAGS])
199 FFLAGS="-O" 254 FFLAGS="-O"
255 AC_VERBOSE([setting FFLAGS to $FFLAGS])
200 if test -n "$F77"; then 256 if test -n "$F77"; then
201 export F77 257 export F77
202 FLIBS=`sh $srcdir/flibs.sh` 258 FLIBS=`sh $srcdir/flibs.sh`
259 AC_VERBOSE([setting FLIBS to $FLIBS])
203 DOT_O_DOT_F_C1= 260 DOT_O_DOT_F_C1=
204 DOT_O_DOT_F_C2= 261 DOT_O_DOT_F_C2=
205 DOT_O_DOT_F_C3= 262 DOT_O_DOT_F_C3=
206 DOT_O_DOT_F_C4= 263 DOT_O_DOT_F_C4=
207 DEFAULT_DOT_C_FROM_DOT_F= 264 DEFAULT_DOT_C_FROM_DOT_F=
213 if test -n "$FLIBS" ; then 270 if test -n "$FLIBS" ; then
214 AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl 271 AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl
215 fi 272 fi
216 fi 273 fi
217 if test -z "$FLIBS" ; then 274 if test -z "$FLIBS" ; then
218 cat << EOF 275 AC_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a])
219 warning: I found f2c but I couldn't find libf2c.a, or
220 libF77.a and libI77.a
221 EOF
222 fi 276 fi
223 DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\ 277 DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\
224 # If we are using f2c we should also turn off the default rule for\ 278 # If we are using f2c we should also turn off the default rule for\
225 # making objects from .f files so that we do not invoke the fortran\ 279 # making objects from .f files so that we do not invoke the fortran\
226 # compiler by mistake.\ 280 # compiler by mistake.\
227 \ 281 \
228 \%.c : \%.f\ 282 \%.c : \%.f\
229 cat $< | $(F2C) $(F2CFLAGS) > $(@F)' 283 cat $< | $(F2C) $(F2CFLAGS) > $(@F)'
284 AC_VERBOSE([setting DEFAULT_DOT_C_FROM_DOT_F to $DEFAULT_DOT_C_FROM_DOT_F])
230 DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f' 285 DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f'
286 AC_VERBOSE([setting DEFAULT_DOT_O_FROM_DOT_F to $DEFAULT_DOT_O_FROM_DOT_F])
231 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl 287 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl
232 else 288 else
233 cat << EOF 289 AC_WARN([in order to build octave, you must have a compatible])
234 warning: in order to build octave, you must have a compatible 290 AC_WARN([Fortran compiler or f2c installed and in your path.])
235 Fortran compiler or f2c installed and in your path. 291 AC_WARN([See the file INSTALL for more information.])
236 See the file INSTALL for more information. 292 AC_WARN([Continuing anyway...])
237 Continuing anyway...
238 EOF
239 fi 293 fi
240 dnl 294 dnl
241 AC_SUBST(FFLAGS)dnl 295 AC_SUBST(FFLAGS)dnl
242 AC_SUBST(FLIBS)dnl 296 AC_SUBST(FLIBS)dnl
243 AC_SUBST(F2C)dnl 297 AC_SUBST(F2C)dnl
244 AC_SUBST(F2CFLAGS)dnl 298 AC_SUBST(F2CFLAGS)dnl
245 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl 299 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl
246 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl 300 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl
247 dnl 301 dnl
248 AC_PROG_INSTALL 302 dnl Checks for header files.
249 AC_PROG_RANLIB 303 dnl
250 AC_STDC_HEADERS 304 AC_STDC_HEADERS
251 AC_HAVE_HEADERS(string.h varargs.h unistd.h floatingpoint.h)dnl 305 AC_HAVE_HEADERS(string.h varargs.h unistd.h floatingpoint.h)dnl
252 AC_HAVE_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h)dnl 306 AC_HAVE_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h)dnl
253 AC_HAVE_HEADERS(sys/ttold.h sys/ptem.h sys/select.h)dnl 307 AC_HAVE_HEADERS(sys/ttold.h sys/ptem.h sys/select.h)dnl
254 AC_DIR_HEADER 308 AC_DIR_HEADER
309 dnl
310 dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips
311 dnl binary to an Alpha binary will work.
312 dnl
313 case "$canonical_host_type" in
314 mips-dec-ultrix*)
315 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])
316 ;;
317 esac
318 dnl
319 case "$DEFS" in
320 *HAVE_SGTTY_H*)
321 ;;
322 *)
323 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1),
324 AC_HEADER_CHECK(termio.h, AC_DEFINE(HAVE_TERMIO_H, 1),
325 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])))
326 ;;
327 esac
328 case "$DEFS" in
329 *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*)
330 ;;
331 *)
332 AC_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!])
333 ;;
334 esac
335 dnl
336 dnl Checks for functions.
337 dnl
255 AC_HAVE_FUNCS(setvbuf getcwd gethostname bzero rindex vfprintf vsprintf)dnl 338 AC_HAVE_FUNCS(setvbuf getcwd gethostname bzero rindex vfprintf vsprintf)dnl
256 AC_HAVE_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror)dnl 339 AC_HAVE_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror)dnl
257 AC_HAVE_FUNCS(atexit on_exit)dnl 340 AC_HAVE_FUNCS(atexit on_exit)dnl
258 AC_STRUCT_TM
259 AC_SETVBUF_REVERSED
260 TERMLIBS=""
261 for termlib in termcap terminfo curses termlib ; do
262 AC_HAVE_LIBRARY(${termlib}, [TERMLIBS="${TERMLIBS} -l${termlib}"])
263 case "${TERMLIBS}" in
264 *-l${termlib}*)
265 break
266 ;;
267 esac
268 done
269 AC_SUBST(TERMLIBS)
270 dnl
271 dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in
272 dnl it, and it might not be installed.
273 dnl
274 dnl Also make sure that we generate an interactive scanner if we are
275 dnl using flex.
276 dnl
277 AC_PROG_LEX
278 case "$LEX" in
279 flex*)
280 LFLAGS="-t -I"
281 LEXLIB=
282 ;;
283 *)
284 LFLAGS="-t"
285 cat << EOF
286 warning: I didn't find flex, but that's only a problem
287 if you need to reconstruct lex.cc
288 EOF
289 ;;
290 esac
291 AC_SUBST(LFLAGS)dnl
292 dnl
293 AC_PROG_YACC
294 case "$YACC" in
295 bison*)
296 ;;
297 *)
298 cat << EOF
299 warning: I didn't find bison, but that's only a problem
300 if you need to reconstruct parse.cc
301 EOF
302 ;;
303 esac
304 dnl
305 dnl Define VOID_SIGHANDLER for readline.
306 dnl
307 AC_RETSIGTYPE
308 case "$RETSIGTYPE" in
309 int)
310 ;;
311 *)
312 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1"
313 ;;
314 esac
315 AC_SUBST(VOID_SIGHANDLER)dnl
316 dnl
317 dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips
318 dnl binary to an Alpha binary will work.
319 dnl
320 case "$canonical_host_type" in
321 mips-dec-ultrix*)
322 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])dnl
323 ;;
324 esac
325 dnl
326 case "$DEFS" in
327 *HAVE_SGTTY_H*)
328 ;;
329 *)
330 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1),
331 AC_HEADER_CHECK(termio.h, AC_DEFINE(HAVE_TERMIO_H, 1),
332 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])))dnl
333
334 case "$DEFS" in
335 *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*)
336 ;;
337 *)
338 cat << EOF
339 error: I couldn't find termios.h, termio.h, or sgtty.h, and I can't
340 continue without them. To compile Octave, your system must
341 have at least one of these header files.
342 EOF
343 exit 1
344 ;;
345 esac
346 ;;
347 esac
348 dnl 341 dnl
349 dnl Check to see if we have IEEE math functions, and if so, which ones. 342 dnl Check to see if we have IEEE math functions, and if so, which ones.
350 dnl 343 dnl
351 dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP 344 dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP
352 dnl functions, otherwise we may not find them. 345 dnl functions, otherwise we may not find them.
359 dnl Also check for some additional trig functions that aren't ANSI but 352 dnl Also check for some additional trig functions that aren't ANSI but
360 dnl are often available. If they are missing, we try to replace them 353 dnl are often available. If they are missing, we try to replace them
361 dnl with functions from the BSD/NET2 math library. 354 dnl with functions from the BSD/NET2 math library.
362 dnl 355 dnl
363 AC_HAVE_LIBRARY(-lm)dnl 356 AC_HAVE_LIBRARY(-lm)dnl
357 dnl
364 XCFLAGS="$CFLAGS" 358 XCFLAGS="$CFLAGS"
365 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" 359 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG"
366 for func in finite isnan isinf 360 for func in finite isnan isinf
367 do 361 do
368 trfunc=`echo $func | tr '[a-z]' '[A-Z]'` 362 trfunc=`echo $func | tr '[a-z]' '[A-Z]'`
381 ], 375 ],
382 AC_DEFINE(HAVE_[$trfunc], 1), []))dnl 376 AC_DEFINE(HAVE_[$trfunc], 1), []))dnl
383 done 377 done
384 dnl 378 dnl
385 CFLAGS="$XCFLAGS" 379 CFLAGS="$XCFLAGS"
386 AC_REPLACE_FUNCS(acosh asinh atanh)dnl 380 dnl
381 dnl Check for nonstandard but common trig functions that we need.
382 dnl If they are missing, we replace them using functions from the BSD
383 dnl math library, and we may need to replace some other functions too.
384 dnl
385 AC_REPLACE_FUNCS(acosh asinh atanh)
387 dnl 386 dnl
388 if test -n "$LIBOBJS"; then 387 if test -n "$LIBOBJS"; then
389 for func in $LIBOBJS 388 for func in $LIBOBJS
390 do 389 do
391 case "$func" in 390 case "$func" in
392 *acosh.o*) 391 *acosh.o*)
393 AC_DEFINE(ACOSH_MISSING, 1)dnl 392 AC_DEFINE(ACOSH_MISSING, 1)dnl
394 ;; 393 ;;
395 *asinh.o*) 394 *asinh.o*)
396 AC_DEFINE(ASINH_MISSING, 1)dnl 395 AC_DEFINE(ASINH_MISSING, 1)dnl
397 ;; 396 ;;
398 *atanh.o*) 397 *atanh.o*)
399 AC_DEFINE(ATANH_MISSING, 1)dnl 398 AC_DEFINE(ATANH_MISSING, 1)dnl
400 ;; 399 ;;
401 esac 400 esac
402 done 401 done
403
404 case $LIBOBJS in 402 case $LIBOBJS in
405 *acosh.o* | *asinh.o*) 403 *acosh.o* | *asinh.o*)
406 AC_REPLACE_FUNCS(copysign)dnl 404 AC_REPLACE_FUNCS(copysign)
407 ;; 405 ;;
408 esac 406 esac
409
410 case $LIBOBJS in 407 case $LIBOBJS in
411 *acosh.o* | *asinh.o* | *atanh.o*) 408 *acosh.o* | *asinh.o* | *atanh.o*)
412 AC_REPLACE_FUNCS(log1p)dnl 409 AC_REPLACE_FUNCS(log1p)
413 ;; 410 ;;
414 esac 411 esac
415
416 case $LIBOBJS in 412 case $LIBOBJS in
417 *log1p*) 413 *log1p*)
418 AC_REPLACE_FUNCS(log__L)dnl 414 AC_REPLACE_FUNCS(log__L)
419 ;; 415 ;;
420 esac 416 esac
421
422 case $LIBOBJS in 417 case $LIBOBJS in
423 *log1p*) 418 *log1p*)
424 AC_REPLACE_FUNCS(finite)dnl 419 AC_REPLACE_FUNCS(finite)
425 ;; 420 ;;
426 esac 421 esac
427
428 case $LIBOBJS in 422 case $LIBOBJS in
429 *copysign* | *finite* | *log1p*) 423 *copysign* | *finite* | *log1p*)
430 AC_REPLACE_FUNCS(logb scalb)dnl 424 AC_REPLACE_FUNCS(logb scalb)
431 ;; 425 ;;
432 esac 426 esac
433 fi 427 fi
434 dnl 428 dnl
435 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl 429 dnl Checks for OS specific cruft.
436 if test -z "$GNUPLOT_BINARY"; then 430 dnl
437 cat << EOF 431 AC_STRUCT_TM
438 warning: I didn't find gnuplot. It isn't necessary to have gnuplot 432 AC_SETVBUF_REVERSED
439 installed, but you won't be able to use any of Octave's 433 TERMLIBS=""
440 plotting commands without it. 434 for termlib in termcap terminfo curses termlib ; do
441 435 AC_HAVE_LIBRARY(${termlib}, [TERMLIBS="${TERMLIBS} -l${termlib}"])
442 If gnuplot is installed but it isn't in your path, you can 436 case "${TERMLIBS}" in
443 tell Octave where to find it by typing the command 437 *-l${termlib}*)
444 438 AC_VERBOSE([setting TERMLIBS to $TERMLIBS])
445 gnuplot_binary = '/full/path/to/gnuplot/binary' 439 break
446 440 ;;
447 at the Octave prompt. 441 esac
448 EOF 442 done
449 fi 443 AC_SUBST(TERMLIBS)
450 dnl 444 dnl
451 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl 445 dnl Define VOID_SIGHANDLER for readline.
452 if test -z "$DEFAULT_PAGER"; then 446 dnl
453 echo "warning: I couldn't find less(1), more(1), page(1), or pg(1)" 447 AC_RETSIGTYPE
454 elif test "$DEFAULT_PAGER" = less; then 448 case "$RETSIGTYPE" in
455 DEFAULT_PAGER="less -e" 449 int)
456 fi 450 ;;
451 *)
452 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1"
453 AC_VERBOSE([defining VOID_SIGHANDLER to be 1])
454 ;;
455 esac
456 AC_SUBST(VOID_SIGHANDLER)dnl
457 dnl
458 dnl Checks for other programs used for building, testing, installing,
459 dnl and running Octave.
460 dnl
461 dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in
462 dnl it, and it might not be installed.
463 dnl
464 dnl Also make sure that we generate an interactive scanner if we are
465 dnl using flex.
466 dnl
467 AC_PROG_LEX
468 case "$LEX" in
469 flex*)
470 LFLAGS="-t -I"
471 AC_VERBOSE([setting LFLAGS to be $LFLAGS])
472 LEXLIB=
473 ;;
474 *)
475 LFLAGS="-t"
476 AC_VERBOSE([setting LFLAGS to be $LFLAGS])
477 AC_WARN([I didn't find flex, but that's only a problem])
478 AC_WARN([if you need to reconstruct lex.cc])
479 ;;
480 esac
481 AC_SUBST(LFLAGS)dnl
482 dnl
483 AC_PROG_YACC
484 case "$YACC" in
485 bison*)
486 ;;
487 *)
488 AC_WARN([I didn't find bison, but that's only a problem])
489 AC_WARN([if you need to reconstruct parse.cc])
490 ;;
491 esac
492 dnl
493 AC_PROG_RANLIB
457 dnl 494 dnl
458 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl 495 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl
459 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl 496 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl
460 if test -z "$EXPECT" ; then 497 if test -z "$EXPECT" ; then
461 RUNTEST= 498 RUNTEST=
462 fi 499 fi
463 AC_SUBST(RUNTEST)dnl 500 AC_SUBST(RUNTEST)dnl
464 dnl 501 dnl
502 AC_PROG_INSTALL
503 dnl
504 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl
505 if test -z "$GNUPLOT_BINARY"; then
506 AC_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot])
507 AC_WARN([installed, but you won't be able to use any of Octave's])
508 AC_WARN([plotting commands without it.])
509 AC_WARN([])
510 AC_WARN([If gnuplot is installed but it isn't in your path, you can])
511 AC_WARN([tell Octave where to find it by typing the command])
512 AC_WARN([])
513 AC_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"])
514 AC_WARN([])
515 AC_WARN([at the Octave prompt.])
516 fi
517 dnl
518 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl
519 if test -z "$DEFAULT_PAGER"; then
520 AC_WARN([I couldn't find `less', `more', `page', or `pg'])
521 elif test "$DEFAULT_PAGER" = less; then
522 DEFAULT_PAGER="less -e"
523 AC_VERBOSE([setting DEFAULT_PAGER to be $DEFAULT_PAGER])
524 fi
525 dnl
526 dnl Even though we include config.h in most files, some need to be
527 dnl compiled with the -D options on the compiler command line. Use
528 dnl UGLY_DEFS for that.
529 dnl
465 UGLY_DEFS="$DEFS" 530 UGLY_DEFS="$DEFS"
531 AC_VERBOSE([setting UGLY_DEFS to be $UGLY_DEFS])
466 AC_SUBST(UGLY_DEFS)dnl 532 AC_SUBST(UGLY_DEFS)dnl
533 dnl
534 dnl Maybe add -Wall to compiler flags now that we're done feature
535 dnl testing.
536 dnl
537 if $ADD_CXX_WALL; then
538 CXXFLAGS="$CXXFLAGS -Wall"
539 AC_VERBOSE([adding -Wall to CXXFLAGS])
540 fi
541 if $ADD_CC_WALL; then
542 CFLAGS="$CFLAGS -Wall"
543 AC_VERBOSE([adding -Wall to CFLAGS])
544 fi
545 dnl
546 dnl Do the substitutions in all the Makefiles.
467 dnl 547 dnl
468 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl 548 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl
469 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl 549 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl
470 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl 550 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl
471 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl 551 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl