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