dnl configure.in
dnl
dnl Process this file with autoconf to produce a configure script.
dnl Requires GNU autoconf 1.8 or later.
dnl
dnl Copyright (C) 1992, 1993, 1994 John W. Eaton
dnl 
dnl This file is part of Octave.
dnl 
dnl Octave is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2, or (at your option) any
dnl later version.
dnl 
dnl Octave is distributed in the hope that it will be useful, but WITHOUT
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dnl for more details.
dnl 
dnl You should have received a copy of the GNU General Public License
dnl along with Octave; see the file COPYING.  If not, write to the Free
dnl Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
AC_REVISION($Revision: 1.42 $)dnl
AC_PREREQ(1.8)dnl
AC_INIT(src/octave.cc)
AC_CONFIG_HEADER(config.h kpathsea/c-auto.h)
dnl
AC_DEFINE(OCTAVE_SOURCE, 1)dnl
dnl
dnl See if we were given the target host type.  If not, use
dnl config.guess to try to guess the target host type.
dnl
if test $# -gt 0; then
  TARGET=`eval echo $\{\`echo $#\`\}`
  case $TARGET in
    -*)
      target_host_type=
    ;;
    *)
      target_host_type=$TARGET
    ;;
  esac
fi
dnl
if test -z "$target_host_type" -o "$target_host_type" = unknown; then
  target_host_type=`sh $srcdir/config.guess`
  if test -z "$target_host_type"; then
    AC_WARN([unable to guess system type])
    target_host_type=unknown
  fi
fi
dnl
dnl Use config.sub to come up with a standard vendor-host-os triple.
dnl
canonical_host_type=`sh $srcdir/config.sub $target_host_type 2>&1`
status=$?
if test $status -eq 0; then
  echo "configuring Octave for a $target_host_type"
else
  canonical_host_type=unknown
  AC_WARN([configuring Octave for an unknown system type])
fi
AC_SUBST(target_host_type)dnl
AC_VERBOSE([target_host_type is $target_host_type])
AC_VERBOSE([canonical_host_type is $canonical_host_type])
dnl
dnl Allow the user to force us to use f2c.
dnl
AC_WITH(f2c, use_f2c=true, use_f2c=false)dnl
dnl
dnl Allow the user to experiment with dynamic linking using GNU dld.
dnl
AC_ENABLE(dld, use_dld=true, use_dld=false)dnl
dnl
dnl some defaults
dnl
exec_prefix='$(prefix)'
bindir='$(exec_prefix)/bin'
datadir='$(prefix)/lib'
libdir='$(exec_prefix)/lib'
includedir='$(prefix)/include'
mandir='$(prefix)/man/man1'
infodir='$(prefix)/info'
fcnfiledir='$(datadir)/octave/$(version)/m//'
localfcnfilepath='$(datadir)/octave/site-m'
archlibdir='$(libdir)/octave/$(version)/$(target_host_type)/exec'
octfiledir='$(archlibdir)/oct'
localoctfilepath='$(datadir)/octave/$(target_host_type)/site-oct'
fcnfilepath='.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir):$(fcnfiledir)'
dnl
dnl Handle --enable-run-in-place.  This option makes Octave look for
dnl info and function files in the same directory tree as the sources.
dnl
AC_ENABLE(run-in-place, [
  run_in_place=true;
  if test "$enableval" = "yes"; then
    builddir="."
  else
    builddir=$enableval
  fi
], run_in_place=false)dnl
dnl
if $run_in_place; then
  AC_DEFINE(RUN_IN_PLACE, 1)dnl
  case "$srcdir" in
    /*)
      absolute_srcdir=$srcdir
    ;;
    *)
      AC_WARN([making srcdir absolute -- may lose with automounter])
      absolute_srcdir=`(cd $srcdir; pwd)`
    ;;
  esac
  case "$builddir" in
    /*)
      absolute_builddir=$builddir
    ;;
    *)
      AC_WARN([making builddir absolute -- may lose with automounter])
      absolute_builddir=`(cd $builddir; pwd)`
    ;;
  esac
  absolute_builddir=$absolute_builddir
  prefix=$absolute_srcdir
  infodir=$absolute_srcdir/info
  fcnfiledir=$absolute_srcdir/scripts//
  archlibdir=$absolute_builddir
  fcnfilepath='.:$(fcnfiledir)'
fi
AC_VERBOSE([setting prefix to $prefix])
AC_VERBOSE([setting exec_prefix to $exec_prefix])
AC_VERBOSE([setting bindir to $bindir])
AC_VERBOSE([setting datadir to $datadir])
AC_VERBOSE([setting libdir to $libdir])
AC_VERBOSE([setting includedir to $includedir])
AC_VERBOSE([setting mandir to $mandir])
AC_VERBOSE([setting infodir to $infodir])
AC_VERBOSE([setting fcnfiledir to $fcnfiledir])
AC_VERBOSE([setting localfcnfilepath to $localfcnfilepath])
AC_VERBOSE([setting archlibdir to $archlibdir])
AC_VERBOSE([setting octfiledir to $octfiledir])
AC_VERBOSE([setting localoctfilepath to $localoctfilepath])
AC_VERBOSE([setting fcnfilepath to $fcnfilepath])
AC_SUBST(exec_prefix)
AC_SUBST(bindir)
AC_SUBST(datadir)
AC_SUBST(libdir)
AC_SUBST(includedir)
AC_SUBST(mandir)
AC_SUBST(infodir)
AC_SUBST(fcnfiledir)
AC_SUBST(localfcnfilepath)
AC_SUBST(archlibdir)
AC_SUBST(octfiledir)
AC_SUBST(localoctfilepath)
AC_SUBST(fcnfilepath)
dnl
DYNAMIC_LD_OBJ=
DLD_DIR=
LIBDLD=
LIBOCTDLD='../liboctdld.a'
LD_STATIC_FLAG=
if $use_dld; then
  DYNAMIC_LD_OBJ='dynamic-ld.o'
  DLD_DIR=dld
  LIBDLD='../libdld.a'
  LIBOCTDLD= # don't link them in if doing dynamic linking
  LD_STATIC_FLAG=-static
  AC_DEFINE(WITH_DLD, 1)dnl
fi
if test -n "$DYNAMIC_LD_OBJ"; then
  AC_VERBOSE([setting DYNAMIC_LD_OBJ to $DYNAMIC_LD_OBJ])
fi
if test -n "$DLD_DIR"; then
  AC_VERBOSE([setting DLD_DIR to $DLD_DIR])
fi
if test -n "$LIBDLD"; then
  AC_VERBOSE([setting LIBDLD to $LIBDLD])
fi
if test -n "$LIBOCTDLD"; then
  AC_VERBOSE([setting LIBOCTDLD to $LIBOCTDLD])
fi
if test -n "$LD_STATIC_FLAG"; then
  AC_VERBOSE([setting LD_STATIC_FLAG to $LD_STATIC_FLAG])
fi
AC_SUBST(DYNAMIC_LD_OBJ)dnl
AC_SUBST(DLD_DIR)dnl
AC_SUBST(LIBDLD)dnl
AC_SUBST(LIBOCTDLD)dnl
AC_SUBST(LD_STATIC_FLAG)dnl
dnl
dnl See if the optional nonlinear programming code is present.
dnl
AC_CHECKING([for npsol])
if test -f $srcdir/libcruft/npsol/npsol.f; then
  :
else
  AC_DEFINE(NPSOL_MISSING, 1)dnl
fi
dnl
AC_CHECKING([for qpsol])
if test -f $srcdir/libcruft/qpsol/qpsol.f; then
  :
else
  AC_DEFINE(QPSOL_MISSING, 1)dnl
fi
dnl
AC_CHECKING([for fsqp])
if test -f $srcdir/libcruft/fsqp/fsqpd.f; then
  :
else
  AC_DEFINE(FSQP_MISSING, 1)dnl
fi
dnl
dnl See which C++ compiler to use (we expect to find g++).
dnl
AC_PROG_CXX
AC_PROG_CXXCPP
dnl
dnl Do special things for g++.
dnl
ADD_CXX_WALL=false
gxx_version=`$CXX -v 2>&1 | grep "^g.. version" | sed 's/^g.. version *//'`
case "$gxx_version" in
  2.5.*|2.6.*|2.7.*|2.8.*|2.9.*)
    CXXFLAGS="-g -O"
    AC_VERBOSE([setting CXXFLAGS to $CXXFLAGS])
    EXTERNAL_TEMPLATES="-fexternal-templates"
    AC_VERBOSE([setting EXTERNAL_TEMPLATES to $EXTERNAL_TEMPLATES])
    ADD_CXX_WALL=true
    AC_DEFINE(USE_EXTERNAL_TEMPLATES, 1)dnl
  ;;
  1.*)
    AC_WARN([g++ version $gxx_version will not work to compile Octave])
  ;;
  *)
    AC_WARN([Octave has only been tested with g++, and I can't find it])
  ;;
esac
dnl
AC_SUBST(CXXFLAGS)dnl
AC_SUBST(EXTERNAL_TEMPLATES)dnl
dnl
dnl See which C compiler to use (we expect to find gcc).
dnl
AC_PROG_CC
AC_PROG_CPP
AC_GCC_TRADITIONAL
dnl
dnl Do special things for gcc.
dnl
ADD_CC_WALL=false
gcc_version=`$CC -v 2>&1 | grep "^gcc version" | sed 's/^gcc version *//'`
case "$gcc_version" in
  2.*)
    CFLAGS="-g -O"
    AC_VERBOSE([setting CFLAGS to $CFLAGS])
    LDFLAGS="-g"
    AC_VERBOSE([setting LDFLAGS to $LDFLAGS])
    ADD_CC_WALL=true
  ;;
  1.*)
    AC_WARN([gcc version $gcc_version is likely to cause problems])
  ;;
  *)
    AC_WARN([Octave has only been tested with gcc, and I can't find it])
  ;;
esac
dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(LDFLAGS)dnl
dnl
dnl On Linux systems we need to compile with -mieee-fp to get full
dnl support for IEEE floating point.
dnl
case "$canonical_host_type" in
  i386-*-linux | i486-*-linux | i586-*-linux)
    GCC_IEEE_FP_FLAG="-mieee-fp"
    AC_VERBOSE([setting GCC_IEEE_FP_FLAG to $GCC_IEEE_FP_FLAG])
  ;;
esac
dnl
AC_SUBST(GCC_IEEE_FP_FLAG)dnl
dnl
dnl Special checks for odd OS specific things.
dnl
AC_ISC_POSIX
AC_MINIX
AC_AIX
AC_DYNIX_SEQ
AC_IRIX_SUN
AC_SCO_INTL
AC_XENIX_DIR
dnl
dnl How big are ints and how are they oriented?
dnl
AC_SIZEOF_TYPE(short)
AC_SIZEOF_TYPE(int)
AC_SIZEOF_TYPE(long)
AC_WORDS_BIGENDIAN
dnl
dnl Try to determine the floating point format.
dnl
AC_CHECKING([floating point format])
changequote(,)dnl
XCFLAGS=`echo $CFLAGS | sed 's/-O[^ \t]*//'`
changequote([,])dnl
${CC-cc} -DDP $XCFLAGS $LDFLAGS $srcdir/float-type.c -o conftest >/dev/null 2>&1
FLOAT_FORMAT=`./conftest`
case "$FLOAT_FORMAT" in
  IEEE_BIG_ENDIAN)
    AC_DEFINE(IEEE_BIG_ENDIAN, 1)dnl
  ;;
  IEEE_LITTLE_ENDIAN)
    AC_DEFINE(IEEE_LITTLE_ENDIAN, 1)dnl
  ;;
  VAX_D_FLOAT)
    AC_DEFINE(VAX_D_FLOAT, 1)dnl
  ;;
  VAX_G_FLOAT)
    AC_DEFINE(VAX_G_FLOAT, 1)dnl
  ;;
  *)
    AC_WARN("unrecognized floating point format!")
  ;;
esac
dnl
dnl Does the C compiler handle alloca() and const correctly?
dnl
AC_ALLOCA
dnl
dnl It would be nicer to test for the requisite putenv features directly,
dnl but can't figure out how to do that.
dnl
if test "`(uname) 2>/dev/null`" = NetBSD \
   || test "`(uname) 2>/dev/null`" = FreeBSD; then
  AC_DEFINE(SMART_PUTENV)
fi
dnl
AC_CONST
dnl
dnl If we haven't been forced to use f2c, try to find a Fortran compiler
dnl under any one of several common Un*x Fortran compiler names. 
dnl Put fc last to avoid confusion with some vendor's /bin/sh fc
dnl builtin.
dnl
dnl    xlf : IBM / AIX
dnl   cf77 : Cray / Unicos
dnl    g77 : GNU Fortran (someday...)
dnl     fc : Convex
dnl
dnl I don't think the Cray compiler will ever work like f2c...
dnl
if $use_f2c; then
  true
else
  F77=
  AC_PROGRAMS_CHECK(F77, xlf cf77 f77 g77 fc)dnl

  # If it looks like we have a Fortran compiler, try to determine
  # whether it might be compatible with f2c.

  if test -n "$F77"; then
    AC_CHECKING([$F77/f2c compatibility])
    export F77
    export CC
    tmpdef=`sh $srcdir/f2c-compat.sh $srcdir/flibs.sh`
    status=$?
    if test $status -eq 0; then
      if test "$tmpdef" = '-DF77_APPEND_UNDERSCORE=1'; then
        AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl
      fi
    else
      F77=
    fi
  fi
fi
dnl
dnl If we can't find a Fortran compiler, or if it looks like it isn't
dnl compatible with f2c, try to find f2c.
dnl
if test -z "$F77"; then
  AC_PROGRAM_CHECK(F2C, f2c, f2c, [])dnl
fi
dnl
F2CFLAGS=
AC_VERBOSE([setting F2CFLAGS to $F2CFLAGS])
FFLAGS="-O"
AC_VERBOSE([setting FFLAGS to $FFLAGS])
if test -n "$F77"; then
  export F77
  FLIBS=`sh $srcdir/flibs.sh`
  AC_VERBOSE([setting FLIBS to $FLIBS])
  DOT_O_DOT_F_C1=
  DOT_O_DOT_F_C2=
  DOT_O_DOT_F_C3=
  DOT_O_DOT_F_C4=
  DEFAULT_DOT_C_FROM_DOT_F=
  DEFAULT_DOT_O_FROM_DOT_F=
elif test -n "$F2C" || $use_f2c; then
  AC_HAVE_LIBRARY(f2c, FLIBS=-lf2c, [])dnl
  if test -z "$FLIBS" ; then
    AC_HAVE_LIBRARY(F77, FLIBS=-lF77, [])dnl
    if test -n "$FLIBS" ; then
      AC_HAVE_LIBRARY(I77, FLIBS="$FLIBS -lI77", [])dnl
    fi
  fi
  if test -z "$FLIBS" ; then
    AC_WARN([I found f2c but not libf2c.a, or libF77.a and libI77.a])
  fi
DEFAULT_DOT_C_FROM_DOT_F='# A rule for making C source from Fortran source.\
# If we are using f2c we should also turn off the default rule for\
# making objects from .f files so that we do not invoke the fortran\
# compiler by mistake.\
\
\%.c : \%.f\
	cat $< | $(F2C) $(F2CFLAGS) > $(@F)'
  AC_VERBOSE([setting DEFAULT_DOT_C_FROM_DOT_F to $DEFAULT_DOT_C_FROM_DOT_F])
  DEFAULT_DOT_O_FROM_DOT_F='\%.o : \%.f'
  AC_VERBOSE([setting DEFAULT_DOT_O_FROM_DOT_F to $DEFAULT_DOT_O_FROM_DOT_F])
  AC_DEFINE(F77_APPEND_UNDERSCORE, 1)dnl
else
  AC_WARN([in order to build octave, you must have a compatible])
  AC_WARN([Fortran compiler or f2c installed and in your path.])
  AC_WARN([See the file INSTALL for more information.])
  AC_WARN([Continuing anyway...])
fi
dnl
AC_SUBST(FFLAGS)dnl
AC_SUBST(FLIBS)dnl
AC_SUBST(F2C)dnl
AC_SUBST(F2CFLAGS)dnl
AC_SUBST(DEFAULT_DOT_C_FROM_DOT_F)dnl
AC_SUBST(DEFAULT_DOT_O_FROM_DOT_F)dnl
dnl
dnl Checks for header files.
dnl
AC_STDC_HEADERS
AC_HAVE_HEADERS(assert.h float.h limits.h memory.h pwd.h stdlib.h)dnl
AC_HAVE_HEADERS(string.h varargs.h unistd.h floatingpoint.h)dnl
AC_HAVE_HEADERS(sys/utsname.h sys/time.h sys/fcntl.h)dnl
AC_HAVE_HEADERS(sys/ttold.h sys/ptem.h sys/select.h)dnl
AC_DIR_HEADER
dnl
dnl Use sgtty on Ultrix so that using DEC Migrate to convert a Mips
dnl binary to an Alpha binary will work.
dnl
case "$canonical_host_type" in
  mips-dec-ultrix* | alpha-dec-osf*)
    AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])
  ;;
esac
dnl
case "$DEFS" in
  *HAVE_SGTTY_H*)
  ;;
  *)
    AC_HEADER_CHECK(termios.h, AC_DEFINE(HAVE_TERMIOS_H, 1),
      AC_HEADER_CHECK(termio.h, AC_DEFINE(HAVE_TERMIO_H, 1),
        AC_HEADER_CHECK(sgtty.h, AC_DEFINE(HAVE_SGTTY_H, 1), [])))
  ;;
esac
case "$DEFS" in
  *HAVE_TERMIOS_H* | *HAVE_TERMIO_H* | *HAVE_SGTTY_H*)
  ;;
  *)
    AC_ERROR([I couldn't find termios.h, termio.h, or sgtty.h!])
  ;;
esac
dnl
dnl Checks for functions.
dnl
AC_HAVE_FUNCS(setvbuf getcwd gethostname bzero rindex vfprintf vsprintf)dnl
AC_HAVE_FUNCS(stricmp strnicmp strcasecmp strncasecmp strerror)dnl
AC_HAVE_FUNCS(atexit on_exit tempnam memmove putenv)dnl
dnl
dnl Check to see if we have IEEE math functions, and if so, which ones.
dnl
dnl For Linux: add -mieee-fp flag to CFLAGS when checking for IEEE FP
dnl functions, otherwise we may not find them.
dnl
dnl Also just using AC_HAVE_FUNCS doesn't seem to work to find isinf
dnl and isnan on Linux systems, so we use AC_FUNC_CHECK, and if that
dnl fails, we try again by including math.h and invoking the function
dnl with an argument. 
dnl
dnl Also check for some additional trig functions that aren't ANSI but
dnl are often available.  If they are missing, we try to replace them
dnl with functions from the BSD/NET2 math library.
dnl
AC_HAVE_LIBRARY(-lm)dnl
dnl
XCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $GCC_IEEE_FP_FLAG"
for func in finite isnan isinf
do
  trfunc=`echo $func | tr '[a-z]' '[A-Z]'`
  AC_FUNC_CHECK([$func],
  AC_DEFINE(HAVE_[$trfunc], 1),
    AC_COMPILE_CHECK([$func], [#include <math.h>], [
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$func) || defined (__stub___$func)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
$func (1.0);
#endif
],
      AC_DEFINE(HAVE_[$trfunc], 1), []))dnl
done
dnl
AC_HAVE_FUNCS(infinity quiet_nan)dnl
AC_HAVE_FUNCS(erf erfc lgamma)dnl
dnl
CFLAGS="$XCFLAGS"
dnl
dnl Check for nonstandard but common trig functions that we need.
dnl If they are missing, we replace them using functions from the BSD
dnl math library, and we may need to replace some other functions too.
dnl
AC_REPLACE_FUNCS(acosh asinh atanh)
dnl
if test -n "$LIBOBJS"; then
  for func in $LIBOBJS
  do
    case "$func" in
      *acosh.o*)
	AC_DEFINE(ACOSH_MISSING, 1)dnl
      ;;
      *asinh.o*)
	AC_DEFINE(ASINH_MISSING, 1)dnl
      ;;
      *atanh.o*)
	AC_DEFINE(ATANH_MISSING, 1)dnl
      ;;
    esac
  done
  case $LIBOBJS in
    *acosh.o* | *asinh.o*)
      AC_REPLACE_FUNCS(copysign)
    ;;
  esac
  case $LIBOBJS in
    *acosh.o* | *asinh.o* | *atanh.o*)
      AC_REPLACE_FUNCS(log1p)
    ;;
  esac
  case $LIBOBJS in
    *log1p*)
      AC_REPLACE_FUNCS(log__L)
    ;;
  esac
  case $LIBOBJS in
    *log1p*)
      AC_REPLACE_FUNCS(finite)
    ;;
  esac
  case $LIBOBJS in
    *copysign* | *finite* | *log1p*)
      AC_REPLACE_FUNCS(logb scalb)
    ;;
  esac
fi
dnl
dnl Checks for OS specific cruft.
dnl
AC_STRUCT_TM
AC_SETVBUF_REVERSED
TERMLIBS=""
for termlib in termcap terminfo curses termlib ; do
  AC_HAVE_LIBRARY(${termlib}, [TERMLIBS="${TERMLIBS} -l${termlib}"])
  case "${TERMLIBS}" in
    *-l${termlib}*)
      AC_VERBOSE([setting TERMLIBS to $TERMLIBS])
      break
    ;;
  esac
done
dnl
AC_COMPILE_CHECK([struct exception in math.h],
[#include <math.h>],
[struct exception *x; x->type; x->name;],
AC_DEFINE(EXCEPTION_IN_MATH, 1), [])dnl
dnl
AC_SUBST(TERMLIBS)
dnl
dnl Define VOID_SIGHANDLER for readline.
dnl
AC_RETSIGTYPE
case "$RETSIGTYPE" in
  int)
  ;;
  *)
    VOID_SIGHANDLER="-DVOID_SIGHANDLER=1"
    AC_VERBOSE([defining VOID_SIGHANDLER to be 1])
  ;;
esac
AC_SUBST(VOID_SIGHANDLER)dnl
dnl
dnl Checks for other programs used for building, testing, installing,
dnl and running Octave.
dnl
dnl For now, don't define LEXLIB to be -lfl -- we don't use anything in
dnl it, and it might not be installed.
dnl
dnl Also make sure that we generate an interactive scanner if we are
dnl using flex.
dnl
AC_PROG_LEX
case "$LEX" in
  flex*)
    LFLAGS="-t -I"
    AC_VERBOSE([setting LFLAGS to be $LFLAGS])
    LEXLIB=
  ;;
  *)
    LFLAGS="-t"
    AC_VERBOSE([setting LFLAGS to be $LFLAGS])
    AC_WARN([I didn't find flex, but that's only a problem])
    AC_WARN([if you need to reconstruct lex.cc])
  ;;
esac
AC_SUBST(LFLAGS)dnl
dnl
AC_PROG_YACC
case "$YACC" in
  bison*)
  ;;
  *)
    AC_WARN([I didn't find bison, but that's only a problem])
    AC_WARN([if you need to reconstruct parse.cc])
  ;;
esac
dnl
AC_PROG_RANLIB
dnl
AC_PROGRAM_CHECK(RUNTEST, runtest, runtest, [])dnl
AC_PROGRAM_CHECK(EXPECT, expect, expect, [])dnl
if test -z "$EXPECT" ; then
  RUNTEST=
fi
AC_SUBST(RUNTEST)dnl
dnl
AC_PROG_INSTALL
dnl
AC_PROGRAM_CHECK(GNUPLOT_BINARY, gnuplot, gnuplot, [])dnl
if test -z "$GNUPLOT_BINARY"; then
  AC_WARN([I didn't find gnuplot.  It isn't necessary to have gnuplot])
  AC_WARN([installed, but you won't be able to use any of Octave's])
  AC_WARN([plotting commands without it.])
  AC_WARN([])
  AC_WARN([If gnuplot is installed but it isn't in your path, you can])
  AC_WARN([tell Octave where to find it by typing the command])
  AC_WARN([])
  AC_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"])
  AC_WARN([])
  AC_WARN([at the Octave prompt.])
fi
dnl
AC_PROGRAMS_CHECK(DEFAULT_PAGER, less more page pg, [])dnl
if test -z "$DEFAULT_PAGER"; then
  AC_WARN([I couldn't find `less', `more', `page', or `pg'])
elif test "$DEFAULT_PAGER" = less; then
  DEFAULT_PAGER="less -e"
  AC_VERBOSE([setting DEFAULT_PAGER to be $DEFAULT_PAGER])
fi
dnl
dnl Even though we include config.h in most files, some need to be
dnl compiled with the -D options on the compiler command line.  Use
dnl UGLY_DEFS for that.
dnl
UGLY_DEFS="$DEFS"
AC_VERBOSE([setting UGLY_DEFS to be $UGLY_DEFS])
AC_SUBST(UGLY_DEFS)dnl
dnl
dnl Maybe add -Wall to compiler flags now that we're done feature
dnl testing. 
dnl
dnl To get gcc and g++ to be really picky, try these adding these
dnl options to CFLAGS and CXXFLAGS along with -Wall:
dnl
dnl   -ansi
dnl   -pedantic
dnl   -Wwrite-strings
dnl   -Wid-clash-31
dnl   -Wpointer-arith
dnl   -Wcast-qual
dnl   -Wenum-clash
dnl   -Wcast-align
dnl   -Wtraditional
dnl   -Wstrict-prototypes
dnl   -Wmissing-prototypes
dnl   -Wnested-externs
dnl   -Woverloaded-virtual
dnl   -Winline
dnl   -felide-constructors
dnl   -fnonnull-objects
dnl
if $ADD_CXX_WALL; then
  CXXFLAGS="$CXXFLAGS -Wall"
  AC_VERBOSE([adding -Wall to CXXFLAGS])
fi
if $ADD_CC_WALL; then
  CFLAGS="$CFLAGS -Wall"
  AC_VERBOSE([adding -Wall to CFLAGS])
fi
dnl
dnl Do the substitutions in all the Makefiles.
dnl
define([tmpa], [libcruft/blas/Makefile libcruft/balgen/Makefile])dnl
define([tmpb], [libcruft/dassl/Makefile libcruft/eispack/Makefile])dnl
define([tmpc], [libcruft/fftpack/Makefile libcruft/fsqp/Makefile])dnl
define([tmpd], [libcruft/lapack/Makefile libcruft/linpack/Makefile])dnl
define([tmpe], [libcruft/minpack/Makefile libcruft/misc/Makefile])dnl
define([tmpf], [libcruft/npsol/Makefile libcruft/odepack/Makefile])dnl
define([tmpg], [libcruft/qpsol/Makefile libcruft/quadpack/Makefile])dnl
define([tmph], [libcruft/ranlib/Makefile libcruft/villad/Makefile])dnl 
define([cruftdirs], [tmpa tmpb tmpc tmpd tmpe tmpf tmpg tmph])dnl
define([tmpA], [Makefile Makeconf libcruft/Makefile libcruft/Makerules])dnl
define([tmpB], [liboctave/Makefile src/Makefile dld/Makefile])dnl
define([tmpC], [info/Makefile readline/Makefile readline/doc/Makefile])dnl
define([tmpD], [readline/examples/Makefile doc/Makefile])dnl
define([tmpE], [scripts/Makefile test/Makefile kpathsea/Makefile])dnl
define([srcdirs], [tmpA tmpB tmpC tmpD tmpE])dnl
AC_OUTPUT([srcdirs cruftdirs])dnl
