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