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