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