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