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