405
|
1 dnl configure.in |
|
2 dnl |
5
|
3 dnl Process this file with autoconf to produce a configure script. |
405
|
4 dnl Requires GNU autoconf 1.8 or later. |
5
|
5 dnl |
405
|
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 |
521
|
24 AC_REVISION($Revision: 1.35 $)dnl |
405
|
25 AC_PREREQ(1.8)dnl |
|
26 AC_INIT(src/octave.cc) |
424
|
27 AC_CONFIG_HEADER(config.h) |
369
|
28 dnl |
236
|
29 AC_DEFINE(OCTAVE_SOURCE, 1)dnl |
369
|
30 dnl |
405
|
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. |
369
|
33 dnl |
5
|
34 if test $# -gt 0; then |
|
35 TARGET=`eval echo $\{\`echo $#\`\}` |
|
36 case $TARGET in |
405
|
37 -*) |
|
38 target_host_type= |
|
39 ;; |
|
40 *) |
|
41 target_host_type=$TARGET |
|
42 ;; |
5
|
43 esac |
|
44 fi |
369
|
45 dnl |
5
|
46 if test -z "$target_host_type" -o "$target_host_type" = unknown; then |
|
47 target_host_type=`sh $srcdir/config.guess` |
|
48 if test -z "$target_host_type"; then |
405
|
49 AC_WARN([unable to guess system type]) |
5
|
50 target_host_type=unknown |
|
51 fi |
|
52 fi |
369
|
53 dnl |
405
|
54 dnl Use config.sub to come up with a standard vendor-host-os triple. |
|
55 dnl |
294
|
56 canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1` |
|
57 status=$? |
|
58 if test $status -eq 0; then |
|
59 echo "configuring Octave for a $target_host_type" |
|
60 else |
|
61 canonical_host_type=unknown |
405
|
62 AC_WARN([configuring Octave for an unknown system type]) |
294
|
63 fi |
5
|
64 AC_SUBST(target_host_type)dnl |
405
|
65 AC_VERBOSE([target_host_type is $target_host_type]) |
|
66 AC_VERBOSE([canonical_host_type is $canonical_host_type]) |
369
|
67 dnl |
405
|
68 dnl Allow the user to force us to use f2c. |
369
|
69 dnl |
5
|
70 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl |
405
|
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 |
369
|
75 dnl |
424
|
76 dnl Makes Octave look for info and function files in the same |
|
77 dnl directory tree as the sources |
|
78 dnl |
|
79 AC_ENABLE(run-in-place, run_in_place=true, run_in_place=false)dnl |
425
|
80 OCTAVE_HOME=/usr/local |
|
81 if test -n "$prefix"; then |
|
82 OCTAVE_HOME=$prefix |
424
|
83 fi |
425
|
84 OCTAVE_LIB_DIR= |
|
85 OCTAVE_INFO_DIR= |
|
86 if $run_in_place; then |
424
|
87 AC_DEFINE(RUN_IN_PLACE, 1)dnl |
425
|
88 case "$srcdir" in |
|
89 /*) |
|
90 absolute_srcdir=$srcdir |
|
91 ;; |
|
92 *) |
|
93 AC_WARN([making OCTAVE_HOME absolute -- may lose with automounter]) |
|
94 absolute_srcdir=`(cd $srcdir; pwd)` |
|
95 ;; |
|
96 esac |
|
97 OCTAVE_HOME=$absolute_srcdir |
|
98 OCTAVE_LIB_DIR=$absolute_srcdir/scripts |
|
99 OCTAVE_INFO_DIR=$absolute_srcdir/doc |
424
|
100 fi |
425
|
101 AC_VERBOSE([setting OCTAVE_HOME to $OCTAVE_HOME]) |
|
102 AC_VERBOSE([setting OCTAVE_LIB_DIR to $OCTAVE_LIB_DIR]) |
|
103 AC_VERBOSE([setting OCTAVE_INFO_DIR to $OCTAVE_INFO_DIR]) |
|
104 AC_SUBST(OCTAVE_HOME)dnl |
|
105 AC_SUBST(OCTAVE_LIB_DIR)dnl |
|
106 AC_SUBST(OCTAVE_INFO_DIR)dnl |
424
|
107 dnl |
5
|
108 DYNAMIC_LD_OBJ= |
|
109 DLD_DIR= |
|
110 LIBDLD= |
518
|
111 LIBOCTDLD='../liboctdld.a' |
5
|
112 LD_STATIC_FLAG= |
|
113 if $use_dld; then |
|
114 DYNAMIC_LD_OBJ='dynamic-ld.o' |
518
|
115 DLD_DIR=dld |
|
116 LIBDLD='../libdld.a' |
|
117 LIBOCTDLD= # don't link them in if doing dynamic linking |
|
118 LD_STATIC_FLAG=-static |
|
119 AC_DEFINE(WITH_DLD, 1)dnl |
|
120 fi |
|
121 if test -n "$DYNAMIC_LD_OBJ"; then |
405
|
122 AC_VERBOSE([setting DYNAMIC_LD_OBJ to $DYNAMIC_LD_OBJ]) |
518
|
123 fi |
|
124 if test -n "$DLD_DIR"; then |
405
|
125 AC_VERBOSE([setting DLD_DIR to $DLD_DIR]) |
518
|
126 fi |
|
127 if test -n "$LIBDLD"; then |
405
|
128 AC_VERBOSE([setting LIBDLD to $LIBDLD]) |
518
|
129 fi |
|
130 if test -n "$LIBOCTDLD"; then |
|
131 AC_VERBOSE([setting LIBOCTDLD to $LIBOCTDLD]) |
|
132 fi |
|
133 if test -n "$LD_STATIC_FLAG"; then |
405
|
134 AC_VERBOSE([setting LD_STATIC_FLAG to $LD_STATIC_FLAG]) |
5
|
135 fi |
|
136 AC_SUBST(DYNAMIC_LD_OBJ)dnl |
|
137 AC_SUBST(DLD_DIR)dnl |
|
138 AC_SUBST(LIBDLD)dnl |
518
|
139 AC_SUBST(LIBOCTDLD)dnl |
5
|
140 AC_SUBST(LD_STATIC_FLAG)dnl |
369
|
141 dnl |
405
|
142 dnl See if the optional nonlinear programming code is present. |
|
143 dnl |
|
144 AC_CHECKING([for npsol]) |
5
|
145 if test -f $srcdir/libcruft/npsol/npsol.f; then |
|
146 : |
|
147 else |
236
|
148 AC_DEFINE(NPSOL_MISSING, 1)dnl |
5
|
149 fi |
369
|
150 dnl |
405
|
151 AC_CHECKING([for qpsol]) |
5
|
152 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
|
153 : |
|
154 else |
236
|
155 AC_DEFINE(QPSOL_MISSING, 1)dnl |
5
|
156 fi |
369
|
157 dnl |
405
|
158 AC_CHECKING([for fsqp]) |
5
|
159 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
|
160 : |
|
161 else |
236
|
162 AC_DEFINE(FSQP_MISSING, 1)dnl |
5
|
163 fi |
369
|
164 dnl |
405
|
165 dnl See which C++ compiler to use (we expect to find g++). |
|
166 dnl |
|
167 AC_PROG_CXX |
|
168 AC_PROG_CXXCPP |
|
169 dnl |
|
170 dnl Do special things for g++. |
|
171 dnl |
|
172 ADD_CXX_WALL=false |
|
173 gxx_version=`$CXX -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'` |
|
174 case "$gxx_version" in |
|
175 2.5.*|2.6.*|2.7.*|2.8.*|2.9.*) |
|
176 CXXFLAGS="-g -O" |
|
177 AC_VERBOSE([setting CXXFLAGS to $CXXFLAGS]) |
|
178 EXTERNAL_TEMPLATES="-fexternal-templates" |
|
179 AC_VERBOSE([setting EXTERNAL_TEMPLATES to $EXTERNAL_TEMPLATES]) |
|
180 ADD_CXX_WALL=true |
|
181 AC_DEFINE(USE_EXTERNAL_TEMPLATES, 1)dnl |
|
182 ;; |
|
183 1.*) |
|
184 AC_WARN([g++ version $gxx_version will not work to compile Octave]) |
|
185 ;; |
|
186 *) |
|
187 AC_WARN([Octave has only been tested with g++, and I can't find it]) |
|
188 ;; |
|
189 esac |
|
190 dnl |
|
191 AC_SUBST(CXXFLAGS)dnl |
|
192 AC_SUBST(EXTERNAL_TEMPLATES)dnl |
|
193 dnl |
|
194 dnl See which C compiler to use (we expect to find gcc). |
|
195 dnl |
5
|
196 AC_PROG_CC |
405
|
197 AC_PROG_CPP |
5
|
198 AC_GCC_TRADITIONAL |
369
|
199 dnl |
|
200 dnl Do special things for gcc. |
|
201 dnl |
405
|
202 ADD_CC_WALL=false |
|
203 gcc_version=`$CC -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` |
|
204 case "$gcc_version" in |
|
205 2.*) |
|
206 CFLAGS="-g -O" |
|
207 AC_VERBOSE([setting CFLAGS to $CFLAGS]) |
5
|
208 LDFLAGS="-g -O" |
405
|
209 AC_VERBOSE([setting LDFLAGS to $LDFLAGS]) |
|
210 ADD_CC_WALL=true |
|
211 ;; |
|
212 1.*) |
|
213 AC_WARN([gcc version $gcc_version is likely to cause problems]) |
|
214 ;; |
5
|
215 *) |
405
|
216 AC_WARN([Octave has only been tested with gcc, and I can't find it]) |
|
217 ;; |
5
|
218 esac |
405
|
219 dnl |
5
|
220 AC_SUBST(CFLAGS)dnl |
|
221 AC_SUBST(LDFLAGS)dnl |
369
|
222 dnl |
405
|
223 dnl On Linux systems we need to compile with -mieee-fp to get full |
|
224 dnl support for IEEE floating point. |
369
|
225 dnl |
350
|
226 case "$canonical_host_type" in |
|
227 i386-*-linux | i486-*-linux | i586-*-linux) |
|
228 GCC_IEEE_FP_FLAG="-mieee-fp" |
405
|
229 AC_VERBOSE([setting GCC_IEEE_FP_FLAG to $GCC_IEEE_FP_FLAG]) |
324
|
230 ;; |
|
231 esac |
405
|
232 dnl |
324
|
233 AC_SUBST(GCC_IEEE_FP_FLAG)dnl |
369
|
234 dnl |
405
|
235 dnl Special checks for odd OS specific things. |
|
236 dnl |
|
237 AC_ISC_POSIX |
|
238 AC_MINIX |
|
239 AC_AIX |
|
240 AC_DYNIX_SEQ |
|
241 AC_IRIX_SUN |
|
242 AC_SCO_INTL |
|
243 AC_XENIX_DIR |
|
244 dnl |
|
245 dnl Does the C compiler handle alloca() and const correctly? |
|
246 dnl |
|
247 AC_ALLOCA |
|
248 AC_CONST |
|
249 dnl |
369
|
250 dnl If we haven't been forced to use f2c, try to find a Fortran compiler |
|
251 dnl under any one of several common Un*x Fortran compiler names. |
|
252 dnl Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
253 dnl builtin. |
|
254 dnl |
|
255 dnl xlf : IBM / AIX |
|
256 dnl cf77 : Cray / Unicos |
405
|
257 dnl g77 : GNU Fortran (someday...) |
369
|
258 dnl fc : Convex |
|
259 dnl |
|
260 dnl I don't think the Cray compiler will ever work like f2c... |
|
261 dnl |
5
|
262 if $use_f2c; then |
|
263 true |
|
264 else |
|
265 F77= |
405
|
266 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 g77 fc)dnl |
5
|
267 |
|
268 # If it looks like we have a Fortran compiler, try to determine |
|
269 # whether it might be compatible with f2c. |
|
270 |
|
271 if test -n "$F77"; then |
405
|
272 AC_CHECKING([$F77/f2c compatibility]) |
5
|
273 export F77 |
|
274 export CC |
|
275 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
276 status=$? |
|
277 if test $status -eq 0; then |
|
278 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
236
|
279 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl |
5
|
280 fi |
|
281 else |
|
282 F77= |
|
283 fi |
|
284 fi |
|
285 fi |
369
|
286 dnl |
|
287 dnl If we can't find a Fortran compiler, or if it looks like it isn't |
|
288 dnl compatible with f2c, try to find f2c. |
|
289 dnl |
5
|
290 if test -z "$F77"; then |
|
291 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl |
|
292 fi |
369
|
293 dnl |
5
|
294 F2CFLAGS= |
405
|
295 AC_VERBOSE([setting F2CFLAGS to $F2CFLAGS]) |
5
|
296 FFLAGS="-O" |
405
|
297 AC_VERBOSE([setting FFLAGS to $FFLAGS]) |
5
|
298 if test -n "$F77"; then |
|
299 export F77 |
|
300 FLIBS=`sh $srcdir/flibs.sh` |
405
|
301 AC_VERBOSE([setting FLIBS to $FLIBS]) |
5
|
302 DOT_O_DOT_F_C1= |
|
303 DOT_O_DOT_F_C2= |
|
304 DOT_O_DOT_F_C3= |
|
305 DOT_O_DOT_F_C4= |
|
306 DEFAULT_DOT_C_FROM_DOT_F= |
|
307 DEFAULT_DOT_O_FROM_DOT_F= |
|
308 elif test -n "$F2C" || $use_f2c; then |
|
309 AC_HAVE_LIBRARY(f2c, FLIBS=-lf2c, [])dnl |
|
310 if test -z "$FLIBS" ; then |
|
311 AC_HAVE_LIBRARY(F77, FLIBS=-lF77, [])dnl |
|
312 if test -n "$FLIBS" ; then |
|
313 AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl |
|
314 fi |
|
315 fi |
|
316 if test -z "$FLIBS" ; then |
405
|
317 AC_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
318 fi |
|
319 DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\ |
|
320 # If we are using f2c we should also turn off the default rule for\ |
|
321 # making objects from .f files so that we do not invoke the fortran\ |
|
322 # compiler by mistake.\ |
|
323 \ |
|
324 \%.c : \%.f\ |
|
325 cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
405
|
326 AC_VERBOSE([setting DEFAULT_DOT_C_FROM_DOT_F to $DEFAULT_DOT_C_FROM_DOT_F]) |
5
|
327 DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f' |
405
|
328 AC_VERBOSE([setting DEFAULT_DOT_O_FROM_DOT_F to $DEFAULT_DOT_O_FROM_DOT_F]) |
236
|
329 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl |
5
|
330 else |
405
|
331 AC_WARN([in order to build octave, you must have a compatible]) |
|
332 AC_WARN([Fortran compiler or f2c installed and in your path.]) |
|
333 AC_WARN([See the file INSTALL for more information.]) |
|
334 AC_WARN([Continuing anyway...]) |
5
|
335 fi |
369
|
336 dnl |
5
|
337 AC_SUBST(FFLAGS)dnl |
|
338 AC_SUBST(FLIBS)dnl |
|
339 AC_SUBST(F2C)dnl |
|
340 AC_SUBST(F2CFLAGS)dnl |
|
341 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl |
|
342 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl |
369
|
343 dnl |
405
|
344 dnl Checks for header files. |
|
345 dnl |
5
|
346 AC_STDC_HEADERS |
402
|
347 AC_HAVE_HEADERS(string.h varargs.h unistd.h floatingpoint.h)dnl |
|
348 AC_HAVE_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h)dnl |
|
349 AC_HAVE_HEADERS(sys/ttold.h sys/ptem.h sys/select.h)dnl |
5
|
350 AC_DIR_HEADER |
369
|
351 dnl |
|
352 dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips |
|
353 dnl binary to an Alpha binary will work. |
|
354 dnl |
294
|
355 case "$canonical_host_type" in |
521
|
356 mips-dec-ultrix* | alpha-dec-osf*) |
405
|
357 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), []) |
294
|
358 ;; |
|
359 esac |
369
|
360 dnl |
5
|
361 case "$DEFS" in |
294
|
362 *HAVE_SGTTY_H*) |
5
|
363 ;; |
|
364 *) |
294
|
365 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1), |
|
366 AC_HEADER_CHECK(termio.h, AC_DEFINE(HAVE_TERMIO_H, 1), |
405
|
367 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), []))) |
5
|
368 ;; |
|
369 esac |
405
|
370 case "$DEFS" in |
|
371 *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*) |
|
372 ;; |
|
373 *) |
|
374 AC_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
375 ;; |
|
376 esac |
|
377 dnl |
|
378 dnl Checks for functions. |
|
379 dnl |
|
380 AC_HAVE_FUNCS(setvbuf getcwd gethostname bzero rindex vfprintf vsprintf)dnl |
|
381 AC_HAVE_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror)dnl |
|
382 AC_HAVE_FUNCS(atexit on_exit)dnl |
369
|
383 dnl |
|
384 dnl Check to see if we have IEEE math functions, and if so, which ones. |
|
385 dnl |
|
386 dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
387 dnl functions, otherwise we may not find them. |
|
388 dnl |
|
389 dnl Also just using AC_HAVE_FUNCS doesn't seem to work to find isinf |
|
390 dnl and isnan on Linux systems, so we use AC_FUNC_CHECK, and if that |
|
391 dnl fails, we try again by including math.h and invoking the function |
|
392 dnl with an argument. |
|
393 dnl |
|
394 dnl Also check for some additional trig functions that aren't ANSI but |
|
395 dnl are often available. If they are missing, we try to replace them |
|
396 dnl with functions from the BSD/NET2 math library. |
|
397 dnl |
28
|
398 AC_HAVE_LIBRARY(-lm)dnl |
405
|
399 dnl |
360
|
400 XCFLAGS="$CFLAGS" |
351
|
401 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
369
|
402 for func in finite isnan isinf |
|
403 do |
|
404 trfunc=`echo $func | tr '[a-z]' '[A-Z]'` |
|
405 AC_FUNC_CHECK([$func], |
|
406 AC_DEFINE(HAVE_[$trfunc], 1), |
|
407 AC_COMPILE_CHECK([$func], [#include <math.h>], [ |
|
408 /* The GNU C library defines this for functions which it implements |
|
409 to always fail with ENOSYS. Some functions are actually named |
|
410 something starting with __ and the normal name is an alias. */ |
|
411 #if defined (__stub_$func) || defined (__stub___$func) |
|
412 choke me |
|
413 #else |
|
414 /* Override any gcc2 internal prototype to avoid an error. */ |
|
415 $func (1.0); |
|
416 #endif |
|
417 ], |
|
418 AC_DEFINE(HAVE_[$trfunc], 1), []))dnl |
|
419 done |
|
420 dnl |
468
|
421 AC_HAVE_FUNCS(infinity quiet_nan)dnl |
|
422 dnl |
360
|
423 CFLAGS="$XCFLAGS" |
405
|
424 dnl |
|
425 dnl Check for nonstandard but common trig functions that we need. |
|
426 dnl If they are missing, we replace them using functions from the BSD |
|
427 dnl math library, and we may need to replace some other functions too. |
|
428 dnl |
|
429 AC_REPLACE_FUNCS(acosh asinh atanh) |
369
|
430 dnl |
5
|
431 if test -n "$LIBOBJS"; then |
|
432 for func in $LIBOBJS |
|
433 do |
|
434 case "$func" in |
|
435 *acosh.o*) |
236
|
436 AC_DEFINE(ACOSH_MISSING, 1)dnl |
405
|
437 ;; |
5
|
438 *asinh.o*) |
236
|
439 AC_DEFINE(ASINH_MISSING, 1)dnl |
405
|
440 ;; |
5
|
441 *atanh.o*) |
236
|
442 AC_DEFINE(ATANH_MISSING, 1)dnl |
405
|
443 ;; |
5
|
444 esac |
|
445 done |
|
446 case $LIBOBJS in |
|
447 *acosh.o* | *asinh.o*) |
405
|
448 AC_REPLACE_FUNCS(copysign) |
|
449 ;; |
5
|
450 esac |
|
451 case $LIBOBJS in |
|
452 *acosh.o* | *asinh.o* | *atanh.o*) |
405
|
453 AC_REPLACE_FUNCS(log1p) |
|
454 ;; |
5
|
455 esac |
|
456 case $LIBOBJS in |
|
457 *log1p*) |
405
|
458 AC_REPLACE_FUNCS(log__L) |
|
459 ;; |
5
|
460 esac |
|
461 case $LIBOBJS in |
|
462 *log1p*) |
405
|
463 AC_REPLACE_FUNCS(finite) |
|
464 ;; |
5
|
465 esac |
|
466 case $LIBOBJS in |
|
467 *copysign* | *finite* | *log1p*) |
405
|
468 AC_REPLACE_FUNCS(logb scalb) |
|
469 ;; |
5
|
470 esac |
|
471 fi |
369
|
472 dnl |
405
|
473 dnl Checks for OS specific cruft. |
|
474 dnl |
|
475 AC_STRUCT_TM |
|
476 AC_SETVBUF_REVERSED |
|
477 TERMLIBS="" |
|
478 for termlib in termcap terminfo curses termlib ; do |
|
479 AC_HAVE_LIBRARY(${termlib}, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
|
480 case "${TERMLIBS}" in |
|
481 *-l${termlib}*) |
|
482 AC_VERBOSE([setting TERMLIBS to $TERMLIBS]) |
|
483 break |
|
484 ;; |
|
485 esac |
|
486 done |
505
|
487 dnl |
|
488 AC_COMPILE_CHECK([struct exception in math.h], |
|
489 [#include <math.h>], |
|
490 [struct exception *x; x->type; x->name;], |
|
491 AC_DEFINE(EXCEPTION_IN_MATH, 1), [])dnl |
|
492 dnl |
405
|
493 AC_SUBST(TERMLIBS) |
|
494 dnl |
|
495 dnl Define VOID_SIGHANDLER for readline. |
|
496 dnl |
|
497 AC_RETSIGTYPE |
|
498 case "$RETSIGTYPE" in |
|
499 int) |
|
500 ;; |
|
501 *) |
|
502 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
|
503 AC_VERBOSE([defining VOID_SIGHANDLER to be 1]) |
|
504 ;; |
|
505 esac |
|
506 AC_SUBST(VOID_SIGHANDLER)dnl |
|
507 dnl |
|
508 dnl Checks for other programs used for building, testing, installing, |
|
509 dnl and running Octave. |
369
|
510 dnl |
405
|
511 dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
512 dnl it, and it might not be installed. |
|
513 dnl |
|
514 dnl Also make sure that we generate an interactive scanner if we are |
|
515 dnl using flex. |
|
516 dnl |
|
517 AC_PROG_LEX |
|
518 case "$LEX" in |
|
519 flex*) |
|
520 LFLAGS="-t -I" |
|
521 AC_VERBOSE([setting LFLAGS to be $LFLAGS]) |
|
522 LEXLIB= |
|
523 ;; |
|
524 *) |
|
525 LFLAGS="-t" |
|
526 AC_VERBOSE([setting LFLAGS to be $LFLAGS]) |
|
527 AC_WARN([I didn't find flex, but that's only a problem]) |
|
528 AC_WARN([if you need to reconstruct lex.cc]) |
|
529 ;; |
|
530 esac |
|
531 AC_SUBST(LFLAGS)dnl |
|
532 dnl |
|
533 AC_PROG_YACC |
|
534 case "$YACC" in |
|
535 bison*) |
|
536 ;; |
|
537 *) |
|
538 AC_WARN([I didn't find bison, but that's only a problem]) |
|
539 AC_WARN([if you need to reconstruct parse.cc]) |
|
540 ;; |
|
541 esac |
|
542 dnl |
|
543 AC_PROG_RANLIB |
369
|
544 dnl |
5
|
545 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl |
|
546 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl |
|
547 if test -z "$EXPECT" ; then |
|
548 RUNTEST= |
|
549 fi |
|
550 AC_SUBST(RUNTEST)dnl |
369
|
551 dnl |
405
|
552 AC_PROG_INSTALL |
|
553 dnl |
|
554 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl |
|
555 if test -z "$GNUPLOT_BINARY"; then |
|
556 AC_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
557 AC_WARN([installed, but you won't be able to use any of Octave's]) |
|
558 AC_WARN([plotting commands without it.]) |
|
559 AC_WARN([]) |
|
560 AC_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
561 AC_WARN([tell Octave where to find it by typing the command]) |
|
562 AC_WARN([]) |
|
563 AC_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
564 AC_WARN([]) |
|
565 AC_WARN([at the Octave prompt.]) |
|
566 fi |
|
567 dnl |
|
568 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl |
|
569 if test -z "$DEFAULT_PAGER"; then |
|
570 AC_WARN([I couldn't find `less', `more', `page', or `pg']) |
|
571 elif test "$DEFAULT_PAGER" = less; then |
|
572 DEFAULT_PAGER="less -e" |
|
573 AC_VERBOSE([setting DEFAULT_PAGER to be $DEFAULT_PAGER]) |
|
574 fi |
|
575 dnl |
|
576 dnl Even though we include config.h in most files, some need to be |
|
577 dnl compiled with the -D options on the compiler command line. Use |
|
578 dnl UGLY_DEFS for that. |
|
579 dnl |
236
|
580 UGLY_DEFS="$DEFS" |
405
|
581 AC_VERBOSE([setting UGLY_DEFS to be $UGLY_DEFS]) |
236
|
582 AC_SUBST(UGLY_DEFS)dnl |
369
|
583 dnl |
405
|
584 dnl Maybe add -Wall to compiler flags now that we're done feature |
|
585 dnl testing. |
|
586 dnl |
|
587 if $ADD_CXX_WALL; then |
|
588 CXXFLAGS="$CXXFLAGS -Wall" |
|
589 AC_VERBOSE([adding -Wall to CXXFLAGS]) |
|
590 fi |
|
591 if $ADD_CC_WALL; then |
|
592 CFLAGS="$CFLAGS -Wall" |
|
593 AC_VERBOSE([adding -Wall to CFLAGS]) |
|
594 fi |
|
595 dnl |
|
596 dnl Do the substitutions in all the Makefiles. |
|
597 dnl |
39
|
598 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
599 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
600 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
601 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
602 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
603 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
604 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
|
605 define([tmph], [libcruft/ranlib/Makefile libcruft/villad/Makefile])dnl |
5
|
606 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph])dnl |
|
607 define([tmpA], [Makefile Makeconf libcruft/Makefile libcruft/Makerules])dnl |
179
|
608 define([tmpB], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
609 define([tmpC], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
5
|
610 define([tmpD], [readline/examples/Makefile doc/Makefile])dnl |
|
611 define([tmpE], [scripts/Makefile test/Makefile])dnl |
196
|
612 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE])dnl |
5
|
613 AC_OUTPUT([srcdirs cruftdirs])dnl |