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