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