405
|
1 dnl configure.in |
|
2 dnl |
5
|
3 dnl Process this file with autoconf to produce a configure script. |
|
4 dnl |
1010
|
5 dnl Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
869
|
6 ### |
|
7 ### This file is part of Octave. |
|
8 ### |
|
9 ### Octave is free software; you can redistribute it and/or modify it |
|
10 ### under the terms of the GNU General Public License as published by the |
|
11 ### Free Software Foundation; either version 2, or (at your option) any |
|
12 ### later version. |
|
13 ### |
|
14 ### Octave is distributed in the hope that it will be useful, but WITHOUT |
|
15 ### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
16 ### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
17 ### for more details. |
|
18 ### |
|
19 ### You should have received a copy of the GNU General Public License |
|
20 ### along with Octave; see the file COPYING. If not, write to the Free |
|
21 ### Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
22 |
1239
|
23 AC_REVISION($Revision: 1.114 $) |
859
|
24 AC_PREREQ(2.0) |
405
|
25 AC_INIT(src/octave.cc) |
1146
|
26 AC_CONFIG_HEADER(config.h) |
869
|
27 |
|
28 AC_DEFINE(OCTAVE_SOURCE, 1) |
|
29 |
859
|
30 AC_CANONICAL_HOST |
885
|
31 if test -z "$host"; then |
|
32 host=unknown |
|
33 fi |
|
34 target_host_type=$host |
|
35 canonical_host_type=$host |
|
36 if test "$host" = unknown; then |
869
|
37 AC_MSG_WARN([configuring Octave for unknown system type |
859
|
38 ]) |
294
|
39 fi |
869
|
40 AC_SUBST(target_host_type) |
|
41 |
|
42 ### Allow the user to force us to use f2c. |
|
43 |
832
|
44 AC_ARG_WITH(f2c, |
|
45 [ --with-f2c use f2c even if Fortran compiler is available], |
1177
|
46 [if test $withval = no; then use_f2c=false; else use_f2c=true; fi], |
|
47 use_f2c=false) |
|
48 |
|
49 ### Allow the user to force us to use g77. |
|
50 |
|
51 AC_ARG_WITH(g77, |
|
52 [ --with-g77 use g77 to compile Fortran subroutines], |
|
53 [if test $withval = no; then use_g77=false; else use_g77=true; fi], |
|
54 use_g77=false) |
|
55 |
|
56 if $use_f2c && $use_g77; then |
|
57 AC_MSG_WARN([--with-f2c and --with-g77 both specified! Using g77...]) |
|
58 use_f2c=false |
|
59 fi |
869
|
60 |
|
61 ### Allow the user to experiment with dynamic linking using GNU dld. |
|
62 |
832
|
63 AC_ARG_ENABLE(dld, |
|
64 [ --enable-dld use DLD for dynamic linking (not all systems)], |
1177
|
65 [if test $enableval = no; then use_dld=false; else use_dld=true; fi], |
|
66 use_dld=false) |
869
|
67 AC_SUBST(use_dld) |
|
68 |
|
69 ### Allow compilation of smaller kernel. This only works if some form |
|
70 ### of dynamic linking is also supported and used. |
|
71 |
832
|
72 AC_ARG_ENABLE(lite-kernel, |
|
73 [ --enable-lite-kernel compile smaller kernel (requires DLD)], |
1177
|
74 [if test $enableval = no; then lite_kernel=false; else lite_kernel=true; fi], |
|
75 lite_kernel=false) |
702
|
76 if $lite_kernel; then |
869
|
77 AC_DEFINE(OCTAVE_LITE, 1) |
702
|
78 fi |
869
|
79 AC_SUBST(lite_kernel) |
|
80 |
1137
|
81 ### Allow the user disable support for GNU info. |
|
82 |
|
83 USE_GNU_INFO=true |
1152
|
84 LIBINFO=../info/libinfo.a |
1137
|
85 AC_ARG_ENABLE(info, |
|
86 [ --enable-info use GNU info (default is yes)], |
1177
|
87 [if test $enableval = no; then USE_GNU_INFO=false; LIBINFO=""; fi], []) |
1152
|
88 AC_SUBST(USE_GNU_INFO) |
1145
|
89 AC_SUBST(LIBINFO) |
1137
|
90 |
1138
|
91 ### Allow the user disable support for command line editing using GNU |
|
92 ### readline. |
|
93 |
|
94 USE_READLINE=true |
1152
|
95 LIBREADLINE=../readline/libreadline.a |
1138
|
96 AC_ARG_ENABLE(readline, |
|
97 [ --enable-readline use readline library (default is yes)], |
1177
|
98 [if test "$enableval" = no; then USE_READLINE=false; LIBREADLINE=""; fi], []) |
1152
|
99 AC_SUBST(USE_READLINE) |
1145
|
100 AC_SUBST(LIBREADLINE) |
1138
|
101 |
869
|
102 ### some defaults |
|
103 |
859
|
104 AC_PREFIX_DEFAULT(/usr/local) |
869
|
105 |
666
|
106 exec_prefix='$(prefix)' |
|
107 bindir='$(exec_prefix)/bin' |
|
108 datadir='$(prefix)/lib' |
|
109 libdir='$(exec_prefix)/lib' |
765
|
110 includedir='$(prefix)/include/octave' |
666
|
111 mandir='$(prefix)/man/man1' |
|
112 infodir='$(prefix)/info' |
684
|
113 fcnfiledir='$(datadir)/octave/$(version)/m' |
827
|
114 localfcnfiledir='$(datadir)/octave/site/m' |
|
115 localfcnfilepath='$(localfcnfiledir)//' |
795
|
116 archlibdir='$(libdir)/octave/$(version)/exec/$(target_host_type)' |
|
117 octfiledir='$(libdir)/octave/$(version)/oct/$(target_host_type)' |
827
|
118 localoctfiledir='$(datadir)/octave/site/oct/$(target_host_type)' |
|
119 localoctfilepath='$(localoctfiledir)//' |
765
|
120 fcnfilepath='.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//' |
827
|
121 imagedir='$(datadir)/octave/$(version)/imagelib' |
|
122 imagepath='.:$(imagedir)//' |
869
|
123 |
832
|
124 AC_MSG_RESULT([defining prefix to be $prefix]) |
|
125 AC_MSG_RESULT([defining exec_prefix to be $exec_prefix]) |
|
126 AC_MSG_RESULT([defining bindir to be $bindir]) |
|
127 AC_MSG_RESULT([defining datadir to be $datadir]) |
|
128 AC_MSG_RESULT([defining libdir to be $libdir]) |
|
129 AC_MSG_RESULT([defining includedir to be $includedir]) |
|
130 AC_MSG_RESULT([defining mandir to be $mandir]) |
|
131 AC_MSG_RESULT([defining infodir to be $infodir]) |
|
132 AC_MSG_RESULT([defining fcnfiledir to be $fcnfiledir]) |
|
133 AC_MSG_RESULT([defining localfcnfiledir to be $localfcnfiledir]) |
|
134 AC_MSG_RESULT([defining localfcnfilepath to be $localfcnfilepath]) |
|
135 AC_MSG_RESULT([defining archlibdir to be $archlibdir]) |
|
136 AC_MSG_RESULT([defining octfiledir to be $octfiledir]) |
|
137 AC_MSG_RESULT([defining localoctfiledir to be $localoctfiledir]) |
|
138 AC_MSG_RESULT([defining localoctfilepath to be $localoctfilepath]) |
|
139 AC_MSG_RESULT([defining fcnfilepath to be $fcnfilepath]) |
|
140 AC_MSG_RESULT([defining imagedir to be $imagedir]) |
|
141 AC_MSG_RESULT([defining imagepath to be $imagepath]) |
666
|
142 AC_SUBST(exec_prefix) |
|
143 AC_SUBST(bindir) |
|
144 AC_SUBST(datadir) |
|
145 AC_SUBST(libdir) |
|
146 AC_SUBST(includedir) |
|
147 AC_SUBST(mandir) |
|
148 AC_SUBST(infodir) |
|
149 AC_SUBST(fcnfiledir) |
827
|
150 AC_SUBST(localfcnfiledir) |
666
|
151 AC_SUBST(localfcnfilepath) |
|
152 AC_SUBST(archlibdir) |
|
153 AC_SUBST(octfiledir) |
827
|
154 AC_SUBST(localoctfiledir) |
666
|
155 AC_SUBST(localoctfilepath) |
|
156 AC_SUBST(fcnfilepath) |
827
|
157 AC_SUBST(imagedir) |
684
|
158 AC_SUBST(imagepath) |
869
|
159 |
1104
|
160 ### Path separator. |
|
161 |
|
162 AC_DEFINE(SEPCHAR, [':']) |
|
163 AC_DEFINE(SEPCHAR_STR, [":"]) |
|
164 |
869
|
165 ### Do special stuff if using dld. |
|
166 |
5
|
167 DLD_DIR= |
|
168 LIBDLD= |
759
|
169 LIBOCTDLD='liboctdld.a' |
5
|
170 LD_STATIC_FLAG= |
|
171 if $use_dld; then |
518
|
172 DLD_DIR=dld |
759
|
173 LIBDLD='../dld/libdld.a' |
702
|
174 # don't link them in only if doing dynamic linking and small kernel |
|
175 # requested. |
|
176 if $lite_kernel; then |
|
177 LIBOCTDLD= |
|
178 fi |
518
|
179 LD_STATIC_FLAG=-static |
869
|
180 AC_DEFINE(WITH_DLD, 1) |
518
|
181 fi |
869
|
182 |
|
183 ### Also use -static if compiling on Alpha OSF/1 1.3 systems. |
|
184 |
781
|
185 case "$canonical_host_type" in |
|
186 alpha-dec-osf1.3) |
|
187 LD_STATIC_FLAG=-static |
|
188 ;; |
|
189 esac |
869
|
190 |
518
|
191 if test -n "$DLD_DIR"; then |
832
|
192 AC_MSG_RESULT([defining DLD_DIR to be $DLD_DIR]) |
518
|
193 fi |
|
194 if test -n "$LIBDLD"; then |
832
|
195 AC_MSG_RESULT([defining LIBDLD to be $LIBDLD]) |
518
|
196 fi |
|
197 if test -n "$LIBOCTDLD"; then |
832
|
198 AC_MSG_RESULT([defining LIBOCTDLD to be $LIBOCTDLD]) |
518
|
199 fi |
|
200 if test -n "$LD_STATIC_FLAG"; then |
832
|
201 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
5
|
202 fi |
869
|
203 AC_SUBST(DLD_DIR) |
|
204 AC_SUBST(LIBDLD) |
|
205 AC_SUBST(LIBOCTDLD) |
|
206 AC_SUBST(LD_STATIC_FLAG) |
|
207 |
|
208 ### See if the optional nonlinear programming code is present. |
|
209 |
832
|
210 AC_MSG_CHECKING([for npsol]) |
5
|
211 if test -f $srcdir/libcruft/npsol/npsol.f; then |
1225
|
212 AC_MSG_RESULT(yes) |
5
|
213 else |
1225
|
214 AC_MSG_RESULT(no) |
869
|
215 AC_DEFINE(NPSOL_MISSING, 1) |
5
|
216 fi |
869
|
217 |
832
|
218 AC_MSG_CHECKING([for qpsol]) |
5
|
219 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
1225
|
220 AC_MSG_RESULT(yes) |
5
|
221 else |
1225
|
222 AC_MSG_RESULT(no) |
869
|
223 AC_DEFINE(QPSOL_MISSING, 1) |
5
|
224 fi |
869
|
225 |
832
|
226 AC_MSG_CHECKING([for fsqp]) |
5
|
227 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
1225
|
228 AC_MSG_RESULT(yes) |
5
|
229 else |
1225
|
230 AC_MSG_RESULT(no) |
869
|
231 AC_DEFINE(FSQP_MISSING, 1) |
5
|
232 fi |
869
|
233 |
|
234 ### See which C++ compiler to use (we expect to find g++). |
|
235 |
405
|
236 AC_PROG_CXX |
|
237 AC_PROG_CXXCPP |
869
|
238 |
|
239 ### Do special things for g++. |
|
240 |
405
|
241 ADD_CXX_WALL=false |
759
|
242 NO_IMPLICIT_TEMPLATES= |
1207
|
243 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | sed 's/^.*g.. version *//'` |
405
|
244 case "$gxx_version" in |
832
|
245 changequote(,)dnl |
|
246 2.[6789].*|2.[123456789][0123456789].*) |
|
247 changequote([,])dnl |
1087
|
248 if test -z "$CXXFLAGS"; then |
|
249 CXXFLAGS="-g -O" |
|
250 AC_MSG_RESULT([defining CXXFLAGS to be $CXXFLAGS]) |
|
251 ADD_CXX_WALL=true |
|
252 fi |
759
|
253 NO_IMPLICIT_TEMPLATES="-fno-implicit-templates" |
832
|
254 AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES]) |
405
|
255 ;; |
832
|
256 changequote(,)dnl |
|
257 1.*|2.[012345].*) |
|
258 changequote([,])dnl |
|
259 AC_MSG_WARN([g++ version $gxx_version will not work to compile Octave]) |
405
|
260 ;; |
|
261 *) |
832
|
262 AC_MSG_WARN([Octave has only been tested with g++, and I can't find it]) |
405
|
263 ;; |
|
264 esac |
869
|
265 |
1018
|
266 HOST_CXXFLAGS= |
965
|
267 case "$gxx_version" in |
|
268 2.6.*) |
|
269 case "$canonical_host_type" in |
|
270 rs6000-ibm-aix*) |
1018
|
271 HOST_CXXFLAGS="-Wa,-u" |
|
272 AC_MSG_RESULT([defining HOST_CXXFLAGS to be $HOST_CXXFLAGS]) |
965
|
273 ;; |
|
274 esac |
|
275 ;; |
|
276 esac |
|
277 |
1018
|
278 AC_SUBST(HOST_CXXFLAGS) |
1225
|
279 AC_SUBST(CXXFLAGS) |
|
280 AC_SUBST(NO_IMPLICIT_TEMPLATES) |
1018
|
281 |
869
|
282 ### See which C compiler to use (we expect to find gcc). |
|
283 |
5
|
284 AC_PROG_CC |
405
|
285 AC_PROG_CPP |
832
|
286 AC_PROG_GCC_TRADITIONAL |
869
|
287 |
|
288 ### Do special things for gcc. |
|
289 |
405
|
290 ADD_CC_WALL=false |
1207
|
291 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | sed 's/^.*gcc version *//'` |
405
|
292 case "$gcc_version" in |
|
293 2.*) |
1087
|
294 if test -z "$CFLAGS"; then |
|
295 CFLAGS="-g -O" |
|
296 AC_MSG_RESULT([defining CFLAGS to be $CFLAGS]) |
|
297 ADD_CC_WALL=true |
|
298 fi |
|
299 if test -z "$LDFLAGS"; then |
|
300 LDFLAGS="-g" |
|
301 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
302 fi |
405
|
303 ;; |
|
304 1.*) |
832
|
305 AC_MSG_WARN([gcc version $gcc_version is likely to cause problems]) |
405
|
306 ;; |
5
|
307 *) |
832
|
308 AC_MSG_WARN([Octave has only been tested with gcc, and I can't find it]) |
405
|
309 ;; |
5
|
310 esac |
869
|
311 |
|
312 AC_SUBST(CFLAGS) |
|
313 AC_SUBST(LDFLAGS) |
|
314 |
|
315 ### On Linux systems we need to compile with -mieee-fp to get full |
|
316 ### support for IEEE floating point. |
|
317 |
350
|
318 case "$canonical_host_type" in |
|
319 i386-*-linux | i486-*-linux | i586-*-linux) |
|
320 GCC_IEEE_FP_FLAG="-mieee-fp" |
832
|
321 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
324
|
322 ;; |
|
323 esac |
869
|
324 |
|
325 AC_SUBST(GCC_IEEE_FP_FLAG) |
|
326 |
|
327 ### Special checks for odd OS specific things. |
|
328 |
405
|
329 AC_ISC_POSIX |
|
330 AC_MINIX |
|
331 AC_AIX |
832
|
332 AC_CHECK_LIB(sun, getpwnam) |
869
|
333 |
|
334 ### How big are ints and how are they oriented? These could probably |
|
335 ### be eliminated in favor of run-time checks. |
|
336 |
832
|
337 AC_CHECK_SIZEOF(short) |
|
338 AC_CHECK_SIZEOF(int) |
|
339 AC_CHECK_SIZEOF(long) |
|
340 AC_C_BIGENDIAN |
869
|
341 |
|
342 ### Does the C compiler handle alloca() and const correctly? |
|
343 |
405
|
344 AC_ALLOCA |
832
|
345 AC_C_CONST |
869
|
346 |
1233
|
347 ### Get the list of libraries that the C++ compiler normally uses. |
|
348 |
|
349 OCTAVE_CXXLIBS |
|
350 |
869
|
351 ### If we haven't been forced to use f2c, try to find a Fortran compiler |
|
352 ### under any one of several common Un*x Fortran compiler names. |
|
353 ### Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
354 ### builtin. |
|
355 ### |
|
356 ### xlf : IBM / AIX |
|
357 ### cf77 : Cray / Unicos |
|
358 ### g77 : GNU Fortran (someday...) |
|
359 ### fc : Convex |
|
360 ### |
|
361 ### I don't think the Cray compiler will ever work like f2c... |
1239
|
362 ### |
|
363 ### The optional arguments to --with-g77 or --with-f2c force g77 or |
|
364 ### f2c to be used. The optional argument to can be used to set the |
|
365 ### name of g77 or f2c. For example `--with-g77=/opt/gnu/bin/f77' |
|
366 ### says that we are using g77 but it is installed as |
|
367 ### /opt/gnu/bin/f77. |
|
368 ### |
|
369 ### If neither of those options are specified, look for a Fortran |
|
370 ### compiler. If one is found, see if it is compatible with our |
|
371 ### assumptions. If it is, use it. Otherwise, look for f2c. |
|
372 ### |
|
373 ### Issue a warning if we can't find a compatible fortran compiler or |
|
374 ### f2c. |
1233
|
375 |
1177
|
376 if $use_g77; then |
1239
|
377 if test "$with_g77" = "yes"; then |
|
378 F77=g77 |
|
379 else |
|
380 F77="$with_g77" |
|
381 fi |
|
382 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
383 elif $use_f2c; then |
|
384 F77= |
1239
|
385 if test "$with_f2c" = "yes"; then |
|
386 F2C=g77 |
|
387 else |
|
388 F2C="$with_f2c" |
|
389 fi |
|
390 AC_MSG_RESULT([defining F2C to be $F2C]) |
5
|
391 else |
869
|
392 AC_CHECK_PROGS(F77, xlf cf77 f77 g77 fc) |
1233
|
393 fi |
5
|
394 |
1239
|
395 FUGLY= |
|
396 have_fortran_compiler=false |
|
397 have_f2c=false |
5
|
398 |
1239
|
399 if $use_g77; then |
|
400 FUGLY=-fugly |
|
401 AC_MSG_RESULT([defining FUGLY to be $FUGLY]) |
1233
|
402 OCTAVE_FLIBS |
1239
|
403 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
404 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
|
405 have_fortran_compiler=true |
|
406 elif $use_f2c; then |
|
407 have_f2c=true |
|
408 else |
|
409 if test -n "$F77"; then |
|
410 OCTAVE_FLIBS |
|
411 OCTAVE_F77_APPEND_UNDERSCORE |
|
412 OCTAVE_F2C_F77_COMPAT |
|
413 if test "$octave_cv_f2c_f77_compat" = no; then |
|
414 F77= |
|
415 else |
|
416 if test -z "$FFLAGS"; then |
|
417 FFLAGS="-O" |
|
418 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
419 fi |
|
420 fi |
|
421 fi |
|
422 if test -n "$F77"; then |
|
423 have_fortran_compiler=true |
1233
|
424 else |
1239
|
425 AC_CHECK_PROG(F2C, f2c, f2c, []) |
|
426 if test -n "$F2C"; then |
|
427 have_f2c=true |
5
|
428 fi |
|
429 fi |
|
430 fi |
869
|
431 |
1239
|
432 if $have_fortran_compiler; then |
995
|
433 DOT_C_FROM_DOT_F_CMD= |
1177
|
434 DOT_O_FROM_DOT_F_PAT='.f.o:' |
|
435 DOT_O_FROM_DOT_F_CMD=' $(FC) -c $(ALL_FFLAGS) $<' |
1239
|
436 elif $have_f2c; then |
|
437 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
438 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
869
|
439 AC_CHECK_LIB(f2c, main, FLIBS=-lf2c, []) |
5
|
440 if test -z "$FLIBS" ; then |
869
|
441 AC_CHECK_LIB(F77, main, FLIBS=-lF77, []) |
5
|
442 if test -n "$FLIBS" ; then |
869
|
443 AC_CHECK_LIB(I77, main, FLIBS="$FLIBS -lI77", []) |
5
|
444 fi |
|
445 fi |
|
446 if test -z "$FLIBS" ; then |
832
|
447 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
448 fi |
995
|
449 DOT_C_FROM_DOT_F_CMD=' cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
|
450 AC_MSG_RESULT([defining DOT_C_FROM_DOT_F_CMD to be $DOT_C_FROM_DOT_F_CMD]) |
|
451 DOT_O_FROM_DOT_F_PAT='%.o : %.f' |
1177
|
452 DOT_O_FROM_DOT_F_CMD= |
995
|
453 AC_MSG_RESULT([defining DOT_O_FROM_DOT_F_PAT to be $DOT_O_FROM_DOT_F_PAT]) |
5
|
454 else |
832
|
455 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
456 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
|
457 AC_MSG_WARN([See the file INSTALL for more information.]) |
|
458 AC_MSG_WARN([Continuing anyway...]) |
5
|
459 fi |
869
|
460 |
1163
|
461 FC=$F77 |
|
462 AC_SUBST(FC) |
869
|
463 AC_SUBST(F77) |
|
464 AC_SUBST(FFLAGS) |
1177
|
465 AC_SUBST(FUGLY) |
869
|
466 AC_SUBST(FLIBS) |
|
467 AC_SUBST(F2C) |
|
468 AC_SUBST(F2CFLAGS) |
995
|
469 AC_SUBST(DOT_C_FROM_DOT_F_CMD) |
|
470 AC_SUBST(DOT_O_FROM_DOT_F_PAT) |
1177
|
471 AC_SUBST(DOT_O_FROM_DOT_F_CMD) |
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' \ |
1175
|
479 -e 's/ -[LR] *[^ ]*/ /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' \ |
1175
|
485 -e 's/ -[LR] *[^ ]*/ /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' \ |
1175
|
494 -e 's/ -[LR] *\([^ ]*\)/ \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' \ |
1175
|
500 -e 's/ -[LR] *\([^ ]*\)/ \1/g' -e 's, /[^ ]*\.a , ,g' \ |
843
|
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 |
1172
|
609 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
610 |
360
|
611 CFLAGS="$XCFLAGS" |
869
|
612 |
|
613 ### Checks for OS specific cruft. |
|
614 |
405
|
615 AC_STRUCT_TM |
1186
|
616 AC_STRUCT_TIMEZONE |
832
|
617 AC_FUNC_SETVBUF_REVERSED |
1225
|
618 |
405
|
619 TERMLIBS="" |
|
620 for termlib in termcap terminfo curses termlib ; do |
832
|
621 AC_CHECK_LIB(${termlib}, main, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
622 case "${TERMLIBS}" in |
|
623 *-l${termlib}*) |
832
|
624 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
625 break |
|
626 ;; |
|
627 esac |
|
628 done |
1225
|
629 AC_SUBST(TERMLIBS) |
869
|
630 |
832
|
631 AC_MSG_CHECKING([for struct exception in math.h]) |
|
632 AC_TRY_LINK([#include <math.h>], |
|
633 [struct exception *x; x->type; x->name;], |
835
|
634 AC_MSG_RESULT(yes) |
832
|
635 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
636 AC_MSG_RESULT(no)) |
|
637 |
|
638 ### Signal stuff. |
|
639 |
834
|
640 AC_TYPE_SIGNAL |
885
|
641 AC_DECL_SYS_SIGLIST |
|
642 AC_MSG_CHECKING([for sys_siglist variable]) |
|
643 AC_TRY_LINK([#include <stdio.h>], |
|
644 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
645 AC_MSG_RESULT(yes) |
|
646 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
647 AC_MSG_RESULT(no)) |
869
|
648 |
|
649 ### Define VOID_SIGHANDLER for readline. |
|
650 |
405
|
651 case "$RETSIGTYPE" in |
|
652 int) |
|
653 ;; |
|
654 *) |
|
655 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
656 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
657 ;; |
|
658 esac |
869
|
659 AC_SUBST(VOID_SIGHANDLER) |
|
660 |
|
661 ### Checks for other programs used for building, testing, installing, |
|
662 ### and running Octave. |
|
663 ### |
|
664 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
665 ### it, and it might not be installed. |
|
666 ### |
|
667 ### Also make sure that we generate an interactive scanner if we are |
|
668 ### using flex. |
|
669 |
405
|
670 AC_PROG_LEX |
|
671 case "$LEX" in |
|
672 flex*) |
|
673 LFLAGS="-t -I" |
832
|
674 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
675 LEXLIB= |
|
676 ;; |
|
677 *) |
|
678 LFLAGS="-t" |
832
|
679 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
680 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
681 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
682 ;; |
|
683 esac |
869
|
684 AC_SUBST(LFLAGS) |
|
685 |
405
|
686 AC_PROG_YACC |
|
687 case "$YACC" in |
|
688 bison*) |
|
689 ;; |
|
690 *) |
832
|
691 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
692 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
693 ;; |
|
694 esac |
869
|
695 |
405
|
696 AC_PROG_RANLIB |
869
|
697 |
|
698 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
699 AC_CHECK_PROG(EXPECT, expect, expect, []) |
5
|
700 if test -z "$EXPECT" ; then |
|
701 RUNTEST= |
|
702 fi |
869
|
703 AC_SUBST(RUNTEST) |
|
704 |
405
|
705 AC_PROG_INSTALL |
869
|
706 |
|
707 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
405
|
708 if test -z "$GNUPLOT_BINARY"; then |
832
|
709 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
710 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
711 AC_MSG_WARN([plotting commands without it.]) |
|
712 AC_MSG_WARN([]) |
|
713 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
714 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
715 AC_MSG_WARN([]) |
|
716 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
717 AC_MSG_WARN([]) |
|
718 AC_MSG_WARN([at the Octave prompt.]) |
405
|
719 fi |
869
|
720 |
|
721 AC_CHECK_PROGS(DEFAULT_PAGER, less more page pg, []) |
405
|
722 if test -z "$DEFAULT_PAGER"; then |
832
|
723 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
724 elif test "$DEFAULT_PAGER" = less; then |
|
725 DEFAULT_PAGER="less -e" |
832
|
726 AC_MSG_RESULT([defining DEFAULT_PAGER to be $DEFAULT_PAGER]) |
405
|
727 fi |
869
|
728 |
|
729 ### Even though we include config.h in most files, some need to be |
|
730 ### compiled with the -D options on the compiler command line. Use |
|
731 ### UGLY_DEFS for that. |
|
732 |
832
|
733 AC_OUTPUT_MAKE_DEFS |
236
|
734 UGLY_DEFS="$DEFS" |
832
|
735 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
869
|
736 AC_SUBST(UGLY_DEFS) |
|
737 |
|
738 ### Maybe add -Wall to compiler flags now that we're done feature |
|
739 ### testing. |
|
740 ### |
|
741 ### To get gcc and g++ to be really picky, try these adding these |
|
742 ### options to CFLAGS and CXXFLAGS along with -Wall: |
|
743 ### |
|
744 ### -ansi |
|
745 ### -pedantic |
|
746 ### -Wwrite-strings |
|
747 ### -Wid-clash-31 |
|
748 ### -Wpointer-arith |
|
749 ### -Wcast-qual |
|
750 ### -Wenum-clash |
|
751 ### -Wcast-align |
|
752 ### -Wtraditional |
|
753 ### -Wstrict-prototypes |
|
754 ### -Wmissing-prototypes |
|
755 ### -Wnested-externs |
|
756 ### -Woverloaded-virtual |
|
757 ### -Winline |
|
758 ### -felide-constructors |
|
759 ### -fnonnull-objects |
|
760 |
405
|
761 if $ADD_CXX_WALL; then |
|
762 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
763 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
764 fi |
|
765 if $ADD_CC_WALL; then |
|
766 CFLAGS="$CFLAGS -Wall" |
832
|
767 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
768 fi |
869
|
769 |
1146
|
770 ### Run configure in subdirectories. |
|
771 |
1237
|
772 AC_CONFIG_SUBDIRS(kpathsea libcruft scripts) |
1146
|
773 |
869
|
774 ### Do the substitutions in all the Makefiles. |
|
775 |
837
|
776 define([tmpA], [Makefile octMakefile Makeconf])dnl |
|
777 define([tmpC], [liboctave/Makefile src/Makefile dld/Makefile])dnl |
|
778 define([tmpD], [info/Makefile readline/Makefile readline/doc/Makefile])dnl |
|
779 define([tmpE], [readline/examples/Makefile doc/Makefile])dnl |
1146
|
780 define([tmpF], [test/Makefile])dnl |
837
|
781 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE tmpF])dnl |
869
|
782 |
1237
|
783 AC_OUTPUT([srcdirs]) |
1225
|
784 |
|
785 ### Print a summary so that important information isn't missed. |
|
786 |
|
787 CXX_EXTRAS="$HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES $GCC_IEEE_FP_FLAG" |
|
788 |
|
789 if test -z "$F77"; then |
|
790 FORT="$F2C $F2CFLAGS" |
|
791 else |
|
792 FORT="$F77 $FFLAGS $FUGLY" |
|
793 fi |
|
794 |
|
795 AC_MSG_RESULT([ |
|
796 |
|
797 Octave is now configured for $canonical_host_type |
|
798 |
|
799 Source directory: $srcdir |
|
800 Installation prefix: $prefix |
|
801 C compiler: $CC $GCC_IEEE_FP_FLAG $CFLAGS |
|
802 C++ compiler: $CXX $CXX_EXTRAS $CXXFLAGS |
|
803 Fortran compiler: $FORT |
1233
|
804 Fortran libraries: $FLIBS |
1225
|
805 Dynamic Linking: $use_dld |
|
806 Minimal kernel option: $lite_kernel |
|
807 Use GNU readline: $USE_READLINE |
|
808 Use GNU info reader: $USE_GNU_INFO |
|
809 Default pager: $DEFAULT_PAGER |
|
810 gnuplot: $GNUPLOT_BINARY |
|
811 ]) |