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