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 |
5854
|
32 AC_REVISION($Revision: 1.514 $) |
4531
|
33 AC_PREREQ(2.57) |
3887
|
34 AC_CONFIG_SRCDIR([src/octave.cc]) |
1146
|
35 AC_CONFIG_HEADER(config.h) |
869
|
36 |
5844
|
37 OCTAVE_HOST_TYPE |
|
38 |
3887
|
39 AC_DEFINE(OCTAVE_SOURCE, 1, [Define if this is Octave.]) |
|
40 |
5098
|
41 AC_GNU_SOURCE |
|
42 |
3923
|
43 AC_AIX |
3887
|
44 AC_MINIX |
3923
|
45 AC_ISC_POSIX |
1667
|
46 |
5451
|
47 ### Path separator. |
|
48 sepchar=: |
|
49 AC_ARG_WITH(sepchar, |
5842
|
50 [AS_HELP_STRING([--with-sepchar=<char>], |
5844
|
51 [use <char> as the path separation character])]) |
5451
|
52 case $with_sepchar in |
|
53 yes | "") |
|
54 case "$canonical_host_type" in |
|
55 *-*-mingw*) |
|
56 sepchar=';' |
|
57 ;; |
|
58 esac |
|
59 ;; |
|
60 no) |
|
61 AC_MSG_ERROR([You are required to define a path separation character]) |
|
62 ;; |
|
63 *) |
|
64 sepchar=$with_sepchar |
|
65 ;; |
|
66 esac |
|
67 AC_SUBST(sepchar) |
|
68 AC_DEFINE_UNQUOTED(SEPCHAR, ['$sepchar'], [Define this to be the path separator for your system, as a character constant.]) |
|
69 AC_DEFINE_UNQUOTED(SEPCHAR_STR, ["$sepchar"], [Define this to the path separator, as a string.]) |
|
70 |
2223
|
71 ### some defaults |
|
72 |
2813
|
73 OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') |
|
74 OCTAVE_SET_DEFAULT(man1ext, '.1') |
|
75 OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') |
3597
|
76 OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') |
3029
|
77 OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') |
2813
|
78 OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') |
4449
|
79 OCTAVE_SET_DEFAULT(localapifcnfiledir, |
5778
|
80 '$(datadir)/octave/site/$(api_version)/m') |
3597
|
81 OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') |
3141
|
82 OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') |
3029
|
83 OCTAVE_SET_DEFAULT(archlibdir, |
3130
|
84 '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') |
3029
|
85 OCTAVE_SET_DEFAULT(localarchlibdir, |
3130
|
86 '$(libexecdir)/octave/site/exec/$(canonical_host_type)') |
3597
|
87 OCTAVE_SET_DEFAULT(localverarchlibdir, |
|
88 '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') |
3029
|
89 OCTAVE_SET_DEFAULT(octfiledir, |
3130
|
90 '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') |
3029
|
91 OCTAVE_SET_DEFAULT(localoctfiledir, |
3130
|
92 '$(libexecdir)/octave/site/oct/$(canonical_host_type)') |
4449
|
93 OCTAVE_SET_DEFAULT(localapioctfiledir, |
5778
|
94 '$(libexecdir)/octave/site/oct/$(api_version)/$(canonical_host_type)') |
3597
|
95 OCTAVE_SET_DEFAULT(localveroctfiledir, |
|
96 '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') |
3029
|
97 OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') |
1667
|
98 |
2155
|
99 ### Make configure args available for other uses. |
|
100 |
|
101 config_opts=$ac_configure_args |
|
102 AC_SUBST(config_opts) |
|
103 |
869
|
104 ### Allow the user to force us to use f2c. |
|
105 |
832
|
106 AC_ARG_WITH(f2c, |
5844
|
107 [AS_HELP_STRING([--with-f2c], |
|
108 [use f2c even if Fortran compiler is available])], |
2813
|
109 [if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi], |
1177
|
110 use_f2c=false) |
|
111 |
2813
|
112 ### Allow the user to force us to use f77. |
|
113 |
|
114 AC_ARG_WITH(f77, |
5844
|
115 [AS_HELP_STRING([--with-f77], [use f77 to compile Fortran subroutines])], |
2813
|
116 [if test "$withval" = no; then use_f77=false; else use_f77=true; fi], |
|
117 use_f77=false) |
|
118 |
|
119 ### Make sure only one of the above options for Fortran compilers was |
|
120 ### specified (multiple "no" or --without-FOO options are ok). |
|
121 |
|
122 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, f2c, |
3105
|
123 [warn_f2c_and_f77="--with-f2c and --with-f77 both specified! Using f77..." |
|
124 AC_MSG_WARN($warn_f2c_and_f77) |
2813
|
125 use_f2c=false]) |
|
126 |
|
127 ### Make it possible to have Octave's array and matrix classes do bounds |
2108
|
128 ### checking on element references. This slows some operations down a |
2813
|
129 ### bit, so it is turned off by default. |
2108
|
130 |
2450
|
131 BOUNDS_CHECKING=false |
2108
|
132 AC_ARG_ENABLE(bounds-check, |
5844
|
133 [AS_HELP_STRING([--enable-bounds-check], |
|
134 [for internal array classes (default is no)])], |
3060
|
135 [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) |
2108
|
136 if $BOUNDS_CHECKING; then |
3887
|
137 AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) |
2108
|
138 fi |
|
139 |
5275
|
140 ### If possible, use a 64-bit integer type for array dimensions and indexing. |
|
141 |
|
142 USE_64_BIT_IDX_T=false |
|
143 OCTAVE_IDX_TYPE=int |
|
144 AC_ARG_ENABLE(64, |
5844
|
145 [AS_HELP_STRING([--enable-64], |
|
146 [use 64-bit integer for array dimensions and indexing])], |
5275
|
147 [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) |
|
148 if $USE_64_BIT_IDX_T; then |
|
149 AC_CHECK_SIZEOF(void *) |
|
150 AC_CHECK_SIZEOF(int) |
|
151 AC_CHECK_SIZEOF(long) |
|
152 if test $ac_cv_sizeof_void_p -eq 8; then |
|
153 if test $ac_cv_sizeof_int -eq 8; then |
|
154 OCTAVE_IDX_TYPE=int |
|
155 elif test $ac_cv_sizeof_long -eq 8; then |
|
156 OCTAVE_IDX_TYPE=long |
5351
|
157 AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long]) |
5275
|
158 else |
|
159 AC_MSG_WARN([no suitable type found for octave_idx_type so disabling 64-bit features]) |
|
160 USE_64_BIT_IDX_T=false |
|
161 fi |
|
162 else |
|
163 warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features" |
|
164 AC_MSG_WARN($warn_64_bit) |
|
165 USE_64_BIT_IDX_T=false |
|
166 fi |
|
167 fi |
|
168 AC_SUBST(OCTAVE_IDX_TYPE) |
|
169 if $USE_64_BIT_IDX_T; then |
|
170 AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define if using 64-bit integers for array dimensions and indexing]) |
|
171 fi |
|
172 AC_SUBST(USE_64_BIT_IDX_T) |
|
173 |
3215
|
174 ### It seems that there are some broken inline assembly functions in |
|
175 ### the GNU libc. Since I'm not sure how to test whether we are using |
|
176 ### GNU libc, just disable them for all platforms. |
|
177 |
5844
|
178 AC_MSG_NOTICE([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) |
3887
|
179 AC_DEFINE(__NO_MATH_INLINES, 1, [Define if your version of GNU libc has buggy inline assembly code for math functions like exp.]) |
3215
|
180 |
869
|
181 ### See which C++ compiler to use (we expect to find g++). |
|
182 |
405
|
183 AC_PROG_CXX |
|
184 AC_PROG_CXXCPP |
869
|
185 |
|
186 ### Do special things for g++. |
|
187 |
2353
|
188 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ |
4368
|
189 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` |
3107
|
190 |
405
|
191 case "$gxx_version" in |
4368
|
192 1.* | 2.[[012345678]].*) |
4843
|
193 AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave] |
|
194 ) |
|
195 ;; |
|
196 2.9*) |
|
197 warn_gxx_version="g++ version $gxx_version is likely to cause problems" |
|
198 AC_MSG_WARN($warn_gxx_version) |
3775
|
199 ;; |
405
|
200 esac |
869
|
201 |
1894
|
202 CXX_VERSION= |
|
203 if test -n "$gxx_version"; then |
|
204 CXX_VERSION="$gxx_version" |
|
205 fi |
|
206 AC_SUBST(CXX_VERSION) |
|
207 |
3107
|
208 OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
3769
|
209 OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
5854
|
210 OCTAVE_CXX_BROKEN_REINTERPRET_CAST |
3107
|
211 |
3842
|
212 # Determine the ABI used the C++ compiler, needed by the dynamic loading |
|
213 # code. Currently supported ABIs are GNU v2, GNU v3 and Sun Workshop. |
|
214 |
|
215 OCTAVE_CXX_ABI |
|
216 |
869
|
217 ### See which C compiler to use (we expect to find gcc). |
|
218 |
5
|
219 AC_PROG_CC |
405
|
220 AC_PROG_CPP |
832
|
221 AC_PROG_GCC_TRADITIONAL |
869
|
222 |
|
223 ### Do special things for gcc. |
|
224 |
2353
|
225 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ |
3107
|
226 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` |
405
|
227 case "$gcc_version" in |
|
228 2.*) |
1087
|
229 if test -z "$LDFLAGS"; then |
|
230 LDFLAGS="-g" |
5844
|
231 AC_MSG_NOTICE([defining LDFLAGS to be $LDFLAGS]) |
1087
|
232 fi |
405
|
233 ;; |
|
234 1.*) |
3105
|
235 warn_gcc_version="gcc version $gcc_version is likely to cause problems" |
|
236 AC_MSG_WARN($warn_gcc_version) |
405
|
237 ;; |
5
|
238 esac |
869
|
239 |
1894
|
240 CC_VERSION= |
|
241 if test -n "$gcc_version"; then |
|
242 CC_VERSION="$gcc_version" |
|
243 fi |
|
244 AC_SUBST(CC_VERSION) |
|
245 |
3775
|
246 ### The flag to create dependency varies depending on the compier. |
|
247 |
|
248 # Assume GCC. |
|
249 DEPEND_FLAGS="-M" |
|
250 DEPEND_EXTRA_SED_PATTERN="" |
|
251 case "$canonical_host_type" in |
|
252 sparc-sun-solaris2* | i386-pc-solaris2*) |
3820
|
253 if test "$GCC" = yes; then |
3775
|
254 true |
|
255 else |
|
256 DEPEND_FLAGS="-xM1" |
|
257 DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'" |
|
258 fi |
|
259 ;; |
|
260 esac |
|
261 AC_SUBST(DEPEND_FLAGS) |
|
262 AC_SUBST(DEPEND_EXTRA_SED_PATTERN) |
|
263 |
5076
|
264 ### On Intel systems with gcc, we may need to compile with -mieee-fp |
|
265 ### and -ffloat-store to get full support for IEEE floating point. |
2020
|
266 ### |
3126
|
267 ### On Alpha/OSF systems, we need -mieee. |
869
|
268 |
3126
|
269 ieee_fp_flag= |
350
|
270 case "$canonical_host_type" in |
3887
|
271 i[[3456789]]86-*-*) |
5076
|
272 if test "$GCC" = yes; then |
|
273 OCTAVE_CC_FLAG(-mieee-fp, [ |
|
274 ieee_fp_flag=-mieee-fp |
|
275 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" |
5844
|
276 AC_MSG_NOTICE([adding -mieee-fp to XTRA_CFLAGS])]) |
3126
|
277 |
5078
|
278 ### OCTAVE_CC_FLAG(-ffloat-store, [ |
|
279 ### float_store_flag=-ffloat-store |
|
280 ### XTRA_CFLAGS="$XTRA_CFLAGS -ffloat-store" |
|
281 ### AC_MSG_RESULT([adding -ffloat-store to XTRA_CFLAGS])]) |
5076
|
282 fi |
|
283 if test "$GXX" = yes; then |
|
284 OCTAVE_CXX_FLAG(-mieee-fp, [ |
|
285 ieee_fp_flag=-mieee-fp |
|
286 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" |
5844
|
287 AC_MSG_NOTICE([adding -mieee-fp to XTRA_CXXFLAGS])]) |
5076
|
288 |
5078
|
289 ### OCTAVE_CXX_FLAG(-ffloat-store, [ |
|
290 ### float_store_flag=-ffloat-store |
|
291 ### XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ffloat-store" |
|
292 ### AC_MSG_RESULT([adding -ffloat-store to XTRA_CXXFLAGS])]) |
5076
|
293 fi |
324
|
294 ;; |
3127
|
295 alpha*-*-*) |
4284
|
296 if test "$GCC" = yes; then |
4812
|
297 OCTAVE_CC_FLAG(-mieee, [ |
|
298 ieee_fp_flag=-mieee |
|
299 XTRA_CFLAGS="$XTRA_CFLAGS -mieee" |
5844
|
300 AC_MSG_NOTICE([adding -mieee to XTRA_CFLAGS])]) |
5076
|
301 else |
|
302 OCTAVE_CC_FLAG(-ieee, [ |
|
303 ieee_fp_flag=-ieee |
|
304 XTRA_CFLAGS="$XTRA_CFLAGS -ieee" |
5844
|
305 AC_MSG_NOTICE([adding -ieee to XTRA_CFLAGS])]) |
5076
|
306 fi |
|
307 if test "$GXX" = yes; then |
4812
|
308 OCTAVE_CXX_FLAG(-mieee, [ |
|
309 ieee_fp_flag=-mieee |
|
310 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee" |
5844
|
311 AC_MSG_NOTICE([adding -mieee to XTRA_CXXFLAGS])]) |
4284
|
312 else |
|
313 OCTAVE_CXX_FLAG(-ieee, [ |
|
314 ieee_fp_flag=-ieee |
|
315 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ieee" |
5844
|
316 AC_MSG_NOTICE([adding -ieee to XTRA_CXXFLAGS])]) |
4284
|
317 fi |
2020
|
318 ;; |
3176
|
319 *ibm-aix4*) |
3351
|
320 OCTAVE_CC_FLAG(-mminimal-toc, [ |
|
321 XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) |
3176
|
322 |
3351
|
323 OCTAVE_CXX_FLAG(-mminimal-toc, [ |
|
324 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) |
3176
|
325 ;; |
324
|
326 esac |
3126
|
327 |
|
328 AC_SUBST(XTRA_CFLAGS) |
|
329 AC_SUBST(XTRA_CXXFLAGS) |
869
|
330 |
1667
|
331 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
332 |
|
333 case "$canonical_host_type" in |
3127
|
334 alpha*-dec-osf1.3) |
1667
|
335 LD_STATIC_FLAG=-static |
|
336 ;; |
|
337 esac |
1679
|
338 if test -n "$LD_STATIC_FLAG"; then |
5844
|
339 AC_MSG_NOTICE([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
1679
|
340 fi |
|
341 AC_SUBST(LD_STATIC_FLAG) |
1667
|
342 |
3222
|
343 OCTAVE_CXX_PREPENDS_UNDERSCORE |
4094
|
344 |
|
345 ### Defaults for cross compiling. BUILD_CC and BUILD_CXX are |
|
346 ### the compilers that we use for building tools on the build system. |
4098
|
347 ### For now, we assume that the only cross compiling we can do is |
4298
|
348 ### with gcc on a Unixy system, but the dedicated hacker can override these. |
4094
|
349 |
|
350 if test "$cross_compiling" = yes; then |
|
351 BUILD_CC="gcc" |
|
352 BUILD_CFLAGS="-O2 -g" |
|
353 BUILD_CXX="g++" |
|
354 BUILD_CXXFLAGS="-O2 -g" |
4298
|
355 BUILD_LDFLAGS="" |
4098
|
356 BUILD_EXEEXT="" |
4094
|
357 else |
4298
|
358 BUILD_CC='$(CC)' |
|
359 BUILD_CFLAGS='$(CFLAGS)' |
|
360 BUILD_CXX='$(CXX)' |
|
361 BUILD_CXXFLAGS='$(CXXFLAGS)' |
|
362 BUILD_LDFLAGS='$(LDFLAGS)' |
4284
|
363 case "$canonical_host_type" in |
|
364 sparc-sun-solaris2*) |
|
365 if test "$GCC" != yes; then |
4298
|
366 ## The Sun C++ compiler never seems to complete compiling |
|
367 ## gendoc.cc unless we reduce the optimization level... |
|
368 BUILD_CXXFLAGS="-g -O1" |
4284
|
369 fi |
|
370 ;; |
|
371 esac |
4298
|
372 BUILD_EXEEXT='$(EXEEXT)' |
4094
|
373 fi |
|
374 |
|
375 AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) |
|
376 AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) |
|
377 AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) |
|
378 AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) |
4298
|
379 AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) |
|
380 AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) |
3222
|
381 |
3232
|
382 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
383 |
|
384 ### Look for math library. If found, this will add -lm to LIBS. |
|
385 |
|
386 case "$canonical_host_type" in |
|
387 *-*-nextstep*) |
|
388 ;; |
|
389 *-*-linux*) |
|
390 AC_CHECK_LIB(m, sin, , , -lc) |
|
391 ;; |
|
392 *) |
|
393 AC_CHECK_LIB(m, sin) |
|
394 ;; |
|
395 esac |
|
396 |
5585
|
397 ### Check for pcre/regex library. |
|
398 AC_SUBST(REGEX_LIBS) |
|
399 WITH_PCRE_CONFIG=no |
|
400 AC_CHECK_HEADER(pcre.h, WITH_PCRE=yes, WITH_PCRE=no) |
|
401 if test $WITH_PCRE = no ; then |
|
402 AC_CHECK_PROG(WITH_PCRE_CONFIG, pcre-config, yes, no) |
|
403 if test $WITH_PCRE_CONFIG = yes ; then |
|
404 WITH_PCRE=yes |
|
405 fi |
|
406 fi |
|
407 if test $WITH_PCRE = yes ; then |
|
408 AC_CHECK_LIB(pcre, pcre_compile, WITH_PCRE=yes, WITH_PCRE=no) |
|
409 if test $WITH_PCRE = yes ; then |
|
410 AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.]) |
|
411 if test $WITH_PCRE_CONFIG = yes ; then |
|
412 REGEX_LIBS=`pcre-config --cflags --libs` |
|
413 else |
|
414 REGEX_LIBS="-lpcre" |
|
415 fi |
|
416 fi |
|
417 fi |
|
418 AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [ |
|
419 AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)]) |
|
420 if test $WITH_REGEX = yes ; then |
|
421 AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.]) |
5600
|
422 if test $WITH_PCRE = no ; then |
5585
|
423 AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [ |
|
424 AC_CHECK_LIB(regex, regexec, REGEX_LIBS="-lregex")]) |
|
425 fi |
|
426 fi |
|
427 |
5270
|
428 ### Check for ZLIB library. |
3820
|
429 |
5270
|
430 WITH_ZLIB=true |
|
431 AC_ARG_WITH(zlib, |
5844
|
432 [AS_HELP_STRING([--without-zlib], [don't use zlib])], |
5270
|
433 with_zlib=$withval, with_zlib=yes) |
3820
|
434 |
5270
|
435 zlib_lib= |
|
436 if test "$with_zlib" = yes; then |
|
437 zlib_lib="z" |
|
438 elif test "$with_zlib" != no; then |
|
439 zlib_lib="$with_zlib" |
3687
|
440 fi |
|
441 |
5270
|
442 ZLIB_LIBS= |
|
443 WITH_ZLIB=false |
|
444 if test -n "$zlib_lib"; then |
5337
|
445 AC_CHECK_LIB($zlib_lib, gzclearerr, [ |
5270
|
446 AC_CHECK_HEADERS(zlib.h, [ |
|
447 WITH_ZLIB=true |
|
448 ZLIB_LIBS="-l$zlib_lib" |
|
449 LIBS="$ZLIB_LIBS $LIBS" |
|
450 AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available.])])]) |
|
451 fi |
|
452 |
|
453 if $WITH_ZLIB; then |
|
454 ### Check for HDF5 library. |
|
455 |
|
456 WITH_HDF5=true |
|
457 AC_ARG_WITH(hdf5, |
5844
|
458 [AS_HELP_STRING([--without-hdf5], [don't use HDF5])], |
5270
|
459 with_hdf5=$withval, with_hdf5=yes) |
|
460 |
|
461 hdf5_lib= |
|
462 if test "$with_hdf5" = yes; then |
|
463 hdf5_lib="hdf5" |
|
464 elif test "$with_hdf5" != no; then |
|
465 hdf5_lib="$with_hdf5" |
|
466 fi |
|
467 |
|
468 HDF5_LIBS= |
|
469 WITH_HDF5=false |
|
470 if test -n "$hdf5_lib"; then |
|
471 AC_CHECK_LIB($hdf5_lib, H5Pcreate, [ |
3820
|
472 AC_CHECK_HEADERS(hdf5.h, [ |
5270
|
473 WITH_HDF5=true |
|
474 HDF5_LIBS="-l$hdf5_lib" |
3820
|
475 LIBS="$HDF5_LIBS $LIBS" |
4696
|
476 AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) |
|
477 AC_CHECK_LIB($hdf5_lib, H5Gget_num_objs, [ |
5270
|
478 AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.])])])]) |
|
479 fi |
|
480 |
|
481 if $WITH_HDF5; then |
|
482 true |
|
483 else |
|
484 warn_hdf5="HDF5 library not found. Octave will not be able to save or load HDF5 data files." |
|
485 fi |
|
486 else |
|
487 warn_zlib="ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files." |
3820
|
488 fi |
3687
|
489 |
5203
|
490 |
3827
|
491 # Checks for FFTW header and library. |
|
492 |
|
493 # subdirectories of libcruft to build if they aren't found on the system: |
|
494 FFT_DIR="fftpack" |
|
495 AC_SUBST(FFT_DIR) |
|
496 |
|
497 # Installed fftw library, if any. |
|
498 FFTW_LIBS='' |
|
499 AC_SUBST(FFTW_LIBS) |
|
500 |
|
501 AC_ARG_WITH(fftw, |
5844
|
502 [AS_HELP_STRING([--without-fftw], |
|
503 [use included fftpack instead of installed fftw])], |
3886
|
504 with_fftw=$withval, with_fftw=yes) |
3827
|
505 |
5513
|
506 if test "$with_fftw" = yes; then |
4773
|
507 have_fftw3_header=no |
|
508 with_fftw3=no |
|
509 AC_CHECK_HEADER(fftw3.h, [have_fftw3_header=yes; break]) |
|
510 if test "$have_fftw3_header" = yes; then |
5203
|
511 AC_CHECK_LIB(fftw3, fftw_plan_dft_1d, [FFTW_LIBS="-lfftw3"; with_fftw3=yes]) |
3827
|
512 fi |
|
513 fi |
|
514 |
4773
|
515 if test "$with_fftw" = yes && test "$with_fftw3" = yes; then |
3827
|
516 FFT_DIR='' |
4773
|
517 AC_DEFINE(HAVE_FFTW3, 1, [Define if the FFTW3 library is used.]) |
3827
|
518 fi |
|
519 |
5235
|
520 # Checks for GLPK header and library. |
|
521 |
|
522 AC_ARG_WITH(glpk, |
5844
|
523 [AS_HELP_STRING([--without-glpk], [don't use GLPK])], |
5235
|
524 with_glpk=$withval, with_glpk=yes) |
|
525 |
|
526 glpk_lib= |
|
527 if test "$with_glpk" = yes; then |
|
528 glpk_lib="glpk" |
|
529 elif test "$with_glpk" != no; then |
|
530 glpk_lib="$with_glpk" |
|
531 fi |
|
532 |
|
533 GLPK_LIBS= |
|
534 if test -n "$glpk_lib"; then |
|
535 AC_CHECK_LIB($glpk_lib, glp_lpx_simplex, [ |
|
536 AC_CHECK_HEADERS(glpk.h, [ |
|
537 GLPK_LIBS="-l$glpk_lib" |
|
538 AC_DEFINE(HAVE_GLPK, 1, [Define if GLPK is available.])])]) |
|
539 fi |
|
540 AC_SUBST(GLPK_LIBS) |
|
541 |
4853
|
542 OCTAVE_IEEE754_DATA_FORMAT |
4850
|
543 |
3827
|
544 # ---------------------------------------------------------------------- |
|
545 |
3012
|
546 ### We need these before trying to find libf2c. |
|
547 |
3130
|
548 OCTAVE_PROG_AR |
3012
|
549 |
|
550 AC_PROG_RANLIB |
|
551 |
2813
|
552 ### If we haven't been forced to use a particular Fortran compiler, |
|
553 ### try to find one using any one of several common Un*x Fortran |
3887
|
554 ### compiler names using the AC_PROG_F77 macro. |
1239
|
555 ### |
4816
|
556 ### The configure options --with-f77 or --with-f2c |
|
557 ### force f77 or f2c to be used. It is also possible to use |
2813
|
558 ### these options to specify the name of the compiler. For example, |
4816
|
559 ### `--with-f77=g77' says that we are using g77 as the Fortran compiler. |
1233
|
560 |
2813
|
561 if $use_f77; then |
3008
|
562 if test "$with_f77" = yes; then |
2813
|
563 F77=f77 |
|
564 else |
|
565 F77="$with_f77" |
|
566 fi |
5844
|
567 AC_MSG_NOTICE([defining F77 to be $F77]) |
1233
|
568 elif $use_f2c; then |
|
569 F77= |
2336
|
570 if test "$with_f2c" = yes; then |
1317
|
571 F2C=f2c |
1239
|
572 else |
|
573 F2C="$with_f2c" |
|
574 fi |
5844
|
575 AC_MSG_NOTICE([defining F2C to be $F2C]) |
1233
|
576 fi |
5
|
577 |
3887
|
578 if test "x$FFLAGS" = x; then |
|
579 FFLAGS="-O" # override -g -O default by AC_PROG_F77 |
|
580 fi |
|
581 |
|
582 # the F77 variable, if set, overrides AC_PROG_F77 automatically |
|
583 AC_PROG_F77 |
|
584 |
1239
|
585 have_fortran_compiler=false |
|
586 have_f2c=false |
5
|
587 |
2813
|
588 if $use_f2c; then |
1239
|
589 have_f2c=true |
|
590 else |
|
591 if test -n "$F77"; then |
3887
|
592 AC_F77_LIBRARY_LDFLAGS |
|
593 AC_F77_DUMMY_MAIN |
|
594 AC_F77_WRAPPERS |
|
595 case "$canonical_host_type" in |
5076
|
596 i[[3456789]]86-*-*) |
|
597 if test "$ac_cv_f77_compiler_gnu" = yes; then |
|
598 OCTAVE_F77_FLAG(-mieee-fp) |
5078
|
599 ### OCTAVE_F77_FLAG(-ffloat-store) |
5076
|
600 fi |
|
601 ;; |
3887
|
602 alpha*-*-*) |
|
603 if test "$ac_cv_f77_compiler_gnu" = yes; then |
5076
|
604 OCTAVE_F77_FLAG(-mieee) |
3887
|
605 else |
5076
|
606 OCTAVE_F77_FLAG(-ieee) |
|
607 OCTAVE_F77_FLAG(-fpe1) |
3887
|
608 fi |
|
609 ;; |
|
610 powerpc-apple-machten*) |
|
611 FFLAGS= |
|
612 ;; |
|
613 esac |
|
614 if test -n "$FFLAGS"; then |
5844
|
615 AC_MSG_NOTICE([defining FFLAGS to be $FFLAGS]) |
1239
|
616 fi |
|
617 have_fortran_compiler=true |
1233
|
618 else |
1239
|
619 AC_CHECK_PROG(F2C, f2c, f2c, []) |
3897
|
620 AC_ARG_VAR(F2C, [Fortran to C translator command]) |
|
621 AC_ARG_VAR(F2CFLAGS, [Fortran to C translator flags]) |
1239
|
622 if test -n "$F2C"; then |
|
623 have_f2c=true |
5
|
624 fi |
|
625 fi |
|
626 fi |
869
|
627 |
2762
|
628 f77_rules_frag=/dev/null |
1239
|
629 if $have_fortran_compiler; then |
2762
|
630 f77_rules_frag=Makefrag.f77 |
1679
|
631 cat << \EOF > $f77_rules_frag |
1668
|
632 |
1753
|
633 %.c : %.f |
1668
|
634 |
1791
|
635 %.o : %.f |
3615
|
636 $(FC) -c $(ALL_FFLAGS) -o $@ $< |
1668
|
637 |
1984
|
638 pic/%.o : %.f |
|
639 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
640 |
1668
|
641 EOF |
1239
|
642 elif $have_f2c; then |
3887
|
643 AC_DEFINE(HAVE_F2C, 1, [Define if we are using f2c.]) |
2562
|
644 |
5775
|
645 ### FIXME -- these shouldn't be fixed names, eh? |
2562
|
646 |
|
647 oct_conflib=libconflib.a |
|
648 oct_obj_ext=o |
|
649 |
4417
|
650 CONFLIB_ARG= |
2562
|
651 if AC_TRY_EVAL(ac_compile); then |
3887
|
652 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AS_MESSAGE_LOG_FD() |
2562
|
653 if test -n "$RANLIB"; then |
3887
|
654 $RANLIB $oct_conflib 1>&AS_MESSAGE_LOG_FD() |
5
|
655 fi |
4417
|
656 CONFLIB_ARG="-L. -lconflib" |
5
|
657 fi |
2562
|
658 rm -f conftest* |
4417
|
659 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, $CONFLIB_ARG) |
2562
|
660 rm -f $oct_conflib |
|
661 |
|
662 if test -z "$FLIBS"; then |
3232
|
663 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=) |
2562
|
664 if test -n "$FLIBS"; then |
|
665 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
666 fi |
|
667 fi |
|
668 |
1462
|
669 if test -z "$FLIBS"; then |
3105
|
670 warn_f2c_no_lib="I found f2c but not libf2c.a, or libF77.a and libI77.a" |
|
671 AC_MSG_WARN($warn_f2c_no_lib) |
5
|
672 fi |
2633
|
673 f77_rules_frag=Makefrag.f77 |
1679
|
674 cat << \EOF > $f77_rules_frag |
1668
|
675 |
1824
|
676 %.c : %.f |
3847
|
677 $(F2C) $(F2CFLAGS) < $< > $(@F) |
1668
|
678 |
1753
|
679 %.o : %.f |
1668
|
680 |
|
681 EOF |
5
|
682 else |
832
|
683 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
684 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
685 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
686 fi |
869
|
687 |
1163
|
688 FC=$F77 |
|
689 AC_SUBST(FC) |
1679
|
690 AC_SUBST_FILE(f77_rules_frag) |
869
|
691 |
5498
|
692 OCTAVE_F77_FLAG(-ffloat-store, [ |
|
693 AC_MSG_RESULT([setting F77_FLOAT_STORE_FLAG to -ffloat-store]) |
|
694 F77_FLOAT_STORE_FLAG=-ffloat-store |
|
695 AC_SUBST(F77_FLOAT_STORE_FLAG) |
|
696 ]) |
|
697 |
3820
|
698 ### Checks for BLAS and LAPACK libraries: |
3887
|
699 # (Build subdirectories of libcruft if they aren't found on the system.) |
3820
|
700 |
3887
|
701 sinclude(acx_blas.m4) |
|
702 sinclude(acx_lapack.m4) |
|
703 ACX_BLAS([], [BLAS_DIR="blas"]) |
|
704 ACX_LAPACK([BLAS_LIBS="$LAPACK_LIBS $BLAS_LIBS"], [LAPACK_DIR="lapack"]) |
3690
|
705 AC_SUBST(BLAS_DIR) |
|
706 AC_SUBST(LAPACK_DIR) |
|
707 |
5451
|
708 # Check for AMD library |
|
709 AMD_LIBS= |
|
710 AC_SUBST(AMD_LIBS) |
|
711 AC_CHECK_LIB(amd, amd_postorder, [AMD_LIBS="-lamd"; with_amd=yes],[with_amd=no]) |
|
712 |
5226
|
713 # Check for UMFPACK library. |
|
714 |
|
715 UMFPACK_LIBS= |
|
716 AC_SUBST(UMFPACK_LIBS) |
|
717 |
|
718 AC_ARG_WITH(umfpack, |
5844
|
719 [AS_HELP_STRING([--without-umfpack], |
|
720 [don't use UMFPACK, disable some sparse functionality])], |
5226
|
721 with_umfpack=$withval, with_umfpack=yes) |
|
722 |
5703
|
723 warn_umfpack="UMFPACK not found. This will result in some lack of functionality for sparse matrices." |
5513
|
724 if test "$with_umfpack" = yes && test "$with_amd" = yes; then |
5226
|
725 with_umfpack=no |
5512
|
726 AC_CHECK_HEADERS([ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], [ |
|
727 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
|
728 UMFPACK_LIBS="-lumfpack"; with_umfpack=yes], [ |
|
729 ## Invalidate the cache. |
|
730 $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant |
|
731 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
|
732 UMFPACK_LIBS="-lumfpack"; with_umfpack=yes], [ |
|
733 |
5226
|
734 ## Invalidate the cache. |
|
735 $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant |
|
736 AC_CHECK_LIB(umfpack, umfpack_zi_get_determinant, [ |
5512
|
737 UMFPACK_LIBS="-lumfpack -lcblas"; with_umfpack=yes], [], $AMD_LIBS -lcblas $BLAS_LIBS)], $AMD_LIBS $BLAS_LIBS $FLIBS)], $AMD_LIBS) |
5451
|
738 |
5226
|
739 if test "$with_umfpack" = yes; then |
5451
|
740 AC_DEFINE(HAVE_UMFPACK, 1, [Define if the UMFPACK library is used.]) |
5505
|
741 OLD_LIBS=$LIBS |
|
742 LIBS="$LIBS $UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS" |
|
743 OCTAVE_UMFPACK_SEPERATE_SPLIT |
|
744 LIBS=$OLD_LIBS |
5648
|
745 TEXINFO_UMFPACK="@set HAVE_UMFPACK" |
5513
|
746 warn_umfpack= |
5512
|
747 fi |
5513
|
748 break]) |
|
749 fi |
|
750 |
5648
|
751 AC_SUBST(TEXINFO_UMFPACK) |
5226
|
752 |
5451
|
753 COLAMD_LIBS= |
|
754 AC_SUBST(COLAMD_LIBS) |
|
755 |
|
756 AC_ARG_WITH(colamd, |
5844
|
757 [AS_HELP_STRING([--without-colamd], |
|
758 [don't use COLAMD, disable some sparse functionality])], |
5451
|
759 with_colamd=$withval, with_colamd=yes) |
|
760 |
5703
|
761 warn_colamd="COLAMD not found. This will result in some lack of functionality for sparse matrices." |
5513
|
762 if test "$with_colamd" = yes; then |
5451
|
763 with_colamd=no |
5610
|
764 AC_CHECK_HEADERS([ufsparse/colamd.h colamd/colamd.h colamd.h], [ |
5451
|
765 AC_CHECK_LIB(colamd, colamd, [COLAMD_LIBS="-lcolamd"; with_colamd=yes]) |
|
766 if test "$with_colamd" = yes; then |
|
767 AC_DEFINE(HAVE_COLAMD, 1, [Define if the COLAMD library is used.]) |
5648
|
768 TEXINFO_COLAMD="@set HAVE_COLAMD" |
5513
|
769 warn_colamd= |
5512
|
770 fi |
5513
|
771 break]) |
5451
|
772 fi |
|
773 |
5648
|
774 AC_SUBST(TEXINFO_COLAMD) |
5513
|
775 |
5451
|
776 CCOLAMD_LIBS= |
|
777 AC_SUBST(CCOLAMD_LIBS) |
|
778 |
|
779 AC_ARG_WITH(ccolamd, |
5844
|
780 [AS_HELP_STRING([--without-ccolamd], |
|
781 [don't use CCOLAMD, disable some sparse functionality])], |
5451
|
782 with_ccolamd=$withval, with_ccolamd=yes) |
|
783 |
5703
|
784 warn_ccolamd="CCOLAMD not found. This will result in some lack of functionality for sparse matrices." |
5513
|
785 if test "$with_ccolamd" = yes; then |
5451
|
786 with_ccolamd=no |
5610
|
787 AC_CHECK_HEADERS([ufsparse/ccolamd.h ccolamd/ccolamd.h ccolamd.h], [ |
5451
|
788 AC_CHECK_LIB(ccolamd, ccolamd, [CCOLAMD_LIBS="-lccolamd"; with_ccolamd=yes]) |
|
789 if test "$with_ccolamd" = yes; then |
|
790 AC_DEFINE(HAVE_CCOLAMD, 1, [Define if the CCOLAMD library is used.]) |
5513
|
791 warn_ccolamd= |
5512
|
792 fi |
5513
|
793 break]) |
5451
|
794 fi |
|
795 |
|
796 CHOLMOD_LIBS= |
|
797 AC_SUBST(CHOLMOD_LIBS) |
|
798 |
|
799 AC_ARG_WITH(cholmod, |
5844
|
800 [AS_HELP_STRING([--without-cholmod], |
|
801 [don't use CHOLMOD, disable some sparse functionality])], |
5451
|
802 with_cholmod=$withval, with_cholmod=yes) |
|
803 |
5703
|
804 warn_cholmod="CHOLMOD not found. This will result in some lack of functionality for sparse matrices." |
5513
|
805 if test "$with_cholmod" = yes && test "$with_colamd" = yes && |
|
806 test "$with_ccolamd" = yes && test "$with_amd" = yes; then |
5451
|
807 with_cholmod=no |
5610
|
808 AC_CHECK_HEADERS([ufsparse/cholmod.h cholmod/cholmod.h cholmod.h], [ |
|
809 AC_CHECK_HEADERS([ufsparse/metis.h metis/metis.h metis.h], [ |
5512
|
810 AC_CHECK_LIB(metis, METIS_NodeND, with_metis=yes, with_metis=no) |
|
811 break], |
5506
|
812 with_metis=no) |
|
813 |
|
814 if test "$with_metis" = yes; then |
|
815 AC_DEFINE(HAVE_METIS, 1, [Define if the METIS library is used.]) |
5451
|
816 AC_CHECK_LIB(cholmod, cholmod_start, [CHOLMOD_LIBS="-lcholmod -lmetis"; |
|
817 with_cholmod=yes], [ |
5610
|
818 AC_CHECK_LIB(cholmod, cholmod_start, |
5506
|
819 [CHOLMOD_LIBS="-lcholmod -cblas -lmetis"; with_cholmod=yes], [], |
5518
|
820 $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS -lmetis)], |
5506
|
821 $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS -lmetis) |
|
822 else |
|
823 AC_CHECK_LIB(cholmod, cholmod_start, [CHOLMOD_LIBS="-lcholmod"; |
|
824 with_cholmod=yes], [ |
5610
|
825 AC_CHECK_LIB(cholmod, cholmod_start, [CHOLMOD_LIBS="-lcholmod -cblas"; |
5451
|
826 with_cholmod=yes], [], |
5518
|
827 $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS)], |
5506
|
828 $AMD_LIBS $COLAMD_LIBS $CCOLAMD_LIBS $BLAS_LIBS $FLIBS) |
|
829 fi |
5451
|
830 |
|
831 if test "$with_cholmod" = yes; then |
|
832 AC_DEFINE(HAVE_CHOLMOD, 1, [Define if the CHOLMOD library is used.]) |
5648
|
833 TEXINFO_CHOLMOD="@set HAVE_CHOLMOD" |
5513
|
834 warn_cholmod= |
5512
|
835 fi |
5513
|
836 break]) |
5451
|
837 fi |
5226
|
838 |
5648
|
839 AC_SUBST(TEXINFO_CHOLMOD) |
5513
|
840 |
5610
|
841 CXSPARSE_LIBS= |
|
842 AC_SUBST(CXSPARSE_LIBS) |
|
843 |
|
844 AC_ARG_WITH(cxsparse, |
5844
|
845 [AS_HELP_STRING([--without-cxsparse], |
|
846 [don't use CXSparse, disable some sparse functionality])], |
5610
|
847 with_cxsparse=$withval, with_cxsparse=yes) |
|
848 |
5703
|
849 warn_cxsparse="CXSparse not found. This will result in some lack of functionality for sparse matrices." |
5610
|
850 if test "$with_cxsparse" = yes; then |
|
851 with_cxsparse=no |
5648
|
852 AC_CHECK_HEADERS([ufsparse/cs.h cxsparse/cs.h cs.h], [ |
|
853 AC_CHECK_LIB(cxsparse, cs_di_sqr, [CXSPARSE_LIBS="-lcxsparse"; with_cxsparse=yes]) |
5610
|
854 if test "$with_cxsparse" = yes; then |
|
855 AC_DEFINE(HAVE_CXSPARSE, 1, [Define if the CXSparse library is used.]) |
|
856 warn_cxsparse= |
|
857 fi |
|
858 break]) |
|
859 fi |
|
860 |
4110
|
861 ### Handle shared library options. |
2813
|
862 |
3034
|
863 ### Enable creation of static libraries. |
|
864 |
|
865 AC_ARG_ENABLE(static, |
5844
|
866 [AS_HELP_STRING([--enable-static], [create static libraries])], |
3034
|
867 [if test "$enableval" = no; then STATIC_LIBS=false; |
|
868 else STATIC_LIBS=true; fi], |
5221
|
869 STATIC_LIBS=false) |
3034
|
870 AC_SUBST(STATIC_LIBS) |
|
871 |
2813
|
872 ### Enable creation of shared libraries. Currently only works with |
|
873 ### gcc on some systems. |
|
874 |
|
875 AC_ARG_ENABLE(shared, |
5844
|
876 [AS_HELP_STRING([--enable-shared], |
|
877 [create shared libraries (not all systems)])], |
2813
|
878 [if test "$enableval" = no; then SHARED_LIBS=false; |
|
879 else SHARED_LIBS=true; fi], |
5221
|
880 SHARED_LIBS=true) |
2813
|
881 AC_SUBST(SHARED_LIBS) |
|
882 |
4128
|
883 ### Enable dynamic linking. --enable-shared implies this, so |
|
884 ### --enable-dl is only need if you are only building static libraries |
|
885 ### and want to try dynamic linking too (works on some systems, for |
|
886 ### example, OS X and Windows). |
|
887 |
|
888 AC_ARG_ENABLE(dl, |
5844
|
889 [AS_HELP_STRING([--enable-dl], |
|
890 [create shared libraries (not all systems)])], |
4128
|
891 [if test "$enableval" = no; then ENABLE_DYNAMIC_LINKING=false; |
|
892 else ENABLE_DYNAMIC_LINKING=true; fi], |
5221
|
893 ENABLE_DYNAMIC_LINKING=true) |
4128
|
894 |
3034
|
895 if $STATIC_LIBS || $SHARED_LIBS; then |
|
896 true |
|
897 else |
|
898 AC_MSG_ERROR([You can't disable building static AND shared libraries!]) |
|
899 fi |
|
900 |
2813
|
901 AC_ARG_ENABLE(rpath, |
5844
|
902 [AS_HELP_STRING([--enable-rpath], |
|
903 [override the default link options for rpath; e.g., --enable-rpath='-rpath $(octlibdir)'])], |
4353
|
904 [ if test "$enableval" = no; then use_rpath=false; |
|
905 else |
|
906 use_rpath=true |
|
907 if test "$enableval" = yes; then true; |
|
908 else enable_rpath_arg="$enableval"; fi |
4439
|
909 fi], [use_rpath=true]) |
2813
|
910 |
|
911 DLFCN_DIR= |
|
912 CPICFLAG=-fPIC |
|
913 CXXPICFLAG=-fPIC |
|
914 FPICFLAG=-fPIC |
|
915 SHLEXT=so |
4190
|
916 SHLLIB='$(SHLEXT)' |
4102
|
917 SHLBIN= |
4138
|
918 SHLEXT_VER='$(SHLEXT).$(version)' |
|
919 SHLLIB_VER='$(SHLLIB).$(version)' |
|
920 SHLBIN_VER='$(SHLBIN).$(version)' |
4126
|
921 SHLLINKEXT= |
4323
|
922 SH_LD='$(CXX)' |
2813
|
923 SH_LDFLAGS=-shared |
4759
|
924 DL_LD='$(SH_LD)' |
|
925 DL_LDFLAGS='$(SH_LDFLAGS)' |
|
926 MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)' |
3036
|
927 SONAME_FLAGS= |
2813
|
928 RLD_FLAG= |
4199
|
929 NO_OCT_FILE_STRIP=false |
4323
|
930 TEMPLATE_AR='$(AR)' |
3775
|
931 TEMPLATE_ARFLAGS="$ARFLAGS" |
4104
|
932 library_path_var=LD_LIBRARY_PATH |
2813
|
933 case "$canonical_host_type" in |
4323
|
934 *-*-386bsd* | *-*-openbsd* | *-*-netbsd*) |
2813
|
935 SH_LD=ld |
|
936 SH_LDFLAGS=-Bshareable |
|
937 ;; |
4323
|
938 *-*-freebsd*) |
|
939 SH_LD='$(CC)' |
5508
|
940 SH_LDFLAGS="-shared -Wl,-x" |
|
941 RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' |
4323
|
942 ;; |
3127
|
943 alpha*-dec-osf*) |
2813
|
944 CPICFLAG= |
|
945 CXXPICFLAG= |
|
946 FPICFLAG= |
4283
|
947 SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'" |
|
948 RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' |
2813
|
949 ;; |
3956
|
950 *-*-darwin*) |
4759
|
951 DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)' |
|
952 MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $(bindir)/octave-$(version)$(EXEEXT)' |
|
953 SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' |
4157
|
954 CXXPICFLAG= |
|
955 CPICFLAG= |
|
956 FPICFLAG= |
4759
|
957 SHLEXT=dylib |
|
958 SHLLIB='$(SHLEXT)' |
|
959 SHLEXT_VER='$(version).$(SHLEXT)' |
|
960 SHLLIB_VER='$(version).$(SHLLIB)' |
4199
|
961 NO_OCT_FILE_STRIP=true |
4786
|
962 SONAME_FLAGS='-install_name $(octlibdir)/$@' |
4759
|
963 library_path_var=DYLD_LIBRARY_PATH |
3956
|
964 ;; |
4105
|
965 *-*-cygwin* | *-*-mingw*) |
5451
|
966 DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" |
4102
|
967 CXXPICFLAG= |
|
968 CPICFLAG= |
|
969 FPICFLAG= |
|
970 SHLEXT=dll |
|
971 SHLLIB=dll.a |
|
972 SHLBIN=dll |
5414
|
973 SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" |
4102
|
974 SHLLINKEXT=.dll |
|
975 SONAME_FLAGS='-Wl,--out-implib=$@.a' |
4104
|
976 library_path_var=PATH |
4102
|
977 ;; |
3740
|
978 *-*-linux* | *-*-gnu*) |
4906
|
979 MKOCTFILE_DL_LDFLAGS="-shared -Wl,-Bsymbolic" |
4283
|
980 SONAME_FLAGS='-Wl,-soname -Wl,$@' |
|
981 RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' |
2813
|
982 ;; |
3887
|
983 i[[3456]]86-*-sco3.2v5*) |
4283
|
984 SONAME_FLAGS='-Wl,-h -Wl,$@' |
3705
|
985 RLD_FLAG= |
3160
|
986 SH_LDFLAGS=-G |
|
987 ;; |
2813
|
988 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
989 CPICFLAG= |
|
990 CXXPICFLAG= |
|
991 FPICFLAG= |
|
992 DLFCN_DIR=dlfcn |
|
993 ;; |
|
994 hppa*-hp-hpux*) |
3887
|
995 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
996 FPICFLAG=-fPIC |
|
997 else |
|
998 FPICFLAG=+Z |
|
999 fi |
|
1000 SHLEXT=sl |
|
1001 SH_LDFLAGS="-shared -fPIC" |
4283
|
1002 RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' |
2813
|
1003 ;; |
|
1004 *-sgi-*) |
|
1005 CPICFLAG= |
|
1006 CXXPICFLAG= |
|
1007 FPICFLAG= |
4353
|
1008 RLD_FLAG='-rpath $(octlibdir)' |
2813
|
1009 ;; |
|
1010 sparc-sun-sunos4*) |
3887
|
1011 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
1012 FPICFLAG=-fPIC |
|
1013 else |
|
1014 FPICFLAG=-PIC |
|
1015 fi |
3059
|
1016 SH_LD=ld |
|
1017 SH_LDFLAGS="-assert nodefinitions" |
3162
|
1018 RLD_FLAG='-L$(octlibdir)' |
2813
|
1019 ;; |
3606
|
1020 sparc-sun-solaris2* | i386-pc-solaris2*) |
3887
|
1021 if test "$ac_cv_f77_compiler_gnu" = yes; then |
2813
|
1022 FPICFLAG=-fPIC |
|
1023 else |
3775
|
1024 FPICFLAG=-KPIC |
|
1025 fi |
|
1026 if test "$GCC" = yes; then |
|
1027 CPICFLAG=-fPIC |
|
1028 else |
|
1029 CPICFLAG=-KPIC |
2813
|
1030 fi |
3775
|
1031 if test "$GXX" = yes; then |
|
1032 CXXPICFLAG=-fPIC |
|
1033 SH_LDFLAGS=-shared |
|
1034 else |
|
1035 CXXPICFLAG=-KPIC |
|
1036 SH_LDFLAGS=-G |
|
1037 fi |
|
1038 RLD_FLAG='-R $(octlibdir)' |
|
1039 # Template closures in archive libraries need a different mechanism. |
3820
|
1040 if test "$GXX" = yes; then |
3775
|
1041 true |
|
1042 else |
4323
|
1043 TEMPLATE_AR='$(CXX)' |
3775
|
1044 TEMPLATE_ARFLAGS="-xar -o" |
|
1045 fi |
2813
|
1046 ;; |
|
1047 esac |
|
1048 |
|
1049 if $use_rpath; then |
4353
|
1050 if test -n "$enable_rpath_arg"; then |
|
1051 RLD_FLAG="$enable_rpath_arg" |
|
1052 fi |
2813
|
1053 else |
4353
|
1054 RLD_FLAG="" |
2813
|
1055 fi |
|
1056 |
5844
|
1057 AC_MSG_NOTICE([defining FPICFLAG to be $FPICFLAG]) |
|
1058 AC_MSG_NOTICE([defining CPICFLAG to be $CPICFLAG]) |
|
1059 AC_MSG_NOTICE([defining CXXPICFLAG to be $CXXPICFLAG]) |
|
1060 AC_MSG_NOTICE([defining SHLEXT to be $SHLEXT]) |
|
1061 AC_MSG_NOTICE([defining SHLLIB to be $SHLLIB]) |
|
1062 AC_MSG_NOTICE([defining SHLBIN to be $SHLBIN]) |
|
1063 AC_MSG_NOTICE([defining SHLEXT_VER to be $SHLEXT_VER]) |
|
1064 AC_MSG_NOTICE([defining SHLLIB_VER to be $SHLLIB_VER]) |
|
1065 AC_MSG_NOTICE([defining SHLBIN_VER to be $SHLBIN_VER]) |
|
1066 AC_MSG_NOTICE([defining SHLLINKEXT to be $SHLLINKEXT]) |
|
1067 AC_MSG_NOTICE([defining DLFCN_DIR to be $DLFCN_DIR]) |
|
1068 AC_MSG_NOTICE([defining SH_LD to be $SH_LD]) |
|
1069 AC_MSG_NOTICE([defining SH_LDFLAGS to be $SH_LDFLAGS]) |
|
1070 AC_MSG_NOTICE([defining DL_LD to be $DL_LD]) |
|
1071 AC_MSG_NOTICE([defining DL_LDFLAGS to be $DL_LDFLAGS]) |