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