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