#! /bin/sh

# From configure.in Revision: 1.309 
































# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --with-f2c              use f2c even if Fortran compiler is available"
ac_help="$ac_help
  --with-g77              use g77 to compile Fortran subroutines"
ac_help="$ac_help
  --with-f77              use f77 to compile Fortran subroutines"
ac_help="$ac_help
  --enable-bounds-check   for internal array classes (default is no)"
ac_help="$ac_help
  --without-hdf5          don't use HDF5"
ac_help="$ac_help
  --with-fftw             use installed fftw instead of included fftpack"
ac_help="$ac_help
  --without-fastblas      use included (generic) BLAS and LAPACK"
ac_help="$ac_help
  --enable-dl             use dlopen/dlsym for dynamic linking (not all systems)"
ac_help="$ac_help
  --enable-shl            use shl_load/shl_findsym for dynamic linking (HP only)"
ac_help="$ac_help
  --enable-static         create static libraries"
ac_help="$ac_help
  --enable-shared         create shared libraries (not all systems)"
ac_help="$ac_help
  --enable-rpath          add -rpath to link command for shared libraries"
ac_help="$ac_help
  --enable-lite-kernel    compile smaller kernel (requires dynamic linking)"
ac_help="$ac_help
  --enable-readline       use readline library (default is yes)"
ac_help="$ac_help
  --enable-picky-flags    add picky options to CFLAGS, CXXFLAGS, FFLAGS"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=src/octave.cc

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi




cat >> confdefs.h <<\EOF
#define OCTAVE_SOURCE 1
EOF


ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:621: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

if test -z "$host"; then
  host=unknown
fi
canonical_host_type=$host
if test "$host" = unknown; then
  echo "configure: warning: configuring Octave for unknown system type
" 1>&2
fi


### some defaults

: ${man1dir='$(mandir)/man1'}
echo "$ac_t""defining man1dir to be $man1dir" 1>&6

: ${man1ext='.1'}
echo "$ac_t""defining man1ext to be $man1ext" 1>&6

: ${infofile='$(infodir)/octave.info'}
echo "$ac_t""defining infofile to be $infofile" 1>&6

: ${octincludedir='$(includedir)/octave-$(version)'}
echo "$ac_t""defining octincludedir to be $octincludedir" 1>&6

: ${fcnfiledir='$(datadir)/octave/$(version)/m'}
echo "$ac_t""defining fcnfiledir to be $fcnfiledir" 1>&6

: ${localfcnfiledir='$(datadir)/octave/site/m'}
echo "$ac_t""defining localfcnfiledir to be $localfcnfiledir" 1>&6

: ${localverfcnfiledir='$(datadir)/octave/$(version)/site/m'}
echo "$ac_t""defining localverfcnfiledir to be $localverfcnfiledir" 1>&6

: ${localfcnfilepath='$(localverfcnfiledir)//:$(localfcnfiledir)//'}
echo "$ac_t""defining localfcnfilepath to be $localfcnfilepath" 1>&6

: ${octlibdir='$(libdir)/octave-$(version)'}
echo "$ac_t""defining octlibdir to be $octlibdir" 1>&6

: ${archlibdir='$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)'}
echo "$ac_t""defining archlibdir to be $archlibdir" 1>&6

: ${localarchlibdir='$(libexecdir)/octave/site/exec/$(canonical_host_type)'}
echo "$ac_t""defining localarchlibdir to be $localarchlibdir" 1>&6

: ${localverarchlibdir='$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)'}
echo "$ac_t""defining localverarchlibdir to be $localverarchlibdir" 1>&6

: ${octfiledir='$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)'}
echo "$ac_t""defining octfiledir to be $octfiledir" 1>&6

: ${localoctfiledir='$(libexecdir)/octave/site/oct/$(canonical_host_type)'}
echo "$ac_t""defining localoctfiledir to be $localoctfiledir" 1>&6

: ${localveroctfiledir='$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)'}
echo "$ac_t""defining localveroctfiledir to be $localveroctfiledir" 1>&6

: ${localoctfilepath='$(localveroctfiledir)//:$(localoctfiledir)//'}
echo "$ac_t""defining localoctfilepath to be $localoctfilepath" 1>&6

: ${fcnfilepath='.:$(localoctfilepath):$(localfcnfilepath):$(octfiledir)//:$(fcnfiledir)//'}
echo "$ac_t""defining fcnfilepath to be $fcnfilepath" 1>&6

: ${imagedir='$(datadir)/octave/$(version)/imagelib'}
echo "$ac_t""defining imagedir to be $imagedir" 1>&6

: ${imagepath='.:$(imagedir)//'}
echo "$ac_t""defining imagepath to be $imagepath" 1>&6


### Make configure args available for other uses.

config_opts=$ac_configure_args


### Path separator.

cat >> confdefs.h <<\EOF
#define SEPCHAR ':'
EOF

cat >> confdefs.h <<\EOF
#define SEPCHAR_STR ":"
EOF


### Allow the user to force us to use f2c.

# Check whether --with-f2c or --without-f2c was given.
if test "${with_f2c+set}" = set; then
  withval="$with_f2c"
  if test "$withval" = no; then use_f2c=false; else use_f2c=true; fi
else
  use_f2c=false
fi


### Allow the user to force us to use g77.

# Check whether --with-g77 or --without-g77 was given.
if test "${with_g77+set}" = set; then
  withval="$with_g77"
  if test "$withval" = no; then use_g77=false; else use_g77=true; fi
else
  use_g77=false
fi


### Allow the user to force us to use f77.

# Check whether --with-f77 or --without-f77 was given.
if test "${with_f77+set}" = set; then
  withval="$with_f77"
  if test "$withval" = no; then use_f77=false; else use_f77=true; fi
else
  use_f77=false
fi


### Make sure only one of the above options for Fortran compilers was
### specified (multiple "no" or --without-FOO options are ok).

if test "${with_f77+set}" = set; then
  if test "${with_g77+set}" = set; then
    if test "$with_g77" = no; then
      true
    else
      warn_f77_and_g77="--with-f77 and --with-g77 both specified!  Using g77..."
  echo "configure: warning: $warn_f77_and_g77" 1>&2
  use_g77=false
    fi
  fi
fi

if test "${with_f77+set}" = set; then
  if test "${with_f2c+set}" = set; then
    if test "$with_f2c" = no; then
      true
    else
      warn_f2c_and_f77="--with-f2c and --with-f77 both specified!  Using f77..."
  echo "configure: warning: $warn_f2c_and_f77" 1>&2
  use_f2c=false
    fi
  fi
fi

if test "${with_g77+set}" = set; then
  if test "${with_f2c+set}" = set; then
    if test "$with_f2c" = no; then
      true
    else
      warn_f2c_and_g77="--with-f2c and --with-g77 both specified!  Using g77..."
  echo "configure: warning: $warn_f2c_and_g77" 1>&2
  use_f2c=false
    fi
  fi
fi

USE_PLPLOT=false
PLPLOT_DIR=""
LIBPLPLOT=""



LIBKPATHSEA='$(TOPDIR)/kpathsea/libkpathsea.$(LIBEXT)'


### Make it possible to have Octave's array and matrix classes do bounds
### checking on element references.  This slows some operations down a
### bit, so it is turned off by default.

BOUNDS_CHECKING=false
# Check whether --enable-bounds-check or --disable-bounds-check was given.
if test "${enable_bounds_check+set}" = set; then
  enableval="$enable_bounds_check"
  if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi
fi

if $BOUNDS_CHECKING; then
  cat >> confdefs.h <<\EOF
#define BOUNDS_CHECKING 1
EOF

fi

### It seems that there are some broken inline assembly functions in
### the GNU libc.  Since I'm not sure how to test whether we are using
### GNU libc, just disable them for all platforms.

echo "$ac_t""defining __NO_MATH_INLINES avoids buggy GNU libc exp function" 1>&6
cat >> confdefs.h <<\EOF
#define __NO_MATH_INLINES 1
EOF


### See which C++ compiler to use (we expect to find g++).

EXTERN_CXXFLAGS="$CXXFLAGS"

for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:845: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:877: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 888 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:919: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:924: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:952: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:984: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 997 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6


### Do special things for g++.

gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \
  sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`

# 
# Auto instantiate all templates, other than those that are explicitly
# instantiated in Octave. Octave currently instantiates all needed
# templates for GCC-2.8.x and EGCS-1.1.x, but not for newer GNU releases
# nor for other supported compilers.
#
cxx_auto_instantiate_templates=yes
case "$gxx_version" in
  1.* | 2.[0123456].* | 2.7.[01]*)
    { echo "configure: error: g++ version $gxx_version will not work to compile Octave" 1>&2; exit 1; }
  ;;
  2.8* | 2.9[1-6]*)
    cxx_auto_instantiate_templates=no
  ;;
esac

CXX_VERSION=
if test -n "$gxx_version"; then
  CXX_VERSION="$gxx_version"
fi



  
  echo $ac_n "checking for C++ support for new friend template declaration""... $ac_c" 1>&6
echo "configure:1057: checking for C++ support for new friend template declaration" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_new_friend_template_decl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    rm -f conftest.h
    cat > conftest.h <<EOB
       struct A {
	 friend int operator== (const A&, const A&);
	 A (int) { }
       };

       template <class T> int
       operator== (const T&, const T&)
       {
	 return 0;
       }
EOB
    cat > conftest.$ac_ext <<EOF
#line 1084 "configure"
#include "confdefs.h"
#include "conftest.h"
int main() {

        A a (1);
        return a == A(1);
      
; return 0; }
EOF
if { (eval echo configure:1094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  octave_cv_cxx_new_friend_template_decl=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  octave_cv_cxx_new_friend_template_decl=yes
    
fi
rm -f conftest*
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  echo "$ac_t""$octave_cv_cxx_new_friend_template_decl" 1>&6
  if test $octave_cv_cxx_new_friend_template_decl = yes; then
    cat >> confdefs.h <<\EOF
#define CXX_NEW_FRIEND_TEMPLATE_DECL 1
EOF

  fi


  
  echo $ac_n "checking if C++ library is ISO compliant""... $ac_c" 1>&6
echo "configure:1126: checking if C++ library is ISO compliant" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_iso_compliant_library'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    rm -f conftest.h
    for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \
	climits clocale cmath complex csetjmp csignal cstdarg cstddef \
	cstdio cstdlib cstring ctime cwchar cwctype deque exception \
	fstream functional iomanip ios iosfwd iostream istream iterator \
	limits list locale map memory new numeric ostream queue set \
	sstream stack stdexcept streambuf string strstream typeinfo \
	utility valarray vector; do
      echo "#include <$inc>" >> conftest.h
    done
    cat > conftest.$ac_ext <<EOF
#line 1150 "configure"
#include "confdefs.h"
#include "conftest.h"
int main() {

        std::bitset<50> flags;
        flags.set();
        int digits = std::numeric_limits<unsigned long>::digits;
        digits = 0;
      
; return 0; }
EOF
if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  octave_cv_cxx_iso_compliant_library=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  octave_cv_cxx_iso_compliant_library=no
    
fi
rm -f conftest*
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  echo "$ac_t""$octave_cv_cxx_iso_compliant_library" 1>&6
  if test $octave_cv_cxx_iso_compliant_library = yes; then
    cat >> confdefs.h <<\EOF
#define CXX_ISO_COMPLIANT_LIBRARY 1
EOF

  fi


# Determine the ABI used the C++ compiler, needed by the dynamic loading
# code. Currently supported ABIs are GNU v2, GNU v3 and Sun Workshop.

echo $ac_n "checking C++ ABI version used by ${CXX}""... $ac_c" 1>&6
echo "configure:1196: checking C++ ABI version used by ${CXX}" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_abi'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  octave_cv_cxx_abi='unknown'
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    cat > conftest.$ac_ext <<EOF
bool FSmy_dld_fcn (void) { return false; }
EOF
    if { (eval echo configure:1212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
      if test "`${NM-nm} conftest.o | grep FSmy_dld_fcn__Fv`" != ""; then
        octave_cv_cxx_abi='gnu_v2'
      fi
      if test "`${NM-nm} conftest.o | grep _Z12FSmy_dld_fcnv`" != ""; then
        octave_cv_cxx_abi='gnu_v3'
      fi
      if test "`${NM-nm} conftest.o | grep __1cMFSmy_dld_fcn6F_b_`" != ""; then
        octave_cv_cxx_abi='sun_v5'
      fi
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
    fi
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  echo "$ac_t""$octave_cv_cxx_abi" 1>&6
  cat >> confdefs.h <<EOF
#define CXX_ABI $octave_cv_cxx_abi
EOF



### See which C compiler to use (we expect to find gcc).

EXTERN_CFLAGS="$CFLAGS"

# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1250: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1280: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1331: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1363: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 1374 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1405: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:1410: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1438: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1470: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 1485 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 1502 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 1519 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

if test $ac_cv_prog_gcc = yes; then
    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:1551: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    ac_pattern="Autoconf.*'x'"
  cat > conftest.$ac_ext <<EOF
#line 1557 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
else
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


  if test $ac_cv_prog_gcc_traditional = no; then
    cat > conftest.$ac_ext <<EOF
#line 1575 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*

  fi
fi

echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi


### Do special things for gcc.

gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \
  sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`
case "$gcc_version" in
  2.*)
    if test -z "$LDFLAGS"; then
      LDFLAGS="-g"
      echo "$ac_t""defining LDFLAGS to be $LDFLAGS" 1>&6
    fi
  ;;
  1.*)
    warn_gcc_version="gcc version $gcc_version is likely to cause problems"
    echo "configure: warning: $warn_gcc_version" 1>&2
  ;;
esac

CC_VERSION=
if test -n "$gcc_version"; then
  CC_VERSION="$gcc_version"
fi


### The flag to create dependency varies depending on the compier.

# Assume GCC.
DEPEND_FLAGS="-M"
DEPEND_EXTRA_SED_PATTERN=""
case "$canonical_host_type" in
  sparc-sun-solaris2* | i386-pc-solaris2*)
    if test "$GCC" = yes; then
      true
    else
      DEPEND_FLAGS="-xM1"
      DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'"
    fi
  ;;
esac



### On Intel systems with gcc, we may need to compile with -mieee-fp to
### get full support for IEEE floating point.
###
### On Alpha/OSF systems, we need -mieee.

ieee_fp_flag=
case "$canonical_host_type" in
  i[3456789]86-*-*)
    
  ac_safe=`echo "-mieee-fp" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CC-cc} accepts -mieee-fp""... $ac_c" 1>&6
echo "configure:1649: checking whether ${CC-cc} accepts -mieee-fp" >&5
  if eval "test \"`echo '$''{'octave_cv_cc_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    XCFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -mieee-fp"
    cat > conftest.$ac_ext <<EOF
#line 1665 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=no"
fi
rm -f conftest*
    CFLAGS="$XCFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      ieee_fp_flag=-mieee-fp
      XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp"
      echo "$ac_t""adding -mieee-fp to XTRA_CFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi


    
  ac_safe=`echo "-mieee-fp" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -mieee-fp""... $ac_c" 1>&6
echo "configure:1708: checking whether ${CXX-g++} accepts -mieee-fp" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -mieee-fp"
    cat > conftest.$ac_ext <<EOF
#line 1724 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      ieee_fp_flag=-mieee-fp
      XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp"
      echo "$ac_t""adding -mieee-fp to XTRA_CXXFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

  ;;
  alpha*-*-*)
    
  ac_safe=`echo "-mieee-with-inexact" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CC-cc} accepts -mieee-with-inexact""... $ac_c" 1>&6
echo "configure:1768: checking whether ${CC-cc} accepts -mieee-with-inexact" >&5
  if eval "test \"`echo '$''{'octave_cv_cc_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    XCFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -mieee-with-inexact"
    cat > conftest.$ac_ext <<EOF
#line 1784 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=no"
fi
rm -f conftest*
    CFLAGS="$XCFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      ieee_fp_flag=-mieee-with-inexact
      XTRA_CFLAGS="$XTRA_CFLAGS -mieee-with-inexact"
      echo "$ac_t""adding -mieee-with-inexact to XTRA_CFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi


    
  ac_safe=`echo "-mieee-with-inexact" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -mieee-with-inexact""... $ac_c" 1>&6
echo "configure:1827: checking whether ${CXX-g++} accepts -mieee-with-inexact" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -mieee-with-inexact"
    cat > conftest.$ac_ext <<EOF
#line 1843 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      ieee_fp_flag=-mieee-with-inexact
      XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-with-inexact"
      echo "$ac_t""adding -mieee-with-inexact to XTRA_CXXFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

  ;;
  *ibm-aix4*)
    
  ac_safe=`echo "-mminimal-toc" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CC-cc} accepts -mminimal-toc""... $ac_c" 1>&6
echo "configure:1887: checking whether ${CC-cc} accepts -mminimal-toc" >&5
  if eval "test \"`echo '$''{'octave_cv_cc_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    XCFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -mminimal-toc"
    cat > conftest.$ac_ext <<EOF
#line 1903 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=no"
fi
rm -f conftest*
    CFLAGS="$XCFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"
  else
    echo "$ac_t""no" 1>&6
    
  fi


    
  ac_safe=`echo "-mminimal-toc" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -mminimal-toc""... $ac_c" 1>&6
echo "configure:1944: checking whether ${CXX-g++} accepts -mminimal-toc" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -mminimal-toc"
    cat > conftest.$ac_ext <<EOF
#line 1960 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"
  else
    echo "$ac_t""no" 1>&6
    
  fi

  ;;
esac

### We do our own template instantiation for specific compilers.

if test "$cxx_auto_instantiate_templates" = no; then
  
  ac_safe=`echo "-fno-implicit-templates" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -fno-implicit-templates""... $ac_c" 1>&6
echo "configure:2006: checking whether ${CXX-g++} accepts -fno-implicit-templates" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -fno-implicit-templates"
    cat > conftest.$ac_ext <<EOF
#line 2022 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:2029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
    XTRA_CXXFLAGS="$XTRA_CXXFLAGS -fno-implicit-templates"
    echo "$ac_t""adding -fno-implicit-templates to XTRA_CXXFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

fi




### Use -static if compiling on Alpha OSF/1 1.3 systems.

case "$canonical_host_type" in
  alpha*-dec-osf1.3)
    LD_STATIC_FLAG=-static
  ;;
esac
if test -n "$LD_STATIC_FLAG"; then
  echo "$ac_t""defining LD_STATIC_FLAG to be $LD_STATIC_FLAG" 1>&6
fi


echo $ac_n "checking whether ${CXX-g++} prepends an underscore to external names""... $ac_c" 1>&6
echo "configure:2078: checking whether ${CXX-g++} prepends an underscore to external names" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_prepends_underscore'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  octave_cv_cxx_prepends_underscore=no
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    cat > conftest.$ac_ext <<EOF
bool FSmy_dld_fcn (void) { return false; }
EOF
    if { (eval echo configure:2094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
      if test "`${NM-nm} conftest.o | grep _FSmy_dld_fcn`" != ""; then
        octave_cv_cxx_prepends_underscore=yes
      fi
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
    fi
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  echo "$ac_t""$octave_cv_cxx_prepends_underscore" 1>&6
  if test $octave_cv_cxx_prepends_underscore = yes; then
    cat >> confdefs.h <<\EOF
#define CXX_PREPENDS_UNDERSCORE 1
EOF

  fi



### Look for math library.  If found, this will add -lm to LIBS.

case "$canonical_host_type" in
  *-*-nextstep*)
  ;;  
  *-*-linux*)
    echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
echo "configure:2129: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lm -lc $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2137 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sin();

int main() {
sin()
; return 0; }
EOF
if { (eval echo configure:2148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lm $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

  ;;
  *)
    echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
echo "configure:2178: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2186 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sin();

int main() {
sin()
; return 0; }
EOF
if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lm $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

  ;;
esac

### Check for HDF5 library.

### XXX FIXME XXX -- how can user specify a set of libraries here?

WITH_HDF5=true
# Check whether --with-hdf5 or --without-hdf5 was given.
if test "${with_hdf5+set}" = set; then
  withval="$with_hdf5"
  with_hdf5=$withval
else
  with_hdf5=yes
fi


hdf5_lib=
if test "$with_hdf5" = yes; then
  hdf5_lib="hdf5"
elif test "$with_hdf5" != no; then
  hdf5_lib="$with_hdf5"
fi

HDF5_LIBS=
WITH_HDF5=false
if test -n "$hdf5_lib"; then
  echo $ac_n "checking for H5Pcreate in -l$hdf5_lib""... $ac_c" 1>&6
echo "configure:2252: checking for H5Pcreate in -l$hdf5_lib" >&5
ac_lib_var=`echo $hdf5_lib'_'H5Pcreate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$hdf5_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2260 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char H5Pcreate();

int main() {
H5Pcreate()
; return 0; }
EOF
if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
    echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
echo "configure:2288: checking for deflate in -lz" >&5
ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lz  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2296 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char deflate();

int main() {
deflate()
; return 0; }
EOF
if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
      for ac_hdr in hdf5.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2327: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2332 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
	WITH_HDF5=true
        HDF5_LIBS="-l$hdf5_lib -lz"
        LIBS="$HDF5_LIBS $LIBS"
        cat >> confdefs.h <<\EOF
#define HAVE_HDF5 1
EOF

else
  echo "$ac_t""no" 1>&6
fi
done

else
  echo "$ac_t""no" 1>&6
fi

else
  echo "$ac_t""no" 1>&6
fi

fi

# Checks for FFTW header and library.

# subdirectories of libcruft to build if they aren't found on the system:
FFT_DIR="fftpack"


# Installed fftw library, if any.
FFTW_LIBS=''


# Check whether --with-fftw or --without-fftw was given.
if test "${with_fftw+set}" = set; then
  withval="$with_fftw"
  with_fftw=yes
else
  with_fftw=yes
fi


if test "$with_fftw" = "yes"; then
  for ac_hdr in dfftw.h fftw.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2404: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2409 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

  if test "$ac_cv_header_dfftw_h" = yes \
      || test "$ac_cv_header_fftw_h" = yes; then
    echo $ac_n "checking for fftw_create_plan in -ldfftw""... $ac_c" 1>&6
echo "configure:2443: checking for fftw_create_plan in -ldfftw" >&5
ac_lib_var=`echo dfftw'_'fftw_create_plan | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldfftw  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2451 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fftw_create_plan();

int main() {
fftw_create_plan()
; return 0; }
EOF
if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFTW_LIBS="-ldfftw"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for fftw_create_plan in -lfftw""... $ac_c" 1>&6
echo "configure:2481: checking for fftw_create_plan in -lfftw" >&5
ac_lib_var=`echo fftw'_'fftw_create_plan | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lfftw  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2489 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fftw_create_plan();

int main() {
fftw_create_plan()
; return 0; }
EOF
if { (eval echo configure:2500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FFTW_LIBS="-lfftw"
else
  echo "$ac_t""no" 1>&6
with_fftw=no
fi

fi

  else
    with_fftw=no
  fi
fi

if test "$with_fftw" = yes; then
  FFT_DIR=''
  cat >> confdefs.h <<\EOF
#define HAVE_FFTW 1
EOF

fi

# ----------------------------------------------------------------------

### We need these before trying to find libf2c.

if test -z "$AR"; then
  AR=ar
fi


if test -z "$ARFLAGS"; then
  ARFLAGS="rc"
fi



# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2554: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


### If we haven't been forced to use a particular Fortran compiler,
### try to find one using any one of several common Un*x Fortran
### compiler names.  Put fc last to avoid confusion with some vendor's
### /bin/sh fc builtin.
###
###    f77 : most Unix systems
###    xlf : IBM / AIX
###   cf77 : Cray / Unicos
###    g77 : GNU Fortran
###     fc : Convex
###
### If a compiler is found, check to see if it is compatible with our
### assumptions.  If it is, use it.  Otherwise, look for f2c.  If we
### can't find a compatible fortran compiler or f2c, issue a warning.
###
### I don't think the Cray compiler will ever work like f2c...
###
### The configure options --with-f77, --with-g77, or --with-f2c
### force f77, g77 or f2c to be used.  It is also possible to use
### these options to specify the name of the compiler.  For example,
### `--with-g77=/opt/gnu/bin/f77' says that we are using g77 but it is
### installed as /opt/gnu/bin/f77.

if $use_f77; then
  if test "$with_f77" = yes; then
    F77=f77
  else
    F77="$with_f77"
  fi
  echo "$ac_t""defining F77 to be $F77" 1>&6
elif $use_g77; then
  if test "$with_g77" = yes; then
    F77=g77
  else
    F77="$with_g77"
  fi
  echo "$ac_t""defining F77 to be $F77" 1>&6
elif $use_f2c; then
  F77=
  if test "$with_f2c" = yes; then
    F2C=f2c
  else
    F2C="$with_f2c"
  fi
  echo "$ac_t""defining F2C to be $F2C" 1>&6
else
  for ac_prog in g77 f77 f90 xlf cf77 fc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2633: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F77"; then
  ac_cv_prog_F77="$F77" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F77="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F77="$ac_cv_prog_F77"
if test -n "$F77"; then
  echo "$ac_t""$F77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F77" && break
done

fi

have_fortran_compiler=false
have_f2c=false

if $use_f2c; then
  have_f2c=true
else
  if test -n "$F77"; then
    echo $ac_n "checking for Fortran libraries""... $ac_c" 1>&6
echo "configure:2672: checking for Fortran libraries" >&5

if eval "test \"`echo '$''{'octave_cv_flibs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
echo "      END" > conftest.f
foutput=`${F77-f77} -v -o conftest conftest.f 2>&1`

### The easiest thing to do for xlf output is to replace all the commas
### with spaces.  Try to only do that if the output is really from xlf,
### since doing that causes problems on other systems.

xlf_p=`echo $foutput | grep xlfentry`
if test -n "$xlf_p"; then
  foutput=`echo $foutput | sed 's/,/ /g'`
fi

ld_run_path=`echo $foutput | \
  sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`

### We are only supposed to find this on Solaris systems...
### Uh, the run path should be absolute, shouldn't it?

case "$ld_run_path" in
  /*)
    if test "$ac_cv_prog_gcc" = yes; then
      ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
    else
      ld_run_path="-R $ld_run_path"
    fi
  ;;
  *)
    ld_run_path=
  ;;
esac

flibs=
lflags=

### If want_arg is set, we know we want the arg to be added to the list,
### so we don't have to examine it.

want_arg=

for arg in $foutput; do
  old_want_arg=$want_arg
  want_arg=

### None of the options that take arguments expect the argument to
### start with a -, so pretend we didn't see anything special.

  if test -n "$old_want_arg"; then
    case "$arg" in
      -*)
	old_want_arg=
      ;;
    esac
  fi
  case "$old_want_arg" in
    '')
      case $arg in
	/*.a)
	  exists=false
	  for f in $lflags; do
	    if test x$arg = x$f; then
	      exists=true
	    fi
	  done
	  if $exists; then
	    arg=
	  else
	    lflags="$lflags $arg"
	  fi
	;;
	-bI:*)
	  exists=false
	  for f in $lflags; do
	    if test x$arg = x$f; then
	      exists=true
	    fi
	  done
	  if $exists; then
	    arg=
	  else
	    if test "$ac_cv_prog_gcc" = yes; then
	      lflags="$lflags -Xlinker $arg"
	    else
	      lflags="$lflags $arg"
	    fi
	  fi
	;;
	-lang* | -lcrt0.o | -lc | -lgcc)
	  arg=
	;;
	-[lLR])
	  want_arg=$arg
	  arg=
	;;
	-[lLR]*)
	  exists=false
	  for f in $lflags; do
	    if test x$arg = x$f; then
	      exists=true
	    fi
	  done
	  if $exists; then
	    arg=
	  else
	    case "$arg" in
	      -lkernel32)
		case "$canonical_host_type" in
		  *-*-cygwin32)
		    arg=
		  ;;
		  *)
		    lflags="$lflags $arg"
		  ;;
		esac
	      ;;
	      -lm)
	      ;;
	      *)
		lflags="$lflags $arg"
	      ;;
	    esac
	  fi
	;;
	-u)
	  want_arg=$arg
	  arg=
	;;
	-Y)
	  want_arg=$arg
	  arg=
	;;
	*)
	  arg=
	;;
      esac
    ;;
    -[lLR])
      arg="$old_want_arg $arg"
    ;;
    -u)
      arg="-u $arg"
    ;;
    -Y)

### Should probably try to ensure unique directory options here too.
### This probably only applies to Solaris systems, and then will only
### work with gcc...

      arg=`echo $arg | sed -e 's%^P,%%'`
      SAVE_IFS=$IFS
      IFS=:
      list=
      for elt in $arg; do
	list="$list -L$elt"
      done
      IFS=$SAVE_IFS
      arg="$list"
    ;;
  esac
  if test -n "$arg"; then
    flibs="$flibs $arg"
  fi
done
if test -n "$ld_run_path"; then
  flibs_result="$ld_run_path $flibs"
else
  flibs_result="$flibs"
fi

octave_cv_flibs="$flibs_result"
fi

FLIBS="$octave_cv_flibs"
echo "$ac_t""$FLIBS" 1>&6
    echo $ac_n "checking whether ${F77-f77} uses uppercase external names""... $ac_c" 1>&6
echo "configure:2852: checking whether ${F77-f77} uses uppercase external names" >&5
if eval "test \"`echo '$''{'octave_cv_f77_uppercase_names'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  octave_cv_f77_uppercase_names=no
cat > conftest.f <<EOF
      subroutine xxyyzz ()
      return
      end
EOF
if ${F77-f77} -c conftest.f 1>&5 2>&5; then
  if test "`${NM-nm} conftest.o | grep XXYYZZ`" != ""; then
    octave_cv_f77_uppercase_names=yes
  fi
fi
fi

echo "$ac_t""$octave_cv_f77_uppercase_names" 1>&6
if test "$octave_cv_f77_uppercase_names" = yes; then
  cat >> confdefs.h <<\EOF
#define F77_UPPERCASE_NAMES 1
EOF

fi
echo $ac_n "checking whether ${F77-f77} appends underscores to external names""... $ac_c" 1>&6
echo "configure:2877: checking whether ${F77-f77} appends underscores to external names" >&5

if eval "test \"`echo '$''{'octave_cv_f77_append_underscore'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  octave_cv_f77_append_underscore=no
cat > conftest.f <<EOF
      subroutine xxyyzz ()
      return
      end
EOF
if ${F77-f77} -c conftest.f 1>&5 2>&5; then
  if test "$octave_cv_f77_uppercase_names" = yes; then
    if test "`${NM-nm} conftest.o | grep XXYYZZ_`" != ""; then
      octave_cv_f77_append_underscore=yes
    fi
  else
    if test "`${NM-nm} conftest.o | grep xxyyzz_`" != ""; then
      octave_cv_f77_append_underscore=yes
    fi
  fi
fi
fi

echo "$ac_t""$octave_cv_f77_append_underscore" 1>&6
if test "$octave_cv_f77_append_underscore" = yes; then
  cat >> confdefs.h <<\EOF
#define F77_APPEND_UNDERSCORE 1
EOF

fi
    echo $ac_n "checking whether ${F77-f77} is the GNU Fortran compiler""... $ac_c" 1>&6
echo "configure:2909: checking whether ${F77-f77} is the GNU Fortran compiler" >&5
if eval "test \"`echo '$''{'octave_cv_f77_is_g77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if $use_g77; then
  octave_cv_f77_is_g77=yes
else
  echo "      END" > conftest.f
  foutput=`${F77-f77} -v conftest.f 2>&1 | egrep "GNU F77|FSF-g77"`
  if test -n "$foutput"; then
    octave_cv_f77_is_g77=yes
  else
    octave_cv_f77_is_g77=no
  fi
fi
fi

echo "$ac_t""$octave_cv_f77_is_g77" 1>&6




if test "$cross_compiling" = yes; then
  octave_cv_f2c_f77_compat=yes
  if test "$octave_cv_f77_is_g77" = yes; then
    echo "$ac_t""assuming ${F77-f77} cross compiler is f2c compatible" 1>&6
  else
    echo "configure: warning: assuming ${F77-f77} cross compiler is f2c compatible" 1>&2
  fi
else
  echo $ac_n "checking ${F77-f77}/f2c compatibility""... $ac_c" 1>&6
echo "configure:2940: checking ${F77-f77}/f2c compatibility" >&5
if eval "test \"`echo '$''{'octave_cv_f2c_f77_compat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  trap 'rm -f ftest* ctest* core; exit 1' 1 3 15
  octave_cv_f2c_f77_compat=no
  cat > ftest.f <<EOF
      SUBROUTINE FORSUB (C, I, D)
      CHARACTER *(*) C
      INTEGER L, I
      DOUBLE PRECISION D
      L = LEN (C)
      WRITE (*, '(A,1X,I2)') C(1:L), INT (D)
      I = 0
      RETURN
      END
EOF
  ${F77-f77} -c ftest.f 1>&5 2>&5
  
  cat > ctest.c <<EOF
#include "confdefs.h"
#ifdef F77_APPEND_UNDERSCORE
extern int forsub_ (const char*, int*, double*, long int);
#else
extern int forsub (const char*, int*, double*, long int);
#endif
static char s[14];
int main ()
{
  double d = 10.0;
  int len, i = 1;
  strcpy (s, "FOO-I-HITHERE");
  len = strlen (s);
#ifdef F77_APPEND_UNDERSCORE
  forsub_ (s, &i, &d, len);
#else
  forsub (s, &i, &d, len);
#endif
  return i;
}
#if defined (sun)
int MAIN_ () { return 0; }
#elif defined (linux) && defined (__ELF__)
int MAIN__ () { return 0; }
#endif
EOF
  
  if ${CC-cc} -c ctest.c 1>&5 2>&5; then
    if ${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm 1>&5 2>&5; then
      ctest_output=`./ctest 2>&1`
      status=$?
      if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10"; then
	octave_cv_f2c_f77_compat=yes
      fi
    fi
  fi
fi

echo "$ac_t""$octave_cv_f2c_f77_compat" 1>&6
fi
rm -f ftest* ctest* core

    if test "$octave_cv_f2c_f77_compat" = no; then
      F77=
    else
      if test -z "$FFLAGS"; then
        FFLAGS="-O"
      fi
      case "$canonical_host_type" in
        alpha*-*-*)
          if test "$octave_cv_f77_is_g77" = yes; then
            FFLAGS="$ieee_fp_flag $FFLAGS"
	  else
	    FFLAGS="-fpe1 $FFLAGS"
	  fi
        ;;
	powerpc-apple-machten*)
	  FFLAGS=
	;;
      esac
      if test -n "$FFLAGS"; then
        echo "$ac_t""defining FFLAGS to be $FFLAGS" 1>&6
      fi
    fi
  fi
  if test -n "$F77"; then
    have_fortran_compiler=true
  else
    # Extract the first word of "f2c", so it can be a program name with args.
set dummy f2c; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3031: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F2C'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F2C"; then
  ac_cv_prog_F2C="$F2C" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F2C="f2c"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F2C="$ac_cv_prog_F2C"
if test -n "$F2C"; then
  echo "$ac_t""$F2C" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    if test -n "$F2C"; then
      have_f2c=true
    fi
  fi
fi

f77_rules_frag=/dev/null
if $have_fortran_compiler; then
  f77_rules_frag=Makefrag.f77
  cat << \EOF > $f77_rules_frag

%.c : %.f

%.o : %.f
	$(FC) -c $(ALL_FFLAGS) -o $@ $<

pic/%.o : %.f
	$(FC) -c $(FPICFLAG) $(ALL_FFLAGS) $< -o $@

EOF
elif $have_f2c; then
  cat >> confdefs.h <<\EOF
#define F77_APPEND_UNDERSCORE 1
EOF

  echo "$ac_t""defining F77_APPEND_UNDERSCORE to be 1" 1>&6

### This seems to be necessary on some Linux system.

  cat > conftest.$ac_ext << EOF
int MAIN_ () { return 0; }
int MAIN__ () { return 0; }
EOF

### XXX FIMXE XXX -- these shouldn't be fixed names, eh?

  oct_conflib=libconflib.a
  oct_obj_ext=o

  if { (eval echo configure:3096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    $AR $ARFLAGS $oct_conflib conftest.$oct_obj_ext 1>&5
    if test -n "$RANLIB"; then
      $RANLIB $oct_conflib 1>&5
    fi
  fi
  rm -f conftest*
  echo $ac_n "checking for f_open in -lf2c""... $ac_c" 1>&6
echo "configure:3104: checking for f_open in -lf2c" >&5
ac_lib_var=`echo f2c'_'f_open | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lf2c -L. -lconflib $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3112 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char f_open();

int main() {
f_open()
; return 0; }
EOF
if { (eval echo configure:3123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FLIBS=-lf2c
else
  echo "$ac_t""no" 1>&6
FLIBS=
fi

  rm -f $oct_conflib

  if test -z "$FLIBS"; then
    echo $ac_n "checking for d_sin in -lF77""... $ac_c" 1>&6
echo "configure:3148: checking for d_sin in -lF77" >&5
ac_lib_var=`echo F77'_'d_sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lF77  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3156 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char d_sin();

int main() {
d_sin()
; return 0; }
EOF
if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FLIBS=-lF77
else
  echo "$ac_t""no" 1>&6
FLIBS=
fi

    if test -n "$FLIBS"; then
      echo $ac_n "checking for f_rew in -lI77""... $ac_c" 1>&6
echo "configure:3190: checking for f_rew in -lI77" >&5
ac_lib_var=`echo I77'_'f_rew | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lI77 -lF77 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3198 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char f_rew();

int main() {
f_rew()
; return 0; }
EOF
if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  FLIBS="$FLIBS -lI77"
else
  echo "$ac_t""no" 1>&6
FLIBS=
fi

    fi
  fi

  if test -z "$FLIBS"; then
    warn_f2c_no_lib="I found f2c but not libf2c.a, or libF77.a and libI77.a"
    echo "configure: warning: $warn_f2c_no_lib" 1>&2
  fi
  f77_rules_frag=Makefrag.f77
  cat << \EOF > $f77_rules_frag

%.c : %.f
	$(F2C) $(F2CFLAGS) < $< > $(@F)

%.o : %.f

EOF
else
  echo "configure: warning: in order to build octave, you must have a compatible" 1>&2
  echo "configure: warning: Fortran compiler or f2c installed and in your path." 1>&2
  { echo "configure: error: See the file INSTALL for more information." 1>&2; exit 1; }
fi

FORTRAN_MAIN_FLAG=
case "$canonical_host_type" in
  *-linux-*)
    FORTRAN_MAIN_FLAG="-u MAIN__"
  ;;
esac
if test -n "$FORTRAN_MAIN_FLAG"; then
  echo "$ac_t""defining FORTRAN_MAIN_FLAG to be $FORTRAN_MAIN_FLAG" 1>&6
fi



FC=$F77








### Checks for BLAS and LAPACK libraries:

### XXX FIXME XXX -- how can user specify a set of libraries here?

### Subdirectories of libcruft to build if they aren't found on the system:

BLAS_DIR="blas"
LAPACK_DIR="lapack"



### names of Fortran dgemm & cheev functions to check for (depends upon
### F77 compiler name-mangling scheme):

if test "$octave_cv_f77_uppercase_names" = yes; then
  if test "$octave_cv_f77_append_underscore" = yes; then
    dgemm_func=DGEMM_
    cheev_func=CHEEV_
  else
    dgemm_func=DGEMM
    cheev_func=CHEEV
  fi
else
  if test "$octave_cv_f77_append_underscore" = yes || test -n "${F2C}"; then
    dgemm_func=dgemm_
    cheev_func=cheev_
  else
    dgemm_func=dgemm
    cheev_func=cheev
  fi
fi

# Check whether --with-fastblas or --without-fastblas was given.
if test "${with_fastblas+set}" = set; then
  withval="$with_fastblas"
  with_fastblas=$withval
else
  with_fastblas=yes
fi


if test "$with_fastblas" = no; then
  BLAS_LIBS=" "
elif test "$with_fastblas" != yes; then
  # user specified a BLAS library to try on the command line
  echo $ac_n "checking for $dgemm_func in -l$with_fastblas""... $ac_c" 1>&6
echo "configure:3319: checking for $dgemm_func in -l$with_fastblas" >&5
ac_lib_var=`echo $with_fastblas'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$with_fastblas $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3327 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-l$with_fastblas"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test "x$BLAS_LIBS" = x; then
  # Checks for ATLAS BLAS library:
  echo $ac_n "checking for ATL_xerbla in -latlas""... $ac_c" 1>&6
echo "configure:3363: checking for ATL_xerbla in -latlas" >&5
ac_lib_var=`echo atlas'_'ATL_xerbla | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-latlas  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3371 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char ATL_xerbla();

int main() {
ATL_xerbla()
; return 0; }
EOF
if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-latlas"
else
  echo "$ac_t""no" 1>&6
fi

  if test "x$BLAS_LIBS" != x; then
    # check for other atlas libs:
    echo $ac_n "checking for cblas_dgemm in -lcblas""... $ac_c" 1>&6
echo "configure:3405: checking for cblas_dgemm in -lcblas" >&5
ac_lib_var=`echo cblas'_'cblas_dgemm | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcblas $BLAS_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3413 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char cblas_dgemm();

int main() {
cblas_dgemm()
; return 0; }
EOF
if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lcblas $BLAS_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

    echo $ac_n "checking for $dgemm_func in -lf77blas""... $ac_c" 1>&6
echo "configure:3445: checking for $dgemm_func in -lf77blas" >&5
ac_lib_var=`echo f77blas'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lf77blas $BLAS_LIBS $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3453 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lf77blas $BLAS_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

  fi
fi

if test "x$BLAS_LIBS" = x; then
  # BLAS in Alpha CXML library?
  echo $ac_n "checking for $dgemm_func in -lcxml""... $ac_c" 1>&6
echo "configure:3490: checking for $dgemm_func in -lcxml" >&5
ac_lib_var=`echo cxml'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcxml $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3498 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lcxml"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test "x$BLAS_LIBS" = x; then
  # BLAS in Alpha DXML library? (now called CXML, see above)
  echo $ac_n "checking for $dgemm_func in -ldxml""... $ac_c" 1>&6
echo "configure:3534: checking for $dgemm_func in -ldxml" >&5
ac_lib_var=`echo dxml'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldxml $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3542 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-ldxml"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test "x$BLAS_LIBS" = x; then
  # Check for BLAS in Sun Performance library:
  echo $ac_n "checking for acosp in -lsunmath""... $ac_c" 1>&6
echo "configure:3578: checking for acosp in -lsunmath" >&5
ac_lib_var=`echo sunmath'_'acosp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsunmath  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3586 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char acosp();

int main() {
acosp()
; return 0; }
EOF
if { (eval echo configure:3597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lsunmath"
else
  echo "$ac_t""no" 1>&6
fi

  # Don't use AC_CHECK_LIB here.
  saved_LIBS="$LIBS"
  LIBS="$LIBS $BLAS_LIBS -xlic_lib=sunperf"
  echo $ac_n "checking for $dgemm_func""... $ac_c" 1>&6
echo "configure:3621: checking for $dgemm_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$dgemm_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3626 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $dgemm_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {

/* 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_$dgemm_func) || defined (__stub___$dgemm_func)
choke me
#else
$dgemm_func();
#endif

; return 0; }
EOF
if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$dgemm_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$dgemm_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$dgemm_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-xlic_lib=sunperf $BLAS_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

  LIBS="$saved_LIBS"
fi

if test "x$BLAS_LIBS" = x; then
  # Check for BLAS in SCSL and SGIMATH libraries (prefer SCSL):
  echo $ac_n "checking for $dgemm_func in -lscs""... $ac_c" 1>&6
echo "configure:3674: checking for $dgemm_func in -lscs" >&5
ac_lib_var=`echo scs'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lscs $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3682 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lscs"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for $dgemm_func in -lcomplib.sgimath""... $ac_c" 1>&6
echo "configure:3712: checking for $dgemm_func in -lcomplib.sgimath" >&5
ac_lib_var=`echo complib.sgimath'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lcomplib.sgimath $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3720 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lcomplib.sgimath"
else
  echo "$ac_t""no" 1>&6
fi

fi

fi

if test "x$BLAS_LIBS" = x; then
  # Checks for BLAS in IBM ESSL library.  We must also link
  # with -lblas in this case (ESSL does not include the full BLAS):
  echo $ac_n "checking for zherk in -lblas""... $ac_c" 1>&6
echo "configure:3759: checking for zherk in -lblas" >&5
ac_lib_var=`echo blas'_'zherk | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lblas $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3767 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char zherk();

int main() {
zherk()
; return 0; }
EOF
if { (eval echo configure:3778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  echo $ac_n "checking for $dgemm_func in -lessl""... $ac_c" 1>&6
echo "configure:3794: checking for $dgemm_func in -lessl" >&5
ac_lib_var=`echo essl'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lessl $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3802 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lessl -lblas"
else
  echo "$ac_t""no" 1>&6
fi

else
  echo "$ac_t""no" 1>&6
fi

fi

if test "x$BLAS_LIBS" = x; then
  # Finally, check for the generic BLAS library:
  echo $ac_n "checking for $dgemm_func in -lblas""... $ac_c" 1>&6
echo "configure:3842: checking for $dgemm_func in -lblas" >&5
ac_lib_var=`echo blas'_'$dgemm_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lblas $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3850 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $dgemm_func();

int main() {
$dgemm_func()
; return 0; }
EOF
if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-lblas"
else
  echo "$ac_t""no" 1>&6
fi

fi

if test "$with_fastblas" = no; then
  # Unset BLAS_LIBS so that we know below that nothing was found.
  BLAS_LIBS=""
fi

if test "x$BLAS_LIBS" != x; then
  BLAS_DIR=""  # don't build our own BLAS

### Check for LAPACK library.  Note that ATLAS has its own liblapack.a,
### which is designed to be combined with the real LAPACK.  cheev is a
### function in the real LAPACK but not in ATLAS's version, so this
### (hopefully) insures that we are getting the real LAPACK.  Note also
### that on some systems, LAPACK is included in the math library
### (e.g. DXML) that we already linked to above...we detect this by
### doing AC_CHECK_FUNC if -llapack isn't found:

  echo $ac_n "checking for $cheev_func in -llapack""... $ac_c" 1>&6
echo "configure:3900: checking for $cheev_func in -llapack" >&5
ac_lib_var=`echo lapack'_'$cheev_func | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-llapack $BLAS_LIBS $FLIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3908 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $cheev_func();

int main() {
$cheev_func()
; return 0; }
EOF
if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  BLAS_LIBS="-llapack $BLAS_LIBS"; LAPACK_DIR=""
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for $cheev_func""... $ac_c" 1>&6
echo "configure:3938: checking for $cheev_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$cheev_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3943 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $cheev_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $cheev_func();

int main() {

/* 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_$cheev_func) || defined (__stub___$cheev_func)
choke me
#else
$cheev_func();
#endif

; return 0; }
EOF
if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$cheev_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$cheev_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$cheev_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LAPACK_DIR=""
else
  echo "$ac_t""no" 1>&6
fi

fi

fi



### Handle dynamic linking and shared library options.

### Allow the user to experiment with dynamic linking using dlopen/dlsym.

# Check whether --enable-dl or --disable-dl was given.
if test "${enable_dl+set}" = set; then
  enableval="$enable_dl"
  if test "$enableval" = no; then WITH_DL=no;
   elif test "$enableval" = yes; then WITH_DL=yes;
   else WITH_DL=maybe; fi
else
  WITH_DL=maybe
fi


### Allow the user to experiment with dynamic linking using
### shl_load/shl_findsym (HP/UX only?).

# Check whether --enable-shl or --disable-shl was given.
if test "${enable_shl+set}" = set; then
  enableval="$enable_shl"
  if test "$enableval" = no; then WITH_SHL=no;
   elif test "$enableval" = yes; then WITH_SHL=yes;
   else WITH_SHL=maybe; fi
else
  WITH_SHL=maybe
fi


### Enable creation of static libraries.

# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
  enableval="$enable_static"
  if test "$enableval" = no; then STATIC_LIBS=false;
   else STATIC_LIBS=true; fi
else
  STATIC_LIBS=true
fi



### Enable creation of shared libraries.  Currently only works with
### gcc on some systems.

# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
  if test "$enableval" = no; then SHARED_LIBS=false;
   else SHARED_LIBS=true; fi
else
  SHARED_LIBS=false
fi



if $STATIC_LIBS || $SHARED_LIBS; then
  true
else
  { echo "configure: error: You can't disable building static AND shared libraries!" 1>&2; exit 1; }
fi

if $SHARED_LIBS; then
  LIBOCTINTERP=-loctinterp
  LIBOCTAVE=-loctave
  LIBCRUFT=-lcruft
else
  LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)'
  LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)'
  LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)'
fi




use_rpath=true
# Check whether --enable-rpath or --disable-rpath was given.
if test "${enable_rpath+set}" = set; then
  enableval="$enable_rpath"
  if test "$enableval" = no; then use_rpath=false; fi
fi


DLFCN_DIR=
CPICFLAG=-fPIC
CXXPICFLAG=-fPIC
FPICFLAG=-fPIC
SHLEXT=so
SH_LD="$CXX"
SH_LDFLAGS=-shared
SONAME_FLAGS=
RLD_FLAG=
TEMPLATE_AR="$AR"
TEMPLATE_ARFLAGS="$ARFLAGS"
case "$canonical_host_type" in
  *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*)
    SH_LD=ld
    SH_LDFLAGS=-Bshareable
  ;;
  alpha*-dec-osf*)
    CPICFLAG=
    CXXPICFLAG=
    FPICFLAG=
    SH_LDFLAGS="-shared -Xlinker -expect_unresolved -Xlinker '*'"
    SONAME_FLAGS='-Xlinker -soname -Xlinker $@'
    RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)'
  ;;
  *-*-linux* | *-*-gnu*)
    SONAME_FLAGS='-Xlinker -soname -Xlinker $@'
    RLD_FLAG='-Xlinker -rpath -Xlinker $(octlibdir)'
  ;;
  i[3456]86-*-sco3.2v5*)
    SONAME_FLAGS='-Xlinker -h -Xlinker $@'
    RLD_FLAG=
    SH_LDFLAGS=-G
  ;;
  rs6000-ibm-aix* | powerpc-ibm-aix*)
    CPICFLAG=
    CXXPICFLAG=
    FPICFLAG=
    DLFCN_DIR=dlfcn
  ;;
  hppa*-hp-hpux*)
    if test "$octave_cv_f77_is_g77" = yes; then
      FPICFLAG=-fPIC
    else
      FPICFLAG=+Z
    fi
    SHLEXT=sl
    SH_LDFLAGS="-shared -fPIC"
    RLD_FLAG='-Xlinker +b -Xlinker $(octlibdir)'
  ;;
  *-sgi-*)
    CPICFLAG=
    CXXPICFLAG=
    FPICFLAG=
    RLD_FLAG='-L$(octlibdir)'
  ;;
  sparc-sun-sunos4*)
    if test "$octave_cv_f77_is_g77" = yes; then
      FPICFLAG=-fPIC
    else
      FPICFLAG=-PIC
    fi
    SH_LD=ld
    SH_LDFLAGS="-assert nodefinitions"
    RLD_FLAG='-L$(octlibdir)'
  ;;
  sparc-sun-solaris2* | i386-pc-solaris2*)
    if test "$octave_cv_f77_is_g77" = yes; then
      FPICFLAG=-fPIC
    else
      FPICFLAG=-KPIC
    fi
    if test "$GCC" = yes; then
      CPICFLAG=-fPIC
    else
      CPICFLAG=-KPIC
    fi
    if test "$GXX" = yes; then
      CXXPICFLAG=-fPIC
      SH_LDFLAGS=-shared
    else
      CXXPICFLAG=-KPIC
      SH_LDFLAGS=-G
    fi
    RLD_FLAG='-R $(octlibdir)'
    # Template closures in archive libraries need a different mechanism.
    if test "$GXX" = yes; then
      true
    else
      TEMPLATE_AR="$CXX"
      TEMPLATE_ARFLAGS="-xar -o"
    fi
  ;;
esac

if $use_rpath; then
  true
else
  RLD_FLAG=
fi

echo "$ac_t""defining FPICFLAG to be $FPICFLAG" 1>&6
echo "$ac_t""defining CPICFLAG to be $CPICFLAG" 1>&6
echo "$ac_t""defining CXXPICFLAG to be $CXXPICFLAG" 1>&6
echo "$ac_t""defining SHLEXT to be $SHLEXT" 1>&6
echo "$ac_t""defining DLFCN_DIR to be $DLFCN_DIR" 1>&6
echo "$ac_t""defining SH_LD to be $SH_LD" 1>&6
echo "$ac_t""defining SH_LDFLAGS to be $SH_LDFLAGS" 1>&6
echo "$ac_t""defining SONAME_FLAGS to be $SONAME_FLAGS" 1>&6
echo "$ac_t""defining RLD_FLAG to be $RLD_FLAG" 1>&6
echo "$ac_t""defining TEMPLATE_AR to be $TEMPLATE_AR" 1>&6
echo "$ac_t""defining TEMPLATE_ARFLAGS to be $TEMPLATE_ARFLAGS" 1>&6












### Allow compilation of smaller kernel.  This only works if some form
### of dynamic linking is also supported and used.

# Check whether --enable-lite-kernel or --disable-lite-kernel was given.
if test "${enable_lite_kernel+set}" = set; then
  enableval="$enable_lite_kernel"
  if test "$enableval" = no; then OCTAVE_LITE=false;
   else OCTAVE_LITE=true; fi
else
  OCTAVE_LITE=false
fi

if $OCTAVE_LITE; then
  cat >> confdefs.h <<\EOF
#define OCTAVE_LITE 1
EOF

fi


### special checks for odd OS specific things.
###
### I am told that on some SCO systems, the only place to find some
### functions like gethostname and gettimeofday is in libsocket.

echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
echo "configure:4223: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
  echo "$ac_t""yes" 1>&6
  ISC=yes # If later tests want to check for ISC.
  cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF

  if test "$GCC" = yes; then
    CC="$CC -posix"
  else
    CC="$CC -Xp"
  fi
else
  echo "$ac_t""no" 1>&6
  ISC=
fi

ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
echo "configure:4245: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4250 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  MINIX=yes
else
  echo "$ac_t""no" 1>&6
MINIX=
fi

if test "$MINIX" = yes; then
  cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF

  cat >> confdefs.h <<\EOF
#define _POSIX_1_SOURCE 2
EOF

  cat >> confdefs.h <<\EOF
#define _MINIX 1
EOF

fi

echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:4293: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 4295 "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
#define _ALL_SOURCE 1
EOF

else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*


for ac_func in gethostname getpwnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4319: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4324 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

if test "$ac_cv_func_gethostname" = yes; then
  true
else
  echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
echo "configure:4375: checking for gethostname in -lsocket" >&5
ac_lib_var=`echo socket'_'gethostname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4383 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostname();

int main() {
gethostname()
; return 0; }
EOF
if { (eval echo configure:4394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsocket $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi
if test "$ac_cv_func_getpwnam" = yes; then
  true
else
  echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6
echo "configure:4426: checking for getpwnam in -lsun" >&5
ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsun  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char getpwnam();

int main() {
getpwnam()
; return 0; }
EOF
if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo sun | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsun $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi

### How big are ints and how are they oriented?  These could probably
### be eliminated in favor of run-time checks.

echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:4478: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_short=2
else
  cat > conftest.$ac_ext <<EOF
#line 4486 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}
EOF
if { (eval echo configure:4498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_short=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_short" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
EOF


echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:4518: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=4
else
  cat > conftest.$ac_ext <<EOF
#line 4526 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:4558: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=4
else
  cat > conftest.$ac_ext <<EOF
#line 4566 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:4578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:4598: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_long=8
else
  cat > conftest.$ac_ext <<EOF
#line 4606 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long long));
  exit(0);
}
EOF
if { (eval echo configure:4618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF



### Does the C compiler handle alloca() and const correctly?

# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
echo "configure:4643: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4648 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
if test $ac_cv_header_alloca_h = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA_H 1
EOF

fi

echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:4676: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4681 "configure"
#include "confdefs.h"

#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
if test $ac_cv_func_alloca_works = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA 1
EOF

fi

if test $ac_cv_func_alloca_works = no; then
  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  # that cause trouble.  Some versions do not even contain alloca or
  # contain a buggy version.  If you still want to use their alloca,
  # use ar to extract alloca.o from them instead of compiling alloca.c.
  ALLOCA=alloca.${ac_objext}
  cat >> confdefs.h <<\EOF
#define C_ALLOCA 1
EOF


echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:4741: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4746 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "webecray" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_os_cray=yes
else
  rm -rf conftest*
  ac_cv_os_cray=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4771: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4776 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define CRAY_STACKSEG_END $ac_func
EOF

  break
else
  echo "$ac_t""no" 1>&6
fi

done
fi

echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:4826: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat > conftest.$ac_ext <<EOF
#line 4834 "configure"
#include "confdefs.h"
find_stack_direction ()
{
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
    {
      addr = &dummy;
      return find_stack_direction ();
    }
  else
    return (&dummy > addr) ? 1 : -1;
}
main ()
{
  exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:4853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_stack_direction=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
cat >> confdefs.h <<EOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
EOF

fi

echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:4875: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4880 "configure"
#include "confdefs.h"

int main() {

/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this.  */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25, 17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}

; return 0; }
EOF
if { (eval echo configure:4929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
  cat >> confdefs.h <<\EOF
#define const 
EOF

fi


### See if we should define NPOS.

echo $ac_n "checking whether including <string> defines NPOS""... $ac_c" 1>&6
echo "configure:4953: checking whether including <string> defines NPOS" >&5
if eval "test \"`echo '$''{'octave_cv_string_npos'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext <<EOF
#line 4966 "configure"
#include "confdefs.h"
#include <string>
int main() {
size_t foo = NPOS
; return 0; }
EOF
if { (eval echo configure:4973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  octave_cv_string_npos=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  octave_cv_string_npos=no
fi
rm -f conftest*
fi

echo "$ac_t""$octave_cv_string_npos" 1>&6
if test $octave_cv_string_npos = no; then
  cat >> confdefs.h <<\EOF
#define NPOS std::string::npos
EOF

fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross



### Checks for header files.

echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:5004: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5009 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 5034 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 5052 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 5073 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
if { (eval echo configure:5084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:5112: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5117 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:5125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
echo "configure:5150: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldir  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5158 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:5169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -ldir"
else
  echo "$ac_t""no" 1>&6
fi

else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
echo "configure:5191: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lx  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5199 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:5210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LIBS="$LIBS -lx"
else
  echo "$ac_t""no" 1>&6
fi

fi

echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:5233: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5238 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:5247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_header_time" 1>&6
if test $ac_cv_header_time = yes; then
  cat >> confdefs.h <<\EOF
#define TIME_WITH_SYS_TIME 1
EOF

fi

echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
echo "configure:5268: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5273 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
int main() {
int s;
wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
if { (eval echo configure:5289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_sys_wait_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
if test $ac_cv_header_sys_wait_h = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_SYS_WAIT_H 1
EOF

fi


for ac_hdr in assert.h curses.h dlfcn.h fcntl.h float.h \
  floatingpoint.h fnmatch.h glob.h grp.h ieeefp.h limits.h memory.h \
  nan.h ncurses.h poll.h pwd.h sgtty.h stdlib.h string.h sys/ioctl.h \
  sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \
  sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h \
  termio.h $TERMIOS_H unistd.h varargs.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:5319: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5324 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


### I'm told that termios.h is broken on NeXT systems.

case "$canonical_host_type" in
  *-*-nextstep*)
    if test "$ac_cv_header_termios_h" = yes; then
      echo "configure: warning: Ignoring termios.h on NeXT systems." 1>&2
      ac_cv_header_termios_h=no
    fi
  ;;
esac

if test "$ac_cv_header_termios_h" = yes \
    || test "$ac_cv_header_termio_h" = yes \
    || test "$ac_cv_header_sgtty_h" = yes; then
  true
else
  { echo "configure: error: I couldn't find termios.h, termio.h, or sgtty.h!" 1>&2; exit 1; }
fi

## I'm told that setting LIBGLOB to be $(TOPDIR)/glob/libglob.a causes
## trouble on SCO systems, but setting it to be the two object files
## avoids the problem.

GLOB_DIR=glob
LIBGLOB='$(TOPDIR)/glob/glob.o $(TOPDIR)/glob/fnmatch.o'
GLOB_INCFLAGS='-I$(top_srcdir)/glob -I$(TOPDIR)/glob'
if test "$ac_cv_header_fnmatch_h" = yes \
  && test "$ac_cv_header_glob_h" = yes; then
  cat > conftest.$ac_ext <<EOF
#line 5385 "configure"
#include "confdefs.h"
#ifdef FNM_NOESCAPE
     #ifdef FNM_FOOBAR_PATHNAME
     #ifdef FNM_PERIOD
       yes
     #endif
     #endif
     #endif
    
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  
      GLOB_DIR=
      echo $ac_n "checking for glob in -lglob""... $ac_c" 1>&6
echo "configure:5402: checking for glob in -lglob" >&5
ac_lib_var=`echo glob'_'glob | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lglob  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5410 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char glob();

int main() {
glob()
; return 0; }
EOF
if { (eval echo configure:5421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo glob | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lglob $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

      for ac_func in fnmatch glob
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5451: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5456 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

      if test "$ac_cv_func_fnmatch" = yes \
	&& test "$ac_cv_func_glob" = yes; then
	GLOB_DIR=
	LIBGLOB=
	GLOB_INCFLAGS=
      fi
    
else
  rm -rf conftest*
  
### We provide replacements, so we should set these to "yes".
    if eval "test \"`echo '$''{'ac_cv_func_fnmatch'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_func_fnmatch=yes
fi

    if eval "test \"`echo '$''{'ac_cv_func_glob'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_func_glob=yes
fi

    
fi
rm -f conftest*

else
### We provide replacements, so we should set these to "yes".
  ac_cv_header_fnmatch_h=yes
  ac_cv_header_glob_h=yes
  if eval "test \"`echo '$''{'ac_cv_func_fnmatch'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_func_fnmatch=yes
fi

  if eval "test \"`echo '$''{'ac_cv_func_glob'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_func_glob=yes
fi

fi




### Checks for functions and variables.

for ac_func in atexit bcopy bzero dup2 endgrent endpwent execvp \
  fcntl fork getcwd getegid geteuid getgid getgrent getgrgid \
  getgrnam getpgrp getpid getppid getpwent \
  getpwuid gettimeofday getuid getwd link localtime_r lstat \
  memmove mkdir mkfifo on_exit pipe poll putenv readlink rename \
  rindex rmdir select setgrent setpwent setvbuf sigaction sigpending \
  sigprocmask sigsuspend stat strcasecmp strdup strerror strftime \
  stricmp strncasecmp strnicmp strptime symlink tempnam umask unlink \
  usleep vfprintf vsprintf vsnprintf waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5564: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5569 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


echo $ac_n "checking whether putenv uses malloc""... $ac_c" 1>&6
echo "configure:5618: checking whether putenv uses malloc" >&5
if eval "test \"`echo '$''{'octave_cv_func_putenv_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  octave_cv_func_putenv_malloc=no
else
  cat > conftest.$ac_ext <<EOF
#line 5626 "configure"
#include "confdefs.h"

#define VAR	"YOW_VAR"
#define STRING1 "GabbaGabbaHey"
#define STRING2 "Yow!!"		/* should be shorter than STRING1 */
extern char *getenv (); /* in case char* and int don't mix gracefully */
main ()
{
  char *str1, *rstr1, *str2, *rstr2;
  str1 = getenv (VAR);
  if (str1)
    exit (1);
  str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
  if (str1 == 0)
    exit (2);
  strcpy (str1, VAR);
  strcat (str1, "=");
  strcat (str1, STRING1);
  if (putenv (str1) < 0)
    exit (3);
  rstr1 = getenv (VAR);
  if (rstr1 == 0)
    exit (4);
  rstr1 -= strlen (VAR) + 1;
  if (strncmp (rstr1, VAR, strlen (VAR)))
    exit (5);
  str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
  if (str2 == 0 || str1 == str2)
    exit (6);
  strcpy (str2, VAR);
  strcat (str2, "=");
  strcat (str2, STRING2);
  if (putenv (str2) < 0)
    exit (7);
  rstr2 = getenv (VAR);
  if (rstr2 == 0)
    exit (8);
  rstr2 -= strlen (VAR) + 1;
#if 0
  printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2);
  /*
   * If string from first call was reused for the second call,
   * you had better not do a free on the first string!
   */
  if (rstr1 == rstr2)
          printf ("#define SMART_PUTENV\n");
  else
          printf ("#undef SMART_PUTENV\n");
#endif
  exit (rstr1 == rstr2 ? 0 : 1);
}
EOF
if { (eval echo configure:5679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  octave_cv_func_putenv_malloc=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  octave_cv_func_putenv_malloc=no
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$octave_cv_func_putenv_malloc" 1>&6
if test $octave_cv_func_putenv_malloc = yes; then
  cat >> confdefs.h <<\EOF
#define SMART_PUTENV 1
EOF

fi

LD_CXX='$(CXX)'
LIBDLFCN=
DLFCN_INCFLAGS=
RDYNAMIC_FLAG=
if test "$WITH_DL" = yes || test "$WITH_DL" = maybe; then
  case "$canonical_host_type" in
    rs6000-ibm-aix* | powerpc-ibm-aix*)
      LIBDLFCN="-ldlfcn -ll -lld"
      DLFCN_INCFLAGS='-I$(top_srcdir)/dlfcn -I$(TOPDIR)/dlfcn'
      WITH_DL=true
    ;;
    i[3456]86-*-sco3.2v5*)
      LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)'
      WITH_DL=true
    ;;
    *)
      echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:5717: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5725 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

      for ac_func in dlopen dlsym dlerror dlclose
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5766: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5771 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

      if test "$ac_cv_func_dlopen" = yes \
	 && test "$ac_cv_func_dlsym" = yes \
	 && test "$ac_cv_func_dlerror" = yes \
	 && test "$ac_cv_func_dlclose" = yes; then
	WITH_DL=true
      else
	if test "$WITH_DL" = yes; then
	  { echo "configure: error: --enable-dl specified, but functions are missing!" 1>&2; exit 1; }
	fi
	WITH_DL=false
      fi
    ;;
  esac
  if $WITH_DL; then
    
  ac_safe=`echo "-rdynamic" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -rdynamic""... $ac_c" 1>&6
echo "configure:5835: checking whether ${CXX-g++} accepts -rdynamic" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -rdynamic"
    cat > conftest.$ac_ext <<EOF
#line 5851 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:5858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    RDYNAMIC_FLAG=-rdynamic
  else
    echo "$ac_t""no" 1>&6
    
  fi

    cat >> confdefs.h <<\EOF
#define WITH_DL 1
EOF

  fi
else
  WITH_DL=false
fi






if test "$WITH_SHL" = yes || test "$WITH_SHL" = maybe; then
  echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "configure:5903: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldld  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5911 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char shl_load();

int main() {
shl_load()
; return 0; }
EOF
if { (eval echo configure:5922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldld $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

  for ac_func in shl_load shl_findsym
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:5952: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5957 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

  if test "$ac_cv_func_shl_load" = yes \
     && test "$ac_cv_func_shl_findsym" = yes; then
    WITH_SHL=true
  else
    if test "$WITH_SHL" = yes; then
      { echo "configure: error: --enable-shl specified, but functions are missing!" 1>&2; exit 1; }
    fi
    WITH_SHL=false
  fi
  if $WITH_SHL; then
    cat >> confdefs.h <<\EOF
#define WITH_SHL 1
EOF

  fi
else
  WITH_SHL=false
fi


### Set WITH_DYNAMIC_LINKING after all the other shared library stuff
### has been determined.

if $WITH_DL || $WITH_SHL; then
  cat >> confdefs.h <<\EOF
#define WITH_DYNAMIC_LINKING 1
EOF

  WITH_DYNAMIC_LINKING=true
else
  WITH_DYNAMIC_LINKING=false
fi


### There is more than one possible prototype for gettimeofday.  See
### which one (if any) appears in sys/time.h.  These tests are from
### Emacs 19.

echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
echo "configure:6043: checking for struct timeval" >&5
cat > conftest.$ac_ext <<EOF
#line 6045 "configure"
#include "confdefs.h"
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
int main() {
static struct timeval x; x.tv_sec = x.tv_usec;
; return 0; }
EOF
if { (eval echo configure:6061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
   cat >> confdefs.h <<\EOF
#define HAVE_TIMEVAL 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
   HAVE_TIMEVAL=no
fi
rm -f conftest*

if test "x$HAVE_TIMEVAL" = xyes; then
echo $ac_n "checking whether gettimeofday can't accept two arguments""... $ac_c" 1>&6
echo "configure:6080: checking whether gettimeofday can't accept two arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 6082 "configure"
#include "confdefs.h"
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>
#else
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <time.h>
#endif
#endif
int main() {
struct timeval time; struct timezone dummy;
  gettimeofday (&time, &dummy);
; return 0; }
EOF
if { (eval echo configure:6099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
   cat >> confdefs.h <<\EOF
#define GETTIMEOFDAY_NO_TZ 1
EOF

fi
rm -f conftest*
fi


### I am told that Inf and NaN don't work on m68k HP sytems, and that
### on SCO systems, isnan and isinf don't work, but they can be
### replaced by something that does.

case "$canonical_host_type" in
  m68k-hp-hpux*)
  ;;
  *-*-sco*)
    echo "$ac_t""defining SCO to be 1" 1>&6
    cat >> confdefs.h <<\EOF
#define SCO 1
EOF

    echo "$ac_t""forcing HAVE_ISINF for SCO" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_ISINF 1
EOF

    echo "$ac_t""forcing HAVE_ISNAN for SCO" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_ISNAN 1
EOF

  ;;
  *)
    for ac_func in finite isnan isinf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6144: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6149 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:6172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

  ;;
esac

### Check for nonstandard but common math functions that we need.

for ac_func in acosh asinh atanh erf erfc
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6204: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6209 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


### Checks for OS specific cruft.

echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
echo "configure:6260: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6265 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
if { (eval echo configure:6273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_blksize=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_blksize=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
if test $ac_cv_struct_st_blksize = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ST_BLKSIZE 1
EOF

fi

echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
echo "configure:6294: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6299 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
if { (eval echo configure:6307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_blocks=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_blocks=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6
if test $ac_cv_struct_st_blocks = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ST_BLOCKS 1
EOF

else
  LIBOBJS="$LIBOBJS fileblocks.${ac_objext}"
fi

echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
echo "configure:6330: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6335 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
if { (eval echo configure:6343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_st_rdev=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_st_rdev=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6
if test $ac_cv_struct_st_rdev = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ST_RDEV 1
EOF

fi

echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
echo "configure:6364: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6369 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:6377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_tm=time.h
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_tm=sys/time.h
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_tm" 1>&6
if test $ac_cv_struct_tm = sys/time.h; then
  cat >> confdefs.h <<\EOF
#define TM_IN_SYS_TIME 1
EOF

fi

echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
echo "configure:6398: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6403 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
if { (eval echo configure:6411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_struct_tm_zone=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_struct_tm_zone=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_struct_tm_zone" 1>&6
if test "$ac_cv_struct_tm_zone" = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_TM_ZONE 1
EOF

else
  echo $ac_n "checking for tzname""... $ac_c" 1>&6
echo "configure:6431: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6436 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI.  */
extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
#endif
int main() {
atoi(*tzname);
; return 0; }
EOF
if { (eval echo configure:6446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_var_tzname=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_var_tzname=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_var_tzname" 1>&6
  if test $ac_cv_var_tzname = yes; then
    cat >> confdefs.h <<\EOF
#define HAVE_TZNAME 1
EOF

  fi
fi

echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
echo "configure:6468: checking whether closedir returns void" >&5
if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_closedir_void=yes
else
  cat > conftest.$ac_ext <<EOF
#line 6476 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
if { (eval echo configure:6482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_closedir_void=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_closedir_void=yes
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_func_closedir_void" 1>&6
if test $ac_cv_func_closedir_void = yes; then
  cat >> confdefs.h <<\EOF
#define CLOSEDIR_VOID 1
EOF

fi


echo $ac_n "checking for gr_passwd in struct group""... $ac_c" 1>&6
echo "configure:6506: checking for gr_passwd in struct group" >&5
if eval "test \"`echo '$''{'octave_cv_struct_gr_passwd'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6511 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <grp.h>
int main() {
struct group s; s.gr_passwd;
; return 0; }
EOF
if { (eval echo configure:6519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  octave_cv_struct_gr_passwd=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  octave_cv_struct_gr_passwd=no
fi
rm -f conftest*
fi

echo "$ac_t""$octave_cv_struct_gr_passwd" 1>&6
if test $octave_cv_struct_gr_passwd = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_GR_PASSWD 1
EOF

fi


for termlib in ncurses curses termcap terminfo termlib; do
  echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6
echo "configure:6542: checking for tputs in -l${termlib}" >&5
ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l${termlib}  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6550 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tputs();

int main() {
tputs()
; return 0; }
EOF
if { (eval echo configure:6561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  TERMLIBS="${TERMLIBS} -l${termlib}"
else
  echo "$ac_t""no" 1>&6
fi

  case "${TERMLIBS}" in
    *-l${termlib}*)
      LIBS="$TERMLIBS $LIBS"
      break
    ;;
  esac
done

if test "$ac_cv_lib_termcap_tputs" = yes \
    || test "$ac_cv_lib_terminfo_tputs" = yes \
    || test "$ac_cv_lib_ncurses_tputs" = yes \
    || test "$ac_cv_lib_curses_tputs" = yes \
    || test "$ac_cv_lib_termlib_tputs" = yes; then
  true
else
  warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, or -ltermlib!"
  echo "configure: warning: $warn_termlibs" 1>&2
fi


  USE_READLINE=true
  # Check whether --enable-readline or --disable-readline was given.
if test "${enable_readline+set}" = set; then
  enableval="$enable_readline"
  if test "$enableval" = no; then
       USE_READLINE=false
       warn_readline="command editing and history features require GNU Readline"
     fi
fi

  if $USE_READLINE; then
    echo $ac_n "checking for rl_set_keyboard_input_timeout in -lreadline""... $ac_c" 1>&6
echo "configure:6613: checking for rl_set_keyboard_input_timeout in -lreadline" >&5
ac_lib_var=`echo readline'_'rl_set_keyboard_input_timeout | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lreadline  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6621 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char rl_set_keyboard_input_timeout();

int main() {
rl_set_keyboard_input_timeout()
; return 0; }
EOF
if { (eval echo configure:6632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
      LIBS="-lreadline $LIBS"
      cat >> confdefs.h <<\EOF
#define USE_READLINE 1
EOF

    
else
  echo "$ac_t""no" 1>&6

      echo "configure: warning: I need GNU Readline 4.2 or later" 1>&2
      { echo "configure: error: this is fatal unless you specify --disable-readline" 1>&2; exit 1; }
    
fi

  fi


echo $ac_n "checking for struct exception in math.h""... $ac_c" 1>&6
echo "configure:6666: checking for struct exception in math.h" >&5
cat > conftest.$ac_ext <<EOF
#line 6668 "configure"
#include "confdefs.h"
#include <math.h>
int main() {
struct exception *x; x->type; x->name;
; return 0; }
EOF
if { (eval echo configure:6675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define EXCEPTION_IN_MATH 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

### Signal stuff.

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:6693: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6698 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
#ifdef __cplusplus
extern "C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:6715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_type_signal=void
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_type_signal=int
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_type_signal" 1>&6
cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF


echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
echo "configure:6734: checking for sys_siglist declaration in signal.h or unistd.h" >&5
if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6739 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h.  */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
int main() {
char *msg = *(sys_siglist + 1);
; return 0; }
EOF
if { (eval echo configure:6751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_decl_sys_siglist=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_decl_sys_siglist=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6
if test $ac_cv_decl_sys_siglist = yes; then
  cat >> confdefs.h <<\EOF
#define SYS_SIGLIST_DECLARED 1
EOF

fi

echo $ac_n "checking for sys_siglist variable""... $ac_c" 1>&6
echo "configure:6772: checking for sys_siglist variable" >&5
cat > conftest.$ac_ext <<EOF
#line 6774 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
extern char *sys_siglist[]; printf ("%s\n", sys_siglist[1]);
; return 0; }
EOF
if { (eval echo configure:6781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_SYS_SIGLIST 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
echo "configure:6797: checking for type of signal functions" >&5
if eval "test \"`echo '$''{'octave_cv_signal_vintage'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
  cat > conftest.$ac_ext <<EOF
#line 6803 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {

    sigset_t ss;
    struct sigaction sa;
    sigemptyset(&ss); sigsuspend(&ss);
    sigaction(SIGINT, &sa, (struct sigaction *) 0);
    sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
  
; return 0; }
EOF
if { (eval echo configure:6816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  octave_cv_signal_vintage=posix
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
    cat > conftest.$ac_ext <<EOF
#line 6825 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {

	int mask = sigmask(SIGINT);
	sigsetmask(mask); sigblock(mask); sigpause(mask);
    
; return 0; }
EOF
if { (eval echo configure:6835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  octave_cv_signal_vintage=4.2bsd
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
      cat > conftest.$ac_ext <<EOF
#line 6844 "configure"
#include "confdefs.h"

	#include <signal.h>
	RETSIGTYPE foo() { }
int main() {

		int mask = sigmask(SIGINT);
		sigset(SIGINT, foo); sigrelse(SIGINT);
		sighold(SIGINT); sigpause(SIGINT);
        
; return 0; }
EOF
if { (eval echo configure:6857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  octave_cv_signal_vintage=svr3
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  octave_cv_signal_vintage=v7
    
fi
rm -f conftest*
  
fi
rm -f conftest*

fi
rm -f conftest*

fi

echo "$ac_t""$octave_cv_signal_vintage" 1>&6
if test "$octave_cv_signal_vintage" = posix; then
cat >> confdefs.h <<\EOF
#define HAVE_POSIX_SIGNALS 1
EOF

elif test "$octave_cv_signal_vintage" = "4.2bsd"; then
cat >> confdefs.h <<\EOF
#define HAVE_BSD_SIGNALS 1
EOF

elif test "$octave_cv_signal_vintage" = svr3; then
cat >> confdefs.h <<\EOF
#define HAVE_USG_SIGHOLD 1
EOF

fi



echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
echo "configure:6898: checking if signal handlers must be reinstalled when invoked" >&5
if eval "test \"`echo '$''{'octave_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  if test "$octave_cv_signal_vintage" = svr3; then
  octave_cv_must_reinstall_sighandlers=yes
else
  octave_cv_must_reinstall_sighandlers=no
fi
else
  cat > conftest.$ac_ext <<EOF
#line 6910 "configure"
#include "confdefs.h"

#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
typedef RETSIGTYPE sigfunc();
int nsigint;
#ifdef HAVE_POSIX_SIGNALS
sigfunc *
set_signal_handler(sig, handler)
     int sig;
     sigfunc *handler;
{
  struct sigaction act, oact;
  act.sa_handler = handler;
  act.sa_flags = 0;
  sigemptyset (&act.sa_mask);
  sigemptyset (&oact.sa_mask);
  sigaction (sig, &act, &oact);
  return (oact.sa_handler);
}
#else
#define set_signal_handler(s, h) signal(s, h)
#endif
RETSIGTYPE
sigint(s)
    int s;
{
  nsigint++;
}
main()
{
  nsigint = 0;
  set_signal_handler(SIGINT, sigint);
  kill((int)getpid(), SIGINT);
  kill((int)getpid(), SIGINT);
  exit(nsigint != 2);
}

EOF
if { (eval echo configure:6952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  octave_cv_must_reinstall_sighandlers=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  octave_cv_must_reinstall_sighandlers=yes
fi
rm -fr conftest*
fi

fi

if test "$cross_compiling" = yes; then
  echo "$ac_t""$octave_cv_must_reinstall_sighandlers assumed for cross compilation" 1>&6
else
  echo "$ac_t""$octave_cv_must_reinstall_sighandlers" 1>&6
fi
if test "$octave_cv_must_reinstall_sighandlers" = yes; then
  cat >> confdefs.h <<\EOF
#define MUST_REINSTALL_SIGHANDLERS 1
EOF

fi


### Type stuff.

echo $ac_n "checking for mode_t""... $ac_c" 1>&6
echo "configure:6982: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6987 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_mode_t=yes
else
  rm -rf conftest*
  ac_cv_type_mode_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_mode_t" 1>&6
if test $ac_cv_type_mode_t = no; then
  cat >> confdefs.h <<\EOF
#define mode_t int
EOF

fi

echo $ac_n "checking for off_t""... $ac_c" 1>&6
echo "configure:7015: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7020 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_off_t=yes
else
  rm -rf conftest*
  ac_cv_type_off_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_off_t" 1>&6
if test $ac_cv_type_off_t = no; then
  cat >> confdefs.h <<\EOF
#define off_t long
EOF

fi

echo $ac_n "checking for pid_t""... $ac_c" 1>&6
echo "configure:7048: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7053 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_pid_t=yes
else
  rm -rf conftest*
  ac_cv_type_pid_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_pid_t" 1>&6
if test $ac_cv_type_pid_t = no; then
  cat >> confdefs.h <<\EOF
#define pid_t int
EOF

fi

echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:7081: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7086 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&6
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:7114: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7119 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_type_uid_t" 1>&6
if test $ac_cv_type_uid_t = no; then
  cat >> confdefs.h <<\EOF
#define uid_t int
EOF

  cat >> confdefs.h <<\EOF
#define gid_t int
EOF

fi

echo $ac_n "checking for dev_t""... $ac_c" 1>&6
echo "configure:7148: checking for dev_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7153 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])dev_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_dev_t=yes
else
  rm -rf conftest*
  ac_cv_type_dev_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_dev_t" 1>&6
if test $ac_cv_type_dev_t = no; then
  cat >> confdefs.h <<\EOF
#define dev_t short
EOF

fi

echo $ac_n "checking for ino_t""... $ac_c" 1>&6
echo "configure:7181: checking for ino_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7186 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_ino_t=yes
else
  rm -rf conftest*
  ac_cv_type_ino_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_ino_t" 1>&6
if test $ac_cv_type_ino_t = no; then
  cat >> confdefs.h <<\EOF
#define ino_t unsigned long
EOF

fi

echo $ac_n "checking for nlink_t""... $ac_c" 1>&6
echo "configure:7214: checking for nlink_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_nlink_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7219 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])nlink_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_nlink_t=yes
else
  rm -rf conftest*
  ac_cv_type_nlink_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_nlink_t" 1>&6
if test $ac_cv_type_nlink_t = no; then
  cat >> confdefs.h <<\EOF
#define nlink_t short
EOF

fi

echo $ac_n "checking for sigset_t""... $ac_c" 1>&6
echo "configure:7247: checking for sigset_t" >&5
if eval "test \"`echo '$''{'octave_cv_type_sigset_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7252 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#endif
#include <signal.h>

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "sigset_t" >/dev/null 2>&1; then
  rm -rf conftest*
  octave_cv_type_sigset_t=yes
else
  rm -rf conftest*
  octave_cv_type_sigset_t=no
fi
rm -f conftest*

fi

echo "$ac_t""$octave_cv_type_sigset_t" 1>&6

if test $octave_cv_type_sigset_t = no; then
  cat >> confdefs.h <<\EOF
#define sigset_t int
EOF

fi


### A system dependent kluge or two.

for ac_func in getrusage times
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7288: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7293 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

case "$canonical_host_type" in
  *-*-cygwin32)
    cat >> confdefs.h <<\EOF
#define RUSAGE_TIMES_ONLY 1
EOF

  ;;
esac

bsd_gcc_kluge_targets_frag=/dev/null
case "$canonical_host_type" in
  *-*-386bsd* | *-*-openbsd* | *-*-netbsd* | *-*-freebsd*)
    bsd_gcc_kluge_targets_frag=Makefrag.bsd
    cat << \EOF > $bsd_gcc_kluge_targets_frag

lex.o: lex.cc 
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $<

pt-plot.o: pt-plot.cc
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $<

symtab.o: symtab.cc
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $<

toplev.o: toplev.cc
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $<

unwind-prot.o: unwind-prot.cc 
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS_NO_PT_FLAGS) $<

EOF
  ;;
esac


### Checks for other programs used for building, testing, installing,
### and running Octave.


### For now, don't define LEXLIB to be -lfl -- we don't use anything in
### it, and it might not be installed.
###
### Also make sure that we generate an interactive scanner if we are
### using flex.
  # Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7387: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LEX="flex"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
fi
LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
  echo "$ac_t""$LEX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:7421: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7429 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char yywrap();

int main() {
yywrap()
; return 0; }
EOF
if { (eval echo configure:7440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LEXLIB="-l$ac_lib"
else
  echo "$ac_t""no" 1>&6
fi

fi

  case "$LEX" in
    flex*)
      LFLAGS="-t -I"
      echo "$ac_t""defining LFLAGS to be $LFLAGS" 1>&6
      LEXLIB=
    ;;
    *)
      LEX='$(top_srcdir)/missing flex'
      warn_flex="I didn't find flex, but it's only a problem if you need to reconstruct lex.cc"
      echo "configure: warning: $warn_flex" 1>&2
    ;;
  esac
  


  for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7482: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_YACC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
YACC="$ac_cv_prog_YACC"
if test -n "$YACC"; then
  echo "$ac_t""$YACC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"

  case "$YACC" in
    bison*)
    ;;
    *)
      YACC='$(top_srcdir)/missing bison'
      warn_bison="I didn't find bison, but it's only a problem if you need to reconstruct parse.cc"
      echo "configure: warning: $warn_bison" 1>&2
    ;;
  esac


echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:7524: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test "$cross_compiling" = yes; then
  NM=nm
  echo "$ac_t""assuming $NM exists on $canonical_host_type host" 1>&6
  
else
  # Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7553: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$NM"; then
  ac_cv_prog_NM="$NM" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_NM="nm"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
NM="$ac_cv_prog_NM"
if test -n "$NM"; then
  echo "$ac_t""$NM" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  
fi

if test "$cross_compiling" = yes; then
  RUNTEST=runtest
  echo "$ac_t""assuming $RUNTEST exists on $canonical_host_type host" 1>&6
  
else
  # Extract the first word of "runtest", so it can be a program name with args.
set dummy runtest; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7590: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RUNTEST'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RUNTEST"; then
  ac_cv_prog_RUNTEST="$RUNTEST" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RUNTEST="runtest"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
RUNTEST="$ac_cv_prog_RUNTEST"
if test -n "$RUNTEST"; then
  echo "$ac_t""$RUNTEST" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$RUNTEST"; then
    warn_runtest="I didn't find runtest -- install DejaGNU if you want to run \`make check'"
    echo "configure: warning: $warn_runtest" 1>&2
  fi
  
fi


# Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:7636: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

INSTALL_SCRIPT='${INSTALL}'


if test "$cross_compiling" = yes; then
  GNUPLOT_BINARY=gnuplot
  echo "$ac_t""assuming $GNUPLOT_BINARY exists on $canonical_host_type host" 1>&6
  
  echo "$ac_t""assuming $GNUPLOT_BINARY supports multiplot mode" 1>&6
  cat >> confdefs.h <<\EOF
#define GNUPLOT_HAS_MULTIPLOT 1
EOF

  echo "$ac_t""assuming $GNUPLOT_BINARY supports multiple frams" 1>&6
  cat >> confdefs.h <<\EOF
#define GNUPLOT_HAS_FRAMES 1
EOF

else
  # Extract the first word of "gnuplot", so it can be a program name with args.
set dummy gnuplot; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7709: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNUPLOT_BINARY'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$GNUPLOT_BINARY"; then
  ac_cv_prog_GNUPLOT_BINARY="$GNUPLOT_BINARY" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_GNUPLOT_BINARY="gnuplot"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
GNUPLOT_BINARY="$ac_cv_prog_GNUPLOT_BINARY"
if test -n "$GNUPLOT_BINARY"; then
  echo "$ac_t""$GNUPLOT_BINARY" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -n "$GNUPLOT_BINARY"; then
    echo $ac_n "checking to see if your gnuplot supports multiplot""... $ac_c" 1>&6
echo "configure:7737: checking to see if your gnuplot supports multiplot" >&5
    if test -z "`echo 'set term unknown; set multiplot' | \
      $GNUPLOT_BINARY 2>&1`"; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define GNUPLOT_HAS_MULTIPLOT 1
EOF

    else
      echo "$ac_t""no" 1>&6
    fi
    echo $ac_n "checking to see if your gnuplot supports multiple plot windows""... $ac_c" 1>&6
echo "configure:7749: checking to see if your gnuplot supports multiple plot windows" >&5
    if test -z "`echo 'set term x11 2' | $GNUPLOT_BINARY 2>&1`"; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define GNUPLOT_HAS_FRAMES 1
EOF

    else
      echo "$ac_t""no" 1>&6
    fi
  else
    warn_gnuplot="yes"

    ## If you change this text, be sure to also copy it to the set of
    ## warnings at the end of the script

    echo "configure: warning: I didn't find gnuplot.  It isn't necessary to have gnuplot" 1>&2
    echo "configure: warning: installed, but you won't be able to use any of Octave's" 1>&2
    echo "configure: warning: plotting commands without it." 1>&2
    echo "configure: warning: " 1>&2
    echo "configure: warning: If gnuplot is installed but it isn't in your path, you can" 1>&2
    echo "configure: warning: tell Octave where to find it by typing the command" 1>&2
    echo "configure: warning: " 1>&2
    echo "configure: warning: gnuplot_binary = "/full/path/to/gnuplot/binary"" 1>&2
    echo "configure: warning: " 1>&2
    echo "configure: warning: at the Octave prompt." 1>&2
  fi
fi

if test "$cross_compiling" = yes; then
  DEFAULT_PAGER=less
  echo "$ac_t""assuming $DEFAULT_PAGER exists on $canonical_host_type host" 1>&6
  
else
  octave_possible_pagers="less more page pg"
  case "$canonical_host_type" in
    *-*-cygwin32)
      octave_possible_pagers="$octave_possible_pagers more.com"
    ;;
  esac

  for ac_prog in $octave_possible_pagers
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7795: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_PAGER'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DEFAULT_PAGER"; then
  ac_cv_prog_DEFAULT_PAGER="$DEFAULT_PAGER" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_DEFAULT_PAGER="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
DEFAULT_PAGER="$ac_cv_prog_DEFAULT_PAGER"
if test -n "$DEFAULT_PAGER"; then
  echo "$ac_t""$DEFAULT_PAGER" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$DEFAULT_PAGER" && break
done

  if test -z "$DEFAULT_PAGER"; then
    warn_less="I couldn't find \`less', \`more', \`page', or \`pg'"
    echo "configure: warning: $warn_less" 1>&2
  fi
fi


  # Extract the first word of "gperf", so it can be a program name with args.
set dummy gperf; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:7834: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GPERF'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$GPERF"; then
  ac_cv_prog_GPERF="$GPERF" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_GPERF="gperf"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
GPERF="$ac_cv_prog_GPERF"
if test -n "$GPERF"; then
  echo "$ac_t""$GPERF" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -n "$GPERF"; then
    if echo "%{
%}
%%
foo" | $GPERF -t -C -D -E -G -L ANSI-C -H octave_kw_hash -N octave_kw_lookup > /dev/null 2>&1; then
      true
    else
      GPERF=""
      warn_gperf="I found gperf, but it does not support all of the following options: -t -C -D -E -G -L ANSI-C -H -N; you need gperf 2.7 or a more recent version"
      echo "configure: warning: $warn_gperf" 1>&2
    fi
  else
    GPERF='$(top_srcdir)/missing gperf'
    warn_gperf="I didn't find gperf, but it's only a problem if you need to reconstruct oct-gperf.h"
    echo "configure: warning: $warn_gperf" 1>&2
  fi
  


EXE=
case "$canonical_host_type" in
  *-*-cygwin32)
    EXE=.exe
  ;;
esac


### Even though we include config.h, we need to have the preprocessor
### defines available in a variable for the octave-bug script.  Use
### UGLY_DEFS for that.

# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
cat > conftest.defs <<\EOF
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
s%\[%\\&%g
s%\]%\\&%g
s%\$%$$%g
EOF
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
rm -f conftest.defs

UGLY_DEFS=`echo $DEFS | sed 's,\\",\\\\\\\\\\\\\\\\\\",g'`
echo "$ac_t""defining UGLY_DEFS to be $UGLY_DEFS" 1>&6


### Maybe add -Wall to compiler flags now that we're done feature
### testing. 

if test -z "$EXTERN_CFLAGS"; then
  
  ac_safe=`echo "-Wall" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CC-cc} accepts -Wall""... $ac_c" 1>&6
echo "configure:7915: checking whether ${CC-cc} accepts -Wall" >&5
  if eval "test \"`echo '$''{'octave_cv_cc_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    XCFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -Wall"
    cat > conftest.$ac_ext <<EOF
#line 7931 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:7938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=no"
fi
rm -f conftest*
    CFLAGS="$XCFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      CFLAGS="$CFLAGS -Wall"
      echo "$ac_t""adding -Wall to CFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

fi

if test -z "$EXTERN_CXXFLAGS"; then
  
  ac_safe=`echo "-Wall" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts -Wall""... $ac_c" 1>&6
echo "configure:7975: checking whether ${CXX-g++} accepts -Wall" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS -Wall"
    cat > conftest.$ac_ext <<EOF
#line 7991 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:7998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      CXXFLAGS="$CXXFLAGS -Wall"
      echo "$ac_t""adding -Wall to CXXFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

fi

### Someday, maybe include -ansi and even -pedantic in this list...

GCC_PICKY_FLAGS="-Wcast-align -Wcast-qual -Wid-clash-31 \
 -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
 -Wstrict-prototypes -Wwrite-strings"

GXX_PICKY_FLAGS="$GCC_PICKY_FLAGS -Weffc++ -Wenum-clash -fno-nonnull-objects"

# Check whether --enable-picky-flags or --disable-picky-flags was given.
if test "${enable_picky_flags+set}" = set; then
  enableval="$enable_picky_flags"
  if test "$enableval" = no; then
     true
   elif test "$enableval" = yes; then
     if test -z "$EXTERN_CFLAGS"; then
       for flag in $GCC_PICKY_FLAGS; do
	 
  ac_safe=`echo "$flag" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CC-cc} accepts $flag""... $ac_c" 1>&6
echo "configure:8050: checking whether ${CC-cc} accepts $flag" >&5
  if eval "test \"`echo '$''{'octave_cv_cc_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    XCFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $flag"
    cat > conftest.$ac_ext <<EOF
#line 8066 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:8073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cc_flag_$ac_safe=no"
fi
rm -f conftest*
    CFLAGS="$XCFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      CFLAGS="$CFLAGS $flag"
      echo "$ac_t""adding $flag to CFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

       done
     fi
     if test -z "$EXTERN_CXXFLAGS"; then
       for flag in $GXX_PICKY_FLAGS; do
	 
  ac_safe=`echo "$flag" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking whether ${CXX-g++} accepts $flag""... $ac_c" 1>&6
echo "configure:8111: checking whether ${CXX-g++} accepts $flag" >&5
  if eval "test \"`echo '$''{'octave_cv_cxx_flag_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

    XCXXFLAGS="$CXXFLAGS"
    CXXFLAGS="$CXXFLAGS $flag"
    cat > conftest.$ac_ext <<EOF
#line 8127 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:8134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "octave_cv_cxx_flag_$ac_safe=no"
fi
rm -f conftest*
    CXXFLAGS="$XCXXFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

  
fi

  if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then
    echo "$ac_t""yes" 1>&6
    
      CXXFLAGS="$CXXFLAGS $flag"
      echo "$ac_t""adding $flag to CXXFLAGS" 1>&6
  else
    echo "$ac_t""no" 1>&6
    
  fi

       done
     fi
   fi
fi


### Run configure in subdirectories.

export CC
export CXX
export F77

subdirs="$GLOB_DIR kpathsea scripts $PLPLOT_DIR"


### Do the substitutions in all the Makefiles.

trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "Makefile octMakefile Makeconf install-octave \
  test/Makefile dlfcn/Makefile \
  doc/Makefile doc/faq/Makefile doc/interpreter/Makefile \
  doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \
  examples/Makefile liboctave/Makefile src/Makefile \
  libcruft/Makefile libcruft/Makerules \
  libcruft/amos/Makefile libcruft/blas/Makefile \
  libcruft/dassl/Makefile libcruft/fftpack/Makefile \
  libcruft/lapack/Makefile libcruft/linpack/Makefile \
  libcruft/minpack/Makefile libcruft/misc/Makefile \
  libcruft/odepack/Makefile libcruft/ordered-qz/Makefile \
  libcruft/quadpack/Makefile libcruft/ranlib/Makefile \
  libcruft/slatec-fn/Makefile libcruft/slatec-err/Makefile \
  libcruft/villad/Makefile \
  libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@canonical_host_type@%$canonical_host_type%g
s%@man1dir@%$man1dir%g
s%@man1ext@%$man1ext%g
s%@infofile@%$infofile%g
s%@octincludedir@%$octincludedir%g
s%@fcnfiledir@%$fcnfiledir%g
s%@localfcnfiledir@%$localfcnfiledir%g
s%@localverfcnfiledir@%$localverfcnfiledir%g
s%@localfcnfilepath@%$localfcnfilepath%g
s%@octlibdir@%$octlibdir%g
s%@archlibdir@%$archlibdir%g
s%@localarchlibdir@%$localarchlibdir%g
s%@localverarchlibdir@%$localverarchlibdir%g
s%@octfiledir@%$octfiledir%g
s%@localoctfiledir@%$localoctfiledir%g
s%@localveroctfiledir@%$localveroctfiledir%g
s%@localoctfilepath@%$localoctfilepath%g
s%@fcnfilepath@%$fcnfilepath%g
s%@imagedir@%$imagedir%g
s%@imagepath@%$imagepath%g
s%@config_opts@%$config_opts%g
s%@LIBPLPLOT@%$LIBPLPLOT%g
s%@PLPLOT_DIR@%$PLPLOT_DIR%g
s%@LIBKPATHSEA@%$LIBKPATHSEA%g
s%@CXX@%$CXX%g
s%@CXXCPP@%$CXXCPP%g
s%@CXX_VERSION@%$CXX_VERSION%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@CC_VERSION@%$CC_VERSION%g
s%@DEPEND_FLAGS@%$DEPEND_FLAGS%g
s%@DEPEND_EXTRA_SED_PATTERN@%$DEPEND_EXTRA_SED_PATTERN%g
s%@XTRA_CFLAGS@%$XTRA_CFLAGS%g
s%@XTRA_CXXFLAGS@%$XTRA_CXXFLAGS%g
s%@LD_STATIC_FLAG@%$LD_STATIC_FLAG%g
s%@FFT_DIR@%$FFT_DIR%g
s%@FFTW_LIBS@%$FFTW_LIBS%g
s%@AR@%$AR%g
s%@ARFLAGS@%$ARFLAGS%g
s%@RANLIB@%$RANLIB%g
s%@F77@%$F77%g
s%@F2C@%$F2C%g
s%@FORTRAN_MAIN_FLAG@%$FORTRAN_MAIN_FLAG%g
s%@FC@%$FC%g
s%@FLIBS@%$FLIBS%g
s%@F2CFLAGS@%$F2CFLAGS%g
/@f77_rules_frag@/r $f77_rules_frag
s%@f77_rules_frag@%%g
s%@BLAS_DIR@%$BLAS_DIR%g
s%@LAPACK_DIR@%$LAPACK_DIR%g
s%@BLAS_LIBS@%$BLAS_LIBS%g
s%@STATIC_LIBS@%$STATIC_LIBS%g
s%@SHARED_LIBS@%$SHARED_LIBS%g
s%@LIBOCTINTERP@%$LIBOCTINTERP%g
s%@LIBOCTAVE@%$LIBOCTAVE%g
s%@LIBCRUFT@%$LIBCRUFT%g
s%@FPICFLAG@%$FPICFLAG%g
s%@CPICFLAG@%$CPICFLAG%g
s%@CXXPICFLAG@%$CXXPICFLAG%g
s%@SHLEXT@%$SHLEXT%g
s%@DLFCN_DIR@%$DLFCN_DIR%g
s%@SH_LD@%$SH_LD%g
s%@SH_LDFLAGS@%$SH_LDFLAGS%g
s%@SONAME_FLAGS@%$SONAME_FLAGS%g
s%@RLD_FLAG@%$RLD_FLAG%g
s%@TEMPLATE_AR@%$TEMPLATE_AR%g
s%@TEMPLATE_ARFLAGS@%$TEMPLATE_ARFLAGS%g
s%@OCTAVE_LITE@%$OCTAVE_LITE%g
s%@ALLOCA@%$ALLOCA%g
s%@GLOB_DIR@%$GLOB_DIR%g
s%@LIBGLOB@%$LIBGLOB%g
s%@GLOB_INCFLAGS@%$GLOB_INCFLAGS%g
s%@WITH_DL@%$WITH_DL%g
s%@LIBDLFCN@%$LIBDLFCN%g
s%@DLFCN_INCFLAGS@%$DLFCN_INCFLAGS%g
s%@RDYNAMIC_FLAG@%$RDYNAMIC_FLAG%g
s%@LD_CXX@%$LD_CXX%g
s%@WITH_SHL@%$WITH_SHL%g
s%@WITH_DYNAMIC_LINKING@%$WITH_DYNAMIC_LINKING%g
s%@LIBOBJS@%$LIBOBJS%g
/@bsd_gcc_kluge_targets_frag@/r $bsd_gcc_kluge_targets_frag
s%@bsd_gcc_kluge_targets_frag@%%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LFLAGS@%$LFLAGS%g
s%@YACC@%$YACC%g
s%@LN_S@%$LN_S%g
s%@NM@%$NM%g
s%@RUNTEST@%$RUNTEST%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@DEFAULT_PAGER@%$DEFAULT_PAGER%g
s%@GNUPLOT_BINARY@%$GNUPLOT_BINARY%g
s%@GPERF@%$GPERF%g
s%@EXE@%$EXE%g
s%@UGLY_DEFS@%$UGLY_DEFS%g
s%@subdirs@%$subdirs%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"Makefile octMakefile Makeconf install-octave \
  test/Makefile dlfcn/Makefile \
  doc/Makefile doc/faq/Makefile doc/interpreter/Makefile \
  doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \
  examples/Makefile liboctave/Makefile src/Makefile \
  libcruft/Makefile libcruft/Makerules \
  libcruft/amos/Makefile libcruft/blas/Makefile \
  libcruft/dassl/Makefile libcruft/fftpack/Makefile \
  libcruft/lapack/Makefile libcruft/linpack/Makefile \
  libcruft/minpack/Makefile libcruft/misc/Makefile \
  libcruft/odepack/Makefile libcruft/ordered-qz/Makefile \
  libcruft/quadpack/Makefile libcruft/ranlib/Makefile \
  libcruft/slatec-fn/Makefile libcruft/slatec-err/Makefile \
  libcruft/villad/Makefile \
  libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1

if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in $GLOB_DIR kpathsea scripts $PLPLOT_DIR; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac
  case "$ac_given_INSTALL" in
        [/$]*) INSTALL="$ac_given_INSTALL" ;;
        *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
        esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi




### Print a summary so that important information isn't missed.

if test -z "$F77"; then
  FORT="$F2C $F2CFLAGS"
else
  FORT="$F77 $FFLAGS"
fi

echo "$ac_t""

Octave is now configured for $canonical_host_type

  Source directory:     $srcdir
  Installation prefix:  $prefix
  C compiler:           $CC $XTRA_CFLAGS $CFLAGS
  C++ compiler:         $CXX $XTRA_CXXFLAGS $CXXFLAGS
  Fortran compiler:     $FORT
  Fortran libraries:    $FLIBS
  BLAS libraries:       $BLAS_LIBS
  FFTW libraries:       $FFTW_LIBS
  HDF5 libraries:       $HDF5_LIBS
  LIBS:                 $LIBS
  Default pager:        $DEFAULT_PAGER
  gnuplot:              $GNUPLOT_BINARY

  Do internal array bounds checking:       $BOUNDS_CHECKING
  Build static libraries:                  $STATIC_LIBS
  Build shared libraries:                  $SHARED_LIBS
  Minimal kernel option:                   $OCTAVE_LITE
  Dynamic Linking (dlopen/dlsym):          $WITH_DL
  Dynamic Linking (shl_load/shl_findsym):  $WITH_SHL
  Include support for GNU readline:        $USE_READLINE
" 1>&6

warn_msg_printed=false

if test -n "$warn_f77_and_g77"; then
  echo "configure: warning: $warn_f77_and_g77" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_f2c_and_f77"; then
  echo "configure: warning: $warn_f2c_and_f77" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_f2c_and_g77"; then
  echo "configure: warning: $warn_f2c_and_g77" 1>&2
  warn_msg_printed=true
fi

if test -n "$gxx_only"; then
  echo "configure: warning: $gxx_only" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_gcc_version"; then
  echo "configure: warning: $warn_gcc_version" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_gcc_only"; then
  echo "configure: warning: $warn_gcc_only" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_f2c_no_lib"; then
  echo "configure: warning: $warn_f2c_no_lib" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_readline"; then
  echo "configure: warning: $warn_readline" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_termlibs"; then
  echo "configure: warning: $warn_termlibs" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_gperf"; then
  echo "configure: warning: $warn_gperf" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_flex"; then
  echo "configure: warning: $warn_flex" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_bison"; then
  echo "configure: warning: $warn_bison" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_less"; then
  echo "configure: warning: $warn_less" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_runtest"; then
  echo "configure: warning: $warn_runtest" 1>&2
  warn_msg_printed=true
fi

if test -n "$warn_gnuplot"; then

  ## If you change this text, be sure to also change the corresponding
  ## set of warnings above.

  echo "configure: warning: I didn't find gnuplot.  It isn't necessary to have gnuplot" 1>&2
  echo "configure: warning: installed, but you won't be able to use any of Octave's" 1>&2
  echo "configure: warning: plotting commands without it." 1>&2
  echo "configure: warning: " 1>&2
  echo "configure: warning: If gnuplot is installed but it isn't in your path, you can" 1>&2
  echo "configure: warning: tell Octave where to find it by typing the command" 1>&2
  echo "configure: warning: " 1>&2
  echo "configure: warning: gnuplot_binary = "/full/path/to/gnuplot/binary"" 1>&2
  echo "configure: warning: " 1>&2
  echo "configure: warning: at the Octave prompt." 1>&2
  warn_msg_printed=true
fi

if $warn_msg_printed; then
  echo "$ac_t""" 1>&6
fi

### End of configure.
chmod +x install-octave

