405
|
1 dnl configure.in |
|
2 dnl |
5
|
3 dnl Process this file with autoconf to produce a configure script. |
405
|
4 dnl Requires GNU autoconf 1.8 or later. |
5
|
5 dnl |
1010
|
6 dnl Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
869
|
7 ### |
|
8 ### This file is part of Octave. |
|
9 ### |
|
10 ### Octave is free software; you can redistribute it and/or modify it |
|
11 ### under the terms of the GNU General Public License as published by the |
|
12 ### Free Software Foundation; either version 2, or (at your option) any |
|
13 ### later version. |
|
14 ### |
|
15 ### Octave is distributed in the hope that it will be useful, but WITHOUT |
|
16 ### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
17 ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
18 ### for more details. |
|
19 ### |
|
20 ### You should have received a copy of the GNU General Public License |
|
21 ### along with Octave; see the file COPYING. If not, write to the Free |
|
22 ### Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
23 |
1146
|
24 AC_REVISION($Revision: 1.97 $) |
859
|
25 AC_PREREQ(2.0) |
405
|
26 AC_INIT(src/octave.cc) |
1146
|
27 AC_CONFIG_HEADER(config.h) |
869
|
28 |
|
29 AC_DEFINE(OCTAVE_SOURCE, 1) |
|
30 |
859
|
31 AC_CANONICAL_HOST |
885
|
32 if test -z "$host"; then |
|
33 host=unknown |
|
34 fi |
|
35 target_host_type=$host |
|
36 canonical_host_type=$host |
|
37 if test "$host" = unknown; then |
869
|
38 AC_MSG_WARN([configuring Octave for unknown system type |
859
|
39 ]) |
294
|
40 fi |
869
|
41 AC_SUBST(target_host_type) |
|
42 |
|
43 ### Allow the user to force us to use f2c. |
|
44 |
832
|
45 AC_ARG_WITH(f2c, |
|
46 [ --with-f2c use f2c even if Fortran compiler is available], |
869
|
47 use_f2c=true, use_f2c=false) |
|
48 |
|
49 ### Allow the user to experiment with dynamic linking using GNU dld. |
|
50 |
832
|
51 AC_ARG_ENABLE(dld, |
|
52 [ --enable-dld use DLD for dynamic linking (not all systems)], |
869
|
53 use_dld=true, use_dld=false) |
|
54 AC_SUBST(use_dld) |
|
55 |
|
56 ### Allow compilation of smaller kernel. This only works if some form |
|
57 ### of dynamic linking is also supported and used. |
|
58 |
832
|
59 AC_ARG_ENABLE(lite-kernel, |
|
60 [ --enable-lite-kernel compile smaller kernel (requires DLD)], |
869
|
61 lite_kernel=true, lite_kernel=false) |
702
|
62 if $lite_kernel; then |
869
|
63 AC_DEFINE(OCTAVE_LITE, 1) |
702
|
64 fi |
869
|
65 AC_SUBST(lite_kernel) |
|
66 |
1137
|
67 ### Allow the user disable support for GNU info. |
|
68 |
|
69 USE_GNU_INFO=true |
|
70 AC_ARG_ENABLE(info, |
|
71 [ --enable-info use GNU info (default is yes)], |
|
72 USE_GNU_INFO=true, USE_GNU_INFO=false) |
|
73 AC_SUBST(USE_GNU_INFO) |
1145
|
74 LIBINFO= |
|
75 if $USE_GNU_INFO; then |
|
76 LIBINFO=../info/libinfo.a |
|
77 else |
|
78 AC_SUBST(LIBINFO) |
1137
|
79 |
1138
|
80 ### Allow the user disable support for command line editing using GNU |
|
81 ### readline. |
|
82 |
|
83 USE_READLINE=true |
|
84 AC_ARG_ENABLE(readline, |
|
85 [ --enable-readline use readline library (default is yes)], |
|
86 USE_READLINE=true, USE_READLINE=false) |
|
87 AC_SUBST(USE_READLINE) |
1145
|
88 LIBREADLINE= |
|
89 if $USE_READLINE; then |
|
90 LIBREADLINE=../readline/libreadline.a |
|
91 else |
|
92 AC_SUBST(LIBREADLINE) |
1138
|
93 |
869
|
94 ### some defaults |
|
95 |
859
|
96 AC_PREFIX_DEFAULT(/usr/local) |
869
|
97 |
666
|
98 exec_prefix='$(prefix)' |
|
99 bindir='$(exec_prefix)/bin' |
|
100 datadir='$(prefix)/lib' |
|
101 libdir='$(exec_prefix)/lib' |
765
|
102 includedir='$(prefix)/include/octave' |
666
|
103 mandir='$(prefix)/man/man1' |
|
104 infodir='$(prefix)/info' |
684
|
105 fcnfiledir='$(datadir)/octave/$(version)/m' |
827
|
106 localfcnfiledir='$(datadir)/octave/site/m' |
|
107 localfcnfilepath='$(localfcnfiledir)//' |
795
|
108 archlibdir='$(libdir)/octave/$(version)/exec/$(target_host_type)' |
|
109 octfiledir='$(libdir)/octave/$(version)/oct/$(target_host_type)' |
827
|
110 localoctfiledir='$(datadir)/octave/site/oct/$(target_host_type)' |
|
111 localoctfilepath='$(localoctfiledir)//' |
765
|
112 fcnfilepath='.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//' |
827
|
113 imagedir='$(datadir)/octave/$(version)/imagelib' |
|
114 imagepath='.:$(imagedir)//' |
869
|
115 |
832
|
116 AC_MSG_RESULT([defining prefix to be $prefix]) |
|
117 AC_MSG_RESULT([defining exec_prefix to be $exec_prefix]) |
|
118 AC_MSG_RESULT([defining bindir to be $bindir]) |
|
119 AC_MSG_RESULT([defining datadir to be $datadir]) |
|
120 AC_MSG_RESULT([defining libdir to be $libdir]) |
|
121 AC_MSG_RESULT([defining includedir to be $includedir]) |
|
122 AC_MSG_RESULT([defining mandir to be $mandir]) |
|
123 AC_MSG_RESULT([defining infodir to be $infodir]) |
|
124 AC_MSG_RESULT([defining fcnfiledir to be $fcnfiledir]) |
|
125 AC_MSG_RESULT([defining localfcnfiledir to be $localfcnfiledir]) |
|
126 AC_MSG_RESULT([defining localfcnfilepath to be $localfcnfilepath]) |
|
127 AC_MSG_RESULT([defining archlibdir to be $archlibdir]) |
|
128 AC_MSG_RESULT([defining octfiledir to be $octfiledir]) |
|
129 AC_MSG_RESULT([defining localoctfiledir to be $localoctfiledir]) |
|
130 AC_MSG_RESULT([defining localoctfilepath to be $localoctfilepath]) |
|
131 AC_MSG_RESULT([defining fcnfilepath to be $fcnfilepath]) |
|
132 AC_MSG_RESULT([defining imagedir to be $imagedir]) |
|
133 AC_MSG_RESULT([defining imagepath to be $imagepath]) |
666
|
134 AC_SUBST(exec_prefix) |
|
135 AC_SUBST(bindir) |
|
136 AC_SUBST(datadir) |
|
137 AC_SUBST(libdir) |
|
138 AC_SUBST(includedir) |
|
139 AC_SUBST(mandir) |
|
140 AC_SUBST(infodir) |
|
141 AC_SUBST(fcnfiledir) |
827
|
142 AC_SUBST(localfcnfiledir) |
666
|
143 AC_SUBST(localfcnfilepath) |
|
144 AC_SUBST(archlibdir) |
|
145 AC_SUBST(octfiledir) |
827
|
146 AC_SUBST(localoctfiledir) |
666
|
147 AC_SUBST(localoctfilepath) |
|
148 AC_SUBST(fcnfilepath) |
827
|
149 AC_SUBST(imagedir) |
684
|
150 AC_SUBST(imagepath) |
869
|
151 |
1104
|
152 ### Path separator. |
|
153 |
|
154 AC_DEFINE(SEPCHAR, [':']) |
|
155 AC_DEFINE(SEPCHAR_STR, [":"]) |
|
156 |
869
|
157 ### Do special stuff if using dld. |
|
158 |
5
|
159 DLD_DIR= |
|
160 LIBDLD= |
759
|
161 LIBOCTDLD='liboctdld.a' |
5
|
162 LD_STATIC_FLAG= |
|
163 if $use_dld; then |
518
|
164 DLD_DIR=dld |
759
|
165 LIBDLD='../dld/libdld.a' |
702
|
166 # don't link them in only if doing dynamic linking and small kernel |
|
167 # requested. |
|
168 if $lite_kernel; then |
|
169 LIBOCTDLD= |
|
170 fi |
518
|
171 LD_STATIC_FLAG=-static |
869
|
172 AC_DEFINE(WITH_DLD, 1) |
518
|
173 fi |
869
|
174 |
|
175 ### Also use -static if compiling on Alpha OSF/1 1.3 systems. |
|
176 |
781
|
177 case "$canonical_host_type" in |
|
178 alpha-dec-osf1.3) |
|
179 LD_STATIC_FLAG=-static |
|
180 ;; |
|
181 esac |
869
|
182 |
518
|
183 if test -n "$DLD_DIR"; then |
832
|
184 AC_MSG_RESULT([defining DLD_DIR to be $DLD_DIR]) |
518
|
185 fi |
|
186 if test -n "$LIBDLD"; then |
832
|
187 AC_MSG_RESULT([defining LIBDLD to be $LIBDLD]) |
518
|
188 fi |
|
189 if test -n "$LIBOCTDLD"; then |
832
|
190 AC_MSG_RESULT([defining LIBOCTDLD to be $LIBOCTDLD]) |
518
|
191 fi |
|
192 if test -n "$LD_STATIC_FLAG"; then |
832
|
193 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
5
|
194 fi |
869
|
195 AC_SUBST(DLD_DIR) |
|
196 AC_SUBST(LIBDLD) |
|
197 AC_SUBST(LIBOCTDLD) |
|
198 AC_SUBST(LD_STATIC_FLAG) |
|
199 |
|
200 ### See if the optional nonlinear programming code is present. |
|
201 |
832
|
202 AC_MSG_CHECKING([for npsol]) |
5
|
203 if test -f $srcdir/libcruft/npsol/npsol.f; then |
832
|
204 AC_MSG_RESULT([yes]) |
5
|
205 else |
832
|
206 AC_MSG_RESULT([no]) |
869
|
207 AC_DEFINE(NPSOL_MISSING, 1) |
5
|
208 fi |
869
|
209 |
832
|
210 AC_MSG_CHECKING([for qpsol]) |
5
|
211 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
832
|
212 AC_MSG_RESULT([yes]) |
5
|
213 else |
832
|
214 AC_MSG_RESULT([no]) |
869
|
215 AC_DEFINE(QPSOL_MISSING, 1) |
5
|
216 fi |
869
|
217 |
832
|
218 AC_MSG_CHECKING([for fsqp]) |
5
|
219 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
832
|
220 AC_MSG_RESULT([yes]) |
5
|
221 else |
832
|
222 AC_MSG_RESULT([no]) |
869
|
223 AC_DEFINE(FSQP_MISSING, 1) |
5
|
224 fi |
869
|
225 |
|
226 ### See which C++ compiler to use (we expect to find g++). |
|
227 |
405
|
228 AC_PROG_CXX |
|
229 AC_PROG_CXXCPP |
869
|
230 |
|
231 ### Do special things for g++. |
|
232 |
405
|
233 ADD_CXX_WALL=false |
759
|
234 NO_IMPLICIT_TEMPLATES= |
405
|
235 gxx_version=`$CXX -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'` |
|
236 case "$gxx_version" in |
832
|
237 changequote(,)dnl |
|
238 2.[6789].*|2.[123456789][0123456789].*) |
|
239 changequote([,])dnl |
1087
|
240 if test -z "$CXXFLAGS"; then |
|
241 CXXFLAGS="-g -O" |
|
242 AC_MSG_RESULT([defining CXXFLAGS to be $CXXFLAGS]) |
|
243 ADD_CXX_WALL=true |
|
244 fi |
759
|
245 NO_IMPLICIT_TEMPLATES="-fno-implicit-templates" |
832
|
246 AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES]) |
405
|
247 ;; |
832
|
248 changequote(,)dnl |
|
249 1.*|2.[012345].*) |
|
250 changequote([,])dnl |
|
251 AC_MSG_WARN([g++ version $gxx_version will not work to compile Octave]) |
405
|
252 ;; |
|
253 *) |
832
|
254 AC_MSG_WARN([Octave has only been tested with g++, and I can't find it]) |
405
|
255 ;; |
|
256 esac |
869
|
257 |
1018
|
258 HOST_CXXFLAGS= |
965
|
259 case "$gxx_version" in |
|
260 2.6.*) |
|
261 case "$canonical_host_type" in |
|
262 rs6000-ibm-aix*) |
1018
|
263 HOST_CXXFLAGS="-Wa,-u" |
|
264 AC_MSG_RESULT([defining HOST_CXXFLAGS to be $HOST_CXXFLAGS]) |
965
|
265 ;; |
|
266 esac |
|
267 ;; |
|
268 esac |
|
269 |
1018
|
270 AC_SUBST(HOST_CXXFLAGS) |
|
271 |
869
|
272 ### See what libraries are used by the C++ compiler. Need this for |
|
273 ### dynamic linking. |
|
274 |
708
|
275 CXXLIBS=`sh $srcdir/cxxlibs.sh` |
832
|
276 AC_MSG_RESULT([defining CXXLIBS to be $CXXLIBS]) |
869
|
277 |
|
278 AC_SUBST(CXXFLAGS) |
|
279 AC_SUBST(NO_IMPLICIT_TEMPLATES) |
|
280 AC_SUBST(CXXLIBS) |
|
281 |
|
282 ### See which C compiler to use (we expect to find gcc). |
|
283 |
5
|
284 AC_PROG_CC |
405
|
285 AC_PROG_CPP |
832
|
286 AC_PROG_GCC_TRADITIONAL |
869
|
287 |
|
288 ### Do special things for gcc. |
|
289 |
405
|
290 ADD_CC_WALL=false |
|
291 gcc_version=`$CC -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` |
|
292 case "$gcc_version" in |
|
293 2.*) |
1087
|
294 if test -z "$CFLAGS"; then |
|
295 CFLAGS="-g -O" |
|
296 AC_MSG_RESULT([defining CFLAGS to be $CFLAGS]) |
|
297 ADD_CC_WALL=true |
|
298 fi |
|
299 if test -z "$LDFLAGS"; then |
|
300 LDFLAGS="-g" |
|
301 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
302 fi |
405
|
303 ;; |
|
304 1.*) |
832
|
305 AC_MSG_WARN([gcc version $gcc_version is likely to cause problems]) |
405
|
306 ;; |
5
|
307 *) |
832
|
308 AC_MSG_WARN([Octave has only been tested with gcc, and I can't find it]) |
405
|
309 ;; |
5
|
310 esac |
869
|
311 |
|
312 AC_SUBST(CFLAGS) |
|
313 AC_SUBST(LDFLAGS) |
|
314 |
|
315 ### On Linux systems we need to compile with -mieee-fp to get full |
|
316 ### support for IEEE floating point. |
|
317 |
350
|
318 case "$canonical_host_type" in |
|
319 i386-*-linux | i486-*-linux | i586-*-linux) |
|
320 GCC_IEEE_FP_FLAG="-mieee-fp" |
832
|
321 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
324
|
322 ;; |
|
323 esac |
869
|
324 |
|
325 AC_SUBST(GCC_IEEE_FP_FLAG) |
|
326 |
|
327 ### Special checks for odd OS specific things. |
|
328 |
405
|
329 AC_ISC_POSIX |
|
330 AC_MINIX |
|
331 AC_AIX |
832
|
332 AC_FUNC_STRFTIME |
|
333 AC_CHECK_LIB(sun, getpwnam) |
869
|
334 |
|
335 ### How big are ints and how are they oriented? These could probably |
|
336 ### be eliminated in favor of run-time checks. |
|
337 |
832
|
338 AC_CHECK_SIZEOF(short) |
|
339 AC_CHECK_SIZEOF(int) |
|
340 AC_CHECK_SIZEOF(long) |
|
341 AC_C_BIGENDIAN |
869
|
342 |
|
343 ### Try to determine the floating point format. This could probably |
|
344 ### be eliminated in favor of run-time checks. |
|
345 |
832
|
346 AC_MSG_CHECKING([floating point format]) |
602
|
347 changequote(,)dnl |
|
348 XCFLAGS=`echo $CFLAGS | sed 's/-O[^ \t]*//'` |
|
349 changequote([,])dnl |
|
350 ${CC-cc} -DDP $XCFLAGS $LDFLAGS $srcdir/float-type.c -o conftest >/dev/null 2>&1 |
588
|
351 FLOAT_FORMAT=`./conftest` |
|
352 case "$FLOAT_FORMAT" in |
|
353 IEEE_BIG_ENDIAN) |
832
|
354 AC_MSG_RESULT([IEEE big endian]) |
869
|
355 AC_DEFINE(IEEE_BIG_ENDIAN, 1) |
588
|
356 ;; |
|
357 IEEE_LITTLE_ENDIAN) |
832
|
358 AC_MSG_RESULT([IEEE little endian]) |
869
|
359 AC_DEFINE(IEEE_LITTLE_ENDIAN, 1) |
588
|
360 ;; |
|
361 VAX_D_FLOAT) |
832
|
362 AC_MSG_RESULT([VAX D floating]) |
869
|
363 AC_DEFINE(VAX_D_FLOAT, 1) |
588
|
364 ;; |
|
365 VAX_G_FLOAT) |
832
|
366 AC_MSG_RESULT([VAX G floating]) |
869
|
367 AC_DEFINE(VAX_G_FLOAT, 1) |
588
|
368 ;; |
|
369 *) |
832
|
370 AC_MSG_RESULT() |
|
371 AC_MSG_WARN("unrecognized floating point format!") |
588
|
372 ;; |
|
373 esac |
869
|
374 |
|
375 ### Does the C compiler handle alloca() and const correctly? |
|
376 |
405
|
377 AC_ALLOCA |
832
|
378 AC_C_CONST |
869
|
379 |
|
380 ### If we haven't been forced to use f2c, try to find a Fortran compiler |
|
381 ### under any one of several common Un*x Fortran compiler names. |
|
382 ### Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
383 ### builtin. |
|
384 ### |
|
385 ### xlf : IBM / AIX |
|
386 ### cf77 : Cray / Unicos |
|
387 ### g77 : GNU Fortran (someday...) |
|
388 ### fc : Convex |
|
389 ### |
|
390 ### I don't think the Cray compiler will ever work like f2c... |
|
391 |
5
|
392 if $use_f2c; then |
|
393 true |
|
394 else |
869
|
395 AC_CHECK_PROGS(F77, xlf cf77 f77 g77 fc) |
5
|
396 |
|
397 # If it looks like we have a Fortran compiler, try to determine |
|
398 # whether it might be compatible with f2c. |
|
399 |
|
400 if test -n "$F77"; then |
832
|
401 AC_MSG_CHECKING([$F77/f2c compatibility]) |
5
|
402 export F77 |
|
403 export CC |
|
404 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
405 status=$? |
|
406 if test $status -eq 0; then |
832
|
407 AC_MSG_RESULT([yes]) |
5
|
408 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
869
|
409 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
410 fi |
|
411 else |
832
|
412 AC_MSG_RESULT([no]) |
5
|
413 F77= |
|
414 fi |
|
415 fi |
|
416 fi |
869
|
417 |
|
418 ### If we can't find a Fortran compiler, or if it looks like it isn't |
|
419 ### compatible with f2c, try to find f2c. |
|
420 |
5
|
421 if test -z "$F77"; then |
869
|
422 AC_CHECK_PROG(F2C, f2c, f2c, []) |
5
|
423 fi |
869
|
424 |
1087
|
425 if test -z "$F2CFLAGS"; then |
|
426 F2CFLAGS= |
|
427 fi |
|
428 |
|
429 if test -z "$FFLAGS"; then |
|
430 FFLAGS="-O" |
|
431 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
432 fi |
|
433 |
5
|
434 if test -n "$F77"; then |
|
435 export F77 |
|
436 FLIBS=`sh $srcdir/flibs.sh` |
832
|
437 AC_MSG_RESULT([defining FLIBS to be $FLIBS]) |
995
|
438 DOT_C_FROM_DOT_F_CMD= |
|
439 DOT_O_FROM_DOT_F_PAT= |
5
|
440 elif test -n "$F2C" || $use_f2c; then |
869
|
441 AC_CHECK_LIB(f2c, main, FLIBS=-lf2c, []) |
5
|
442 if test -z "$FLIBS" ; then |
869
|
443 AC_CHECK_LIB(F77, main, FLIBS=-lF77, []) |
5
|
444 if test -n "$FLIBS" ; then |
869
|
445 AC_CHECK_LIB(I77, main, FLIBS="$FLIBS -lI77", []) |
5
|
446 fi |
|
447 fi |
|
448 if test -z "$FLIBS" ; then |
832
|
449 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
450 fi |
995
|
451 DOT_C_FROM_DOT_F_CMD=' cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
|
452 AC_MSG_RESULT([defining DOT_C_FROM_DOT_F_CMD to be $DOT_C_FROM_DOT_F_CMD]) |
|
453 DOT_O_FROM_DOT_F_PAT='%.o : %.f' |
|
454 AC_MSG_RESULT([defining DOT_O_FROM_DOT_F_PAT to be $DOT_O_FROM_DOT_F_PAT]) |
869
|
455 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
456 else |
832
|
457 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
458 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
|
459 AC_MSG_WARN([See the file INSTALL for more information.]) |
|
460 AC_MSG_WARN([Continuing anyway...]) |
5
|
461 fi |
869
|
462 |
|
463 AC_SUBST(F77) |
|
464 AC_SUBST(FFLAGS) |
|
465 AC_SUBST(FLIBS) |
|
466 AC_SUBST(F2C) |
|
467 AC_SUBST(F2CFLAGS) |
995
|
468 AC_SUBST(DOT_C_FROM_DOT_F_CMD) |
|
469 AC_SUBST(DOT_O_FROM_DOT_F_PAT) |
869
|
470 |
|
471 ### Extract libraries and directories from FLIBS and CXXLIBS. |
|
472 ### |
|
473 ### Leave only libraries, with -lfoo converted to libfoo.a: |
|
474 |
708
|
475 changequote(,)dnl |
843
|
476 FLIB_LIST=`echo " $FLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
842
|
477 -e 's/ -L *[^ ]*/ /g' \ |
843
|
478 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
479 -e 's/ [^ ]*\.o//g' \ |
832
|
480 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
481 |
843
|
482 CXXLIB_LIST=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
842
|
483 -e 's/ -L *[^ ]*/ /g' \ |
843
|
484 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
485 -e 's/ [^ ]*\.o//g' \ |
708
|
486 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
487 |
|
488 ### Leave only directories where libraries might be found: |
|
489 |
843
|
490 FLIB_PATH=`echo " $FLIBS " | sed \ |
|
491 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
|
492 -e 's/ -L *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
1069
|
493 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
494 -e 's/ [^ ]*\.o//g' \ |
|
495 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
496 |
843
|
497 CXXLIB_PATH=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
|
498 -e 's/ -L *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
|
499 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
1069
|
500 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
501 -e 's/ [^ ]*\.o//g' \ |
|
502 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
708
|
503 changequote([,])dnl |
869
|
504 |
832
|
505 AC_MSG_RESULT([defining FLIB_LIST to be $FLIB_LIST]) |
|
506 AC_MSG_RESULT([defining FLIB_PATH to be $FLIB_PATH]) |
869
|
507 |
832
|
508 AC_MSG_RESULT([defining CXXLIB_LIST to be $CXXLIB_LIST]) |
|
509 AC_MSG_RESULT([defining CXXLIB_PATH to be $CXXLIB_PATH]) |
869
|
510 |
|
511 AC_SUBST(FLIB_LIST) |
|
512 AC_SUBST(FLIB_PATH) |
|
513 |
|
514 AC_SUBST(CXXLIB_LIST) |
|
515 AC_SUBST(CXXLIB_PATH) |
|
516 |
|
517 ### Checks for header files. |
|
518 |
832
|
519 AC_HEADER_STDC |
869
|
520 AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h) |
|
521 AC_CHECK_HEADERS(string.h varargs.h unistd.h floatingpoint.h) |
|
522 AC_CHECK_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h) |
936
|
523 AC_CHECK_HEADERS(sys/ttold.h sys/ptem.h sys/select.h sys/resource.h) |
832
|
524 AC_HEADER_DIRENT |
792
|
525 AC_TIME_WITH_SYS_TIME |
869
|
526 |
|
527 ### Use sgtty on Ultrix so that using DEC Migrate to convert a Mips |
|
528 ### binary to an Alpha binary will work. Also on Alpha/OSF to avoid |
|
529 ### a readline bug. |
|
530 |
294
|
531 case "$canonical_host_type" in |
521
|
532 mips-dec-ultrix* | alpha-dec-osf*) |
869
|
533 AC_CHECK_HEADER(sgtty.h, [AC_DEFINE(HAVE_SGTTY_H, 1)], []) |
|
534 |
|
535 if test "$ac_cv_header_sgtty_h" = no; then |
|
536 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
|
537 fi |
|
538 ;; |
|
539 *) |
|
540 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
294
|
541 ;; |
|
542 esac |
869
|
543 |
|
544 if test "$ac_cv_header_termios_h" = yes \ |
|
545 || test "$ac_cv_header_termio_h" = yes \ |
|
546 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
547 true |
|
548 else |
|
549 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
550 fi |
869
|
551 |
|
552 ### Checks for functions. |
|
553 |
966
|
554 AC_CHECK_FUNCS(setvbuf getcwd gethostname bzero bcopy rindex vfprintf vsprintf) |
903
|
555 AC_CHECK_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror atexit) |
|
556 AC_CHECK_FUNCS(on_exit tempnam memmove putenv gettimeofday getrusage) |
869
|
557 |
832
|
558 dnl Would like to get rid of this cruft, and just have |
|
559 dnl |
|
560 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
561 dnl |
|
562 dnl instead, but that used to fail on some systems... |
369
|
563 dnl |
832
|
564 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
565 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
566 dnl fails, we try again by including math.h and invoking the function |
|
567 dnl with an argument. |
869
|
568 |
|
569 ### Check to see if we have IEEE math functions, and if so, which ones. |
|
570 ### |
|
571 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
572 ### functions, otherwise we may not find them. |
|
573 ### |
|
574 ### Also check for some additional trig functions that aren't ANSI but |
|
575 ### are often available. If they are missing, we try to replace them |
|
576 ### with functions from the BSD/NET2 math library. |
|
577 |
|
578 AC_CHECK_LIB(sunmath, main) |
1070
|
579 |
|
580 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
581 |
|
582 case "$canonical_host_type" in |
|
583 *-*-linux*) |
|
584 AC_CHECK_LIB(m, main, , , -lc) |
|
585 ;; |
|
586 *) |
|
587 AC_CHECK_LIB(m, main) |
|
588 ;; |
|
589 esac |
869
|
590 |
360
|
591 XCFLAGS="$CFLAGS" |
351
|
592 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
593 |
1075
|
594 ### Inf and NaN don't work with gcc on the Alpha yet. I am also told |
|
595 ### that they don't work on m68k HP sytems either. |
956
|
596 |
|
597 case "$canonical_host_type" in |
1075
|
598 alpha-dec-osf* | m68k-hp-hpux*) |
956
|
599 ;; |
|
600 *) |
|
601 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
602 ;; |
|
603 esac |
|
604 |
1076
|
605 ### Check for nonstandard but common math functions that we need. |
|
606 |
|
607 AC_CHECK_FUNCS(acosh asinh atanh erf erfc lgamma) |
869
|
608 |
832
|
609 AC_MSG_CHECKING([for signgam declaration in math.h]) |
|
610 AC_TRY_LINK([#include <math.h>], |
706
|
611 [int foo = signgam + 1;], |
832
|
612 AC_MSG_RESULT(yes) |
|
613 AC_DEFINE(SIGNGAM_DECLARED, 1), |
869
|
614 AC_MSG_RESULT(no)) |
|
615 |
360
|
616 CFLAGS="$XCFLAGS" |
869
|
617 |
|
618 ### Checks for OS specific cruft. |
|
619 |
405
|
620 AC_STRUCT_TM |
832
|
621 AC_FUNC_SETVBUF_REVERSED |
405
|
622 TERMLIBS="" |
|
623 for termlib in termcap terminfo curses termlib ; do |
832
|
624 AC_CHECK_LIB(${termlib}, main, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
625 case "${TERMLIBS}" in |
|
626 *-l${termlib}*) |
832
|
627 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
628 break |
|
629 ;; |
|
630 esac |
|
631 done |
869
|
632 |
832
|
633 AC_MSG_CHECKING([for struct exception in math.h]) |
|
634 AC_TRY_LINK([#include <math.h>], |
|
635 [struct exception *x; x->type; x->name;], |
835
|
636 AC_MSG_RESULT(yes) |
832
|
637 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
638 AC_MSG_RESULT(no)) |
|
639 |
405
|
640 AC_SUBST(TERMLIBS) |
869
|
641 |
|
642 ### Signal stuff. |
|
643 |
834
|
644 AC_TYPE_SIGNAL |
885
|
645 AC_DECL_SYS_SIGLIST |
|
646 AC_MSG_CHECKING([for sys_siglist variable]) |
|
647 AC_TRY_LINK([#include <stdio.h>], |
|
648 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
649 AC_MSG_RESULT(yes) |
|
650 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
651 AC_MSG_RESULT(no)) |
869
|
652 |
|
653 ### Define VOID_SIGHANDLER for readline. |
|
654 |
405
|
655 case "$RETSIGTYPE" in |
|
656 int) |
|
657 ;; |
|
658 *) |
|
659 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
660 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
661 ;; |
|
662 esac |
869
|
663 AC_SUBST(VOID_SIGHANDLER) |
|
664 |
|
665 ### Checks for other programs used for building, testing, installing, |
|
666 ### and running Octave. |
|
667 ### |
|
668 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
669 ### it, and it might not be installed. |
|
670 ### |
|
671 ### Also make sure that we generate an interactive scanner if we are |
|
672 ### using flex. |
|
673 |
405
|
674 AC_PROG_LEX |
|
675 case "$LEX" in |
|
676 flex*) |
|
677 LFLAGS="-t -I" |
832
|
678 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
679 LEXLIB= |
|
680 ;; |
|
681 *) |
|
682 LFLAGS="-t" |
832
|
683 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
684 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
685 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
686 ;; |
|
687 esac |
869
|
688 AC_SUBST(LFLAGS) |
|
689 |
405
|
690 AC_PROG_YACC |
|
691 case "$YACC" in |
|
692 bison*) |
|
693 ;; |
|
694 *) |
832
|
695 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
696 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
697 ;; |
|
698 esac |
869
|
699 |
405
|
700 AC_PROG_RANLIB |
869
|
701 |
|
702 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
703 AC_CHECK_PROG(EXPECT, expect, expect, []) |
5
|
704 if test -z "$EXPECT" ; then |
|
705 RUNTEST= |
|
706 fi |
869
|
707 AC_SUBST(RUNTEST) |
|
708 |
405
|
709 AC_PROG_INSTALL |
869
|
710 |
|
711 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
405
|
712 if test -z "$GNUPLOT_BINARY"; then |
832
|
713 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
714 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
715 AC_MSG_WARN([plotting commands without it.]) |
|
716 AC_MSG_WARN([]) |
|
717 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
718 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
719 AC_MSG_WARN([]) |
|
720 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
721 AC_MSG_WARN([]) |
|
722 AC_MSG_WARN([at the Octave prompt.]) |
405
|
723 fi |
869
|
724 |
|
725 AC_CHECK_PROGS(DEFAULT_PAGER, less more page pg, []) |
405
|
726 if test -z "$DEFAULT_PAGER"; then |
832
|
727 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
728 elif test "$DEFAULT_PAGER" = less; then |
|
729 DEFAULT_PAGER="less -e" |
832
|
730 AC_MSG_RESULT([defining DEFAULT_PAGER to be $DEFAULT_PAGER]) |
405
|
731 fi |
869
|
732 |
|
733 ### Even though we include config.h in most files, some need to be |
|
734 ### compiled with the -D options on the compiler command line. Use |
|
735 ### UGLY_DEFS for that. |
|
736 |
832
|
737 AC_OUTPUT_MAKE_DEFS |
236
|
738 UGLY_DEFS="$DEFS" |
832
|
739 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
869
|
740 AC_SUBST(UGLY_DEFS) |
|
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 |
|
776 AC_CONFIG_SUBDIRS(kpathsea) |
|
777 |
869
|
778 ### Do the substitutions in all the Makefiles. |
|
779 |
837
|
780 define([tmpA], [Makefile octMakefile Makeconf])dnl |
|
781 define([tmpB], [libcruft/Makefile libcruft/Makerules])dnl |
|
782 define([tmpC], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
783 define([tmpD], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
|
784 define([tmpE], [readline/examples/Makefile doc/Makefile])dnl |
1146
|
785 define([tmpF], [test/Makefile])dnl |
837
|
786 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE tmpF])dnl |
869
|
787 |
39
|
788 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
789 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
790 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
791 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
792 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
793 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
794 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
1075
|
795 define([tmph], [libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile])dnl |
|
796 define([tmpi], [libcruft/villad/Makefile])dnl |
869
|
797 |
1075
|
798 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph tmpi])dnl |
684
|
799 define([tmpSA], [scripts/Makefile scripts/control/Makefile])dnl |
869
|
800 define([tmpSB], [scripts/general/Makefile scripts/image/Makefile]) |
684
|
801 define([tmpSC], [scripts/linear-algebra/Makefile])dnl |
|
802 define([tmpSD], [scripts/miscellaneous/Makefile scripts/plot/Makefile])dnl |
|
803 define([tmpSE], [scripts/polynomial/Makefile scripts/set/Makefile])dnl |
|
804 define([tmpSF], [scripts/signal/Makefile scripts/special-matrix/Makefile])dnl |
733
|
805 define([tmpSG], [scripts/startup/Makefile scripts/statistics/Makefile])dnl |
717
|
806 define([tmpSH], [scripts/elfun/Makefile scripts/specfun/Makefile])dnl |
937
|
807 define([tmpSI], [scripts/strings/Makefile])dnl |
|
808 define([mdirs], [tmpSA tmpSB tmpSC tmpSD tmpSE tmpSF tmpSG tmpSH tmpSI])dnl |
869
|
809 |
937
|
810 AC_OUTPUT([srcdirs cruftdirs mdirs]) |