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