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