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