comparison configure.in @ 369:f436b7a5f26a

[project @ 1994-02-17 04:49:21 by jwe]
author jwe
date Thu, 17 Feb 1994 04:49:21 +0000
parents 8c7677b435ad
children 431896eee4db
comparison
equal deleted inserted replaced
368:5c987c27f3d7 369:f436b7a5f26a
1 dnl Process this file with autoconf to produce a configure script. 1 dnl Process this file with autoconf to produce a configure script.
2 dnl 2 dnl
3 AC_INIT([[src]]/octave.cc)dnl 3 AC_INIT([[src]]/octave.cc)dnl
4 AC_CONFIG_HEADER(config.h)dnl 4 AC_CONFIG_HEADER(config.h)dnl
5 5 dnl
6 root_srcdir=$srcdir 6 root_srcdir=$srcdir
7 AC_SUBST(root_srcdir)dnl 7 AC_SUBST(root_srcdir)dnl
8 8 dnl
9 AC_DEFINE(OCTAVE_SOURCE, 1)dnl 9 AC_DEFINE(OCTAVE_SOURCE, 1)dnl
10 10 dnl
11 # See if we were given the target host type. If not, guess. 11 dnl See if we were given the target host type. If not, guess.
12 12 dnl
13 if test $# -gt 0; then 13 if test $# -gt 0; then
14 TARGET=`eval echo $\{\`echo $#\`\}` 14 TARGET=`eval echo $\{\`echo $#\`\}`
15 case $TARGET in 15 case $TARGET in
16 -*) target_host_type= ;; 16 -*) target_host_type= ;;
17 *) target_host_type=$TARGET ;; 17 *) target_host_type=$TARGET ;;
18 esac 18 esac
19 fi 19 fi
20 20 dnl
21 if test -z "$target_host_type" -o "$target_host_type" = unknown; then 21 if test -z "$target_host_type" -o "$target_host_type" = unknown; then
22 target_host_type=`sh $srcdir/config.guess` 22 target_host_type=`sh $srcdir/config.guess`
23 if test -z "$target_host_type"; then 23 if test -z "$target_host_type"; then
24 echo "warning: unable to guess system type" 24 echo "warning: unable to guess system type"
25 target_host_type=unknown 25 target_host_type=unknown
26 fi 26 fi
27 fi 27 fi
28 28 dnl
29 canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1` 29 canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1`
30 status=$? 30 status=$?
31 if test $status -eq 0; then 31 if test $status -eq 0; then
32 echo "configuring Octave for a $target_host_type" 32 echo "configuring Octave for a $target_host_type"
33 else 33 else
34 canonical_host_type=unknown 34 canonical_host_type=unknown
35 echo "configuring Octave for an unknown system type" 35 echo "configuring Octave for an unknown system type"
36 fi 36 fi
37 AC_SUBST(target_host_type)dnl 37 AC_SUBST(target_host_type)dnl
38 38 dnl
39 # Set up to handle --with-FOO options. 39 dnl Set up to handle --with-FOO options.
40 40 dnl
41 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl 41 AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl
42 AC_WITH(dld, use_dld=true, use_dld=false)dnl 42 AC_WITH(dld, use_dld=true, use_dld=false)dnl
43 43 dnl
44 DYNAMIC_LD_OBJ= 44 DYNAMIC_LD_OBJ=
45 DLD_DIR= 45 DLD_DIR=
46 LIBDLD= 46 LIBDLD=
47 DLD_OBJECTS='$(DLD_OBJECTS)' 47 DLD_OBJECTS='$(DLD_OBJECTS)'
48 LD_STATIC_FLAG= 48 LD_STATIC_FLAG=
57 AC_SUBST(DYNAMIC_LD_OBJ)dnl 57 AC_SUBST(DYNAMIC_LD_OBJ)dnl
58 AC_SUBST(DLD_DIR)dnl 58 AC_SUBST(DLD_DIR)dnl
59 AC_SUBST(LIBDLD)dnl 59 AC_SUBST(LIBDLD)dnl
60 AC_SUBST(DLD_OBJECTS)dnl 60 AC_SUBST(DLD_OBJECTS)dnl
61 AC_SUBST(LD_STATIC_FLAG)dnl 61 AC_SUBST(LD_STATIC_FLAG)dnl
62 62 dnl
63 echo "checking for npsol" 63 echo "checking for npsol"
64 if test -f $srcdir/libcruft/npsol/npsol.f; then 64 if test -f $srcdir/libcruft/npsol/npsol.f; then
65 : 65 :
66 else 66 else
67 AC_DEFINE(NPSOL_MISSING, 1)dnl 67 AC_DEFINE(NPSOL_MISSING, 1)dnl
68 fi 68 fi
69 69 dnl
70 echo "checking for qpsol" 70 echo "checking for qpsol"
71 if test -f $srcdir/libcruft/qpsol/qpsol.f; then 71 if test -f $srcdir/libcruft/qpsol/qpsol.f; then
72 : 72 :
73 else 73 else
74 AC_DEFINE(QPSOL_MISSING, 1)dnl 74 AC_DEFINE(QPSOL_MISSING, 1)dnl
75 fi 75 fi
76 76 dnl
77 echo "checking for fsqp" 77 echo "checking for fsqp"
78 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then 78 if test -f $srcdir/libcruft/fsqp/fsqpd.f; then
79 : 79 :
80 else 80 else
81 AC_DEFINE(FSQP_MISSING, 1)dnl 81 AC_DEFINE(FSQP_MISSING, 1)dnl
82 fi 82 fi
83 83 dnl
84 AC_PROG_CC 84 AC_PROG_CC
85 AC_GCC_TRADITIONAL 85 AC_GCC_TRADITIONAL
86 AC_MINIX 86 AC_MINIX
87 AC_ISC_POSIX 87 AC_ISC_POSIX
88 AC_AIX 88 AC_AIX
89 AC_DYNIX_SEQ 89 AC_DYNIX_SEQ
90 AC_ALLOCA 90 AC_ALLOCA
91 AC_CONST 91 AC_CONST
92 92 dnl
93 # Do special things for gcc. 93 dnl Do special things for gcc.
94 94 dnl
95 case "$CC" in 95 case "$CC" in
96 gcc* | */gcc*) 96 gcc* | */gcc*)
97 CFLAGS="-g -O -Wall" 97 CFLAGS="-g -O -Wall"
98 LDFLAGS="-g -O" 98 LDFLAGS="-g -O"
99 gcc_version=`gcc -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'` 99 gcc_version=`gcc -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'`
116 LDFLAGS="-g" 116 LDFLAGS="-g"
117 ;; 117 ;;
118 esac 118 esac
119 AC_SUBST(CFLAGS)dnl 119 AC_SUBST(CFLAGS)dnl
120 AC_SUBST(LDFLAGS)dnl 120 AC_SUBST(LDFLAGS)dnl
121 121 dnl
122 AC_PROGRAM_CHECK(CXX, g++, g++, [])dnl 122 AC_PROGRAM_CHECK(CXX, g++, g++, [])dnl
123 if test "$CXX" = g++ ; then 123 if test "$CXX" = g++ ; then
124 CXXFLAGS="-g -O -Wall" 124 CXXFLAGS="-g -O -Wall"
125 gxx_version=`g++ -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'` 125 gxx_version=`g++ -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'`
126 case "$gxx_version" in 126 case "$gxx_version" in
141 seem to find it. 141 seem to find it.
142 EOF 142 EOF
143 fi 143 fi
144 AC_SUBST(CXXFLAGS)dnl 144 AC_SUBST(CXXFLAGS)dnl
145 AC_SUBST(EXTERNAL_TEMPLATES)dnl 145 AC_SUBST(EXTERNAL_TEMPLATES)dnl
146 146 dnl
147 case "$canonical_host_type" in 147 case "$canonical_host_type" in
148 i386-*-linux | i486-*-linux | i586-*-linux) 148 i386-*-linux | i486-*-linux | i586-*-linux)
149 GCC_IEEE_FP_FLAG="-mieee-fp" 149 GCC_IEEE_FP_FLAG="-mieee-fp"
150 ;; 150 ;;
151 esac 151 esac
152 AC_SUBST(GCC_IEEE_FP_FLAG)dnl 152 AC_SUBST(GCC_IEEE_FP_FLAG)dnl
153 153 dnl
154 # If we haven't been forced to use f2c, try to find a Fortran compiler 154 dnl If we haven't been forced to use f2c, try to find a Fortran compiler
155 # under any one of several common Un*x Fortran compiler names. 155 dnl under any one of several common Un*x Fortran compiler names.
156 # Put fc last to avoid confusion with some vendor's /bin/sh fc 156 dnl Put fc last to avoid confusion with some vendor's /bin/sh fc
157 # builtin. 157 dnl builtin.
158 # 158 dnl
159 # xlf : IBM / AIX 159 dnl xlf : IBM / AIX
160 # cf77 : Cray / Unicos 160 dnl cf77 : Cray / Unicos
161 # fc : Convex 161 dnl fc : Convex
162 # g77 : GNU Fortran (someday...) 162 dnl g77 : GNU Fortran (someday...)
163 # 163 dnl
164 # I don't think the Cray compiler will ever work like f2c... 164 dnl I don't think the Cray compiler will ever work like f2c...
165 165 dnl
166 if $use_f2c; then 166 if $use_f2c; then
167 true 167 true
168 else 168 else
169 F77= 169 F77=
170 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 fc g77)dnl 170 AC_PROGRAMS_CHECK(F77, xlf cf77 f77 fc g77)dnl
185 else 185 else
186 F77= 186 F77=
187 fi 187 fi
188 fi 188 fi
189 fi 189 fi
190 190 dnl
191 # If we can't find a Fortran compiler, or if it looks like it isn't 191 dnl If we can't find a Fortran compiler, or if it looks like it isn't
192 # compatible with f2c, try to find f2c. 192 dnl compatible with f2c, try to find f2c.
193 193 dnl
194 if test -z "$F77"; then 194 if test -z "$F77"; then
195 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl 195 AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl
196 fi 196 fi
197 197 dnl
198 F2CFLAGS= 198 F2CFLAGS=
199 FFLAGS="-O" 199 FFLAGS="-O"
200 if test -n "$F77"; then 200 if test -n "$F77"; then
201 export F77 201 export F77
202 FLIBS=`sh $srcdir/flibs.sh` 202 FLIBS=`sh $srcdir/flibs.sh`
235 Fortran compiler or f2c installed and in your path. 235 Fortran compiler or f2c installed and in your path.
236 See the file INSTALL for more information. 236 See the file INSTALL for more information.
237 Continuing anyway... 237 Continuing anyway...
238 EOF 238 EOF
239 fi 239 fi
240 240 dnl
241 AC_SUBST(FFLAGS)dnl 241 AC_SUBST(FFLAGS)dnl
242 AC_SUBST(FLIBS)dnl 242 AC_SUBST(FLIBS)dnl
243 AC_SUBST(F2C)dnl 243 AC_SUBST(F2C)dnl
244 AC_SUBST(F2CFLAGS)dnl 244 AC_SUBST(F2CFLAGS)dnl
245 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl 245 AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl
246 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl 246 AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl
247 247 dnl
248 AC_PROG_INSTALL 248 AC_PROG_INSTALL
249 AC_PROG_RANLIB 249 AC_PROG_RANLIB
250 AC_STDC_HEADERS 250 AC_STDC_HEADERS
251 AC_HAVE_HEADERS(string.h varargs.h unistd.h sys/utsname.h)dnl 251 AC_HAVE_HEADERS(string.h varargs.h unistd.h sys/utsname.h)dnl
252 AC_HAVE_HEADERS(sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/select.h)dnl 252 AC_HAVE_HEADERS(sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/select.h)dnl
264 break 264 break
265 ;; 265 ;;
266 esac 266 esac
267 done 267 done
268 AC_SUBST(TERMLIBS) 268 AC_SUBST(TERMLIBS)
269 269 dnl
270 # For now, don't define LEXLIB to be -lfl -- we don't use anything in 270 dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in
271 # it, and it might not be installed. 271 dnl it, and it might not be installed.
272 # 272 dnl
273 # Also make sure that we generate an interactive scanner if we are 273 dnl Also make sure that we generate an interactive scanner if we are
274 # using flex. 274 dnl using flex.
275 275 dnl
276 AC_PROG_LEX 276 AC_PROG_LEX
277 case "$LEX" in 277 case "$LEX" in
278 flex*) 278 flex*)
279 LFLAGS="-t -I" 279 LFLAGS="-t -I"
280 LEXLIB= 280 LEXLIB=
286 if you need to reconstruct lex.cc 286 if you need to reconstruct lex.cc
287 EOF 287 EOF
288 ;; 288 ;;
289 esac 289 esac
290 AC_SUBST(LFLAGS)dnl 290 AC_SUBST(LFLAGS)dnl
291 291 dnl
292 AC_PROG_YACC 292 AC_PROG_YACC
293 case "$YACC" in 293 case "$YACC" in
294 bison*) 294 bison*)
295 ;; 295 ;;
296 *) 296 *)
298 warning: I didn't find bison, but that's only a problem 298 warning: I didn't find bison, but that's only a problem
299 if you need to reconstruct parse.cc 299 if you need to reconstruct parse.cc
300 EOF 300 EOF
301 ;; 301 ;;
302 esac 302 esac
303 303 dnl
304 # Define VOID_SIGHANDLER for readline. 304 dnl Define VOID_SIGHANDLER for readline.
305 305 dnl
306 AC_RETSIGTYPE 306 AC_RETSIGTYPE
307 case "$RETSIGTYPE" in 307 case "$RETSIGTYPE" in
308 int) 308 int)
309 ;; 309 ;;
310 *) 310 *)
311 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1" 311 VOID_SIGHANDLER="-DVOID_SIGHANDLER=1"
312 ;; 312 ;;
313 esac 313 esac
314 AC_SUBST(VOID_SIGHANDLER)dnl 314 AC_SUBST(VOID_SIGHANDLER)dnl
315 315 dnl
316 # Use sgtty on Ultrix so that using DEC Migrate to convert a Mips 316 dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips
317 # binary to an Alpha binary will work. 317 dnl binary to an Alpha binary will work.
318 318 dnl
319 case "$canonical_host_type" in 319 case "$canonical_host_type" in
320 mips-dec-ultrix*) 320 mips-dec-ultrix*)
321 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])dnl 321 AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])dnl
322 ;; 322 ;;
323 esac 323 esac
324 324 dnl
325 case "$DEFS" in 325 case "$DEFS" in
326 *HAVE_SGTTY_H*) 326 *HAVE_SGTTY_H*)
327 ;; 327 ;;
328 *) 328 *)
329 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1), 329 AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1),
342 exit 1 342 exit 1
343 ;; 343 ;;
344 esac 344 esac
345 ;; 345 ;;
346 esac 346 esac
347 347 dnl
348 # Check to see if we have IEEE math functions, and if so, which ones. 348 dnl Check to see if we have IEEE math functions, and if so, which ones.
349 # 349 dnl
350 # For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP 350 dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP
351 # functions, otherwise we may not find them. 351 dnl functions, otherwise we may not find them.
352 # 352 dnl
353 # Also check for some additional trig functions that aren't ANSI but 353 dnl Also just using AC_HAVE_FUNCS doesn't seem to work to find isinf
354 # are often available. If they are missing, we try to replace them 354 dnl and isnan on Linux systems, so we use AC_FUNC_CHECK, and if that
355 # with functions from the BSD/NET2 math library. 355 dnl fails, we try again by including math.h and invoking the function
356 356 dnl with an argument.
357 dnl
358 dnl Also check for some additional trig functions that aren't ANSI but
359 dnl are often available. If they are missing, we try to replace them
360 dnl with functions from the BSD/NET2 math library.
361 dnl
357 AC_HAVE_LIBRARY(-lm)dnl 362 AC_HAVE_LIBRARY(-lm)dnl
358 XCFLAGS="$CFLAGS" 363 XCFLAGS="$CFLAGS"
359 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG" 364 CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG"
360 AC_HAVE_FUNCS(finite isnan isinf)dnl 365 for func in finite isnan isinf
366 do
367 trfunc=`echo $func | tr '[a-z]' '[A-Z]'`
368 AC_FUNC_CHECK([$func],
369 AC_DEFINE(HAVE_[$trfunc], 1),
370 AC_COMPILE_CHECK([$func], [#include <math.h>], [
371 /* The GNU C library defines this for functions which it implements
372 to always fail with ENOSYS. Some functions are actually named
373 something starting with __ and the normal name is an alias. */
374 #if defined (__stub_$func) || defined (__stub___$func)
375 choke me
376 #else
377 /* Override any gcc2 internal prototype to avoid an error. */
378 $func (1.0);
379 #endif
380 ],
381 AC_DEFINE(HAVE_[$trfunc], 1), []))dnl
382 done
383 dnl
361 CFLAGS="$XCFLAGS" 384 CFLAGS="$XCFLAGS"
362 AC_REPLACE_FUNCS(acosh asinh atanh)dnl 385 AC_REPLACE_FUNCS(acosh asinh atanh)dnl
363 386 dnl
364 if test -n "$LIBOBJS"; then 387 if test -n "$LIBOBJS"; then
365 for func in $LIBOBJS 388 for func in $LIBOBJS
366 do 389 do
367 case "$func" in 390 case "$func" in
368 *acosh.o*) 391 *acosh.o*)
405 *copysign* | *finite* | *log1p*) 428 *copysign* | *finite* | *log1p*)
406 AC_REPLACE_FUNCS(logb scalb)dnl 429 AC_REPLACE_FUNCS(logb scalb)dnl
407 ;; 430 ;;
408 esac 431 esac
409 fi 432 fi
410 433 dnl
411 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl 434 AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl
412 if test -z "$GNUPLOT_BINARY"; then 435 if test -z "$GNUPLOT_BINARY"; then
413 cat << EOF 436 cat << EOF
414 warning: I didn't find gnuplot. It isn't necessary to have gnuplot 437 warning: I didn't find gnuplot. It isn't necessary to have gnuplot
415 installed, but you won't be able to use any of Octave's 438 installed, but you won't be able to use any of Octave's
421 gnuplot_binary = '/full/path/to/gnuplot/binary' 444 gnuplot_binary = '/full/path/to/gnuplot/binary'
422 445
423 at the Octave prompt. 446 at the Octave prompt.
424 EOF 447 EOF
425 fi 448 fi
426 449 dnl
427 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl 450 AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl
428 if test -z "$DEFAULT_PAGER"; then 451 if test -z "$DEFAULT_PAGER"; then
429 echo "warning: I couldn't find less(1), more(1), page(1), or pg(1)" 452 echo "warning: I couldn't find less(1), more(1), page(1), or pg(1)"
430 elif test "$DEFAULT_PAGER" = less; then 453 elif test "$DEFAULT_PAGER" = less; then
431 DEFAULT_PAGER="less -e" 454 DEFAULT_PAGER="less -e"
432 fi 455 fi
433 456 dnl
434 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl 457 AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl
435 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl 458 AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl
436 if test -z "$EXPECT" ; then 459 if test -z "$EXPECT" ; then
437 RUNTEST= 460 RUNTEST=
438 fi 461 fi
439 AC_SUBST(RUNTEST)dnl 462 AC_SUBST(RUNTEST)dnl
440 463 dnl
441 UGLY_DEFS="$DEFS" 464 UGLY_DEFS="$DEFS"
442 AC_SUBST(UGLY_DEFS)dnl 465 AC_SUBST(UGLY_DEFS)dnl
443 466 dnl
444 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl 467 define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl
445 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl 468 define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl
446 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl 469 define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl
447 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl 470 define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl
448 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl 471 define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl