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 |
1010
|
6 dnl Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
869
|
7 ### |
|
8 ### This file is part of Octave. |
|
9 ### |
|
10 ### Octave is free software; you can redistribute it and/or modify it |
|
11 ### under the terms of the GNU General Public License as published by the |
|
12 ### Free Software Foundation; either version 2, or (at your option) any |
|
13 ### later version. |
|
14 ### |
|
15 ### Octave is distributed in the hope that it will be useful, but WITHOUT |
|
16 ### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
17 ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
18 ### for more details. |
|
19 ### |
|
20 ### You should have received a copy of the GNU General Public License |
|
21 ### along with Octave; see the file COPYING. If not, write to the Free |
|
22 ### Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
23 |
1186
|
24 AC_REVISION($Revision: 1.106 $) |
859
|
25 AC_PREREQ(2.0) |
405
|
26 AC_INIT(src/octave.cc) |
1146
|
27 AC_CONFIG_HEADER(config.h) |
869
|
28 |
|
29 AC_DEFINE(OCTAVE_SOURCE, 1) |
|
30 |
859
|
31 AC_CANONICAL_HOST |
885
|
32 if test -z "$host"; then |
|
33 host=unknown |
|
34 fi |
|
35 target_host_type=$host |
|
36 canonical_host_type=$host |
|
37 if test "$host" = unknown; then |
869
|
38 AC_MSG_WARN([configuring Octave for unknown system type |
859
|
39 ]) |
294
|
40 fi |
869
|
41 AC_SUBST(target_host_type) |
|
42 |
|
43 ### Allow the user to force us to use f2c. |
|
44 |
832
|
45 AC_ARG_WITH(f2c, |
|
46 [ --with-f2c use f2c even if Fortran compiler is available], |
1177
|
47 [if test $withval = no; then use_f2c=false; else use_f2c=true; fi], |
|
48 use_f2c=false) |
|
49 |
|
50 ### Allow the user to force us to use g77. |
|
51 |
|
52 AC_ARG_WITH(g77, |
|
53 [ --with-g77 use g77 to compile Fortran subroutines], |
|
54 [if test $withval = no; then use_g77=false; else use_g77=true; fi], |
|
55 use_g77=false) |
|
56 |
|
57 if $use_f2c && $use_g77; then |
|
58 AC_MSG_WARN([--with-f2c and --with-g77 both specified! Using g77...]) |
|
59 use_f2c=false |
|
60 fi |
869
|
61 |
|
62 ### Allow the user to experiment with dynamic linking using GNU dld. |
|
63 |
832
|
64 AC_ARG_ENABLE(dld, |
|
65 [ --enable-dld use DLD for dynamic linking (not all systems)], |
1177
|
66 [if test $enableval = no; then use_dld=false; else use_dld=true; fi], |
|
67 use_dld=false) |
869
|
68 AC_SUBST(use_dld) |
|
69 |
|
70 ### Allow compilation of smaller kernel. This only works if some form |
|
71 ### of dynamic linking is also supported and used. |
|
72 |
832
|
73 AC_ARG_ENABLE(lite-kernel, |
|
74 [ --enable-lite-kernel compile smaller kernel (requires DLD)], |
1177
|
75 [if test $enableval = no; then lite_kernel=false; else lite_kernel=true; fi], |
|
76 lite_kernel=false) |
702
|
77 if $lite_kernel; then |
869
|
78 AC_DEFINE(OCTAVE_LITE, 1) |
702
|
79 fi |
869
|
80 AC_SUBST(lite_kernel) |
|
81 |
1137
|
82 ### Allow the user disable support for GNU info. |
|
83 |
|
84 USE_GNU_INFO=true |
1152
|
85 LIBINFO=../info/libinfo.a |
1137
|
86 AC_ARG_ENABLE(info, |
|
87 [ --enable-info use GNU info (default is yes)], |
1177
|
88 [if test $enableval = no; then USE_GNU_INFO=false; LIBINFO=""; fi], []) |
1152
|
89 AC_SUBST(USE_GNU_INFO) |
1145
|
90 AC_SUBST(LIBINFO) |
1137
|
91 |
1138
|
92 ### Allow the user disable support for command line editing using GNU |
|
93 ### readline. |
|
94 |
|
95 USE_READLINE=true |
1152
|
96 LIBREADLINE=../readline/libreadline.a |
1138
|
97 AC_ARG_ENABLE(readline, |
|
98 [ --enable-readline use readline library (default is yes)], |
1177
|
99 [if test "$enableval" = no; then USE_READLINE=false; LIBREADLINE=""; fi], []) |
1152
|
100 AC_SUBST(USE_READLINE) |
1145
|
101 AC_SUBST(LIBREADLINE) |
1138
|
102 |
869
|
103 ### some defaults |
|
104 |
859
|
105 AC_PREFIX_DEFAULT(/usr/local) |
869
|
106 |
666
|
107 exec_prefix='$(prefix)' |
|
108 bindir='$(exec_prefix)/bin' |
|
109 datadir='$(prefix)/lib' |
|
110 libdir='$(exec_prefix)/lib' |
765
|
111 includedir='$(prefix)/include/octave' |
666
|
112 mandir='$(prefix)/man/man1' |
|
113 infodir='$(prefix)/info' |
684
|
114 fcnfiledir='$(datadir)/octave/$(version)/m' |
827
|
115 localfcnfiledir='$(datadir)/octave/site/m' |
|
116 localfcnfilepath='$(localfcnfiledir)//' |
795
|
117 archlibdir='$(libdir)/octave/$(version)/exec/$(target_host_type)' |
|
118 octfiledir='$(libdir)/octave/$(version)/oct/$(target_host_type)' |
827
|
119 localoctfiledir='$(datadir)/octave/site/oct/$(target_host_type)' |
|
120 localoctfilepath='$(localoctfiledir)//' |
765
|
121 fcnfilepath='.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//' |
827
|
122 imagedir='$(datadir)/octave/$(version)/imagelib' |
|
123 imagepath='.:$(imagedir)//' |
869
|
124 |
832
|
125 AC_MSG_RESULT([defining prefix to be $prefix]) |
|
126 AC_MSG_RESULT([defining exec_prefix to be $exec_prefix]) |
|
127 AC_MSG_RESULT([defining bindir to be $bindir]) |
|
128 AC_MSG_RESULT([defining datadir to be $datadir]) |
|
129 AC_MSG_RESULT([defining libdir to be $libdir]) |
|
130 AC_MSG_RESULT([defining includedir to be $includedir]) |
|
131 AC_MSG_RESULT([defining mandir to be $mandir]) |
|
132 AC_MSG_RESULT([defining infodir to be $infodir]) |
|
133 AC_MSG_RESULT([defining fcnfiledir to be $fcnfiledir]) |
|
134 AC_MSG_RESULT([defining localfcnfiledir to be $localfcnfiledir]) |
|
135 AC_MSG_RESULT([defining localfcnfilepath to be $localfcnfilepath]) |
|
136 AC_MSG_RESULT([defining archlibdir to be $archlibdir]) |
|
137 AC_MSG_RESULT([defining octfiledir to be $octfiledir]) |
|
138 AC_MSG_RESULT([defining localoctfiledir to be $localoctfiledir]) |
|
139 AC_MSG_RESULT([defining localoctfilepath to be $localoctfilepath]) |
|
140 AC_MSG_RESULT([defining fcnfilepath to be $fcnfilepath]) |
|
141 AC_MSG_RESULT([defining imagedir to be $imagedir]) |
|
142 AC_MSG_RESULT([defining imagepath to be $imagepath]) |
666
|
143 AC_SUBST(exec_prefix) |
|
144 AC_SUBST(bindir) |
|
145 AC_SUBST(datadir) |
|
146 AC_SUBST(libdir) |
|
147 AC_SUBST(includedir) |
|
148 AC_SUBST(mandir) |
|
149 AC_SUBST(infodir) |
|
150 AC_SUBST(fcnfiledir) |
827
|
151 AC_SUBST(localfcnfiledir) |
666
|
152 AC_SUBST(localfcnfilepath) |
|
153 AC_SUBST(archlibdir) |
|
154 AC_SUBST(octfiledir) |
827
|
155 AC_SUBST(localoctfiledir) |
666
|
156 AC_SUBST(localoctfilepath) |
|
157 AC_SUBST(fcnfilepath) |
827
|
158 AC_SUBST(imagedir) |
684
|
159 AC_SUBST(imagepath) |
869
|
160 |
1104
|
161 ### Path separator. |
|
162 |
|
163 AC_DEFINE(SEPCHAR, [':']) |
|
164 AC_DEFINE(SEPCHAR_STR, [":"]) |
|
165 |
869
|
166 ### Do special stuff if using dld. |
|
167 |
5
|
168 DLD_DIR= |
|
169 LIBDLD= |
759
|
170 LIBOCTDLD='liboctdld.a' |
5
|
171 LD_STATIC_FLAG= |
|
172 if $use_dld; then |
518
|
173 DLD_DIR=dld |
759
|
174 LIBDLD='../dld/libdld.a' |
702
|
175 # don't link them in only if doing dynamic linking and small kernel |
|
176 # requested. |
|
177 if $lite_kernel; then |
|
178 LIBOCTDLD= |
|
179 fi |
518
|
180 LD_STATIC_FLAG=-static |
869
|
181 AC_DEFINE(WITH_DLD, 1) |
518
|
182 fi |
869
|
183 |
|
184 ### Also use -static if compiling on Alpha OSF/1 1.3 systems. |
|
185 |
781
|
186 case "$canonical_host_type" in |
|
187 alpha-dec-osf1.3) |
|
188 LD_STATIC_FLAG=-static |
|
189 ;; |
|
190 esac |
869
|
191 |
518
|
192 if test -n "$DLD_DIR"; then |
832
|
193 AC_MSG_RESULT([defining DLD_DIR to be $DLD_DIR]) |
518
|
194 fi |
|
195 if test -n "$LIBDLD"; then |
832
|
196 AC_MSG_RESULT([defining LIBDLD to be $LIBDLD]) |
518
|
197 fi |
|
198 if test -n "$LIBOCTDLD"; then |
832
|
199 AC_MSG_RESULT([defining LIBOCTDLD to be $LIBOCTDLD]) |
518
|
200 fi |
|
201 if test -n "$LD_STATIC_FLAG"; then |
832
|
202 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
5
|
203 fi |
869
|
204 AC_SUBST(DLD_DIR) |
|
205 AC_SUBST(LIBDLD) |
|
206 AC_SUBST(LIBOCTDLD) |
|
207 AC_SUBST(LD_STATIC_FLAG) |
|
208 |
|
209 ### See if the optional nonlinear programming code is present. |
|
210 |
832
|
211 AC_MSG_CHECKING([for npsol]) |
5
|
212 if test -f $srcdir/libcruft/npsol/npsol.f; then |
832
|
213 AC_MSG_RESULT([yes]) |
5
|
214 else |
832
|
215 AC_MSG_RESULT([no]) |
869
|
216 AC_DEFINE(NPSOL_MISSING, 1) |
5
|
217 fi |
869
|
218 |
832
|
219 AC_MSG_CHECKING([for qpsol]) |
5
|
220 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
832
|
221 AC_MSG_RESULT([yes]) |
5
|
222 else |
832
|
223 AC_MSG_RESULT([no]) |
869
|
224 AC_DEFINE(QPSOL_MISSING, 1) |
5
|
225 fi |
869
|
226 |
832
|
227 AC_MSG_CHECKING([for fsqp]) |
5
|
228 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
832
|
229 AC_MSG_RESULT([yes]) |
5
|
230 else |
832
|
231 AC_MSG_RESULT([no]) |
869
|
232 AC_DEFINE(FSQP_MISSING, 1) |
5
|
233 fi |
869
|
234 |
|
235 ### See which C++ compiler to use (we expect to find g++). |
|
236 |
405
|
237 AC_PROG_CXX |
|
238 AC_PROG_CXXCPP |
869
|
239 |
|
240 ### Do special things for g++. |
|
241 |
405
|
242 ADD_CXX_WALL=false |
759
|
243 NO_IMPLICIT_TEMPLATES= |
405
|
244 gxx_version=`$CXX -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'` |
|
245 case "$gxx_version" in |
832
|
246 changequote(,)dnl |
|
247 2.[6789].*|2.[123456789][0123456789].*) |
|
248 changequote([,])dnl |
1087
|
249 if test -z "$CXXFLAGS"; then |
|
250 CXXFLAGS="-g -O" |
|
251 AC_MSG_RESULT([defining CXXFLAGS to be $CXXFLAGS]) |
|
252 ADD_CXX_WALL=true |
|
253 fi |
759
|
254 NO_IMPLICIT_TEMPLATES="-fno-implicit-templates" |
832
|
255 AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES]) |
405
|
256 ;; |
832
|
257 changequote(,)dnl |
|
258 1.*|2.[012345].*) |
|
259 changequote([,])dnl |
|
260 AC_MSG_WARN([g++ version $gxx_version will not work to compile Octave]) |
405
|
261 ;; |
|
262 *) |
832
|
263 AC_MSG_WARN([Octave has only been tested with g++, and I can't find it]) |
405
|
264 ;; |
|
265 esac |
869
|
266 |
1018
|
267 HOST_CXXFLAGS= |
965
|
268 case "$gxx_version" in |
|
269 2.6.*) |
|
270 case "$canonical_host_type" in |
|
271 rs6000-ibm-aix*) |
1018
|
272 HOST_CXXFLAGS="-Wa,-u" |
|
273 AC_MSG_RESULT([defining HOST_CXXFLAGS to be $HOST_CXXFLAGS]) |
965
|
274 ;; |
|
275 esac |
|
276 ;; |
|
277 esac |
|
278 |
1018
|
279 AC_SUBST(HOST_CXXFLAGS) |
|
280 |
869
|
281 ### See what libraries are used by the C++ compiler. Need this for |
|
282 ### dynamic linking. |
|
283 |
1175
|
284 if test -n "$CXX"; then |
|
285 export CXX |
|
286 fi |
708
|
287 CXXLIBS=`sh $srcdir/cxxlibs.sh` |
832
|
288 AC_MSG_RESULT([defining CXXLIBS to be $CXXLIBS]) |
869
|
289 |
|
290 AC_SUBST(CXXFLAGS) |
|
291 AC_SUBST(NO_IMPLICIT_TEMPLATES) |
|
292 AC_SUBST(CXXLIBS) |
|
293 |
|
294 ### See which C compiler to use (we expect to find gcc). |
|
295 |
5
|
296 AC_PROG_CC |
405
|
297 AC_PROG_CPP |
832
|
298 AC_PROG_GCC_TRADITIONAL |
869
|
299 |
|
300 ### Do special things for gcc. |
|
301 |
405
|
302 ADD_CC_WALL=false |
|
303 gcc_version=`$CC -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` |
|
304 case "$gcc_version" in |
|
305 2.*) |
1087
|
306 if test -z "$CFLAGS"; then |
|
307 CFLAGS="-g -O" |
|
308 AC_MSG_RESULT([defining CFLAGS to be $CFLAGS]) |
|
309 ADD_CC_WALL=true |
|
310 fi |
|
311 if test -z "$LDFLAGS"; then |
|
312 LDFLAGS="-g" |
|
313 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
314 fi |
405
|
315 ;; |
|
316 1.*) |
832
|
317 AC_MSG_WARN([gcc version $gcc_version is likely to cause problems]) |
405
|
318 ;; |
5
|
319 *) |
832
|
320 AC_MSG_WARN([Octave has only been tested with gcc, and I can't find it]) |
405
|
321 ;; |
5
|
322 esac |
869
|
323 |
|
324 AC_SUBST(CFLAGS) |
|
325 AC_SUBST(LDFLAGS) |
|
326 |
|
327 ### On Linux systems we need to compile with -mieee-fp to get full |
|
328 ### support for IEEE floating point. |
|
329 |
350
|
330 case "$canonical_host_type" in |
|
331 i386-*-linux | i486-*-linux | i586-*-linux) |
|
332 GCC_IEEE_FP_FLAG="-mieee-fp" |
832
|
333 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
324
|
334 ;; |
|
335 esac |
869
|
336 |
|
337 AC_SUBST(GCC_IEEE_FP_FLAG) |
|
338 |
|
339 ### Special checks for odd OS specific things. |
|
340 |
405
|
341 AC_ISC_POSIX |
|
342 AC_MINIX |
|
343 AC_AIX |
832
|
344 AC_CHECK_LIB(sun, getpwnam) |
869
|
345 |
|
346 ### How big are ints and how are they oriented? These could probably |
|
347 ### be eliminated in favor of run-time checks. |
|
348 |
832
|
349 AC_CHECK_SIZEOF(short) |
|
350 AC_CHECK_SIZEOF(int) |
|
351 AC_CHECK_SIZEOF(long) |
|
352 AC_C_BIGENDIAN |
869
|
353 |
|
354 ### Try to determine the floating point format. This could probably |
|
355 ### be eliminated in favor of run-time checks. |
|
356 |
832
|
357 AC_MSG_CHECKING([floating point format]) |
602
|
358 changequote(,)dnl |
|
359 XCFLAGS=`echo $CFLAGS | sed 's/-O[^ \t]*//'` |
|
360 changequote([,])dnl |
|
361 ${CC-cc} -DDP $XCFLAGS $LDFLAGS $srcdir/float-type.c -o conftest >/dev/null 2>&1 |
588
|
362 FLOAT_FORMAT=`./conftest` |
|
363 case "$FLOAT_FORMAT" in |
|
364 IEEE_BIG_ENDIAN) |
832
|
365 AC_MSG_RESULT([IEEE big endian]) |
869
|
366 AC_DEFINE(IEEE_BIG_ENDIAN, 1) |
588
|
367 ;; |
|
368 IEEE_LITTLE_ENDIAN) |
832
|
369 AC_MSG_RESULT([IEEE little endian]) |
869
|
370 AC_DEFINE(IEEE_LITTLE_ENDIAN, 1) |
588
|
371 ;; |
|
372 VAX_D_FLOAT) |
832
|
373 AC_MSG_RESULT([VAX D floating]) |
869
|
374 AC_DEFINE(VAX_D_FLOAT, 1) |
588
|
375 ;; |
|
376 VAX_G_FLOAT) |
832
|
377 AC_MSG_RESULT([VAX G floating]) |
869
|
378 AC_DEFINE(VAX_G_FLOAT, 1) |
588
|
379 ;; |
|
380 *) |
832
|
381 AC_MSG_RESULT() |
|
382 AC_MSG_WARN("unrecognized floating point format!") |
588
|
383 ;; |
|
384 esac |
869
|
385 |
|
386 ### Does the C compiler handle alloca() and const correctly? |
|
387 |
405
|
388 AC_ALLOCA |
832
|
389 AC_C_CONST |
869
|
390 |
|
391 ### If we haven't been forced to use f2c, try to find a Fortran compiler |
|
392 ### under any one of several common Un*x Fortran compiler names. |
|
393 ### Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
394 ### builtin. |
|
395 ### |
|
396 ### xlf : IBM / AIX |
|
397 ### cf77 : Cray / Unicos |
|
398 ### g77 : GNU Fortran (someday...) |
|
399 ### fc : Convex |
|
400 ### |
|
401 ### I don't think the Cray compiler will ever work like f2c... |
|
402 |
1177
|
403 if $use_g77; then |
|
404 F77=g77 |
|
405 fi |
|
406 |
|
407 if test -n "$F77"; then |
|
408 export F77 |
|
409 fi |
|
410 |
5
|
411 if $use_f2c; then |
|
412 true |
|
413 else |
869
|
414 AC_CHECK_PROGS(F77, xlf cf77 f77 g77 fc) |
5
|
415 |
|
416 # If it looks like we have a Fortran compiler, try to determine |
|
417 # whether it might be compatible with f2c. |
|
418 |
|
419 if test -n "$F77"; then |
832
|
420 AC_MSG_CHECKING([$F77/f2c compatibility]) |
5
|
421 export F77 |
|
422 export CC |
|
423 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
424 status=$? |
|
425 if test $status -eq 0; then |
832
|
426 AC_MSG_RESULT([yes]) |
5
|
427 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
869
|
428 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
429 fi |
|
430 else |
832
|
431 AC_MSG_RESULT([no]) |
5
|
432 F77= |
|
433 fi |
|
434 fi |
|
435 fi |
869
|
436 |
|
437 ### If we can't find a Fortran compiler, or if it looks like it isn't |
|
438 ### compatible with f2c, try to find f2c. |
|
439 |
5
|
440 if test -z "$F77"; then |
869
|
441 AC_CHECK_PROG(F2C, f2c, f2c, []) |
5
|
442 fi |
869
|
443 |
1087
|
444 if test -z "$F2CFLAGS"; then |
|
445 F2CFLAGS= |
|
446 fi |
|
447 |
|
448 if test -z "$FFLAGS"; then |
|
449 FFLAGS="-O" |
|
450 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
451 fi |
|
452 |
5
|
453 if test -n "$F77"; then |
1177
|
454 if test "$F77" = "g77"; then |
|
455 FUGLY=-fugly |
|
456 AC_MSG_RESULT([defining FUGLY to be $FUGLY]) |
|
457 fi |
5
|
458 export F77 |
|
459 FLIBS=`sh $srcdir/flibs.sh` |
832
|
460 AC_MSG_RESULT([defining FLIBS to be $FLIBS]) |
995
|
461 DOT_C_FROM_DOT_F_CMD= |
1177
|
462 DOT_O_FROM_DOT_F_PAT='.f.o:' |
|
463 DOT_O_FROM_DOT_F_CMD=' $(FC) -c $(ALL_FFLAGS) $<' |
5
|
464 elif test -n "$F2C" || $use_f2c; then |
869
|
465 AC_CHECK_LIB(f2c, main, FLIBS=-lf2c, []) |
5
|
466 if test -z "$FLIBS" ; then |
869
|
467 AC_CHECK_LIB(F77, main, FLIBS=-lF77, []) |
5
|
468 if test -n "$FLIBS" ; then |
869
|
469 AC_CHECK_LIB(I77, main, FLIBS="$FLIBS -lI77", []) |
5
|
470 fi |
|
471 fi |
|
472 if test -z "$FLIBS" ; then |
832
|
473 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
474 fi |
995
|
475 DOT_C_FROM_DOT_F_CMD=' cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
|
476 AC_MSG_RESULT([defining DOT_C_FROM_DOT_F_CMD to be $DOT_C_FROM_DOT_F_CMD]) |
|
477 DOT_O_FROM_DOT_F_PAT='%.o : %.f' |
1177
|
478 DOT_O_FROM_DOT_F_CMD= |
995
|
479 AC_MSG_RESULT([defining DOT_O_FROM_DOT_F_PAT to be $DOT_O_FROM_DOT_F_PAT]) |
869
|
480 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
481 else |
832
|
482 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
483 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
|
484 AC_MSG_WARN([See the file INSTALL for more information.]) |
|
485 AC_MSG_WARN([Continuing anyway...]) |
5
|
486 fi |
869
|
487 |
1163
|
488 FC=$F77 |
|
489 AC_SUBST(FC) |
869
|
490 AC_SUBST(F77) |
|
491 AC_SUBST(FFLAGS) |
1177
|
492 AC_SUBST(FUGLY) |
869
|
493 AC_SUBST(FLIBS) |
|
494 AC_SUBST(F2C) |
|
495 AC_SUBST(F2CFLAGS) |
995
|
496 AC_SUBST(DOT_C_FROM_DOT_F_CMD) |
|
497 AC_SUBST(DOT_O_FROM_DOT_F_PAT) |
1177
|
498 AC_SUBST(DOT_O_FROM_DOT_F_CMD) |
869
|
499 |
|
500 ### Extract libraries and directories from FLIBS and CXXLIBS. |
|
501 ### |
|
502 ### Leave only libraries, with -lfoo converted to libfoo.a: |
|
503 |
708
|
504 changequote(,)dnl |
843
|
505 FLIB_LIST=`echo " $FLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
506 -e 's/ -[LR] *[^ ]*/ /g' \ |
843
|
507 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
508 -e 's/ [^ ]*\.o//g' \ |
832
|
509 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
510 |
843
|
511 CXXLIB_LIST=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
512 -e 's/ -[LR] *[^ ]*/ /g' \ |
843
|
513 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
514 -e 's/ [^ ]*\.o//g' \ |
708
|
515 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
516 |
|
517 ### Leave only directories where libraries might be found: |
|
518 |
843
|
519 FLIB_PATH=`echo " $FLIBS " | sed \ |
|
520 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
521 -e 's/ -[LR] *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
1069
|
522 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
523 -e 's/ [^ ]*\.o//g' \ |
|
524 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
525 |
843
|
526 CXXLIB_PATH=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
527 -e 's/ -[LR] *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
843
|
528 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
1069
|
529 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
530 -e 's/ [^ ]*\.o//g' \ |
|
531 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
708
|
532 changequote([,])dnl |
869
|
533 |
832
|
534 AC_MSG_RESULT([defining FLIB_LIST to be $FLIB_LIST]) |
|
535 AC_MSG_RESULT([defining FLIB_PATH to be $FLIB_PATH]) |
869
|
536 |
832
|
537 AC_MSG_RESULT([defining CXXLIB_LIST to be $CXXLIB_LIST]) |
|
538 AC_MSG_RESULT([defining CXXLIB_PATH to be $CXXLIB_PATH]) |
869
|
539 |
|
540 AC_SUBST(FLIB_LIST) |
|
541 AC_SUBST(FLIB_PATH) |
|
542 |
|
543 AC_SUBST(CXXLIB_LIST) |
|
544 AC_SUBST(CXXLIB_PATH) |
|
545 |
|
546 ### Checks for header files. |
|
547 |
832
|
548 AC_HEADER_STDC |
869
|
549 AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h) |
|
550 AC_CHECK_HEADERS(string.h varargs.h unistd.h floatingpoint.h) |
|
551 AC_CHECK_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h) |
936
|
552 AC_CHECK_HEADERS(sys/ttold.h sys/ptem.h sys/select.h sys/resource.h) |
832
|
553 AC_HEADER_DIRENT |
792
|
554 AC_TIME_WITH_SYS_TIME |
869
|
555 |
|
556 ### Use sgtty on Ultrix so that using DEC Migrate to convert a Mips |
|
557 ### binary to an Alpha binary will work. Also on Alpha/OSF to avoid |
|
558 ### a readline bug. |
|
559 |
294
|
560 case "$canonical_host_type" in |
521
|
561 mips-dec-ultrix* | alpha-dec-osf*) |
869
|
562 AC_CHECK_HEADER(sgtty.h, [AC_DEFINE(HAVE_SGTTY_H, 1)], []) |
|
563 |
|
564 if test "$ac_cv_header_sgtty_h" = no; then |
|
565 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
|
566 fi |
|
567 ;; |
|
568 *) |
|
569 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
294
|
570 ;; |
|
571 esac |
869
|
572 |
|
573 if test "$ac_cv_header_termios_h" = yes \ |
|
574 || test "$ac_cv_header_termio_h" = yes \ |
|
575 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
576 true |
|
577 else |
|
578 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
579 fi |
869
|
580 |
|
581 ### Checks for functions. |
|
582 |
966
|
583 AC_CHECK_FUNCS(setvbuf getcwd gethostname bzero bcopy rindex vfprintf vsprintf) |
903
|
584 AC_CHECK_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror atexit) |
|
585 AC_CHECK_FUNCS(on_exit tempnam memmove putenv gettimeofday getrusage) |
869
|
586 |
832
|
587 dnl Would like to get rid of this cruft, and just have |
|
588 dnl |
|
589 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
590 dnl |
|
591 dnl instead, but that used to fail on some systems... |
369
|
592 dnl |
832
|
593 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
594 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
595 dnl fails, we try again by including math.h and invoking the function |
|
596 dnl with an argument. |
869
|
597 |
|
598 ### Check to see if we have IEEE math functions, and if so, which ones. |
|
599 ### |
|
600 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
601 ### functions, otherwise we may not find them. |
|
602 ### |
|
603 ### Also check for some additional trig functions that aren't ANSI but |
|
604 ### are often available. If they are missing, we try to replace them |
|
605 ### with functions from the BSD/NET2 math library. |
|
606 |
|
607 AC_CHECK_LIB(sunmath, main) |
1070
|
608 |
|
609 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
610 |
|
611 case "$canonical_host_type" in |
|
612 *-*-linux*) |
|
613 AC_CHECK_LIB(m, main, , , -lc) |
|
614 ;; |
|
615 *) |
|
616 AC_CHECK_LIB(m, main) |
|
617 ;; |
|
618 esac |
869
|
619 |
360
|
620 XCFLAGS="$CFLAGS" |
351
|
621 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
622 |
1075
|
623 ### Inf and NaN don't work with gcc on the Alpha yet. I am also told |
|
624 ### that they don't work on m68k HP sytems either. |
956
|
625 |
|
626 case "$canonical_host_type" in |
1075
|
627 alpha-dec-osf* | m68k-hp-hpux*) |
956
|
628 ;; |
|
629 *) |
|
630 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
631 ;; |
|
632 esac |
|
633 |
1076
|
634 ### Check for nonstandard but common math functions that we need. |
|
635 |
1172
|
636 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
637 |
360
|
638 CFLAGS="$XCFLAGS" |
869
|
639 |
|
640 ### Checks for OS specific cruft. |
|
641 |
405
|
642 AC_STRUCT_TM |
1186
|
643 AC_STRUCT_TIMEZONE |
832
|
644 AC_FUNC_SETVBUF_REVERSED |
405
|
645 TERMLIBS="" |
|
646 for termlib in termcap terminfo curses termlib ; do |
832
|
647 AC_CHECK_LIB(${termlib}, main, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
648 case "${TERMLIBS}" in |
|
649 *-l${termlib}*) |
832
|
650 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
651 break |
|
652 ;; |
|
653 esac |
|
654 done |
869
|
655 |
832
|
656 AC_MSG_CHECKING([for struct exception in math.h]) |
|
657 AC_TRY_LINK([#include <math.h>], |
|
658 [struct exception *x; x->type; x->name;], |
835
|
659 AC_MSG_RESULT(yes) |
832
|
660 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
661 AC_MSG_RESULT(no)) |
|
662 |
405
|
663 AC_SUBST(TERMLIBS) |
869
|
664 |
|
665 ### Signal stuff. |
|
666 |
834
|
667 AC_TYPE_SIGNAL |
885
|
668 AC_DECL_SYS_SIGLIST |
|
669 AC_MSG_CHECKING([for sys_siglist variable]) |
|
670 AC_TRY_LINK([#include <stdio.h>], |
|
671 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
672 AC_MSG_RESULT(yes) |
|
673 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
674 AC_MSG_RESULT(no)) |
869
|
675 |
|
676 ### Define VOID_SIGHANDLER for readline. |
|
677 |
405
|
678 case "$RETSIGTYPE" in |
|
679 int) |
|
680 ;; |
|
681 *) |
|
682 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
683 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
684 ;; |
|
685 esac |
869
|
686 AC_SUBST(VOID_SIGHANDLER) |
|
687 |
|
688 ### Checks for other programs used for building, testing, installing, |
|
689 ### and running Octave. |
|
690 ### |
|
691 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
692 ### it, and it might not be installed. |
|
693 ### |
|
694 ### Also make sure that we generate an interactive scanner if we are |
|
695 ### using flex. |
|
696 |
405
|
697 AC_PROG_LEX |
|
698 case "$LEX" in |
|
699 flex*) |
|
700 LFLAGS="-t -I" |
832
|
701 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
702 LEXLIB= |
|
703 ;; |
|
704 *) |
|
705 LFLAGS="-t" |
832
|
706 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
707 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
708 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
709 ;; |
|
710 esac |
869
|
711 AC_SUBST(LFLAGS) |
|
712 |
405
|
713 AC_PROG_YACC |
|
714 case "$YACC" in |
|
715 bison*) |
|
716 ;; |
|
717 *) |
832
|
718 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
719 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
720 ;; |
|
721 esac |
869
|
722 |
405
|
723 AC_PROG_RANLIB |
869
|
724 |
|
725 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
726 AC_CHECK_PROG(EXPECT, expect, expect, []) |
5
|
727 if test -z "$EXPECT" ; then |
|
728 RUNTEST= |
|
729 fi |
869
|
730 AC_SUBST(RUNTEST) |
|
731 |
405
|
732 AC_PROG_INSTALL |
869
|
733 |
|
734 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
405
|
735 if test -z "$GNUPLOT_BINARY"; then |
832
|
736 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
737 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
738 AC_MSG_WARN([plotting commands without it.]) |
|
739 AC_MSG_WARN([]) |
|
740 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
741 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
742 AC_MSG_WARN([]) |
|
743 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
744 AC_MSG_WARN([]) |
|
745 AC_MSG_WARN([at the Octave prompt.]) |
405
|
746 fi |
869
|
747 |
|
748 AC_CHECK_PROGS(DEFAULT_PAGER, less more page pg, []) |
405
|
749 if test -z "$DEFAULT_PAGER"; then |
832
|
750 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
751 elif test "$DEFAULT_PAGER" = less; then |
|
752 DEFAULT_PAGER="less -e" |
832
|
753 AC_MSG_RESULT([defining DEFAULT_PAGER to be $DEFAULT_PAGER]) |
405
|
754 fi |
869
|
755 |
|
756 ### Even though we include config.h in most files, some need to be |
|
757 ### compiled with the -D options on the compiler command line. Use |
|
758 ### UGLY_DEFS for that. |
|
759 |
832
|
760 AC_OUTPUT_MAKE_DEFS |
236
|
761 UGLY_DEFS="$DEFS" |
832
|
762 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
869
|
763 AC_SUBST(UGLY_DEFS) |
|
764 |
|
765 ### Maybe add -Wall to compiler flags now that we're done feature |
|
766 ### testing. |
|
767 ### |
|
768 ### To get gcc and g++ to be really picky, try these adding these |
|
769 ### options to CFLAGS and CXXFLAGS along with -Wall: |
|
770 ### |
|
771 ### -ansi |
|
772 ### -pedantic |
|
773 ### -Wwrite-strings |
|
774 ### -Wid-clash-31 |
|
775 ### -Wpointer-arith |
|
776 ### -Wcast-qual |
|
777 ### -Wenum-clash |
|
778 ### -Wcast-align |
|
779 ### -Wtraditional |
|
780 ### -Wstrict-prototypes |
|
781 ### -Wmissing-prototypes |
|
782 ### -Wnested-externs |
|
783 ### -Woverloaded-virtual |
|
784 ### -Winline |
|
785 ### -felide-constructors |
|
786 ### -fnonnull-objects |
|
787 |
405
|
788 if $ADD_CXX_WALL; then |
|
789 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
790 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
791 fi |
|
792 if $ADD_CC_WALL; then |
|
793 CFLAGS="$CFLAGS -Wall" |
832
|
794 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
795 fi |
869
|
796 |
1146
|
797 ### Run configure in subdirectories. |
|
798 |
|
799 AC_CONFIG_SUBDIRS(kpathsea) |
|
800 |
869
|
801 ### Do the substitutions in all the Makefiles. |
|
802 |
837
|
803 define([tmpA], [Makefile octMakefile Makeconf])dnl |
|
804 define([tmpB], [libcruft/Makefile libcruft/Makerules])dnl |
|
805 define([tmpC], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
806 define([tmpD], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
|
807 define([tmpE], [readline/examples/Makefile doc/Makefile])dnl |
1146
|
808 define([tmpF], [test/Makefile])dnl |
837
|
809 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE tmpF])dnl |
869
|
810 |
39
|
811 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
812 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
813 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
814 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
815 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
816 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
817 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
1075
|
818 define([tmph], [libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile])dnl |
|
819 define([tmpi], [libcruft/villad/Makefile])dnl |
869
|
820 |
1075
|
821 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph tmpi])dnl |
684
|
822 define([tmpSA], [scripts/Makefile scripts/control/Makefile])dnl |
869
|
823 define([tmpSB], [scripts/general/Makefile scripts/image/Makefile]) |
684
|
824 define([tmpSC], [scripts/linear-algebra/Makefile])dnl |
|
825 define([tmpSD], [scripts/miscellaneous/Makefile scripts/plot/Makefile])dnl |
|
826 define([tmpSE], [scripts/polynomial/Makefile scripts/set/Makefile])dnl |
|
827 define([tmpSF], [scripts/signal/Makefile scripts/special-matrix/Makefile])dnl |
733
|
828 define([tmpSG], [scripts/startup/Makefile scripts/statistics/Makefile])dnl |
717
|
829 define([tmpSH], [scripts/elfun/Makefile scripts/specfun/Makefile])dnl |
937
|
830 define([tmpSI], [scripts/strings/Makefile])dnl |
|
831 define([mdirs], [tmpSA tmpSB tmpSC tmpSD tmpSE tmpSF tmpSG tmpSH tmpSI])dnl |
869
|
832 |
937
|
833 AC_OUTPUT([srcdirs cruftdirs mdirs]) |