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