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