#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12 
# 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-lam=MPI_DIR	Top-level install directory for LAM/MPI"
ac_help="$ac_help
--with-mpich=MPI_DIR	Top-level install directory for MPICH/MPI"
ac_help="$ac_help
--with-mpichdev=LIBDIR	Library subdirectory for MPICH/MPI"
ac_help="$ac_help
--with-sp		Use IBM's SP/MPI"
ac_help="$ac_help
--with-sgi		Use SGI's IRIX/64 MPI"
ac_help="$ac_help
--with-sgi64		Use SGI's IRIX/64 MPI (force 64 bit mode)"
ac_help="$ac_help
--with-cray            Use Cray's native MPI"
ac_help="$ac_help
--with-hp		Use HP's HP-UX 10.x MPI"
ac_help="$ac_help
--with-mpidir=MPI_DIR	Top-level MPI directory (if not listed above)"
ac_help="$ac_help
--with-mpiinc=MPI_INC	Directory where mpi.h exists"
ac_help="$ac_help
--with-mpilib=MPI_INC	Directory where libmpi.a exists"
ac_help="$ac_help
--with-profiling	Make the profilable C++ bindings"
ac_help="$ac_help
--with-exflags          Specify flags necessary to enable exceptions"
ac_help="$ac_help
--without-opt		Compile with no optimization (for debugging)"
ac_help="$ac_help
--with-libopt		Opt flags for use when compiling libmpi++.a"
ac_help="$ac_help
--with-testopt		Opt flags for use when compiling test suite"
ac_help="$ac_help
--with-examopt		Opt flags for use when compiling examples"
ac_help="$ac_help
--with-namespace        Force the use of C++ namespaces"

# 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=
# 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.12"
    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/comm.h

# 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 $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

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




#
# Configure script for MPI C++ Bindings.
# Set some directories and some defaults.
#

TOPDIR=`pwd`
DISTDIR=`dirname $TOPDIR`


#
# Directories for other packages
#

if test "$prefix" != "NONE"; then
    INSTALLDIR=$prefix
else
    INSTALLDIR="/usr/local"
fi

MPI_IMP=other_vendor
MPI_DIR=$prefix
MPI_INCDIR=

#MPI_CXX=
# Do this later -- #$%^#$ HP-UX!!
MPI_CXXFLAGS=
MPI_LDFLAGS=
MPI_LIBS=

MPI_CONSTANTS_BAD=0


#
# Balky flags
#

BALKY_CXX=
BALKY_INCDIR=
BALKY_CXXFLAGS=
BALKY_LIBDIR=
BALKY_LIBS=
BALKY_LDFLAGS=


#
# Compiler flags
#

OPTFLAGS="-O"
EXAM_OPTFLAGS=$OPTFLAGS
TEST_OPTFLAGS=$OPTFLAGS


#
# Miscellaneous flags
#

MPICH_DEV=
EXTRA_CXXFLAGS=
EXCPTN_CXXFLAGS=
EXCPTN_LDFLAGS=
IV_DESTRUCTORS=1
WANT_SOCKET_LIBS=
WANT_THREAD_LIBS=
ARCH=
EXFLAGS=
FORCE_EXFLAGS=


#
# Get our system type
# Set up for some screwy machines
#

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 $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:660: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`$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=`$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

case "$host" in
    *-hp-hpux*)
        EXTRA_CXXFLAGS="-w"
        CXXFLAGS="$CXXFLAGS $EXTRA_CXXFLAGS"
	EXFLAGS="+eh"

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


        OPTFLAGS="+O1"
        EXAM_OPTFLAGS=$OPTFLAGS
        TEST_OPTFLAGS=$OPTFLAGS

	MPI_CXX_SAVE=$MPI_CXX

	ARCH=HPUX
        ;;

    mips-sgi-irix*)
        OPTFLAGS="-O3"
        TEST_OPTFLAGS=$OPTFLAGS
        EXAM_OPTFLAGS=$OPTFLAGS
	ARCH=IRIX
        ;;

    *-cray-unicos*)
	# Yuk!  We have to turn off all optimization in the test suite because
	# Cray's CC version 3.0.0.0 runs out of memory when compiling modules
	# like port_test.cc and request_array_test.cc.  Doh!!

	NOOPT="-O0"
	OPTFLAGS="-O3"
	TEST_OPTFLAGS=$NOOPT
	EXAM_OPTFLAGS=$OPTFLAGS

	EXFLAGS="-h exceptions"
	ARCH=CRAY
	;;
esac

#
# Now we can clear MPI_CXX
#

MPI_CXX=


#
# Set autoconf for C++
#

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 $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross



#
# Figure out which brand of echo we have and define
# prompt and print shell functions accordingly.
#
# Blatently stolen from the TIFF configure file.
#

if test `echo foo\\\c`@ = "foo@"; then
    prompt()
    {
        echo "$* \\c"
    }
elif test "`echo -n foo`@" = "foo@"; then
    prompt()
    {
        echo -n "$* "
    }
else
    prompt()
    {
        echo "$*"
    }
fi


#
# Find some extra programs
#

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

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



#
# Check --with values for specific MPI implementations.  Check for:
#  - wrapper compilers that come with some implementations
#  - specific options necessary for some MPI implementations
#
# LAM 6.0/6.1
#

# Check whether --with-lam or --without-lam was given.
if test "${with_lam+set}" = set; then
  withval="$with_lam"
  MPI_IMP="lam" WITHDIR=$withval
fi


if test "$MPI_IMP" = "lam"; then
    if test "$LAMHCP" = ""; then
        { echo "configure: error: LAMHCP environment variable not set" 1>&2; exit 1; }
        exit
    fi

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

    if test "$MPI_CXX" = "no"; then
        echo $ac_n "checking for hcp (elsewhere)""... $ac_c" 1>&6
echo "configure:890: checking for hcp (elsewhere)" >&5
        if test -x $WITHDIR/bin/hcp; then
            MPI_CXX=$WITHDIR/bin/hcp
            echo "$ac_t""$MPI_CXX" 1>&6
        elif test -x $WITHDIR/hcp; then
            MPI_CXX=$WITHDIR/hcp
            echo "$ac_t""$MPI_CXX" 1>&6
        else
            { echo "configure: error: cannot continue -- put hcp in your path" 1>&2; exit 1; }
        fi
    fi
    CXX=$MPI_CXX

    MPI_LIBS="-lmpi"

    if test "$ARCH" = "IRIX"; then
	cat >> confdefs.h <<\EOF
#define LAMIRIX 1
EOF

    fi

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

fi

#
# MPICH 1.0.13 (or higher)
#

# Check whether --with-mpich or --without-mpich was given.
if test "${with_mpich+set}" = set; then
  withval="$with_mpich"
  MPI_IMP="mpich" WITHDIR=$withval
fi

# Check whether --with-mpichdev or --without-mpichdev was given.
if test "${with_mpichdev+set}" = set; then
  withval="$with_mpichdev"
  MPI_IMP="mpich" MPICH_DEV=$withval
fi


if test "$MPI_IMP" = "mpich"; then

    if test "$WITHDIR" = "yes"; then
        { echo "configure: error: supplied --with-mpich without a directory" 1>&2; exit 1; }
    fi

    echo $ac_n "checking MPICH version""... $ac_c" 1>&6
echo "configure:942: checking MPICH version" >&5
    MPICH_VERSION=`cat $WITHDIR/include/patchlevel.h | awk '{print $3}' | sed -e 's/\.0-9//' | tr '\012' '.'`
    if test "$MPICH_VERSION" = "1.0.0.13."; then
        MPI_CONSTANTS_BAD=1
        cat >> confdefs.h <<\EOF
#define MPICH1013 1
EOF

        echo "$ac_t""1.0.13 (you should upgrade)" 1>&6
    elif test "$MPICH_VERSION" = "1.1.0."; then
        cat >> confdefs.h <<\EOF
#define MPICH110 1
EOF

        echo "$ac_t""1.1.0 (you should upgrade)" 1>&6
    else

	#
	# Argh!  MPICH changed the format of their patchlevel file
	# as of version 1.1.1.
	#

	MPICH_VERSION=`grep 'PATCHLEVEL ' $WITHDIR/include/patchlevel.h | awk '{print $3}'`
	mv1=`grep 'PATCHLEVEL_SUBMINOR' $WITHDIR/include/patchlevel.h | awk '{print $3}'`
	MPICH_VERSION="$MPICH_VERSION.$mv1."

	if test "$MPICH_VERSION" = "1.1.1."; then
	    cat >> confdefs.h <<\EOF
#define MPICH111 1
EOF

	    echo "$ac_t""1.1.1 (good)" 1>&6
	else
	    cat >> confdefs.h <<\EOF
#define MPICH 1
EOF

	    echo "$ac_t""unrecognized MPICH level -- good luck!" 1>&6
	fi
    fi

    MPILIB_DIR=$WITHDIR/$MPICH_DEV
    
    OLD_ARCH=$ARCH
    if test -x $WITHDIR/util/tarch; then 
	ARCH=`$WITHDIR/util/tarch | sed s/-/_/g`
    elif test -x $WITHDIR/bin/tarch; then
	ARCH=`$WITHDIR/bin/tarch | sed s/-/_/g`
    fi

    if test ! "$MPICH_DEV" = ""; then
	DEVICE=$MPICH_DEV
    elif test -d "$WITHDIR/lib/$ARCH"; then
	echo "no MPICH device specified"
	echo $ac_n "checking checking for existing MPICH devices""... $ac_c" 1>&6
echo "configure:997: checking checking for existing MPICH devices" >&5
	devices=""
	for device in `/bin/ls $WITHDIR/lib/$ARCH`; do
	    if test -d $WITHDIR/lib/$ARCH/$device; then
		devices="$device $devices"
	    fi
	done
	devices=`echo "$devices" | sed -e 's/^ 	*//' -e 's/ 	*$//'`
	
	device_count=`echo $devices | $WC | $AWK '{ print $2 }'`

	#
	# How many did we find?
	#

	if test "$device_count" = "0"; then
	    echo "$ac_t""none found" 1>&6
	    { echo "configure: error: cannot continue" 1>&2; exit 1; }
	elif test "$device_count" = "1"; then
	    DEVICE=$devices
	    echo "$ac_t""found $DEVICE MPICH device" 1>&6
	else
	    echo "$ac_t""found multiple MPICH devices" 1>&6
	    DEVICE=0
	    while test "$DEVICE" = "0"; do
		prompt "Please select an MPICH device ($devices):"
		read DEVICE
		DEVICE=`echo "$DEVICE" | sed -e 's/^	*//' -e 's/	*$//'`

		if test ! -d "$WITHDIR/lib/$ARCH/$DEVICE"; then
		    echo "$DEVICE MPICH device not found"
		    DEVICE=0
		fi
	    done
	fi
	MPICH_DEV=lib/$ARCH/$DEVICE
    else
	{ echo "configure: error: could not find MPICH support for $ARCH" 1>&2; exit 1; }
    fi
    
    ARCH=$OLD_ARCH

    if test "$MPICH_VERSION" = "1.1.1."; then
        MPI_CXX=$WITHDIR/$MPICH_DEV/mpiCC
        CXX=$MPI_CXX
    else
	MPI_CXXFLAGS="-I$WITHDIR/include"
	MPI_LDFLAGS="-L$WITHDIR/$MPICH_DEV"

	MPI_LIBS="-lmpi"
	if test "$ARCH" != "IRIX"; then
	    WANT_SOCKET_LIBS=1
	fi
	WANT_THREAD_LIBS=1
    fi

fi


#
# IBM SP
#

# Check whether --with-sp or --without-sp was given.
if test "${with_sp+set}" = set; then
  withval="$with_sp"
  MPI_IMP="ibm-sp" CXX=mpCC
fi


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

    if test "$MPI_CXX" = "doh"; then
        echo $ac_n "checking for mpCC (elsewhere)""... $ac_c" 1>&6
echo "configure:1102: checking for mpCC (elsewhere)" >&5
        foreach comp /bin/mpCC /usr/bin/mpCC
            if test "$MPI_CXX" = "" -a -x $comp; then
                echo "$ac_t""yes" 1>&6
                MPI_CXX=$comp
            fi
        end
        if test "$MPI_CXX" = ""; then
            echo "$ac_t""no" 1>&6
            { echo "configure: error: cannot continue -- put mpCC in your path" 1>&2; exit 1; }
        fi
    fi
    CXX=$MPI_CXX
   
    OPTFLAGS="-O3 -qstrict -qarch=pwr2 -qtune=pwr2s -Q"
    TEST_OPTFLAGS=$OPTFLAGS
    EXAM_OPTFLAGS=$OPTFLAGS

    echo $ac_n "checking POE version""... $ac_c" 1>&6
echo "configure:1121: checking POE version" >&5
    POE_VERSION=`lslpp -L ppe.poe | grep poe | awk '{ print $2 }'`
    if test "$POE_VERSION" = "2.1.0.14"; then
        cat >> confdefs.h <<\EOF
#define IBM21014 1
EOF

        echo "$ac_t""2.1.0.14 (you should upgrade)" 1>&6
    elif test "$POE_VERSION" = "2.1.0.15"; then
        cat >> confdefs.h <<\EOF
#define IBM21015 1
EOF

        echo "$ac_t""2.1.0.15 (you should upgrade)" 1>&6
    elif test "$POE_VERSION" = "2.1.0.16"; then
        cat >> confdefs.h <<\EOF
#define IBM21016 1
EOF

        echo "$ac_t""2.1.0.16 (you should upgrade)" 1>&6
    elif test "$POE_VERSION" = "2.1.0.17"; then
        cat >> confdefs.h <<\EOF
#define IBM21017 1
EOF

        echo "$ac_t""2.1.0.17 (you should upgrade)" 1>&6
    elif test "$POE_VERSION" = "2.1.0.18"; then
        cat >> confdefs.h <<\EOF
#define IBM21018 1
EOF

        echo "$ac_t""2.1.0.18 (good)" 1>&6
    else
        cat >> confdefs.h <<\EOF
#define IBMUNKNOWN 1
EOF

        echo "$ac_t""Unknown version -- $POE_VERSION (good luck)" 1>&6
    fi
fi


#
# SGI IRIX 6.4
#

# Check whether --with-sgi or --without-sgi was given.
if test "${with_sgi+set}" = set; then
  withval="$with_sgi"
  MPI_IMP="sgi" CXX=CC
fi

# Check whether --with-sgi64 or --without-sgi64 was given.
if test "${with_sgi64+set}" = set; then
  withval="$with_sgi64"
  MPI_IMP="sgi64" CXX=CC
fi


if test "$MPI_IMP" = "sgi" -o "$MPI_IMP" = "sgi64"; then
    MPI_LIBS="-lmpi"

    IV_DESTRUCTORS=0

    # If they just said "--with-sgi", go find the libmpi.so

    if test "$MPI_IMP" = "sgi"; then
        if test -f /usr/lib32/libmpi.so; then
            LIBDIR=/usr/lib32
            SGIFLAGS="-n32"
            SGIBIT="n32"
        elif test -f /usr/lib64/libmpi.so; then
            LIBDIR=/usr/lib64
            SGIFLAGS="-64"
            SGIBIT="64"
        else
            { echo "configure: error: cannot find libmpi.so in /usr/lib32 or /usr/lib64" 1>&2; exit 1; }
        fi
    elif test "$MPI_IMP" = "sgi64"; then
        if test -f /usr/lib64/libmpi.so; then
	    cat >> confdefs.h <<\EOF
#define POINTER long
EOF

            LIBDIR=/usr/lib64
            SGIFLAGS="-64"
            SGIBIT="64"
        else
            { echo "configure: error: cannot find libmpi.so in /usr/lib64" 1>&2; exit 1; }
        fi
    fi

    echo $ac_n "checking SGI MPI version""... $ac_c" 1>&6
echo "configure:1214: checking SGI MPI version" >&5
    IS20=`strings $LIBDIR/libmpi.so | grep "SGI MPI 2.0"`
    if test "$IS20" != ""; then    
        cat >> confdefs.h <<\EOF
#define SGI20 1
EOF

        echo "$ac_t""2.0 ($SGIBIT) (you should upgrade)" 1>&6
        echo "configure: warning: *** You are advised to get the latest version of SGI's MPI" 1>&2
        echo "configure: warning: *** See http://www.sgi.com/Products/Evaluation/evaluation.html" 1>&2
    else
        IS30=`strings $LIBDIR/libmpi.so | grep "SGI MPI 3.0"`
        if test "$IS30" != ""; then
            cat >> confdefs.h <<\EOF
#define SGI30 1
EOF

            echo "$ac_t""3.0 ($SGIBIT -- good)" 1>&6
        else
            VER=`strings $LIBDIR/libmpi.so | grep "SGI MPI"`
            cat >> confdefs.h <<\EOF
#define SGIUNKNOWN 1
EOF

            
            echo "$ac_t""Unknown version ($SGIBIT) -- $VER (good luck)" 1>&6
        fi
    fi

    MPI_CXXFLAGS="$SGIFLAGS"
    MPI_LDFLAGS="$SGIFLAGS"
fi


#
# Cray
#

# Check whether --with-cray or --without-cray was given.
if test "${with_cray+set}" = set; then
  withval="$with_cray"
  MPI_IMP="cray"
fi


if test "$MPI_IMP" = "cray"; then
    MPI_LIBS="-lmpi"
    CXX=CC
    MPI_CXX=CC

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

    echo $ac_n "checking Cray MPI version""... $ac_c" 1>&6
echo "configure:1269: checking Cray MPI version" >&5
    CRAYVER=`ls -ld /opt/ctl/mpt/mpt | awk '{ print $11 }' | cut -d/ -f5`
    if test "$CRAYVER" = "1.1.0.4"; then
        cat >> confdefs.h <<\EOF
#define CRAY1104 1
EOF

	echo "$ac_t""1.1.0.4 (good)" 1>&6
    else
	cat >> confdefs.h <<\EOF
#define CRAYUNKNOWN 1
EOF

	echo "$ac_t""unknown Cray MPI version -- good luck!" 1>&6
    fi

    MPI_CXXFLAGS="-hnomessage=427"
    MPI_LDFLAGS=""
fi


#
# HP-UX
#

# Check whether --with-hp or --without-hp was given.
if test "${with_hp+set}" = set; then
  withval="$with_hp"
  MPI_IMP="hp"
fi


if test "$MPI_IMP" = "hp"; then
        if test "$MPI_ROOT" = ""; then
                MPI_ROOT="/opt/mpi"
                echo "configure: warning: \$MPI_ROOT is defaulting to /opt/mpi." 1>&2
                echo "configure: warning: Override it by setting it manually and re-running configure." 1>&2
        fi

	MPI_CXX=$MPI_CXX_SAVE
        if test "$MPI_CXX" = ""; then
                MPI_CXX=aCC
                echo "configure: warning: You need to set \$MPI_CXX to the appropriate compiler." 1>&2
                echo "configure: warning: Defaulting to aCC." 1>&2
        fi

        echo $ac_n "checking HP-UX MPI version""... $ac_c" 1>&6
echo "configure:1316: checking HP-UX MPI version" >&5
        if ! test -r $MPI_ROOT/lib/pa1.1/libmpi.a; then
                echo "$ac_t""cannot find libmpi.a!" 1>&6
                { echo "configure: error: Is \$MPI_ROOT set properly?" 1>&2; exit 1; }
        fi

        HPSTR=`what $MPI_ROOT/lib/pa1.1/libmpi.a | grep "HP MPI"`
	HPVER=`echo $HPSTR | cut -d. -f2-3`
        if test "$HPVER" = "01.02"; then
                cat >> confdefs.h <<\EOF
#define HPUX0102 1
EOF

                echo "$ac_t""1.2 (good)" 1>&6
	else
		HPVER=`echo "$HPSTR" | sed -e "s/[^0-9\.]*//" | cut -c1-5`
               	if test "$HPVER" = "01.03"; then
			cat >> confdefs.h <<\EOF
#define HPUX0103 1
EOF

			echo "$ac_t""1.3 (cross your fingers)" 1>&6
		else
                	cat >> confdefs.h <<\EOF
#define HPUNKNOWN 1
EOF

                	echo "$ac_t""Unknown version -- $HPVER (good luck)" 1>&6
        	fi
	fi

        echo $ac_n "checking for mpiCC compiler""... $ac_c" 1>&6
echo "configure:1348: checking for mpiCC compiler" >&5
        if test -x $MPI_ROOT/bin/mpiCC; then
                CXX="$MPI_ROOT/bin/mpiCC"
                echo "$ac_t""$CXX" 1>&6
        else
                echo "$ac_t""not found!" 1>&6
                { echo "configure: error: ensure that mpiCC is in \$MPI_ROOT/bin" 1>&2; exit 1; }
        fi
fi

#
# Generic MPI: Top-level dir
#

# Check whether --with-mpidir or --without-mpidir was given.
if test "${with_mpidir+set}" = set; then
  withval="$with_mpidir"
  MPI_IMP="supplied-topdir" MPI_DIR=$withval
fi


if test "$MPI_IMP" = "supplied-topdir"; then
    if test ! -d $WITHDIR; then
        { echo "configure: error: $WITHDIR does not exist" 1>&2; exit 1; }
    elif test ! -d $WITHDIR/include; then
        { echo "configure: error: $WITHDIR/include does not exist" 1>&2; exit 1; }
    elif test ! -d $WITHDIR/lib; then
        { echo "configure: error: $WITHDIR/lib does not exist" 1>&2; exit 1; }
    fi

    MPI_CXXFLAGS="-I$MPIDIR/include"
    MPI_LDFLAGS="-L$MPIDIR/lib"
    MPI_LIBS="-lmpi"
    WANT_SOCKET_LIBS=1
fi


#
# Generic MPI: Include directory / library directory
#

# Check whether --with-mpiinc or --without-mpiinc was given.
if test "${with_mpiinc+set}" = set; then
  withval="$with_mpiinc"
  MPI_IMP="supplied-indiv" INCDIR=$withval
fi

# Check whether --with-mpilib or --without-mpilib was given.
if test "${with_mpilib+set}" = set; then
  withval="$with_mpilib"
  MPI_IMP="supplied-indiv" LIBDIR=$withval
fi


if test "$MPI_IMP" = "supplied-indiv"; then
    if test "$INCDIR" = ""; then
        { echo "configure: error: no include directory specified (--with-mpiinc)" 1>&2; exit 1; }
    elif test "$LIBDIR" = ""; then
        { echo "configure: error: no library directory specified (--with-mpilib)" 1>&2; exit 1; }
    elif test ! -d "$INCDIR"; then
        { echo "configure: error: $INCDIR does not exist" 1>&2; exit 1; }
    elif test ! -d "$LIBDIR"; then
        { echo "configure: error: $LIBDIR does not exist" 1>&2; exit 1; }
    fi

    MPI_CXXFLAGS="-I$INCDIR/include"
    MPI_LDFLAGS="-L$LIBDIR/lib"
    MPI_LIBS="-lmpi"
    WANT_SOCKET_LIBS=1
fi

#
# Profilable option for MPI C++ Bindings
#

# Check whether --with-profiling or --without-profiling was given.
if test "${with_profiling+set}" = set; then
  withval="$with_profiling"
  cat >> confdefs.h <<\EOF
#define _MPIPP_PROFILING_ 1
EOF
 NOPRO_OR_PRO="profile"
else
  NOPRO_OR_PRO="noprofile"
fi


#
# Setup C++ compiler
#

if test "$CXX" = "" -a "$MPI_CXX" != ""; then
    CXX=$MPI_CXX
fi

for ac_prog in $CCC c++ g++ gcc CC cxx cc++
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:1448: 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="${IFS}:"
  for ac_dir in $PATH; 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:1479: 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 $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext <<EOF
#line 1489 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:1493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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*

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:1513: 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:1518: 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:1527: \"$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
  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:1542: 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
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-O2"
  fi
else
  GXX=
  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
fi

echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:1570: 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 $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 1583 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
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"
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6

echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:1607: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 1609 "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*



BALKY_CXX=$CXX


#
# Some compilers are brain dead and complain about inline
# virtual destructors
#

cat >> confdefs.h <<EOF
#define IV_DESTRUCTORS $IV_DESTRUCTORS
EOF


#
# Get the version number
#

VERSION=`cat VERSION | cut -f5 -d\ `


#
# Exception handling flags
#

# Check whether --with-exflags or --without-exflags was given.
if test "${with_exflags+set}" = set; then
  withval="$with_exflags"
  FORCE_EXFLAGS=$withval
fi


echo $ac_n "checking for compiler exception flags""... $ac_c" 1>&6
echo "configure:1663: checking for compiler exception flags" >&5
if test "$FORCE_EXFLAGS" != ""; then
    EXFLAGS=$FORCE_EXFLAGS
elif test "$GXX" = "yes"; then
    EXFLAGS="-fhandle-exceptions"
elif test "$CXX" = "KCC" -o "$LAMHCP" = "KCC"; then
    EXFLAGS="-x"
fi

EXCPTN_CXXFLAGS=$EXFLAGS
CXXFLAGS="$EXFLAGS $CXXFLAGS"
EXCPTN_LDFLAGS="$EXFLAGS"
if test "$EXFLAGS" = ""; then
    echo "$ac_t""none necessary" 1>&6
else
    echo "$ac_t""$EXFLAGS" 1>&6
fi


#
# Check to see if this compiler can handle exceptions 
#

echo $ac_n "checking for throw/catch""... $ac_c" 1>&6
echo "configure:1687: checking for throw/catch" >&5
cat > conftest.$ac_ext <<EOF
#line 1689 "configure"
#include "confdefs.h"

int main() {
int i=1; throw(i);
; return 0; }
EOF
if { (eval echo configure:1696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  have_excep=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  have_excep=no
fi
rm -f conftest*
if test "$have_excep" = "yes"; then
    cat >> confdefs.h <<\EOF
#define _MPIPP_USEEXCEPTIONS_ 1
EOF

    echo "$ac_t""yes" 1>&6
else
    cat >> confdefs.h <<\EOF
#define _MPIPP_USEEXCEPTIONS_ 0
EOF

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


#
# Set final compiler flags
#

MINI_BALKY_CXXFLAGS="$EXCPTN_CXXFLAGS $EXTRA_CXXFLAGS $MPI_CXXFLAGS -I`pwd`/src"
BALKY_CXXFLAGS="$EXCPTN_CXXFLAGS $EXTRA_CXXFLAGS $MPI_CXXFLAGS -I$INSTALLDIR/include -I$INSTALLDIR/include/mpi2c++-$VERSION"
CXXFLAGS="$CXXFLAGS $MPI_CXXFLAGS"


#
# Try to compile with the Balky flags, see if we can find <mpi.h>
#

echo $ac_n "checking for mpi.h""... $ac_c" 1>&6
echo "configure:1735: checking for mpi.h" >&5
cat > conftest.$ac_ext <<EOF
#line 1737 "configure"
#include "confdefs.h"
#include <mpi.h>

int main() {
int i = 0;
; return 0; }
EOF
if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  mpih_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  mpih_found=no
fi
rm -f conftest*
if test "$mpih_found" = "yes"; then
    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
    { echo "configure: error: cannot continue -- cannot find <mpi.h>" 1>&2; exit 1; }
fi


#
# Look for extra libraries
#

if test "$WANT_SOCKET_LIBS" = "1"; then
    echo $ac_n "checking for getservbyname in -lsocket""... $ac_c" 1>&6
echo "configure:1769: checking for getservbyname in -lsocket" >&5
ac_lib_var=`echo socket'_'getservbyname | 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 1777 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char getservbyname();

int main() {
getservbyname()
; return 0; }
EOF
if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  socket_lib="-lsocket"
else
  echo "$ac_t""no" 1>&6
socket_lib=""
fi

    echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
echo "configure:1813: checking for gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyaddr | 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="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1821 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyaddr();

int main() {
gethostbyaddr()
; return 0; }
EOF
if { (eval echo configure:1835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  nsl_lib="-lnsl"
else
  echo "$ac_t""no" 1>&6
nsl_lib=""
fi

fi
if test "$WANT_THREAD_LIBS" = "1"; then
    echo $ac_n "checking for sigwait in -lthread""... $ac_c" 1>&6
echo "configure:1859: checking for sigwait in -lthread" >&5
ac_lib_var=`echo thread'_'sigwait | 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="-lthread  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1867 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char sigwait();

int main() {
sigwait()
; return 0; }
EOF
if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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
  thread_lib="-lthread"
else
  echo "$ac_t""no" 1>&6
thread_lib=""
fi

fi
EXTRA_LIBS="$socket_lib $nsl_lib $thread_lib"


#
# Set final linker flags
#

LDFLAGS="$LDFLAGS $MPI_LDFLAGS"
LIBS="$MPI_LIBS $EXTRA_LIBS"

MINI_BALKY_LDFLAGS="$EXCPTN_LDFLAGS $EXTRA_LDFLAGS $MPI_LDFLAGS -L`pwd`/src -lmpi++ $MPI_LIBS $EXTRA_LIBS"
BALKY_LDFLAGS="$EXCPTN_LDFLAGS $EXTRA_LDFLAGS $MPI_LDFLAGS -L$INSTALLDIR/lib -lmpi++ $MPI_LIBS $EXTRA_LIBS"


#
# Try to link with the Balky flags, see if we can find libmpi.*
# (if necessary)
#

if test "$MPI_LIBS" != ""; then
    echo $ac_n "checking for MPI_Initialized in -lmpi""... $ac_c" 1>&6
echo "configure:1924: checking for MPI_Initialized in -lmpi" >&5
    cat > conftest.$ac_ext <<EOF
#line 1926 "configure"
#include "confdefs.h"
#include <mpi.h>

int main() {
int i; MPI_Initialized(&i);
; return 0; }
EOF
if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  rm -rf conftest*
  libmpi_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  libmpi_found=no
fi
rm -f conftest*
    if test "$libmpi_found" = "yes"; then
        echo "$ac_t""yes" 1>&6
    else
        echo "$ac_t""no" 1>&6
        { echo "configure: error: cannot continue -- cannot link to -lmpi" 1>&2; exit 1; }
    fi
fi


#
# Override optimization flags, if supplied
#

# Check whether --with-noopt or --without-noopt was given.
if test "${with_noopt+set}" = set; then
  withval="$with_noopt"
  OPTFLAGS="" TEST_OPTFLAGS="" EXAM_OPTFLAGS=""
fi

# Check whether --with-libopt or --without-libopt was given.
if test "${with_libopt+set}" = set; then
  withval="$with_libopt"
  OPTFLAGS=$withval
fi

# Check whether --with-testopt or --without-testopt was given.
if test "${with_testopt+set}" = set; then
  withval="$with_testopt"
  TEST_OPTFLAGS=$withval
fi

# Check whether --with-examopt or --without-examopt was given.
if test "${with_examopt+set}" = set; then
  withval="$with_examopt"
  EXAM_OPTFLAGS=$withval
fi



#
# Get peculiarities about our MPI
# Can our MPI use its constants as initializers before MPI_Init() is called?
#

cat >> confdefs.h <<EOF
#define MPI_CONSTANTS_BAD $MPI_CONSTANTS_BAD
EOF




# At least one implementation has this problem
# (no names mentioned...)
#

echo $ac_n "checking whether to use MPI(_ERR)_PENDING""... $ac_c" 1>&6
echo "configure:2000: checking whether to use MPI(_ERR)_PENDING" >&5
cat > conftest.$ac_ext <<EOF
#line 2002 "configure"
#include "confdefs.h"
#include <mpi.h>)

int main() {
int yow=MPI_PENDING;
; return 0; }
EOF
if { (eval echo configure:2010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  use_pending=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  use_pending=no
fi
rm -f conftest*
if test "$use_pending" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_PENDING 1
EOF

    echo "$ac_t""MPI_PENDING" 1>&6
else
    cat >> confdefs.h <<\EOF
#define HAVE_PENDING 0
EOF

    echo "$ac_t""MPI_ERR_PENDING" 1>&6
fi


#
# Find out how to make libraries
#

# 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
# 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:2050: 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="${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.
      for ac_prog in ginstall installbsd 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.
	    # OSF/1 installbsd also uses dspmsg, but is usable.
	    :
	  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_DATA" && INSTALL_DATA='${INSTALL} -m 644'

# Override the buggy /bin/installbsd in AIX
case "$host" in
    rs6000-ibm-aix*)
        if test "$INSTALL" = "/bin/installbsd" -o \
            "$INSTALL" = "/bin/installbsd -c" -o \
            "$INSTALL" = "/usr/bin/installbsd" -o \
            "$INSTALL" = "/usr/bin/installbsd -c" -o \
            "$INSTALL" = "/bin/install" -o \
            "$INSTALL" = "/bin/install -c" -o \
            "$INSTALL" = "/etc/install" -o \
            "$INSTALL" = "/etc/install -c" -o \
            "$INSTALL" = "/usr/bin/install" -o \
            "$INSTALL" = "/usr/bin/install -c" -o \
            "$INSTALL" = "/usr/ucb/install" -o \
            "$INSTALL" = "/usr/ucb/install -c"; then
            echo "configure: warning: overriding buggy AIX $INSTALL... ./install-sh -c" 1>&2
            INSTALL="./install-sh -c"
        fi
        ;;
esac
# 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:2122: 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="${IFS}:"
  for ac_dir in $PATH; 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

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

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:2178: 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

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



#
# Various compiler checks
#
# Check for the "bool" type, and for the items "true" and "false"
# Autoconf 2.9 AC-CHECK-TYPE is buggy, hence this workaround
#

echo $ac_n "checking for bool type""... $ac_c" 1>&6
echo "configure:2239: checking for bool type" >&5
cat > conftest.$ac_ext <<EOF
#line 2241 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <stdlib.h>

int main() {
bool testme;
; return 0; }
EOF
if { (eval echo configure:2250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  bool_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  bool_found=no
fi
rm -f conftest*
if test "$bool_found" = "yes"; then
    cat >> confdefs.h <<\EOF
#define HAVE_BOOL 1
EOF

    BOOL_TYPE="bool"
    echo "$ac_t""yes" 1>&6
else
    cat >> confdefs.h <<\EOF
#define HAVE_BOOL 0
EOF

    BOOL_TYPE="unsigned int"
    echo "$ac_t""no" 1>&6
fi
cat >> confdefs.h <<EOF
#define MPI2CPP_BOOL_T $BOOL_TYPE
EOF



#
# Check to see if the resulting bool type is the same size as an int
# Just to make it easy (and uniform), always check, even if this compiler
# does not have a native "bool" type.
#
# I don't know why autoconf is forcing me to put in cross compiling sizes!
# Reset the LDFLAGS and LIBS arguments so that we don't get -lmpi or
# other extraneous libraries in the test executables.
#

SAVE_LDFLAGS=$LDFLAGS
SAVE_LIBS=$LIBS
LDFLAGS=
LIBS=

echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:2297: 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 2305 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:2319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./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 MPI2CPP_BOOL_T""... $ac_c" 1>&6
echo "configure:2339: checking size of MPI2CPP_BOOL_T" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_MPI2CPP_BOOL_T'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_MPI2CPP_BOOL_T=4
else
  cat > conftest.$ac_ext <<EOF
#line 2347 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(MPI2CPP_BOOL_T));
  exit(0);
}
EOF
if { (eval echo configure:2361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_MPI2CPP_BOOL_T=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_MPI2CPP_BOOL_T=0
fi
rm -fr conftest*
fi

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




LDFLAGS=$SAVE_LDFLAGS
LIBS=$SAVE_LIBS


#
# MPI says that attributes will be at least as large as pointers.
# If we're on a 64 bit system, the pointers may be 8 bytes, not 4.
# Attributes must be typed/sized appropriately.
#

echo $ac_n "checking type of MPI attributes""... $ac_c" 1>&6
echo "configure:2393: checking type of MPI attributes" >&5
if test "$cross_compiling" = yes; then
  sizeof_same=no
else
  cat > conftest.$ac_ext <<EOF
#line 2398 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
int main() 
{
  if (sizeof(int) != sizeof(int *))
    return -1;
  return 0;
}
EOF
if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
  sizeof_same=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  sizeof_same=no
fi
rm -fr conftest*
fi

if test "$sizeof_same" = "yes"; then
    ATTR_TYPE="int"
    cat >> confdefs.h <<\EOF
#define ATTR int
EOF
     
else
    ATTR_TYPE="long"
    cat >> confdefs.h <<\EOF
#define ATTR long
EOF

fi
echo "$ac_t""$ATTR_TYPE" 1>&6


#
# Do we have BSD or SYSV style signals?
# (or something that we haven't thought of yet?)
#

echo $ac_n "checking for signal declaration""... $ac_c" 1>&6
echo "configure:2444: checking for signal declaration" >&5
cat > conftest.$ac_ext <<EOF
#line 2446 "configure"
#include "confdefs.h"
#include<signal.h>

int main() {
void handler(int sig, int code, struct sigcontext *scp, char *addr);
signal(1, handler);
; return 0; }
EOF
if { (eval echo configure:2455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  bsd_signal="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  bsd_signal="no"
fi
rm -f conftest*
if test "$bsd_signal" = "yes"; then
    cat >> confdefs.h <<\EOF
#define MPI2CPP_BSD_SIGNAL 1
EOF

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

#
# Sanity check.  Make sure that it is SYSV
#

    cat > conftest.$ac_ext <<EOF
#line 2478 "configure"
#include "confdefs.h"
#include<signal.h>

int main() {
void handler(int sig);
signal(1, handler);
; return 0; }
EOF
if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  sysv_signal="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  sysv_signal="no"
fi
rm -f conftest*
    if test "$sysv_signal" = "yes"; then
        cat >> confdefs.h <<\EOF
#define MPI2CPP_SYSV_SIGNAL 1
EOF

        echo "$ac_t""SYSV" 1>&6
    else
        echo "$ac_t""not found" 1>&6
        { echo "configure: error: cannot determine if signals are bsd/sysv" 1>&2; exit 1; }
        exit
    fi
fi


#
#  Check for namespaces
#  @#%$@#^ g++!  It has namespaces, but is VERY broken
#

FORCE_NAMESPACE=
# Check whether --with-namespace or --without-namespace was given.
if test "${with_namespace+set}" = set; then
  withval="$with_namespace"
  FORCE_NAMESPACE=$withval
fi


echo $ac_n "checking for namespace support""... $ac_c" 1>&6
echo "configure:2525: checking for namespace support" >&5
if test "$FORCE_NAMESPACE" = "yes"; then
    cat >> confdefs.h <<\EOF
#define _MPIPP_USENAMESPACE_ 1
EOF

    echo "$ac_t""yes (forced)" 1>&6
elif test "$FORCE_NAMESPACE" = "no"; then 
    cat >> confdefs.h <<\EOF
#define _MPIPP_USENAMESPACE_ 0
EOF

    echo "$ac_t""no (forced)" 1>&6
else
    cat > conftest.$ac_ext <<EOF
#line 2540 "configure"
#include "confdefs.h"
void blah();
namespace N {
  extern const int global;
  class foo {
    //g++ does not like :: operator for global scope
    friend void ::blah();
  public:
    int foobar();
  };
}

//aCC con't handle the following line confuses namespaces and classes
const int N::global = 0;

//g++ does not like namespace'd return types
N::foo blahblah() { N::foo f; return f; }
//g++ does not like functions of classes in namespaces
int N::foo::foobar() { return 1; }
void blah() { }

int main() {

; return 0; }
EOF
if { (eval echo configure:2566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  namespace_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  namespace_found=no
fi
rm -f conftest*
    if test "$namespace_found" = "yes"; then
	cat >> confdefs.h <<\EOF
#define _MPIPP_USENAMESPACE_ 1
EOF

	echo "$ac_t""yes" 1>&6
    else
	cat >> confdefs.h <<\EOF
#define _MPIPP_USENAMESPACE_ 0
EOF

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

#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#

echo $ac_n "checking for template repository""... $ac_c" 1>&6
echo "configure:2597: checking for template repository" >&5
mkdir oompi_tmp_$$
cd oompi_tmp_$$
cat > foo.h <<EOF
template <class T>
class foo {
public:
  foo(T yow) : data(yow) { yow.member(3); };
  void member(int i);
private:
  T data;
};

class bar {
public:
  bar(int i) { data = i; };
  void member(int j) { data = data * j; };

private:
  int data;
};
EOF

cat > other.cc <<EOF
#include "foo.h"

void
some_other_function(void)
{
  foo<bar> var1(6);
  foo< foo<bar> > var2(var1);
}
EOF

cat > main.cc <<EOF
#include "foo.h"

void some_other_function(void);

template <class T>
void
foo<T>::member(int i)
{
  i += 2;
}

int
main(int argc, char *argv)
{
  foo<bar> var1(6);
  foo< foo<bar> > var2(var1);

  some_other_function();
  return 0;
}
EOF

$CXX -c main.cc >/dev/null 2>/dev/null
$CXX -c other.cc >/dev/null 2>/dev/null
rm -rf *.h *.cc *.o

for file in `ls`
do
    if test "$file" != "." -a "$file" != ".."; then
	# Is it a directory?
	if test -d "$file"; then
            TEMPLATE_DIR="$file $TEMPLATE_DIR"

	# Or is it a file?
	else
	    name="`echo $file | cut -d. -f1`"

	    temp_mask=
	    if test "$name" = "main" -o "$name" = "other"; then
		temp_mask="`echo $file | cut -d. -f2`"
		if test "$TEMPLATE_FILEMASK" = ""; then
		   TEMPLATE_FILEMASK="$temp_mask";
		elif test "`echo $TEMPLATE_FILEMASK | grep $temp_mask`" = ""; then
		   TEMPLATE_FILEMASK="$TEMPLATE_FILEMASK $temp_mask"
		fi
	    fi
	fi
    fi
done
if test "$TEMPLATE_FILEMASK" != ""; then
    temp_mask=
    for mask in $TEMPLATE_FILEMASK
    do
	temp_mask="*.$mask $temp_mask"
    done
    TEMPLATE_FILEMASK=$temp_mask
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != ""; then
    echo "$ac_t""$TEMPLATE_REP" 1>&6
else
    echo "$ac_t""not used" 1>&6
fi
cd ..
rm -rf oompi_tmp_$$

#
# Check to see if the FORTRAN constants are there, 
# and then check for the optional FORTRAN constants.
#

echo $ac_n "checking for FORTRAN constants""... $ac_c" 1>&6
echo "configure:2705: checking for FORTRAN constants" >&5
cat > conftest.$ac_ext <<EOF
#line 2707 "configure"
#include "confdefs.h"
#include <mpi.h>

int main() {
MPI_Datatype a = MPI_INTEGER;
; return 0; }
EOF
if { (eval echo configure:2715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  fortran_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  fortran_found=no
fi
rm -f conftest*
if test "$fortran_found" = "yes"; then
    cat >> confdefs.h <<\EOF
#define FORTRAN 1
EOF

    echo "$ac_t""yes" 1>&6
    echo $ac_n "checking for optional FORTRAN constants""... $ac_c" 1>&6
echo "configure:2732: checking for optional FORTRAN constants" >&5
    cat > conftest.$ac_ext <<EOF
#line 2734 "configure"
#include "confdefs.h"
#include <mpi.h>
    
int main() {
MPI_Datatype b = MPI_8REAL;
; return 0; }
EOF
if { (eval echo configure:2742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  all_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  all_found=no
fi
rm -f conftest*
    if test "$all_found" = "yes"; then
	cat >> confdefs.h <<\EOF
#define ALL_OPTIONAL_FORTRAN 1
EOF

	echo "$ac_t""all" 1>&6
    else
	cat >> confdefs.h <<\EOF
#define ALL_OPTIONAL_FORTRAN 0
EOF

	cat > conftest.$ac_ext <<EOF
#line 2764 "configure"
#include "confdefs.h"
#include <mpi.h>
	
int main() {
MPI_Datatype c = MPI_2REAL;
; return 0; }
EOF
if { (eval echo configure:2772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  some_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  some_found=no
fi
rm -f conftest*
	if test "$some_found" = "yes"; then
	    cat >> confdefs.h <<\EOF
#define SOME_OPTIONAL_FORTRAN 1
EOF

	    echo "$ac_t""some" 1>&6
	else
	    cat >> confdefs.h <<\EOF
#define SOME_OPTIONAL_FORTRAN 0
EOF

	    echo "$ac_t""none" 1>&6
	fi
    fi
else
    cat >> confdefs.h <<\EOF
#define FORTRAN 0
EOF

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

#
# Check for optional C stuff.
#

echo $ac_n "checking for optional C constants""... $ac_c" 1>&6
echo "configure:2809: checking for optional C constants" >&5
cat > conftest.$ac_ext <<EOF
#line 2811 "configure"
#include "confdefs.h"
#include <mpi.h>

int main() {
MPI_Datatype d = MPI_UNSIGNED_LONG_LONG;
; return 0; }
EOF
if { (eval echo configure:2819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  c_found=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  c_found=no
fi
rm -f conftest*
if test "$c_found" = "yes"; then
    cat >> confdefs.h <<\EOF
#define OPTIONAL_C 1
EOF

    echo "$ac_t""yes" 1>&6
else
    cat >> confdefs.h <<\EOF
#define OPTIONAL_C 0
EOF

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

#
# Substitute them in...
#
































#
# Party on
#

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) 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.12"
    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
    src/Makefile
    contrib/test_suite/Makefile
    contrib/examples/Makefile
    balky/balky
    balky/mini-balky src/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%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%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%@AWK@%$AWK%g
s%@WC@%$WC%g
s%@MPI_CXX@%$MPI_CXX%g
s%@CXX@%$CXX%g
s%@CXXCPP@%$CXXCPP%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@LN_S@%$LN_S%g
s%@BINSH@%$BINSH%g
s%@VERSION@%$VERSION%g
s%@INSTALL@%$INSTALL%g
s%@BALKY_CXX@%$BALKY_CXX%g
s%@BALKY_INCDIR@%$BALKY_INCDIR%g
s%@BALKY_LIBDIR@%$BALKY_LIBDIR%g
s%@BALKY_CXXFLAGS@%$BALKY_CXXFLAGS%g
s%@BALKY_LDFLAGS@%$BALKY_LDFLAGS%g
s%@MINI_BALKY_CXXFLAGS@%$MINI_BALKY_CXXFLAGS%g
s%@MINI_BALKY_LDFLAGS@%$MINI_BALKY_LDFLAGS%g
s%@DEPFLAGS@%$DEPFLAGS%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@TEST_OPTFLAGS@%$TEST_OPTFLAGS%g
s%@EXAM_OPTFLAGS@%$EXAM_OPTFLAGS%g
s%@INSTALLDIR@%$INSTALLDIR%g
s%@IV_DESTRUCTORS@%$IV_DESTRUCTORS%g
s%@TEMPLATE_REP@%$TEMPLATE_REP%g
s%@MPILIB_DIR@%$MPILIB_DIR%g
s%@NOPRO_OR_PRO@%$NOPRO_OR_PRO%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
    src/Makefile
    contrib/test_suite/Makefile
    contrib/examples/Makefile
    balky/balky
    balky/mini-balky"}
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="src/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

chmod +x balky/balky balky/mini-balky

