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 |
5307
|
21 ### Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
22 ### 02110-1301, USA. |
869
|
23 |
4587
|
24 ### Preserve CFLAGS and CXXFLAGS from the environment before doing |
|
25 ### anything else because we don't know which macros might call |
|
26 ### AC_PROG_CC or AC_PROG_CXX. |
|
27 |
|
28 EXTERN_CFLAGS="$CFLAGS" |
|
29 EXTERN_CXXFLAGS="$CXXFLAGS" |
|
30 |
3887
|
31 AC_INIT |
5414
|
32 AC_REVISION($Revision: 1.480 $) |
4531
|
33 AC_PREREQ(2.57) |
3887
|
34 AC_CONFIG_SRCDIR([src/octave.cc]) |
1146
|
35 AC_CONFIG_HEADER(config.h) |
869
|
36 |
3887
|
37 AC_DEFINE(OCTAVE_SOURCE, 1, [Define if this is Octave.]) |
|
38 |
|
39 OCTAVE_HOST_TYPE |
869
|
40 |
5098
|
41 AC_GNU_SOURCE |
|
42 |
3923
|
43 AC_AIX |
3887
|
44 AC_MINIX |
3923
|
45 AC_ISC_POSIX |
1667
|
46 |
2223
|
47 ### some defaults |
|
48 |
2813
|
49 OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') |
|
50 OCTAVE_SET_DEFAULT(man1ext, '.1') |
|
51 OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') |
3597
|
52 OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') |
3029
|
53 OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') |
2813
|
54 OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') |
4449
|
55 OCTAVE_SET_DEFAULT(localapifcnfiledir, |
|
56 '$(datadir)/octave/site/$(apiversion)/m') |
3597
|
57 OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') |
|
58 OCTAVE_SET_DEFAULT(localfcnfilepath, |
4449
|
59 '$(localverfcnfiledir)//:$(localapifcnfiledir)//:$(localfcnfiledir)//') |
3141
|
60 OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') |
3029
|
61 OCTAVE_SET_DEFAULT(archlibdir, |
3130
|
62 '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') |
3029
|
63 OCTAVE_SET_DEFAULT(localarchlibdir, |
3130
|
64 '$(libexecdir)/octave/site/exec/$(canonical_host_type)') |
3597
|
65 OCTAVE_SET_DEFAULT(localverarchlibdir, |
|
66 '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') |
3029
|
67 OCTAVE_SET_DEFAULT(octfiledir, |
3130
|
68 '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') |
3029
|
69 OCTAVE_SET_DEFAULT(localoctfiledir, |
3130
|
70 '$(libexecdir)/octave/site/oct/$(canonical_host_type)') |
4449
|
71 OCTAVE_SET_DEFAULT(localapioctfiledir, |
|
72 '$(libexecdir)/octave/site/oct/$(apiversion)/$(canonical_host_type)') |
3597
|
73 OCTAVE_SET_DEFAULT(localveroctfiledir, |
|
74 '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') |
|
75 OCTAVE_SET_DEFAULT(localoctfilepath, |
4449
|
76 '$(localveroctfiledir)//:$(localapioctfiledir)//:$(localoctfiledir)//') |
3029
|
77 OCTAVE_SET_DEFAULT(fcnfilepath, |
|
78 '.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//') |
|
79 OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') |
2813
|
80 OCTAVE_SET_DEFAULT(imagepath, '.:$(imagedir)//') |
1667
|
81 |
2155
|
82 ### Make configure args available for other uses. |
|
83 |
|
84 config_opts=$ac_configure_args |
|
85 AC_SUBST(config_opts) |
|
86 |
1667
|
87 ### Path separator. |
|
88 |
3887
|
89 AC_DEFINE(SEPCHAR, [':'], Define this to be the path separator for your system, as a character constant.]) |
|
90 AC_DEFINE(SEPCHAR_STR, [":"], [Define this to the path separator, as a string.]) |
1667
|
91 |
869
|
92 ### Allow the user to force us to use f2c. |
|
93 |
832
|
94 AC_ARG_WITH(f2c, |
|
95 [ --with-f2c use f2c even if Fortran compiler is available], |
2813
|
96 [if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi], |
1177
|
97 use_f2c=false) |
|
98 |
2813
|
99 ### Allow the user to force us to use f77. |
|
100 |
|
101 AC_ARG_WITH(f77, |
|
102 [ --with-f77 use f77 to compile Fortran subroutines], |
|
103 [if test "$withval" = no; then use_f77=false; else use_f77=true; fi], |
|
104 use_f77=false) |
|
105 |
|
106 ### Make sure only one of the above options for Fortran compilers was |
|
107 ### specified (multiple "no" or --without-FOO options are ok). |
|
108 |
|
109 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, f2c, |
3105
|
110 [warn_f2c_and_f77="--with-f2c and --with-f77 both specified! Using f77..." |
|
111 AC_MSG_WARN($warn_f2c_and_f77) |
2813
|
112 use_f2c=false]) |
|
113 |
2415
|
114 dnl ### Allow the user disable support for plplot. |
|
115 dnl |
|
116 dnl # USE_PLPLOT=true |
|
117 dnl # PLPLOT_DIR=plplot |
3156
|
118 dnl # LIBPLPLOT='$(TOPDIR)/plplot/libplplot.$(LIBEXT) |
1397
|
119 USE_PLPLOT=false |
|
120 PLPLOT_DIR="" |
|
121 LIBPLPLOT="" |
2415
|
122 dnl AC_ARG_ENABLE(plplot, |
|
123 dnl [ --enable-plplot use plplot for plotting (default is yes)], |
2813
|
124 dnl [if test "$enableval" = no; then |
2415
|
125 dnl USE_PLPLOT=false; |
|
126 dnl LIBPLPLOT=""; |
|
127 dnl PLPLOT_DIR=""; |
|
128 dnl fi], []) |
|
129 dnl if $USE_PLPLOT; then |
3887
|
130 dnl AC_DEFINE(USE_PLPLOT, 1, [Define to use plplot.]) |
2415
|
131 dnl fi |
2421
|
132 AC_SUBST(LIBPLPLOT) |
|
133 AC_SUBST(PLPLOT_DIR) |
1137
|
134 |
2813
|
135 ### Make it possible to have Octave's array and matrix classes do bounds |
2108
|
136 ### checking on element references. This slows some operations down a |
2813
|
137 ### bit, so it is turned off by default. |
2108
|
138 |
2450
|
139 BOUNDS_CHECKING=false |
2108
|
140 AC_ARG_ENABLE(bounds-check, |
3060
|
141 [ --enable-bounds-check for internal array classes (default is no)], |
|
142 [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) |
2108
|
143 if $BOUNDS_CHECKING; then |
3887
|
144 AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) |
2108
|
145 fi |
|
146 |
5275
|
147 ### If possible, use a 64-bit integer type for array dimensions and indexing. |
|
148 |
|
149 USE_64_BIT_IDX_T=false |
|
150 OCTAVE_IDX_TYPE=int |
|
151 AC_ARG_ENABLE(64, |
|
152 [ --enable-64 use 64-bit integer for array dimensions and indexing], |
|
153 [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) |
|
154 if $USE_64_BIT_IDX_T; then |
|
155 AC_CHECK_SIZEOF(void *) |
|
156 AC_CHECK_SIZEOF(int) |
|
157 AC_CHECK_SIZEOF(long) |
|
158 if test $ac_cv_sizeof_void_p -eq 8; then |
|
159 if test $ac_cv_sizeof_int -eq 8; then |
|
160 OCTAVE_IDX_TYPE=int |
|
161 elif test $ac_cv_sizeof_long -eq 8; then |
|
162 OCTAVE_IDX_TYPE=long |
5351
|
163 AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long]) |
5275
|
164 else |
|
165 AC_MSG_WARN([no suitable type found for octave_idx_type so disabling 64-bit features]) |
|
166 USE_64_BIT_IDX_T=false |
|
167 fi |
|
168 else |
|
169 warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features" |
|
170 AC_MSG_WARN($warn_64_bit) |
|
171 USE_64_BIT_IDX_T=false |
|
172 fi |
|
173 fi |
|
174 AC_SUBST(OCTAVE_IDX_TYPE) |
|
175 if $USE_64_BIT_IDX_T; then |
|
176 AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define if using 64-bit integers for array dimensions and indexing]) |
|
177 fi |
|
178 AC_SUBST(USE_64_BIT_IDX_T) |
|
179 |
3215
|
180 ### It seems that there are some broken inline assembly functions in |
|
181 ### the GNU libc. Since I'm not sure how to test whether we are using |
|
182 ### GNU libc, just disable them for all platforms. |
|
183 |
|
184 AC_MSG_RESULT([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) |
3887
|
185 AC_DEFINE(__NO_MATH_INLINES, 1, [Define if your version of GNU libc has buggy inline assembly code for math functions like exp.]) |
3215
|
186 |
869
|
187 ### See which C++ compiler to use (we expect to find g++). |
|
188 |
405
|
189 AC_PROG_CXX |
|
190 AC_PROG_CXXCPP |
869
|
191 |
|
192 ### Do special things for g++. |
|
193 |
2353
|
194 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ |
4368
|
195 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` |
3107
|
196 |
405
|
197 case "$gxx_version" in |
4368
|
198 1.* | 2.[[012345678]].*) |
4843
|
199 AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave] |
|
200 ) |
|
201 ;; |
|
202 2.9*) |
|
203 warn_gxx_version="g++ version $gxx_version is likely to cause problems" |
|
204 AC_MSG_WARN($warn_gxx_version) |
3775
|
205 ;; |
405
|
206 esac |
869
|
207 |
1894
|
208 CXX_VERSION= |
|
209 if test -n "$gxx_version"; then |
|
210 CXX_VERSION="$gxx_version" |
|
211 fi |
|
212 AC_SUBST(CXX_VERSION) |
|
213 |
3107
|
214 OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
3769
|
215 OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
3107
|
216 |
3842
|
217 # Determine the ABI used the C++ compiler, needed by the dynamic loading |
|
218 # code. Currently supported ABIs are GNU v2, GNU v3 and Sun Workshop. |
|
219 |
|
220 OCTAVE_CXX_ABI |
|
221 |
869
|
222 ### See which C compiler to use (we expect to find gcc). |
|
223 |
5
|
224 AC_PROG_CC |
405
|
225 AC_PROG_CPP |
832
|
226 AC_PROG_GCC_TRADITIONAL |
869
|
227 |
|
228 ### Do special things for gcc. |
|
229 |
2353
|
230 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ |
3107
|
231 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` |
405
|
232 case "$gcc_version" in |
|
233 2.*) |
1087
|
234 if test -z "$LDFLAGS"; then |
|
235 LDFLAGS="-g" |
|
236 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
237 fi |
405
|
238 ;; |
|
239 1.*) |
3105
|
240 warn_gcc_version="gcc version $gcc_version is likely to cause problems" |
|
241 AC_MSG_WARN($warn_gcc_version) |
405
|
242 ;; |
5
|
243 esac |
869
|
244 |
1894
|
245 CC_VERSION= |
|
246 if test -n "$gcc_version"; then |
|
247 CC_VERSION="$gcc_version" |
|
248 fi |
|
249 AC_SUBST(CC_VERSION) |
|
250 |
3775
|
251 ### The flag to create dependency varies depending on the compier. |
|
252 |
|
253 # Assume GCC. |
|
254 DEPEND_FLAGS="-M" |
|
255 DEPEND_EXTRA_SED_PATTERN="" |
|
256 case "$canonical_host_type" in |
|
257 sparc-sun-solaris2* | i386-pc-solaris2*) |
3820
|
258 if test "$GCC" = yes; then |
3775
|
259 true |
|
260 else |
|
261 DEPEND_FLAGS="-xM1" |
|
262 DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'" |
|
263 fi |
|
264 ;; |
|
265 esac |
|
266 AC_SUBST(DEPEND_FLAGS) |
|
267 AC_SUBST(DEPEND_EXTRA_SED_PATTERN) |
|
268 |
5076
|
269 ### On Intel systems with gcc, we may need to compile with -mieee-fp |
|
270 ### and -ffloat-store to get full support for IEEE floating point. |
2020
|
271 ### |
3126
|
272 ### On Alpha/OSF systems, we need -mieee. |
869
|
273 |
3126
|
274 ieee_fp_flag= |
350
|
275 case "$canonical_host_type" in |
3887
|
276 i[[3456789]]86-*-*) |
5076
|
277 if test "$GCC" = yes; then |
|
278 OCTAVE_CC_FLAG(-mieee-fp, [ |
|
279 ieee_fp_flag=-mieee-fp |
|
280 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" |
|
281 AC_MSG_RESULT([adding -mieee-fp to XTRA_CFLAGS])]) |
3126
|
282 |
5078
|
283 ### OCTAVE_CC_FLAG(-ffloat-store, [ |
|
284 ### float_store_flag=-ffloat-store |
|
285 ### XTRA_CFLAGS="$XTRA_CFLAGS -ffloat-store" |
|
286 ### AC_MSG_RESULT([adding -ffloat-store to XTRA_CFLAGS])]) |
5076
|
287 fi |
|
288 if test "$GXX" = yes; then |
|
289 OCTAVE_CXX_FLAG(-mieee-fp, [ |
|
290 ieee_fp_flag=-mieee-fp |
|
291 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" |
|
292 AC_MSG_RESULT([adding -mieee-fp to XTRA_CXXFLAGS])]) |
|
293 |
5078
|
294 ### OCTAVE_CXX_FLAG(-ffloat-store, [ |
|
295 ### float_store_flag=-ffloat-store |
|
296 ### XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ffloat-store" |
|
297 ### AC_MSG_RESULT([adding -ffloat-store to XTRA_CXXFLAGS])]) |
5076
|
298 fi |
324
|
299 ;; |
3127
|
300 alpha*-*-*) |
4284
|
301 if test "$GCC" = yes; then |
4812
|
302 OCTAVE_CC_FLAG(-mieee, [ |
|
303 ieee_fp_flag=-mieee |
|
304 XTRA_CFLAGS="$XTRA_CFLAGS -mieee" |
|
305 AC_MSG_RESULT([adding -mieee to XTRA_CFLAGS])]) |
5076
|
306 else |
|
307 OCTAVE_CC_FLAG(-ieee, [ |
|
308 ieee_fp_flag=-ieee |
|
309 XTRA_CFLAGS="$XTRA_CFLAGS -ieee" |
|
310 AC_MSG_RESULT([adding -ieee to XTRA_CFLAGS])]) |
|
311 fi |
|
312 if test "$GXX" = yes; then |
4812
|
313 OCTAVE_CXX_FLAG(-mieee, [ |
|
314 ieee_fp_flag=-mieee |
|
315 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee" |
|
316 AC_MSG_RESULT([adding -mieee to XTRA_CXXFLAGS])]) |
4284
|
317 else |
|
318 OCTAVE_CXX_FLAG(-ieee, [ |
|
319 ieee_fp_flag=-ieee |
|
320 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ieee" |
|
321 AC_MSG_RESULT([adding -ieee to XTRA_CXXFLAGS])]) |
|
322 fi |
2020
|
323 ;; |
3176
|
324 *ibm-aix4*) |
3351
|
325 OCTAVE_CC_FLAG(-mminimal-toc, [ |
|
326 XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) |
3176
|
327 |
3351
|
328 OCTAVE_CXX_FLAG(-mminimal-toc, [ |
|
329 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) |
3176
|
330 ;; |
324
|
331 esac |
3126
|
332 |
|
333 AC_SUBST(XTRA_CFLAGS) |
|
334 AC_SUBST(XTRA_CXXFLAGS) |
869
|
335 |
1667
|
336 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
337 |
|
338 case "$canonical_host_type" in |
3127
|
339 alpha*-dec-osf1.3) |
1667
|
340 LD_STATIC_FLAG=-static |
|
341 ;; |
|
342 esac |
1679
|
343 if test -n "$LD_STATIC_FLAG"; then |
|
344 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
|
345 fi |
|
346 AC_SUBST(LD_STATIC_FLAG) |
1667
|
347 |
3222
|
348 OCTAVE_CXX_PREPENDS_UNDERSCORE |
4094
|
349 |
|
350 ### Defaults for cross compiling. BUILD_CC and BUILD_CXX are |
|
351 ### the compilers that we use for building tools on the build system. |
4098
|
352 ### For now, we assume that the only cross compiling we can do is |
4298
|
353 ### with gcc on a Unixy system, but the dedicated hacker can override these. |
4094
|
354 |
|
355 if test "$cross_compiling" = yes; then |
|
356 BUILD_CC="gcc" |
|
357 BUILD_CFLAGS="-O2 -g" |
|
358 BUILD_CXX="g++" |
|
359 BUILD_CXXFLAGS="-O2 -g" |
4298
|
360 BUILD_LDFLAGS="" |
4098
|
361 BUILD_EXEEXT="" |
4094
|
362 else |
4298
|
363 BUILD_CC='$(CC)' |
|
364 BUILD_CFLAGS='$(CFLAGS)' |
|
365 BUILD_CXX='$(CXX)' |
|
366 BUILD_CXXFLAGS='$(CXXFLAGS)' |
|
367 BUILD_LDFLAGS='$(LDFLAGS)' |
4284
|
368 case "$canonical_host_type" in |
|
369 sparc-sun-solaris2*) |
|
370 if test "$GCC" != yes; then |
4298
|
371 ## The Sun C++ compiler never seems to complete compiling |
|
372 ## gendoc.cc unless we reduce the optimization level... |
|
373 BUILD_CXXFLAGS="-g -O1" |
4284
|
374 fi |
|
375 ;; |
|
376 esac |
4298
|
377 BUILD_EXEEXT='$(EXEEXT)' |
4094
|
378 fi |
|
379 |
|
380 AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) |
|
381 AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) |
|
382 AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) |
|
383 AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) |
4298
|
384 AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) |
|
385 AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) |
3222
|
386 |
3232
|
387 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
388 |
|
389 ### Look for math library. If found, this will add -lm to LIBS. |
|
390 |
|
391 case "$canonical_host_type" in |
|
392 *-*-nextstep*) |
|
393 ;; |
|
394 *-*-linux*) |
|
395 AC_CHECK_LIB(m, sin, , , -lc) |
|
396 ;; |
|
397 *) |
|
398 AC_CHECK_LIB(m, sin) |
|
399 ;; |
|
400 esac |
|
401 |
5270
|
402 ### Check for ZLIB library. |
3820
|
403 |
5270
|
404 WITH_ZLIB=true |
|
405 AC_ARG_WITH(zlib, |
|
406 [ --without-zlib don't use zlib], |
|
407 with_zlib=$withval, with_zlib=yes) |
3820
|
408 |
5270
|
409 zlib_lib= |
|
410 if test "$with_zlib" = yes; then |
|
411 zlib_lib="z" |
|
412 elif test "$with_zlib" != no; then |
|
413 zlib_lib="$with_zlib" |
3687
|
414 fi |
|
415 |
5270
|
416 ZLIB_LIBS= |
|
417 WITH_ZLIB=false |
|
418 if test -n "$zlib_lib"; then |
5337
|
419 AC_CHECK_LIB($zlib_lib, gzclearerr, [ |
5270
|
420 AC_CHECK_HEADERS(zlib.h, [ |
|
421 WITH_ZLIB=true |
|
422 ZLIB_LIBS="-l$zlib_lib" |
|
423 LIBS="$ZLIB_LIBS $LIBS" |
|
424 AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available.])])]) |
|
425 fi |
|
426 |
|
427 if $WITH_ZLIB; then |
|
428 ### Check for HDF5 library. |
|
429 |
|
430 WITH_HDF5=true |
|
431 AC_ARG_WITH(hdf5, |
|
432 [ --without-hdf5 don't use HDF5], |
|
433 with_hdf5=$withval, with_hdf5=yes) |
|
434 |
|
435 hdf5_lib= |
|
436 if test "$with_hdf5" = yes; then |
|
437 hdf5_lib="hdf5" |
|
438 elif test "$with_hdf5" != no; then |
|
439 hdf5_lib="$with_hdf5" |
|
440 fi |
|
441 |
|
442 HDF5_LIBS= |
|
443 WITH_HDF5=false |
|
444 if test -n "$hdf5_lib"; then |
|
445 AC_CHECK_LIB($hdf5_lib, H5Pcreate, [ |
3820
|
446 AC_CHECK_HEADERS(hdf5.h, [ |
5270
|
447 WITH_HDF5=true |
|
448 HDF5_LIBS="-l$hdf5_lib" |
3820
|
449 LIBS="$HDF5_LIBS $LIBS" |
4696
|
450 AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) |
|
451 AC_CHECK_LIB($hdf5_lib, H5Gget_num_objs, [ |
5270
|
452 AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.])])])]) |
|
453 fi |
|
454 |
|
455 if $WITH_HDF5; then |
|
456 true |
|
457 else |
|
458 warn_hdf5="HDF5 library not found. Octave will not be able to save or load HDF5 data files." |
|
459 fi |
|
460 else |
|
461 warn_zlib="ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files." |
3820
|
462 fi |
3687
|
463 |
5203
|
464 |
3827
|
465 # Checks for FFTW header and library. |
|
466 |
|
467 # subdirectories of libcruft to build if they aren't found on the system: |
|
468 FFT_DIR="fftpack" |
|
469 AC_SUBST(FFT_DIR) |
|
470 |
|
471 # Installed fftw library, if any. |
|
472 FFTW_LIBS='' |
|
473 AC_SUBST(FFTW_LIBS) |
|
474 |
|
475 AC_ARG_WITH(fftw, |
3886
|
476 [ --without-fftw use included fftpack instead of installed fftw], |
|
477 with_fftw=$withval, with_fftw=yes) |
3827
|
478 |
|
479 if test "$with_fftw" = "yes"; then |
4773
|
480 have_fftw3_header=no |
|
481 with_fftw3=no |
|
482 AC_CHECK_HEADER(fftw3.h, [have_fftw3_header=yes; break]) |
|
483 if test "$have_fftw3_header" = yes; then |
5203
|
484 AC_CHECK_LIB(fftw3, fftw_plan_dft_1d, [FFTW_LIBS="-lfftw3"; with_fftw3=yes]) |
3827
|
485 fi |
|
486 fi |
|
487 |
4773
|
488 if test "$with_fftw" = yes && test "$with_fftw3" = yes; then |
3827
|
489 FFT_DIR='' |
4773
|
490 AC_DEFINE(HAVE_FFTW3, 1, [Define if the FFTW3 library is used.]) |
3827
|
491 fi |
|
492 |
5235
|
493 # Checks for GLPK header and library. |
|
494 |
|
495 AC_ARG_WITH(glpk, |
|
496 [ --without-glpk don't use GLPK], |
|
497 with_glpk=$withval, with_glpk=yes) |
|
498 |
|
499 glpk_lib= |
|
500 if test "$with_glpk" = yes; then |
|
501 glpk_lib="glpk" |
|
502 elif test "$with_glpk" != no; then |
|
503 glpk_lib="$with_glpk" |
|
504 fi |
|
505 |
|
506 GLPK_LIBS= |
|
507 if test -n "$glpk_lib"; then |
|
508 AC_CHECK_LIB($glpk_lib, glp_lpx_simplex, [ |
|
509 AC_CHECK_HEADERS(glpk.h, [ |
|
510 GLPK_LIBS="-l$glpk_lib" |
|
511 AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])])]) |
|
512 fi |
|
513 AC_SUBST(GLPK_LIBS) |
|
514 |
|
515 # Checks for MPI header and library. |
|
516 |
4343
|
517 WITH_MPI=true |
|
518 AC_ARG_WITH(mpi, |
|
519 [ --without-mpi don't use MPI], |
|
520 with_mpi=$withval, with_mpi=yes) |
|
521 |
|
522 mpi_lib= |
|
523 if test "$with_mpi" = yes; then |
|
524 mpi_lib="mpi" |
|
525 elif test "$with_mpi" != no; then |
|
526 mpi_lib="$with_mpi" |
|
527 fi |
|
528 |
|
529 MPI_LIBS= |
|
530 WITH_MPI=false |
|
531 if test -n "$mpi_lib"; then |
|
532 AC_CHECK_LIB($mpi_lib, MPI_Init, [ |
|
533 AC_CHECK_HEADERS(mpi.h, [ |
|
534 WITH_MPI=true |
|
535 MPI_LIBS="-l$mpi_lib" |
|
536 LIBS="$MPI_LIBS $LIBS" |
|
537 AC_DEFINE(HAVE_MPI, 1, [Define if MPI is available.])])]) |
|
538 fi |
|
539 |
4853
|
540 OCTAVE_IEEE754_DATA_FORMAT |
4850
|
541 |
3827
|
542 # ---------------------------------------------------------------------- |
|
543 |
3012
|
544 ### We need these before trying to find libf2c. |
|
545 |
3130
|
546 OCTAVE_PROG_AR |
3012
|
547 |
|
548 AC_PROG_RANLIB |
|
549 |
2813
|
550 ### If we haven't been forced to use a particular Fortran compiler, |
|
551 ### try to find one using any one of several common Un*x Fortran |
3887
|
552 ### compiler names using the AC_PROG_F77 macro. |
1239
|
553 ### |
4816
|
554 ### The configure options --with-f77 or --with-f2c |
|
555 ### force f77 or f2c to be used. It is also possible to use |
2813
|
556 ### these options to specify the name of the compiler. For example, |
4816
|
557 ### `--with-f77=g77' says that we are using g77 as the Fortran compiler. |
1233
|
558 |
2813
|
559 if $use_f77; then |
3008
|
560 if test "$with_f77" = yes; then |
2813
|
561 F77=f77 |
|
562 else |
|
563 F77="$with_f77" |
|
564 fi |
|
565 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
566 elif $use_f2c; then |
|
567 F77= |
2336
|
568 if test "$with_f2c" = yes; then |
1317
|
569 F2C=f2c |
1239
|
570 else |
|
571 F2C="$with_f2c" |
|
572 fi |
|
573 AC_MSG_RESULT([defining F2C to be $F2C]) |
1233
|
574 fi |
5
|
575 |
3887
|
576 if test "x$FFLAGS" = x; then |
|
577 FFLAGS="-O" # override -g -O default by AC_PROG_F77 |
|
578 fi |
|
579 |
|
580 # the F77 variable, if set, overrides AC_PROG_F77 automatically |
|
581 AC_PROG_F77 |
|
582 |
1239
|
583 have_fortran_compiler=false |
|
584 have_f2c=false |
5
|
585 |
2813
|
586 if $use_f2c; then |
1239
|
587 have_f2c=true |
|
588 else |
|
589 if test -n "$F77"; then |
3887
|
590 AC_F77_LIBRARY_LDFLAGS |
|
591 AC_F77_DUMMY_MAIN |
|
592 AC_F77_WRAPPERS |
|
593 case "$canonical_host_type" in |
5076
|
594 i[[3456789]]86-*-*) |
|
595 if test "$ac_cv_f77_compiler_gnu" = yes; then |
|
596 OCTAVE_F77_FLAG(-mieee-fp) |
5078
|
597 ### OCTAVE_F77_FLAG(-ffloat-store) |
5076
|
598 fi |
|
599 ;; |
3887
|
600 alpha*-*-*) |
|
601 if test "$ac_cv_f77_compiler_gnu" = yes; then |
5076
|
602 OCTAVE_F77_FLAG(-mieee) |
3887
|
603 else |
5076
|
604 OCTAVE_F77_FLAG(-ieee) |
|
605 OCTAVE_F77_FLAG(-fpe1) |
3887
|
606 fi |
|
607 ;; |
|
608 powerpc-apple-machten*) |
|
609 FFLAGS= |
|
610 ;; |
|
611 esac |
|
612 if test -n "$FFLAGS"; then |
|
613 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
1239
|
614 fi |
|
615 have_fortran_compiler=true |
1233
|
616 else |
1239
|
617 AC_CHECK_PROG(F2C, f2c, f2c, []) |
3897
|
618 AC_ARG_VAR(F2C, [Fortran to C translator command]) |
|
619 AC_ARG_VAR(F2CFLAGS, [Fortran to C translator flags]) |
1239
|
620 if test -n "$F2C"; then |
|
621 have_f2c=true |
5
|
622 fi |
|
623 fi |
|
624 fi |
869
|
625 |
2762
|
626 f77_rules_frag=/dev/null |
1239
|
627 if $have_fortran_compiler; then |
2762
|
628 f77_rules_frag=Makefrag.f77 |
1679
|
629 cat << \EOF > $f77_rules_frag |
1668
|
630 |
1753
|
631 %.c : %.f |
1668
|
632 |
1791
|
633 %.o : %.f |
3615
|
634 $(FC) -c $(ALL_FFLAGS) -o $@ $< |
1668
|
635 |
1984
|
636 pic/%.o : %.f |
|
637 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
638 |
1668
|
639 EOF |
1239
|
640 elif $have_f2c; then |
3887
|
641 AC_DEFINE(HAVE_F2C, 1, [Define if we are using f2c.]) |
2562
|
642 |
|
643 ### XXX FIMXE XXX -- these shouldn't be fixed names, eh? |
|
644 |
|
645 oct_conflib=libconflib.a |
|
646 oct_obj_ext=o |
|
647 |
4417
|
648 CONFLIB_ARG= |
2562
|
649 if AC_TRY_EVAL(ac_compile); then |
3887
|
650 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AS_MESSAGE_LOG_FD() |
2562
|
651 if test -n "$RANLIB"; then |
3887
|
652 $RANLIB $oct_conflib 1>&AS_MESSAGE_LOG_FD() |
5
|
653 fi |
4417
|
654 CONFLIB_ARG="-L. -lconflib" |
5
|
655 fi |
2562
|
656 rm -f conftest* |
4417
|
657 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, $CONFLIB_ARG) |
2562
|
658 rm -f $oct_conflib |
|
659 |
|
660 if test -z "$FLIBS"; then |
3232
|
661 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=) |
2562
|
662 if test -n "$FLIBS"; then |
|
663 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
664 fi |
|
665 fi |
|
666 |
1462
|
667 if test -z "$FLIBS"; then |
3105
|
668 warn_f2c_no_lib="I found f2c but not libf2c.a, or libF77.a and libI77.a" |
|
669 AC_MSG_WARN($warn_f2c_no_lib) |
5
|
670 fi |
2633
|
671 f77_rules_frag=Makefrag.f77 |
1679
|
672 cat << \EOF > $f77_rules_frag |
1668
|
673 |
1824
|
674 %.c : %.f |
3847
|
675 $(F2C) $(F2CFLAGS) < $< > $(@F) |
1668
|
676 |
1753
|
677 %.o : %.f |
1668
|
678 |
|
679 EOF |
5
|
680 else |
832
|
681 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
682 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
683 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
684 fi |
869
|
685 |
1163
|
686 FC=$F77 |
|
687 AC_SUBST(FC) |
1679
|
688 AC_SUBST_FILE(f77_rules_frag) |
869
|
689 |
3820
|
690 ### Checks for BLAS and LAPACK libraries: |
3887
|
691 # (Build subdirectories of libcruft if they aren't found on the system.) |
3820
|
692 |
3887
|
693 sinclude(acx_blas.m4) |
|
694 sinclude(acx_lapack.m4) |
|
695 ACX_BLAS([], [BLAS_DIR="blas"]) |
|
696 ACX_LAPACK([BLAS_LIBS="$LAPACK_LIBS $BLAS_LIBS"], [LAPACK_DIR="lapack"]) |
3690
|
697 AC_SUBST(BLAS_DIR) |
|
698 AC_SUBST(LAPACK_DIR) |
|
699 |
5226
|
700 # Check for UMFPACK library. |
|
701 |
|
702 UMFPACK_LIBS= |
|
703 AC_SUBST(UMFPACK_LIBS) |
|
704 |
|
705 AC_ARG_WITH(umfpack, |
5275
|
706 [ --without-umfpack don't use UMFPACK, disable some sparse functionality], |
5226
|
707 with_umfpack=$withval, with_umfpack=yes) |
|
708 |
|
709 if test "$with_umfpack" = "yes"; then |
|
710 have_umfpack_header=no |
|
711 with_umfpack=no |
|
712 AC_CHECK_HEADER(umfpack/umfpack.h, [have_umfpack_header=yes; break]) |
|
713 if test "$have_umfpack_header" = yes; then |
|
714 AC_CHECK_LIB(amd, amd_postorder, [ |
|
715 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
5330
|
716 UMFPACK_LIBS="-lumfpack -lamd"; with_umfpack=yes], [ |
5226
|
717 ## Invalidate the cache. |
|
718 $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant |
|
719 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
5330
|
720 UMFPACK_LIBS="-lumfpack -lamd"; with_umfpack=yes], [ |
5270
|
721 |
|
722 ## Invalidate the cache. |
|
723 $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant |
|
724 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
5330
|
725 UMFPACK_LIBS="-lumfpack -lamd -lcblas"; with_umfpack=yes], [], -lamd -lcblas $BLAS_LIBS)], -lamd $BLAS_LIBS $FLIBS)]), -lamd]) |
5226
|
726 if test "$with_umfpack" = yes; then |
|
727 # For now the code needed for this is not in umfpack, will add |
|
728 # a test later that will probably have to be based on version |
|
729 # numbers as there is no interface changes that are visible at |
|
730 # compile time. |
|
731 with_umfpack_split=no |
|
732 fi |
|
733 fi |
|
734 fi |
|
735 |
|
736 if test "$with_umfpack" = yes; then |
|
737 AC_DEFINE(HAVE_UMFPACK, 1, [Define if the UMFPACK library is used.]) |
|
738 if test "$with_umfpack_split" = yes; then |
|
739 AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define if the UMFPACK Complex solver allow matrix and RHS to be split independently]) |
|
740 fi |
|
741 else |
|
742 warn_umfpack="UMFPACK not found. This will result in some lack of functionality for sparse matrices." |
|
743 fi |
|
744 |
4110
|
745 ### Handle shared library options. |
2813
|
746 |
3034
|
747 ### Enable creation of static libraries. |
|
748 |
|
749 AC_ARG_ENABLE(static, |
|
750 [ --enable-static create static libraries], |
|
751 [if test "$enableval" = no; then STATIC_LIBS=false; |
|
752 else STATIC_LIBS=true; fi], |
5221
|
753 STATIC_LIBS=false) |
3034
|
754 AC_SUBST(STATIC_LIBS) |
|
755 |
2813
|
756 ### Enable creation of shared libraries. Currently only works with |
|
757 ### gcc on some systems. |
|
758 |
|
759 AC_ARG_ENABLE(shared, |
|
760 [ --enable-shared create shared libraries (not all systems)], |
|
761 [if test "$enableval" = no; then SHARED_LIBS=false; |
|
762 else SHARED_LIBS=true; fi], |
5221
|
763 SHARED_LIBS=true) |
2813
|
764 AC_SUBST(SHARED_LIBS) |
|
765 |
4128
|
766 ### Enable dynamic linking. --enable-shared implies this, so |
|
767 ### --enable-dl is only need if you are only building static libraries |
|
768 ### and want to try dynamic linking too (works on some systems, for |
|
769 ### example, OS X and Windows). |
|
770 |
|
771 AC_ARG_ENABLE(dl, |
|
772 [ --enable-dl create shared libraries (not all systems)], |
|
773 [if test "$enableval" = no; then ENABLE_DYNAMIC_LINKING=false; |
|
774 else ENABLE_DYNAMIC_LINKING=true; fi], |
5221
|
775 ENABLE_DYNAMIC_LINKING=true) |
4128
|
776 |
3034
|
777 if $STATIC_LIBS || $SHARED_LIBS; then |
|
778 true |
|
779 else |
|
780 AC_MSG_ERROR([You can't disable building static AND shared libraries!]) |
|
781 fi |
|
782 |
2813
|
783 AC_ARG_ENABLE(rpath, |
4353
|
784 [ --enable-rpath override the default link options for rpath; |
4354
|
785 e.g., --enable-rpath='-rpath $(octlibdir)'], |
4353
|
786 [ if test "$enableval" = no; then use_rpath=false; |
|
787 else |
|
788 use_rpath=true |
|
789 if test "$enableval" = yes; then true; |
|
790 else enable_rpath_arg="$enableval"; fi |
4439
|
791 fi], [use_rpath=true]) |
2813
|
792 |
|
793 DLFCN_DIR= |
|
794 CPICFLAG=-fPIC |
|
795 CXXPICFLAG=-fPIC |
|
796 FPICFLAG=-fPIC |
|
797 SHLEXT=so |
4190
|
798 SHLLIB='$(SHLEXT)' |
4102
|
799 SHLBIN= |
4138
|
800 SHLEXT_VER='$(SHLEXT).$(version)' |
|
801 SHLLIB_VER='$(SHLLIB).$(version)' |
|
802 SHLBIN_VER='$(SHLBIN).$(version)' |
4126
|
803 SHLLINKEXT= |
4323
|
804 SH_LD='$(CXX)' |
2813
|
805 SH_LDFLAGS=-shared |
4759
|
806 DL_LD='$(SH_LD)' |
|
807 DL_LDFLAGS='$(SH_LDFLAGS)' |
|
808 MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)' |
3036
|
809 SONAME_FLAGS= |
2813
|
810 RLD_FLAG= |
4199
|
811 NO_OCT_FILE_STRIP=false |
4323
|
812 TEMPLATE_AR='$(AR)' |
3775
|
813 TEMPLATE_ARFLAGS="$ARFLAGS" |
4104
|
814 library_path_var=LD_LIBRARY_PATH |
2813
|
815 case "$canonical_host_type" in |
4323
|
816 *-*-386bsd* | *-*-openbsd* | *-*-netbsd*) |
2813
|
817 SH_LD=ld |
|
818 SH_LDFLAGS=-Bshareable |
|
819 ;; |
4323
|
820 *-*-freebsd*) |
|
821 SH_LD='$(CC)' |
|
822 SH_LDFLAGS=-shared -Wl,-x |
|
823 ;; |
3127
|
824 alpha*-dec-osf*) |
2813
|
825 CPICFLAG= |
|
826 CXXPICFLAG= |
|
827 FPICFLAG= |
4283
|
828 SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'" |
|
829 RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' |
2813
|
830 ;; |
3956
|
831 *-*-darwin*) |
4759
|
832 DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)' |
|
833 MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $(bindir)/octave-$(version)$(EXEEXT)' |
|
834 SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' |
4157
|
835 CXXPICFLAG= |
|
836 CPICFLAG= |
|
837 FPICFLAG= |
4759
|
838 SHLEXT=dylib |
|
839 SHLLIB='$(SHLEXT)' |
|
840 SHLEXT_VER='$(version).$(SHLEXT)' |
|
841 SHLLIB_VER='$(version).$(SHLLIB)' |
4199
|
842 NO_OCT_FILE_STRIP=true |
4786
|
843 SONAME_FLAGS='-install_name $(octlibdir)/$@' |
4759
|
844 library_path_var=DYLD_LIBRARY_PATH |
3956
|
845 ;; |
4105
|
846 *-*-cygwin* | *-*-mingw*) |
4102
|
847 CXXPICFLAG= |
|
848 CPICFLAG= |
|
849 FPICFLAG= |
|
850 SHLEXT=dll |
|
851 SHLLIB=dll.a |
|
852 SHLBIN=dll |
5414
|
853 SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" |
4102
|
854 SHLLINKEXT=.dll |
|
855 SONAME_FLAGS='-Wl,--out-implib=$@.a' |
4104
|
856 library_path_var=PATH |
4102
|
857 ;; |
3740
|
858 *-*-linux* | *-*-gnu*) |
4906
|
859 MKOCTFILE_DL_LDFLAGS="-shared -Wl,-Bsymbolic" |
4283
|
860 SONAME_FLAGS='-Wl,-soname -Wl,$@' |
|
861 RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' |
2813
|
862 ;; |
3887
|
863 i[[3456]]86-*-sco3.2v5*) |
4283
|
864 SONAME_FLAGS='-Wl,-h -Wl,$@' |
3705
|
865 RLD_FLAG= |
3160
|
866 SH_LDFLAGS=-G |
|
867 ;; |
2813
|
868 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
869 CPICFLAG= |
|
870 CXXPICFLAG= |
|
871 FPICFLAG= |
|
872 DLFCN_DIR=dlfcn |
|
873 ;; |
|
874 hppa*-hp-hpux*) |
3887
|
875 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
876 FPICFLAG=-fPIC |
|
877 else |
|
878 FPICFLAG=+Z |
|
879 fi |
|
880 SHLEXT=sl |
|
881 SH_LDFLAGS="-shared -fPIC" |
4283
|
882 RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' |
2813
|
883 ;; |
|
884 *-sgi-*) |
|
885 CPICFLAG= |
|
886 CXXPICFLAG= |
|
887 FPICFLAG= |
4353
|
888 RLD_FLAG='-rpath $(octlibdir)' |
2813
|
889 ;; |
|
890 sparc-sun-sunos4*) |
3887
|
891 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
892 FPICFLAG=-fPIC |
|
893 else |
|
894 FPICFLAG=-PIC |
|
895 fi |
3059
|
896 SH_LD=ld |
|
897 SH_LDFLAGS="-assert nodefinitions" |
3162
|
898 RLD_FLAG='-L$(octlibdir)' |
2813
|
899 ;; |
3606
|
900 sparc-sun-solaris2* | i386-pc-solaris2*) |
3887
|
901 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
902 FPICFLAG=-fPIC |
|
903 else |
3775
|
904 FPICFLAG=-KPIC |
|
905 fi |
|
906 if test "$GCC" = yes; then |
|
907 CPICFLAG=-fPIC |
|
908 else |
|
909 CPICFLAG=-KPIC |
2813
|
910 fi |
3775
|
911 if test "$GXX" = yes; then |
|
912 CXXPICFLAG=-fPIC |
|
913 SH_LDFLAGS=-shared |
|
914 else |
|
915 CXXPICFLAG=-KPIC |
|
916 SH_LDFLAGS=-G |
|
917 fi |
|
918 RLD_FLAG='-R $(octlibdir)' |
|
919 # Template closures in archive libraries need a different mechanism. |
3820
|
920 if test "$GXX" = yes; then |
3775
|
921 true |
|
922 else |
4323
|
923 TEMPLATE_AR='$(CXX)' |
3775
|
924 TEMPLATE_ARFLAGS="-xar -o" |
|
925 fi |
2813
|
926 ;; |
|
927 esac |
|
928 |
|
929 if $use_rpath; then |
4353
|
930 if test -n "$enable_rpath_arg"; then |
|
931 RLD_FLAG="$enable_rpath_arg" |
|
932 fi |
2813
|
933 else |
4353
|
934 RLD_FLAG="" |
2813
|
935 fi |
|
936 |
|
937 AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) |
|
938 AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) |
|
939 AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) |
|
940 AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) |
4126
|
941 AC_MSG_RESULT([defining SHLLIB to be $SHLLIB]) |
|
942 AC_MSG_RESULT([defining SHLBIN to be $SHLBIN]) |
|
943 AC_MSG_RESULT([defining SHLEXT_VER to be $SHLEXT_VER]) |
|
944 AC_MSG_RESULT([defining SHLLIB_VER to be $SHLLIB_VER]) |
|
945 AC_MSG_RESULT([defining SHLBIN_VER to be $SHLBIN_VER]) |
|
946 AC_MSG_RESULT([defining SHLLINKEXT to be $SHLLINKEXT]) |
2813
|
947 AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) |
|
948 AC_MSG_RESULT([defining SH_LD to be $SH_LD]) |
|
949 AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) |
4759
|
950 AC_MSG_RESULT([defining DL_LD to be $DL_LD]) |
|
951 AC_MSG_RESULT([defining DL_LDFLAGS to be $DL_LDFLAGS]) |
|
952 AC_MSG_RESULT([defining MKOCTFILE_DL_LDFLAGS to be $MKOCTFILE_DL_LDFLAGS]) |
3036
|
953 AC_MSG_RESULT([defining SONAME_FLAGS to be $SONAME_FLAGS]) |
4199
|
954 AC_MSG_RESULT([defining NO_OCT_FILE_STRIP to be $NO_OCT_FILE_STRIP]) |
2813
|
955 AC_MSG_RESULT([defining RLD_FLAG to be $RLD_FLAG]) |
3775
|
956 AC_MSG_RESULT([defining TEMPLATE_AR to be $TEMPLATE_AR]) |
|
957 AC_MSG_RESULT([defining TEMPLATE_ARFLAGS to be $TEMPLATE_ARFLAGS]) |
4104
|
958 AC_MSG_RESULT([defining library_path_var to be $library_path_var]) |
2813
|
959 AC_SUBST(FPICFLAG) |
|
960 AC_SUBST(CPICFLAG) |
|
961 AC_SUBST(CXXPICFLAG) |
|
962 AC_SUBST(SHLEXT) |
4102
|
963 AC_SUBST(SHLLIB) |
|
964 AC_SUBST(SHLBIN) |
4126
|
965 AC_SUBST(SHLEXT_VER) |
|
966 AC_SUBST(SHLLIB_VER) |
|
967 AC_SUBST(SHLBIN_VER) |
|
968 AC_SUBST(SHLLINKEXT) |
2813
|
969 AC_SUBST(DLFCN_DIR) |
|
970 AC_SUBST(SH_LD) |
|
971 AC_SUBST(SH_LDFLAGS) |
4759
|
972 AC_SUBST(DL_LD) |
|
973 AC_SUBST(DL_LDFLAGS) |
|
974 AC_SUBST(MKOCTFILE_DL_LDFLAGS) |
3036
|
975 AC_SUBST(SONAME_FLAGS) |
4199
|
976 AC_SUBST(NO_OCT_FILE_STRIP) |
2813
|
977 AC_SUBST(RLD_FLAG) |
3775
|
978 AC_SUBST(TEMPLATE_AR) |
|
979 AC_SUBST(TEMPLATE_ARFLAGS) |
4104
|
980 AC_SUBST(library_path_var) |
4102
|
981 |
2813
|
982 ### special checks for odd OS specific things. |
|
983 ### |
|
984 ### I am told that on some SCO systems, the only place to find some |
|
985 ### functions like gethostname and gettimeofday is in libsocket. |
|
986 |
3887
|
987 AC_CHECK_FUNCS(gethostname, [], [AC_CHECK_LIB(socket, gethostname)]) |
|
988 AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) |
2813
|
989 |
4388
|
990 case "$canonical_host_type" in |
|
991 *-*-cygwin* | *-*-mingw*) |
|
992 AC_CHECK_LIB(wsock32, gethostname) |
|
993 ;; |
|
994 esac |
|
995 |
4353
|
996 ### Type stuff. |
|
997 |
|
998 AC_TYPE_MODE_T |
|
999 AC_TYPE_OFF_T |
|
1000 AC_TYPE_PID_T |
|
1001 AC_TYPE_SIZE_T |
|
1002 AC_TYPE_UID_T |
|
1003 AC_CHECK_TYPES([dev_t, ino_t, nlink_t, nlink_t]) |
|
1004 AC_CHECK_TYPES([long long int, unsigned long long int]) |
|
1005 AC_CHECK_TYPES([sigset_t, sig_atomic_t], , , [#include <signal.h>]) |
|
1006 |
2813
|
1007 ### How big are ints and how are they oriented? These could probably |
|
1008 ### be eliminated in favor of run-time checks. |
|
1009 |
3888
|
1010 AC_CHECK_SIZEOF(short) |
|
1011 AC_CHECK_SIZEOF(int) |
|
1012 AC_CHECK_SIZEOF(long) |
|
1013 AC_CHECK_SIZEOF(long long) |
2813
|
1014 |
|
1015 ### Does the C compiler handle alloca() and const correctly? |
|
1016 |
4602
|
1017 AC_FUNC_ALLOCA |
2813
|
1018 AC_C_CONST |
|
1019 |
|
1020 ### See if we should define NPOS. |
|
1021 |
|
1022 OCTAVE_STRING_NPOS |
|
1023 |
4360
|
1024 ### See if we should use placement delete. |
|
1025 |
|
1026 OCTAVE_PLACEMENT_DELETE |
|
1027 |
4366
|
1028 ### See if we can auto allocate variable sized arrays. |
|
1029 |
|
1030 OCTAVE_DYNAMIC_AUTO_ARRAYS |
|
1031 |
869
|
1032 ### Checks for header files. |
|
1033 |
832
|
1034 AC_HEADER_STDC |
|
1035 AC_HEADER_DIRENT |
1377
|
1036 AC_HEADER_TIME |
|
1037 AC_HEADER_SYS_WAIT |
2097
|
1038 |
4051
|
1039 ### C headers |
|
1040 |
4067
|
1041 AC_CHECK_HEADERS(assert.h curses.h direct.h dlfcn.h fcntl.h float.h \ |
4051
|
1042 floatingpoint.h grp.h ieeefp.h limits.h memory.h nan.h \ |
|
1043 ncurses.h poll.h pwd.h stdlib.h string.h sys/ioctl.h \ |
3308
|
1044 sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ |
|
1045 sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h \ |
3887
|
1046 unistd.h varargs.h) |
|
1047 |
4051
|
1048 ### C++ headers |
|
1049 |
|
1050 AC_LANG_PUSH(C++) |
|
1051 AC_CHECK_HEADERS(sstream) |
|
1052 AC_LANG_POP(C++) |
|
1053 |
3887
|
1054 have_termios_h=no |
|
1055 AC_CHECK_HEADERS($TERMIOS_H, have_termios_h=yes) |
|
1056 AC_CHECK_HEADERS(termio.h, have_termio_h=yes, have_termio_h=no) |
|
1057 AC_CHECK_HEADERS(sgtty.h, have_sgtty_h=yes, have_sgtty_h=no) |
4067
|
1058 AC_CHECK_HEADERS(conio.h, have_conio_h=yes, have_conio_h=no) |
3249
|
1059 |
3225
|
1060 ### I'm told that termios.h is broken on NeXT systems. |
|
1061 |
|
1062 case "$canonical_host_type" in |
|
1063 *-*-nextstep*) |
3887
|
1064 if test "$have_termios_h" = yes; then |
3249
|
1065 AC_MSG_WARN([Ignoring termios.h on NeXT systems.]) |
3887
|
1066 have_termios_h=no |
3249
|
1067 fi |
3225
|
1068 ;; |
|
1069 esac |
|
1070 |
3887
|
1071 if test "$have_termios_h" = yes \ |
|
1072 || test "$have_termio_h" = yes \ |
|
1073 || test "$have_sgtty_h" = yes; then |
832
|
1074 true |
|
1075 else |
4064
|
1076 AC_MSG_WARN([I couldn't find termios.h, termio.h, or sgtty.h!]) |
832
|
1077 fi |
869
|
1078 |
1788
|
1079 ### Checks for functions and variables. |
869
|
1080 |
5138
|
1081 AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name \ |
|
1082 dup2 endgrent endpwent execvp fcntl fork getcwd getegid geteuid \ |
|
1083 getgid getgrent getgrgid getgrnam getpgrp getpid getppid getpwent \ |
|
1084 getpwuid gettimeofday getuid getwd _kbhit kill link localtime_r \ |
|
1085 lstat memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise \ |
|
1086 readlink rename resolvepath rindex rmdir round select setgrent \ |
|
1087 setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \ |
|
1088 sigsuspend stat strcasecmp strdup strerror strftime stricmp \ |
|
1089 strncasecmp strnicmp strptime symlink tempnam umask unlink usleep \ |
|
1090 vfprintf vsprintf vsnprintf waitpid) |
1300
|
1091 |
1708
|
1092 OCTAVE_SMART_PUTENV |
|
1093 |
4110
|
1094 ### Dynamic linking is now enabled only if we are building shared |
|
1095 ### libs and some API for dynamic linking is detected. |
|
1096 |
3705
|
1097 LD_CXX='$(CXX)' |
2064
|
1098 LIBDLFCN= |
|
1099 DLFCN_INCFLAGS= |
3232
|
1100 RDYNAMIC_FLAG= |
4110
|
1101 DL_API_MSG="" |
|
1102 dlopen_api=false |
|
1103 shl_load_api=false |
|
1104 loadlibrary_api=false |
4163
|
1105 dyld_api=false |
4110
|
1106 |
4163
|
1107 if $SHARED_LIBS || $ENABLE_DYNAMIC_LINKING; then |
|
1108 |
|
1109 ### Check for dyld first since OS X can have a non-standard libdl |
4110
|
1110 |
4163
|
1111 AC_CHECK_HEADER(Mach-O/dyld.h) |
4201
|
1112 if test "$ac_cv_header_Mach_O_dyld_h" = yes; then |
4163
|
1113 dyld_api=true |
|
1114 else |
4189
|
1115 AC_CHECK_LIB(dld, shl_load) |
|
1116 AC_CHECK_FUNCS(shl_load shl_findsym) |
4201
|
1117 if test "$ac_cv_func_shl_load" = yes \ |
|
1118 && test "$ac_cv_func_shl_findsym" = yes; then |
4189
|
1119 shl_load_api=true |
4110
|
1120 else |
4189
|
1121 AC_CHECK_LIB(wsock32, LoadLibrary) |
|
1122 AC_CHECK_FUNCS(LoadLibrary) |
4201
|
1123 if test "$ac_cv_func_loadlibrary" = yes; then |
4189
|
1124 loadlibrary_api=true |
2063
|
1125 else |
4189
|
1126 AC_CHECK_LIB(dl, dlopen) |
|
1127 AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) |
4201
|
1128 if test "$ac_cv_func_dlclose" = yes \ |
|
1129 && test "$ac_cv_func_dlerror" = yes \ |
|
1130 && test "$ac_cv_func_dlopen" = yes \ |
|
1131 && test "$ac_cv_func_dlsym" = yes; then |
4189
|
1132 dlopen_api=true |
|
1133 else |
4163
|
1134 case "$canonical_host_type" in |
|
1135 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
1136 LIBDLFCN="-ldlfcn -ll -lld" |
|
1137 DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn' |
|
1138 dlopen_api=true |
|
1139 ;; |
|
1140 i[[3456]]86-*-sco3.2v5*) |
|
1141 LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)' |
|
1142 dlopen_api=true |
|
1143 ;; |
|
1144 esac |
|
1145 fi |
2063
|
1146 fi |
4110
|
1147 fi |
|
1148 fi |
|
1149 |
|
1150 if $dlopen_api; then |
|
1151 DL_API_MSG="(dlopen)" |
|
1152 AC_DEFINE(HAVE_DLOPEN_API, 1, [Define if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking]) |
3958
|
1153 OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic]) |
4110
|
1154 elif $shl_load_api; then |
|
1155 DL_API_MSG="(shl_load)" |
|
1156 AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define if your system has shl_load and shl_findsym for dynamic linking]) |
|
1157 elif $loadlibrary_api; then |
|
1158 DL_API_MSG="(LoadLibrary)" |
|
1159 AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define if your system has LoadLibrary for dynamic linking]) |
4163
|
1160 elif $dyld_api; then |
|
1161 DL_API_MSG="(dyld)" |
|
1162 AC_DEFINE(HAVE_DYLD_API, 1, [Define if your system has dyld for dynamic linking]) |
4110
|
1163 fi |
|
1164 |
4163
|
1165 if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then |
4128
|
1166 ENABLE_DYNAMIC_LINKING=true |
|
1167 AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define if using dynamic linking]) |
1978
|
1168 fi |
4163
|
1169 fi |
|
1170 |
|
1171 if $SHARED_LIBS; then |
|
1172 LIBOCTINTERP=-loctinterp$SHLLINKEXT |
|
1173 LIBOCTAVE=-loctave$SHLLINKEXT |
|
1174 LIBCRUFT=-lcruft$SHLLINKEXT |
1978
|
1175 else |
4110
|
1176 LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)' |
|
1177 LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)' |
|
1178 LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)' |
1664
|
1179 fi |
4163
|
1180 |
4110
|
1181 AC_SUBST(LD_CXX) |
2064
|
1182 AC_SUBST(LIBDLFCN) |
|
1183 AC_SUBST(DLFCN_INCFLAGS) |
3232
|
1184 AC_SUBST(RDYNAMIC_FLAG) |
4128
|
1185 AC_SUBST(ENABLE_DYNAMIC_LINKING) |
4110
|
1186 AC_SUBST(LIBOCTINTERP) |
|
1187 AC_SUBST(LIBOCTAVE) |
|
1188 AC_SUBST(LIBCRUFT) |
1901
|
1189 |
1300
|
1190 ### There is more than one possible prototype for gettimeofday. See |
2782
|
1191 ### which one (if any) appears in sys/time.h. These tests are from |
|
1192 ### Emacs 19. |
1300
|
1193 |
2782
|
1194 AC_MSG_CHECKING(for struct timeval) |
|
1195 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME |
|
1196 #include <sys/time.h> |
|
1197 #include <time.h> |
|
1198 #else |
|
1199 #ifdef HAVE_SYS_TIME_H |
|
1200 #include <sys/time.h> |
|
1201 #else |
|
1202 #include <time.h> |
|
1203 #endif |
|
1204 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;], |
|
1205 [AC_MSG_RESULT(yes) |
|
1206 HAVE_TIMEVAL=yes |
3887
|
1207 AC_DEFINE(HAVE_TIMEVAL, 1, [Define if struct timeval is defined.])], |
2782
|
1208 [AC_MSG_RESULT(no) |
|
1209 HAVE_TIMEVAL=no]) |
|
1210 |
|
1211 if test "x$HAVE_TIMEVAL" = xyes; then |
|
1212 AC_MSG_CHECKING(whether gettimeofday can't accept two arguments) |
|
1213 AC_TRY_LINK([#ifdef TIME_WITH_SYS_TIME |
|
1214 #include <sys/time.h> |
|
1215 #include <time.h> |
|
1216 #else |
|
1217 #ifdef HAVE_SYS_TIME_H |
|
1218 #include <sys/time.h> |
|
1219 #else |
|
1220 #include <time.h> |
|
1221 #endif |
|
1222 #endif],[struct timeval time; struct timezone dummy; |
|
1223 gettimeofday (&time, &dummy);], [AC_MSG_RESULT(no)], |
|
1224 [AC_MSG_RESULT(yes) |
3887
|
1225 AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1, [Define if your system has a single-arg prototype for gettimeofday.])]) |
2782
|
1226 fi |
869
|
1227 |
832
|
1228 dnl Would like to get rid of this cruft, and just have |
|
1229 dnl |
|
1230 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
1231 dnl |
|
1232 dnl instead, but that used to fail on some systems... |
369
|
1233 dnl |
832
|
1234 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
1235 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
1236 dnl fails, we try again by including math.h and invoking the function |
|
1237 dnl with an argument. |
869
|
1238 |
2508
|
1239 ### I am told that Inf and NaN don't work on m68k HP sytems, and that |
|
1240 ### on SCO systems, isnan and isinf don't work, but they can be |
|
1241 ### replaced by something that does. |
956
|
1242 |
|
1243 case "$canonical_host_type" in |
1384
|
1244 m68k-hp-hpux*) |
956
|
1245 ;; |
2508
|
1246 *-*-sco*) |
|
1247 AC_MSG_RESULT([defining SCO to be 1]) |
3887
|
1248 AC_DEFINE(SCO, 1, [Define if using an SCO system.]) |
2508
|
1249 AC_MSG_RESULT([forcing HAVE_ISINF for SCO]) |
3887
|
1250 AC_DEFINE(HAVE_ISINF, 1, [Define if you have isinf().]) |
2508
|
1251 AC_MSG_RESULT([forcing HAVE_ISNAN for SCO]) |
3887
|
1252 AC_DEFINE(HAVE_ISNAN, 1, [Define if you have isnan().]) |
2508
|
1253 ;; |
956
|
1254 *) |
4349
|
1255 AC_CHECK_FUNCS(finite isnan isinf copysign signbit) |
5098
|
1256 AC_CHECK_DECLS(signbit, , , [#include <math.h>]) |
956
|
1257 ;; |
|
1258 esac |
|
1259 |
1076
|
1260 ### Check for nonstandard but common math functions that we need. |
|
1261 |
3130
|
1262 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
|
1263 |
869
|
1264 ### Checks for OS specific cruft. |
|
1265 |
3887
|
1266 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) |
|
1267 |
405
|
1268 AC_STRUCT_TM |
1186
|
1269 AC_STRUCT_TIMEZONE |
1388
|
1270 AC_FUNC_CLOSEDIR_VOID |
1225
|
1271 |
3892
|
1272 AC_CHECK_MEMBERS(struct group.gr_passwd) |
2548
|
1273 |
4067
|
1274 # mkdir takes a single argument on some systems. |
|
1275 OCTAVE_MKDIR_TAKES_ONE_ARG |
|
1276 |
3887
|
1277 octave_found_termlib=no |
2592
|
1278 for termlib in ncurses curses termcap terminfo termlib; do |
2034
|
1279 AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
1280 case "${TERMLIBS}" in |
|
1281 *-l${termlib}*) |
3822
|
1282 LIBS="$TERMLIBS $LIBS" |
4102
|
1283 AC_SUBST(TERMLIBS) |
3887
|
1284 octave_found_termlib=yes |
405
|
1285 break |
|
1286 ;; |
|
1287 esac |
|
1288 done |
869
|
1289 |
3887
|
1290 if test "$octave_found_termlib" = no; then |
|
1291 warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ |
|
1292 r -ltermlib!" |
3105
|
1293 AC_MSG_WARN($warn_termlibs) |
2488
|
1294 fi |
|
1295 |
3822
|
1296 OCTAVE_ENABLE_READLINE |
|
1297 |
832
|
1298 AC_MSG_CHECKING([for struct exception in math.h]) |
|
1299 AC_TRY_LINK([#include <math.h>], |
|
1300 [struct exception *x; x->type; x->name;], |
835
|
1301 AC_MSG_RESULT(yes) |
3887
|
1302 AC_DEFINE(EXCEPTION_IN_MATH, 1, [Define if your math.h declares struct exception for matherr().]), |
869
|
1303 AC_MSG_RESULT(no)) |
|
1304 |
|
1305 ### Signal stuff. |
|
1306 |
834
|
1307 AC_TYPE_SIGNAL |
4214
|
1308 AC_CHECK_DECL([sys_siglist], |
|
1309 [AC_DEFINE(SYS_SIGLIST_DECLARED, 1, [Define if your system has a declaration of sys_siglist.])], |
|
1310 [AC_CHECK_DECLS([sys_siglist])], [#include <signal.h>]) |
885
|
1311 AC_MSG_CHECKING([for sys_siglist variable]) |
|
1312 AC_TRY_LINK([#include <stdio.h>], |
|
1313 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
1314 AC_MSG_RESULT(yes) |
3887
|
1315 AC_DEFINE(HAVE_SYS_SIGLIST, 1, [Define if your system has a sys_siglist variable.]), |
885
|
1316 AC_MSG_RESULT(no)) |
2470
|
1317 OCTAVE_SIGNAL_CHECK |
|
1318 OCTAVE_REINSTALL_SIGHANDLERS |
869
|
1319 |
2633
|
1320 ### A system dependent kluge or two. |
|
1321 |
2035
|
1322 AC_CHECK_FUNCS(getrusage times) |
2427
|
1323 case "$canonical_host_type" in |
3971
|
1324 *-*-cygwin*) |
3887
|
1325 AC_DEFINE(RUSAGE_TIMES_ONLY, 1, [Define if your struct rusage only has time information.]) |
2427
|
1326 ;; |
|
1327 esac |
|
1328 |
2762
|
1329 bsd_gcc_kluge_targets_frag=/dev/null |
2633
|
1330 case "$canonical_host_type" in |
|
1331 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
1332 bsd_gcc_kluge_targets_frag=Makefrag.bsd |
|
1333 cat << \EOF > $bsd_gcc_kluge_targets_frag |
|
1334 |
|
1335 lex.o: lex.cc |
|
1336 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1337 |
|
1338 pt-plot.o: pt-plot.cc |
|
1339 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1340 |
|
1341 symtab.o: symtab.cc |
|
1342 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1343 |
|
1344 toplev.o: toplev.cc |
|
1345 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1346 |
|
1347 unwind-prot.o: unwind-prot.cc |
|
1348 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1349 |
|
1350 EOF |
|
1351 ;; |
|
1352 esac |
|
1353 AC_SUBST_FILE(bsd_gcc_kluge_targets_frag) |
|
1354 |
869
|
1355 ### Checks for other programs used for building, testing, installing, |
|
1356 ### and running Octave. |
|
1357 |
4544
|
1358 AC_PROG_AWK |
4084
|
1359 OCTAVE_PROG_SED |
|
1360 |
3729
|
1361 OCTAVE_PROG_FLEX |
|
1362 OCTAVE_PROG_BISON |
869
|
1363 |
1722
|
1364 AC_PROG_LN_S |
|
1365 |
3222
|
1366 OCTAVE_PROG_NM |
3130
|
1367 OCTAVE_PROG_RUNTEST |
869
|
1368 |
405
|
1369 AC_PROG_INSTALL |
2642
|
1370 INSTALL_SCRIPT='${INSTALL}' |
|
1371 AC_SUBST(INSTALL_SCRIPT) |
869
|
1372 |
3130
|
1373 OCTAVE_PROG_GNUPLOT |
|
1374 OCTAVE_PROG_PAGER |
3673
|
1375 OCTAVE_PROG_GPERF |
3130
|
1376 |
2032
|
1377 ### Even though we include config.h, we need to have the preprocessor |
|
1378 ### defines available in a variable for the octave-bug script. Use |
|
1379 ### UGLY_DEFS for that. |
|
1380 |
|
1381 AC_OUTPUT_MAKE_DEFS |
3956
|
1382 |
|
1383 |
|
1384 dnl Maybe this should really be conditional on "broken sed", or |
|
1385 dnl "broken shell backslash quoting" or somesuch. |
|
1386 dnl |
|
1387 case "$canonical_host_type" in |
|
1388 *-*-darwin*) |
|
1389 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\",g'` |
|
1390 ;; |
|
1391 *) |
|
1392 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` |
|
1393 ;; |
|
1394 esac |
2032
|
1395 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
|
1396 AC_SUBST(UGLY_DEFS) |
|
1397 |
4645
|
1398 ### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're |
4587
|
1399 ### done feature testing. |
869
|
1400 |
3131
|
1401 if test -z "$EXTERN_CFLAGS"; then |
4626
|
1402 OCTAVE_CC_FLAG(-Wall, [ |
|
1403 WARN_CFLAGS="$WARN_CFLAGS -Wall"; |
|
1404 AC_MSG_RESULT([adding -Wall to WARN_CFLAGS])]) |
4645
|
1405 OCTAVE_CC_FLAG(-W, [ |
|
1406 WARN_CFLAGS="$WARN_CFLAGS -W"; |
|
1407 AC_MSG_RESULT([adding -W to WARN_CFLAGS])]) |
4626
|
1408 OCTAVE_CC_FLAG(-Wshadow, [ |
|
1409 WARN_CFLAGS="$WARN_CFLAGS -Wshadow"; |
|
1410 AC_MSG_RESULT([adding -Wshadow to WARN_CFLAGS])]) |
405
|
1411 fi |
3131
|
1412 |
|
1413 if test -z "$EXTERN_CXXFLAGS"; then |
4626
|
1414 OCTAVE_CXX_FLAG(-Wall, [ |
|
1415 WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"; |
|
1416 AC_MSG_RESULT([adding -Wall to WARN_CXXFLAGS])]) |
4645
|
1417 OCTAVE_CXX_FLAG(-W, [ |
|
1418 WARN_CXXFLAGS="$WARN_CXXFLAGS -W"; |
|
1419 AC_MSG_RESULT([adding -W to WARN_CXXFLAGS])]) |
4626
|
1420 OCTAVE_CXX_FLAG(-Wshadow, [ |
|
1421 WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow"; |
|
1422 AC_MSG_RESULT([adding -Wshadow to WARN_CXXFLAGS])]) |
405
|
1423 fi |
869
|
1424 |
2813
|
1425 ### Someday, maybe include -ansi and even -pedantic in this list... |
|
1426 |
4971
|
1427 GCC_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wmissing-prototypes \ |
|
1428 -Wpointer-arith -Wstrict-prototypes -Wwrite-strings" |
2813
|
1429 |
5194
|
1430 GXX_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wpointer-arith \ |
|
1431 -Wwrite-strings -Weffc++ -Wenum-clash" |
2813
|
1432 |
|
1433 AC_ARG_ENABLE(picky-flags, |
|
1434 [ --enable-picky-flags add picky options to CFLAGS, CXXFLAGS, FFLAGS], |
3131
|
1435 [if test "$enableval" = no; then |
|
1436 true |
2813
|
1437 elif test "$enableval" = yes; then |
3131
|
1438 if test -z "$EXTERN_CFLAGS"; then |
|
1439 for flag in $GCC_PICKY_FLAGS; do |
4626
|
1440 OCTAVE_CC_FLAG($flag, [ |
|
1441 WARN_CFLAGS="$WARN_CFLAGS $flag"; |
|
1442 AC_MSG_RESULT([adding $flag to WARN_CFLAGS])]) |
3131
|
1443 done |
2813
|
1444 fi |
3131
|
1445 if test -z "$EXTERN_CXXFLAGS"; then |
|
1446 for flag in $GXX_PICKY_FLAGS; do |
4626
|
1447 OCTAVE_CXX_FLAG($flag, [ |
|
1448 WARN_CXXFLAGS="$WARN_CXXFLAGS $flag"; |
|
1449 AC_MSG_RESULT([adding $flag to WARN_CXXFLAGS])]) |
3131
|
1450 done |
2813
|
1451 fi |
|
1452 fi], []) |
|
1453 |
4626
|
1454 AC_SUBST(WARN_CFLAGS) |
|
1455 AC_SUBST(WARN_CXXFLAGS) |
|
1456 |
1146
|
1457 ### Run configure in subdirectories. |
|
1458 |
1304
|
1459 export CC |
|
1460 export CXX |
|
1461 export F77 |
|
1462 |
4378
|
1463 AC_CONFIG_SUBDIRS(scripts) |
3887
|
1464 |
|
1465 if test "x$PLPLOT_DIR" = xplplot; then |
5169
|
1466 AC_CONFIG_SUBDIRS(plplot) |
3887
|
1467 fi |
1146
|
1468 |
3923
|
1469 ### Some things to add to the bottom of config.h. |
|
1470 |
|
1471 AH_BOTTOM([ |
|
1472 #if defined (__GNUC__) |
5389
|
1473 #define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) |
3923
|
1474 #define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) |
|
1475 #define GCC_ATTR_UNUSED __attribute__ ((__unused__)) |
|
1476 #else |
5389
|
1477 #define GCC_ATTR_DEPRECATED |
3923
|
1478 #define GCC_ATTR_NORETURN |
|
1479 #define GCC_ATTR_UNUSED |
|
1480 #endif |
|
1481 |
|
1482 #define CONST_CAST(T, E) (T) (E) |
|
1483 |
|
1484 #define DYNAMIC_CAST(T, E) (T) (E) |
|
1485 |
|
1486 #define REINTERPRET_CAST(T, E) (T) (E) |
|
1487 |
|
1488 #define STATIC_CAST(T, E) (T) (E) |
|
1489 |
|
1490 #define X_CAST(T, E) (T) (E) |
|
1491 |
|
1492 #if defined(HAVE_F2C) && !defined(F77_FUNC) |
|
1493 # define F77_FUNC(x,X) x ## _ |
|
1494 # define F77_FUNC_(x,X) x ## __ |
|
1495 #endif |
|
1496 |
|
1497 #if !defined(HAVE_DEV_T) |
4064
|
1498 typedef short dev_t; |
3923
|
1499 #endif |
|
1500 |
|
1501 #if !defined(HAVE_INO_T) |
4064
|
1502 typedef unsigned long ino_t; |
3923
|
1503 #endif |
|
1504 |
|
1505 #if !defined(HAVE_NLINK_T) |
4064
|
1506 typedef short nlink_t; |
3923
|
1507 #endif |
|
1508 |
|
1509 #if !defined(HAVE_SIGSET_T) |
4064
|
1510 typedef int sigset_t; |
3923
|
1511 #endif |
4101
|
1512 |
4180
|
1513 #if !defined(HAVE_SIG_ATOMIC_T) |
|
1514 typedef int sig_atomic_t; |
|
1515 #endif |
|
1516 |
4101
|
1517 #define OCTAVE_HAVE_POSIX_FILESYSTEM 1 |
|
1518 |
4377
|
1519 #if defined (__WIN32__) && ! defined (__CYGWIN__) |
4101
|
1520 #define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 |
|
1521 #undef OCTAVE_HAVE_POSIX_FILESYSTEM |
|
1522 #endif |
4377
|
1523 |
|
1524 #if defined (__CYGWIN__) |
|
1525 #define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 |
|
1526 #define OCTAVE_HAVE_POSIX_FILESYSTEM 1 |
4101
|
1527 #endif |
|
1528 |
|
1529 /* Define if we expect to have <windows.h>, Sleep, etc. */ |
4102
|
1530 #if defined (__WIN32__) && ! defined (__CYGWIN__) |
4101
|
1531 #define OCTAVE_USE_WINDOWS_API 1 |
|
1532 #endif |
4153
|
1533 |
4180
|
1534 /* sigsetjmp is a macro, not a function. */ |
|
1535 #if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP) |
|
1536 #define OCTAVE_HAVE_SIG_JUMP |
|
1537 #endif |
4249
|
1538 |
4726
|
1539 /* Always use vector<T>, since we sometimes allocate large chunks |
|
1540 of memory and that can cause trouble due to stack size limits. |
|
1541 |
|
1542 Note that using auto_ptr is not appropriate because it uses delete, |
|
1543 not delete[] and we need the latter to properly handle arrays |
|
1544 allocated with new[size]. |
|
1545 |
5174
|
1546 Use < T > instead of <T> to avoid problems if T is a template type |
|
1547 (say, foo<int>) and the preprocessor fails to insert a space and |
|
1548 generates <foo<int>>. |
|
1549 |
4366
|
1550 #if defined (HAVE_DYNAMIC_AUTO_ARRAYS) |
5174
|
1551 |
4249
|
1552 #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ |
|
1553 T buf[size] |
5174
|
1554 |
|
1555 #else |
|
1556 |
|
1557 */ |
|
1558 |
4249
|
1559 #define OCTAVE_LOCAL_BUFFER(T, buf, size) \ |
5174
|
1560 std::vector< T > buf ## _vector (size); \ |
4726
|
1561 T *buf = &(buf ## _vector[0]) |
5174
|
1562 |
4382
|
1563 /* #endif */ |
4278
|
1564 |
|
1565 #if defined (__DECCXX) |
|
1566 #define __USE_STD_IOSTREAM |
|
1567 #endif |
4552
|
1568 |
|
1569 #if defined (_UNICOS) |
|
1570 #define F77_USES_CRAY_CALLING_CONVENTION |
|
1571 #endif |
|
1572 |
|
1573 #if 0 |
|
1574 #define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION |
|
1575 #endif |
5275
|
1576 |
5297
|
1577 #ifdef USE_64_BIT_IDX_T |
|
1578 #define SIZEOF_OCTAVE_IDX_TYPE 8 |
|
1579 #else |
|
1580 #define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT |
|
1581 #endif |
|
1582 |
5275
|
1583 #include "oct-types.h" |
3923
|
1584 ]) |
|
1585 |
869
|
1586 ### Do the substitutions in all the Makefiles. |
|
1587 |
5292
|
1588 AC_CONFIG_FILES([Makefile octMakefile Makeconf \ |
3215
|
1589 test/Makefile dlfcn/Makefile \ |
|
1590 doc/Makefile doc/faq/Makefile doc/interpreter/Makefile \ |
|
1591 doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \ |
5275
|
1592 examples/Makefile liboctave/Makefile liboctave/oct-types.h \ |
|
1593 src/Makefile libcruft/Makefile libcruft/Makerules \ |
|
1594 libcruft/amos/Makefile libcruft/blas/Makefile \ |
|
1595 libcruft/daspk/Makefile libcruft/dasrt/Makefile |
|
1596 libcruft/dassl/Makefile libcruft/fftpack/Makefile \ |
|
1597 libcruft/lapack/Makefile libcruft/minpack/Makefile \ |
|
1598 libcruft/misc/Makefile libcruft/odepack/Makefile \ |
4329
|
1599 libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile \ |
|
1600 libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile \ |
|
1601 libcruft/slatec-err/Makefile libcruft/villad/Makefile \ |
3887
|
1602 libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile]) |
|
1603 AC_OUTPUT |
1225
|
1604 |
3887
|
1605 AC_CONFIG_COMMANDS([default-1],[[chmod +x install-octave]],[[]]) |
3176
|
1606 |
1225
|
1607 ### Print a summary so that important information isn't missed. |
|
1608 |
|
1609 if test -z "$F77"; then |
|
1610 FORT="$F2C $F2CFLAGS" |
|
1611 else |
2610
|
1612 FORT="$F77 $FFLAGS" |
1225
|
1613 fi |
|
1614 |
|
1615 AC_MSG_RESULT([ |
|
1616 |
|
1617 Octave is now configured for $canonical_host_type |
|
1618 |
1664
|
1619 Source directory: $srcdir |
|
1620 Installation prefix: $prefix |
4626
|
1621 C compiler: $CC $XTRA_CFLAGS $WARN_CFLAGS $CFLAGS |
|
1622 C++ compiler: $CXX $XTRA_CXXFLAGS $WARN_CXXFLAGS $CXXFLAGS |
1664
|
1623 Fortran compiler: $FORT |
|
1624 Fortran libraries: $FLIBS |
3820
|
1625 BLAS libraries: $BLAS_LIBS |
3827
|
1626 FFTW libraries: $FFTW_LIBS |
5235
|
1627 GLPK libraries: $GLPK_LIBS |
5203
|
1628 UMFPACK libraries: $UMFPACK_LIBS |
3820
|
1629 HDF5 libraries: $HDF5_LIBS |
4343
|
1630 MPI libraries: $MPI_LIBS |
3822
|
1631 LIBS: $LIBS |
1664
|
1632 Default pager: $DEFAULT_PAGER |
|
1633 gnuplot: $GNUPLOT_BINARY |
|
1634 |
4110
|
1635 Do internal array bounds checking: $BOUNDS_CHECKING |
|
1636 Build static libraries: $STATIC_LIBS |
|
1637 Build shared libraries: $SHARED_LIBS |
4128
|
1638 Dynamic Linking: $ENABLE_DYNAMIC_LINKING $DL_API_MSG |
4110
|
1639 Include support for GNU readline: $USE_READLINE |
5275
|
1640 64-bit array dims and indexing: $USE_64_BIT_IDX_T |
1225
|
1641 ]) |
3105
|
1642 |
|
1643 warn_msg_printed=false |
|
1644 |
4469
|
1645 if $ENABLE_DYNAMIC_LINKING; then |
|
1646 if $SHARED_LIBS; then |
|
1647 true |
|
1648 else |
|
1649 AC_MSG_WARN([You used --enable-dl but not --enable-shared.]) |
|
1650 AC_MSG_WARN([Are you sure that is what you want to do?]) |
|
1651 warn_msg_printed=true |
|
1652 fi |
|
1653 fi |
|
1654 |
3105
|
1655 if test -n "$warn_f2c_and_f77"; then |
|
1656 AC_MSG_WARN($warn_f2c_and_f77) |
|
1657 warn_msg_printed=true |
|
1658 fi |
|
1659 |
|
1660 if test -n "$gxx_only"; then |
|
1661 AC_MSG_WARN($gxx_only) |
|
1662 warn_msg_printed=true |
|
1663 fi |
|
1664 |
|
1665 if test -n "$warn_gcc_version"; then |
|
1666 AC_MSG_WARN($warn_gcc_version) |
|
1667 warn_msg_printed=true |
|
1668 fi |
|
1669 |
|
1670 if test -n "$warn_gcc_only"; then |
|
1671 AC_MSG_WARN($warn_gcc_only) |
|
1672 warn_msg_printed=true |
|
1673 fi |
|
1674 |
|
1675 if test -n "$warn_f2c_no_lib"; then |
|
1676 AC_MSG_WARN($warn_f2c_no_lib) |
|
1677 warn_msg_printed=true |
|
1678 fi |
|
1679 |
3825
|
1680 if test -n "$warn_readline"; then |
|
1681 AC_MSG_WARN($warn_readline) |
|
1682 warn_msg_printed=true |
|
1683 fi |
|
1684 |
3105
|
1685 if test -n "$warn_termlibs"; then |
|
1686 AC_MSG_WARN($warn_termlibs) |
|
1687 warn_msg_printed=true |
|
1688 fi |
|
1689 |
3673
|
1690 if test -n "$warn_gperf"; then |
|
1691 AC_MSG_WARN($warn_gperf) |
|
1692 warn_msg_printed=true |
|
1693 fi |
|
1694 |
3105
|
1695 if test -n "$warn_flex"; then |
|
1696 AC_MSG_WARN($warn_flex) |
|
1697 warn_msg_printed=true |
|
1698 fi |
|
1699 |
|
1700 if test -n "$warn_bison"; then |
|
1701 AC_MSG_WARN($warn_bison) |
|
1702 warn_msg_printed=true |
|
1703 fi |
|
1704 |
|
1705 if test -n "$warn_less"; then |
|
1706 AC_MSG_WARN($warn_less) |
|
1707 warn_msg_printed=true |
|
1708 fi |
|
1709 |
|
1710 if test -n "$warn_runtest"; then |
|
1711 AC_MSG_WARN($warn_runtest) |
|
1712 warn_msg_printed=true |
|
1713 fi |
|
1714 |
5203
|
1715 if test -n "$warn_umfpack"; then |
|
1716 AC_MSG_WARN($warn_umfpack) |
|
1717 warn_msg_printed=true |
|
1718 fi |
|
1719 |
|
1720 if test -n "$warn_hdf5"; then |
|
1721 AC_MSG_WARN($warn_hdf5) |
|
1722 warn_msg_printed=true |
|
1723 fi |
|
1724 |
5270
|
1725 if test -n "$warn_zlib"; then |
|
1726 AC_MSG_WARN($warn_zlib) |
|
1727 warn_msg_printed=true |
|
1728 fi |
|
1729 |
5275
|
1730 if test -n "$warn_64_bit"; then |
|
1731 AC_MSG_WARN($warn_64_bit) |
|
1732 warn_msg_printed=true |
|
1733 fi |
|
1734 |
3105
|
1735 if test -n "$warn_gnuplot"; then |
|
1736 |
|
1737 ## If you change this text, be sure to also change the corresponding |
|
1738 ## set of warnings above. |
|
1739 |
|
1740 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
1741 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
1742 AC_MSG_WARN([plotting commands without it.]) |
|
1743 AC_MSG_WARN([]) |
|
1744 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
1745 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
1746 AC_MSG_WARN([]) |
|
1747 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
1748 AC_MSG_WARN([]) |
|
1749 AC_MSG_WARN([at the Octave prompt.]) |
|
1750 warn_msg_printed=true |
|
1751 fi |
|
1752 |
|
1753 if $warn_msg_printed; then |
|
1754 AC_MSG_RESULT([]) |
|
1755 fi |
|
1756 |
|
1757 ### End of configure. |