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