5
|
1 dnl Process this file with autoconf to produce a configure script. |
|
2 dnl |
|
3 AC_INIT([[src]]/octave.cc)dnl |
|
4 |
|
5 # See if we were given the target host type. If not, guess. |
|
6 |
|
7 if test $# -gt 0; then |
|
8 TARGET=`eval echo $\{\`echo $#\`\}` |
|
9 case $TARGET in |
|
10 -*) target_host_type= ;; |
|
11 *) target_host_type=$TARGET ;; |
|
12 esac |
|
13 fi |
|
14 |
|
15 if test -z "$target_host_type" -o "$target_host_type" = unknown; then |
|
16 target_host_type=`sh $srcdir/config.guess` |
|
17 if test -z "$target_host_type"; then |
|
18 echo "warning: unable to guess system type" |
|
19 target_host_type=unknown |
|
20 fi |
|
21 fi |
|
22 |
|
23 case "$target_host_type" in |
|
24 unknown) |
|
25 echo "configuring Octave for an unknown system type" |
|
26 ;; |
|
27 *) |
|
28 echo "configuring Octave for a $target_host_type" |
|
29 ;; |
|
30 esac |
|
31 AC_SUBST(target_host_type)dnl |
|
32 |
|
33 # Set up to handle --with-FOO options. |
|
34 |
|
35 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl |
|
36 AC_WITH(dld, use_dld=true, use_dld=false)dnl |
|
37 |
|
38 DYNAMIC_LD_OBJ= |
|
39 DLD_DIR= |
|
40 LIBDLD= |
|
41 DLD_OBJECTS='$(DLD_OBJECTS)' |
|
42 LD_STATIC_FLAG= |
|
43 if $use_dld; then |
|
44 DYNAMIC_LD_OBJ='dynamic-ld.o' |
|
45 DLD_DIR=dld |
|
46 LIBDLD='../libdld.a' |
|
47 DLD_OBJECTS= : # don't link them in if doing dynamic linking |
|
48 DEFS="$DEFS -DWITH_DLD=1" |
|
49 LD_STATIC_FLAG=-static |
|
50 fi |
|
51 AC_SUBST(DYNAMIC_LD_OBJ)dnl |
|
52 AC_SUBST(DLD_DIR)dnl |
|
53 AC_SUBST(LIBDLD)dnl |
|
54 AC_SUBST(DLD_OBJECTS)dnl |
|
55 AC_SUBST(LD_STATIC_FLAG)dnl |
|
56 |
|
57 echo "checking for npsol" |
|
58 if test -f $srcdir/libcruft/npsol/npsol.f; then |
|
59 : |
|
60 else |
|
61 DEFS="$DEFS -DNPSOL_MISSING=1" |
|
62 fi |
|
63 |
|
64 echo "checking for qpsol" |
|
65 if test -f $srcdir/libcruft/qpsol/qpsol.f; then |
|
66 : |
|
67 else |
|
68 DEFS="$DEFS -DQPSOL_MISSING=1" |
|
69 fi |
|
70 |
|
71 echo "checking for fsqp" |
|
72 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then |
|
73 : |
|
74 else |
|
75 DEFS="$DEFS -DFSQP_MISSING=1" |
|
76 fi |
|
77 |
|
78 AC_PROG_CC |
|
79 AC_GCC_TRADITIONAL |
80
|
80 |
5
|
81 AC_AIX |
80
|
82 AC_DYNIX_SEQ |
|
83 AC_ISC_POSIX |
|
84 AC_MINIX |
|
85 |
|
86 AC_ALLOCA |
|
87 AC_CONST |
5
|
88 |
|
89 # Do special things for gcc. |
|
90 |
|
91 case "$CC" in |
|
92 gcc*) |
|
93 CFLAGS="-g -O -Wall" |
|
94 LDFLAGS="-g -O" |
|
95 gcc_version=`gcc -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` |
|
96 case "$gcc_version" in |
|
97 1.*) |
|
98 cat << EOF |
|
99 warning: gcc version $gcc_version is likely to cause problems -- |
|
100 you should probably consider getting version 2.x |
|
101 EOF |
|
102 ;; |
|
103 esac |
|
104 ;; |
|
105 *) |
|
106 CFLAGS="-g" |
|
107 LDFLAGS="-g" |
|
108 ;; |
|
109 esac |
|
110 AC_SUBST(CFLAGS)dnl |
|
111 AC_SUBST(LDFLAGS)dnl |
|
112 |
|
113 AC_PROGRAM_CHECK(GXX, g++, g++, [])dnl |
|
114 if test "$GXX" = g++ ; then |
|
115 CXXFLAGS="-g -O -Wall" |
|
116 gxx_version=`g++ -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'` |
|
117 case "$gxx_version" in |
|
118 1.*) |
|
119 cat << EOF |
|
120 warning: g++ version $gxx_version is likely to cause problems -- |
|
121 you should probably consider getting version 2.x |
|
122 EOF |
|
123 ;; |
|
124 esac |
|
125 else |
|
126 cat << EOF |
|
127 warning: Octave has only been tested with g++, and I can't |
|
128 seem to find it. |
|
129 EOF |
|
130 fi |
|
131 AC_SUBST(CXXFLAGS)dnl |
|
132 |
|
133 # If we haven't been forced to use f2c, try to find a Fortran compiler |
|
134 # under any one of several common Un*x Fortran compiler names. |
|
135 # Put fc last to avoid confusion with some vendor's /bin/sh fc |
|
136 # builtin. |
|
137 # |
|
138 # g77 : GNU Fortran (someday...) |
|
139 # xlf : IBM / AIX |
|
140 # cf77 : Cray / Unicos |
|
141 # fc : Convex |
|
142 # |
|
143 # I don't think the Cray compiler will ever work like f2c... |
|
144 |
|
145 if $use_f2c; then |
|
146 true |
|
147 else |
|
148 F77= |
|
149 AC_PROGRAMS_CHECK(F77, g77 xlf cf77 f77 fc)dnl |
|
150 |
|
151 # If it looks like we have a Fortran compiler, try to determine |
|
152 # whether it might be compatible with f2c. |
|
153 |
|
154 if test -n "$F77"; then |
|
155 echo "checking $F77/f2c compatibility" |
|
156 export F77 |
|
157 export CC |
|
158 tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh` |
|
159 status=$? |
|
160 if test $status -eq 0; then |
|
161 if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then |
|
162 DEFS="$DEFS $tmpdef" |
|
163 fi |
|
164 else |
|
165 F77= |
|
166 fi |
|
167 fi |
|
168 fi |
|
169 |
|
170 # If we can't find a Fortran compiler, or if it looks like it isn't |
|
171 # compatible with f2c, try to find f2c. |
|
172 |
|
173 if test -z "$F77"; then |
|
174 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl |
|
175 fi |
|
176 |
|
177 F2CFLAGS= |
|
178 FFLAGS="-O" |
|
179 if test -n "$F77"; then |
|
180 export F77 |
|
181 FLIBS=`sh $srcdir/flibs.sh` |
|
182 DOT_O_DOT_F_C1= |
|
183 DOT_O_DOT_F_C2= |
|
184 DOT_O_DOT_F_C3= |
|
185 DOT_O_DOT_F_C4= |
|
186 DEFAULT_DOT_C_FROM_DOT_F= |
|
187 DEFAULT_DOT_O_FROM_DOT_F= |
|
188 elif test -n "$F2C" || $use_f2c; then |
|
189 AC_HAVE_LIBRARY(f2c, FLIBS=-lf2c, [])dnl |
|
190 if test -z "$FLIBS" ; then |
|
191 AC_HAVE_LIBRARY(F77, FLIBS=-lF77, [])dnl |
|
192 if test -n "$FLIBS" ; then |
|
193 AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl |
|
194 fi |
|
195 fi |
|
196 if test -z "$FLIBS" ; then |
|
197 cat << EOF |
|
198 warning: I found f2c but I couldn't find libf2c.a, or |
|
199 libF77.a and libI77.a |
|
200 EOF |
|
201 fi |
|
202 DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\ |
|
203 # If we are using f2c we should also turn off the default rule for\ |
|
204 # making objects from .f files so that we do not invoke the fortran\ |
|
205 # compiler by mistake.\ |
|
206 \ |
|
207 \%.c : \%.f\ |
|
208 cat $< | $(F2C) $(F2CFLAGS) > $(@F)' |
|
209 DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f' |
|
210 DEFS="$DEFS -DF77_APPEND_UNDERSCORE=1" |
|
211 else |
|
212 cat << EOF |
|
213 warning: in order to build octave, you must have a compatible |
|
214 Fortran compiler or f2c installed and in your path. |
|
215 See the file INSTALL for more information. |
|
216 Continuing anyway... |
|
217 EOF |
|
218 fi |
|
219 |
|
220 AC_SUBST(FFLAGS)dnl |
|
221 AC_SUBST(FLIBS)dnl |
|
222 AC_SUBST(F2C)dnl |
|
223 AC_SUBST(F2CFLAGS)dnl |
|
224 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl |
|
225 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl |
|
226 |
|
227 AC_PROG_INSTALL |
|
228 AC_PROG_RANLIB |
|
229 AC_STDC_HEADERS |
80
|
230 AC_HAVE_HEADERS(string.h) |
5
|
231 AC_UNISTD_H |
|
232 AC_DIR_HEADER |
|
233 |
|
234 # For now, don't define LEXLIB to be -lfl -- we don't use anything in |
|
235 # it, and it might not be installed. |
|
236 # |
|
237 # Also make sure that we generate an interactive scanner if we are |
|
238 # using flex. |
|
239 |
|
240 AC_PROG_LEX |
|
241 case "$LEX" in |
|
242 flex*) |
|
243 LFLAGS="-t -I" |
|
244 LEXLIB= |
|
245 ;; |
|
246 *) |
|
247 LFLAGS="-t" |
|
248 cat << EOF |
|
249 warning: I didn't find flex, but that's only a problem |
|
250 if you need to reconstruct lex.cc |
|
251 EOF |
|
252 ;; |
|
253 esac |
|
254 AC_SUBST(LFLAGS)dnl |
|
255 |
|
256 AC_PROG_YACC |
|
257 case "$YACC" in |
|
258 bison*) |
|
259 ;; |
|
260 *) |
|
261 cat << EOF |
|
262 warning: I didn't find bison, but that's only a problem |
|
263 if you need to reconstruct parse.cc |
|
264 EOF |
|
265 ;; |
|
266 esac |
|
267 |
|
268 # Define VOID_SIGHANDLER for readline. |
|
269 |
|
270 AC_RETSIGTYPE |
|
271 case "$RETSIGTYPE" in |
|
272 int) |
|
273 ;; |
|
274 *) |
|
275 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" |
|
276 ;; |
|
277 esac |
|
278 AC_SUBST(VOID_SIGHANDLER)dnl |
|
279 |
136
|
280 AC_HAVE_HEADERS(termios.h termio.h sgtty.h)dnl |
5
|
281 case "$DEFS" in |
136
|
282 *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*) |
5
|
283 ;; |
|
284 *) |
136
|
285 echo "I couldn't find termios.h, termio.h, or sgtty.h!" |
|
286 exit 1 |
|
287 ;; |
5
|
288 esac |
|
289 |
|
290 # Hack for readline's sysdep.h |
|
291 |
|
292 case "$target_host_type" in |
|
293 *next*) |
|
294 echo "using BSD version of readline/sysdep.h on the NeXT" |
|
295 rm -f readline/sysdep.h |
|
296 cp readline/sysdep-obsd.h readline/sysdep.h |
|
297 ;; |
|
298 esac |
|
299 |
|
300 # Check to see if we have IEEE math functions, and if so, which ones. |
|
301 # |
|
302 # Also check for some additional trig functions that aren't ANSI but |
|
303 # are often available. If they are missing, we try to replace them |
|
304 # with functions from the BSD/NET2 math library. |
|
305 |
28
|
306 AC_HAVE_LIBRARY(-lm)dnl |
5
|
307 AC_HAVE_FUNCS(finite isnan isinf)dnl |
|
308 AC_REPLACE_FUNCS(acosh asinh atanh)dnl |
|
309 |
|
310 if test -n "$LIBOBJS"; then |
|
311 for func in $LIBOBJS |
|
312 do |
|
313 case "$func" in |
|
314 *acosh.o*) |
|
315 DEFS="$DEFS -DACOSH_MISSING=1" |
|
316 ;; |
|
317 *asinh.o*) |
|
318 DEFS="$DEFS -DASINH_MISSING=1" |
|
319 ;; |
|
320 *atanh.o*) |
|
321 DEFS="$DEFS -DATANH_MISSING=1" |
|
322 ;; |
|
323 esac |
|
324 done |
|
325 |
|
326 case $LIBOBJS in |
|
327 *acosh.o* | *asinh.o*) |
|
328 AC_REPLACE_FUNCS(copysign)dnl |
|
329 ;; |
|
330 esac |
|
331 |
|
332 case $LIBOBJS in |
|
333 *acosh.o* | *asinh.o* | *atanh.o*) |
|
334 AC_REPLACE_FUNCS(log1p)dnl |
|
335 ;; |
|
336 esac |
|
337 |
|
338 case $LIBOBJS in |
|
339 *log1p*) |
|
340 AC_REPLACE_FUNCS(log__L)dnl |
|
341 ;; |
|
342 esac |
|
343 |
|
344 case $LIBOBJS in |
|
345 *log1p*) |
|
346 AC_REPLACE_FUNCS(finite)dnl |
|
347 ;; |
|
348 esac |
|
349 |
|
350 case $LIBOBJS in |
|
351 *copysign* | *finite* | *log1p*) |
|
352 AC_REPLACE_FUNCS(logb scalb)dnl |
|
353 ;; |
|
354 esac |
|
355 fi |
|
356 |
|
357 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl |
|
358 if test -z "$GNUPLOT_BINARY"; then |
|
359 cat << EOF |
|
360 warning: I didn't find gnuplot. It isn't necessary to have gnuplot |
|
361 installed, but you won't be able to use any of Octave's |
|
362 plotting commands without it. |
|
363 |
|
364 If gnuplot is installed but it isn't in your path, you can |
|
365 tell Octave where to find it by typing the command |
|
366 |
|
367 gnuplot_binary = '/full/path/to/gnuplot/binary' |
|
368 |
|
369 at the Octave prompt. |
|
370 EOF |
|
371 fi |
|
372 |
28
|
373 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl |
5
|
374 if test -z "$DEFAULT_PAGER"; then |
|
375 echo "warning: I couldn't find less(1), more(1), page(1), or pg(1)" |
28
|
376 elif test "$DEFAULT_PAGER" = less; then |
|
377 DEFAULT_PAGER="less -e" |
5
|
378 fi |
|
379 |
|
380 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl |
|
381 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl |
|
382 if test -z "$EXPECT" ; then |
|
383 RUNTEST= |
|
384 fi |
|
385 AC_SUBST(RUNTEST)dnl |
|
386 |
39
|
387 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl |
80
|
388 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl |
|
389 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl |
|
390 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl |
|
391 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl |
|
392 define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl |
|
393 define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl |
|
394 define([tmph], [libcruft/ranlib/Makefile libcruft/villad/Makefile])dnl |
5
|
395 define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph])dnl |
|
396 define([tmpA], [Makefile Makeconf libcruft/Makefile libcruft/Makerules])dnl |
|
397 define([tmpB], [liboctave/Makefile src/Makefile])dnl |
|
398 define([tmpC], [dld/Makefile readline/Makefile readline/doc/Makefile])dnl |
|
399 define([tmpD], [readline/examples/Makefile doc/Makefile])dnl |
|
400 define([tmpE], [scripts/Makefile test/Makefile])dnl |
|
401 define([tmpF], [test/config/Makefile test/octave/Makefile])dnl |
|
402 define([srcdirs], [tmpA tmpB tmpC tmpD tmpE tmpF])dnl |
|
403 AC_OUTPUT([srcdirs cruftdirs])dnl |