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