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