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