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