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