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 |
2674
|
24 AC_REVISION($Revision: 1.253 $) |
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 |
2674
|
378 AC_ARG_ENABLE(rpath, |
|
379 [ --enable-rpath add -rpath to link command for shared libraries], |
|
380 [if test $enableval = no; then use_rpath=false; else use_rpath=true; fi], |
|
381 use_rpath=false) |
|
382 |
2059
|
383 DLFCN_DIR= |
2357
|
384 CPICFLAG=-fPIC |
|
385 CXXPICFLAG=-fPIC |
|
386 FPICFLAG=-fPIC |
|
387 SHLEXT=so |
2674
|
388 RLD_FLAG= |
2357
|
389 case "$canonical_host_type" in |
|
390 alpha-dec-osf*) |
|
391 CPICFLAG= |
|
392 CXXPICFLAG= |
|
393 FPICFLAG= |
2674
|
394 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
|
395 ;; |
|
396 changequote(,)dnl |
|
397 i[3456789]86-*-linux*) |
|
398 changequote([,])dnl |
|
399 RLD_FLAG='-Xlinker -rpath -Xlinker $(libdir)' |
2484
|
400 ;; |
2357
|
401 rs6000-ibm-aix* | powerpc-ibm-aix*) |
|
402 CPICFLAG= |
|
403 CXXPICFLAG= |
|
404 FPICFLAG= |
|
405 DLFCN_DIR=dlfcn |
|
406 ;; |
|
407 hppa*-hp-hpux*) |
2592
|
408 if $use_g77; then |
|
409 FPICFLAG=-fPIC |
|
410 else |
|
411 FPICFLAG=+Z |
|
412 fi |
2357
|
413 SHLEXT=sl |
2674
|
414 RLD_FLAG='-Xlinker +b -Xlinker $(libdir)' |
2357
|
415 ;; |
|
416 *-sgi-*) |
2611
|
417 if $use_g77; then |
|
418 FPICFLAG=-fPIC |
|
419 else |
|
420 FPICFLAG=-KPIC |
|
421 fi |
2674
|
422 RLD_FLAG='-L$(libdir)' |
2357
|
423 ;; |
|
424 sparc-sun-sunos4*) |
2611
|
425 if $use_g77; then |
|
426 FPICFLAG=-fPIC |
|
427 else |
|
428 FPICFLAG=-PIC |
|
429 fi |
2357
|
430 ;; |
|
431 sparc-sun-solaris2*) |
2611
|
432 if $use_g77; then |
|
433 FPICFLAG=-fPIC |
|
434 else |
|
435 FPICFLAG=-PIC |
|
436 fi |
2674
|
437 RLD_FLAG='-Xlinker -R -Xlinker $(libdir)' |
2357
|
438 ;; |
|
439 esac |
2674
|
440 |
|
441 if $use_rpath; then |
|
442 true |
|
443 else |
|
444 RLD_FLAG= |
|
445 fi |
|
446 |
1667
|
447 AC_MSG_RESULT([defining FPICFLAG to be $FPICFLAG]) |
|
448 AC_MSG_RESULT([defining CPICFLAG to be $CPICFLAG]) |
|
449 AC_MSG_RESULT([defining CXXPICFLAG to be $CXXPICFLAG]) |
1679
|
450 AC_MSG_RESULT([defining SHLEXT to be $SHLEXT]) |
2059
|
451 AC_MSG_RESULT([defining DLFCN_DIR to be $DLFCN_DIR]) |
1668
|
452 AC_SUBST(FPICFLAG) |
|
453 AC_SUBST(CPICFLAG) |
|
454 AC_SUBST(CXXPICFLAG) |
1679
|
455 AC_SUBST(SHLEXT) |
2059
|
456 AC_SUBST(DLFCN_DIR) |
1667
|
457 |
|
458 ### Allow compilation of smaller kernel. This only works if some form |
|
459 ### of dynamic linking is also supported and used. |
|
460 |
|
461 AC_ARG_ENABLE(lite-kernel, |
|
462 [ --enable-lite-kernel compile smaller kernel (requires dynamic linking)], |
1679
|
463 [if test $enableval = no; then OCTAVE_LITE=false; else OCTAVE_LITE=true; fi], |
|
464 OCTAVE_LITE=false) |
|
465 if $OCTAVE_LITE; then |
1667
|
466 AC_DEFINE(OCTAVE_LITE, 1) |
|
467 fi |
1679
|
468 AC_SUBST(OCTAVE_LITE) |
1667
|
469 |
1679
|
470 ### special checks for odd OS specific things. |
2470
|
471 ### |
|
472 ### I am told that on some SCO systems, the only place to find some |
|
473 ### functions like gethostname and gettimeofday is in libsocket. |
869
|
474 |
405
|
475 AC_ISC_POSIX |
|
476 AC_MINIX |
|
477 AC_AIX |
832
|
478 AC_CHECK_LIB(sun, getpwnam) |
2470
|
479 AC_CHECK_LIB(socket, gethostname) |
869
|
480 |
|
481 ### How big are ints and how are they oriented? These could probably |
|
482 ### be eliminated in favor of run-time checks. |
|
483 |
832
|
484 AC_CHECK_SIZEOF(short) |
|
485 AC_CHECK_SIZEOF(int) |
|
486 AC_CHECK_SIZEOF(long) |
869
|
487 |
|
488 ### Does the C compiler handle alloca() and const correctly? |
|
489 |
405
|
490 AC_ALLOCA |
832
|
491 AC_C_CONST |
869
|
492 |
1233
|
493 ### Get the list of libraries that the C++ compiler normally uses. |
|
494 |
|
495 OCTAVE_CXXLIBS |
|
496 |
2574
|
497 ### See if we should define NPOS. |
|
498 |
|
499 OCTAVE_STRING_NPOS |
|
500 |
2562
|
501 ### We need these before trying to find libf2c. |
|
502 |
|
503 if test -z "$AR"; then |
|
504 AR=ar |
|
505 fi |
|
506 AC_SUBST(AR) |
|
507 |
|
508 if test -z "$ARFLAGS"; then |
|
509 ARFLAGS="rc" |
|
510 fi |
|
511 AC_SUBST(ARFLAGS) |
|
512 |
|
513 AC_PROG_RANLIB |
|
514 |
869
|
515 ### If we haven't been forced to use f2c, try to find a Fortran compiler |
|
516 ### under any one of several common Un*x Fortran compiler names. |
|
517 ### Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
518 ### builtin. |
|
519 ### |
2295
|
520 ### f77 : mostUnix systems |
869
|
521 ### xlf : IBM / AIX |
|
522 ### cf77 : Cray / Unicos |
2295
|
523 ### g77 : GNU Fortran |
869
|
524 ### fc : Convex |
|
525 ### |
|
526 ### I don't think the Cray compiler will ever work like f2c... |
1239
|
527 ### |
|
528 ### The optional arguments to --with-g77 or --with-f2c force g77 or |
|
529 ### f2c to be used. The optional argument to can be used to set the |
|
530 ### name of g77 or f2c. For example `--with-g77=/opt/gnu/bin/f77' |
|
531 ### says that we are using g77 but it is installed as |
|
532 ### /opt/gnu/bin/f77. |
|
533 ### |
|
534 ### If neither of those options are specified, look for a Fortran |
|
535 ### compiler. If one is found, see if it is compatible with our |
|
536 ### assumptions. If it is, use it. Otherwise, look for f2c. |
|
537 ### |
|
538 ### Issue a warning if we can't find a compatible fortran compiler or |
|
539 ### f2c. |
1233
|
540 |
1177
|
541 if $use_g77; then |
2336
|
542 if test "$with_g77" = yes; then |
1239
|
543 F77=g77 |
|
544 else |
|
545 F77="$with_g77" |
|
546 fi |
|
547 AC_MSG_RESULT([defining F77 to be $F77]) |
1233
|
548 elif $use_f2c; then |
|
549 F77= |
2336
|
550 if test "$with_f2c" = yes; then |
1317
|
551 F2C=f2c |
1239
|
552 else |
|
553 F2C="$with_f2c" |
|
554 fi |
|
555 AC_MSG_RESULT([defining F2C to be $F2C]) |
5
|
556 else |
2295
|
557 AC_CHECK_PROGS(F77, g77 f77 f90 xlf cf77 fc) |
1233
|
558 fi |
5
|
559 |
1239
|
560 have_fortran_compiler=false |
|
561 have_f2c=false |
5
|
562 |
1239
|
563 if $use_g77; then |
1233
|
564 OCTAVE_FLIBS |
1239
|
565 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
566 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
|
567 have_fortran_compiler=true |
|
568 elif $use_f2c; then |
|
569 have_f2c=true |
|
570 else |
|
571 if test -n "$F77"; then |
|
572 OCTAVE_FLIBS |
|
573 OCTAVE_F77_APPEND_UNDERSCORE |
|
574 OCTAVE_F2C_F77_COMPAT |
|
575 if test "$octave_cv_f2c_f77_compat" = no; then |
|
576 F77= |
|
577 else |
|
578 if test -z "$FFLAGS"; then |
|
579 FFLAGS="-O" |
1316
|
580 fi |
|
581 case "$canonical_host_type" in |
|
582 alpha-dec-osf*) |
2336
|
583 case "$F77" in |
|
584 g77*) |
|
585 ;; |
|
586 *) |
|
587 FFLAGS="-fpe1 $FFLAGS" |
|
588 ;; |
2337
|
589 esac |
1316
|
590 ;; |
|
591 esac |
|
592 if test -n "$FFLAGS"; then |
1239
|
593 AC_MSG_RESULT([defining FFLAGS to be $FFLAGS]) |
|
594 fi |
|
595 fi |
|
596 fi |
|
597 if test -n "$F77"; then |
|
598 have_fortran_compiler=true |
1233
|
599 else |
1239
|
600 AC_CHECK_PROG(F2C, f2c, f2c, []) |
|
601 if test -n "$F2C"; then |
|
602 have_f2c=true |
5
|
603 fi |
|
604 fi |
|
605 fi |
869
|
606 |
2566
|
607 |
2633
|
608 f77_rules_frag=Makefrag.f77 |
1239
|
609 if $have_fortran_compiler; then |
1679
|
610 changequote(,)dnl |
|
611 cat << \EOF > $f77_rules_frag |
1668
|
612 |
1753
|
613 %.c : %.f |
1668
|
614 |
1791
|
615 %.o : %.f |
1679
|
616 $(FC) -c $(ALL_FFLAGS) $< |
1668
|
617 |
1984
|
618 pic/%.o : %.f |
|
619 $(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@ |
|
620 |
1668
|
621 EOF |
1679
|
622 changequote([,])dnl |
1239
|
623 elif $have_f2c; then |
|
624 AC_DEFINE(F77_APPEND_UNDERSCORE, 1) |
|
625 AC_MSG_RESULT([defining F77_APPEND_UNDERSCORE to be 1]) |
2562
|
626 |
|
627 ### This seems to be necessary on some Linux system. |
|
628 |
|
629 cat > conftest.$ac_ext << EOF |
|
630 int MAIN_ () { return 0; } |
|
631 int MAIN__ () { return 0; } |
|
632 EOF |
|
633 |
|
634 ### XXX FIMXE XXX -- these shouldn't be fixed names, eh? |
|
635 |
|
636 oct_conflib=libconflib.a |
|
637 oct_obj_ext=o |
|
638 |
|
639 if AC_TRY_EVAL(ac_compile); then |
|
640 $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&AC_FD_CC |
|
641 if test -n "$RANLIB"; then |
|
642 $RANLIB $oct_conflib 1>&AC_FD_CC |
5
|
643 fi |
|
644 fi |
2562
|
645 rm -f conftest* |
|
646 AC_CHECK_LIB(f2c, f_open, FLIBS=-lf2c, FLIBS=, [-L. -lconflib -lm]) |
|
647 rm -f $oct_conflib |
|
648 |
|
649 if test -z "$FLIBS"; then |
|
650 AC_CHECK_LIB(F77, d_sin, FLIBS=-lF77, FLIBS=, -lm) |
|
651 if test -n "$FLIBS"; then |
|
652 AC_CHECK_LIB(I77, f_rew, FLIBS="$FLIBS -lI77", FLIBS=, -lF77) |
|
653 fi |
|
654 fi |
|
655 |
1462
|
656 if test -z "$FLIBS"; then |
832
|
657 AC_MSG_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a]) |
5
|
658 fi |
2633
|
659 f77_rules_frag=Makefrag.f77 |
1679
|
660 cat << \EOF > $f77_rules_frag |
1668
|
661 |
1824
|
662 %.c : %.f |
1668
|
663 cat $< | $(F2C) $(F2CFLAGS) > $(@F) |
|
664 |
1753
|
665 %.o : %.f |
1668
|
666 |
|
667 EOF |
5
|
668 else |
832
|
669 AC_MSG_WARN([in order to build octave, you must have a compatible]) |
|
670 AC_MSG_WARN([Fortran compiler or f2c installed and in your path.]) |
1664
|
671 AC_MSG_ERROR([See the file INSTALL for more information.]) |
5
|
672 fi |
869
|
673 |
2566
|
674 FORTRAN_MAIN_FLAG= |
|
675 case "$canonical_host_type" in |
|
676 *-linux-*) |
|
677 FORTRAN_MAIN_FLAG="-u MAIN__" |
|
678 ;; |
|
679 esac |
|
680 if test -n "$FORTRAN_MAIN_FLAG"; then |
|
681 AC_MSG_RESULT([defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG]) |
|
682 fi |
|
683 |
1163
|
684 FC=$F77 |
|
685 AC_SUBST(FC) |
869
|
686 AC_SUBST(F77) |
|
687 AC_SUBST(FFLAGS) |
|
688 AC_SUBST(FLIBS) |
|
689 AC_SUBST(F2C) |
|
690 AC_SUBST(F2CFLAGS) |
2566
|
691 AC_SUBST(FORTRAN_MAIN_FLAG) |
1679
|
692 AC_SUBST_FILE(f77_rules_frag) |
869
|
693 |
|
694 ### Checks for header files. |
|
695 |
832
|
696 AC_HEADER_STDC |
|
697 AC_HEADER_DIRENT |
1377
|
698 AC_HEADER_TIME |
|
699 AC_HEADER_SYS_WAIT |
2097
|
700 |
|
701 AC_CHECK_HEADERS(assert.h curses.h fcntl.h float.h floatingpoint.h \ |
2508
|
702 grp.h ieeefp.h limits.h memory.h nan.h ncurses.h pwd.h sgtty.h \ |
|
703 stdlib.h string.h sys/param.h sys/resource.h sys/select.h sys/stat.h \ |
|
704 sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h termio.h \ |
|
705 termios.h unistd.h varargs.h) |
869
|
706 |
|
707 if test "$ac_cv_header_termios_h" = yes \ |
|
708 || test "$ac_cv_header_termio_h" = yes \ |
|
709 || test "$ac_cv_header_sgtty_h" = yes; then |
832
|
710 true |
|
711 else |
|
712 AC_MSG_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!]) |
|
713 fi |
869
|
714 |
1667
|
715 ### See if the optional nonlinear programming code is present. |
|
716 |
|
717 AC_MSG_CHECKING([for npsol]) |
|
718 if test -f $srcdir/libcruft/npsol/npsol.f; then |
|
719 AC_MSG_RESULT(yes) |
|
720 else |
|
721 AC_MSG_RESULT(no) |
|
722 AC_DEFINE(NPSOL_MISSING, 1) |
|
723 fi |
|
724 |
|
725 AC_MSG_CHECKING([for qpsol]) |
|
726 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
|
727 AC_MSG_RESULT(yes) |
|
728 else |
|
729 AC_MSG_RESULT(no) |
|
730 AC_DEFINE(QPSOL_MISSING, 1) |
|
731 fi |
|
732 |
|
733 AC_MSG_CHECKING([for fsqp]) |
|
734 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
|
735 AC_MSG_RESULT(yes) |
|
736 else |
|
737 AC_MSG_RESULT(no) |
|
738 AC_DEFINE(FSQP_MISSING, 1) |
|
739 fi |
|
740 |
1788
|
741 ### Checks for functions and variables. |
869
|
742 |
2475
|
743 AC_CHECK_FUNCS(atexit bcopy bzero dup2 endgrent endpwent execvp fcntl \ |
|
744 fork getcwd getegid geteuid getgid getgrent getgrgid getgrnam \ |
|
745 gethostname getpgrp getpid getppid getpwent getpwnam getpwuid getuid \ |
|
746 lstat memmove mkdir mkfifo on_exit pipe putenv rename rindex rmdir \ |
|
747 setgrent setpwent setvbuf sigaction sigpending sigprocmask \ |
|
748 sigsuspend stat strcasecmp strdup strerror stricmp strncasecmp \ |
2630
|
749 strnicmp tempnam umask unlink usleep vfprintf vsprintf waitpid) |
1300
|
750 |
1708
|
751 OCTAVE_SMART_PUTENV |
1788
|
752 OCTAVE_PROGRAM_INVOCATION_NAME |
1708
|
753 |
2064
|
754 LIBDLFCN= |
|
755 DLFCN_INCFLAGS= |
1978
|
756 if test "$WITH_DL" = yes || test "$WITH_DL" = maybe; then |
2063
|
757 case "$canonical_host_type" in |
|
758 rs6000-ibm-aix* | powerpc-ibm-aix*) |
2346
|
759 LIBDLFCN="-ldlfcn -ll -lld" |
2064
|
760 DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn' |
2063
|
761 WITH_DL=true |
|
762 ;; |
|
763 *) |
|
764 AC_CHECK_LIB(dl, dlopen) |
|
765 AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) |
|
766 if test "$ac_cv_func_dlopen" = yes \ |
|
767 && test "$ac_cv_func_dlsym" = yes \ |
|
768 && test "$ac_cv_func_dlerror" = yes \ |
|
769 && test "$ac_cv_func_dlclose" = yes; then |
|
770 WITH_DL=true |
|
771 else |
|
772 if test "$WITH_DL" = yes; then |
|
773 AC_MSG_ERROR([--enable-dl specified, but functions are missing!]) |
|
774 fi |
|
775 WITH_DL=false |
|
776 fi |
|
777 ;; |
|
778 esac |
1978
|
779 if $WITH_DL; then |
|
780 AC_DEFINE(WITH_DL, 1) |
|
781 fi |
|
782 else |
|
783 WITH_DL=false |
1664
|
784 fi |
1978
|
785 AC_SUBST(WITH_DL) |
2064
|
786 AC_SUBST(LIBDLFCN) |
|
787 AC_SUBST(DLFCN_INCFLAGS) |
1664
|
788 |
1978
|
789 if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then |
|
790 AC_CHECK_LIB(dld, shl_load) |
|
791 AC_CHECK_FUNCS(shl_load shl_findsym) |
|
792 if test "$ac_cv_func_shl_load" = yes \ |
|
793 && test "$ac_cv_func_shl_findsym" = yes; then |
|
794 WITH_SHL=true |
|
795 else |
|
796 if test "$WITH_SHL" = yes; then |
|
797 AC_MSG_ERROR([--enable-shl specified, but functions are missing!]) |
|
798 fi |
|
799 WITH_SHL=false |
|
800 fi |
|
801 if $WITH_SHL; then |
|
802 AC_DEFINE(WITH_SHL, 1) |
|
803 fi |
|
804 else |
|
805 WITH_SHL=false |
1664
|
806 fi |
1978
|
807 AC_SUBST(WITH_SHL) |
1664
|
808 |
1901
|
809 ### Set WITH_DYNAMIC_LINKING after all the other shared library stuff |
|
810 ### has been determined. |
|
811 |
|
812 if $WITH_DL || $WITH_SHL; then |
|
813 AC_DEFINE(WITH_DYNAMIC_LINKING, 1) |
|
814 WITH_DYNAMIC_LINKING=true |
|
815 else |
|
816 WITH_DYNAMIC_LINKING=false |
|
817 fi |
|
818 AC_SUBST(WITH_DYNAMIC_LINKING) |
|
819 |
1300
|
820 ### There is more than one possible prototype for gettimeofday. See |
|
821 ### which one (if any) appears in sys/time.h. |
|
822 |
|
823 AC_CHECK_FUNC(gettimeofday, |
|
824 AC_TRY_COMPILE([#include <sys/time.h>], |
|
825 [gettimeofday ((struct timeval *) 0,(struct timezone *) 0);], |
|
826 [], AC_DEFINE(GETTIMEOFDAY_NO_TZ))) |
869
|
827 |
832
|
828 dnl Would like to get rid of this cruft, and just have |
|
829 dnl |
|
830 dnl AC_CHECK_FUNCS(finite isnan isinf) |
|
831 dnl |
|
832 dnl instead, but that used to fail on some systems... |
369
|
833 dnl |
832
|
834 dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf |
|
835 dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that |
369
|
836 dnl fails, we try again by including math.h and invoking the function |
|
837 dnl with an argument. |
869
|
838 |
|
839 ### Check to see if we have IEEE math functions, and if so, which ones. |
|
840 ### |
|
841 ### For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP |
|
842 ### functions, otherwise we may not find them. |
|
843 ### |
|
844 ### Also check for some additional trig functions that aren't ANSI but |
|
845 ### are often available. If they are missing, we try to replace them |
|
846 ### with functions from the BSD/NET2 math library. |
|
847 |
2050
|
848 AC_CHECK_LIB(sunmath, quiet_nan, , , -lm) |
1070
|
849 |
|
850 dnl This is bogus. We shouldn't have to explicitly add libc too! |
|
851 |
|
852 case "$canonical_host_type" in |
|
853 *-*-linux*) |
2034
|
854 AC_CHECK_LIB(m, sin, , , -lc) |
1070
|
855 ;; |
|
856 *) |
2034
|
857 AC_CHECK_LIB(m, sin) |
1070
|
858 ;; |
|
859 esac |
869
|
860 |
360
|
861 XCFLAGS="$CFLAGS" |
351
|
862 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" |
869
|
863 |
2508
|
864 ### I am told that Inf and NaN don't work on m68k HP sytems, and that |
|
865 ### on SCO systems, isnan and isinf don't work, but they can be |
|
866 ### replaced by something that does. |
956
|
867 |
|
868 case "$canonical_host_type" in |
1384
|
869 m68k-hp-hpux*) |
956
|
870 ;; |
2508
|
871 *-*-sco*) |
|
872 AC_MSG_RESULT([defining SCO to be 1]) |
|
873 AC_DEFINE(SCO, 1) |
|
874 AC_MSG_RESULT([forcing HAVE_ISINF for SCO]) |
|
875 AC_DEFINE(HAVE_ISINF, 1) |
|
876 AC_MSG_RESULT([forcing HAVE_ISNAN for SCO]) |
|
877 AC_DEFINE(HAVE_ISNAN, 1) |
|
878 ;; |
956
|
879 *) |
|
880 AC_CHECK_FUNCS(finite isnan isinf infinity quiet_nan) |
|
881 ;; |
|
882 esac |
|
883 |
1076
|
884 ### Check for nonstandard but common math functions that we need. |
|
885 |
1172
|
886 AC_CHECK_FUNCS(acosh asinh atanh erf erfc) |
869
|
887 |
360
|
888 CFLAGS="$XCFLAGS" |
869
|
889 |
|
890 ### Checks for OS specific cruft. |
|
891 |
1377
|
892 AC_STRUCT_ST_BLKSIZE |
|
893 AC_STRUCT_ST_BLOCKS |
|
894 AC_STRUCT_ST_RDEV |
405
|
895 AC_STRUCT_TM |
1186
|
896 AC_STRUCT_TIMEZONE |
1388
|
897 AC_FUNC_CLOSEDIR_VOID |
1225
|
898 |
2548
|
899 OCTAVE_STRUCT_GR_PASSWD |
|
900 |
405
|
901 TERMLIBS="" |
2592
|
902 for termlib in ncurses curses termcap terminfo termlib; do |
2034
|
903 AC_CHECK_LIB(${termlib}, tputs, [TERMLIBS="${TERMLIBS} -l${termlib}"]) |
405
|
904 case "${TERMLIBS}" in |
|
905 *-l${termlib}*) |
832
|
906 AC_MSG_RESULT([defining TERMLIBS to be $TERMLIBS]) |
405
|
907 break |
|
908 ;; |
|
909 esac |
|
910 done |
1225
|
911 AC_SUBST(TERMLIBS) |
869
|
912 |
2509
|
913 if test "$ac_cv_lib_termcap_tputs" = yes \ |
|
914 || test "$ac_cv_lib_terminfo_tputs" = yes \ |
|
915 || test "$ac_cv_lib_ncurses_tputs" = yes \ |
|
916 || test "$ac_cv_lib_curses_tputs" = yes \ |
|
917 || test "$ac_cv_lib_termlib_tputs" = yes; then |
2488
|
918 true |
|
919 else |
|
920 AC_MSG_WARN([I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!]) |
|
921 fi |
|
922 |
832
|
923 AC_MSG_CHECKING([for struct exception in math.h]) |
|
924 AC_TRY_LINK([#include <math.h>], |
|
925 [struct exception *x; x->type; x->name;], |
835
|
926 AC_MSG_RESULT(yes) |
832
|
927 AC_DEFINE(EXCEPTION_IN_MATH, 1), |
869
|
928 AC_MSG_RESULT(no)) |
|
929 |
|
930 ### Signal stuff. |
|
931 |
834
|
932 AC_TYPE_SIGNAL |
885
|
933 AC_DECL_SYS_SIGLIST |
|
934 AC_MSG_CHECKING([for sys_siglist variable]) |
|
935 AC_TRY_LINK([#include <stdio.h>], |
|
936 [extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);], |
|
937 AC_MSG_RESULT(yes) |
|
938 AC_DEFINE(HAVE_SYS_SIGLIST, 1), |
|
939 AC_MSG_RESULT(no)) |
2470
|
940 OCTAVE_SIGNAL_CHECK |
|
941 OCTAVE_REINSTALL_SIGHANDLERS |
869
|
942 |
1762
|
943 ### Type stuff. |
|
944 |
|
945 AC_TYPE_MODE_T |
|
946 AC_TYPE_OFF_T |
2097
|
947 AC_TYPE_PID_T |
1762
|
948 AC_TYPE_SIZE_T |
|
949 AC_TYPE_UID_T |
|
950 AC_CHECK_TYPE(dev_t, short) |
|
951 AC_CHECK_TYPE(ino_t, unsigned long) |
|
952 AC_CHECK_TYPE(nlink_t, short) |
2626
|
953 OCTAVE_CHECK_TYPE(sigset_t, [#include <signal.h>], int) |
1762
|
954 |
869
|
955 ### Define VOID_SIGHANDLER for readline. |
|
956 |
405
|
957 case "$RETSIGTYPE" in |
|
958 int) |
|
959 ;; |
|
960 *) |
|
961 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
832
|
962 AC_MSG_RESULT([defining VOID_SIGHANDLER to be 1]) |
405
|
963 ;; |
|
964 esac |
869
|
965 AC_SUBST(VOID_SIGHANDLER) |
|
966 |
2633
|
967 ### A system dependent kluge or two. |
|
968 |
2035
|
969 AC_CHECK_FUNCS(getrusage times) |
2427
|
970 case "$canonical_host_type" in |
|
971 *-*-cygwin32) |
|
972 AC_DEFINE(RUSAGE_TIMES_ONLY, 1) |
|
973 ;; |
|
974 esac |
|
975 |
2633
|
976 bsd_gcc_kluge_targets_frag= |
|
977 case "$canonical_host_type" in |
|
978 *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*) |
|
979 bsd_gcc_kluge_targets_frag=Makefrag.bsd |
|
980 cat << \EOF > $bsd_gcc_kluge_targets_frag |
|
981 |
|
982 lex.o: lex.cc |
|
983 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
984 |
|
985 pt-plot.o: pt-plot.cc |
|
986 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
987 |
|
988 symtab.o: symtab.cc |
|
989 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
990 |
|
991 toplev.o: toplev.cc |
|
992 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
993 |
|
994 unwind-prot.o: unwind-prot.cc |
|
995 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $< |
|
996 |
|
997 EOF |
|
998 ;; |
|
999 esac |
|
1000 AC_SUBST_FILE(bsd_gcc_kluge_targets_frag) |
|
1001 |
869
|
1002 ### Checks for other programs used for building, testing, installing, |
|
1003 ### and running Octave. |
|
1004 ### |
|
1005 ### For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
1006 ### it, and it might not be installed. |
|
1007 ### |
|
1008 ### Also make sure that we generate an interactive scanner if we are |
|
1009 ### using flex. |
|
1010 |
405
|
1011 AC_PROG_LEX |
|
1012 case "$LEX" in |
|
1013 flex*) |
|
1014 LFLAGS="-t -I" |
832
|
1015 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
405
|
1016 LEXLIB= |
|
1017 ;; |
|
1018 *) |
|
1019 LFLAGS="-t" |
832
|
1020 AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) |
|
1021 AC_MSG_WARN([I didn't find flex, but that's only a problem]) |
|
1022 AC_MSG_WARN([if you need to reconstruct lex.cc]) |
405
|
1023 ;; |
|
1024 esac |
869
|
1025 AC_SUBST(LFLAGS) |
|
1026 |
405
|
1027 AC_PROG_YACC |
|
1028 case "$YACC" in |
|
1029 bison*) |
|
1030 ;; |
|
1031 *) |
832
|
1032 AC_MSG_WARN([I didn't find bison, but that's only a problem]) |
|
1033 AC_MSG_WARN([if you need to reconstruct parse.cc]) |
405
|
1034 ;; |
|
1035 esac |
869
|
1036 |
1722
|
1037 AC_PROG_LN_S |
|
1038 |
2257
|
1039 ### Kluge for SunOS 4.x vs. shared libraries. |
|
1040 |
|
1041 SH_LIBS="$LIBS" |
|
1042 SH_FLIBS="$FLIBS" |
|
1043 SH_TERMLIBS="$TERMLIBS" |
|
1044 case "$canonical_host_type" in |
|
1045 *-*-sunos4*) |
|
1046 SH_LIBS= |
|
1047 SH_FLIBS= |
|
1048 SH_TERMLIBS= |
|
1049 ;; |
|
1050 esac |
|
1051 AC_MSG_RESULT([defining SH_LIBS to be $SH_LIBS]) |
|
1052 AC_MSG_RESULT([defining SH_FLIBS to be $SH_FLIBS]) |
|
1053 AC_MSG_RESULT([defining SH_TERMLIBS to be $SH_TERMLIBS]) |
|
1054 AC_SUBST(SH_LIBS) |
|
1055 AC_SUBST(SH_FLIBS) |
|
1056 AC_SUBST(SH_TERMLIBS) |
|
1057 |
869
|
1058 AC_CHECK_PROG(RUNTEST, runtest, runtest, []) |
|
1059 AC_CHECK_PROG(EXPECT, expect, expect, []) |
1462
|
1060 if test -z "$EXPECT"; then |
5
|
1061 RUNTEST= |
|
1062 fi |
869
|
1063 AC_SUBST(RUNTEST) |
|
1064 |
405
|
1065 AC_PROG_INSTALL |
2642
|
1066 INSTALL_SCRIPT='${INSTALL}' |
|
1067 AC_SUBST(INSTALL_SCRIPT) |
869
|
1068 |
2577
|
1069 EXE= |
|
1070 case "$canonical_host_type" in |
|
1071 *-*-cygwin32) |
|
1072 EXE=.exe |
|
1073 ;; |
|
1074 esac |
2578
|
1075 AC_SUBST(EXE) |
2577
|
1076 |
869
|
1077 AC_CHECK_PROG(GNUPLOT_BINARY, gnuplot, gnuplot, []) |
1500
|
1078 if test -n "$GNUPLOT_BINARY"; then |
|
1079 AC_MSG_CHECKING([to see if your gnuplot supports multiplot]) |
1556
|
1080 if test -z "`echo 'set term unknown; set multiplot' | \ |
|
1081 $GNUPLOT_BINARY 2>&1`"; then |
1500
|
1082 AC_MSG_RESULT([yes]) |
|
1083 AC_DEFINE(GNUPLOT_HAS_MULTIPLOT, 1) |
|
1084 else |
|
1085 AC_MSG_RESULT([no]) |
|
1086 fi |
2289
|
1087 AC_MSG_CHECKING([to see if your gnuplot supports multiple plot windows]) |
|
1088 if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then |
|
1089 AC_MSG_RESULT([yes]) |
|
1090 AC_DEFINE(GNUPLOT_HAS_FRAMES, 1) |
|
1091 else |
|
1092 AC_MSG_RESULT([no]) |
|
1093 fi |
1500
|
1094 else |
832
|
1095 AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) |
|
1096 AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) |
|
1097 AC_MSG_WARN([plotting commands without it.]) |
|
1098 AC_MSG_WARN([]) |
|
1099 AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) |
|
1100 AC_MSG_WARN([tell Octave where to find it by typing the command]) |
|
1101 AC_MSG_WARN([]) |
|
1102 AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) |
|
1103 AC_MSG_WARN([]) |
|
1104 AC_MSG_WARN([at the Octave prompt.]) |
405
|
1105 fi |
869
|
1106 |
2605
|
1107 octave_possible_pagers="less more page pg" |
|
1108 case "$canonical_host_type" in |
|
1109 *-*-cygwin32) |
|
1110 octave_possible_pagers="$octave_possible_pagers more.com" |
|
1111 ;; |
|
1112 esac |
|
1113 |
|
1114 AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) |
405
|
1115 if test -z "$DEFAULT_PAGER"; then |
832
|
1116 AC_MSG_WARN([I couldn't find `less', `more', `page', or `pg']) |
405
|
1117 fi |
869
|
1118 |
2032
|
1119 ### Even though we include config.h, we need to have the preprocessor |
|
1120 ### defines available in a variable for the octave-bug script. Use |
|
1121 ### UGLY_DEFS for that. |
|
1122 |
|
1123 AC_OUTPUT_MAKE_DEFS |
2162
|
1124 UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'` |
2032
|
1125 AC_MSG_RESULT([defining UGLY_DEFS to be $UGLY_DEFS]) |
|
1126 AC_SUBST(UGLY_DEFS) |
|
1127 |
869
|
1128 ### Maybe add -Wall to compiler flags now that we're done feature |
|
1129 ### testing. |
|
1130 ### |
|
1131 ### To get gcc and g++ to be really picky, try these adding these |
|
1132 ### options to CFLAGS and CXXFLAGS along with -Wall: |
|
1133 ### |
|
1134 ### -ansi |
|
1135 ### -pedantic |
|
1136 ### -Wwrite-strings |
|
1137 ### -Wid-clash-31 |
|
1138 ### -Wpointer-arith |
|
1139 ### -Wcast-qual |
|
1140 ### -Wenum-clash |
|
1141 ### -Wcast-align |
|
1142 ### -Wtraditional |
|
1143 ### -Wstrict-prototypes |
|
1144 ### -Wmissing-prototypes |
|
1145 ### -Wnested-externs |
|
1146 ### -Woverloaded-virtual |
|
1147 ### -Winline |
|
1148 ### -felide-constructors |
|
1149 ### -fnonnull-objects |
|
1150 |
405
|
1151 if $ADD_CXX_WALL; then |
1481
|
1152 CXXFLAGS="$CXXFLAGS -Wall" |
832
|
1153 AC_MSG_RESULT([adding -Wall to CXXFLAGS]) |
405
|
1154 fi |
|
1155 if $ADD_CC_WALL; then |
1481
|
1156 CFLAGS="$CFLAGS -Wall" |
832
|
1157 AC_MSG_RESULT([adding -Wall to CFLAGS]) |
405
|
1158 fi |
869
|
1159 |
1146
|
1160 ### Run configure in subdirectories. |
|
1161 |
1304
|
1162 export CC |
|
1163 export CXX |
|
1164 export F77 |
|
1165 |
2064
|
1166 AC_CONFIG_SUBDIRS(glob kpathsea scripts $INFO_DIR $PLPLOT_DIR $READLINE_DIR) |
1146
|
1167 |
869
|
1168 ### Do the substitutions in all the Makefiles. |
|
1169 |
2064
|
1170 AC_OUTPUT(Makefile octMakefile Makeconf test/Makefile dlfcn/Makefile |
2475
|
1171 doc/Makefile doc/faq/Makefile doc/interpreter/Makefile |
2626
|
1172 doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile |
2629
|
1173 emacs/Makefile examples/Makefile liboctave/Makefile |
|
1174 src/Makefile libcruft/Makefile libcruft/Makerules |
|
1175 libcruft/blas/Makefile libcruft/balgen/Makefile |
2475
|
1176 libcruft/dassl/Makefile libcruft/eispack/Makefile |
|
1177 libcruft/fftpack/Makefile libcruft/fsqp/Makefile |
|
1178 libcruft/lapack/Makefile libcruft/linpack/Makefile |
|
1179 libcruft/minpack/Makefile libcruft/misc/Makefile |
|
1180 libcruft/npsol/Makefile libcruft/odepack/Makefile |
|
1181 libcruft/qpsol/Makefile libcruft/quadpack/Makefile |
|
1182 libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile |
|
1183 libcruft/villad/Makefile) |
1225
|
1184 |
|
1185 ### Print a summary so that important information isn't missed. |
|
1186 |
|
1187 CXX_EXTRAS="$HOST_CXXFLAGS $NO_IMPLICIT_TEMPLATES $GCC_IEEE_FP_FLAG" |
|
1188 |
|
1189 if test -z "$F77"; then |
|
1190 FORT="$F2C $F2CFLAGS" |
|
1191 else |
2610
|
1192 FORT="$F77 $FFLAGS" |
1225
|
1193 fi |
|
1194 |
|
1195 AC_MSG_RESULT([ |
|
1196 |
|
1197 Octave is now configured for $canonical_host_type |
|
1198 |
1664
|
1199 Source directory: $srcdir |
|
1200 Installation prefix: $prefix |
|
1201 C compiler: $CC $GCC_IEEE_FP_FLAG $CFLAGS |
|
1202 C++ compiler: $CXX $CXX_EXTRAS $CXXFLAGS |
|
1203 Fortran compiler: $FORT |
|
1204 Fortran libraries: $FLIBS |
|
1205 Use GNU readline: $USE_READLINE |
|
1206 Use GNU info reader: $USE_GNU_INFO |
|
1207 Default pager: $DEFAULT_PAGER |
|
1208 gnuplot: $GNUPLOT_BINARY |
|
1209 |
2108
|
1210 Do internal array bounds checking: $BOUNDS_CHECKING |
1679
|
1211 Build shared libraries: $SHARED_LIBS |
|
1212 Minimal kernel option: $OCTAVE_LITE |
|
1213 Dynamic Linking (dlopen/dlsym): $WITH_DL |
|
1214 Dynamic Linking (shl_load/shl_findsym): $WITH_SHL |
1225
|
1215 ]) |