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