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