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