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