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