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 |
638
|
24 AC_REVISION($Revision: 1.39 $)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]) |
638
|
208 LDFLAGS="-g" |
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 |
602
|
245 dnl How big are ints and how are they oriented? |
589
|
246 dnl |
|
247 AC_SIZEOF_TYPE(short) |
|
248 AC_SIZEOF_TYPE(int) |
|
249 AC_SIZEOF_TYPE(long) |
602
|
250 AC_WORDS_BIGENDIAN |
589
|
251 dnl |
588
|
252 dnl Try to determine the floating point format. |
|
253 dnl |
|
254 AC_CHECKING([floating point format]) |
602
|
255 changequote(,)dnl |
|
256 XCFLAGS=`echo $CFLAGS | sed 's/-O[^ \t]*//'` |
|
257 changequote([,])dnl |
|
258 ${CC-cc} -DDP $XCFLAGS $LDFLAGS $srcdir/float-type.c -o conftest >/dev/null 2>&1 |
588
|
259 FLOAT_FORMAT=`./conftest` |
|
260 case "$FLOAT_FORMAT" in |
|
261 IEEE_BIG_ENDIAN) |
|
262 AC_DEFINE(IEEE_BIG_ENDIAN, 1)dnl |
|
263 ;; |
|
264 IEEE_LITTLE_ENDIAN) |
|
265 AC_DEFINE(IEEE_LITTLE_ENDIAN, 1)dnl |
|
266 ;; |
|
267 VAX_D_FLOAT) |
|
268 AC_DEFINE(VAX_D_FLOAT, 1)dnl |
|
269 ;; |
|
270 VAX_G_FLOAT) |
|
271 AC_DEFINE(VAX_G_FLOAT, 1)dnl |
|
272 ;; |
|
273 *) |
|
274 AC_WARN("unrecognized floating point format!") |
|
275 ;; |
|
276 esac |
|
277 dnl |
405
|
278 dnl Does the C compiler handle alloca() and const correctly? |
|
279 dnl |
|
280 AC_ALLOCA |
|
281 AC_CONST |
|
282 dnl |
369
|
283 dnl If we haven't been forced to use f2c, try to find a Fortran compiler |
|
284 dnl under any one of several common Un*x Fortran compiler names. |
|
285 dnl Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
286 dnl builtin. |
|
287 dnl |
|
288 dnl xlf : IBM / AIX |
|
289 dnl cf77 : Cray / Unicos |
405
|
290 dnl g77 : GNU Fortran (someday...) |
369
|
291 dnl fc : Convex |
|
292 dnl |
|
293 dnl I don't think the Cray compiler will ever work like f2c... |
|
294 dnl |
5
|
295 if $use_f2c; then |
|
296 true |
|
297 else |
|
298 F77= |
405
|
299 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 g77 fc)dnl |
5
|
300 |
|
301 # If it looks like we have a Fortran compiler, try to determine |
|
302 # whether it might be compatible with f2c. |
|
303 |
|
304 if test -n "$F77"; then |
405
|
305 AC_CHECKING([$F77/f2c compatibility]) |
5
|
306 export F77 |
|
307 export CC |
|
308 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
309 status=$? |
|
310 if test $status -eq 0; then |
|
311 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
236
|
312 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl |
5
|
313 fi |
|
314 else |
|
315 F77= |
|
316 fi |
|
317 fi |
|
318 fi |
369
|
319 dnl |
|
320 dnl If we can't find a Fortran compiler, or if it looks like it isn't |
|
321 dnl compatible with f2c, try to find f2c. |
|
322 dnl |
5
|
323 if test -z "$F77"; then |
|
324 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl |
|
325 fi |
369
|
326 dnl |
5
|
327 F2CFLAGS= |
405
|
328 AC_VERBOSE([setting F2CFLAGS to $F2CFLAGS]) |
5
|
329 FFLAGS="-O" |
405
|
330 AC_VERBOSE([setting FFLAGS to $FFLAGS]) |
5
|
331 if test -n "$F77"; then |
|
332 export F77 |
|
333 FLIBS=`sh $srcdir/flibs.sh` |
405
|
334 AC_VERBOSE([setting FLIBS to $FLIBS]) |
5
|
335 DOT_O_DOT_F_C1= |
|
336 DOT_O_DOT_F_C2= |
|
337 DOT_O_DOT_F_C3= |
|
338 DOT_O_DOT_F_C4= |
|
339 DEFAULT_DOT_C_FROM_DOT_F= |
|
340 DEFAULT_DOT_O_FROM_DOT_F= |
|
341 elif test -n "$F2C" || $use_f2c; then |
|
342 AC_HAVE_LIBRARY(f2c, FLIBS=-lf2c, [])dnl |
|
343 if test -z "$FLIBS" ; then |
|
344 AC_HAVE_LIBRARY(F77, FLIBS=-lF77, [])dnl |
|
345 if test -n "$FLIBS" ; then |
|
346 AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl |
|
347 fi |
|
348 fi |
|
349 if test -z "$FLIBS" ; then |
405
|
350 AC_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
351 fi |
|
352 DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\ |
|
353 # If we are using f2c we should also turn off the default rule for\ |
|
354 # making objects from .f files so that we do not invoke the fortran\ |
|
355 # compiler by mistake.\ |
|
356 \ |
|
357 \%.c : \%.f\ |
|
358 cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
405
|
359 AC_VERBOSE([setting DEFAULT_DOT_C_FROM_DOT_F to $DEFAULT_DOT_C_FROM_DOT_F]) |
5
|
360 DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f' |
405
|
361 AC_VERBOSE([setting DEFAULT_DOT_O_FROM_DOT_F to $DEFAULT_DOT_O_FROM_DOT_F]) |
236
|
362 AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl |
5
|
363 else |
405
|
364 AC_WARN([in order to build octave, you must have a compatible]) |
|
365 AC_WARN([Fortran compiler or f2c installed and in your path.]) |
|
366 AC_WARN([See the file INSTALL for more information.]) |
|
367 AC_WARN([Continuing anyway...]) |
5
|
368 fi |
369
|
369 dnl |
5
|
370 AC_SUBST(FFLAGS)dnl |
|
371 AC_SUBST(FLIBS)dnl |
|
372 AC_SUBST(F2C)dnl |
|
373 AC_SUBST(F2CFLAGS)dnl |
|
374 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl |
|
375 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl |
369
|
376 dnl |
405
|
377 dnl Checks for header files. |
|
378 dnl |
5
|
379 AC_STDC_HEADERS |
402
|
380 AC_HAVE_HEADERS(string.h varargs.h unistd.h floatingpoint.h)dnl |
|
381 AC_HAVE_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h)dnl |
|
382 AC_HAVE_HEADERS(sys/ttold.h sys/ptem.h sys/select.h)dnl |
5
|
383 AC_DIR_HEADER |
369
|
384 dnl |
|
385 dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips |
|
386 dnl binary to an Alpha binary will work. |
|
387 dnl |
294
|
388 case "$canonical_host_type" in |
521
|
389 mips-dec-ultrix* | alpha-dec-osf*) |
405
|
390 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), []) |
294
|
391 ;; |
|
392 esac |
369
|
393 dnl |
5
|
394 case "$DEFS" in |
294
|
395 *HAVE_SGTTY_H*) |
5
|
396 ;; |
|
397 *) |
294
|
398 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1), |
|
399 AC_HEADER_CHECK(termio.h, AC_DEFINE(HAVE_TERMIO_H, 1), |
405
|
400 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), []))) |
5
|
401 ;; |
|
402 esac |
405
|
403 case "$DEFS" in |
|
404 *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*) |
|
405 ;; |
|
406 *) |
|
407 AC_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
408 ;; |
|
409 esac |
|
410 dnl |
|
411 dnl Checks for functions. |
|
412 dnl |
|
413 AC_HAVE_FUNCS(setvbuf getcwd gethostname bzero rindex vfprintf vsprintf)dnl |
|
414 AC_HAVE_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror)dnl |
638
|
415 AC_HAVE_FUNCS(atexit on_exit mktemp)dnl |
369
|
416 dnl |
|
417 dnl Check to see if we have IEEE math functions, and if so, which ones. |
|
418 dnl |
|
419 dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
420 dnl functions, otherwise we may not find them. |
|
421 dnl |
|
422 dnl Also just using AC_HAVE_FUNCS doesn't seem to work to find isinf |
|
423 dnl and isnan on Linux systems, so we use AC_FUNC_CHECK, and if that |
|
424 dnl fails, we try again by including math.h and invoking the function |
|
425 dnl with an argument. |
|
426 dnl |
|
427 dnl Also check for some additional trig functions that aren't ANSI but |
|
428 dnl are often available. If they are missing, we try to replace them |
|
429 dnl with functions from the BSD/NET2 math library. |
|
430 dnl |
28
|
431 AC_HAVE_LIBRARY(-lm)dnl |
405
|
432 dnl |
360
|
433 XCFLAGS="$CFLAGS" |
351
|
434 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
369
|
435 for func in finite isnan isinf |
|
436 do |
|
437 trfunc=`echo $func | tr '[a-z]' '[A-Z]'` |
|
438 AC_FUNC_CHECK([$func], |
|
439 AC_DEFINE(HAVE_[$trfunc], 1), |
|
440 AC_COMPILE_CHECK([$func], [#include <math.h>], [ |
|
441 /* The GNU C library defines this for functions which it implements |
|
442 to always fail with ENOSYS. Some functions are actually named |
|
443 something starting with __ and the normal name is an alias. */ |
|
444 #if defined (__stub_$func) || defined (__stub___$func) |
|
445 choke me |
|
446 #else |
|
447 /* Override any gcc2 internal prototype to avoid an error. */ |
|
448 $func (1.0); |
|
449 #endif |
|
450 ], |
|
451 AC_DEFINE(HAVE_[$trfunc], 1), []))dnl |
|
452 done |
|
453 dnl |
468
|
454 AC_HAVE_FUNCS(infinity quiet_nan)dnl |
638
|
455 AC_HAVE_FUNCS(erf erfc lgamma)dnl |
468
|
456 dnl |
360
|
457 CFLAGS="$XCFLAGS" |
405
|
458 dnl |
|
459 dnl Check for nonstandard but common trig functions that we need. |
|
460 dnl If they are missing, we replace them using functions from the BSD |
|
461 dnl math library, and we may need to replace some other functions too. |
|
462 dnl |
|
463 AC_REPLACE_FUNCS(acosh asinh atanh) |
369
|
464 dnl |
5
|
465 if test -n "$LIBOBJS"; then |
|
466 for func in $LIBOBJS |
|
467 do |
|
468 case "$func" in |
|
469 *acosh.o*) |
236
|
470 AC_DEFINE(ACOSH_MISSING, 1)dnl |
405
|
471 ;; |
5
|
472 *asinh.o*) |
236
|
473 AC_DEFINE(ASINH_MISSING, 1)dnl |
405
|
474 ;; |
5
|
475 *atanh.o*) |
236
|
476 AC_DEFINE(ATANH_MISSING, 1)dnl |
405
|
477 ;; |
5
|
478 esac |
|
479 done |
|
480 case $LIBOBJS in |
|
481 *acosh.o* | *asinh.o*) |
405
|
482 AC_REPLACE_FUNCS(copysign) |
|
483 ;; |
5
|
484 esac |
|
485 case $LIBOBJS in |
|
486 *acosh.o* | *asinh.o* | *atanh.o*) |
405
|
487 AC_REPLACE_FUNCS(log1p) |
|
488 ;; |
5
|
489 esac |
|
490 case $LIBOBJS in |
|
491 *log1p*) |
405
|
492 AC_REPLACE_FUNCS(log__L) |
|
493 ;; |
5
|
494 esac |
|
495 case $LIBOBJS in |
|
496 *log1p*) |
405
|
497 AC_REPLACE_FUNCS(finite) |
|
498 ;; |
5
|
499 esac |
|
500 case $LIBOBJS in |
|
501 *copysign* | *finite* | *log1p*) |
405
|
502 AC_REPLACE_FUNCS(logb scalb) |
|
503 ;; |
5
|
504 esac |
|
505 fi |
369
|
506 dnl |
405
|
507 dnl Checks for OS specific cruft. |
|
508 dnl |
|
509 AC_STRUCT_TM |
|
510 AC_SETVBUF_REVERSED |
|
511 TERMLIBS="" |
|
512 for termlib in termcap terminfo curses termlib ; do |
|
513 AC_HAVE_LIBRARY(${termlib}, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
|
514 case "${TERMLIBS}" in |
|
515 *-l${termlib}*) |
|
516 AC_VERBOSE([setting TERMLIBS to $TERMLIBS]) |
|
517 break |
|
518 ;; |
|
519 esac |
|
520 done |
505
|
521 dnl |
|
522 AC_COMPILE_CHECK([struct exception in math.h], |
|
523 [#include <math.h>], |
|
524 [struct exception *x; x->type; x->name;], |
|
525 AC_DEFINE(EXCEPTION_IN_MATH, 1), [])dnl |
|
526 dnl |
405
|
527 AC_SUBST(TERMLIBS) |
|
528 dnl |
|
529 dnl Define VOID_SIGHANDLER for readline. |
|
530 dnl |
|
531 AC_RETSIGTYPE |
|
532 case "$RETSIGTYPE" in |
|
533 int) |
|
534 ;; |
|
535 *) |
|
536 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
|
537 AC_VERBOSE([defining VOID_SIGHANDLER to be 1]) |
|
538 ;; |
|
539 esac |
|
540 AC_SUBST(VOID_SIGHANDLER)dnl |
|
541 dnl |
|
542 dnl Checks for other programs used for building, testing, installing, |
|
543 dnl and running Octave. |
369
|
544 dnl |
405
|
545 dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
546 dnl it, and it might not be installed. |
|
547 dnl |
|
548 dnl Also make sure that we generate an interactive scanner if we are |
|
549 dnl using flex. |
|
550 dnl |
|
551 AC_PROG_LEX |
|
552 case "$LEX" in |
|
553 flex*) |
|
554 LFLAGS="-t -I" |
|
555 AC_VERBOSE([setting LFLAGS to be $LFLAGS]) |
|
556 LEXLIB= |
|
557 ;; |
|
558 *) |
|
559 LFLAGS="-t" |
|
560 AC_VERBOSE([setting LFLAGS to be $LFLAGS]) |
|
561 AC_WARN([I didn't find flex, but that's only a problem]) |
|
562 AC_WARN([if you need to reconstruct lex.cc]) |
|
563 ;; |
|
564 esac |
|
565 AC_SUBST(LFLAGS)dnl |
|
566 dnl |
|
567 AC_PROG_YACC |
|
568 case "$YACC" in |
|
569 bison*) |
|
570 ;; |
|
571 *) |
|
572 AC_WARN([I didn't find bison, but that's only a problem]) |
|
573 AC_WARN([if you need to reconstruct parse.cc]) |
|
574 ;; |
|
575 esac |
|
576 dnl |
|
577 AC_PROG_RANLIB |
369
|
578 dnl |
5
|
579 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl |
|
580 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl |
|
581 if test -z "$EXPECT" ; then |
|
582 RUNTEST= |
|
583 fi |
|
584 AC_SUBST(RUNTEST)dnl |
369
|
585 dnl |
405
|
586 AC_PROG_INSTALL |
|
587 dnl |
|
588 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl |
|
589 if test -z "$GNUPLOT_BINARY"; then |
|
590 AC_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
591 AC_WARN([installed, but you won't be able to use any of Octave's]) |
|
592 AC_WARN([plotting commands without it.]) |
|
593 AC_WARN([]) |
|
594 AC_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
595 AC_WARN([tell Octave where to find it by typing the command]) |
|
596 AC_WARN([]) |
|
597 AC_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
598 AC_WARN([]) |
|
599 AC_WARN([at the Octave prompt.]) |
|
600 fi |
|
601 dnl |
|
602 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl |
|
603 if test -z "$DEFAULT_PAGER"; then |
|
604 AC_WARN([I couldn't find `less', `more', `page', or `pg']) |
|
605 elif test "$DEFAULT_PAGER" = less; then |
|
606 DEFAULT_PAGER="less -e" |
|
607 AC_VERBOSE([setting DEFAULT_PAGER to be $DEFAULT_PAGER]) |
|
608 fi |
|
609 dnl |
|
610 dnl Even though we include config.h in most files, some need to be |
|
611 dnl compiled with the -D options on the compiler command line. Use |
|
612 dnl UGLY_DEFS for that. |
|
613 dnl |
236
|
614 UGLY_DEFS="$DEFS" |
405
|
615 AC_VERBOSE([setting UGLY_DEFS to be $UGLY_DEFS]) |
236
|
616 AC_SUBST(UGLY_DEFS)dnl |
369
|
617 dnl |
405
|
618 dnl Maybe add -Wall to compiler flags now that we're done feature |
|
619 dnl testing. |
|
620 dnl |
|
621 if $ADD_CXX_WALL; then |
|
622 CXXFLAGS="$CXXFLAGS -Wall" |
|
623 AC_VERBOSE([adding -Wall to CXXFLAGS]) |
|
624 fi |
|
625 if $ADD_CC_WALL; then |
|
626 CFLAGS="$CFLAGS -Wall" |
|
627 AC_VERBOSE([adding -Wall to CFLAGS]) |
|
628 fi |
|
629 dnl |
|
630 dnl Do the substitutions in all the Makefiles. |
|
631 dnl |
39
|
632 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
633 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
634 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
635 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
636 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
637 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
638 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
|
639 define([tmph], [libcruft/ranlib/Makefile libcruft/villad/Makefile])dnl |
5
|
640 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph])dnl |
|
641 define([tmpA], [Makefile Makeconf libcruft/Makefile libcruft/Makerules])dnl |
179
|
642 define([tmpB], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
643 define([tmpC], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
5
|
644 define([tmpD], [readline/examples/Makefile doc/Makefile])dnl |
|
645 define([tmpE], [scripts/Makefile test/Makefile])dnl |
196
|
646 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE])dnl |
5
|
647 AC_OUTPUT([srcdirs cruftdirs])dnl |