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