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