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