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