405
|
1 dnl configure.in |
|
2 dnl |
5
|
3 dnl Process this file with autoconf to produce a configure script. |
|
4 dnl |
2847
|
5 dnl Copyright (C) 1996, 1997 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 |
2488
|
21 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
|
22 ### 02111-1307, USA. |
869
|
23 |
3687
|
24 AC_REVISION($Revision: 1.328 $) |
2034
|
25 AC_PREREQ(2.9) |
405
|
26 AC_INIT(src/octave.cc) |
1146
|
27 AC_CONFIG_HEADER(config.h) |
869
|
28 |
|
29 AC_DEFINE(OCTAVE_SOURCE, 1) |
|
30 |
2813
|
31 OCTAVE_HOST_TYPE |
1667
|
32 |
2223
|
33 ### some defaults |
|
34 |
2813
|
35 OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') |
|
36 OCTAVE_SET_DEFAULT(man1ext, '.1') |
|
37 OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') |
3597
|
38 OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') |
3029
|
39 OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') |
2813
|
40 OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') |
3597
|
41 OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') |
|
42 OCTAVE_SET_DEFAULT(localfcnfilepath, |
|
43 '$(localverfcnfiledir)//:$(localfcnfiledir)//') |
3141
|
44 OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') |
3029
|
45 OCTAVE_SET_DEFAULT(archlibdir, |
3130
|
46 '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') |
3029
|
47 OCTAVE_SET_DEFAULT(localarchlibdir, |
3130
|
48 '$(libexecdir)/octave/site/exec/$(canonical_host_type)') |
3597
|
49 OCTAVE_SET_DEFAULT(localverarchlibdir, |
|
50 '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') |
3029
|
51 OCTAVE_SET_DEFAULT(octfiledir, |
3130
|
52 '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') |
3029
|
53 OCTAVE_SET_DEFAULT(localoctfiledir, |
3130
|
54 '$(libexecdir)/octave/site/oct/$(canonical_host_type)') |
3597
|
55 OCTAVE_SET_DEFAULT(localveroctfiledir, |
|
56 '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') |
|
57 OCTAVE_SET_DEFAULT(localoctfilepath, |
|
58 '$(localveroctfiledir)//:$(localoctfiledir)//') |
3029
|
59 OCTAVE_SET_DEFAULT(fcnfilepath, |
|
60 '.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//') |
|
61 OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') |
2813
|
62 OCTAVE_SET_DEFAULT(imagepath, '.:$(imagedir)//') |
1667
|
63 |
2155
|
64 ### Make configure args available for other uses. |
|
65 |
|
66 config_opts=$ac_configure_args |
|
67 AC_SUBST(config_opts) |
|
68 |
1667
|
69 ### Path separator. |
|
70 |
1679
|
71 AC_DEFINE(SEPCHAR, [':']) |
|
72 AC_DEFINE(SEPCHAR_STR, [":"]) |
1667
|
73 |
869
|
74 ### Allow the user to force us to use f2c. |
|
75 |
832
|
76 AC_ARG_WITH(f2c, |
|
77 [ --with-f2c use f2c even if Fortran compiler is available], |
2813
|
78 [if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi], |
1177
|
79 use_f2c=false) |
|
80 |
|
81 ### Allow the user to force us to use g77. |
|
82 |
|
83 AC_ARG_WITH(g77, |
|
84 [ --with-g77 use g77 to compile Fortran subroutines], |
2813
|
85 [if test "$withval" = no; then use_g77=false; else use_g77=true; fi], |
1177
|
86 use_g77=false) |
|
87 |
2813
|
88 ### Allow the user to force us to use f77. |
|
89 |
|
90 AC_ARG_WITH(f77, |
|
91 [ --with-f77 use f77 to compile Fortran subroutines], |
|
92 [if test "$withval" = no; then use_f77=false; else use_f77=true; fi], |
|
93 use_f77=false) |
|
94 |
|
95 ### Make sure only one of the above options for Fortran compilers was |
|
96 ### specified (multiple "no" or --without-FOO options are ok). |
|
97 |
|
98 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, g77, |
3105
|
99 [warn_f77_and_g77="--with-f77 and --with-g77 both specified! Using g77..." |
|
100 AC_MSG_WARN($warn_f77_and_g77) |
2813
|
101 use_g77=false]) |
|
102 |
|
103 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, f2c, |
3105
|
104 [warn_f2c_and_f77="--with-f2c and --with-f77 both specified! Using f77..." |
|
105 AC_MSG_WARN($warn_f2c_and_f77) |
2813
|
106 use_f2c=false]) |
|
107 |
|
108 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(g77, f2c, |
3105
|
109 [warn_f2c_and_g77="--with-f2c and --with-g77 both specified! Using g77..." |
|
110 AC_MSG_WARN($warn_f2c_and_g77) |
2813
|
111 use_f2c=false]) |
869
|
112 |
2415
|
113 dnl ### Allow the user disable support for plplot. |
|
114 dnl |
|
115 dnl # USE_PLPLOT=true |
|
116 dnl # PLPLOT_DIR=plplot |
3156
|
117 dnl # LIBPLPLOT='$(TOPDIR)/plplot/libplplot.$(LIBEXT) |
1397
|
118 USE_PLPLOT=false |
|
119 PLPLOT_DIR="" |
|
120 LIBPLPLOT="" |
2415
|
121 dnl AC_ARG_ENABLE(plplot, |
|
122 dnl [ --enable-plplot use plplot for plotting (default is yes)], |
2813
|
123 dnl [if test "$enableval" = no; then |
2415
|
124 dnl USE_PLPLOT=false; |
|
125 dnl LIBPLPLOT=""; |
|
126 dnl PLPLOT_DIR=""; |
|
127 dnl fi], []) |
|
128 dnl if $USE_PLPLOT; then |
|
129 dnl AC_DEFINE(USE_PLPLOT, 1) |
|
130 dnl fi |
2421
|
131 AC_SUBST(LIBPLPLOT) |
|
132 AC_SUBST(PLPLOT_DIR) |
1137
|
133 |
1138
|
134 ### Allow the user disable support for command line editing using GNU |
|
135 ### readline. |
|
136 |
1261
|
137 READLINE_DIR=readline |
1138
|
138 USE_READLINE=true |
3156
|
139 LIBREADLINE='$(TOPDIR)/readline/libreadline.$(LIBEXT)' |
2930
|
140 AC_ARG_ENABLE(readline, |
|
141 [ --enable-readline use readline library (default is yes)], |
|
142 [if test "$enableval" = no; then |
|
143 USE_READLINE=false; |
|
144 LIBREADLINE=""; |
|
145 READLINE_DIR=""; |
|
146 fi], []) |
1264
|
147 if $USE_READLINE; then |
|
148 AC_DEFINE(USE_READLINE, 1) |
|
149 fi |
1145
|
150 AC_SUBST(LIBREADLINE) |
1261
|
151 AC_SUBST(READLINE_DIR) |
1138
|
152 |
3156
|
153 LIBKPATHSEA='$(TOPDIR)/kpathsea/libkpathsea.$(LIBEXT)' |
|
154 AC_SUBST(LIBKPATHSEA) |
|
155 |
2813
|
156 ### Make it possible to have Octave's array and matrix classes do bounds |
2108
|
157 ### checking on element references. This slows some operations down a |
2813
|
158 ### bit, so it is turned off by default. |
2108
|
159 |
2450
|
160 BOUNDS_CHECKING=false |
2108
|
161 AC_ARG_ENABLE(bounds-check, |
3060
|
162 [ --enable-bounds-check for internal array classes (default is no)], |
|
163 [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) |
2108
|
164 if $BOUNDS_CHECKING; then |
|
165 AC_DEFINE(BOUNDS_CHECKING, 1) |
|
166 fi |
|
167 |
3215
|
168 ### It seems that there are some broken inline assembly functions in |
|
169 ### the GNU libc. Since I'm not sure how to test whether we are using |
|
170 ### GNU libc, just disable them for all platforms. |
|
171 |
|
172 AC_MSG_RESULT([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) |
|
173 AC_DEFINE(__NO_MATH_INLINES, 1) |
|
174 |
869
|
175 ### See which C++ compiler to use (we expect to find g++). |
|
176 |
1334
|
177 EXTERN_CXXFLAGS="$CXXFLAGS" |
|
178 |
405
|
179 AC_PROG_CXX |
|
180 AC_PROG_CXXCPP |
869
|
181 |
|
182 ### Do special things for g++. |
|
183 |
2353
|
184 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ |
3107
|
185 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` |
|
186 |
405
|
187 case "$gxx_version" in |
832
|
188 changequote(,)dnl |
3107
|
189 1.* | 2.[0123456].* | 2.7.[01]*) |
832
|
190 changequote([,])dnl |
3107
|
191 AC_MSG_ERROR([g++ version $gxx_version will not work to compile Octave]) |
|
192 ;; |
405
|
193 esac |
869
|
194 |
1894
|
195 CXX_VERSION= |
|
196 if test -n "$gxx_version"; then |
|
197 CXX_VERSION="$gxx_version" |
|
198 fi |
|
199 AC_SUBST(CXX_VERSION) |
|
200 |
3107
|
201 OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
|
202 |
869
|
203 ### See which C compiler to use (we expect to find gcc). |
|
204 |
1334
|
205 EXTERN_CFLAGS="$CFLAGS" |
|
206 |
5
|
207 AC_PROG_CC |
405
|
208 AC_PROG_CPP |
832
|
209 AC_PROG_GCC_TRADITIONAL |
869
|
210 |
|
211 ### Do special things for gcc. |
|
212 |
2353
|
213 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ |
3107
|
214 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` |
405
|
215 case "$gcc_version" in |
|
216 2.*) |
1087
|
217 if test -z "$LDFLAGS"; then |
|
218 LDFLAGS="-g" |
|
219 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
220 fi |
405
|
221 ;; |
|
222 1.*) |
3105
|
223 warn_gcc_version="gcc version $gcc_version is likely to cause problems" |
|
224 AC_MSG_WARN($warn_gcc_version) |
405
|
225 ;; |
5
|
226 esac |
869
|
227 |
1894
|
228 CC_VERSION= |
|
229 if test -n "$gcc_version"; then |
|
230 CC_VERSION="$gcc_version" |
|
231 fi |
|
232 AC_SUBST(CC_VERSION) |
|
233 |
3065
|
234 ### On Intel systems with gcc, we may need to compile with -mieee-fp to |
2558
|
235 ### get full support for IEEE floating point. |
2020
|
236 ### |
3126
|
237 ### On Alpha/OSF systems, we need -mieee. |
869
|
238 |
3126
|
239 ieee_fp_flag= |
350
|
240 case "$canonical_host_type" in |
2022
|
241 changequote(,)dnl |
2558
|
242 i[3456789]86-*-*) |
2022
|
243 changequote([,])dnl |
3126
|
244 OCTAVE_CC_FLAG(-mieee-fp, [ |
|
245 ieee_fp_flag=-mieee-fp |
3131
|
246 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" |
|
247 AC_MSG_RESULT([adding -mieee-fp to XTRA_CFLAGS])]) |
3126
|
248 |
|
249 OCTAVE_CXX_FLAG(-mieee-fp, [ |
|
250 ieee_fp_flag=-mieee-fp |
3131
|
251 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" |
|
252 AC_MSG_RESULT([adding -mieee-fp to XTRA_CXXFLAGS])]) |
324
|
253 ;; |
3127
|
254 alpha*-*-*) |
3160
|
255 OCTAVE_CC_FLAG(-mieee-with-inexact, [ |
|
256 ieee_fp_flag=-mieee-with-inexact |
|
257 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-with-inexact" |
|
258 AC_MSG_RESULT([adding -mieee-with-inexact to XTRA_CFLAGS])]) |
3131
|
259 |
3160
|
260 OCTAVE_CXX_FLAG(-mieee-with-inexact, [ |
|
261 ieee_fp_flag=-mieee-with-inexact |
|
262 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-with-inexact" |
|
263 AC_MSG_RESULT([adding -mieee-with-inexact to XTRA_CXXFLAGS])]) |
2020
|
264 ;; |
3176
|
265 *ibm-aix4*) |
3351
|
266 OCTAVE_CC_FLAG(-mminimal-toc, [ |
|
267 XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) |
3176
|
268 |
3351
|
269 OCTAVE_CXX_FLAG(-mminimal-toc, [ |
|
270 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) |
3176
|
271 ;; |
324
|
272 esac |
3126
|
273 |
3130
|
274 ### Octave doesn't use run-time type identification or exceptions yet, |
|
275 ### so disable them for somewhat faster and smaller code. |
|
276 |
3131
|
277 OCTAVE_CXX_FLAG(-fno-rtti, [ |
|
278 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -fno-rtti" |
|
279 AC_MSG_RESULT([adding -fno-rtti to XTRA_CXXFLAGS])]) |
3126
|
280 |
3131
|
281 OCTAVE_CXX_FLAG(-fno-exceptions, [ |
|
282 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -fno-exceptions" |
|
283 AC_MSG_RESULT([adding -fno-exceptions to XTRA_CXXFLAGS])]) |
3126
|
284 |
|
285 ### We do our own template instantiation. |
|
286 |
3131
|
287 OCTAVE_CXX_FLAG(-fno-implicit-templates, [ |
|
288 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -fno-implicit-templates" |
|
289 AC_MSG_RESULT([adding -fno-implicit-templates to XTRA_CXXFLAGS])]) |
3126
|
290 |
|
291 AC_SUBST(XTRA_CFLAGS) |
|
292 AC_SUBST(XTRA_CXXFLAGS) |
869
|
293 |
1667
|
294 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
295 |
|
296 case "$canonical_host_type" in |
3127
|
297 alpha*-dec-osf1.3) |
1667
|
298 LD_STATIC_FLAG=-static |
|
299 ;; |
|
300 esac |
1679
|
301 if test -n "$LD_STATIC_FLAG"; then |
|
302 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
|
303 fi |
|
304 AC_SUBST(LD_STATIC_FLAG) |
1667
|
305 |
3222
|
306 OCTAVE_CXX_PREPENDS_UNDERSCORE |
|
307 |
3232
|
308 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
309 |
|
310 ### Look for math library. If found, this will add -lm to LIBS. |
|
311 |
|
312 case "$canonical_host_type" in |
|
313 *-*-nextstep*) |
|
314 ;; |
|
315 *-*-linux*) |
|
316 AC_CHECK_LIB(m, sin, , , -lc) |
|
317 ;; |
|
318 *) |
|
319 AC_CHECK_LIB(m, sin) |
|
320 ;; |
|
321 esac |
|
322 |
3687
|
323 # ---------------------------------------------------------------------- |
|
324 # Check for HDF5 library |
|
325 AC_ARG_WITH(hdf5, [ --without-hdf5 don't use HDF5 output], ok=$withval, ok=yes) |
|
326 if test "$ok" = "yes"; then |
|
327 AC_CHECK_LIB(z, deflate) |
|
328 AC_CHECK_LIB(hdf5, H5Pcreate, [ |
|
329 AC_CHECK_HEADERS(hdf5.h, [LIBS="-lhdf5 $LIBS" |
|
330 AC_DEFINE(HAVE_HDF5)])]) |
|
331 fi |
|
332 |
|
333 # ---------------------------------------------------------------------- |
|
334 |
3012
|
335 ### We need these before trying to find libf2c. |
|
336 |
3130
|
337 OCTAVE_PROG_AR |
3012
|
338 |
|
339 AC_PROG_RANLIB |
|
340 |
2813
|
341 ### If we haven't been forced to use a particular Fortran compiler, |
|
342 ### try to find one using any one of several common Un*x Fortran |
|
343 ### compiler names. Put fc last to avoid confusion with some vendor's |
|
344 ### /bin/sh fc builtin. |
2470
|
345 ### |
2813
|
346 ### f77 : most Unix systems |
869
|
347 ### xlf : IBM / AIX |
|
348 ### cf77 : Cray / Unicos |
2295
|
349 ### g77 : GNU Fortran |
869
|
350 ### fc : Convex |
|
351 ### |
2813
|
352 ### If a compiler is found, check to see if it is compatible with our |
|
353 ### assumptions. If it is, use it. Otherwise, look for f2c. If we |
|
354 ### can't find a compatible fortran compiler or f2c, issue a warning. |
|
355 ### |
869
|
356 ### I don't think the Cray compiler will ever work like f2c... |
1239
|
357 ### |
2813
|
358 ### The configure options --with-f77, --with-g77, or --with-f2c |
|
359 ### force f77, g77 or f2c to be used. It is also possible to use |
|
360 ### these options to specify the name of the compiler. For example, |
|
361 ### `--with-g77=/opt/gnu/bin/f77' says that we are using g77 but it is |
|
362 ### installed as /opt/gnu/bin/f77. |
1233
|
363 |
2813
|
364 if $use_f77; then |
3008
|
365 if test "$with_f77" = yes; then |
2813
|
366 F77=f77 |
|
367 else |
|
368 F77="$with_f77" |
|
369 fi |
|
370 AC_MSG_RESULT([defining F77 to be $F77]) |
|
371 elif $use_g77; then |
2336
|
372 if test "$with_g77" = yes; then |
1239
|
373 F77=g77 |
|
374 else |
|
375 F77="$with_g77" |
|
376 fi |
|
377 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
378 elif $use_f2c; then |
|
379 F77= |
2336
|
380 if test "$with_f2c" = yes; then |
1317
|
381 F2C=f2c |
1239
|
382 else |
|
383 F2C="$with_f2c" |
|
384 fi |
|
385 AC_MSG_RESULT([defining F2C to be $F2C]) |
5
|
386 else |
2295
|
387 AC_CHECK_PROGS(F77, g77 f77 f90 xlf cf77 fc) |
1233
|
388 fi |
5
|
389 |
1239
|
390 have_fortran_compiler=false |
|
391 have_f2c=false |
5
|
392 |
2813
|
393 if $use_f2c; then |
1239
|
394 have_f2c=true |
|
395 else |
|
396 if test -n "$F77"; then |
|
397 OCTAVE_FLIBS |
|
398 OCTAVE_F77_APPEND_UNDERSCORE |
|
399 OCTAVE_F2C_F77_COMPAT |
|
400 if test "$octave_cv_f2c_f77_compat" = no; then |
|
401 F77= |
|
402 else |
|
403 if test -z "$FFLAGS"; then |
|
404 FFLAGS="-O" |
1316
|
405 fi |
|
406 case "$canonical_host_type" in |
3127
|
407 alpha*-*-*) |
3249
|
408 if test "$octave_cv_f77_is_g77" = yes; then |
|
409 FFLAGS="$ieee_fp_flag $FFLAGS" |
2813
|
410 else |
2855
|
411 FFLAGS="-fpe1 $FFLAGS" |
2813
|
412 fi |
1316
|
413 ;; |
3233
|
414 powerpc-apple-machten*) |
|
415 FFLAGS= |
|
416 ;; |
1316
|
417 esac |
|
418 if test -n "$FFLAGS"; then |
1239
|
419 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
420 fi |
|
421 fi |
|
422 fi |
|
423 if test -n "$F77"; then |
|
424 have_fortran_compiler=true |
1233
|
425 else |
1239
|
426 AC_CHECK_PROG(F2C, f2c, f2c, []) |
|
427 if test -n "$F2C"; then |
|
428 have_f2c=true |
5
|
429 fi |
|
430 fi |
|
431 fi |
869
|
432 |
2762
|
433 f77_rules_frag=/dev/null |
1239
|
434 if $have_fortran_compiler; then |
2762
|
435 f77_rules_frag=Makefrag.f77 |
1679
|
436 changequote(,)dnl |
|
437 cat << \EOF > $f77_rules_frag |
1668
|
438 |
1753
|
439 %.c : %.f |
1668
|
440 |
1791
|
441 %.o : %.f |
3615
|
442 $(FC) -c $(ALL_FFLAGS) -o $@ $< |
1668
|
443 |
1984
|
444 pic/%.o : %.f |
|
445 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
446 |
1668
|
447 EOF |
1679
|
448 changequote([,])dnl |
1239
|
449 elif $have_f2c; then |
|
450 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
451 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
2562
|
452 |
|
453 ### This seems to be necessary on some Linux system. |
|
454 |
|
455 cat > conftest.$ac_ext << EOF |
|
456 int MAIN_ () { return 0; } |
|
457 int MAIN__ () { return 0; } |
|
458 EOF |
|
459 |
|
460 ### XXX FIMXE XXX -- these shouldn't be fixed names, eh? |
|
461 |
|
462 oct_conflib=libconflib.a |
|
463 oct_obj_ext=o |
|
464 |
|
465 if AC_TRY_EVAL(ac_compile); then |
|
466 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AC_FD_CC |
|
467 if test -n "$RANLIB"; then |
|
468 $RANLIB $oct_conflib 1>&AC_FD_CC |
5
|
469 fi |
|
470 fi |
2562
|
471 rm -f conftest* |
3232
|
472 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, [-L. -lconflib]) |
2562
|
473 rm -f $oct_conflib |
|
474 |
|
475 if test -z "$FLIBS"; then |
3232
|
476 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=) |
2562
|
477 if test -n "$FLIBS"; then |
|
478 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
479 fi |
|
480 fi |
|
481 |
1462
|
482 if test -z "$FLIBS"; then |
3105
|
483 warn_f2c_no_lib="I found f2c but not libf2c.a, or libF77.a and libI77.a" |
|
484 AC_MSG_WARN($warn_f2c_no_lib) |
5
|
485 fi |
2633
|
486 f77_rules_frag=Makefrag.f77 |
1679
|
487 cat << \EOF > $f77_rules_frag |
1668
|
488 |
1824
|
489 %.c : %.f |
1668
|
490 cat $< | $(F2C) $(F2CFLAGS) > $(@F) |
|
491 |
1753
|
492 %.o : %.f |
1668
|
493 |
|
494 EOF |
5
|
495 else |
832
|
496 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
497 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
498 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
499 fi |
869
|
500 |
3130
|
501 OCTAVE_F77_MAIN_FLAG |
2566
|
502 |
1163
|
503 FC=$F77 |
|
504 AC_SUBST(FC) |
869
|
505 AC_SUBST(F77) |
|
506 AC_SUBST(FFLAGS) |
|
507 AC_SUBST(FLIBS) |
|
508 AC_SUBST(F2C) |
|
509 AC_SUBST(F2CFLAGS) |
1679
|
510 AC_SUBST_FILE(f77_rules_frag) |
869
|
511 |
2813
|
512 ### Handle dynamic linking and shared library options. |
|
513 |
|
514 ### Allow the user to experiment with dynamic linking using dlopen/dlsym. |
|
515 |
|
516 AC_ARG_ENABLE(dl, |
|
517 [ --enable-dl use dlopen/dlsym for dynamic linking (not all systems)], |
|
518 [if test "$enableval" = no; then WITH_DL=no; |
|
519 elif test "$enableval" = yes; then WITH_DL=yes; |
|
520 else WITH_DL=maybe; fi], |
|
521 WITH_DL=maybe) |
|
522 |
|
523 ### Allow the user to experiment with dynamic linking using |
|
524 ### shl_load/shl_findsym (HP/UX only?). |
|
525 |
|
526 AC_ARG_ENABLE(shl, |
|
527 [ --enable-shl use shl_load/shl_findsym for dynamic linking (HP only)], |
|
528 [if test "$enableval" = no; then WITH_SHL=no; |
|
529 elif test "$enableval" = yes; then WITH_SHL=yes; |
|
530 else WITH_SHL=maybe; fi], |
|
531 WITH_SHL=maybe) |
|
532 |
3034
|
533 ### Enable creation of static libraries. |
|
534 |
|
535 AC_ARG_ENABLE(static, |
|
536 [ --enable-static create static libraries], |
|
537 [if test "$enableval" = no; then STATIC_LIBS=false; |
|
538 else STATIC_LIBS=true; fi], |
|
539 STATIC_LIBS=true) |
|
540 AC_SUBST(STATIC_LIBS) |
|
541 |
2813
|
542 ### Enable creation of shared libraries. Currently only works with |
|
543 ### gcc on some systems. |
|
544 |
|
545 AC_ARG_ENABLE(shared, |
|
546 [ --enable-shared create shared libraries (not all systems)], |
|
547 [if test "$enableval" = no; then SHARED_LIBS=false; |
|
548 else SHARED_LIBS=true; fi], |
|
549 SHARED_LIBS=false) |
|
550 AC_SUBST(SHARED_LIBS) |
|
551 |
3034
|
552 if $STATIC_LIBS || $SHARED_LIBS; then |
|
553 true |
|
554 else |
|
555 AC_MSG_ERROR([You can't disable building static AND shared libraries!]) |
|
556 fi |
|
557 |
3156
|
558 if $SHARED_LIBS; then |
|
559 LIBOCTINTERP=-loctinterp |
|
560 LIBOCTAVE=-loctave |
|
561 LIBCRUFT=-lcruft |
|
562 else |
|
563 LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)' |
|
564 LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)' |
|
565 LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)' |
|
566 fi |
|
567 AC_SUBST(LIBOCTINTERP) |
|
568 AC_SUBST(LIBOCTAVE) |
|
569 AC_SUBST(LIBCRUFT) |
|
570 |
2813
|
571 use_rpath=true |
|
572 AC_ARG_ENABLE(rpath, |
|
573 [ --enable-rpath add -rpath to link command for shared libraries], |
|
574 [if test "$enableval" = no; then use_rpath=false; fi], []) |
|
575 |
|
576 DLFCN_DIR= |
|
577 CPICFLAG=-fPIC |
|
578 CXXPICFLAG=-fPIC |
|
579 FPICFLAG=-fPIC |
|
580 SHLEXT=so |
3124
|
581 SH_LD="$CXX" |
2813
|
582 SH_LDFLAGS=-shared |
3036
|
583 SONAME_FLAGS= |
2813
|
584 RLD_FLAG= |
|
585 case "$canonical_host_type" in |
|
586 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
587 SH_LD=ld |
|
588 SH_LDFLAGS=-Bshareable |
|
589 ;; |
3127
|
590 alpha*-dec-osf*) |
2813
|
591 CPICFLAG= |
|
592 CXXPICFLAG= |
|
593 FPICFLAG= |
|
594 SH_LDFLAGS="-shared -Xlinker -expect_unresolved -Xlinker '*'" |
3037
|
595 SONAME_FLAGS='-Xlinker -soname -Xlinker $@' |
3162
|
596 RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)' |
2813
|
597 ;; |
3178
|
598 *-*-linux*) |
3038
|
599 SONAME_FLAGS='-Xlinker -soname -Xlinker $@' |
3162
|
600 RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)' |
2813
|
601 ;; |
3160
|
602 changequote(,)dnl |
|
603 i[3456]86-*-sco3.2v5*) |
|
604 changequote([,])dnl |
|
605 SH_LDFLAGS=-G |
|
606 ;; |
2813
|
607 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
608 CPICFLAG= |
|
609 CXXPICFLAG= |
|
610 FPICFLAG= |
|
611 DLFCN_DIR=dlfcn |
|
612 ;; |
|
613 hppa*-hp-hpux*) |
3160
|
614 if test "$octave_cv_f77_is_g77" = yes; then |
2813
|
615 FPICFLAG=-fPIC |
|
616 else |
|
617 FPICFLAG=+Z |
|
618 fi |
|
619 SHLEXT=sl |
|
620 SH_LDFLAGS="-shared -fPIC" |
3162
|
621 RLD_FLAG='-Xlinker +b -Xlinker $(octlibdir)' |
2813
|
622 ;; |
|
623 *-sgi-*) |
|
624 CPICFLAG= |
|
625 CXXPICFLAG= |
|
626 FPICFLAG= |
3162
|
627 RLD_FLAG='-L$(octlibdir)' |
2813
|
628 ;; |
|
629 sparc-sun-sunos4*) |
3160
|
630 if test "$octave_cv_f77_is_g77" = yes; then |
2813
|
631 FPICFLAG=-fPIC |
|
632 else |
|
633 FPICFLAG=-PIC |
|
634 fi |
3059
|
635 SH_LD=ld |
|
636 SH_LDFLAGS="-assert nodefinitions" |
3162
|
637 RLD_FLAG='-L$(octlibdir)' |
2813
|
638 ;; |
3606
|
639 sparc-sun-solaris2* | i386-pc-solaris2*) |
3160
|
640 if test "$octave_cv_f77_is_g77" = yes; then |
2813
|
641 FPICFLAG=-fPIC |
|
642 else |
|
643 FPICFLAG=-PIC |
|
644 fi |
3162
|
645 RLD_FLAG='-Xlinker -R -Xlinker $(octlibdir)' |
2813
|
646 ;; |
|
647 esac |
|
648 |
|
649 if $use_rpath; then |
|
650 true |
|
651 else |
|
652 RLD_FLAG= |
|
653 fi |
|
654 |
|
655 AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) |
|
656 AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) |
|
657 AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) |
|
658 AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) |
|
659 AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) |
|
660 AC_MSG_RESULT([defining SH_LD to be $SH_LD]) |
|
661 AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) |
3036
|
662 AC_MSG_RESULT([defining SONAME_FLAGS to be $SONAME_FLAGS]) |
2813
|
663 AC_MSG_RESULT([defining RLD_FLAG to be $RLD_FLAG]) |
|
664 AC_SUBST(FPICFLAG) |
|
665 AC_SUBST(CPICFLAG) |
|
666 AC_SUBST(CXXPICFLAG) |
|
667 AC_SUBST(SHLEXT) |
|
668 AC_SUBST(DLFCN_DIR) |
|
669 AC_SUBST(SH_LD) |
|
670 AC_SUBST(SH_LDFLAGS) |
3036
|
671 AC_SUBST(SONAME_FLAGS) |
2813
|
672 AC_SUBST(RLD_FLAG) |
|
673 |
|
674 ### Allow compilation of smaller kernel. This only works if some form |
|
675 ### of dynamic linking is also supported and used. |
|
676 |
|
677 AC_ARG_ENABLE(lite-kernel, |
|
678 [ --enable-lite-kernel compile smaller kernel (requires dynamic linking)], |
|
679 [if test "$enableval" = no; then OCTAVE_LITE=false; |
|
680 else OCTAVE_LITE=true; fi], |
|
681 OCTAVE_LITE=false) |
|
682 if $OCTAVE_LITE; then |
|
683 AC_DEFINE(OCTAVE_LITE, 1) |
|
684 fi |
|
685 AC_SUBST(OCTAVE_LITE) |
|
686 |
|
687 ### special checks for odd OS specific things. |
|
688 ### |
|
689 ### I am told that on some SCO systems, the only place to find some |
|
690 ### functions like gethostname and gettimeofday is in libsocket. |
|
691 |
|
692 AC_ISC_POSIX |
|
693 AC_MINIX |
|
694 AC_AIX |
|
695 AC_CHECK_LIB(sun, getpwnam) |
|
696 AC_CHECK_LIB(socket, gethostname) |
|
697 |
3111
|
698 case "$canonical_host_type" in |
3127
|
699 alpha*-dec-osf*) |
3111
|
700 AC_CHECK_LIB(dxml, dgemm_, [SPECIAL_MATH_LIB=-ldxml]) |
|
701 ;; |
|
702 esac |
|
703 AC_SUBST(SPECIAL_MATH_LIB) |
|
704 |
2813
|
705 ### How big are ints and how are they oriented? These could probably |
|
706 ### be eliminated in favor of run-time checks. |
|
707 |
3130
|
708 AC_CHECK_SIZEOF(short, 2) |
|
709 AC_CHECK_SIZEOF(int, 4) |
|
710 AC_CHECK_SIZEOF(long, 4) |
2813
|
711 |
|
712 ### Does the C compiler handle alloca() and const correctly? |
|
713 |
|
714 AC_ALLOCA |
|
715 AC_C_CONST |
|
716 |
|
717 ### See if we should define NPOS. |
|
718 |
|
719 OCTAVE_STRING_NPOS |
|
720 |
869
|
721 ### Checks for header files. |
|
722 |
832
|
723 AC_HEADER_STDC |
|
724 AC_HEADER_DIRENT |
1377
|
725 AC_HEADER_TIME |
|
726 AC_HEADER_SYS_WAIT |
2097
|
727 |
3308
|
728 AC_CHECK_HEADERS(assert.h curses.h dlfcn.h fcntl.h float.h \ |
|
729 floatingpoint.h fnmatch.h glob.h grp.h ieeefp.h limits.h memory.h \ |
|
730 nan.h ncurses.h poll.h pwd.h sgtty.h stdlib.h string.h sys/ioctl.h \ |
|
731 sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ |
|
732 sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h \ |
|
733 termio.h $TERMIOS_H unistd.h varargs.h) |
3249
|
734 |
3225
|
735 ### I'm told that termios.h is broken on NeXT systems. |
|
736 |
|
737 case "$canonical_host_type" in |
|
738 *-*-nextstep*) |
3249
|
739 if test "$ac_cv_header_termios_h" = yes; then |
|
740 AC_MSG_WARN([Ignoring termios.h on NeXT systems.]) |
|
741 ac_cv_header_termios_h=no |
|
742 fi |
3225
|
743 ;; |
|
744 esac |
|
745 |
869
|
746 if test "$ac_cv_header_termios_h" = yes \ |
|
747 || test "$ac_cv_header_termio_h" = yes \ |
|
748 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
749 true |
|
750 else |
|
751 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
752 fi |
869
|
753 |
3177
|
754 |
3156
|
755 GLOB_DIR=glob |
|
756 LIBGLOB='$(TOPDIR)/glob/libglob.$(LIBEXT)' |
|
757 GLOB_INCFLAGS='-I$(top_srcdir)/glob -I$(TOPDIR)/glob' |
3160
|
758 if test "$ac_cv_header_fnmatch_h" = yes \ |
|
759 && test "$ac_cv_header_glob_h" = yes; then |
3177
|
760 AC_EGREP_CPP(yes, |
|
761 [#ifdef FNM_NOESCAPE |
|
762 #ifdef FNM_FOOBAR_PATHNAME |
|
763 #ifdef FNM_PERIOD |
|
764 yes |
|
765 #endif |
|
766 #endif |
|
767 #endif |
|
768 ], [ |
|
769 GLOB_DIR= |
|
770 AC_CHECK_LIB(glob, glob) |
|
771 AC_CHECK_FUNCS(fnmatch glob) |
|
772 if test "$ac_cv_func_fnmatch" = yes \ |
|
773 && test "$ac_cv_func_glob" = yes; then |
|
774 GLOB_DIR= |
|
775 LIBGLOB= |
|
776 GLOB_INCFLAGS= |
|
777 fi |
|
778 ], [ |
|
779 ### We provide replacements, so we should set these to "yes". |
|
780 AC_CACHE_VAL(ac_cv_func_fnmatch, ac_cv_func_fnmatch=yes) |
|
781 AC_CACHE_VAL(ac_cv_func_glob, ac_cv_func_glob=yes) |
|
782 ]) |
|
783 else |
|
784 ### We provide replacements, so we should set these to "yes". |
|
785 ac_cv_header_fnmatch_h=yes |
|
786 ac_cv_header_glob_h=yes |
|
787 AC_CACHE_VAL(ac_cv_func_fnmatch, ac_cv_func_fnmatch=yes) |
|
788 AC_CACHE_VAL(ac_cv_func_glob, ac_cv_func_glob=yes) |
3156
|
789 fi |
|
790 AC_SUBST(GLOB_DIR) |
|
791 AC_SUBST(LIBGLOB) |
|
792 AC_SUBST(GLOB_INCFLAGS) |
|
793 |
1788
|
794 ### Checks for functions and variables. |
869
|
795 |
2475
|
796 AC_CHECK_FUNCS(atexit bcopy bzero dup2 endgrent endpwent execvp fcntl \ |
|
797 fork getcwd getegid geteuid getgid getgrent getgrgid getgrnam \ |
2782
|
798 gethostname getpgrp getpid getppid getpwent getpwnam getpwuid \ |
3465
|
799 gettimeofday getuid getwd localtime_r lstat memmove mkdir mkfifo \ |
|
800 on_exit pipe poll putenv rename rindex rmdir select setgrent \ |
3620
|
801 setpwent setvbuf sigaction sigpending sigprocmask sigsuspend \ |
|
802 stat strcasecmp strdup strerror strftime stricmp strncasecmp \ |
|
803 strnicmp strptime tempnam umask unlink usleep vfprintf vsprintf \ |
|
804 vsnprintf waitpid) |
1300
|
805 |
1708
|
806 OCTAVE_SMART_PUTENV |
|
807 |
2064
|
808 LIBDLFCN= |
|
809 DLFCN_INCFLAGS= |
3232
|
810 RDYNAMIC_FLAG= |
1978
|
811 if test "$WITH_DL" = yes || test "$WITH_DL" = maybe; then |
2063
|
812 case "$canonical_host_type" in |
|
813 rs6000-ibm-aix* | powerpc-ibm-aix*) |
2346
|
814 LIBDLFCN="-ldlfcn -ll -lld" |
2064
|
815 DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn' |
2063
|
816 WITH_DL=true |
|
817 ;; |
3160
|
818 changequote(,)dnl |
|
819 i[3456]86-*-sco3.2v5*) |
|
820 changequote([,])dnl |
|
821 WITH_DL=true |
|
822 ;; |
2063
|
823 *) |
|
824 AC_CHECK_LIB(dl, dlopen) |
|
825 AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) |
|
826 if test "$ac_cv_func_dlopen" = yes \ |
|
827 && test "$ac_cv_func_dlsym" = yes \ |
|
828 && test "$ac_cv_func_dlerror" = yes \ |
|
829 && test "$ac_cv_func_dlclose" = yes; then |
|
830 WITH_DL=true |
|
831 else |
|
832 if test "$WITH_DL" = yes; then |
|
833 AC_MSG_ERROR([--enable-dl specified, but functions are missing!]) |
|
834 fi |
|
835 WITH_DL=false |
|
836 fi |
|
837 ;; |
|
838 esac |
1978
|
839 if $WITH_DL; then |
3232
|
840 OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic]) |
1978
|
841 AC_DEFINE(WITH_DL, 1) |
|
842 fi |
|
843 else |
|
844 WITH_DL=false |
1664
|
845 fi |
1978
|
846 AC_SUBST(WITH_DL) |
2064
|
847 AC_SUBST(LIBDLFCN) |
|
848 AC_SUBST(DLFCN_INCFLAGS) |
3232
|
849 AC_SUBST(RDYNAMIC_FLAG) |
1664
|
850 |
1978
|
851 if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then |
|
852 AC_CHECK_LIB(dld, shl_load) |
|
853 AC_CHECK_FUNCS(shl_load shl_findsym) |
|
854 if test "$ac_cv_func_shl_load" = yes \ |
|
855 && test "$ac_cv_func_shl_findsym" = yes; then |
|
856 WITH_SHL=true |
|
857 else |
|
858 if test "$WITH_SHL" = yes; then |
|
859 AC_MSG_ERROR([--enable-shl specified, but functions are missing!]) |
|
860 fi |
|
861 WITH_SHL=false |
|
862 fi |
|
863 if $WITH_SHL; then |
|
864 AC_DEFINE(WITH_SHL, 1) |
|
865 fi |
|
866 else |
|
867 WITH_SHL=false |
1664
|
868 fi |
1978
|
869 AC_SUBST(WITH_SHL) |
1664
|
870 |
1901
|
871 ### Set WITH_DYNAMIC_LINKING after all the other shared library stuff |
|
872 ### has been determined. |
|
873 |
|
874 if $WITH_DL || $WITH_SHL; then |
|
875 AC_DEFINE(WITH_DYNAMIC_LINKING, 1) |
|
876 WITH_DYNAMIC_LINKING=true |
|
877 else |
|
878 WITH_DYNAMIC_LINKING=false |
|
879 fi |
|
880 AC_SUBST(WITH_DYNAMIC_LINKING) |
|
881 |
1300
|
882 ### There is more than one possible prototype for gettimeofday. See |
2782
|
883 ### which one (if any) appears in sys/time.h. These tests are from |
|
884 ### Emacs 19. |
1300
|
885 |
2782
|
886 AC_MSG_CHECKING(for struct timeval) |
|
887 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME |
|
888 #include <sys/time.h> |
|
889 #include <time.h> |
|
890 #else |
|
891 #ifdef HAVE_SYS_TIME_H |
|
892 #include <sys/time.h> |
|
893 #else |
|
894 #include <time.h> |
|
895 #endif |
|
896 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;], |
|
897 [AC_MSG_RESULT(yes) |
|
898 HAVE_TIMEVAL=yes |
|
899 AC_DEFINE(HAVE_TIMEVAL)], |
|
900 [AC_MSG_RESULT(no) |
|
901 HAVE_TIMEVAL=no]) |
|
902 |
|
903 if test "x$HAVE_TIMEVAL" = xyes; then |
|
904 AC_MSG_CHECKING(whether gettimeofday can't accept two arguments) |
|
905 AC_TRY_LINK([#ifdef TIME_WITH_SYS_TIME |
|
906 #include <sys/time.h> |
|
907 #include <time.h> |
|
908 #else |
|
909 #ifdef HAVE_SYS_TIME_H |
|
910 #include <sys/time.h> |
|
911 #else |
|
912 #include <time.h> |
|
913 #endif |
|
914 #endif],[struct timeval time; struct timezone dummy; |
|
915 gettimeofday (&time, &dummy);], [AC_MSG_RESULT(no)], |
|
916 [AC_MSG_RESULT(yes) |
|
917 AC_DEFINE(GETTIMEOFDAY_NO_TZ)]) |
|
918 fi |
869
|
919 |
832
|
920 dnl Would like to get rid of this cruft, and just have |
|
921 dnl |
|
922 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
923 dnl |
|
924 dnl instead, but that used to fail on some systems... |
369
|
925 dnl |
832
|
926 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
927 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
928 dnl fails, we try again by including math.h and invoking the function |
|
929 dnl with an argument. |
869
|
930 |
2508
|
931 ### I am told that Inf and NaN don't work on m68k HP sytems, and that |
|
932 ### on SCO systems, isnan and isinf don't work, but they can be |
|
933 ### replaced by something that does. |
956
|
934 |
|
935 case "$canonical_host_type" in |
1384
|
936 m68k-hp-hpux*) |
956
|
937 ;; |
2508
|
938 *-*-sco*) |
|
939 AC_MSG_RESULT([defining SCO to be 1]) |
|
940 AC_DEFINE(SCO, 1) |
|
941 AC_MSG_RESULT([forcing HAVE_ISINF for SCO]) |
|
942 AC_DEFINE(HAVE_ISINF, 1) |
|
943 AC_MSG_RESULT([forcing HAVE_ISNAN for SCO]) |
|
944 AC_DEFINE(HAVE_ISNAN, 1) |
|
945 ;; |
956
|
946 *) |
3475
|
947 AC_CHECK_FUNCS(finite isnan isinf) |
956
|
948 ;; |
|
949 esac |
|
950 |
1076
|
951 ### Check for nonstandard but common math functions that we need. |
|
952 |
3130
|
953 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
|
954 |
869
|
955 ### Checks for OS specific cruft. |
|
956 |
1377
|
957 AC_STRUCT_ST_BLKSIZE |
|
958 AC_STRUCT_ST_BLOCKS |
|
959 AC_STRUCT_ST_RDEV |
405
|
960 AC_STRUCT_TM |
1186
|
961 AC_STRUCT_TIMEZONE |
1388
|
962 AC_FUNC_CLOSEDIR_VOID |
1225
|
963 |
2548
|
964 OCTAVE_STRUCT_GR_PASSWD |
|
965 |
405
|
966 TERMLIBS="" |
2592
|
967 for termlib in ncurses curses termcap terminfo termlib; do |
2034
|
968 AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
969 case "${TERMLIBS}" in |
|
970 *-l${termlib}*) |
832
|
971 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
972 break |
|
973 ;; |
|
974 esac |
|
975 done |
1225
|
976 AC_SUBST(TERMLIBS) |
869
|
977 |
2509
|
978 if test "$ac_cv_lib_termcap_tputs" = yes \ |
|
979 || test "$ac_cv_lib_terminfo_tputs" = yes \ |
|
980 || test "$ac_cv_lib_ncurses_tputs" = yes \ |
|
981 || test "$ac_cv_lib_curses_tputs" = yes \ |
|
982 || test "$ac_cv_lib_termlib_tputs" = yes; then |
2488
|
983 true |
|
984 else |
3105
|
985 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!" |
|
986 AC_MSG_WARN($warn_termlibs) |
2488
|
987 fi |
|
988 |
832
|
989 AC_MSG_CHECKING([for struct exception in math.h]) |
|
990 AC_TRY_LINK([#include <math.h>], |
|
991 [struct exception *x; x->type; x->name;], |
835
|
992 AC_MSG_RESULT(yes) |
832
|
993 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
994 AC_MSG_RESULT(no)) |
|
995 |
|
996 ### Signal stuff. |
|
997 |
834
|
998 AC_TYPE_SIGNAL |
885
|
999 AC_DECL_SYS_SIGLIST |
|
1000 AC_MSG_CHECKING([for sys_siglist variable]) |
|
1001 AC_TRY_LINK([#include <stdio.h>], |
|
1002 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
1003 AC_MSG_RESULT(yes) |
|
1004 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
1005 AC_MSG_RESULT(no)) |
2470
|
1006 OCTAVE_SIGNAL_CHECK |
|
1007 OCTAVE_REINSTALL_SIGHANDLERS |
869
|
1008 |
1762
|
1009 ### Type stuff. |
|
1010 |
|
1011 AC_TYPE_MODE_T |
|
1012 AC_TYPE_OFF_T |
2097
|
1013 AC_TYPE_PID_T |
1762
|
1014 AC_TYPE_SIZE_T |
|
1015 AC_TYPE_UID_T |
|
1016 AC_CHECK_TYPE(dev_t, short) |
|
1017 AC_CHECK_TYPE(ino_t, unsigned long) |
|
1018 AC_CHECK_TYPE(nlink_t, short) |
2626
|
1019 OCTAVE_CHECK_TYPE(sigset_t, [#include <signal.h>], int) |
1762
|
1020 |
869
|
1021 ### Define VOID_SIGHANDLER for readline. |
|
1022 |
405
|
1023 case "$RETSIGTYPE" in |
|
1024 int) |
|
1025 ;; |
|
1026 *) |
|
1027 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
1028 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
1029 ;; |
|
1030 esac |
869
|
1031 AC_SUBST(VOID_SIGHANDLER) |
|
1032 |
2633
|
1033 ### A system dependent kluge or two. |
|
1034 |
2035
|
1035 AC_CHECK_FUNCS(getrusage times) |
2427
|
1036 case "$canonical_host_type" in |
|
1037 *-*-cygwin32) |
|
1038 AC_DEFINE(RUSAGE_TIMES_ONLY, 1) |
|
1039 ;; |
|
1040 esac |
|
1041 |
2762
|
1042 bsd_gcc_kluge_targets_frag=/dev/null |
2633
|
1043 case "$canonical_host_type" in |
|
1044 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
1045 bsd_gcc_kluge_targets_frag=Makefrag.bsd |
|
1046 cat << \EOF > $bsd_gcc_kluge_targets_frag |
|
1047 |
|
1048 lex.o: lex.cc |
|
1049 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1050 |
|
1051 pt-plot.o: pt-plot.cc |
|
1052 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1053 |
|
1054 symtab.o: symtab.cc |
|
1055 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1056 |
|
1057 toplev.o: toplev.cc |
|
1058 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1059 |
|
1060 unwind-prot.o: unwind-prot.cc |
|
1061 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1062 |
|
1063 EOF |
|
1064 ;; |
|
1065 esac |
|
1066 AC_SUBST_FILE(bsd_gcc_kluge_targets_frag) |
|
1067 |
869
|
1068 ### Checks for other programs used for building, testing, installing, |
|
1069 ### and running Octave. |
|
1070 ### |
|
1071 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
1072 ### it, and it might not be installed. |
|
1073 ### |
|
1074 ### Also make sure that we generate an interactive scanner if we are |
|
1075 ### using flex. |
|
1076 |
405
|
1077 AC_PROG_LEX |
|
1078 case "$LEX" in |
|
1079 flex*) |
|
1080 LFLAGS="-t -I" |
832
|
1081 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
1082 LEXLIB= |
|
1083 ;; |
|
1084 *) |
|
1085 LFLAGS="-t" |
832
|
1086 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
3105
|
1087 warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc" |
|
1088 AC_MSG_WARN($warn_flex) |
405
|
1089 ;; |
|
1090 esac |
869
|
1091 AC_SUBST(LFLAGS) |
|
1092 |
405
|
1093 AC_PROG_YACC |
|
1094 case "$YACC" in |
|
1095 bison*) |
|
1096 ;; |
|
1097 *) |
3105
|
1098 warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc" |
|
1099 AC_MSG_WARN($warn_bison) |
405
|
1100 ;; |
|
1101 esac |
869
|
1102 |
1722
|
1103 AC_PROG_LN_S |
|
1104 |
3222
|
1105 OCTAVE_PROG_NM |
3130
|
1106 OCTAVE_PROG_RUNTEST |
869
|
1107 |
405
|
1108 AC_PROG_INSTALL |
2642
|
1109 INSTALL_SCRIPT='${INSTALL}' |
|
1110 AC_SUBST(INSTALL_SCRIPT) |
869
|
1111 |
3130
|
1112 OCTAVE_PROG_GNUPLOT |
|
1113 OCTAVE_PROG_PAGER |
3673
|
1114 OCTAVE_PROG_GPERF |
3130
|
1115 |
2577
|
1116 EXE= |
|
1117 case "$canonical_host_type" in |
|
1118 *-*-cygwin32) |
|
1119 EXE=.exe |
|
1120 ;; |
|
1121 esac |
2578
|
1122 AC_SUBST(EXE) |
2577
|
1123 |
2032
|
1124 ### Even though we include config.h, we need to have the preprocessor |
|
1125 ### defines available in a variable for the octave-bug script. Use |
|
1126 ### UGLY_DEFS for that. |
|
1127 |
|
1128 AC_OUTPUT_MAKE_DEFS |
2162
|
1129 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` |
2032
|
1130 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
|
1131 AC_SUBST(UGLY_DEFS) |
|
1132 |
869
|
1133 ### Maybe add -Wall to compiler flags now that we're done feature |
|
1134 ### testing. |
|
1135 |
3131
|
1136 if test -z "$EXTERN_CFLAGS"; then |
|
1137 OCTAVE_CC_FLAG(-Wall) |
405
|
1138 fi |
3131
|
1139 |
|
1140 if test -z "$EXTERN_CXXFLAGS"; then |
|
1141 OCTAVE_CXX_FLAG(-Wall) |
405
|
1142 fi |
869
|
1143 |
2813
|
1144 ### Someday, maybe include -ansi and even -pedantic in this list... |
|
1145 |
|
1146 GCC_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wid-clash-31 \ |
|
1147 -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ |
|
1148 -Wstrict-prototypes -Wwrite-strings" |
|
1149 |
3131
|
1150 GXX_PICKY_FLAGS="$GCC_PICKY_FLAGS -Weffc++ -Wenum-clash -fno-nonnull-objects" |
2813
|
1151 |
|
1152 AC_ARG_ENABLE(picky-flags, |
|
1153 [ --enable-picky-flags add picky options to CFLAGS, CXXFLAGS, FFLAGS], |
3131
|
1154 [if test "$enableval" = no; then |
|
1155 true |
2813
|
1156 elif test "$enableval" = yes; then |
3131
|
1157 if test -z "$EXTERN_CFLAGS"; then |
|
1158 for flag in $GCC_PICKY_FLAGS; do |
|
1159 OCTAVE_CC_FLAG($flag) |
|
1160 done |
2813
|
1161 fi |
3131
|
1162 if test -z "$EXTERN_CXXFLAGS"; then |
|
1163 for flag in $GXX_PICKY_FLAGS; do |
|
1164 OCTAVE_CXX_FLAG($flag) |
|
1165 done |
2813
|
1166 fi |
|
1167 fi], []) |
|
1168 |
1146
|
1169 ### Run configure in subdirectories. |
|
1170 |
1304
|
1171 export CC |
|
1172 export CXX |
|
1173 export F77 |
|
1174 |
3157
|
1175 AC_CONFIG_SUBDIRS($GLOB_DIR kpathsea scripts $PLPLOT_DIR $READLINE_DIR) |
1146
|
1176 |
869
|
1177 ### Do the substitutions in all the Makefiles. |
|
1178 |
3215
|
1179 AC_OUTPUT(Makefile octMakefile Makeconf install-octave \ |
|
1180 test/Makefile dlfcn/Makefile \ |
|
1181 doc/Makefile doc/faq/Makefile doc/interpreter/Makefile \ |
|
1182 doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \ |
|
1183 examples/Makefile liboctave/Makefile src/Makefile \ |
|
1184 libcruft/Makefile libcruft/Makerules \ |
3220
|
1185 libcruft/amos/Makefile libcruft/blas/Makefile \ |
|
1186 libcruft/dassl/Makefile libcruft/fftpack/Makefile \ |
|
1187 libcruft/lapack/Makefile libcruft/linpack/Makefile \ |
|
1188 libcruft/minpack/Makefile libcruft/misc/Makefile \ |
|
1189 libcruft/odepack/Makefile libcruft/ordered-qz/Makefile \ |
|
1190 libcruft/quadpack/Makefile libcruft/ranlib/Makefile \ |
3215
|
1191 libcruft/slatec-fn/Makefile libcruft/slatec-err/Makefile \ |
3180
|
1192 libcruft/villad/Makefile) |
1225
|
1193 |
3238
|
1194 AC_OUTPUT_COMMANDS([chmod +x install-octave]) |
3176
|
1195 |
1225
|
1196 ### Print a summary so that important information isn't missed. |
|
1197 |
|
1198 if test -z "$F77"; then |
|
1199 FORT="$F2C $F2CFLAGS" |
|
1200 else |
2610
|
1201 FORT="$F77 $FFLAGS" |
1225
|
1202 fi |
|
1203 |
|
1204 AC_MSG_RESULT([ |
|
1205 |
|
1206 Octave is now configured for $canonical_host_type |
|
1207 |
1664
|
1208 Source directory: $srcdir |
|
1209 Installation prefix: $prefix |
3126
|
1210 C compiler: $CC $XTRA_CFLAGS $CFLAGS |
|
1211 C++ compiler: $CXX $XTRA_CXXFLAGS $CXXFLAGS |
1664
|
1212 Fortran compiler: $FORT |
|
1213 Fortran libraries: $FLIBS |
|
1214 Use GNU readline: $USE_READLINE |
|
1215 Default pager: $DEFAULT_PAGER |
|
1216 gnuplot: $GNUPLOT_BINARY |
|
1217 |
2108
|
1218 Do internal array bounds checking: $BOUNDS_CHECKING |
3034
|
1219 Build static libraries: $STATIC_LIBS |
1679
|
1220 Build shared libraries: $SHARED_LIBS |
|
1221 Minimal kernel option: $OCTAVE_LITE |
|
1222 Dynamic Linking (dlopen/dlsym): $WITH_DL |
|
1223 Dynamic Linking (shl_load/shl_findsym): $WITH_SHL |
3034
|
1224 Include support for GNU readline: $USE_READLINE |
1225
|
1225 ]) |
3105
|
1226 |
|
1227 warn_msg_printed=false |
|
1228 |
|
1229 if test -n "$warn_f77_and_g77"; then |
|
1230 AC_MSG_WARN($warn_f77_and_g77) |
|
1231 warn_msg_printed=true |
|
1232 fi |
|
1233 |
|
1234 if test -n "$warn_f2c_and_f77"; then |
|
1235 AC_MSG_WARN($warn_f2c_and_f77) |
|
1236 warn_msg_printed=true |
|
1237 fi |
|
1238 |
|
1239 if test -n "$warn_f2c_and_g77"; then |
|
1240 AC_MSG_WARN($warn_f2c_and_g77) |
|
1241 warn_msg_printed=true |
|
1242 fi |
|
1243 |
|
1244 if test -n "$gxx_only"; then |
|
1245 AC_MSG_WARN($gxx_only) |
|
1246 warn_msg_printed=true |
|
1247 fi |
|
1248 |
|
1249 if test -n "$warn_gcc_version"; then |
|
1250 AC_MSG_WARN($warn_gcc_version) |
|
1251 warn_msg_printed=true |
|
1252 fi |
|
1253 |
|
1254 if test -n "$warn_gcc_only"; then |
|
1255 AC_MSG_WARN($warn_gcc_only) |
|
1256 warn_msg_printed=true |
|
1257 fi |
|
1258 |
|
1259 if test -n "$warn_f2c_no_lib"; then |
|
1260 AC_MSG_WARN($warn_f2c_no_lib) |
|
1261 warn_msg_printed=true |
|
1262 fi |
|
1263 |
|
1264 if test -n "$warn_termlibs"; then |
|
1265 AC_MSG_WARN($warn_termlibs) |
|
1266 warn_msg_printed=true |
|
1267 fi |
|
1268 |
3673
|
1269 if test -n "$warn_gperf"; then |
|
1270 AC_MSG_WARN($warn_gperf) |
|
1271 warn_msg_printed=true |
|
1272 fi |
|
1273 |
3105
|
1274 if test -n "$warn_flex"; then |
|
1275 AC_MSG_WARN($warn_flex) |
|
1276 warn_msg_printed=true |
|
1277 fi |
|
1278 |
|
1279 if test -n "$warn_bison"; then |
|
1280 AC_MSG_WARN($warn_bison) |
|
1281 warn_msg_printed=true |
|
1282 fi |
|
1283 |
|
1284 if test -n "$warn_less"; then |
|
1285 AC_MSG_WARN($warn_less) |
|
1286 warn_msg_printed=true |
|
1287 fi |
|
1288 |
|
1289 if test -n "$warn_runtest"; then |
|
1290 AC_MSG_WARN($warn_runtest) |
|
1291 warn_msg_printed=true |
|
1292 fi |
|
1293 |
|
1294 if test -n "$warn_gnuplot"; then |
|
1295 |
|
1296 ## If you change this text, be sure to also change the corresponding |
|
1297 ## set of warnings above. |
|
1298 |
|
1299 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
1300 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
1301 AC_MSG_WARN([plotting commands without it.]) |
|
1302 AC_MSG_WARN([]) |
|
1303 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
1304 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
1305 AC_MSG_WARN([]) |
|
1306 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
1307 AC_MSG_WARN([]) |
|
1308 AC_MSG_WARN([at the Octave prompt.]) |
|
1309 warn_msg_printed=true |
|
1310 fi |
|
1311 |
|
1312 if $warn_msg_printed; then |
|
1313 AC_MSG_RESULT([]) |
|
1314 fi |
|
1315 |
|
1316 ### End of configure. |