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