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