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