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