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