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