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 |
1225
|
24 AC_REVISION($Revision: 1.109 $) |
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 what libraries are used by the C++ compiler. Need this for |
|
284 ### dynamic linking. |
|
285 |
1225
|
286 AC_MSG_CHECKING([for C++ libraries]) |
|
287 AC_CACHE_VAL(octave_cv_cxxlibs, |
|
288 [if test -n "$CXX"; then |
1175
|
289 export CXX |
|
290 fi |
1225
|
291 octave_cv_cxxlibs=`sh $srcdir/cxxlibs.sh`]) |
|
292 AC_MSG_RESULT([$octave_cv_cxxlibs]) |
|
293 CXXLIBS="$octave_cv_cxxlibs" |
869
|
294 AC_SUBST(CXXLIBS) |
|
295 |
|
296 ### See which C compiler to use (we expect to find gcc). |
|
297 |
5
|
298 AC_PROG_CC |
405
|
299 AC_PROG_CPP |
832
|
300 AC_PROG_GCC_TRADITIONAL |
869
|
301 |
|
302 ### Do special things for gcc. |
|
303 |
405
|
304 ADD_CC_WALL=false |
1207
|
305 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | sed 's/^.*gcc version *//'` |
405
|
306 case "$gcc_version" in |
|
307 2.*) |
1087
|
308 if test -z "$CFLAGS"; then |
|
309 CFLAGS="-g -O" |
|
310 AC_MSG_RESULT([defining CFLAGS to be $CFLAGS]) |
|
311 ADD_CC_WALL=true |
|
312 fi |
|
313 if test -z "$LDFLAGS"; then |
|
314 LDFLAGS="-g" |
|
315 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
316 fi |
405
|
317 ;; |
|
318 1.*) |
832
|
319 AC_MSG_WARN([gcc version $gcc_version is likely to cause problems]) |
405
|
320 ;; |
5
|
321 *) |
832
|
322 AC_MSG_WARN([Octave has only been tested with gcc, and I can't find it]) |
405
|
323 ;; |
5
|
324 esac |
869
|
325 |
|
326 AC_SUBST(CFLAGS) |
|
327 AC_SUBST(LDFLAGS) |
|
328 |
|
329 ### On Linux systems we need to compile with -mieee-fp to get full |
|
330 ### support for IEEE floating point. |
|
331 |
350
|
332 case "$canonical_host_type" in |
|
333 i386-*-linux | i486-*-linux | i586-*-linux) |
|
334 GCC_IEEE_FP_FLAG="-mieee-fp" |
832
|
335 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
324
|
336 ;; |
|
337 esac |
869
|
338 |
|
339 AC_SUBST(GCC_IEEE_FP_FLAG) |
|
340 |
|
341 ### Special checks for odd OS specific things. |
|
342 |
405
|
343 AC_ISC_POSIX |
|
344 AC_MINIX |
|
345 AC_AIX |
832
|
346 AC_CHECK_LIB(sun, getpwnam) |
869
|
347 |
|
348 ### How big are ints and how are they oriented? These could probably |
|
349 ### be eliminated in favor of run-time checks. |
|
350 |
832
|
351 AC_CHECK_SIZEOF(short) |
|
352 AC_CHECK_SIZEOF(int) |
|
353 AC_CHECK_SIZEOF(long) |
|
354 AC_C_BIGENDIAN |
869
|
355 |
|
356 ### Does the C compiler handle alloca() and const correctly? |
|
357 |
405
|
358 AC_ALLOCA |
832
|
359 AC_C_CONST |
869
|
360 |
|
361 ### If we haven't been forced to use f2c, try to find a Fortran compiler |
|
362 ### under any one of several common Un*x Fortran compiler names. |
|
363 ### Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
364 ### builtin. |
|
365 ### |
|
366 ### xlf : IBM / AIX |
|
367 ### cf77 : Cray / Unicos |
|
368 ### g77 : GNU Fortran (someday...) |
|
369 ### fc : Convex |
|
370 ### |
|
371 ### I don't think the Cray compiler will ever work like f2c... |
|
372 |
1177
|
373 if $use_g77; then |
|
374 F77=g77 |
|
375 fi |
|
376 |
|
377 if test -n "$F77"; then |
|
378 export F77 |
|
379 fi |
|
380 |
5
|
381 if $use_f2c; then |
|
382 true |
|
383 else |
869
|
384 AC_CHECK_PROGS(F77, xlf cf77 f77 g77 fc) |
5
|
385 |
|
386 # If it looks like we have a Fortran compiler, try to determine |
|
387 # whether it might be compatible with f2c. |
|
388 |
|
389 if test -n "$F77"; then |
832
|
390 AC_MSG_CHECKING([$F77/f2c compatibility]) |
5
|
391 export F77 |
|
392 export CC |
|
393 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
394 status=$? |
1225
|
395 octave_f77_f2c_compat=no |
5
|
396 if test $status -eq 0; then |
1225
|
397 octave_f77_f2c_compat=yes |
|
398 fi |
|
399 AC_MSG_RESULT([$octave_f77_f2c_compat]) |
|
400 if test "$octave_f77_f2c_compat" = yes; then |
5
|
401 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
869
|
402 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
403 fi |
|
404 else |
|
405 F77= |
|
406 fi |
|
407 fi |
|
408 fi |
869
|
409 |
|
410 ### If we can't find a Fortran compiler, or if it looks like it isn't |
|
411 ### compatible with f2c, try to find f2c. |
|
412 |
5
|
413 if test -z "$F77"; then |
869
|
414 AC_CHECK_PROG(F2C, f2c, f2c, []) |
5
|
415 fi |
869
|
416 |
1087
|
417 if test -z "$F2CFLAGS"; then |
|
418 F2CFLAGS= |
|
419 fi |
|
420 |
|
421 if test -z "$FFLAGS"; then |
|
422 FFLAGS="-O" |
|
423 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
424 fi |
|
425 |
5
|
426 if test -n "$F77"; then |
1177
|
427 if test "$F77" = "g77"; then |
|
428 FUGLY=-fugly |
|
429 AC_MSG_RESULT([defining FUGLY to be $FUGLY]) |
|
430 fi |
1225
|
431 AC_MSG_CHECKING([for Fortran librarires]) |
|
432 AC_CACHE_VAL(octave_cv_flibs, |
|
433 [export F77 |
|
434 octave_cv_flibs=`sh $srcdir/flibs.sh`]) |
|
435 FLIBS="$octave_cv_flibs" |
|
436 AC_MSG_RESULT([$FLIBS]) |
995
|
437 DOT_C_FROM_DOT_F_CMD= |
1177
|
438 DOT_O_FROM_DOT_F_PAT='.f.o:' |
|
439 DOT_O_FROM_DOT_F_CMD=' $(FC) -c $(ALL_FFLAGS) $<' |
5
|
440 elif test -n "$F2C" || $use_f2c; then |
869
|
441 AC_CHECK_LIB(f2c, main, FLIBS=-lf2c, []) |
5
|
442 if test -z "$FLIBS" ; then |
869
|
443 AC_CHECK_LIB(F77, main, FLIBS=-lF77, []) |
5
|
444 if test -n "$FLIBS" ; then |
869
|
445 AC_CHECK_LIB(I77, main, FLIBS="$FLIBS -lI77", []) |
5
|
446 fi |
|
447 fi |
|
448 if test -z "$FLIBS" ; then |
832
|
449 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
450 fi |
995
|
451 DOT_C_FROM_DOT_F_CMD=' cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
|
452 AC_MSG_RESULT([defining DOT_C_FROM_DOT_F_CMD to be $DOT_C_FROM_DOT_F_CMD]) |
|
453 DOT_O_FROM_DOT_F_PAT='%.o : %.f' |
1177
|
454 DOT_O_FROM_DOT_F_CMD= |
995
|
455 AC_MSG_RESULT([defining DOT_O_FROM_DOT_F_PAT to be $DOT_O_FROM_DOT_F_PAT]) |
869
|
456 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
5
|
457 else |
832
|
458 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
459 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
|
460 AC_MSG_WARN([See the file INSTALL for more information.]) |
|
461 AC_MSG_WARN([Continuing anyway...]) |
5
|
462 fi |
869
|
463 |
1163
|
464 FC=$F77 |
|
465 AC_SUBST(FC) |
869
|
466 AC_SUBST(F77) |
|
467 AC_SUBST(FFLAGS) |
1177
|
468 AC_SUBST(FUGLY) |
869
|
469 AC_SUBST(FLIBS) |
|
470 AC_SUBST(F2C) |
|
471 AC_SUBST(F2CFLAGS) |
995
|
472 AC_SUBST(DOT_C_FROM_DOT_F_CMD) |
|
473 AC_SUBST(DOT_O_FROM_DOT_F_PAT) |
1177
|
474 AC_SUBST(DOT_O_FROM_DOT_F_CMD) |
869
|
475 |
|
476 ### Extract libraries and directories from FLIBS and CXXLIBS. |
|
477 ### |
|
478 ### Leave only libraries, with -lfoo converted to libfoo.a: |
|
479 |
708
|
480 changequote(,)dnl |
843
|
481 FLIB_LIST=`echo " $FLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
482 -e 's/ -[LR] *[^ ]*/ /g' \ |
843
|
483 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
484 -e 's/ [^ ]*\.o//g' \ |
832
|
485 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
486 |
843
|
487 CXXLIB_LIST=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
488 -e 's/ -[LR] *[^ ]*/ /g' \ |
843
|
489 -e 's/ -l *\([^ ]*\)/ lib\1.a/g' -e 's/ -u *[^ ]*/ /g' \ |
1068
|
490 -e 's/ [^ ]*\.o//g' \ |
708
|
491 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
492 |
|
493 ### Leave only directories where libraries might be found: |
|
494 |
843
|
495 FLIB_PATH=`echo " $FLIBS " | sed \ |
|
496 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
497 -e 's/ -[LR] *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
1069
|
498 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
499 -e 's/ [^ ]*\.o//g' \ |
|
500 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
869
|
501 |
843
|
502 CXXLIB_PATH=`echo " $CXXLIBS " | sed -e 's/ -Xlinker *[^ ]*/ /g' \ |
1175
|
503 -e 's/ -[LR] *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
843
|
504 -e 's/ / /g' -e 's/ -Xlinker *[^ ]*/ /g' \ |
1069
|
505 -e 's/ -l *[^ ]*/ /g' -e 's/ -u *[^ ]*/ /g' \ |
|
506 -e 's/ [^ ]*\.o//g' \ |
|
507 -e 's/^ *//' -e 's/ *$//' -e 's/ */:/g'` |
708
|
508 changequote([,])dnl |
869
|
509 |
832
|
510 AC_MSG_RESULT([defining FLIB_LIST to be $FLIB_LIST]) |
|
511 AC_MSG_RESULT([defining FLIB_PATH to be $FLIB_PATH]) |
869
|
512 |
832
|
513 AC_MSG_RESULT([defining CXXLIB_LIST to be $CXXLIB_LIST]) |
|
514 AC_MSG_RESULT([defining CXXLIB_PATH to be $CXXLIB_PATH]) |
869
|
515 |
|
516 AC_SUBST(FLIB_LIST) |
|
517 AC_SUBST(FLIB_PATH) |
|
518 |
|
519 AC_SUBST(CXXLIB_LIST) |
|
520 AC_SUBST(CXXLIB_PATH) |
|
521 |
|
522 ### Checks for header files. |
|
523 |
832
|
524 AC_HEADER_STDC |
869
|
525 AC_CHECK_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h) |
|
526 AC_CHECK_HEADERS(string.h varargs.h unistd.h floatingpoint.h) |
|
527 AC_CHECK_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h) |
936
|
528 AC_CHECK_HEADERS(sys/ttold.h sys/ptem.h sys/select.h sys/resource.h) |
832
|
529 AC_HEADER_DIRENT |
792
|
530 AC_TIME_WITH_SYS_TIME |
869
|
531 |
|
532 ### Use sgtty on Ultrix so that using DEC Migrate to convert a Mips |
|
533 ### binary to an Alpha binary will work. Also on Alpha/OSF to avoid |
|
534 ### a readline bug. |
|
535 |
294
|
536 case "$canonical_host_type" in |
521
|
537 mips-dec-ultrix* | alpha-dec-osf*) |
869
|
538 AC_CHECK_HEADER(sgtty.h, [AC_DEFINE(HAVE_SGTTY_H, 1)], []) |
|
539 |
|
540 if test "$ac_cv_header_sgtty_h" = no; then |
|
541 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
|
542 fi |
|
543 ;; |
|
544 *) |
|
545 AC_CHECK_HEADERS(termios.h termio.h sgtty.h, [break], []) |
294
|
546 ;; |
|
547 esac |
869
|
548 |
|
549 if test "$ac_cv_header_termios_h" = yes \ |
|
550 || test "$ac_cv_header_termio_h" = yes \ |
|
551 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
552 true |
|
553 else |
|
554 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
555 fi |
869
|
556 |
|
557 ### Checks for functions. |
|
558 |
966
|
559 AC_CHECK_FUNCS(setvbuf getcwd gethostname bzero bcopy rindex vfprintf vsprintf) |
903
|
560 AC_CHECK_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror atexit) |
|
561 AC_CHECK_FUNCS(on_exit tempnam memmove putenv gettimeofday getrusage) |
869
|
562 |
832
|
563 dnl Would like to get rid of this cruft, and just have |
|
564 dnl |
|
565 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
566 dnl |
|
567 dnl instead, but that used to fail on some systems... |
369
|
568 dnl |
832
|
569 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
570 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
571 dnl fails, we try again by including math.h and invoking the function |
|
572 dnl with an argument. |
869
|
573 |
|
574 ### Check to see if we have IEEE math functions, and if so, which ones. |
|
575 ### |
|
576 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
577 ### functions, otherwise we may not find them. |
|
578 ### |
|
579 ### Also check for some additional trig functions that aren't ANSI but |
|
580 ### are often available. If they are missing, we try to replace them |
|
581 ### with functions from the BSD/NET2 math library. |
|
582 |
|
583 AC_CHECK_LIB(sunmath, main) |
1070
|
584 |
|
585 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
586 |
|
587 case "$canonical_host_type" in |
|
588 *-*-linux*) |
|
589 AC_CHECK_LIB(m, main, , , -lc) |
|
590 ;; |
|
591 *) |
|
592 AC_CHECK_LIB(m, main) |
|
593 ;; |
|
594 esac |
869
|
595 |
360
|
596 XCFLAGS="$CFLAGS" |
351
|
597 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
598 |
1075
|
599 ### Inf and NaN don't work with gcc on the Alpha yet. I am also told |
|
600 ### that they don't work on m68k HP sytems either. |
956
|
601 |
|
602 case "$canonical_host_type" in |
1075
|
603 alpha-dec-osf* | m68k-hp-hpux*) |
956
|
604 ;; |
|
605 *) |
|
606 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
607 ;; |
|
608 esac |
|
609 |
1076
|
610 ### Check for nonstandard but common math functions that we need. |
|
611 |
1172
|
612 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
613 |
360
|
614 CFLAGS="$XCFLAGS" |
869
|
615 |
|
616 ### Checks for OS specific cruft. |
|
617 |
405
|
618 AC_STRUCT_TM |
1186
|
619 AC_STRUCT_TIMEZONE |
832
|
620 AC_FUNC_SETVBUF_REVERSED |
1225
|
621 |
405
|
622 TERMLIBS="" |
|
623 for termlib in termcap terminfo curses termlib ; do |
832
|
624 AC_CHECK_LIB(${termlib}, main, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
625 case "${TERMLIBS}" in |
|
626 *-l${termlib}*) |
832
|
627 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
628 break |
|
629 ;; |
|
630 esac |
|
631 done |
1225
|
632 AC_SUBST(TERMLIBS) |
869
|
633 |
832
|
634 AC_MSG_CHECKING([for struct exception in math.h]) |
|
635 AC_TRY_LINK([#include <math.h>], |
|
636 [struct exception *x; x->type; x->name;], |
835
|
637 AC_MSG_RESULT(yes) |
832
|
638 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
639 AC_MSG_RESULT(no)) |
|
640 |
|
641 ### Signal stuff. |
|
642 |
834
|
643 AC_TYPE_SIGNAL |
885
|
644 AC_DECL_SYS_SIGLIST |
|
645 AC_MSG_CHECKING([for sys_siglist variable]) |
|
646 AC_TRY_LINK([#include <stdio.h>], |
|
647 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
648 AC_MSG_RESULT(yes) |
|
649 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
650 AC_MSG_RESULT(no)) |
869
|
651 |
|
652 ### Define VOID_SIGHANDLER for readline. |
|
653 |
405
|
654 case "$RETSIGTYPE" in |
|
655 int) |
|
656 ;; |
|
657 *) |
|
658 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
659 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
660 ;; |
|
661 esac |
869
|
662 AC_SUBST(VOID_SIGHANDLER) |
|
663 |
|
664 ### Checks for other programs used for building, testing, installing, |
|
665 ### and running Octave. |
|
666 ### |
|
667 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
668 ### it, and it might not be installed. |
|
669 ### |
|
670 ### Also make sure that we generate an interactive scanner if we are |
|
671 ### using flex. |
|
672 |
405
|
673 AC_PROG_LEX |
|
674 case "$LEX" in |
|
675 flex*) |
|
676 LFLAGS="-t -I" |
832
|
677 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
678 LEXLIB= |
|
679 ;; |
|
680 *) |
|
681 LFLAGS="-t" |
832
|
682 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
683 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
684 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
685 ;; |
|
686 esac |
869
|
687 AC_SUBST(LFLAGS) |
|
688 |
405
|
689 AC_PROG_YACC |
|
690 case "$YACC" in |
|
691 bison*) |
|
692 ;; |
|
693 *) |
832
|
694 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
695 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
696 ;; |
|
697 esac |
869
|
698 |
405
|
699 AC_PROG_RANLIB |
869
|
700 |
|
701 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
702 AC_CHECK_PROG(EXPECT, expect, expect, []) |
5
|
703 if test -z "$EXPECT" ; then |
|
704 RUNTEST= |
|
705 fi |
869
|
706 AC_SUBST(RUNTEST) |
|
707 |
405
|
708 AC_PROG_INSTALL |
869
|
709 |
|
710 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
405
|
711 if test -z "$GNUPLOT_BINARY"; then |
832
|
712 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
713 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
714 AC_MSG_WARN([plotting commands without it.]) |
|
715 AC_MSG_WARN([]) |
|
716 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
717 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
718 AC_MSG_WARN([]) |
|
719 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
720 AC_MSG_WARN([]) |
|
721 AC_MSG_WARN([at the Octave prompt.]) |
405
|
722 fi |
869
|
723 |
|
724 AC_CHECK_PROGS(DEFAULT_PAGER, less more page pg, []) |
405
|
725 if test -z "$DEFAULT_PAGER"; then |
832
|
726 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
727 elif test "$DEFAULT_PAGER" = less; then |
|
728 DEFAULT_PAGER="less -e" |
832
|
729 AC_MSG_RESULT([defining DEFAULT_PAGER to be $DEFAULT_PAGER]) |
405
|
730 fi |
869
|
731 |
|
732 ### Even though we include config.h in most files, some need to be |
|
733 ### compiled with the -D options on the compiler command line. Use |
|
734 ### UGLY_DEFS for that. |
|
735 |
832
|
736 AC_OUTPUT_MAKE_DEFS |
236
|
737 UGLY_DEFS="$DEFS" |
832
|
738 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
869
|
739 AC_SUBST(UGLY_DEFS) |
|
740 |
|
741 ### Maybe add -Wall to compiler flags now that we're done feature |
|
742 ### testing. |
|
743 ### |
|
744 ### To get gcc and g++ to be really picky, try these adding these |
|
745 ### options to CFLAGS and CXXFLAGS along with -Wall: |
|
746 ### |
|
747 ### -ansi |
|
748 ### -pedantic |
|
749 ### -Wwrite-strings |
|
750 ### -Wid-clash-31 |
|
751 ### -Wpointer-arith |
|
752 ### -Wcast-qual |
|
753 ### -Wenum-clash |
|
754 ### -Wcast-align |
|
755 ### -Wtraditional |
|
756 ### -Wstrict-prototypes |
|
757 ### -Wmissing-prototypes |
|
758 ### -Wnested-externs |
|
759 ### -Woverloaded-virtual |
|
760 ### -Winline |
|
761 ### -felide-constructors |
|
762 ### -fnonnull-objects |
|
763 |
405
|
764 if $ADD_CXX_WALL; then |
|
765 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
766 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
767 fi |
|
768 if $ADD_CC_WALL; then |
|
769 CFLAGS="$CFLAGS -Wall" |
832
|
770 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
771 fi |
869
|
772 |
1146
|
773 ### Run configure in subdirectories. |
|
774 |
|
775 AC_CONFIG_SUBDIRS(kpathsea) |
|
776 |
869
|
777 ### Do the substitutions in all the Makefiles. |
|
778 |
837
|
779 define([tmpA], [Makefile octMakefile Makeconf])dnl |
|
780 define([tmpB], [libcruft/Makefile libcruft/Makerules])dnl |
|
781 define([tmpC], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
782 define([tmpD], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
|
783 define([tmpE], [readline/examples/Makefile doc/Makefile])dnl |
1146
|
784 define([tmpF], [test/Makefile])dnl |
837
|
785 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE tmpF])dnl |
869
|
786 |
39
|
787 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
788 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
789 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
790 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
791 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
792 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
793 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
1075
|
794 define([tmph], [libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile])dnl |
|
795 define([tmpi], [libcruft/villad/Makefile])dnl |
869
|
796 |
1075
|
797 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph tmpi])dnl |
684
|
798 define([tmpSA], [scripts/Makefile scripts/control/Makefile])dnl |
869
|
799 define([tmpSB], [scripts/general/Makefile scripts/image/Makefile]) |
684
|
800 define([tmpSC], [scripts/linear-algebra/Makefile])dnl |
|
801 define([tmpSD], [scripts/miscellaneous/Makefile scripts/plot/Makefile])dnl |
|
802 define([tmpSE], [scripts/polynomial/Makefile scripts/set/Makefile])dnl |
|
803 define([tmpSF], [scripts/signal/Makefile scripts/special-matrix/Makefile])dnl |
733
|
804 define([tmpSG], [scripts/startup/Makefile scripts/statistics/Makefile])dnl |
717
|
805 define([tmpSH], [scripts/elfun/Makefile scripts/specfun/Makefile])dnl |
1208
|
806 define([tmpSI], [scripts/strings/Makefile scripts/time/Makefile])dnl |
937
|
807 define([mdirs], [tmpSA tmpSB tmpSC tmpSD tmpSE tmpSF tmpSG tmpSH tmpSI])dnl |
869
|
808 |
937
|
809 AC_OUTPUT([srcdirs cruftdirs mdirs]) |
1225
|
810 |
|
811 ### Print a summary so that important information isn't missed. |
|
812 |
|
813 CXX_EXTRAS="$HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES $GCC_IEEE_FP_FLAG" |
|
814 |
|
815 if test -z "$F77"; then |
|
816 FORT="$F2C $F2CFLAGS" |
|
817 else |
|
818 FORT="$F77 $FFLAGS $FUGLY" |
|
819 fi |
|
820 |
|
821 AC_MSG_RESULT([ |
|
822 |
|
823 Octave is now configured for $canonical_host_type |
|
824 |
|
825 Source directory: $srcdir |
|
826 Installation prefix: $prefix |
|
827 C compiler: $CC $GCC_IEEE_FP_FLAG $CFLAGS |
|
828 C++ compiler: $CXX $CXX_EXTRAS $CXXFLAGS |
|
829 Fortran compiler: $FORT |
|
830 Dynamic Linking: $use_dld |
|
831 Minimal kernel option: $lite_kernel |
|
832 Use GNU readline: $USE_READLINE |
|
833 Use GNU info reader: $USE_GNU_INFO |
|
834 Default pager: $DEFAULT_PAGER |
|
835 gnuplot: $GNUPLOT_BINARY |
|
836 ]) |