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 |
3037
|
24 AC_REVISION($Revision: 1.276 $) |
2034
|
25 AC_PREREQ(2.9) |
405
|
26 AC_INIT(src/octave.cc) |
1146
|
27 AC_CONFIG_HEADER(config.h) |
869
|
28 |
|
29 AC_DEFINE(OCTAVE_SOURCE, 1) |
|
30 |
2813
|
31 OCTAVE_HOST_TYPE |
1667
|
32 |
2223
|
33 ### some defaults |
|
34 |
2813
|
35 AC_PREFIX_DEFAULT(/usr/local) |
1667
|
36 AC_MSG_RESULT([defining prefix to be $prefix]) |
2813
|
37 OCTAVE_SET_DEFAULT(exec_prefix) |
|
38 OCTAVE_SET_DEFAULT(bindir) |
|
39 OCTAVE_SET_DEFAULT(datadir) |
|
40 OCTAVE_SET_DEFAULT(libdir) |
|
41 OCTAVE_SET_DEFAULT(libexecdir) |
|
42 OCTAVE_SET_DEFAULT(includedir) |
|
43 OCTAVE_SET_DEFAULT(mandir) |
|
44 OCTAVE_SET_DEFAULT(infodir) |
|
45 OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') |
|
46 OCTAVE_SET_DEFAULT(man1ext, '.1') |
|
47 OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') |
3029
|
48 OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)/octave') |
|
49 OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') |
2813
|
50 OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') |
|
51 OCTAVE_SET_DEFAULT(localfcnfilepath, '$(localfcnfiledir)//') |
3029
|
52 OCTAVE_SET_DEFAULT(archlibdir, |
|
53 '$(libexecdir)/octave/$(version)/exec/$(target_host_type)') |
|
54 OCTAVE_SET_DEFAULT(localarchlibdir, |
|
55 '$(libexecdir)/octave/site/exec/$(target_host_type)') |
|
56 OCTAVE_SET_DEFAULT(octfiledir, |
|
57 '$(libexecdir)/octave/$(version)/oct/$(target_host_type)') |
|
58 OCTAVE_SET_DEFAULT(localoctfiledir, |
|
59 '$(libexecdir)/octave/site/oct/$(target_host_type)') |
2813
|
60 OCTAVE_SET_DEFAULT(localoctfilepath, '$(localoctfiledir)//') |
3029
|
61 OCTAVE_SET_DEFAULT(fcnfilepath, |
|
62 '.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//') |
|
63 OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') |
2813
|
64 OCTAVE_SET_DEFAULT(imagepath, '.:$(imagedir)//') |
1667
|
65 |
2155
|
66 ### Make configure args available for other uses. |
|
67 |
|
68 config_opts=$ac_configure_args |
|
69 AC_SUBST(config_opts) |
|
70 |
1667
|
71 ### Path separator. |
|
72 |
1679
|
73 AC_DEFINE(SEPCHAR, [':']) |
|
74 AC_DEFINE(SEPCHAR_STR, [":"]) |
1667
|
75 |
869
|
76 ### Allow the user to force us to use f2c. |
|
77 |
832
|
78 AC_ARG_WITH(f2c, |
|
79 [ --with-f2c use f2c even if Fortran compiler is available], |
2813
|
80 [if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi], |
1177
|
81 use_f2c=false) |
|
82 |
|
83 ### Allow the user to force us to use g77. |
|
84 |
|
85 AC_ARG_WITH(g77, |
|
86 [ --with-g77 use g77 to compile Fortran subroutines], |
2813
|
87 [if test "$withval" = no; then use_g77=false; else use_g77=true; fi], |
1177
|
88 use_g77=false) |
|
89 |
2813
|
90 ### Allow the user to force us to use f77. |
|
91 |
|
92 AC_ARG_WITH(f77, |
|
93 [ --with-f77 use f77 to compile Fortran subroutines], |
|
94 [if test "$withval" = no; then use_f77=false; else use_f77=true; fi], |
|
95 use_f77=false) |
|
96 |
|
97 ### Make sure only one of the above options for Fortran compilers was |
|
98 ### specified (multiple "no" or --without-FOO options are ok). |
|
99 |
|
100 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, g77, |
|
101 [AC_MSG_WARN([--with-f77 and --with-g77 both specified! Using g77...]) |
|
102 use_g77=false]) |
|
103 |
|
104 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(f77, f2c, |
|
105 [AC_MSG_WARN([--with-f2c and --with-f77 both specified! Using f77...]) |
|
106 use_f2c=false]) |
|
107 |
|
108 OCTAVE_CHECK_EXCLUSIVE_WITH_OPTIONS(g77, f2c, |
|
109 [AC_MSG_WARN([--with-f2c and --with-g77 both specified! Using g77...]) |
|
110 use_f2c=false]) |
869
|
111 |
1137
|
112 ### Allow the user disable support for GNU info. |
|
113 |
2577
|
114 case "$canonical_host_type" in |
|
115 *-*-cygwin32) |
|
116 USE_GNU_INFO=false |
2578
|
117 ;; |
2577
|
118 *) |
|
119 USE_GNU_INFO=true |
|
120 ;; |
|
121 esac |
|
122 |
1261
|
123 INFO_DIR=info |
2577
|
124 |
1137
|
125 AC_ARG_ENABLE(info, |
|
126 [ --enable-info use GNU info (default is yes)], |
2813
|
127 [if test "$enableval" = no; then |
1261
|
128 USE_GNU_INFO=false; |
|
129 INFO_DIR=""; |
|
130 fi], []) |
1264
|
131 if $USE_GNU_INFO; then |
|
132 AC_DEFINE(USE_GNU_INFO, 1) |
|
133 fi |
1261
|
134 AC_SUBST(INFO_DIR) |
|
135 |
2415
|
136 dnl ### Allow the user disable support for plplot. |
|
137 dnl |
|
138 dnl # USE_PLPLOT=true |
|
139 dnl # PLPLOT_DIR=plplot |
|
140 dnl # LIBPLPLOT=../plplot/libplplot.a |
1397
|
141 USE_PLPLOT=false |
|
142 PLPLOT_DIR="" |
|
143 LIBPLPLOT="" |
2415
|
144 dnl AC_ARG_ENABLE(plplot, |
|
145 dnl [ --enable-plplot use plplot for plotting (default is yes)], |
2813
|
146 dnl [if test "$enableval" = no; then |
2415
|
147 dnl USE_PLPLOT=false; |
|
148 dnl LIBPLPLOT=""; |
|
149 dnl PLPLOT_DIR=""; |
|
150 dnl fi], []) |
|
151 dnl if $USE_PLPLOT; then |
|
152 dnl AC_DEFINE(USE_PLPLOT, 1) |
|
153 dnl fi |
2421
|
154 AC_SUBST(LIBPLPLOT) |
|
155 AC_SUBST(PLPLOT_DIR) |
1137
|
156 |
1138
|
157 ### Allow the user disable support for command line editing using GNU |
|
158 ### readline. |
|
159 |
1261
|
160 READLINE_DIR=readline |
1138
|
161 USE_READLINE=true |
3004
|
162 LIBREADLINE=../readline/libreadline.a |
2930
|
163 AC_ARG_ENABLE(readline, |
|
164 [ --enable-readline use readline library (default is yes)], |
|
165 [if test "$enableval" = no; then |
|
166 USE_READLINE=false; |
|
167 LIBREADLINE=""; |
|
168 READLINE_DIR=""; |
|
169 fi], []) |
1264
|
170 if $USE_READLINE; then |
|
171 AC_DEFINE(USE_READLINE, 1) |
|
172 fi |
1145
|
173 AC_SUBST(LIBREADLINE) |
1261
|
174 AC_SUBST(READLINE_DIR) |
1138
|
175 |
2813
|
176 ### Make it possible to have Octave's array and matrix classes do bounds |
2108
|
177 ### checking on element references. This slows some operations down a |
2813
|
178 ### bit, so it is turned off by default. |
2108
|
179 |
2450
|
180 BOUNDS_CHECKING=false |
2108
|
181 AC_ARG_ENABLE(bounds-check, |
|
182 [ --enable-bounds-check for internal array classes (default is yes)], |
|
183 [if test "$enableval" = no; then BOUNDS_CHECKING=false; fi], []) |
|
184 if $BOUNDS_CHECKING; then |
|
185 AC_DEFINE(BOUNDS_CHECKING, 1) |
|
186 fi |
|
187 |
869
|
188 ### See which C++ compiler to use (we expect to find g++). |
|
189 |
1334
|
190 EXTERN_CXXFLAGS="$CXXFLAGS" |
|
191 |
405
|
192 AC_PROG_CXX |
|
193 AC_PROG_CXXCPP |
869
|
194 |
|
195 ### Do special things for g++. |
|
196 |
405
|
197 ADD_CXX_WALL=false |
759
|
198 NO_IMPLICIT_TEMPLATES= |
2353
|
199 gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ |
2416
|
200 sed -e 's/^.*g.. version *//' -e 's/cygnus-//'` |
405
|
201 case "$gxx_version" in |
832
|
202 changequote(,)dnl |
2854
|
203 2.[6789].* | 2.[123456789][0123456789].*) |
832
|
204 changequote([,])dnl |
1334
|
205 if test -z "$EXTERN_CXXFLAGS"; then |
1087
|
206 ADD_CXX_WALL=true |
|
207 fi |
759
|
208 NO_IMPLICIT_TEMPLATES="-fno-implicit-templates" |
832
|
209 AC_MSG_RESULT([defining NO_IMPLICIT_TEMPLATES to be $NO_IMPLICIT_TEMPLATES]) |
405
|
210 ;; |
832
|
211 changequote(,)dnl |
2854
|
212 1.* | 2.[012345].*) |
832
|
213 changequote([,])dnl |
1664
|
214 AC_MSG_ERROR([g++ version $gxx_version will not work to compile Octave]) |
405
|
215 ;; |
|
216 *) |
832
|
217 AC_MSG_WARN([Octave has only been tested with g++, and I can't find it]) |
405
|
218 ;; |
|
219 esac |
869
|
220 |
1018
|
221 HOST_CXXFLAGS= |
965
|
222 case "$gxx_version" in |
|
223 2.6.*) |
|
224 case "$canonical_host_type" in |
2063
|
225 rs6000-ibm-aix* | powerpc-ibm-aix*) |
1018
|
226 HOST_CXXFLAGS="-Wa,-u" |
|
227 AC_MSG_RESULT([defining HOST_CXXFLAGS to be $HOST_CXXFLAGS]) |
965
|
228 ;; |
|
229 esac |
|
230 ;; |
|
231 esac |
|
232 |
1894
|
233 CXX_VERSION= |
|
234 if test -n "$gxx_version"; then |
|
235 CXX_VERSION="$gxx_version" |
|
236 fi |
|
237 AC_SUBST(CXX_VERSION) |
|
238 |
1018
|
239 AC_SUBST(HOST_CXXFLAGS) |
1225
|
240 AC_SUBST(NO_IMPLICIT_TEMPLATES) |
1018
|
241 |
869
|
242 ### See which C compiler to use (we expect to find gcc). |
|
243 |
1334
|
244 EXTERN_CFLAGS="$CFLAGS" |
|
245 |
5
|
246 AC_PROG_CC |
405
|
247 AC_PROG_CPP |
832
|
248 AC_PROG_GCC_TRADITIONAL |
869
|
249 |
|
250 ### Do special things for gcc. |
|
251 |
405
|
252 ADD_CC_WALL=false |
2353
|
253 gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ |
2416
|
254 sed -e 's/^.*g.. version *//' -e 's/cygnus-//'` |
405
|
255 case "$gcc_version" in |
|
256 2.*) |
1334
|
257 if test -z "$EXTERN_CFLAGS"; then |
1087
|
258 ADD_CC_WALL=true |
|
259 fi |
|
260 if test -z "$LDFLAGS"; then |
|
261 LDFLAGS="-g" |
|
262 AC_MSG_RESULT([defining LDFLAGS to be $LDFLAGS]) |
|
263 fi |
405
|
264 ;; |
|
265 1.*) |
832
|
266 AC_MSG_WARN([gcc version $gcc_version is likely to cause problems]) |
405
|
267 ;; |
5
|
268 *) |
832
|
269 AC_MSG_WARN([Octave has only been tested with gcc, and I can't find it]) |
405
|
270 ;; |
5
|
271 esac |
869
|
272 |
1894
|
273 CC_VERSION= |
|
274 if test -n "$gcc_version"; then |
|
275 CC_VERSION="$gcc_version" |
|
276 fi |
|
277 AC_SUBST(CC_VERSION) |
|
278 |
2558
|
279 ### On Intel systems with gcc, we need to compile with -mieee-fp to |
|
280 ### get full support for IEEE floating point. |
2020
|
281 ### |
2813
|
282 ### On Alpha/OSF systems, wee need -mieee, but that also |
2020
|
283 ### requires gcc 2.8.x or later. |
869
|
284 |
350
|
285 case "$canonical_host_type" in |
2022
|
286 changequote(,)dnl |
2558
|
287 i[3456789]86-*-*) |
2022
|
288 changequote([,])dnl |
350
|
289 GCC_IEEE_FP_FLAG="-mieee-fp" |
832
|
290 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
324
|
291 ;; |
2020
|
292 alpha-dec-osf*) |
2022
|
293 case "$gcc_version" in |
|
294 changequote(,)dnl |
2020
|
295 1.* | 2.[01234567].*) |
2022
|
296 changequote([,])dnl |
2020
|
297 ;; |
|
298 *) |
2813
|
299 GCC_IEEE_FP_FLAG="-mieee" |
2020
|
300 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
|
301 ;; |
|
302 esac |
|
303 ;; |
324
|
304 esac |
1667
|
305 AC_SUBST(GCC_IEEE_FP_FLAG) |
869
|
306 |
1667
|
307 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
308 |
|
309 case "$canonical_host_type" in |
|
310 alpha-dec-osf1.3) |
|
311 LD_STATIC_FLAG=-static |
|
312 ;; |
|
313 esac |
1679
|
314 if test -n "$LD_STATIC_FLAG"; then |
|
315 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
|
316 fi |
|
317 AC_SUBST(LD_STATIC_FLAG) |
1667
|
318 |
3012
|
319 ### We need these before trying to find libf2c. |
|
320 |
|
321 if test -z "$AR"; then |
|
322 AR=ar |
|
323 fi |
|
324 AC_SUBST(AR) |
|
325 |
|
326 if test -z "$ARFLAGS"; then |
|
327 ARFLAGS="rc" |
|
328 fi |
|
329 AC_SUBST(ARFLAGS) |
|
330 |
|
331 AC_PROG_RANLIB |
|
332 |
2813
|
333 ### If we haven't been forced to use a particular Fortran compiler, |
|
334 ### try to find one using any one of several common Un*x Fortran |
|
335 ### compiler names. Put fc last to avoid confusion with some vendor's |
|
336 ### /bin/sh fc builtin. |
2470
|
337 ### |
2813
|
338 ### f77 : most Unix systems |
869
|
339 ### xlf : IBM / AIX |
|
340 ### cf77 : Cray / Unicos |
2295
|
341 ### g77 : GNU Fortran |
869
|
342 ### fc : Convex |
|
343 ### |
2813
|
344 ### If a compiler is found, check to see if it is compatible with our |
|
345 ### assumptions. If it is, use it. Otherwise, look for f2c. If we |
|
346 ### can't find a compatible fortran compiler or f2c, issue a warning. |
|
347 ### |
869
|
348 ### I don't think the Cray compiler will ever work like f2c... |
1239
|
349 ### |
2813
|
350 ### The configure options --with-f77, --with-g77, or --with-f2c |
|
351 ### force f77, g77 or f2c to be used. It is also possible to use |
|
352 ### these options to specify the name of the compiler. For example, |
|
353 ### `--with-g77=/opt/gnu/bin/f77' says that we are using g77 but it is |
|
354 ### installed as /opt/gnu/bin/f77. |
1233
|
355 |
2813
|
356 if $use_f77; then |
3008
|
357 if test "$with_f77" = yes; then |
2813
|
358 F77=f77 |
|
359 else |
|
360 F77="$with_f77" |
|
361 fi |
|
362 AC_MSG_RESULT([defining F77 to be $F77]) |
|
363 elif $use_g77; then |
2336
|
364 if test "$with_g77" = yes; then |
1239
|
365 F77=g77 |
|
366 else |
|
367 F77="$with_g77" |
|
368 fi |
|
369 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
370 elif $use_f2c; then |
|
371 F77= |
2336
|
372 if test "$with_f2c" = yes; then |
1317
|
373 F2C=f2c |
1239
|
374 else |
|
375 F2C="$with_f2c" |
|
376 fi |
|
377 AC_MSG_RESULT([defining F2C to be $F2C]) |
5
|
378 else |
2295
|
379 AC_CHECK_PROGS(F77, g77 f77 f90 xlf cf77 fc) |
1233
|
380 fi |
5
|
381 |
1239
|
382 have_fortran_compiler=false |
|
383 have_f2c=false |
5
|
384 |
2813
|
385 f77_is_g77=false |
|
386 |
|
387 if $use_f2c; then |
1239
|
388 have_f2c=true |
|
389 else |
|
390 if test -n "$F77"; then |
|
391 OCTAVE_FLIBS |
|
392 OCTAVE_F77_APPEND_UNDERSCORE |
|
393 OCTAVE_F2C_F77_COMPAT |
|
394 if test "$octave_cv_f2c_f77_compat" = no; then |
|
395 F77= |
|
396 else |
2813
|
397 if $use_g77; then |
|
398 f77_is_g77=true |
|
399 else |
|
400 f77_output=`$F77 -v 2>&1 | grep "GNU F77"` |
|
401 if test -n "$f77_output"; then |
|
402 f77_is_g77=true |
|
403 fi |
|
404 fi |
1239
|
405 if test -z "$FFLAGS"; then |
|
406 FFLAGS="-O" |
1316
|
407 fi |
|
408 case "$canonical_host_type" in |
|
409 alpha-dec-osf*) |
2855
|
410 if $f77_is_g77 || test -z "$GCC_IEEE_FP_FLAG"; then |
2813
|
411 true |
|
412 else |
2855
|
413 FFLAGS="-fpe1 $FFLAGS" |
2813
|
414 fi |
1316
|
415 ;; |
|
416 esac |
|
417 if test -n "$FFLAGS"; then |
1239
|
418 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
419 fi |
|
420 fi |
|
421 fi |
|
422 if test -n "$F77"; then |
|
423 have_fortran_compiler=true |
1233
|
424 else |
1239
|
425 AC_CHECK_PROG(F2C, f2c, f2c, []) |
|
426 if test -n "$F2C"; then |
|
427 have_f2c=true |
5
|
428 fi |
|
429 fi |
|
430 fi |
869
|
431 |
2762
|
432 f77_rules_frag=/dev/null |
1239
|
433 if $have_fortran_compiler; then |
2762
|
434 f77_rules_frag=Makefrag.f77 |
1679
|
435 changequote(,)dnl |
|
436 cat << \EOF > $f77_rules_frag |
1668
|
437 |
1753
|
438 %.c : %.f |
1668
|
439 |
1791
|
440 %.o : %.f |
1679
|
441 $(FC) -c $(ALL_FFLAGS) $< |
1668
|
442 |
1984
|
443 pic/%.o : %.f |
|
444 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
445 |
1668
|
446 EOF |
1679
|
447 changequote([,])dnl |
1239
|
448 elif $have_f2c; then |
|
449 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
450 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
2562
|
451 |
|
452 ### This seems to be necessary on some Linux system. |
|
453 |
|
454 cat > conftest.$ac_ext << EOF |
|
455 int MAIN_ () { return 0; } |
|
456 int MAIN__ () { return 0; } |
|
457 EOF |
|
458 |
|
459 ### XXX FIMXE XXX -- these shouldn't be fixed names, eh? |
|
460 |
|
461 oct_conflib=libconflib.a |
|
462 oct_obj_ext=o |
|
463 |
|
464 if AC_TRY_EVAL(ac_compile); then |
|
465 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AC_FD_CC |
|
466 if test -n "$RANLIB"; then |
|
467 $RANLIB $oct_conflib 1>&AC_FD_CC |
5
|
468 fi |
|
469 fi |
2562
|
470 rm -f conftest* |
|
471 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, [-L. -lconflib -lm]) |
|
472 rm -f $oct_conflib |
|
473 |
|
474 if test -z "$FLIBS"; then |
|
475 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=, -lm) |
|
476 if test -n "$FLIBS"; then |
|
477 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
478 fi |
|
479 fi |
|
480 |
1462
|
481 if test -z "$FLIBS"; then |
832
|
482 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
483 fi |
2633
|
484 f77_rules_frag=Makefrag.f77 |
1679
|
485 cat << \EOF > $f77_rules_frag |
1668
|
486 |
1824
|
487 %.c : %.f |
1668
|
488 cat $< | $(F2C) $(F2CFLAGS) > $(@F) |
|
489 |
1753
|
490 %.o : %.f |
1668
|
491 |
|
492 EOF |
5
|
493 else |
832
|
494 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
495 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
496 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
497 fi |
869
|
498 |
2566
|
499 FORTRAN_MAIN_FLAG= |
|
500 case "$canonical_host_type" in |
|
501 *-linux-*) |
|
502 FORTRAN_MAIN_FLAG="-u MAIN__" |
|
503 ;; |
|
504 esac |
|
505 if test -n "$FORTRAN_MAIN_FLAG"; then |
|
506 AC_MSG_RESULT([defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG]) |
|
507 fi |
|
508 |
1163
|
509 FC=$F77 |
|
510 AC_SUBST(FC) |
869
|
511 AC_SUBST(F77) |
|
512 AC_SUBST(FFLAGS) |
|
513 AC_SUBST(FLIBS) |
|
514 AC_SUBST(F2C) |
|
515 AC_SUBST(F2CFLAGS) |
2566
|
516 AC_SUBST(FORTRAN_MAIN_FLAG) |
1679
|
517 AC_SUBST_FILE(f77_rules_frag) |
869
|
518 |
2813
|
519 ### Handle dynamic linking and shared library options. |
|
520 |
|
521 ### Allow the user to experiment with dynamic linking using dlopen/dlsym. |
|
522 |
|
523 AC_ARG_ENABLE(dl, |
|
524 [ --enable-dl use dlopen/dlsym for dynamic linking (not all systems)], |
|
525 [if test "$enableval" = no; then WITH_DL=no; |
|
526 elif test "$enableval" = yes; then WITH_DL=yes; |
|
527 else WITH_DL=maybe; fi], |
|
528 WITH_DL=maybe) |
|
529 |
|
530 ### Allow the user to experiment with dynamic linking using |
|
531 ### shl_load/shl_findsym (HP/UX only?). |
|
532 |
|
533 AC_ARG_ENABLE(shl, |
|
534 [ --enable-shl use shl_load/shl_findsym for dynamic linking (HP only)], |
|
535 [if test "$enableval" = no; then WITH_SHL=no; |
|
536 elif test "$enableval" = yes; then WITH_SHL=yes; |
|
537 else WITH_SHL=maybe; fi], |
|
538 WITH_SHL=maybe) |
|
539 |
3034
|
540 ### Enable creation of static libraries. |
|
541 |
|
542 AC_ARG_ENABLE(static, |
|
543 [ --enable-static create static libraries], |
|
544 [if test "$enableval" = no; then STATIC_LIBS=false; |
|
545 else STATIC_LIBS=true; fi], |
|
546 STATIC_LIBS=true) |
|
547 AC_SUBST(STATIC_LIBS) |
|
548 |
2813
|
549 ### Enable creation of shared libraries. Currently only works with |
|
550 ### gcc on some systems. |
|
551 |
|
552 AC_ARG_ENABLE(shared, |
|
553 [ --enable-shared create shared libraries (not all systems)], |
|
554 [if test "$enableval" = no; then SHARED_LIBS=false; |
|
555 else SHARED_LIBS=true; fi], |
|
556 SHARED_LIBS=false) |
|
557 AC_SUBST(SHARED_LIBS) |
|
558 |
3034
|
559 if $STATIC_LIBS || $SHARED_LIBS; then |
|
560 true |
|
561 else |
|
562 AC_MSG_ERROR([You can't disable building static AND shared libraries!]) |
|
563 fi |
|
564 |
2813
|
565 use_rpath=true |
|
566 AC_ARG_ENABLE(rpath, |
|
567 [ --enable-rpath add -rpath to link command for shared libraries], |
|
568 [if test "$enableval" = no; then use_rpath=false; fi], []) |
|
569 |
|
570 DLFCN_DIR= |
|
571 CPICFLAG=-fPIC |
|
572 CXXPICFLAG=-fPIC |
|
573 FPICFLAG=-fPIC |
|
574 SHLEXT=so |
|
575 SH_LD="$CC" |
|
576 SH_LDFLAGS=-shared |
3036
|
577 SONAME_FLAGS= |
2813
|
578 RLD_FLAG= |
|
579 case "$canonical_host_type" in |
|
580 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
581 SH_LD=ld |
|
582 SH_LDFLAGS=-Bshareable |
|
583 ;; |
|
584 alpha-dec-osf*) |
|
585 CPICFLAG= |
|
586 CXXPICFLAG= |
|
587 FPICFLAG= |
|
588 SH_LDFLAGS="-shared -Xlinker -expect_unresolved -Xlinker '*'" |
3037
|
589 SONAME_FLAGS='-Xlinker -soname -Xlinker $@' |
2813
|
590 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
|
591 ;; |
|
592 changequote(,)dnl |
|
593 i[3456789]86-*-linux*) |
|
594 changequote([,])dnl |
3037
|
595 SONAME_FLAGS='Xlinker -soname -Xlinker $@' |
2813
|
596 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
|
597 ;; |
|
598 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
599 CPICFLAG= |
|
600 CXXPICFLAG= |
|
601 FPICFLAG= |
|
602 DLFCN_DIR=dlfcn |
|
603 ;; |
|
604 hppa*-hp-hpux*) |
|
605 if $f77_is_g77; then |
|
606 FPICFLAG=-fPIC |
|
607 else |
|
608 FPICFLAG=+Z |
|
609 fi |
|
610 SHLEXT=sl |
|
611 SH_LDFLAGS="-shared -fPIC" |
|
612 RLD_FLAG='-Xlinker +b -Xlinker $(libdir)' |
|
613 ;; |
|
614 *-sgi-*) |
|
615 CPICFLAG= |
|
616 CXXPICFLAG= |
|
617 FPICFLAG= |
|
618 RLD_FLAG='-L$(libdir)' |
|
619 ;; |
|
620 sparc-sun-sunos4*) |
|
621 if $f77_is_g77; then |
|
622 FPICFLAG=-fPIC |
|
623 else |
|
624 FPICFLAG=-PIC |
|
625 fi |
|
626 ;; |
|
627 sparc-sun-solaris2*) |
|
628 if $f77_is_g77; then |
|
629 FPICFLAG=-fPIC |
|
630 else |
|
631 FPICFLAG=-PIC |
|
632 fi |
|
633 RLD_FLAG='-Xlinker -R -Xlinker $(libdir)' |
|
634 ;; |
|
635 esac |
|
636 |
|
637 if $use_rpath; then |
|
638 true |
|
639 else |
|
640 RLD_FLAG= |
|
641 fi |
|
642 |
|
643 AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) |
|
644 AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) |
|
645 AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) |
|
646 AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) |
|
647 AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) |
|
648 AC_MSG_RESULT([defining SH_LD to be $SH_LD]) |
|
649 AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) |
3036
|
650 AC_MSG_RESULT([defining SONAME_FLAGS to be $SONAME_FLAGS]) |
2813
|
651 AC_MSG_RESULT([defining RLD_FLAG to be $RLD_FLAG]) |
|
652 AC_SUBST(FPICFLAG) |
|
653 AC_SUBST(CPICFLAG) |
|
654 AC_SUBST(CXXPICFLAG) |
|
655 AC_SUBST(SHLEXT) |
|
656 AC_SUBST(DLFCN_DIR) |
|
657 AC_SUBST(SH_LD) |
|
658 AC_SUBST(SH_LDFLAGS) |
3036
|
659 AC_SUBST(SONAME_FLAGS) |
2813
|
660 AC_SUBST(RLD_FLAG) |
|
661 |
|
662 ### Allow compilation of smaller kernel. This only works if some form |
|
663 ### of dynamic linking is also supported and used. |
|
664 |
|
665 AC_ARG_ENABLE(lite-kernel, |
|
666 [ --enable-lite-kernel compile smaller kernel (requires dynamic linking)], |
|
667 [if test "$enableval" = no; then OCTAVE_LITE=false; |
|
668 else OCTAVE_LITE=true; fi], |
|
669 OCTAVE_LITE=false) |
|
670 if $OCTAVE_LITE; then |
|
671 AC_DEFINE(OCTAVE_LITE, 1) |
|
672 fi |
|
673 AC_SUBST(OCTAVE_LITE) |
|
674 |
|
675 ### special checks for odd OS specific things. |
|
676 ### |
|
677 ### I am told that on some SCO systems, the only place to find some |
|
678 ### functions like gethostname and gettimeofday is in libsocket. |
|
679 |
|
680 AC_ISC_POSIX |
|
681 AC_MINIX |
|
682 AC_AIX |
|
683 AC_CHECK_LIB(sun, getpwnam) |
|
684 AC_CHECK_LIB(socket, gethostname) |
|
685 |
|
686 ### How big are ints and how are they oriented? These could probably |
|
687 ### be eliminated in favor of run-time checks. |
|
688 |
|
689 AC_CHECK_SIZEOF(short) |
|
690 AC_CHECK_SIZEOF(int) |
|
691 AC_CHECK_SIZEOF(long) |
|
692 |
|
693 ### Does the C compiler handle alloca() and const correctly? |
|
694 |
|
695 AC_ALLOCA |
|
696 AC_C_CONST |
|
697 |
|
698 ### See if we should define NPOS. |
|
699 |
|
700 OCTAVE_STRING_NPOS |
|
701 |
869
|
702 ### Checks for header files. |
|
703 |
832
|
704 AC_HEADER_STDC |
|
705 AC_HEADER_DIRENT |
1377
|
706 AC_HEADER_TIME |
|
707 AC_HEADER_SYS_WAIT |
2097
|
708 |
|
709 AC_CHECK_HEADERS(assert.h curses.h fcntl.h float.h floatingpoint.h \ |
2508
|
710 grp.h ieeefp.h limits.h memory.h nan.h ncurses.h pwd.h sgtty.h \ |
|
711 stdlib.h string.h sys/param.h sys/resource.h sys/select.h sys/stat.h \ |
|
712 sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h termio.h \ |
|
713 termios.h unistd.h varargs.h) |
869
|
714 |
|
715 if test "$ac_cv_header_termios_h" = yes \ |
|
716 || test "$ac_cv_header_termio_h" = yes \ |
|
717 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
718 true |
|
719 else |
|
720 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
721 fi |
869
|
722 |
1667
|
723 ### See if the optional nonlinear programming code is present. |
|
724 |
|
725 AC_MSG_CHECKING([for npsol]) |
|
726 if test -f $srcdir/libcruft/npsol/npsol.f; then |
|
727 AC_MSG_RESULT(yes) |
|
728 else |
|
729 AC_MSG_RESULT(no) |
|
730 AC_DEFINE(NPSOL_MISSING, 1) |
|
731 fi |
|
732 |
|
733 AC_MSG_CHECKING([for qpsol]) |
|
734 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
|
735 AC_MSG_RESULT(yes) |
|
736 else |
|
737 AC_MSG_RESULT(no) |
|
738 AC_DEFINE(QPSOL_MISSING, 1) |
|
739 fi |
|
740 |
|
741 AC_MSG_CHECKING([for fsqp]) |
|
742 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
|
743 AC_MSG_RESULT(yes) |
|
744 else |
|
745 AC_MSG_RESULT(no) |
|
746 AC_DEFINE(FSQP_MISSING, 1) |
|
747 fi |
|
748 |
1788
|
749 ### Checks for functions and variables. |
869
|
750 |
2475
|
751 AC_CHECK_FUNCS(atexit bcopy bzero dup2 endgrent endpwent execvp fcntl \ |
|
752 fork getcwd getegid geteuid getgid getgrent getgrgid getgrnam \ |
2782
|
753 gethostname getpgrp getpid getppid getpwent getpwnam getpwuid \ |
|
754 gettimeofday getuid lstat memmove mkdir mkfifo on_exit pipe putenv \ |
|
755 rename rindex rmdir setgrent setpwent setvbuf sigaction sigpending \ |
|
756 sigprocmask sigsuspend stat strcasecmp strdup strerror stricmp \ |
|
757 strncasecmp strnicmp tempnam umask unlink usleep vfprintf vsprintf \ |
|
758 waitpid) |
1300
|
759 |
1708
|
760 OCTAVE_SMART_PUTENV |
|
761 |
2064
|
762 LIBDLFCN= |
|
763 DLFCN_INCFLAGS= |
1978
|
764 if test "$WITH_DL" = yes || test "$WITH_DL" = maybe; then |
2063
|
765 case "$canonical_host_type" in |
|
766 rs6000-ibm-aix* | powerpc-ibm-aix*) |
2346
|
767 LIBDLFCN="-ldlfcn -ll -lld" |
2064
|
768 DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn' |
2063
|
769 WITH_DL=true |
|
770 ;; |
|
771 *) |
|
772 AC_CHECK_LIB(dl, dlopen) |
|
773 AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) |
|
774 if test "$ac_cv_func_dlopen" = yes \ |
|
775 && test "$ac_cv_func_dlsym" = yes \ |
|
776 && test "$ac_cv_func_dlerror" = yes \ |
|
777 && test "$ac_cv_func_dlclose" = yes; then |
|
778 WITH_DL=true |
|
779 else |
|
780 if test "$WITH_DL" = yes; then |
|
781 AC_MSG_ERROR([--enable-dl specified, but functions are missing!]) |
|
782 fi |
|
783 WITH_DL=false |
|
784 fi |
|
785 ;; |
|
786 esac |
1978
|
787 if $WITH_DL; then |
|
788 AC_DEFINE(WITH_DL, 1) |
|
789 fi |
|
790 else |
|
791 WITH_DL=false |
1664
|
792 fi |
1978
|
793 AC_SUBST(WITH_DL) |
2064
|
794 AC_SUBST(LIBDLFCN) |
|
795 AC_SUBST(DLFCN_INCFLAGS) |
1664
|
796 |
1978
|
797 if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then |
|
798 AC_CHECK_LIB(dld, shl_load) |
|
799 AC_CHECK_FUNCS(shl_load shl_findsym) |
|
800 if test "$ac_cv_func_shl_load" = yes \ |
|
801 && test "$ac_cv_func_shl_findsym" = yes; then |
|
802 WITH_SHL=true |
|
803 else |
|
804 if test "$WITH_SHL" = yes; then |
|
805 AC_MSG_ERROR([--enable-shl specified, but functions are missing!]) |
|
806 fi |
|
807 WITH_SHL=false |
|
808 fi |
|
809 if $WITH_SHL; then |
|
810 AC_DEFINE(WITH_SHL, 1) |
|
811 fi |
|
812 else |
|
813 WITH_SHL=false |
1664
|
814 fi |
1978
|
815 AC_SUBST(WITH_SHL) |
1664
|
816 |
1901
|
817 ### Set WITH_DYNAMIC_LINKING after all the other shared library stuff |
|
818 ### has been determined. |
|
819 |
|
820 if $WITH_DL || $WITH_SHL; then |
|
821 AC_DEFINE(WITH_DYNAMIC_LINKING, 1) |
|
822 WITH_DYNAMIC_LINKING=true |
|
823 else |
|
824 WITH_DYNAMIC_LINKING=false |
|
825 fi |
|
826 AC_SUBST(WITH_DYNAMIC_LINKING) |
|
827 |
1300
|
828 ### There is more than one possible prototype for gettimeofday. See |
2782
|
829 ### which one (if any) appears in sys/time.h. These tests are from |
|
830 ### Emacs 19. |
1300
|
831 |
2782
|
832 AC_MSG_CHECKING(for struct timeval) |
|
833 AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME |
|
834 #include <sys/time.h> |
|
835 #include <time.h> |
|
836 #else |
|
837 #ifdef HAVE_SYS_TIME_H |
|
838 #include <sys/time.h> |
|
839 #else |
|
840 #include <time.h> |
|
841 #endif |
|
842 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;], |
|
843 [AC_MSG_RESULT(yes) |
|
844 HAVE_TIMEVAL=yes |
|
845 AC_DEFINE(HAVE_TIMEVAL)], |
|
846 [AC_MSG_RESULT(no) |
|
847 HAVE_TIMEVAL=no]) |
|
848 |
|
849 if test "x$HAVE_TIMEVAL" = xyes; then |
|
850 AC_MSG_CHECKING(whether gettimeofday can't accept two arguments) |
|
851 AC_TRY_LINK([#ifdef TIME_WITH_SYS_TIME |
|
852 #include <sys/time.h> |
|
853 #include <time.h> |
|
854 #else |
|
855 #ifdef HAVE_SYS_TIME_H |
|
856 #include <sys/time.h> |
|
857 #else |
|
858 #include <time.h> |
|
859 #endif |
|
860 #endif],[struct timeval time; struct timezone dummy; |
|
861 gettimeofday (&time, &dummy);], [AC_MSG_RESULT(no)], |
|
862 [AC_MSG_RESULT(yes) |
|
863 AC_DEFINE(GETTIMEOFDAY_NO_TZ)]) |
|
864 fi |
869
|
865 |
832
|
866 dnl Would like to get rid of this cruft, and just have |
|
867 dnl |
|
868 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
869 dnl |
|
870 dnl instead, but that used to fail on some systems... |
369
|
871 dnl |
832
|
872 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
873 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
874 dnl fails, we try again by including math.h and invoking the function |
|
875 dnl with an argument. |
869
|
876 |
|
877 ### Check to see if we have IEEE math functions, and if so, which ones. |
|
878 ### |
|
879 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
880 ### functions, otherwise we may not find them. |
|
881 ### |
|
882 ### Also check for some additional trig functions that aren't ANSI but |
|
883 ### are often available. If they are missing, we try to replace them |
|
884 ### with functions from the BSD/NET2 math library. |
|
885 |
2050
|
886 AC_CHECK_LIB(sunmath, quiet_nan, , , -lm) |
1070
|
887 |
|
888 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
889 |
|
890 case "$canonical_host_type" in |
|
891 *-*-linux*) |
2034
|
892 AC_CHECK_LIB(m, sin, , , -lc) |
1070
|
893 ;; |
|
894 *) |
2034
|
895 AC_CHECK_LIB(m, sin) |
1070
|
896 ;; |
|
897 esac |
869
|
898 |
360
|
899 XCFLAGS="$CFLAGS" |
351
|
900 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
901 |
2508
|
902 ### I am told that Inf and NaN don't work on m68k HP sytems, and that |
|
903 ### on SCO systems, isnan and isinf don't work, but they can be |
|
904 ### replaced by something that does. |
956
|
905 |
|
906 case "$canonical_host_type" in |
1384
|
907 m68k-hp-hpux*) |
956
|
908 ;; |
2508
|
909 *-*-sco*) |
|
910 AC_MSG_RESULT([defining SCO to be 1]) |
|
911 AC_DEFINE(SCO, 1) |
|
912 AC_MSG_RESULT([forcing HAVE_ISINF for SCO]) |
|
913 AC_DEFINE(HAVE_ISINF, 1) |
|
914 AC_MSG_RESULT([forcing HAVE_ISNAN for SCO]) |
|
915 AC_DEFINE(HAVE_ISNAN, 1) |
|
916 ;; |
956
|
917 *) |
|
918 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
919 ;; |
|
920 esac |
|
921 |
1076
|
922 ### Check for nonstandard but common math functions that we need. |
|
923 |
1172
|
924 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
925 |
360
|
926 CFLAGS="$XCFLAGS" |
869
|
927 |
|
928 ### Checks for OS specific cruft. |
|
929 |
1377
|
930 AC_STRUCT_ST_BLKSIZE |
|
931 AC_STRUCT_ST_BLOCKS |
|
932 AC_STRUCT_ST_RDEV |
405
|
933 AC_STRUCT_TM |
1186
|
934 AC_STRUCT_TIMEZONE |
1388
|
935 AC_FUNC_CLOSEDIR_VOID |
1225
|
936 |
2548
|
937 OCTAVE_STRUCT_GR_PASSWD |
|
938 |
405
|
939 TERMLIBS="" |
2592
|
940 for termlib in ncurses curses termcap terminfo termlib; do |
2034
|
941 AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
942 case "${TERMLIBS}" in |
|
943 *-l${termlib}*) |
832
|
944 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
945 break |
|
946 ;; |
|
947 esac |
|
948 done |
1225
|
949 AC_SUBST(TERMLIBS) |
869
|
950 |
2509
|
951 if test "$ac_cv_lib_termcap_tputs" = yes \ |
|
952 || test "$ac_cv_lib_terminfo_tputs" = yes \ |
|
953 || test "$ac_cv_lib_ncurses_tputs" = yes \ |
|
954 || test "$ac_cv_lib_curses_tputs" = yes \ |
|
955 || test "$ac_cv_lib_termlib_tputs" = yes; then |
2488
|
956 true |
|
957 else |
|
958 AC_MSG_WARN([I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!]) |
|
959 fi |
|
960 |
832
|
961 AC_MSG_CHECKING([for struct exception in math.h]) |
|
962 AC_TRY_LINK([#include <math.h>], |
|
963 [struct exception *x; x->type; x->name;], |
835
|
964 AC_MSG_RESULT(yes) |
832
|
965 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
966 AC_MSG_RESULT(no)) |
|
967 |
|
968 ### Signal stuff. |
|
969 |
834
|
970 AC_TYPE_SIGNAL |
885
|
971 AC_DECL_SYS_SIGLIST |
|
972 AC_MSG_CHECKING([for sys_siglist variable]) |
|
973 AC_TRY_LINK([#include <stdio.h>], |
|
974 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
975 AC_MSG_RESULT(yes) |
|
976 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
977 AC_MSG_RESULT(no)) |
2470
|
978 OCTAVE_SIGNAL_CHECK |
|
979 OCTAVE_REINSTALL_SIGHANDLERS |
869
|
980 |
1762
|
981 ### Type stuff. |
|
982 |
|
983 AC_TYPE_MODE_T |
|
984 AC_TYPE_OFF_T |
2097
|
985 AC_TYPE_PID_T |
1762
|
986 AC_TYPE_SIZE_T |
|
987 AC_TYPE_UID_T |
|
988 AC_CHECK_TYPE(dev_t, short) |
|
989 AC_CHECK_TYPE(ino_t, unsigned long) |
|
990 AC_CHECK_TYPE(nlink_t, short) |
2626
|
991 OCTAVE_CHECK_TYPE(sigset_t, [#include <signal.h>], int) |
1762
|
992 |
869
|
993 ### Define VOID_SIGHANDLER for readline. |
|
994 |
405
|
995 case "$RETSIGTYPE" in |
|
996 int) |
|
997 ;; |
|
998 *) |
|
999 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
1000 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
1001 ;; |
|
1002 esac |
869
|
1003 AC_SUBST(VOID_SIGHANDLER) |
|
1004 |
2633
|
1005 ### A system dependent kluge or two. |
|
1006 |
2035
|
1007 AC_CHECK_FUNCS(getrusage times) |
2427
|
1008 case "$canonical_host_type" in |
|
1009 *-*-cygwin32) |
|
1010 AC_DEFINE(RUSAGE_TIMES_ONLY, 1) |
|
1011 ;; |
|
1012 esac |
|
1013 |
2762
|
1014 bsd_gcc_kluge_targets_frag=/dev/null |
2633
|
1015 case "$canonical_host_type" in |
|
1016 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
1017 bsd_gcc_kluge_targets_frag=Makefrag.bsd |
|
1018 cat << \EOF > $bsd_gcc_kluge_targets_frag |
|
1019 |
|
1020 lex.o: lex.cc |
|
1021 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1022 |
|
1023 pt-plot.o: pt-plot.cc |
|
1024 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1025 |
|
1026 symtab.o: symtab.cc |
|
1027 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1028 |
|
1029 toplev.o: toplev.cc |
|
1030 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1031 |
|
1032 unwind-prot.o: unwind-prot.cc |
|
1033 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
1034 |
|
1035 EOF |
|
1036 ;; |
|
1037 esac |
|
1038 AC_SUBST_FILE(bsd_gcc_kluge_targets_frag) |
|
1039 |
869
|
1040 ### Checks for other programs used for building, testing, installing, |
|
1041 ### and running Octave. |
|
1042 ### |
|
1043 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
1044 ### it, and it might not be installed. |
|
1045 ### |
|
1046 ### Also make sure that we generate an interactive scanner if we are |
|
1047 ### using flex. |
|
1048 |
405
|
1049 AC_PROG_LEX |
|
1050 case "$LEX" in |
|
1051 flex*) |
|
1052 LFLAGS="-t -I" |
832
|
1053 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
1054 LEXLIB= |
|
1055 ;; |
|
1056 *) |
|
1057 LFLAGS="-t" |
832
|
1058 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
1059 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
1060 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
1061 ;; |
|
1062 esac |
869
|
1063 AC_SUBST(LFLAGS) |
|
1064 |
405
|
1065 AC_PROG_YACC |
|
1066 case "$YACC" in |
|
1067 bison*) |
|
1068 ;; |
|
1069 *) |
832
|
1070 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
1071 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
1072 ;; |
|
1073 esac |
869
|
1074 |
1722
|
1075 AC_PROG_LN_S |
|
1076 |
869
|
1077 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
1078 AC_CHECK_PROG(EXPECT, expect, expect, []) |
1462
|
1079 if test -z "$EXPECT"; then |
5
|
1080 RUNTEST= |
|
1081 fi |
869
|
1082 AC_SUBST(RUNTEST) |
|
1083 |
405
|
1084 AC_PROG_INSTALL |
2642
|
1085 INSTALL_SCRIPT='${INSTALL}' |
|
1086 AC_SUBST(INSTALL_SCRIPT) |
869
|
1087 |
2577
|
1088 EXE= |
|
1089 case "$canonical_host_type" in |
|
1090 *-*-cygwin32) |
|
1091 EXE=.exe |
|
1092 ;; |
|
1093 esac |
2578
|
1094 AC_SUBST(EXE) |
2577
|
1095 |
869
|
1096 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
1500
|
1097 if test -n "$GNUPLOT_BINARY"; then |
|
1098 AC_MSG_CHECKING([to see if your gnuplot supports multiplot]) |
1556
|
1099 if test -z "`echo 'set term unknown; set multiplot' | \ |
|
1100 $GNUPLOT_BINARY 2>&1`"; then |
1500
|
1101 AC_MSG_RESULT([yes]) |
|
1102 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1) |
|
1103 else |
|
1104 AC_MSG_RESULT([no]) |
|
1105 fi |
2289
|
1106 AC_MSG_CHECKING([to see if your gnuplot supports multiple plot windows]) |
|
1107 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then |
|
1108 AC_MSG_RESULT([yes]) |
|
1109 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1) |
|
1110 else |
|
1111 AC_MSG_RESULT([no]) |
|
1112 fi |
1500
|
1113 else |
832
|
1114 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
1115 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
1116 AC_MSG_WARN([plotting commands without it.]) |
|
1117 AC_MSG_WARN([]) |
|
1118 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
1119 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
1120 AC_MSG_WARN([]) |
|
1121 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
1122 AC_MSG_WARN([]) |
|
1123 AC_MSG_WARN([at the Octave prompt.]) |
405
|
1124 fi |
869
|
1125 |
2605
|
1126 octave_possible_pagers="less more page pg" |
|
1127 case "$canonical_host_type" in |
|
1128 *-*-cygwin32) |
|
1129 octave_possible_pagers="$octave_possible_pagers more.com" |
|
1130 ;; |
|
1131 esac |
|
1132 |
|
1133 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) |
405
|
1134 if test -z "$DEFAULT_PAGER"; then |
832
|
1135 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
1136 fi |
869
|
1137 |
2032
|
1138 ### Even though we include config.h, we need to have the preprocessor |
|
1139 ### defines available in a variable for the octave-bug script. Use |
|
1140 ### UGLY_DEFS for that. |
|
1141 |
|
1142 AC_OUTPUT_MAKE_DEFS |
2162
|
1143 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` |
2032
|
1144 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
|
1145 AC_SUBST(UGLY_DEFS) |
|
1146 |
869
|
1147 ### Maybe add -Wall to compiler flags now that we're done feature |
|
1148 ### testing. |
|
1149 |
405
|
1150 if $ADD_CXX_WALL; then |
1481
|
1151 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
1152 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
1153 fi |
|
1154 if $ADD_CC_WALL; then |
1481
|
1155 CFLAGS="$CFLAGS -Wall" |
832
|
1156 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
1157 fi |
869
|
1158 |
2813
|
1159 ### Someday, maybe include -ansi and even -pedantic in this list... |
|
1160 |
|
1161 GCC_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wid-clash-31 \ |
|
1162 -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ |
|
1163 -Wstrict-prototypes -Wwrite-strings" |
|
1164 |
2826
|
1165 GXX_PICKY_FLAGS="$GCC_PICKY_FLAGS -fno-nonnull-objects" |
2813
|
1166 |
|
1167 AC_ARG_ENABLE(picky-flags, |
|
1168 [ --enable-picky-flags add picky options to CFLAGS, CXXFLAGS, FFLAGS], |
|
1169 [if test "$enableval" = no; then true; |
|
1170 elif test "$enableval" = yes; then |
|
1171 if $ADD_CXX_WALL; then |
|
1172 CXXFLAGS="$GXX_PICKY_FLAGS $CXXFLAGS" |
|
1173 AC_MSG_RESULT([adding picky options to CXXFLAGS]) |
|
1174 else |
|
1175 AC_MSG_WARN([CXX doesn't look like g++ -- not adding picky options]) |
|
1176 fi |
|
1177 if $ADD_CC_WALL; then |
|
1178 CFLAGS="$GCC_PICKY_FLAGS $CFLAGS" |
|
1179 AC_MSG_RESULT([adding picky options to CFLAGS]) |
|
1180 else |
|
1181 AC_MSG_WARN([CC doesn't look like gcc -- not adding picky options]) |
|
1182 fi |
|
1183 else |
|
1184 if $ADD_CXX_WALL; then |
|
1185 CXXFLAGS="$enableval $CXXFLAGS" |
|
1186 AC_MSG_RESULT([adding picky options to CXXFLAGS]) |
|
1187 else |
|
1188 AC_MSG_WARN([CXX doesn't look like g++ -- not adding picky options]) |
|
1189 fi |
|
1190 if $ADD_CC_WALL; then |
|
1191 CFLAGS="$enableval $CFLAGS" |
|
1192 AC_MSG_RESULT([adding picky options to CFLAGS]) |
|
1193 else |
|
1194 AC_MSG_WARN([CC doesn't look like gcc -- not adding picky options]) |
|
1195 fi |
|
1196 fi], []) |
|
1197 |
1146
|
1198 ### Run configure in subdirectories. |
|
1199 |
1304
|
1200 export CC |
|
1201 export CXX |
|
1202 export F77 |
|
1203 |
2064
|
1204 AC_CONFIG_SUBDIRS(glob kpathsea scripts $INFO_DIR $PLPLOT_DIR $READLINE_DIR) |
1146
|
1205 |
869
|
1206 ### Do the substitutions in all the Makefiles. |
|
1207 |
2064
|
1208 AC_OUTPUT(Makefile octMakefile Makeconf test/Makefile dlfcn/Makefile |
2475
|
1209 doc/Makefile doc/faq/Makefile doc/interpreter/Makefile |
2626
|
1210 doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile |
3004
|
1211 examples/Makefile liboctave/Makefile src/Makefile |
|
1212 libcruft/Makefile libcruft/Makerules |
2629
|
1213 libcruft/blas/Makefile libcruft/balgen/Makefile |
2475
|
1214 libcruft/dassl/Makefile libcruft/eispack/Makefile |
|
1215 libcruft/fftpack/Makefile libcruft/fsqp/Makefile |
|
1216 libcruft/lapack/Makefile libcruft/linpack/Makefile |
|
1217 libcruft/minpack/Makefile libcruft/misc/Makefile |
|
1218 libcruft/npsol/Makefile libcruft/odepack/Makefile |
|
1219 libcruft/qpsol/Makefile libcruft/quadpack/Makefile |
|
1220 libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile |
|
1221 libcruft/villad/Makefile) |
1225
|
1222 |
|
1223 ### Print a summary so that important information isn't missed. |
|
1224 |
|
1225 CXX_EXTRAS="$HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES $GCC_IEEE_FP_FLAG" |
|
1226 |
|
1227 if test -z "$F77"; then |
|
1228 FORT="$F2C $F2CFLAGS" |
|
1229 else |
2610
|
1230 FORT="$F77 $FFLAGS" |
1225
|
1231 fi |
|
1232 |
|
1233 AC_MSG_RESULT([ |
|
1234 |
|
1235 Octave is now configured for $canonical_host_type |
|
1236 |
1664
|
1237 Source directory: $srcdir |
|
1238 Installation prefix: $prefix |
|
1239 C compiler: $CC $GCC_IEEE_FP_FLAG $CFLAGS |
|
1240 C++ compiler: $CXX $CXX_EXTRAS $CXXFLAGS |
|
1241 Fortran compiler: $FORT |
|
1242 Fortran libraries: $FLIBS |
|
1243 Use GNU readline: $USE_READLINE |
|
1244 Use GNU info reader: $USE_GNU_INFO |
|
1245 Default pager: $DEFAULT_PAGER |
|
1246 gnuplot: $GNUPLOT_BINARY |
|
1247 |
2108
|
1248 Do internal array bounds checking: $BOUNDS_CHECKING |
3034
|
1249 Build static libraries: $STATIC_LIBS |
1679
|
1250 Build shared libraries: $SHARED_LIBS |
|
1251 Minimal kernel option: $OCTAVE_LITE |
|
1252 Dynamic Linking (dlopen/dlsym): $WITH_DL |
|
1253 Dynamic Linking (shl_load/shl_findsym): $WITH_SHL |
3034
|
1254 Include support for GNU readline: $USE_READLINE |
|
1255 Include support for the GNU Info reader: $USE_GNU_INFO |
1225
|
1256 ]) |