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 |
4378
|
25 AC_REVISION($Revision: 1.424 $) |
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 |
2813
|
139 ### Make it possible to have Octave's array and matrix classes do bounds |
2108
|
140 ### checking on element references. This slows some operations down a |
2813
|
141 ### bit, so it is turned off by default. |
2108
|
142 |
2450
|
143 BOUNDS_CHECKING=false |
2108
|
144 AC_ARG_ENABLE(bounds-check, |
3060
|
145 [ --enable-bounds-check for internal array classes (default is no)], |
|
146 [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) |
2108
|
147 if $BOUNDS_CHECKING; then |
3887
|
148 AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) |
2108
|
149 fi |
|
150 |
3215
|
151 ### It seems that there are some broken inline assembly functions in |
|
152 ### the GNU libc. Since I'm not sure how to test whether we are using |
|
153 ### GNU libc, just disable them for all platforms. |
|
154 |
|
155 AC_MSG_RESULT([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) |
3887
|
156 AC_DEFINE(__NO_MATH_INLINES, 1, [Define if your version of GNU libc has buggy inline assembly code for math functions like exp.]) |
3215
|
157 |
869
|
158 ### See which C++ compiler to use (we expect to find g++). |
|
159 |
1334
|
160 EXTERN_CXXFLAGS="$CXXFLAGS" |
|
161 |
405
|
162 AC_PROG_CXX |
|
163 AC_PROG_CXXCPP |
869
|
164 |
|
165 ### Do special things for g++. |
|
166 |
2353
|
167 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ |
4368
|
168 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` |
3107
|
169 |
405
|
170 case "$gxx_version" in |
4368
|
171 1.* | 2.[[012345678]].*) |
4264
|
172 AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave]) |
3775
|
173 ;; |
405
|
174 esac |
869
|
175 |
1894
|
176 CXX_VERSION= |
|
177 if test -n "$gxx_version"; then |
|
178 CXX_VERSION="$gxx_version" |
|
179 fi |
|
180 AC_SUBST(CXX_VERSION) |
|
181 |
3107
|
182 OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL |
3769
|
183 OCTAVE_CXX_ISO_COMPLIANT_LIBRARY |
3107
|
184 |
3842
|
185 # Determine the ABI used the C++ compiler, needed by the dynamic loading |
|
186 # code. Currently supported ABIs are GNU v2, GNU v3 and Sun Workshop. |
|
187 |
|
188 OCTAVE_CXX_ABI |
|
189 |
869
|
190 ### See which C compiler to use (we expect to find gcc). |
|
191 |
1334
|
192 EXTERN_CFLAGS="$CFLAGS" |
|
193 |
5
|
194 AC_PROG_CC |
405
|
195 AC_PROG_CPP |
832
|
196 AC_PROG_GCC_TRADITIONAL |
869
|
197 |
|
198 ### Do special things for gcc. |
|
199 |
2353
|
200 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ |
3107
|
201 sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` |
405
|
202 case "$gcc_version" in |
|
203 2.*) |
1087
|
204 if test -z "$LDFLAGS"; then |
|
205 LDFLAGS="-g" |
|
206 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
207 fi |
405
|
208 ;; |
|
209 1.*) |
3105
|
210 warn_gcc_version="gcc version $gcc_version is likely to cause problems" |
|
211 AC_MSG_WARN($warn_gcc_version) |
405
|
212 ;; |
5
|
213 esac |
869
|
214 |
1894
|
215 CC_VERSION= |
|
216 if test -n "$gcc_version"; then |
|
217 CC_VERSION="$gcc_version" |
|
218 fi |
|
219 AC_SUBST(CC_VERSION) |
|
220 |
3775
|
221 ### The flag to create dependency varies depending on the compier. |
|
222 |
|
223 # Assume GCC. |
|
224 DEPEND_FLAGS="-M" |
|
225 DEPEND_EXTRA_SED_PATTERN="" |
|
226 case "$canonical_host_type" in |
|
227 sparc-sun-solaris2* | i386-pc-solaris2*) |
3820
|
228 if test "$GCC" = yes; then |
3775
|
229 true |
|
230 else |
|
231 DEPEND_FLAGS="-xM1" |
|
232 DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'" |
|
233 fi |
|
234 ;; |
|
235 esac |
|
236 AC_SUBST(DEPEND_FLAGS) |
|
237 AC_SUBST(DEPEND_EXTRA_SED_PATTERN) |
|
238 |
3065
|
239 ### On Intel systems with gcc, we may need to compile with -mieee-fp to |
2558
|
240 ### get full support for IEEE floating point. |
2020
|
241 ### |
3126
|
242 ### On Alpha/OSF systems, we need -mieee. |
869
|
243 |
3126
|
244 ieee_fp_flag= |
350
|
245 case "$canonical_host_type" in |
3887
|
246 i[[3456789]]86-*-*) |
3126
|
247 OCTAVE_CC_FLAG(-mieee-fp, [ |
|
248 ieee_fp_flag=-mieee-fp |
3131
|
249 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" |
|
250 AC_MSG_RESULT([adding -mieee-fp to XTRA_CFLAGS])]) |
3126
|
251 |
|
252 OCTAVE_CXX_FLAG(-mieee-fp, [ |
|
253 ieee_fp_flag=-mieee-fp |
3131
|
254 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" |
|
255 AC_MSG_RESULT([adding -mieee-fp to XTRA_CXXFLAGS])]) |
324
|
256 ;; |
3127
|
257 alpha*-*-*) |
4284
|
258 if test "$GCC" = yes; then |
|
259 OCTAVE_CC_FLAG(-mieee-with-inexact, [ |
|
260 ieee_fp_flag=-mieee-with-inexact |
|
261 XTRA_CFLAGS="$XTRA_CFLAGS -mieee-with-inexact" |
|
262 AC_MSG_RESULT([adding -mieee-with-inexact to XTRA_CFLAGS])]) |
3131
|
263 |
4284
|
264 OCTAVE_CXX_FLAG(-mieee-with-inexact, [ |
|
265 ieee_fp_flag=-mieee-with-inexact |
|
266 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-with-inexact" |
|
267 AC_MSG_RESULT([adding -mieee-with-inexact to XTRA_CXXFLAGS])]) |
|
268 else |
|
269 OCTAVE_CC_FLAG(-ieee, [ |
|
270 ieee_fp_flag=-ieee |
|
271 XTRA_CFLAGS="$XTRA_CFLAGS -ieee" |
|
272 AC_MSG_RESULT([adding -ieee to XTRA_CFLAGS])]) |
|
273 |
|
274 OCTAVE_CXX_FLAG(-ieee, [ |
|
275 ieee_fp_flag=-ieee |
|
276 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ieee" |
|
277 AC_MSG_RESULT([adding -ieee to XTRA_CXXFLAGS])]) |
|
278 fi |
2020
|
279 ;; |
3176
|
280 *ibm-aix4*) |
3351
|
281 OCTAVE_CC_FLAG(-mminimal-toc, [ |
|
282 XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) |
3176
|
283 |
3351
|
284 OCTAVE_CXX_FLAG(-mminimal-toc, [ |
|
285 XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) |
3176
|
286 ;; |
324
|
287 esac |
3126
|
288 |
|
289 AC_SUBST(XTRA_CFLAGS) |
|
290 AC_SUBST(XTRA_CXXFLAGS) |
869
|
291 |
1667
|
292 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
293 |
|
294 case "$canonical_host_type" in |
3127
|
295 alpha*-dec-osf1.3) |
1667
|
296 LD_STATIC_FLAG=-static |
|
297 ;; |
|
298 esac |
1679
|
299 if test -n "$LD_STATIC_FLAG"; then |
|
300 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
|
301 fi |
|
302 AC_SUBST(LD_STATIC_FLAG) |
1667
|
303 |
3222
|
304 OCTAVE_CXX_PREPENDS_UNDERSCORE |
4094
|
305 |
|
306 ### Defaults for cross compiling. BUILD_CC and BUILD_CXX are |
|
307 ### the compilers that we use for building tools on the build system. |
4098
|
308 ### For now, we assume that the only cross compiling we can do is |
4298
|
309 ### with gcc on a Unixy system, but the dedicated hacker can override these. |
4094
|
310 |
|
311 if test "$cross_compiling" = yes; then |
|
312 BUILD_CC="gcc" |
|
313 BUILD_CFLAGS="-O2 -g" |
|
314 BUILD_CXX="g++" |
|
315 BUILD_CXXFLAGS="-O2 -g" |
4298
|
316 BUILD_LDFLAGS="" |
4098
|
317 BUILD_EXEEXT="" |
4094
|
318 else |
4298
|
319 BUILD_CC='$(CC)' |
|
320 BUILD_CFLAGS='$(CFLAGS)' |
|
321 BUILD_CXX='$(CXX)' |
|
322 BUILD_CXXFLAGS='$(CXXFLAGS)' |
|
323 BUILD_LDFLAGS='$(LDFLAGS)' |
4284
|
324 case "$canonical_host_type" in |
|
325 sparc-sun-solaris2*) |
|
326 if test "$GCC" != yes; then |
4298
|
327 ## The Sun C++ compiler never seems to complete compiling |
|
328 ## gendoc.cc unless we reduce the optimization level... |
|
329 BUILD_CXXFLAGS="-g -O1" |
4284
|
330 fi |
|
331 ;; |
|
332 esac |
4298
|
333 BUILD_EXEEXT='$(EXEEXT)' |
4094
|
334 fi |
|
335 |
|
336 AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) |
|
337 AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) |
|
338 AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) |
|
339 AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) |
4298
|
340 AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) |
|
341 AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) |
3222
|
342 |
3232
|
343 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
344 |
|
345 ### Look for math library. If found, this will add -lm to LIBS. |
|
346 |
|
347 case "$canonical_host_type" in |
|
348 *-*-nextstep*) |
|
349 ;; |
|
350 *-*-linux*) |
|
351 AC_CHECK_LIB(m, sin, , , -lc) |
|
352 ;; |
|
353 *) |
|
354 AC_CHECK_LIB(m, sin) |
|
355 ;; |
|
356 esac |
|
357 |
3820
|
358 ### Check for HDF5 library. |
|
359 |
|
360 ### XXX FIXME XXX -- how can user specify a set of libraries here? |
|
361 |
|
362 WITH_HDF5=true |
|
363 AC_ARG_WITH(hdf5, |
|
364 [ --without-hdf5 don't use HDF5], |
|
365 with_hdf5=$withval, with_hdf5=yes) |
|
366 |
|
367 hdf5_lib= |
|
368 if test "$with_hdf5" = yes; then |
|
369 hdf5_lib="hdf5" |
|
370 elif test "$with_hdf5" != no; then |
|
371 hdf5_lib="$with_hdf5" |
3687
|
372 fi |
|
373 |
3820
|
374 HDF5_LIBS= |
|
375 WITH_HDF5=false |
|
376 if test -n "$hdf5_lib"; then |
|
377 AC_CHECK_LIB($hdf5_lib, H5Pcreate, [ |
|
378 AC_CHECK_LIB(z, deflate, [ |
|
379 AC_CHECK_HEADERS(hdf5.h, [ |
|
380 WITH_HDF5=true |
|
381 HDF5_LIBS="-l$hdf5_lib -lz" |
|
382 LIBS="$HDF5_LIBS $LIBS" |
3892
|
383 AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.])])])]) |
3820
|
384 fi |
3687
|
385 |
3827
|
386 # Checks for FFTW header and library. |
|
387 |
|
388 # subdirectories of libcruft to build if they aren't found on the system: |
|
389 FFT_DIR="fftpack" |
|
390 AC_SUBST(FFT_DIR) |
|
391 |
|
392 # Installed fftw library, if any. |
|
393 FFTW_LIBS='' |
|
394 AC_SUBST(FFTW_LIBS) |
|
395 |
|
396 AC_ARG_WITH(fftw, |
3886
|
397 [ --without-fftw use included fftpack instead of installed fftw], |
|
398 with_fftw=$withval, with_fftw=yes) |
3827
|
399 |
|
400 if test "$with_fftw" = "yes"; then |
3887
|
401 have_fftw_header=no |
|
402 AC_CHECK_HEADERS(dfftw.h fftw.h, [have_fftw_header=yes; break]) |
|
403 if test "$have_fftw_header" = yes; then |
3827
|
404 AC_CHECK_LIB(dfftw, fftw_create_plan, FFTW_LIBS="-ldfftw", |
|
405 [AC_CHECK_LIB(fftw, fftw_create_plan, FFTW_LIBS="-lfftw", with_fftw=no)]) |
|
406 else |
|
407 with_fftw=no |
|
408 fi |
|
409 fi |
|
410 |
|
411 if test "$with_fftw" = yes; then |
|
412 FFT_DIR='' |
3892
|
413 AC_DEFINE(HAVE_FFTW, 1, [Define if the FFTW library is available.]) |
3827
|
414 fi |
|
415 |
4343
|
416 WITH_MPI=true |
|
417 AC_ARG_WITH(mpi, |
|
418 [ --without-mpi don't use MPI], |
|
419 with_mpi=$withval, with_mpi=yes) |
|
420 |
|
421 mpi_lib= |
|
422 if test "$with_mpi" = yes; then |
|
423 mpi_lib="mpi" |
|
424 elif test "$with_mpi" != no; then |
|
425 mpi_lib="$with_mpi" |
|
426 fi |
|
427 |
|
428 MPI_LIBS= |
|
429 WITH_MPI=false |
|
430 if test -n "$mpi_lib"; then |
|
431 AC_CHECK_LIB($mpi_lib, MPI_Init, [ |
|
432 AC_CHECK_HEADERS(mpi.h, [ |
|
433 WITH_MPI=true |
|
434 MPI_LIBS="-l$mpi_lib" |
|
435 LIBS="$MPI_LIBS $LIBS" |
|
436 AC_DEFINE(HAVE_MPI, 1, [Define if MPI is available.])])]) |
|
437 fi |
|
438 |
3827
|
439 # ---------------------------------------------------------------------- |
|
440 |
3012
|
441 ### We need these before trying to find libf2c. |
|
442 |
3130
|
443 OCTAVE_PROG_AR |
3012
|
444 |
|
445 AC_PROG_RANLIB |
|
446 |
2813
|
447 ### If we haven't been forced to use a particular Fortran compiler, |