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