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 |
3069
|
24 AC_REVISION($Revision: 1.282 $) |
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, |
3060
|
182 [ --enable-bounds-check for internal array classes (default is no)], |
|
183 [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) |
2108
|
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 |
3065
|
279 ### On Intel systems with gcc, we may need to compile with -mieee-fp to |
2558
|
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 |
3065
|
285 GCC_IEEE_FP_FLAG= |
350
|
286 case "$canonical_host_type" in |
2022
|
287 changequote(,)dnl |
2558
|
288 i[3456789]86-*-*) |
2022
|
289 changequote([,])dnl |
3065
|
290 XCFLAGS="$CFLAGS" |
|
291 CFLAGS="$CFLAGS -mieee-fp" |
|
292 AC_TRY_LINK([], [], [GCC_IEEE_FP_FLAG="-mieee-fp"], []) |
|
293 CFLAGS="$XCFLAGS" |
324
|
294 ;; |
2020
|
295 alpha-dec-osf*) |
2022
|
296 case "$gcc_version" in |
|
297 changequote(,)dnl |
2020
|
298 1.* | 2.[01234567].*) |
2022
|
299 changequote([,])dnl |
2020
|
300 ;; |
|
301 *) |
2813
|
302 GCC_IEEE_FP_FLAG="-mieee" |
2020
|
303 ;; |
|
304 esac |
|
305 ;; |
324
|
306 esac |
3065
|
307 if test -n "$GCC_IEEE_FP_FLAG"; then |
|
308 AC_MSG_RESULT([defining GCC_IEEE_FP_FLAG to be $GCC_IEEE_FP_FLAG]) |
|
309 fi |
1667
|
310 AC_SUBST(GCC_IEEE_FP_FLAG) |
869
|
311 |
1667
|
312 ### Use -static if compiling on Alpha OSF/1 1.3 systems. |
|
313 |
|
314 case "$canonical_host_type" in |
|
315 alpha-dec-osf1.3) |
|
316 LD_STATIC_FLAG=-static |
|
317 ;; |
|
318 esac |
1679
|
319 if test -n "$LD_STATIC_FLAG"; then |
|
320 AC_MSG_RESULT([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) |
|
321 fi |
|
322 AC_SUBST(LD_STATIC_FLAG) |
1667
|
323 |
3012
|
324 ### We need these before trying to find libf2c. |
|
325 |
|
326 if test -z "$AR"; then |
|
327 AR=ar |
|
328 fi |
|
329 AC_SUBST(AR) |
|
330 |
|
331 if test -z "$ARFLAGS"; then |
|
332 ARFLAGS="rc" |
|
333 fi |
|
334 AC_SUBST(ARFLAGS) |
|
335 |
|
336 AC_PROG_RANLIB |
|
337 |
2813
|
338 ### If we haven't been forced to use a particular Fortran compiler, |
|
339 ### try to find one using any one of several common Un*x Fortran |
|
340 ### compiler names. Put fc last to avoid confusion with some vendor's |
|
341 ### /bin/sh fc builtin. |
2470
|
342 ### |
2813
|
343 ### f77 : most Unix systems |
869
|
344 ### xlf : IBM / AIX |
|
345 ### cf77 : Cray / Unicos |
2295
|
346 ### g77 : GNU Fortran |
869
|
347 ### fc : Convex |
|
348 ### |
2813
|
349 ### If a compiler is found, check to see if it is compatible with our |
|
350 ### assumptions. If it is, use it. Otherwise, look for f2c. If we |
|
351 ### can't find a compatible fortran compiler or f2c, issue a warning. |
|
352 ### |
869
|
353 ### I don't think the Cray compiler will ever work like f2c... |
1239
|
354 ### |
2813
|
355 ### The configure options --with-f77, --with-g77, or --with-f2c |
|
356 ### force f77, g77 or f2c to be used. It is also possible to use |
|
357 ### these options to specify the name of the compiler. For example, |
|
358 ### `--with-g77=/opt/gnu/bin/f77' says that we are using g77 but it is |
|
359 ### installed as /opt/gnu/bin/f77. |
1233
|
360 |
2813
|
361 if $use_f77; then |
3008
|
362 if test "$with_f77" = yes; then |
2813
|
363 F77=f77 |
|
364 else |
|
365 F77="$with_f77" |
|
366 fi |
|
367 AC_MSG_RESULT([defining F77 to be $F77]) |
|
368 elif $use_g77; then |
2336
|
369 if test "$with_g77" = yes; then |
1239
|
370 F77=g77 |
|
371 else |
|
372 F77="$with_g77" |
|
373 fi |
|
374 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
375 elif $use_f2c; then |
|
376 F77= |
2336
|
377 if test "$with_f2c" = yes; then |
1317
|
378 F2C=f2c |
1239
|
379 else |
|
380 F2C="$with_f2c" |
|
381 fi |
|
382 AC_MSG_RESULT([defining F2C to be $F2C]) |
5
|
383 else |
2295
|
384 AC_CHECK_PROGS(F77, g77 f77 f90 xlf cf77 fc) |
1233
|
385 fi |
5
|
386 |
1239
|
387 have_fortran_compiler=false |
|
388 have_f2c=false |
5
|
389 |
2813
|
390 f77_is_g77=false |
|
391 |
|
392 if $use_f2c; then |
1239
|
393 have_f2c=true |
|
394 else |
|
395 if test -n "$F77"; then |
|
396 OCTAVE_FLIBS |
|
397 OCTAVE_F77_APPEND_UNDERSCORE |
|
398 OCTAVE_F2C_F77_COMPAT |
|
399 if test "$octave_cv_f2c_f77_compat" = no; then |
|
400 F77= |
|
401 else |
2813
|
402 if $use_g77; then |
|
403 f77_is_g77=true |
|
404 else |
|
405 f77_output=`$F77 -v 2>&1 | grep "GNU F77"` |
|
406 if test -n "$f77_output"; then |
|
407 f77_is_g77=true |
|
408 fi |
|
409 fi |
1239
|
410 if test -z "$FFLAGS"; then |
|
411 FFLAGS="-O" |
1316
|
412 fi |
|
413 case "$canonical_host_type" in |
|
414 alpha-dec-osf*) |
2855
|
415 if $f77_is_g77 || test -z "$GCC_IEEE_FP_FLAG"; then |
2813
|
416 true |
|
417 else |
2855
|
418 FFLAGS="-fpe1 $FFLAGS" |
2813
|
419 fi |
1316
|
420 ;; |
|
421 esac |
|
422 if test -n "$FFLAGS"; then |
1239
|
423 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
424 fi |
|
425 fi |
|
426 fi |
|
427 if test -n "$F77"; then |
|
428 have_fortran_compiler=true |
1233
|
429 else |
1239
|
430 AC_CHECK_PROG(F2C, f2c, f2c, []) |
|
431 if test -n "$F2C"; then |
|
432 have_f2c=true |
5
|
433 fi |
|
434 fi |
|
435 fi |
869
|
436 |
2762
|
437 f77_rules_frag=/dev/null |
1239
|
438 if $have_fortran_compiler; then |
2762
|
439 f77_rules_frag=Makefrag.f77 |
1679
|
440 changequote(,)dnl |
|
441 cat << \EOF > $f77_rules_frag |
1668
|
442 |
1753
|
443 %.c : %.f |
1668
|
444 |
1791
|
445 %.o : %.f |
1679
|
446 $(FC) -c $(ALL_FFLAGS) $< |
1668
|
447 |
1984
|
448 pic/%.o : %.f |
|
449 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
450 |
1668
|
451 EOF |
1679
|
452 changequote([,])dnl |
1239
|
453 elif $have_f2c; then |
|
454 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
455 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
2562
|
456 |
|
457 ### This seems to be necessary on some Linux system. |
|
458 |
|
459 cat > conftest.$ac_ext << EOF |
|
460 int MAIN_ () { return 0; } |
|
461 int MAIN__ () { return 0; } |
|
462 EOF |
|
463 |
|
464 ### XXX FIMXE XXX -- these shouldn't be fixed names, eh? |
|
465 |
|
466 oct_conflib=libconflib.a |
|
467 oct_obj_ext=o |
|
468 |
|
469 if AC_TRY_EVAL(ac_compile); then |
|
470 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AC_FD_CC |
|
471 if test -n "$RANLIB"; then |
|
472 $RANLIB $oct_conflib 1>&AC_FD_CC |
5
|
473 fi |
|
474 fi |
2562
|
475 rm -f conftest* |
|
476 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, [-L. -lconflib -lm]) |
|
477 rm -f $oct_conflib |
|
478 |
|
479 if test -z "$FLIBS"; then |
|
480 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=, -lm) |
|
481 if test -n "$FLIBS"; then |
|
482 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
483 fi |
|
484 fi |
|
485 |
1462
|
486 if test -z "$FLIBS"; then |
832
|
487 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
488 fi |
2633
|
489 f77_rules_frag=Makefrag.f77 |
1679
|
490 cat << \EOF > $f77_rules_frag |
1668
|
491 |
1824
|
492 %.c : %.f |
1668
|
493 cat $< | $(F2C) $(F2CFLAGS) > $(@F) |
|
494 |
1753
|
495 %.o : %.f |
1668
|
496 |
|
497 EOF |
5
|
498 else |
832
|
499 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
500 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
501 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
502 fi |
869
|
503 |
2566
|
504 FORTRAN_MAIN_FLAG= |
|
505 case "$canonical_host_type" in |
|
506 *-linux-*) |
|
507 FORTRAN_MAIN_FLAG="-u MAIN__" |
|
508 ;; |
|
509 esac |
|
510 if test -n "$FORTRAN_MAIN_FLAG"; then |
|
511 AC_MSG_RESULT([defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG]) |
|
512 fi |
|
513 |
1163
|
514 FC=$F77 |
|
515 AC_SUBST(FC) |
869
|
516 AC_SUBST(F77) |
|
517 AC_SUBST(FFLAGS) |
|
518 AC_SUBST(FLIBS) |
|
519 AC_SUBST(F2C) |
|
520 AC_SUBST(F2CFLAGS) |
2566
|
521 AC_SUBST(FORTRAN_MAIN_FLAG) |
1679
|
522 AC_SUBST_FILE(f77_rules_frag) |
869
|
523 |
2813
|
524 ### Handle dynamic linking and shared library options. |
|
525 |
|
526 ### Allow the user to experiment with dynamic linking using dlopen/dlsym. |
|
527 |
|
528 AC_ARG_ENABLE(dl, |
|
529 [ --enable-dl use dlopen/dlsym for dynamic linking (not all systems)], |
|
530 [if test "$enableval" = no; then WITH_DL=no; |
|
531 elif test "$enableval" = yes; then WITH_DL=yes; |
|
532 else WITH_DL=maybe; fi], |
|
533 WITH_DL=maybe) |
|
534 |
|
535 ### Allow the user to experiment with dynamic linking using |
|
536 ### shl_load/shl_findsym (HP/UX only?). |
|
537 |
|
538 AC_ARG_ENABLE(shl, |
|
539 [ --enable-shl use shl_load/shl_findsym for dynamic linking (HP only)], |
|
540 [if test "$enableval" = no; then WITH_SHL=no; |
|
541 elif test "$enableval" = yes; then WITH_SHL=yes; |
|
542 else WITH_SHL=maybe; fi], |
|
543 WITH_SHL=maybe) |
|
544 |
3034
|
545 ### Enable creation of static libraries. |
|
546 |
|
547 AC_ARG_ENABLE(static, |
|
548 [ --enable-static create static libraries], |
|
549 [if test "$enableval" = no; then STATIC_LIBS=false; |
|
550 else STATIC_LIBS=true; fi], |
|
551 STATIC_LIBS=true) |
|
552 AC_SUBST(STATIC_LIBS) |
|
553 |
2813
|
554 ### Enable creation of shared libraries. Currently only works with |
|
555 ### gcc on some systems. |
|
556 |
|
557 AC_ARG_ENABLE(shared, |
|
558 [ --enable-shared create shared libraries (not all systems)], |
|
559 [if test "$enableval" = no; then SHARED_LIBS=false; |
|
560 else SHARED_LIBS=true; fi], |
|
561 SHARED_LIBS=false) |
|
562 AC_SUBST(SHARED_LIBS) |
|
563 |
3034
|
564 if $STATIC_LIBS || $SHARED_LIBS; then |
|
565 true |
|
566 else |
|
567 AC_MSG_ERROR([You can't disable building static AND shared libraries!]) |
|
568 fi |
|
569 |
2813
|
570 use_rpath=true |
|
571 AC_ARG_ENABLE(rpath, |
|
572 [ --enable-rpath add -rpath to link command for shared libraries], |
|
573 [if test "$enableval" = no; then use_rpath=false; fi], []) |
|
574 |
|
575 DLFCN_DIR= |
|
576 CPICFLAG=-fPIC |
|
577 CXXPICFLAG=-fPIC |
|
578 FPICFLAG=-fPIC |
|
579 SHLEXT=so |
|
580 SH_LD="$CC" |
|
581 SH_LDFLAGS=-shared |
3036
|
582 SONAME_FLAGS= |
2813
|
583 RLD_FLAG= |
|
584 case "$canonical_host_type" in |
|
585 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
586 SH_LD=ld |
|
587 SH_LDFLAGS=-Bshareable |
|
588 ;; |
|
589 alpha-dec-osf*) |
|
590 CPICFLAG= |
|
591 CXXPICFLAG= |
|
592 FPICFLAG= |
|
593 SH_LDFLAGS="-shared -Xlinker -expect_unresolved -Xlinker '*'" |
3037
|
594 SONAME_FLAGS='-Xlinker -soname -Xlinker $@' |
2813
|
595 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
|
596 ;; |
|
597 changequote(,)dnl |
|
598 i[3456789]86-*-linux*) |
|
599 changequote([,])dnl |
3038
|
600 SONAME_FLAGS='-Xlinker -soname -Xlinker $@' |
2813
|
601 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
|
602 ;; |
|
603 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
604 CPICFLAG= |
|
605 CXXPICFLAG= |
|
606 FPICFLAG= |
|
607 DLFCN_DIR=dlfcn |
|
608 ;; |
|
609 hppa*-hp-hpux*) |
|
610 if $f77_is_g77; then |
|
611 FPICFLAG=-fPIC |
|
612 else |
|
613 FPICFLAG=+Z |
|
614 fi |
|
615 SHLEXT=sl |
|
616 SH_LDFLAGS="-shared -fPIC" |
|
617 RLD_FLAG='-Xlinker +b -Xlinker $(libdir)' |
|
618 ;; |
|
619 *-sgi-*) |
|
620 CPICFLAG= |
|
621 CXXPICFLAG= |
|
622 FPICFLAG= |
|
623 RLD_FLAG='-L$(libdir)' |
|
624 ;; |
|
625 sparc-sun-sunos4*) |
|
626 if $f77_is_g77; then |
|
627 FPICFLAG=-fPIC |
|
628 else |
|
629 FPICFLAG=-PIC |
|
630 fi |
3059
|
631 SH_LD=ld |
|
632 SH_LDFLAGS="-assert nodefinitions" |
|
633 RLD_FLAG='-L$(libdir)' |
2813
|
634 ;; |
|
635 sparc-sun-solaris2*) |
|
636 if $f77_is_g77; then |
|
637 FPICFLAG=-fPIC |
|
638 else |
|
639 FPICFLAG=-PIC |
|
640 fi |
|
641 RLD_FLAG='-Xlinker -R -Xlinker $(libdir)' |
|
642 ;; |
|
643 esac |
|
644 |
|
645 if $use_rpath; then |
|
646 true |
|
647 else |
|
648 RLD_FLAG= |
|
649 fi |
|
650 |
|
651 AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) |
|
652 AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) |
|
653 AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) |
|
654 AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) |
|
655 AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) |
|
656 AC_MSG_RESULT([defining SH_LD to be $SH_LD]) |
|
657 AC_MSG_RESULT([defining SH_LDFLAGS to be $SH_LDFLAGS]) |
3036
|
658 AC_MSG_RESULT([defining SONAME_FLAGS to be $SONAME_FLAGS]) |
2813
|
659 AC_MSG_RESULT([defining RLD_FLAG to be $RLD_FLAG]) |
|
660 AC_SUBST(FPICFLAG) |
|
661 AC_SUBST(CPICFLAG) |
|
662 AC_SUBST(CXXPICFLAG) |
|
663 AC_SUBST(SHLEXT) |
|
664 AC_SUBST(DLFCN_DIR) |
|
665 AC_SUBST(SH_LD) |
|
666 AC_SUBST(SH_LDFLAGS) |
3036
|
667 AC_SUBST(SONAME_FLAGS) |
2813
|
668 AC_SUBST(RLD_FLAG) |
|
669 |
|
670 ### Allow compilation of smaller kernel. This only works if some form |
|
671 ### of dynamic linking is also supported and used. |
|
672 |
|
673 AC_ARG_ENABLE(lite-kernel, |
|
674 [ --enable-lite-kernel compile smaller kernel (requires dynamic linking)], |
|
675 [if test "$enableval" = no; then OCTAVE_LITE=false; |
|
676 else OCTAVE_LITE=true; fi], |
|
677 OCTAVE_LITE=false) |
|
678 if $OCTAVE_LITE; then |
|
679 AC_DEFINE(OCTAVE_LITE, 1) |
|
680 fi |
|
681 AC_SUBST(OCTAVE_LITE) |
|
682 |
|
683 ### special checks for odd OS specific things. |
|
684 ### |
|
685 ### I am told that on some SCO systems, the only place to find some |
|
686 ### functions like gethostname and gettimeofday is in libsocket. |
|
687 |
|
688 AC_ISC_POSIX |
|
689 AC_MINIX |
|
690 AC_AIX |
|
691 AC_CHECK_LIB(sun, getpwnam) |
|
692 AC_CHECK_LIB(socket, gethostname) |
|
693 |
|
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 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
862 ### functions, otherwise we may not find them. |
|
863 ### |
|
864 ### Also check for some additional trig functions that aren't ANSI but |
|
865 ### are often available. If they are missing, we try to replace them |
|
866 ### with functions from the BSD/NET2 math library. |
|
867 |
2050
|
868 AC_CHECK_LIB(sunmath, quiet_nan, , , -lm) |
1070
|
869 |
|
870 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
871 |
|
872 case "$canonical_host_type" in |
|
873 *-*-linux*) |
2034
|
874 AC_CHECK_LIB(m, sin, , , -lc) |
1070
|
875 ;; |
|
876 *) |
2034
|
877 AC_CHECK_LIB(m, sin) |
1070
|
878 ;; |
|
879 esac |
869
|
880 |
360
|
881 XCFLAGS="$CFLAGS" |
351
|
882 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
883 |
2508
|
884 ### I am told that Inf and NaN don't work on m68k HP sytems, and that |
|
885 ### on SCO systems, isnan and isinf don't work, but they can be |
|
886 ### replaced by something that does. |
956
|
887 |
|
888 case "$canonical_host_type" in |
1384
|
889 m68k-hp-hpux*) |
956
|
890 ;; |
2508
|
891 *-*-sco*) |
|
892 AC_MSG_RESULT([defining SCO to be 1]) |
|
893 AC_DEFINE(SCO, 1) |
|
894 AC_MSG_RESULT([forcing HAVE_ISINF for SCO]) |
|
895 AC_DEFINE(HAVE_ISINF, 1) |
|
896 AC_MSG_RESULT([forcing HAVE_ISNAN for SCO]) |
|
897 AC_DEFINE(HAVE_ISNAN, 1) |
|
898 ;; |
956
|
899 *) |
|
900 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
901 ;; |
|
902 esac |
|
903 |
1076
|
904 ### Check for nonstandard but common math functions that we need. |
|
905 |
1172
|
906 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
907 |
360
|
908 CFLAGS="$XCFLAGS" |
869
|
909 |
|
910 ### Checks for OS specific cruft. |
|
911 |
1377
|
912 AC_STRUCT_ST_BLKSIZE |
|
913 AC_STRUCT_ST_BLOCKS |
|
914 AC_STRUCT_ST_RDEV |
405
|
915 AC_STRUCT_TM |
1186
|
916 AC_STRUCT_TIMEZONE |
1388
|
917 AC_FUNC_CLOSEDIR_VOID |
1225
|
918 |
2548
|
919 OCTAVE_STRUCT_GR_PASSWD |
|
920 |
405
|
921 TERMLIBS="" |
2592
|
922 for termlib in ncurses curses termcap terminfo termlib; do |
2034
|
923 AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
924 case "${TERMLIBS}" in |
|
925 *-l${termlib}*) |
832
|
926 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
927 break |
|
928 ;; |
|
929 esac |
|
930 done |
1225
|
931 AC_SUBST(TERMLIBS) |
869
|
932 |
2509
|
933 if test "$ac_cv_lib_termcap_tputs" = yes \ |
|
934 || test "$ac_cv_lib_terminfo_tputs" = yes \ |
|
935 || test "$ac_cv_lib_ncurses_tputs" = yes \ |
|
936 || test "$ac_cv_lib_curses_tputs" = yes \ |
|
937 || test "$ac_cv_lib_termlib_tputs" = yes; then |
2488
|
938 true |
|
939 else |
|
940 AC_MSG_WARN([I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!]) |
|
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]) |
|
1041 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
1042 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
1043 ;; |
|
1044 esac |
869
|
1045 AC_SUBST(LFLAGS) |
|
1046 |
405
|
1047 AC_PROG_YACC |
|
1048 case "$YACC" in |
|
1049 bison*) |
|
1050 ;; |
|
1051 *) |
832
|
1052 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
1053 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
1054 ;; |
|
1055 esac |
869
|
1056 |
1722
|
1057 AC_PROG_LN_S |
|
1058 |
869
|
1059 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
1060 AC_CHECK_PROG(EXPECT, expect, expect, []) |
1462
|
1061 if test -z "$EXPECT"; then |
5
|
1062 RUNTEST= |
|
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 |
832
|
1096 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
1097 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
1098 AC_MSG_WARN([plotting commands without it.]) |
|
1099 AC_MSG_WARN([]) |
|
1100 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
1101 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
1102 AC_MSG_WARN([]) |
|
1103 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
1104 AC_MSG_WARN([]) |
|
1105 AC_MSG_WARN([at the Octave prompt.]) |
405
|
1106 fi |
869
|
1107 |
2605
|
1108 octave_possible_pagers="less more page pg" |
|
1109 case "$canonical_host_type" in |
|
1110 *-*-cygwin32) |
|
1111 octave_possible_pagers="$octave_possible_pagers more.com" |
|
1112 ;; |
|
1113 esac |
|
1114 |
|
1115 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) |
405
|
1116 if test -z "$DEFAULT_PAGER"; then |
832
|
1117 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
1118 fi |
869
|
1119 |
2032
|
1120 ### Even though we include config.h, we need to have the preprocessor |
|
1121 ### defines available in a variable for the octave-bug script. Use |
|
1122 ### UGLY_DEFS for that. |
|
1123 |
|
1124 AC_OUTPUT_MAKE_DEFS |
2162
|
1125 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` |
2032
|
1126 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
|
1127 AC_SUBST(UGLY_DEFS) |
|
1128 |
869
|
1129 ### Maybe add -Wall to compiler flags now that we're done feature |
|
1130 ### testing. |
|
1131 |
405
|
1132 if $ADD_CXX_WALL; then |
1481
|
1133 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
1134 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
1135 fi |
|
1136 if $ADD_CC_WALL; then |
1481
|
1137 CFLAGS="$CFLAGS -Wall" |
832
|
1138 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
1139 fi |
869
|
1140 |
2813
|
1141 ### Someday, maybe include -ansi and even -pedantic in this list... |
|
1142 |
|
1143 GCC_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wid-clash-31 \ |
|
1144 -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ |
|
1145 -Wstrict-prototypes -Wwrite-strings" |
|
1146 |
2826
|
1147 GXX_PICKY_FLAGS="$GCC_PICKY_FLAGS -fno-nonnull-objects" |
2813
|
1148 |
|
1149 AC_ARG_ENABLE(picky-flags, |
|
1150 [ --enable-picky-flags add picky options to CFLAGS, CXXFLAGS, FFLAGS], |
|
1151 [if test "$enableval" = no; then true; |
|
1152 elif test "$enableval" = yes; then |
|
1153 if $ADD_CXX_WALL; then |
|
1154 CXXFLAGS="$GXX_PICKY_FLAGS $CXXFLAGS" |
|
1155 AC_MSG_RESULT([adding picky options to CXXFLAGS]) |
|
1156 else |
|
1157 AC_MSG_WARN([CXX doesn't look like g++ -- not adding picky options]) |
|
1158 fi |
|
1159 if $ADD_CC_WALL; then |
|
1160 CFLAGS="$GCC_PICKY_FLAGS $CFLAGS" |
|
1161 AC_MSG_RESULT([adding picky options to CFLAGS]) |
|
1162 else |
|
1163 AC_MSG_WARN([CC doesn't look like gcc -- not adding picky options]) |
|
1164 fi |
|
1165 else |
|
1166 if $ADD_CXX_WALL; then |
|
1167 CXXFLAGS="$enableval $CXXFLAGS" |
|
1168 AC_MSG_RESULT([adding picky options to CXXFLAGS]) |
|
1169 else |
|
1170 AC_MSG_WARN([CXX doesn't look like g++ -- not adding picky options]) |
|
1171 fi |
|
1172 if $ADD_CC_WALL; then |
|
1173 CFLAGS="$enableval $CFLAGS" |
|
1174 AC_MSG_RESULT([adding picky options to CFLAGS]) |
|
1175 else |
|
1176 AC_MSG_WARN([CC doesn't look like gcc -- not adding picky options]) |
|
1177 fi |
|
1178 fi], []) |
|
1179 |
1146
|
1180 ### Run configure in subdirectories. |
|
1181 |
1304
|
1182 export CC |
|
1183 export CXX |
|
1184 export F77 |
|
1185 |
2064
|
1186 AC_CONFIG_SUBDIRS(glob kpathsea scripts $INFO_DIR $PLPLOT_DIR $READLINE_DIR) |
1146
|
1187 |
869
|
1188 ### Do the substitutions in all the Makefiles. |
|
1189 |
2064
|
1190 AC_OUTPUT(Makefile octMakefile Makeconf test/Makefile dlfcn/Makefile |
2475
|
1191 doc/Makefile doc/faq/Makefile doc/interpreter/Makefile |
2626
|
1192 doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile |
3004
|
1193 examples/Makefile liboctave/Makefile src/Makefile |
|
1194 libcruft/Makefile libcruft/Makerules |
2629
|
1195 libcruft/blas/Makefile libcruft/balgen/Makefile |
2475
|
1196 libcruft/dassl/Makefile libcruft/eispack/Makefile |
3043
|
1197 libcruft/fftpack/Makefile libcruft/lapack/Makefile |
|
1198 libcruft/linpack/Makefile libcruft/minpack/Makefile |
|
1199 libcruft/misc/Makefile libcruft/odepack/Makefile |
|
1200 libcruft/quadpack/Makefile libcruft/ranlib/Makefile |
|
1201 libcruft/slatec-fn/Makefile libcruft/villad/Makefile) |
1225
|
1202 |
|
1203 ### Print a summary so that important information isn't missed. |
|
1204 |
|
1205 CXX_EXTRAS="$HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES $GCC_IEEE_FP_FLAG" |
|
1206 |
|
1207 if test -z "$F77"; then |
|
1208 FORT="$F2C $F2CFLAGS" |
|
1209 else |
2610
|
1210 FORT="$F77 $FFLAGS" |
1225
|
1211 fi |
|
1212 |
|
1213 AC_MSG_RESULT([ |
|
1214 |
|
1215 Octave is now configured for $canonical_host_type |
|
1216 |
1664
|
1217 Source directory: $srcdir |
|
1218 Installation prefix: $prefix |
|
1219 C compiler: $CC $GCC_IEEE_FP_FLAG $CFLAGS |
|
1220 C++ compiler: $CXX $CXX_EXTRAS $CXXFLAGS |
|
1221 Fortran compiler: $FORT |
|
1222 Fortran libraries: $FLIBS |
|
1223 Use GNU readline: $USE_READLINE |
|
1224 Use GNU info reader: $USE_GNU_INFO |
|
1225 Default pager: $DEFAULT_PAGER |
|
1226 gnuplot: $GNUPLOT_BINARY |
|
1227 |
2108
|
1228 Do internal array bounds checking: $BOUNDS_CHECKING |
3034
|
1229 Build static libraries: $STATIC_LIBS |
1679
|
1230 Build shared libraries: $SHARED_LIBS |
|
1231 Minimal kernel option: $OCTAVE_LITE |
|
1232 Dynamic Linking (dlopen/dlsym): $WITH_DL |
|
1233 Dynamic Linking (shl_load/shl_findsym): $WITH_SHL |
3034
|
1234 Include support for GNU readline: $USE_READLINE |
|
1235 Include support for the GNU Info reader: $USE_GNU_INFO |
1225
|
1236 ]) |