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