#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
#
# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi


## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi

# NLS nuisances.
# Support unset when possible.
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi

(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
    { $as_unset LANG || test "${LANG+set}" != set; } ||
      { LANG=C; export LANG; }
(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
      { LC_ALL=C; export LC_ALL; }
(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
      { LC_TIME=C; export LC_TIME; }
(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
      { LC_CTYPE=C; export LC_CTYPE; }
(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
      { LANGUAGE=C; export LANGUAGE; }
(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
      { LC_COLLATE=C; export LC_COLLATE; }
(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
      { LC_NUMERIC=C; export LC_NUMERIC; }
(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
      { LC_MESSAGES=C; export LC_MESSAGES; }


# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  	  /^X\/\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`

# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conftest.sh
  echo  "exit 0"   >>conftest.sh
  chmod +x conftest.sh
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conftest.sh
fi


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, and appends trailing '-' during
  # substitution so that $LINENO is not a special case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.file

as_executable_p="test -f"

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }


# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`

exec 6>&1

#
# Initializations.
#
ac_default_prefix=/usr/local
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}

# Maximum number of lines to put in a shell here document.
# This variable seems obsolete.  It should probably be removed, and
# only ac_max_sed_lines should be used.
: ${ac_max_here_lines=38}

# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=

ac_unique_file="src/mpi2c++/comm.h"

# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE

# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
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'

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

  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`

  # 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_alias ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build_alias=$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 ;;

  --config-cache | -C)
    cache_file=config.cache ;;

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

  -disable-* | --disable-*)
    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   { (exit 1); exit 1; }; }
    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
    eval "enable_$ac_feature=no" ;;

  -enable-* | --enable-*)
    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   { (exit 1); exit 1; }; }
    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
    case $ac_option in
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
      *) 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 | -h)
    ac_init_help=long ;;
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
    ac_init_help=recursive ;;
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
    ac_init_help=short ;;

  -host | --host | --hos | --ho)
    ac_prev=host_alias ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host_alias=$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 | -n)
    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_alias ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target_alias=$ac_optarg ;;

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

  -version | --version | --versio | --versi | --vers | -V)
    ac_init_version=: ;;

  -with-* | --with-*)
    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid package name: $ac_package" >&2
   { (exit 1); exit 1; }; }
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case $ac_option in
      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
      *) ac_optarg=yes ;;
    esac
    eval "with_$ac_package='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
    # Reject names that are not valid shell variable names.
    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid package name: $ac_package" >&2
   { (exit 1); exit 1; }; }
    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 "$as_me: error: unrecognized option: $ac_option
Try \`$0 --help' for more information." >&2
   { (exit 1); exit 1; }; }
    ;;

  *=*)
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
    # Reject names that are not valid shell variable names.
    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
   { (exit 1); exit 1; }; }
    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
    eval "$ac_envvar='$ac_optarg'"
    export $ac_envvar ;;

  *)
    # FIXME: should be removed in autoconf 3.0.
    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
    ;;

  esac
done

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

# Be sure to have absolute paths.
for ac_var in exec_prefix prefix
do
  eval ac_val=$`echo $ac_var`
  case $ac_val in
    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; };;
  esac
done

# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
              localstatedir libdir includedir oldincludedir infodir mandir
do
  eval ac_val=$`echo $ac_var`
  case $ac_val in
    [\\/$]* | ?:[\\/]* ) ;;
    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   { (exit 1); exit 1; }; };;
  esac
done

# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used." >&2
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-

test "$silent" = yes && exec 6>/dev/null


# 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_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$0" : 'X\(//\)[^/]' \| \
         X"$0" : 'X\(//\)$' \| \
         X"$0" : 'X\(/\)' \| \
         .     : '\(.\)' 2>/dev/null ||
echo X"$0" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
  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 "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
   { (exit 1); exit 1; }; }
  else
    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
   { (exit 1); exit 1; }; }
  fi
fi
srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
ac_env_build_alias_set=${build_alias+set}
ac_env_build_alias_value=$build_alias
ac_cv_env_build_alias_set=${build_alias+set}
ac_cv_env_build_alias_value=$build_alias
ac_env_host_alias_set=${host_alias+set}
ac_env_host_alias_value=$host_alias
ac_cv_env_host_alias_set=${host_alias+set}
ac_cv_env_host_alias_value=$host_alias
ac_env_target_alias_set=${target_alias+set}
ac_env_target_alias_value=$target_alias
ac_cv_env_target_alias_set=${target_alias+set}
ac_cv_env_target_alias_value=$target_alias
ac_env_CXX_set=${CXX+set}
ac_env_CXX_value=$CXX
ac_cv_env_CXX_set=${CXX+set}
ac_cv_env_CXX_value=$CXX
ac_env_CXXFLAGS_set=${CXXFLAGS+set}
ac_env_CXXFLAGS_value=$CXXFLAGS
ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
ac_cv_env_CXXFLAGS_value=$CXXFLAGS
ac_env_LDFLAGS_set=${LDFLAGS+set}
ac_env_LDFLAGS_value=$LDFLAGS
ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
ac_cv_env_LDFLAGS_value=$LDFLAGS
ac_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_env_CPPFLAGS_value=$CPPFLAGS
ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
ac_cv_env_CPPFLAGS_value=$CPPFLAGS
ac_env_CXXCPP_set=${CXXCPP+set}
ac_env_CXXCPP_value=$CXXCPP
ac_cv_env_CXXCPP_set=${CXXCPP+set}
ac_cv_env_CXXCPP_value=$CXXCPP

#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
  # 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 <<_ACEOF
\`configure' configures this package to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print \`checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for \`--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']

_ACEOF

  cat <<_ACEOF
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]
_ACEOF

  cat <<\_ACEOF

Program names:
  --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

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi

if test -n "$ac_init_help"; then

  cat <<\_ACEOF

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
--with-lam=MPI_DIR	Top-level install directory for LAM/MPI
--with-lam-building   Only used internally to LAM/MPI
--with-mpich=MPI_DIR    Top-level install directory for MPICH/MPI
--with-mpichdev=LIBDIR  Library subdirectory for MPICH/MPI
--with-mpichbin=BINDIR  bin subdirectory for MPICH/MPI
--with-mpichsrc=SRCDIR  source home for MPICH/MPI
--with-mpichlib=LIBDIR  Library directory for MPICH/MPI
--with-mpichlibname=NAME Alternate name for MPICH library
--with-sp		Use IBM's SP/MPI
--with-sgi		Use SGI's IRIX/64 MPI
--with-sgi64		Use SGI's IRIX/64 MPI (force 64 bit mode)
--with-cray             Use Cray's native MPI
--with-hp		Use HPs HP-UX 10.x MPI
--with-ftmpi=MPI_DIR    Top-level install directory for FT-MPI
--with-mpidir=MPI_DIR	Top-level MPI directory (if not listed above)
--with-mpiinc=MPI_INC	Directory where mpi.h exists
--with-mpilib=MPI_INC	Directory where libmpi.a exists
--with-profiling	Make the profilable C++ bindings
--with-exflags          Specify flags necessary to enable exceptions
--without-opt		Compile with no optimization (for debugging)
--with-libopt		Opt flags for use when compiling libmpi++.a
--with-testopt		Opt flags for use when compiling test suite
--with-examopt		Opt flags for use when compiling examples
--with-namespace        Force the use of C++ namespaces

Some influential environment variables:
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CXXCPP      C++ preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

_ACEOF
fi

if test "$ac_init_help" = "recursive"; then
  # If there are subdirs, report their specific --help.
  ac_popdir=`pwd`
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
    test -d $ac_dir || continue
    ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
# absolute.
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`

    cd $ac_dir
    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_srcdir/configure.gnu; then
      echo
      $SHELL $ac_srcdir/configure.gnu  --help=recursive
    elif test -f $ac_srcdir/configure; then
      echo
      $SHELL $ac_srcdir/configure  --help=recursive
    elif test -f $ac_srcdir/configure.ac ||
           test -f $ac_srcdir/configure.in; then
      echo
      $ac_configure --help
    else
      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
    fi
    cd $ac_popdir
  done
fi

test -n "$ac_init_help" && exit 0
if $ac_init_version; then
  cat <<\_ACEOF

Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
  exit 0
fi
exec 5>config.log
cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by $as_me, which was
generated by GNU Autoconf 2.53.  Invocation command line was

  $ $0 $@

_ACEOF
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  echo "PATH: $as_dir"
done

} >&5

cat >&5 <<_ACEOF


## ----------- ##
## Core tests. ##
## ----------- ##

_ACEOF


# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell meta-characters.
ac_configure_args=
ac_sep=
for ac_arg
do
  case $ac_arg in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c | -n ) continue ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    continue ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  esac
  case " $ac_configure_args " in
    *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
    *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
       ac_sep=" " ;;
  esac
  # Get rid of the leading space.
done

# When interrupted or exit'd, cleanup temporary files, and complete
# config.log.  We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Be sure not to use single quotes in there, as some shells,
# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
  # Save into config.log some information that might help in debugging.
  {
    echo
    cat <<\_ASBOX
## ---------------- ##
## Cache variables. ##
## ---------------- ##
_ASBOX
    echo
    # The following way of writing the cache mishandles newlines in values,
{
  (set) 2>&1 |
    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
    *ac_space=\ *)
      sed -n \
        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
      ;;
    *)
      sed -n \
        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
      ;;
    esac;
}
    echo
    if test -s confdefs.h; then
      cat <<\_ASBOX
## ----------- ##
## confdefs.h. ##
## ----------- ##
_ASBOX
      echo
      sed "/^$/d" confdefs.h
      echo
    fi
    test "$ac_signal" != 0 &&
      echo "$as_me: caught signal $ac_signal"
    echo "$as_me: exit $exit_status"
  } >&5
  rm -f core core.* *.core &&
  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
    exit $exit_status
     ' 0
for ac_signal in 1 2 13 15; do
  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0

# 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

# Predefined preprocessor variables.

cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF


# Let the site file select an alternate cache file if it wants to.
# 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 "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
    sed 's/^/| /' "$ac_site_file" >&5
    . "$ac_site_file"
  fi
done


# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  eval ac_new_set=\$ac_env_${ac_var}_set
  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
  eval ac_new_val="\$ac_env_${ac_var}_value"
  case $ac_old_set,$ac_new_set in
    set,)
      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,set)
      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
      ac_cache_corrupted=: ;;
    ,);;
    *)
      if test "x$ac_old_val" != "x$ac_new_val"; then
        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
echo "$as_me:   former value:  $ac_old_val" >&2;}
        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
echo "$as_me:   current value: $ac_new_val" >&2;}
        ac_cache_corrupted=:
      fi;;
  esac
  # Pass precious variables to config.status.
  if test "$ac_new_set" = set; then
    case $ac_new_val in
    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
    *) ac_arg=$ac_var=$ac_new_val ;;
    esac
    case " $ac_configure_args " in
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
    esac
  fi
done
if $ac_cache_corrupted; then
  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
   { (exit 1); exit 1; }; }
fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu



















VERSION=`cat $srcdir/VERSION | cut -f5 -d\ `
echo "Configuring MPI-2 C++ bindings, version $VERSION"



# The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and
# VERSION macors

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
  elif test -f $ac_dir/shtool; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/shtool install -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
   { (exit 1); exit 1; }; }
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.

# 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
# AmigaOS /C/install, which installs bootblocks on floppy discs
# 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 "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  # Account for people who put trailing slashes in PATH elements.
case $as_dir/ in
  ./ | .// | /cC/* | \
  /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
      for ac_exec_ext in '' $ac_executable_extensions; do
        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
            :
          elif test $ac_prog = install &&
            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # program-specific install script used by HP pwplus--don't use.
            :
          else
            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
            break 3
          fi
        fi
      done
    done
    ;;
esac
done


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 "$as_me:$LINENO: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&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}'

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

echo "$as_me:$LINENO: checking whether build environment is sane" >&5
echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" >&5
echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" >&2;}
   { (exit 1); exit 1; }; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
Check your system clock" >&5
echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
   { (exit 1); exit 1; }; }
fi
rm -f conftest*
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
  program_transform_name="s,^,$program_prefix,;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
# Double any \ or $.  echo might interpret backslashes.
# By default was `s,x,x', remove it if useless.
cat <<\_ACEOF >conftest.sed
s/[\\$]/&&/g;s/;s,x,x,$//
_ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
rm conftest.sed

echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.make <<\_ACEOF
all:
	@echo 'ac_maketemp="${MAKE}"'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
  SET_MAKE=
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
  SET_MAKE="MAKE=${MAKE-make}"
fi


PACKAGE=mpi2c++

VERSION=$VERSION

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
   { (exit 1); exit 1; }; }
fi



missing_dir=`cd $ac_aux_dir && pwd`
echo "$as_me:$LINENO: checking for working aclocal" >&5
echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal
   echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
   ACLOCAL="$missing_dir/missing aclocal"
   echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi

echo "$as_me:$LINENO: checking for working autoconf" >&5
echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi

echo "$as_me:$LINENO: checking for working automake" >&5
echo $ECHO_N "checking for working automake... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake
   echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
   AUTOMAKE="$missing_dir/missing automake"
   echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi

echo "$as_me:$LINENO: checking for working autoheader" >&5
echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi

echo "$as_me:$LINENO: checking for working makeinfo" >&5
echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$as_me:$LINENO: result: found" >&5
echo "${ECHO_T}found" >&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$as_me:$LINENO: result: missing" >&5
echo "${ECHO_T}missing" >&6
fi



ac_config_headers="$ac_config_headers src/mpi2c++/mpi2c++_config.h"

ac_config_commands="$ac_config_commands default-1"


#
# 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=


#
# Balky flags
#

BALKY_CXX=
BALKY_CXXFLAGS=
BALKY_LIBS=
BALKY_LDFLAGS=


#
# Compiler flags
#

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


#
# Miscellaneous flags
#

MPICH_DEV=
LAM_CXXFLAGS=
EXTRA_CXXFLAGS=
EXCPTN_CXXFLAGS=
EXCPTN_LDFLAGS=
WANT_SOCKET_LIBS=
WANT_THREAD_LIBS=
ARCH=
EXFLAGS=
FORCE_EXFLAGS=

#
HAVE_BROKEN_NAMESPACES=0
UNDERLYING_CXX=
USING_MPICH=0
MPI_MIDDLE_NAME=
MINI_BALKY_CXXFLAGS=
BALKY_CXXFLAGS=


#
# Ensure not to get a user aliased grep
#

if test -x /bin/grep; then
    GREP=/bin/grep
elif test -x /usr/bin/grep; then
    GREP=/usr/bin/grep
elif test -x /sbin/grep; then
    GREP=/sbin/grep
elif test -x /usr/sbin/grep; then
    GREP=/usr/sbin/grep
else
    # Extract the first word of "grep", so it can be a program name with args.
set dummy grep; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_GREP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $GREP in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep"
  ;;
esac
fi
GREP=$ac_cv_path_GREP

if test -n "$GREP"; then
  echo "$as_me:$LINENO: result: $GREP" >&5
echo "${ECHO_T}$GREP" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

fi

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

# Make sure we can run config.sub.
$ac_config_sub sun4 >/dev/null 2>&1 ||
  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
echo "$as_me: error: cannot run $ac_config_sub" >&2;}
   { (exit 1); exit 1; }; }

echo "$as_me:$LINENO: checking build system type" >&5
echo $ECHO_N "checking build system type... $ECHO_C" >&6
if test "${ac_cv_build+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_build_alias=$build_alias
test -z "$ac_cv_build_alias" &&
  ac_cv_build_alias=`$ac_config_guess`
test -z "$ac_cv_build_alias" &&
  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
   { (exit 1); exit 1; }; }
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
   { (exit 1); exit 1; }; }

fi
echo "$as_me:$LINENO: result: $ac_cv_build" >&5
echo "${ECHO_T}$ac_cv_build" >&6
build=$ac_cv_build
build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`


echo "$as_me:$LINENO: checking host system type" >&5
echo $ECHO_N "checking host system type... $ECHO_C" >&6
if test "${ac_cv_host+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_cv_host_alias=$host_alias
test -z "$ac_cv_host_alias" &&
  ac_cv_host_alias=$ac_cv_build_alias
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
   { (exit 1); exit 1; }; }

fi
echo "$as_me:$LINENO: result: $ac_cv_host" >&5
echo "${ECHO_T}$ac_cv_host" >&6
host=$ac_cv_host
host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`



#
# WDG: It is *wrong* to set these options before we know what compiler
# we are using.  After all, we may be using g++!
#
# (case on host moved to later)
case "$host" in
    *-hp-hpux*)
        # WDG, 11/9/99:
	# It is *NOT* correct to chose compiler flags based on the system
        # For example, what if g++ is being used?
        # The following flags for are the aCC compiler.
        # Unfortunately, the compiler isn't available yet, so I can't
	# add the appropriate tests.  Errg.
	if test "$GXX" = ""; then
	    EXTRA_CXXFLAGS="+W829,736"
	    CXXFLAGS="$CXXFLAGS $EXTRA_CXXFLAGS"
	    EXFLAGS="+eh"

	    NOOPT="-Wl,+vnocompatwarnings"
	    OPTFLAGS="+O1 -Wl,+vnocompatwarnings"
	    EXAM_OPTFLAGS=$OPTFLAGS
	    TEST_OPTFLAGS=$OPTFLAGS

	    MPI_CXX_SAVE=$MPI_CXX

	    ARCH=HPUX
	fi
        ;;

    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
	;;

    *solaris*)
	ARCH=SOLARIS
	;;

esac

#
# Now we can clear MPI_CXX
#

MPI_CXX=


#
# Set autoconf for C++
#

ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu



#
# 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 "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_AWK+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $AWK in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_AWK="$AWK" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  ;;
esac
fi
AWK=$ac_cv_path_AWK

if test -n "$AWK"; then
  echo "$as_me:$LINENO: result: $AWK" >&5
echo "${ECHO_T}$AWK" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

# Extract the first word of "wc", so it can be a program name with args.
set dummy wc; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_WC+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $WC in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_WC="$WC" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  ;;
esac
fi
WC=$ac_cv_path_WC

if test -n "$WC"; then
  echo "$as_me:$LINENO: result: $WC" >&5
echo "${ECHO_T}$WC" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&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.3/6.4
#


# 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

    # Run lamboot with a dummy hostfile to find out what version it is

    MPI_CXX=no
    if test "$WITHDIR" != "" -a -x "$WITHDIR/bin/hcp"; then
	echo "$as_me:$LINENO: checking for hcp" >&5
echo $ECHO_N "checking for hcp... $ECHO_C" >&6
	MPI_CXX=$WITHDIR/bin/hcp
	LAMBOOT=$WITHDIR/bin/lamboot
	LAMWIPE=$WITHDIR/bin/wipe
	echo "$as_me:$LINENO: result: $MPI_CXX" >&5
echo "${ECHO_T}$MPI_CXX" >&6
    elif test "$WITHDIR" != "" -a -x "$WITHDIR/hcp"; then
	echo "$as_me:$LINENO: checking for hcp" >&5
echo $ECHO_N "checking for hcp... $ECHO_C" >&6
	MPI_CXX=$WITHDIR/hcp
	LAMBOOT=$WITHDIR/lamboot
	LAMWIPE=$WITHDIR/wipe
	echo "$as_me:$LINENO: result: $MPI_CXX" >&5
echo "${ECHO_T}$MPI_CXX" >&6
    else
	# Extract the first word of "hcp", so it can be a program name with args.
set dummy hcp; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_MPI_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $MPI_CXX in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_MPI_CXX="$MPI_CXX" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_MPI_CXX="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  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 "$as_me:$LINENO: result: $MPI_CXX" >&5
echo "${ECHO_T}$MPI_CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

    fi

    if test "$MPI_CXX" = "no"; then
        { { echo "$as_me:$LINENO: error: cannot continue -- put hcp in your path" >&5
echo "$as_me: error: cannot continue -- put hcp in your path" >&2;}
   { (exit 1); exit 1; }; }
    else
	LAMBOOT=`dirname $MPI_CXX`/lamboot
	LAMWIPE=`dirname $MPI_CXX`/wipe
    fi
    CXX=$MPI_CXX

    MPI_LIBS=" "

    echo "$as_me:$LINENO: checking for LAM/MPI version" >&5
echo $ECHO_N "checking for LAM/MPI version... $ECHO_C" >&6
    VER=`$LAMBOOT -V | $GREP LAM`
    if test "`echo $VER | $GREP 6.1`" != ""; then
	echo "$as_me:$LINENO: result: $LAMVER (you should upgrade)" >&5
echo "${ECHO_T}$LAMVER (you should upgrade)" >&6
	{ echo "$as_me:$LINENO: WARNING: *** LAM/MPI 6.1 is no longer supported." >&5
echo "$as_me: WARNING: *** LAM/MPI 6.1 is no longer supported." >&2;}
	WANT_UPGRADE=1

    elif test "`echo $VER | $GREP 6.2`" != ""; then
	echo "$as_me:$LINENO: result: $LAMVER (you should upgrade)" >&5
echo "${ECHO_T}$LAMVER (you should upgrade)" >&6
	{ echo "$as_me:$LINENO: WARNING: *** LAM/MPI 6.2 is no longer supported." >&5
echo "$as_me: WARNING: *** LAM/MPI 6.2 is no longer supported." >&2;}
	WANT_UPGRADE=1

    elif test "`echo $VER | $GREP 6.3.1`" != ""; then
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_LAM631 1
_ACEOF

	echo "$as_me:$LINENO: result: $LAMVER (you should upgrade)" >&5
echo "${ECHO_T}$LAMVER (you should upgrade)" >&6
	{ echo "$as_me:$LINENO: WARNING: *** LAM/MPI 6.3.1 is no longer supported." >&5
echo "$as_me: WARNING: *** LAM/MPI 6.3.1 is no longer supported." >&2;}
	WANT_UPGRADE=1

    elif test "`echo $VER | $GREP 6.3.2`" != ""; then
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_LAM632 1
_ACEOF

	echo "$as_me:$LINENO: result: $LAMVER (you should upgrade)" >&5
echo "${ECHO_T}$LAMVER (you should upgrade)" >&6
	{ echo "$as_me:$LINENO: WARNING: *** LAM/MPI 6.3.2 is no longer supported." >&5
echo "$as_me: WARNING: *** LAM/MPI 6.3.2 is no longer supported." >&2;}
	WANT_UPGRADE=1

    elif test "`echo $VER | $GREP 6.3.3`" != ""; then
	LAMVER=6.3.3
	LAMCXXFLAGS="-DLAM_BUILDING=1"
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_LAM633 1
_ACEOF

	echo "$as_me:$LINENO: result: $LAMVER (good)" >&5
echo "${ECHO_T}$LAMVER (good)" >&6
	WANT_UPGRADE=0

    elif test "`echo $VER | $GREP 6.3`" != ""; then
	LAMVER=6.3
	echo "$as_me:$LINENO: result: $LAMVER (you should upgrade)" >&5
echo "${ECHO_T}$LAMVER (you should upgrade)" >&6
	{ echo "$as_me:$LINENO: WARNING: *** LAM/MPI 6.3 is no longer supported." >&5
echo "$as_me: WARNING: *** LAM/MPI 6.3 is no longer supported." >&2;}
	WANT_UPGRADE=1

    elif test "`echo $VER | $GREP 6.4`" != ""; then
	LAMVER=6.4
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_LAM64 1
_ACEOF

	echo "$as_me:$LINENO: result: $LAMVER (good)" >&5
echo "${ECHO_T}$LAMVER (good)" >&6
	WANT_UPGRADE=0
    else
	LAMVER=no
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_LAMUNKNOWN 1
_ACEOF

	echo "$as_me:$LINENO: result: cannot determine LAM version -- good luck" >&5
echo "${ECHO_T}cannot determine LAM version -- good luck" >&6
    fi
    if test "$WANT_UPGRADE" = "1"; then
	{ echo "$as_me:$LINENO: WARNING: *** WARNING: You are using an old version of LAM/MPI." >&5
echo "$as_me: WARNING: *** WARNING: You are using an old version of LAM/MPI." >&2;}
	{ echo "$as_me:$LINENO: WARNING: *** You should upgrade to the latest version." >&5
echo "$as_me: WARNING: *** You should upgrade to the latest version." >&2;}
	{ echo "$as_me:$LINENO: WARNING: *** See http://www.mpi.nd.edu/lam/" >&5
echo "$as_me: WARNING: *** See http://www.mpi.nd.edu/lam/" >&2;}
	{ { echo "$as_me:$LINENO: error: *** Cannot continue" >&5
echo "$as_me: error: *** Cannot continue" >&2;}
   { (exit 1); exit 1; }; }
    fi
    MPI_MIDDLE_NAME="lam"

    # Get the underlying compiler name so that we can check for
    # exception flags properly

    echo "$as_me:$LINENO: checking for LAM's underlying C++ compiler" >&5
echo $ECHO_N "checking for LAM's underlying C++ compiler... $ECHO_C" >&6
    full="`hcp -showme`"
    first="`echo $full | awk '{ print $1 }'`"
    UNDERLYING_CXX="`basename $first`"
    if test "$UNDERLYING_CXX" = "libtool"; then
	first=1
	done=0
	for word in $full ; do
	    if test "$done" = "0"; then
		name="`basename $word`"
		if test "$first" != "1" -a \
			"`echo $word | cut -c1-2`" != "--"; then
		    UNDERLYING_CXX="$word"
		    done=1
		fi
		first=0
	    fi
	done
	echo "$as_me:$LINENO: result: $UNDERLYING_CXX (via libtool)" >&5
echo "${ECHO_T}$UNDERLYING_CXX (via libtool)" >&6
    else
	echo "$as_me:$LINENO: result: $UNDERLYING_CXX" >&5
echo "${ECHO_T}$UNDERLYING_CXX" >&6
    fi

    # If we're building LAM (and we should be -- we shouldn't be
    # compiling this from outside of LAM anymore!), set some flags


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

#
# MPICH 1.2.0 (or higher)
#

MPICH_BIN=
MPICH_SRC=
MPILIB_DIR=


# 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;

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

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

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

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

    if test "$WITHDIR" = "yes"; then
        { { echo "$as_me:$LINENO: error: supplied --with-mpich without a directory" >&5
echo "$as_me: error: supplied --with-mpich without a directory" >&2;}
   { (exit 1); exit 1; }; }
    fi
    USING_MPICH=1

    echo "$as_me:$LINENO: checking MPICH version" >&5
echo $ECHO_N "checking MPICH version... $ECHO_C" >&6
    patchfile=$WITHDIR/include/patchlevel.h
    if test ! -s $patchfile -a -n "$MPICH_SRC" ; then
	# look for it in the source location
        if test -s $MPICH_SRC/include/patchlevel.h ; then
	    patchfile=$MPICH_SRC/include/patchlevel.h
	fi
    fi

    if test ! -s $patchfile; then
	{ echo "$as_me:$LINENO: WARNING: Cannot find the patchfile.  Hence, cannot determine" >&5
echo "$as_me: WARNING: Cannot find the patchfile.  Hence, cannot determine" >&2;}
	{ echo "$as_me:$LINENO: WARNING: MPICH's version.  Perhaps you need to" >&5
echo "$as_me: WARNING: MPICH's version.  Perhaps you need to" >&2;}
	{ echo "$as_me:$LINENO: WARNING: specify where the MPICH source tree is with the" >&5
echo "$as_me: WARNING: specify where the MPICH source tree is with the" >&2;}
	{ echo "$as_me:$LINENO: WARNING: --with-mpich-srcdir flag...?" >&5
echo "$as_me: WARNING: --with-mpich-srcdir flag...?" >&2;}
	{ echo "$as_me:$LINENO: WARNING: Going to make a best guess... (good luck!)" >&5
echo "$as_me: WARNING: Going to make a best guess... (good luck!)" >&2;}
	# Stoopid emacs mode: '
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICHUNKNOWN 1
_ACEOF

    else
	MPICH_VERSION=`cat $patchfile | awk '{print $3}' | sed -e 's/\.0-9//' | tr '\012' '.'`
	if test "$MPICH_VERSION" = "1.0.0.13."; then
	    echo "$as_me:$LINENO: result: 1.0.13 (you should upgrade)" >&5
echo "${ECHO_T}1.0.13 (you should upgrade)" >&6
	    WANT_UPGRADE=1
	elif test "$MPICH_VERSION" = "1.1.0."; then
	    echo "$as_me:$LINENO: result: 1.1.0 (you should upgrade)" >&5
echo "${ECHO_T}1.1.0 (you should upgrade)" >&6
	    WANT_UPGRADE=1
	else

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

	    MPICH_VERSION=`grep 'PATCHLEVEL ' $patchfile | awk '{print $3}'`
	    mv1=`grep 'PATCHLEVEL_SUBMINOR' $patchfile | awk '{print $3}'`
	    MPICH_VERSION="$MPICH_VERSION.$mv1."

	    if test -z "$MPILIB_DIR" ; then
		MPILIB_DIR=$WITHDIR/$MPICH_DEV
	    fi
	    if test "$MPICH_VERSION" = "1.1.1."; then
		echo "$as_me:$LINENO: result: 1.1.1 (you should upgrade)" >&5
echo "${ECHO_T}1.1.1 (you should upgrade)" >&6
		WANT_UPGRADE=1
	    elif test "$MPICH_VERSION" = "1.1.2."; then
		echo "$as_me:$LINENO: result: 1.1.2 (you should upgrade)" >&5
echo "${ECHO_T}1.1.2 (you should upgrade)" >&6
		WANT_UPGRADE=1
	    elif test "$MPICH_VERSION" = "1.1.3."; then
		# Need to make this MPICH113 eventually
		echo "$as_me:$LINENO: result: 1.1.3 (you should upgrade)" >&5
echo "${ECHO_T}1.1.3 (you should upgrade)" >&6
		WANT_UPGRADE=1
	    elif test "$MPICH_VERSION" = "1.2.0."; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICH120 1
_ACEOF

		echo "$as_me:$LINENO: result: 1.2.0 (good)" >&5
echo "${ECHO_T}1.2.0 (good)" >&6
		WANT_UPGRADE=0
		if test -z "$MPICH_BIN"; then
		    { { echo "$as_me:$LINENO: error: when configuring for 1.2.0, --with-mpichbin must be specified" >&5
echo "$as_me: error: when configuring for 1.2.0, --with-mpichbin must be specified" >&2;}
   { (exit 1); exit 1; }; }
		fi
	    elif test "$MPICH_VERSION" = "1.2.1."; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICH121 1
_ACEOF

		echo "$as_me:$LINENO: result: 1.2.1 (good)" >&5
echo "${ECHO_T}1.2.1 (good)" >&6
		WANT_UPGRADE=0
		if test -z "$MPICH_BIN"; then
		    { { echo "$as_me:$LINENO: error: when configuring for 1.2.1, --with-mpichbin must be specified" >&5
echo "$as_me: error: when configuring for 1.2.1, --with-mpichbin must be specified" >&2;}
   { (exit 1); exit 1; }; }
		fi
	    elif test "$MPICH_VERSION" = "1.2.2."; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICH121 1
_ACEOF

		echo "$as_me:$LINENO: result: 1.2.2 (good)" >&5
echo "${ECHO_T}1.2.2 (good)" >&6
		WANT_UPGRADE=0
		if test -z "$MPICH_BIN"; then
		    { { echo "$as_me:$LINENO: error: when configuring for 1.2.2, --with-mpichbin must be specified" >&5
echo "$as_me: error: when configuring for 1.2.2, --with-mpichbin must be specified" >&2;}
   { (exit 1); exit 1; }; }
		fi
	    elif test "$MPICH_VERSION" = "1.2.3."; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICH121 1
_ACEOF

		echo "$as_me:$LINENO: result: 1.2.3 (good)" >&5
echo "${ECHO_T}1.2.3 (good)" >&6
		WANT_UPGRADE=0
		if test -z "$MPICH_BIN"; then
		    { { echo "$as_me:$LINENO: error: when configuring for 1.2.3, --with-mpichbin must be specified" >&5
echo "$as_me: error: when configuring for 1.2.3, --with-mpichbin must be specified" >&2;}
   { (exit 1); exit 1; }; }
		fi
	    elif test "$MPICH_VERSION" = "1.2.4."; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICH121 1
_ACEOF

		echo "$as_me:$LINENO: result: 1.2.3 (good)" >&5
echo "${ECHO_T}1.2.3 (good)" >&6
		WANT_UPGRADE=0
		if test -z "$MPICH_BIN"; then
		    { { echo "$as_me:$LINENO: error: when configuring for 1.2.4, --with-mpichbin must be specified" >&5
echo "$as_me: error: when configuring for 1.2.4, --with-mpichbin must be specified" >&2;}
   { (exit 1); exit 1; }; }
		fi
	    else
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_MPICHUNKNOWN 1
_ACEOF

		echo "$as_me:$LINENO: result: unrecognized MPICH level -- good luck!" >&5
echo "${ECHO_T}unrecognized MPICH level -- good luck!" >&6
	    fi

	fi
    fi

    if test "$WANT_UPGRADE" = "1"; then
	{ echo "$as_me:$LINENO: WARNING: *** WARNING: It looks like you are using an old" >&5
echo "$as_me: WARNING: *** WARNING: It looks like you are using an old" >&2;}
	{ echo "$as_me:$LINENO: WARNING: *** version of MPICH." >&5
echo "$as_me: WARNING: *** version of MPICH." >&2;}
	{ echo "$as_me:$LINENO: WARNING: *** You need to upgrade to the latest version." >&5
echo "$as_me: WARNING: *** You need to upgrade to the latest version." >&2;}
	{ echo "$as_me:$LINENO: WARNING: *** See http://www.mcs.anl.gov/mpi/mpich/" >&5
echo "$as_me: WARNING: *** See http://www.mcs.anl.gov/mpi/mpich/" >&2;}
	{ { echo "$as_me:$LINENO: error: *** Cannot continue." >&5
echo "$as_me: error: *** Cannot continue." >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test -z "$MPILIB_DIR" ; then
        MPILIB_DIR=$WITHDIR/$MPICH_DEV
    fi

    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 -d "$WITHDIR/lib"; then
      MPICHLIBDIR=$WITHDIR/lib/$ARCH
    elif test -d "$WITHDIR/build"; then
      MPICHLIBDIR=$WITHDIR/build/$ARCH
    elif test ! -z "$MPILIB_DIR"; then
      MPICHLIBDIR="$MPILIB_DIR"
    else
	{ { echo "$as_me:$LINENO: error: could not find MPICH support for $ARCH" >&5
echo "$as_me: error: could not find MPICH support for $ARCH" >&2;}
   { (exit 1); exit 1; }; }
    fi

    if test ! "$MPICH_DEV" = ""; then
	DEVICE=$MPICH_DEV
    elif test -d "$MPICHLIBDIR"; then
	echo "no MPICH device specified"
	echo "$as_me:$LINENO: checking for existing MPICH devices" >&5
echo $ECHO_N "checking for existing MPICH devices... $ECHO_C" >&6
	devices=""
	for device in `/bin/ls $MPICHLIBDIR`; do
	    if test -d $MPICHLIBDIR/$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 "$as_me:$LINENO: result: none found" >&5
echo "${ECHO_T}none found" >&6
	    { { echo "$as_me:$LINENO: error: cannot continue" >&5
echo "$as_me: error: cannot continue" >&2;}
   { (exit 1); exit 1; }; }
	elif test "$device_count" = "1"; then
	    DEVICE=$devices
	    echo "$as_me:$LINENO: result: found $DEVICE MPICH device" >&5
echo "${ECHO_T}found $DEVICE MPICH device" >&6
	else
	    echo "$as_me:$LINENO: result: found multiple MPICH devices" >&5
echo "${ECHO_T}found multiple MPICH devices" >&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 "$MPICHLIBDIR/$DEVICE"; then
		    echo "$DEVICE MPICH device not found"
		    DEVICE=0
		fi
	    done
	fi
	MPICH_DEV=$MPICHLIBDIR/$DEVICE

	# #$%^$#%^$@%@#%@#$!!!!!!!
	# Don't ask.  Trust us.
	# (the directory structure for MPICH changed between 1.1.1 and 1.1.2
	if test "$MPICH_VERSION" = "1.1.2."; then
	    MPICH_DEV=$MPICH_DEV/lib
	fi
    else
	{ { echo "$as_me:$LINENO: error: could not find MPICH support for $ARCH" >&5
echo "$as_me: error: could not find MPICH support for $ARCH" >&2;}
   { (exit 1); exit 1; }; }
    fi

    ARCH=$OLD_ARCH

    # Look for the actual PROGRAMS; don't use the versions!
    if test -x $MPICH_BIN/mpiCC ; then
        # MPICH 1.2.0 and later
        MPI_CXX=$MPICH_BIN/mpiCC
    else
	MPI_CXX=mpiCC
    fi
    CXX=$MPI_CXX
    # Tell mpiCC to not load mpi++.h when reading mpi.h
    CXXFLAGS="$CXXFLAGS -DMPICH_SKIP_MPICXX"
    MPI_LIBS="-l$MPICH_LIBNAME"

    # JGS not sure were these should go
    MPI_CXXFLAGS="-I$WITHDIR/include -I$WITHDIR"
    MPI_LDFLAGS="-L$WITHDIR/$MPICH_DEV"

    # Get the underlying compiler name so that we can check for
    # exception flags properly

    echo "$as_me:$LINENO: checking for MPICH's underlying C++ compiler" >&5
echo $ECHO_N "checking for MPICH's underlying C++ compiler... $ECHO_C" >&6
    full="`$MPI_CXX -show`"
    first="`echo $full | awk '{ print $1 }'`"
    UNDERLYING_CXX="`basename $first`"
    if test "$UNDERLYING_CXX" = "libtool"; then
	first=1
	done=0
	for word in $full ; do
	    if test "$done" = "0"; then
		name="`basename $word`"
		if test "$first" != "1" -a \
			"`echo $word | cut -c1-2`" != "--"; then
		    UNDERLYING_CXX="$word"
		    done=1
		fi
		first=0
	    fi
	done
	echo "$as_me:$LINENO: result: $UNDERLYING_CXX (via libtool)" >&5
echo "${ECHO_T}$UNDERLYING_CXX (via libtool)" >&6
    else
	echo "$as_me:$LINENO: result: $UNDERLYING_CXX" >&5
echo "${ECHO_T}$UNDERLYING_CXX" >&6
    fi


    if test "$ARCH" != "IRIX"; then
	WANT_SOCKET_LIBS=1
    else
	#MPI_CXXFLAGS="$MPI_CXXFLAGS -64"
	#MPI_LDFLAGS="$MPI_LDFLAGS -64"

	#CXXFLAGS="$CXXFLAGS -64"
	#LDFLAGS="$LDFLAGS -64"
        :
    fi
    WANT_THREAD_LIBS=1
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;

# Stoopid emacs mode: '

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 "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_MPI_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $MPI_CXX in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_MPI_CXX="$MPI_CXX" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_MPI_CXX="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  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 "$as_me:$LINENO: result: $MPI_CXX" >&5
echo "${ECHO_T}$MPI_CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

    if test "$MPI_CXX" = "doh"; then
        echo "$as_me:$LINENO: checking for mpCC (elsewhere)" >&5
echo $ECHO_N "checking for mpCC (elsewhere)... $ECHO_C" >&6
        foreach comp /bin/mpCC /usr/bin/mpCC
            if test "$MPI_CXX" = "" -a -x $comp; then
                echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
                MPI_CXX=$comp
            fi
        end
        if test "$MPI_CXX" = ""; then
            echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
            { { echo "$as_me:$LINENO: error: cannot continue -- put mpCC in your path" >&5
echo "$as_me: error: cannot continue -- put mpCC in your path" >&2;}
   { (exit 1); exit 1; }; }
        fi
    fi
    CXX=$MPI_CXX

    OPTFLAGS="-O3 -qstrict -qarch=pwr2 -qtune=pwr2s -Q"
    TEST_OPTFLAGS=$OPTFLAGS
    EXAM_OPTFLAGS=$OPTFLAGS

    echo "$as_me:$LINENO: checking POE version" >&5
echo $ECHO_N "checking POE version... $ECHO_C" >&6
    POE_VERSION=`lslpp -L ppe.poe | $GREP poe | awk '{ print $2 }'`
    if test "$POE_VERSION" = "2.1.0.14"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM21014 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.1.0.14 (you should upgrade)" >&5
echo "${ECHO_T}2.1.0.14 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.1.0.15"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM21015 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.1.0.15 (you should upgrade)" >&5
echo "${ECHO_T}2.1.0.15 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.1.0.16"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM21016 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.1.0.16 (you should upgrade)" >&5
echo "${ECHO_T}2.1.0.16 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.1.0.17"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM21017 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.1.0.17 (you should upgrade)" >&5
echo "${ECHO_T}2.1.0.17 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.1.0.18"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM21018 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.1.0.18 (you should upgrade)" >&5
echo "${ECHO_T}2.1.0.18 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.3.0.0"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM2_3_0_0 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.3.0.0 (you should upgrade)" >&5
echo "${ECHO_T}2.3.0.0 (you should upgrade)" >&6
    elif test "$POE_VERSION" = "2.4.0.0"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBM2_4_0_0 1
_ACEOF

        echo "$as_me:$LINENO: result: 2.4.0.0 (good)" >&5
echo "${ECHO_T}2.4.0.0 (good)" >&6
    else
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_IBMUNKNOWN 1
_ACEOF

        echo "$as_me:$LINENO: result: Unknown version -- $POE_VERSION (good luck)" >&5
echo "${ECHO_T}Unknown version -- $POE_VERSION (good luck)" >&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"

    # Strategy: build up a list of all the libdirs.  Then search for
    # the appropriate libmpi.so or libmpi.a.

    libpaths=/tmp
    if test "?$LD_LIBRARY64_PATH" != "0"; then
	libpaths="$LD_LIBRARY64_PATH"
    fi
    if test "?$LD_LIBRARYN32_PATH" != "0"; then
	libpaths="$LD_LIBRARYN32_PATH:$libpaths"
    fi
    if test "?$LD_LIBRARY_PATH" != "0"; then
	libpaths="$LD_LIBRARY_PATH:$libpaths"
    fi

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

    LIBDIR=
    if test "$MPI_IMP" = "sgi"; then
	num=1
	dir="`echo $libpaths | cut -d: -f$num`"

	# Iterate through the dirs, look for a libmpi.a or libmpi.so

	while test "$dir" != ""; do
	    if test -f $dir/libmpi.so -o -f $dir/libmpi.a; then
		LIBDIR="$dir"
		dir=""
	    else
		num="`expr $num + 1`"
		dir="`echo $libpaths | cut -d: -f$num`"
	    fi
	done
	if test "$LIBDIR" = ""; then
	    { echo "$as_me:$LINENO: WARNING: Cannot find libmpi.(a|so)" >&5
echo "$as_me: WARNING: Cannot find libmpi.(a|so)" >&2;}
	    { { echo "$as_me:$LINENO: error: Cannot continue" >&5
echo "$as_me: error: Cannot continue" >&2;}
   { (exit 1); exit 1; }; }
	fi
	isn32="`echo $LIBDIR | $GREP /libn32/`"
	is64="`echo $LIBDIR | $GREP /lib64/`"
        if test "$isn32" != ""; then
            SGIFLAGS="-n32"
            SGIBIT="n32"
        elif test "$is64" != ""; then
            SGIFLAGS="-64"
            SGIBIT="64"
	else
	    SGIFLAGS=""
	    SGIBIT="32"
        fi
    elif test "$MPI_IMP" = "sgi64"; then
	num=1
	dir="`echo $libpaths | cut -d: -f$num`"

	# Iterate through the dirs, look for libmpi.a or libmpi.so,
	# but it must have /lib64/ in the directory name.

	while test "$dir" != ""; do
	    if test \( -f $dir/libmpi.so -o -f $dir/libmpi.a \) -a \
	      "`echo $dir | $GREP /lib64/`" != ""; then
		LIBDIR="$dir"
		dir=""
	    else
		num="`expr $num + 1`"
		dir="`echo $libpaths | cut -d: -f$num`"
	    fi
	done
	if test "$LIBDIR" = ""; then
	    { echo "$as_me:$LINENO: WARNING: Cannot find 64 bit libmpi.(a|so)" >&5
echo "$as_me: WARNING: Cannot find 64 bit libmpi.(a|so)" >&2;}
	    { { echo "$as_me:$LINENO: error: Cannot continue" >&5
echo "$as_me: error: Cannot continue" >&2;}
   { (exit 1); exit 1; }; }
	fi
        SGIFLAGS="-64"
        SGIBIT="64"
    fi

    # Now that we found it, find the version number

    echo "$as_me:$LINENO: checking SGI MPI version" >&5
echo $ECHO_N "checking SGI MPI version... $ECHO_C" >&6
    WANT_UPGRADE=
    IS20=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI 2.0"`
    if test "$IS20" != ""; then
        echo "$as_me:$LINENO: result: 2.0 ($SGIBIT) -- you should upgrade" >&5
echo "${ECHO_T}2.0 ($SGIBIT) -- you should upgrade" >&6
	WANT_UPGRADE=1
    else

      IS20=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI 2.0"`
      if test "$IS20" != ""; then
        echo "$as_me:$LINENO: result: 2.0 ($SGIBIT) -- you should upgrade" >&5
echo "${ECHO_T}2.0 ($SGIBIT) -- you should upgrade" >&6
	WANT_UPGRADE=1
      else

        IS30=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI 3.0"`
        if test "$IS30" != ""; then
            cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SGI30 1
_ACEOF

            echo "$as_me:$LINENO: result: 3.0 ($SGIBIT) -- you should upgrade" >&5
echo "${ECHO_T}3.0 ($SGIBIT) -- you should upgrade" >&6
	    WANT_UPGRADE=1
        else

          IS31=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI 3.1"`
          if test "$IS31" != ""; then
              cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SGI31 1
_ACEOF

              echo "$as_me:$LINENO: result: 3.1 ($SGIBIT) -- you should upgrade" >&5
echo "${ECHO_T}3.1 ($SGIBIT) -- you should upgrade" >&6
	      WANT_UPGRADE=1
          else

	    IS32=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI 3.2.0.0"`
	    if test "$IS32" != ""; then
		cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SGI32 1
_ACEOF

		echo "$as_me:$LINENO: result: 3.2 ($SGIBIT) -- you should upgrade" >&5
echo "${ECHO_T}3.2 ($SGIBIT) -- you should upgrade" >&6

		# We'll let this one go, 'cause it's the last one that
		# real users can use this package with -- SGI already
		# includes this package in every version after this.

	    else
              VER=`strings $LIBDIR/libmpi.so | $GREP "SGI MPI"`
              cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SGIUNKNOWN 1
_ACEOF


              echo "$as_me:$LINENO: result: Unknown version ($SGIBIT) -- $VER (good luck)" >&5
echo "${ECHO_T}Unknown version ($SGIBIT) -- $VER (good luck)" >&6
	      { echo "$as_me:$LINENO: WARNING: *** WARNING: It is likely that you are using a version" >&5
echo "$as_me: WARNING: *** WARNING: It is likely that you are using a version" >&2;}
	      { echo "$as_me:$LINENO: WARNING: *** later than SGI MPI 3.2.0.0 (or later than the" >&5
echo "$as_me: WARNING: *** later than SGI MPI 3.2.0.0 (or later than the" >&2;}
	      { echo "$as_me:$LINENO: WARNING: *** Message Passing Toolkit 1.3).  SGI started including" >&5
echo "$as_me: WARNING: *** Message Passing Toolkit 1.3).  SGI started including" >&2;}
	      { echo "$as_me:$LINENO: WARNING: *** this package in their MPI starting with MPT 1.4." >&5
echo "$as_me: WARNING: *** this package in their MPI starting with MPT 1.4." >&2;}
	      { echo "$as_me:$LINENO: WARNING: *** As such, you probably do not need this package, and" >&5
echo "$as_me: WARNING: *** As such, you probably do not need this package, and" >&2;}
	      { echo "$as_me:$LINENO: WARNING: *** it is likely that this compilation will fail." >&5
echo "$as_me: WARNING: *** it is likely that this compilation will fail." >&2;}
	    fi
          fi
        fi
      fi
    fi

    if test "$WANT_UPGRADE" = "1"; then
        { echo "$as_me:$LINENO: WARNING: *** You are advised to get the latest version of SGI's MPI" >&5
echo "$as_me: WARNING: *** You are advised to get the latest version of SGI's MPI" >&2;}
        { echo "$as_me:$LINENO: WARNING: *** See http://www.sgi.com/Products/Evaluation/evaluation.html" >&5
echo "$as_me: WARNING: *** See http://www.sgi.com/Products/Evaluation/evaluation.html" >&2;}
	{ { echo "$as_me:$LINENO: error: *** Cannot continue." >&5
echo "$as_me: error: *** Cannot continue." >&2;}
   { (exit 1); exit 1; }; }
    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"
# Per jitterbug PR#59, assuming the native compiler is not necessarily
# a good thing
    if test "$?CXX" = "0"; then
	CXX=CC
    fi
    MPI_CXX="$CXX"

    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_CRAY 1
_ACEOF

    echo "$as_me:$LINENO: checking Cray MPI version" >&5
echo $ECHO_N "checking Cray MPI version... $ECHO_C" >&6
    CRAYVER=`ls -ld /opt/ctl/mpt/mpt | awk '{ print $11 }' | cut -d/ -f5`
    if test "$CRAYVER" = "1.1.0.4"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_CRAY1104 1
_ACEOF

	echo "$as_me:$LINENO: result: 1.1.0.4 (good)" >&5
echo "${ECHO_T}1.1.0.4 (good)" >&6
    else
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_CRAYUNKNOWN 1
_ACEOF

	echo "$as_me:$LINENO: result: unknown Cray MPI version -- good luck!" >&5
echo "${ECHO_T}unknown Cray MPI version -- good luck!" >&6
    fi

# It seems that this flag is way outdated (per C++ jitterbut PR#59)
#    MPI_CXXFLAGS="-hnomessage=427"
    MPI_CXXFLAGS=
    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 "$as_me:$LINENO: WARNING: \$MPI_ROOT is defaulting to /opt/mpi." >&5
echo "$as_me: WARNING: \$MPI_ROOT is defaulting to /opt/mpi." >&2;}
                { echo "$as_me:$LINENO: WARNING: Override it by setting it manually and re-running configure." >&5
echo "$as_me: WARNING: Override it by setting it manually and re-running configure." >&2;}
        fi

	MPI_CXX=$MPI_CXX_SAVE
        if test "$MPI_CXX" = ""; then
                MPI_CXX=aCC
                { echo "$as_me:$LINENO: WARNING: You need to set \$MPI_CXX to the appropriate compiler." >&5
echo "$as_me: WARNING: You need to set \$MPI_CXX to the appropriate compiler." >&2;}
                { echo "$as_me:$LINENO: WARNING: Defaulting to aCC." >&5
echo "$as_me: WARNING: Defaulting to aCC." >&2;}
        fi

        echo "$as_me:$LINENO: checking HP-UX MPI version" >&5
echo $ECHO_N "checking HP-UX MPI version... $ECHO_C" >&6
        if ! test -r $MPI_ROOT/lib/pa1.1/libmpi.a; then
                echo "$as_me:$LINENO: result: cannot find libmpi.a!" >&5
echo "${ECHO_T}cannot find libmpi.a!" >&6
                { { echo "$as_me:$LINENO: error: Is \$MPI_ROOT set properly?" >&5
echo "$as_me: error: Is \$MPI_ROOT set properly?" >&2;}
   { (exit 1); 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 <<\_ACEOF
#define MPI2CPP_HPUX0102 1
_ACEOF

                echo "$as_me:$LINENO: result: 1.2 (you should upgrade)" >&5
echo "${ECHO_T}1.2 (you should upgrade)" >&6
	else
		HPVER=`echo "$HPSTR" | sed -e "s/[^0-9\.]*//" | cut -c1-5`
               	if test "$HPVER" = "01.03"; then
			cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HPUX0103 1
_ACEOF

			echo "$as_me:$LINENO: result: 1.3 (good )" >&5
echo "${ECHO_T}1.3 (good )" >&6
                elif test "$HPVER" = "01.05"; then
                        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HPUX0105 1
_ACEOF

                        echo "$as_me:$LINENO: result: 1.5 (good)" >&5
echo "${ECHO_T}1.5 (good)" >&6
		else
                	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HPUXUNKNOWN 1
_ACEOF

                	echo "$as_me:$LINENO: result: Unknown version -- $HPVER (good luck)" >&5
echo "${ECHO_T}Unknown version -- $HPVER (good luck)" >&6
        	fi
	fi

        echo "$as_me:$LINENO: checking for mpiCC compiler" >&5
echo $ECHO_N "checking for mpiCC compiler... $ECHO_C" >&6
        if test -x $MPI_ROOT/bin/mpiCC; then
                CXX="$MPI_ROOT/bin/mpiCC"
                echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6
        else
                echo "$as_me:$LINENO: result: not found!" >&5
echo "${ECHO_T}not found!" >&6
                { { echo "$as_me:$LINENO: error: ensure that mpiCC is in \$MPI_ROOT/bin" >&5
echo "$as_me: error: ensure that mpiCC is in \$MPI_ROOT/bin" >&2;}
   { (exit 1); exit 1; }; }
        fi
fi

#
# FT-MPI
#



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

if test "x$WITHDIR" = "xyes" ; then
    WITHDIR=$HARNESS_ROOT
fi

if test "$MPI_IMP" = "ftmpi"; then
    MPI_LIBS="-lftmpi"
    MPI_MIDDLE_NAME="ft"

    if test ! -d $WITHDIR; then
        { { echo "$as_me:$LINENO: error: $WITHDIR does not exist" >&5
echo "$as_me: error: $WITHDIR does not exist" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d $WITHDIR/include; then
        { { echo "$as_me:$LINENO: error: $WITHDIR/include does not exist" >&5
echo "$as_me: error: $WITHDIR/include does not exist" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d $WITHDIR/lib; then
        { { echo "$as_me:$LINENO: error: $WITHDIR/lib does not exist" >&5
echo "$as_me: error: $WITHDIR/lib does not exist" >&2;}
   { (exit 1); exit 1; }; }
    fi

    MPI_CXXFLAGS="-I$WITHDIR/include"
    MPI_LDFLAGS="-L$WITHDIR/lib/$HARNESS_ARCH"

if test "$prefix"="/usr/local/"; then
    INSTALLDIR="$WITHDIR"
    prefix="$WITHDIR"
    bindir="$WITHDIR/bin/$HARNESS_ARCH"
    libdir="$WITHDIR/lib/$HARNESS_ARCH"
else
    INSTALLDIR=$prefix
fi


if test "$ARCH" = "SOLARIS"; then
	WANT_SOCKET_LIBS=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 "$as_me:$LINENO: error: $WITHDIR does not exist" >&5
echo "$as_me: error: $WITHDIR does not exist" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d $WITHDIR/include; then
        { { echo "$as_me:$LINENO: error: $WITHDIR/include does not exist" >&5
echo "$as_me: error: $WITHDIR/include does not exist" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d $WITHDIR/lib; then
        { { echo "$as_me:$LINENO: error: $WITHDIR/lib does not exist" >&5
echo "$as_me: error: $WITHDIR/lib does not exist" >&2;}
   { (exit 1); exit 1; }; }
    fi

    MPI_CXXFLAGS="-I$MPIDIR/include"
    MPI_LDFLAGS="-L$WITHDIR/$MPICHLIBDIR"
    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 "$as_me:$LINENO: error: no include directory specified (--with-mpiinc)" >&5
echo "$as_me: error: no include directory specified (--with-mpiinc)" >&2;}
   { (exit 1); exit 1; }; }
    elif test "$LIBDIR" = ""; then
        { { echo "$as_me:$LINENO: error: no library directory specified (--with-mpilib)" >&5
echo "$as_me: error: no library directory specified (--with-mpilib)" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d "$INCDIR"; then
        { { echo "$as_me:$LINENO: error: $INCDIR does not exist" >&5
echo "$as_me: error: $INCDIR does not exist" >&2;}
   { (exit 1); exit 1; }; }
    elif test ! -d "$LIBDIR"; then
        { { echo "$as_me:$LINENO: error: $LIBDIR does not exist" >&5
echo "$as_me: error: $LIBDIR does not exist" >&2;}
   { (exit 1); exit 1; }; }
    fi

    MPI_CXXFLAGS="-I$INCDIR"
    MPI_LDFLAGS="-L$LIBDIR"
    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"
  WANT_PROFILE=$withval
else
  WANT_PROFILE="no"
fi;
echo "$as_me:$LINENO: checking if want profiling support" >&5
echo $ECHO_N "checking if want profiling support... $ECHO_C" >&6
if test "$WANT_PROFILE" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_PROFILING_ 1
_ACEOF

    MPI2CPP_LIBRARY="libpmpi++.a"
    MPI2CPP_LIB="-lpmpi++"
    MPI2CPP_INSTALLED_LIB="-l${MPI_MIDDLE_NAME}pmpi++"
else
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_PROFILING_ 0
_ACEOF

    MPI2CPP_LIBRARY="libmpi++.a"
    MPI2CPP_LIB="-lmpi++"
    MPI2CPP_INSTALLED_LIB="-l${MPI_MIDDLE_NAME}mpi++"
fi




if test "$WANT_PROFILE" = "yes"; then
  WANT_PROFILING_TRUE=
  WANT_PROFILING_FALSE='#'
else
  WANT_PROFILING_TRUE='#'
  WANT_PROFILING_FALSE=
fi
echo "$as_me:$LINENO: result: $WANT_PROFILE" >&5
echo "${ECHO_T}$WANT_PROFILE" >&6

#
# We need to do a bunch of tests with <mpi.h> and "-lmpi", so
# temporarily change the CXXFLGAS.  Restore them later before they get
# substituted into various Makefiles.
#

CXXFLAGS_SAVE="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $MINI_BALKY_CXXFLAGS"

#
# Setup C++ compiler
#

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

#
# $%@#!@#% AC_PROG_CXX changes CXXFLAGS...
#

LOCAL_CXXFLAGS_SAVE=$CXXFLAGS
CXXFLAGS="$CXXFLAGS"
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$ac_tool_prefix"; then
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
  do
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
  echo "$as_me:$LINENO: result: $CXX" >&5
echo "${ECHO_T}$CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

    test -n "$CXX" && break
  done
fi
if test -z "$CXX"; then
  ac_ct_CXX=$CXX
  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
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 "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_CXX"; then
  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_CXX="$ac_prog"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
echo "${ECHO_T}$ac_ct_CXX" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  test -n "$ac_ct_CXX" && break
done
test -n "$ac_ct_CXX" || ac_ct_CXX="g++"

  CXX=$ac_ct_CXX
fi


# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
     "checking for C++ compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  (eval $ac_compiler --version </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  (eval $ac_compiler -v </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }
{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  (eval $ac_compiler -V </dev/null >&5) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }

cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.exe"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
echo "$as_me:$LINENO: checking for C++ compiler default output" >&5
echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
  (eval $ac_link_default) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # Find the output, starting from the most likely.  This scheme is
# not robust to junk in `.', hence go to wildcards (a.*) only as a last
# resort.

# Be careful to initialize this variable, since it used to be cached.
# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
ac_cv_exeext=
for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null;
                ls a.out conftest 2>/dev/null;
                ls a.* conftest.* 2>/dev/null`; do
  case $ac_file in
    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;;
    a.out ) # We found the default executable, but exeext='' is most
            # certainly right.
            break;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
          export ac_cv_exeext
          break;;
    * ) break;;
  esac
done
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables" >&5
echo "$as_me: error: C++ compiler cannot create executables" >&2;}
   { (exit 77); exit 77; }; }
fi

ac_exeext=$ac_cv_exeext
echo "$as_me:$LINENO: result: $ac_file" >&5
echo "${ECHO_T}$ac_file" >&6

# Check the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5
echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
  if { ac_try='./$ac_file'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
    cross_compiling=no
  else
    if test "$cross_compiling" = maybe; then
	cross_compiling=yes
    else
	{ { echo "$as_me:$LINENO: error: cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'." >&5
echo "$as_me: error: cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'." >&2;}
   { (exit 1); exit 1; }; }
    fi
  fi
fi
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6

rm -f a.out a.exe conftest$ac_cv_exeext
ac_clean_files=$ac_clean_files_save
# Check the compiler produces executables we can run.  If not, either
# the compiler is broken, or we cross compile.
echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $cross_compiling" >&5
echo "${ECHO_T}$cross_compiling" >&6

echo "$as_me:$LINENO: checking for suffix of executables" >&5
echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
  case $ac_file in
    *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
          export ac_cv_exeext
          break;;
    * ) break;;
  esac
done
else
  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5
echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;}
   { (exit 1); exit 1; }; }
fi

rm -f conftest$ac_cv_exeext
echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
echo "${ECHO_T}$ac_cv_exeext" >&6

rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
echo "$as_me:$LINENO: checking for suffix of object files" >&5
echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
if test "${ac_cv_objext+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; then
  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
  case $ac_file in
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
       break;;
  esac
done
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5
echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;}
   { (exit 1); exit 1; }; }
fi

rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
#ifndef __GNUC__
       choke me
#endif

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_compiler_gnu=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_compiler_gnu=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu

fi
echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
GXX=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-g"
echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cxx_g+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_prog_cxx_g=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_cxx_g=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&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
for ac_declaration in \
   ''\
   '#include <stdlib.h>' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'
do
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  :
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
continue
fi
rm -f conftest.$ac_objext conftest.$ac_ext
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
$ac_declaration
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
exit (42);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  break
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -f conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
  echo '#ifdef __cplusplus' >>confdefs.h
  echo $ac_declaration      >>confdefs.h
  echo '#endif'             >>confdefs.h
fi

ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
if test -z "$CXXCPP"; then
  if test "${ac_cv_prog_CXXCPP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      # Double quotes because CXXCPP needs to be expanded
    for CXXCPP in "$CXX -E" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <assert.h>
                     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  egrep -v '^ *\+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
  cat conftest.$ac_ext >&5
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  egrep -v '^ *\+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
  cat conftest.$ac_ext >&5
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  break
fi

    done
    ac_cv_prog_CXXCPP=$CXXCPP

fi
  CXXCPP=$ac_cv_prog_CXXCPP
else
  ac_cv_prog_CXXCPP=$CXXCPP
fi
echo "$as_me:$LINENO: result: $CXXCPP" >&5
echo "${ECHO_T}$CXXCPP" >&6
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
  # Use a header file that comes with gcc, so configuring glibc
  # with a fresh cross-compiler works.
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. "Syntax error" is here to catch this case.
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <assert.h>
                     Syntax error
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  egrep -v '^ *\+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  :
else
  echo "$as_me: failed program was:" >&5
  cat conftest.$ac_ext >&5
  # Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext

  # OK, works on sane cases.  Now check whether non-existent headers
  # can be detected and how.
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <ac_nonexistent.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  ac_status=$?
  egrep -v '^ *\+' conftest.er1 >conftest.err
  rm -f conftest.er1
  cat conftest.err >&5
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } >/dev/null; then
  if test -s conftest.err; then
    ac_cpp_err=$ac_cxx_preproc_warn_flag
  else
    ac_cpp_err=
  fi
else
  ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
  # Broken: success on invalid input.
continue
else
  echo "$as_me: failed program was:" >&5
  cat conftest.$ac_ext >&5
  # Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext

done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
  :
else
  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5
echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;}
   { (exit 1); exit 1; }; }
fi

ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

CXXFLAGS="$LOCAL_CXXFLAGS_SAVE"



echo "$as_me:$LINENO: checking for AIX" >&5
echo $ECHO_N "checking for AIX... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
_ACEOF

else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest*


echo "$as_me:$LINENO: checking whether ln -s works" >&5
echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
echo "${ECHO_T}no, using $LN_S" >&6
fi


BALKY_CXX=$CXX



#
# See if the compiler makes template repository directories
#


#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets TEMPLATE_REP to the directory name, or blank
# Does AC_SUBST on TEMPLATE_REP
#

echo "$as_me:$LINENO: checking for template repository directory" >&5
echo $ECHO_N "checking for template repository directory... $ECHO_C" >&6
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.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 > conftest2.C <<EOF
#include "conftest.h"

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

cat > conftest1.C <<EOF
#include "conftest.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

echo configure:3898: $CXX $CXXFLAGS -c conftest1.C >&5
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
if test ! -f conftest1.o ; then
    echo "$as_me:$LINENO: result: templates not supported?" >&5
echo "${ECHO_T}templates not supported?" >&6
    echo configure:3903: here is the program that failed: >&5
    cat conftest1.C >&5
    echo configure:3905: here is conftest.h: >&5
    cat conftest.h >&5
else
    echo configure:3908: $CXX $CXXFLAGS -c conftest2.C >&5
    $CXX $CXXFLAGS -c conftest2.C >&5 2>&5
    if test ! -f conftest2.o ; then
	echo "$as_me:$LINENO: result: unknown error" >&5
echo "${ECHO_T}unknown error" >&6
	echo configure:3913: here is the program that failed: >&5
	cat conftest2.C >&5
	echo configure:3915: here is conftest.h: >&5
	cat conftest.h >&5
    else
	rm -rf conftest*

	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
    fi
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != "" -a "$TEMPLATE_REP" != " "; then
    echo "$as_me:$LINENO: result: $TEMPLATE_REP" >&5
echo "${ECHO_T}$TEMPLATE_REP" >&6
else
    echo "$as_me:$LINENO: result: not used" >&5
echo "${ECHO_T}not used" >&6
fi
cd ..
rm -rf conf_tmp_$$



#
# Force automake to delete emacs ~ files at "make clean"
#

CLEANFILES='-r *~ $(TEMPLATE_REP)'



#
# Exception handling flags
#

if test "$UNDERLYING_CXX" != ""; then
    CXX_save="$CXX"
    CXX="$UNDERLYING_CXX";
fi

#
# Get the exception handling flags for the C++ compiler
#
# Sets LSC_EXCEPTION_CXXFLAGS and LSC_EXCEPTION_LDFLAGS as appropriate
# Calls AC_SUBST on both
#


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

LOCAL_CXXFLAGS_SAVE=$CXXFLAGS
echo "$as_me:$LINENO: checking for compiler exception flags" >&5
echo $ECHO_N "checking for compiler exception flags... $ECHO_C" >&6
if test "$FORCE_EXFLAGS" != ""; then
    EXFLAGS=$FORCE_EXFLAGS
elif test "$GXX" = "yes"; then
    CXXFLAGS="$CXXFLAGS -fexceptions"



    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
try { int i = 0; } catch(...) { int j = 2; }
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  HAPPY=1
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
HAPPY=0
fi
rm -f conftest.$ac_objext conftest.$ac_ext

    if test "$HAPPY" = "1"; then
	EXFLAGS="-fexceptions";
    else
	CXXFLAGS="$LOCAL_CXXFLAGS_SAVE -fhandle-exceptions"
	cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
try { int i = 0; } catch(...) { int j = 2; }
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  HAPPY=1
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
HAPPY=0
fi
rm -f conftest.$ac_objext conftest.$ac_ext
	if test "$HAPPY" = "1"; then
	    EXFLAGS="-fhandle-exceptions";
	fi
    fi
    ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

elif test "`basename $CXX`" = "KCC"; then
    EXFLAGS="-x"
elif test "$LAMHCP" = "1"; then
    if test "`basename $LAMHCP`" = "KCC"; then
	EXFLAGS="-x"
    fi
fi
CXXFLAGS="$LOCAL_CXXFLAGS_SAVE"

LSC_EXCEPTION_CXXFLAGS=$EXFLAGS
LSC_EXCEPTION_LDFLAGS="$EXFLAGS"
if test "$EXFLAGS" = ""; then
    echo "$as_me:$LINENO: result: none necessary" >&5
echo "${ECHO_T}none necessary" >&6
else
    echo "$as_me:$LINENO: result: $EXFLAGS" >&5
echo "${ECHO_T}$EXFLAGS" >&6
fi


if test "$UNDERLYING_CXX" != ""; then
    CXX="$CXX_save";
fi


EXCPTN_CXXFLAGS=$LSC_EXCEPTION_CXXFLAGS
CXXFLAGS="$EXCPTN_CXXFLAGS $CXXFLAGS"
EXCPTN_LDFLAGS="$LSC_EXCEPTION_LDFLAGS"


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

# Since our errhandling test in the testsuite fails
# when compiling with g++ (both 2.8 and with egcs)
# we'll specify no exceptions for g++
#
# This needs to test for the problem, so that when g++/egcs is fixed, this
# will still work! - WDG
#
# I Agree! - PWR

echo "$as_me:$LINENO: checking for throw/catch" >&5
echo $ECHO_N "checking for throw/catch... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
int i=1; throw(i);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  have_excep=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
have_excep=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test "$GXX" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USEEXCEPTIONS_ 0
_ACEOF

    echo "$as_me:$LINENO: result: no (g++ exceptions broken)" >&5
echo "${ECHO_T}no (g++ exceptions broken)" >&6
elif test "$have_excep" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USEEXCEPTIONS_ 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USEEXCEPTIONS_ 0
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi


#
# Set final compiler flags
#

MINI_BALKY_CXXFLAGS="$EXCPTN_CXXFLAGS $EXTRA_CXXFLAGS $MPI_CXXFLAGS -I`pwd`/src $MINI_BALKY_CXXFLAGS"
BALKY_CXXFLAGS="$EXCPTN_CXXFLAGS $EXTRA_CXXFLAGS $MPI_CXXFLAGS -I$INSTALLDIR/include $CXXFLAGS_SAVE $BALKY_CXXFLAGS"

CXXFLAGS_SAVE="$CXXFLAGS_SAVE $MPI_CXXFLAGS"
CXXFLAGS="$CXXFLAGS $MPI_CXXFLAGS"
DEPFLAGS="$CXXFLAGS_SAVE"






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


if test "$TEMPLATE_REP" = ""; then

#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets TEMPLATE_REP to the directory name, or blank
# Does AC_SUBST on TEMPLATE_REP
#

echo "$as_me:$LINENO: checking for template repository directory" >&5
echo $ECHO_N "checking for template repository directory... $ECHO_C" >&6
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.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 > conftest2.C <<EOF
#include "conftest.h"

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

cat > conftest1.C <<EOF
#include "conftest.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

echo configure:4298: $CXX $CXXFLAGS -c conftest1.C >&5
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
if test ! -f conftest1.o ; then
    echo "$as_me:$LINENO: result: templates not supported?" >&5
echo "${ECHO_T}templates not supported?" >&6
    echo configure:4303: here is the program that failed: >&5
    cat conftest1.C >&5
    echo configure:4305: here is conftest.h: >&5
    cat conftest.h >&5
else
    echo configure:4308: $CXX $CXXFLAGS -c conftest2.C >&5
    $CXX $CXXFLAGS -c conftest2.C >&5 2>&5
    if test ! -f conftest2.o ; then
	echo "$as_me:$LINENO: result: unknown error" >&5
echo "${ECHO_T}unknown error" >&6
	echo configure:4313: here is the program that failed: >&5
	cat conftest2.C >&5
	echo configure:4315: here is conftest.h: >&5
	cat conftest.h >&5
    else
	rm -rf conftest*

	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
    fi
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != "" -a "$TEMPLATE_REP" != " "; then
    echo "$as_me:$LINENO: result: $TEMPLATE_REP" >&5
echo "${ECHO_T}$TEMPLATE_REP" >&6
else
    echo "$as_me:$LINENO: result: not used" >&5
echo "${ECHO_T}not used" >&6
fi
cd ..
rm -rf conf_tmp_$$

fi
echo "$as_me:$LINENO: checking for mpi.h" >&5
echo $ECHO_N "checking for mpi.h... $ECHO_C" >&6
touch conftest.o
rm -f conftest.o
cat > conftest.C <<EOF
#include <mpi.h>
int
main(int argc, char* argv)
{ return 0; }
EOF
echo configure:4376: $CXX $CXXFLAGS -c conftest.C >&5
$CXX $CXXFLAGS -c conftest.C >&2 2>&5
if test -f conftest.o ; then
    HAVE_MPI_H=yes
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    HAVE_MPI_H=no
    echo configure:4384: here is the program that failed: >&5
    cat conftest.C >&5
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -rf conftest* $TEMPLATE_REP
if test "$HAVE_MPI_H" = "no"; then
    { { echo "$as_me:$LINENO: error: cannot continue -- cannot find <mpi.h>" >&5
echo "$as_me: error: cannot continue -- cannot find <mpi.h>" >&2;}
   { (exit 1); exit 1; }; }
fi


#
# Look for extra libraries
#

if test "$WANT_SOCKET_LIBS" = "1"; then
    echo "$as_me:$LINENO: checking for getservbyname in -lsocket" >&5
echo $ECHO_N "checking for getservbyname in -lsocket... $ECHO_C" >&6
if test "${ac_cv_lib_socket_getservbyname+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "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 ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
getservbyname ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_socket_getservbyname=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_lib_socket_getservbyname=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_getservbyname" >&5
echo "${ECHO_T}$ac_cv_lib_socket_getservbyname" >&6
if test $ac_cv_lib_socket_getservbyname = yes; then
  socket_lib="-lsocket"
else
  socket_lib=""
fi

    echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
echo $ECHO_N "checking for gethostbyaddr in -lnsl... $ECHO_C" >&6
if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "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 ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
gethostbyaddr ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_nsl_gethostbyaddr=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_lib_nsl_gethostbyaddr=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyaddr" >&6
if test $ac_cv_lib_nsl_gethostbyaddr = yes; then
  nsl_lib="-lnsl"
else
  nsl_lib=""
fi

fi
if test "$WANT_THREAD_LIBS" = "1"; then
    echo "$as_me:$LINENO: checking for sigwait in -lthread" >&5
echo $ECHO_N "checking for sigwait in -lthread... $ECHO_C" >&6
if test "${ac_cv_lib_thread_sigwait+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lthread  $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "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 ();
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
sigwait ();
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  ac_cv_lib_thread_sigwait=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_lib_thread_sigwait=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_thread_sigwait" >&5
echo "${ECHO_T}$ac_cv_lib_thread_sigwait" >&6
if test $ac_cv_lib_thread_sigwait = yes; then
  thread_lib="-lthread"
else
  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 $MPI2CPP_LIB $MPI_LIBS $EXTRA_LIBS $LDFLAGS"
BALKY_LDFLAGS="$EXCPTN_LDFLAGS $EXTRA_LDFLAGS $MPI_LDFLAGS -L$INSTALLDIR/lib $MPI2CPP_INSTALLED_LIB $MPI_LIBS $EXTRA_LIBS $LDFLAGS"




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

if test "$MPI_LIBS" != ""; then

#
# Try to link a simple program, see if we can find libmpi.*
#
# Aborts if we cannot -lmpi
#

if test "$TEMPLATE_REP" = ""; then

#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets TEMPLATE_REP to the directory name, or blank
# Does AC_SUBST on TEMPLATE_REP
#

echo "$as_me:$LINENO: checking for template repository directory" >&5
echo $ECHO_N "checking for template repository directory... $ECHO_C" >&6
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.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 > conftest2.C <<EOF
#include "conftest.h"

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

cat > conftest1.C <<EOF
#include "conftest.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

echo configure:4685: $CXX $CXXFLAGS -c conftest1.C >&5
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
if test ! -f conftest1.o ; then
    echo "$as_me:$LINENO: result: templates not supported?" >&5
echo "${ECHO_T}templates not supported?" >&6
    echo configure:4690: here is the program that failed: >&5
    cat conftest1.C >&5
    echo configure:4692: here is conftest.h: >&5
    cat conftest.h >&5
else
    echo configure:4695: $CXX $CXXFLAGS -c conftest2.C >&5
    $CXX $CXXFLAGS -c conftest2.C >&5 2>&5
    if test ! -f conftest2.o ; then
	echo "$as_me:$LINENO: result: unknown error" >&5
echo "${ECHO_T}unknown error" >&6
	echo configure:4700: here is the program that failed: >&5
	cat conftest2.C >&5
	echo configure:4702: here is conftest.h: >&5
	cat conftest.h >&5
    else
	rm -rf conftest*

	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
    fi
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != "" -a "$TEMPLATE_REP" != " "; then
    echo "$as_me:$LINENO: result: $TEMPLATE_REP" >&5
echo "${ECHO_T}$TEMPLATE_REP" >&6
else
    echo "$as_me:$LINENO: result: not used" >&5
echo "${ECHO_T}not used" >&6
fi
cd ..
rm -rf conf_tmp_$$

fi
if test "`echo $MPI_LIBS`" != ""; then
    echo "$as_me:$LINENO: checking for MPI_Initialized in \"$MPI_LIBS\"" >&5
echo $ECHO_N "checking for MPI_Initialized in \"$MPI_LIBS\"... $ECHO_C" >&6
else
    echo "$as_me:$LINENO: checking for MPI_Initialized" >&5
echo $ECHO_N "checking for MPI_Initialized... $ECHO_C" >&6
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
int i; MPI_Initialized(&i);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  libmpi_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
libmpi_found=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
if test "$libmpi_found" = "yes"; then
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    { { echo "$as_me:$LINENO: error: cannot continue -- cannot link to \"$MPI_LIBS\"" >&5
echo "$as_me: error: cannot continue -- cannot link to \"$MPI_LIBS\"" >&2;}
   { (exit 1); exit 1; }; }
fi
rm -rf $TEMPLATE_REP
fi


#
# Override optimization flags, if supplied
#


# Check whether --with-opt or --without-opt was given.
if test "${with_opt+set}" = set; then
  withval="$with_opt"
  withoutopt=$withval
else
  withoutopt=$withval
fi;
if test "$withoutopt" = "no"; then
    OPTFLAGS="$NOOPT"
    TEST_OPTFLAGS="$NOOPT"
    EXAM_OPTFLAGS="$NOOPT"
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;





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


#
# At least one MPI implementation has(had) this problem
# (no names mentioned...)
#
# Sets LSC_HAVE_PENDING to 1 if MPI_PENDING, 0 if MPI_ERR_PENDING
#

if test "$TEMPLATE_REP" = ""; then

#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets TEMPLATE_REP to the directory name, or blank
# Does AC_SUBST on TEMPLATE_REP
#

echo "$as_me:$LINENO: checking for template repository directory" >&5
echo $ECHO_N "checking for template repository directory... $ECHO_C" >&6
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.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 > conftest2.C <<EOF
#include "conftest.h"

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

cat > conftest1.C <<EOF
#include "conftest.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

echo configure:4933: $CXX $CXXFLAGS -c conftest1.C >&5
$CXX $CXXFLAGS -c conftest1.C >&5 2>&5
if test ! -f conftest1.o ; then
    echo "$as_me:$LINENO: result: templates not supported?" >&5
echo "${ECHO_T}templates not supported?" >&6
    echo configure:4938: here is the program that failed: >&5
    cat conftest1.C >&5
    echo configure:4940: here is conftest.h: >&5
    cat conftest.h >&5
else
    echo configure:4943: $CXX $CXXFLAGS -c conftest2.C >&5
    $CXX $CXXFLAGS -c conftest2.C >&5 2>&5
    if test ! -f conftest2.o ; then
	echo "$as_me:$LINENO: result: unknown error" >&5
echo "${ECHO_T}unknown error" >&6
	echo configure:4948: here is the program that failed: >&5
	cat conftest2.C >&5
	echo configure:4950: here is conftest.h: >&5
	cat conftest.h >&5
    else
	rm -rf conftest*

	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
    fi
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != "" -a "$TEMPLATE_REP" != " "; then
    echo "$as_me:$LINENO: result: $TEMPLATE_REP" >&5
echo "${ECHO_T}$TEMPLATE_REP" >&6
else
    echo "$as_me:$LINENO: result: not used" >&5
echo "${ECHO_T}not used" >&6
fi
cd ..
rm -rf conf_tmp_$$

fi
echo "$as_me:$LINENO: checking whether to use MPI(_ERR)_PENDING" >&5
echo $ECHO_N "checking whether to use MPI(_ERR)_PENDING... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
int yow=MPI_PENDING;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  use_pending=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
use_pending=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test "$use_pending" = "yes"; then
    LSC_HAVE_PENDING=1
    echo "$as_me:$LINENO: result: MPI_PENDING" >&5
echo "${ECHO_T}MPI_PENDING" >&6
else
    LSC_HAVE_PENDING=0
    echo "$as_me:$LINENO: result: MPI_ERR_PENDING" >&5
echo "${ECHO_T}MPI_ERR_PENDING" >&6
fi
rm -rf $TEMPLATE_REP
if test "$LSC_HAVE_PENDING" = "1"; then
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_PENDING 1
_ACEOF

else
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_PENDING 0
_ACEOF

fi


#
# Check for MPI_GET_VERSION
#

echo "$as_me:$LINENO: checking for MPI_GET_VERSION" >&5
echo $ECHO_N "checking for MPI_GET_VERSION... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include<mpi.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
int v, s; MPI_Get_version(&v, &s);
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  HAVE_GET_VERSION=1
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
HAVE_GET_VERSION=1
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
cat >>confdefs.h <<_ACEOF
#define MPI2CPP_HAVE_MPI_GET_VERSION $HAVE_GET_VERSION
_ACEOF

if test "$HAVE_GET_VERSION" = "1"; then
    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi


#
# See if we have MPI_STATUS_IGNORE / MPI_STATUSES_IGNORE
#
# Unfortunately, the implementation of STATUS_IGNORE in MPICH is
# broken.  Can't really figure out a good way how to have a generic
# test to see if the underlying MPI has a broken STATUS_IGNORE because
# there are so many different ways to run a different MPI program (and
# it depends on several variables in the users' setup).  So we just
# have to put in a hardwired "if MPICH, don't use MPI_STATUS_IGNORE"
# switch.  This will probably have to be removed in the future.  Ick.
#

if test "$USING_MPICH" = "1"; then
    echo "$as_me:$LINENO: checking for MPI_STATUS_IGNORE" >&5
echo $ECHO_N "checking for MPI_STATUS_IGNORE... $ECHO_C" >&6
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_STATUS_IGNORE 0
_ACEOF

    echo "$as_me:$LINENO: result: yes, but broken" >&5
echo "${ECHO_T}yes, but broken" >&6

    echo "$as_me:$LINENO: checking for MPI_STATUSES_IGNORE" >&5
echo $ECHO_N "checking for MPI_STATUSES_IGNORE... $ECHO_C" >&6
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_STATUSES_IGNORE 0
_ACEOF

    echo "$as_me:$LINENO: result: yes, but broken" >&5
echo "${ECHO_T}yes, but broken" >&6
else
    echo "$as_me:$LINENO: checking for MPI_STATUS_IGNORE" >&5
echo $ECHO_N "checking for MPI_STATUS_IGNORE... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Status *foo = MPI_STATUS_IGNORE;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  HAVE_STATUS_IGNORE=1
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
HAVE_STATUS_IGNORE=0
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
    cat >>confdefs.h <<_ACEOF
#define MPI2CPP_HAVE_STATUS_IGNORE $HAVE_STATUS_IGNORE
_ACEOF

    if test "$HAVE_STATUS_IGNORE" = "1"; then
	echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
    else
	echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    fi
    echo "$as_me:$LINENO: checking for MPI_STATUSES_IGNORE" >&5
echo $ECHO_N "checking for MPI_STATUSES_IGNORE... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Status *foo = MPI_STATUSES_IGNORE;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  HAVE_STATUSES_IGNORE=1
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
HAVE_STATUSES_IGNORE=0
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
    cat >>confdefs.h <<_ACEOF
#define MPI2CPP_HAVE_STATUSES_IGNORE $HAVE_STATUSES_IGNORE
_ACEOF

    if test "$HAVE_STATUSES_IGNORE" = "1"; then
	echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
    else
	echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    fi
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
# AmigaOS /C/install, which installs bootblocks on floppy discs
# 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 "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  # Account for people who put trailing slashes in PATH elements.
case $as_dir/ in
  ./ | .// | /cC/* | \
  /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
      for ac_exec_ext in '' $ac_executable_extensions; do
        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
            :
          elif test $ac_prog = install &&
            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # program-specific install script used by HP pwplus--don't use.
            :
          else
            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
            break 3
          fi
        fi
      done
    done
    ;;
esac
done


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 "$as_me:$LINENO: result: $INSTALL" >&5
echo "${ECHO_T}$INSTALL" >&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}'

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 "$as_me:$LINENO: WARNING: overriding buggy AIX $INSTALL... ./install-sh -c" >&5
echo "$as_me: WARNING: overriding buggy AIX $INSTALL... ./install-sh -c" >&2;}
            INSTALL="./install-sh -c"
        fi

	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_AIX 1
_ACEOF

        ;;

    *aix*)
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_AIX 1
_ACEOF

	;;
esac
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
  echo "$as_me:$LINENO: result: $RANLIB" >&5
echo "${ECHO_T}$RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

fi
if test -z "$ac_cv_prog_RANLIB"; then
  ac_ct_RANLIB=$RANLIB
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$ac_ct_RANLIB"; then
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_ac_ct_RANLIB="ranlib"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

  RANLIB=$ac_ct_RANLIB
else
  RANLIB="$ac_cv_prog_RANLIB"
fi

# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_AR+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_prog_AR="ar"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR=";"
fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
  echo "$as_me:$LINENO: result: $AR" >&5
echo "${ECHO_T}$AR" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

# Extract the first word of "sh", so it can be a program name with args.
set dummy sh; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_BINSH+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
  case $BINSH in
  [\\/]* | ?:[\\/]*)
  ac_cv_path_BINSH="$BINSH" # Let the user override the test with a path.
  ;;
  *)
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for ac_exec_ext in '' $ac_executable_extensions; do
  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    ac_cv_path_BINSH="$as_dir/$ac_word$ac_exec_ext"
    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
    break 2
  fi
done
done

  ;;
esac
fi
BINSH=$ac_cv_path_BINSH

if test -n "$BINSH"; then
  echo "$as_me:$LINENO: result: $BINSH" >&5
echo "${ECHO_T}$BINSH" >&6
else
  echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&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
#


#
# Check to see if the C++ compiler has the bool type.  <sigh>
#
# Defines LSC_HAVE_BOOL to be 1 or 0
# Sets LSC_HAVE_BOOL to be 1 or 0
#

if test "$?CXXFLAGS" = 0; then
    CXXFLAGS=""
fi
echo "$as_me:$LINENO: checking for type bool" >&5
echo $ECHO_N "checking for type bool... $ECHO_C" >&6
rm -f conftest.cc conftest.o
cat > conftest.cc <<EOF
#include <stdio.h>
#include <sys/types.h>

int main(int argc, char* argv) {
  bool foo = (bool) 0;
  printf("so foo is used and the compiler wont complain: %d", (int) foo);
  return 0;
}
EOF
echo configure:5555: $CXX $CXXFLAGS conftest.cc -o conftest >&5
$CXX $CXXFLAGS conftest.cc -o conftest >&5 2>&5
if test -f conftest; then
    LSC_HAVE_BOOL=1
    cat >>confdefs.h <<\_ACEOF
#define LSC_HAVE_BOOL 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    echo configure:5566: here is the program that failed: >&5
    cat conftest.cc >&5
    LSC_HAVE_BOOL=0
    cat >>confdefs.h <<\_ACEOF
#define LSC_HAVE_BOOL 0
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -rf conftest*
if test "$LSC_HAVE_BOOL" = "1"; then
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_BOOL 1
_ACEOF

    BOOL_TYPE="bool"
else
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_HAVE_BOOL 0
_ACEOF

    BOOL_TYPE="unsigned int"
fi
cat >>confdefs.h <<_ACEOF
#define MPI2CPP_BOOL_T $BOOL_TYPE
_ACEOF



#
# 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=


# Don't ask.  It's an AIX thing.  <sob>
#if test "$?host" = "0"; then
#
#fi
# Determine datatype size.
# First arg is type, 2nd (optional) arg is config var to define.
echo "$as_me:$LINENO: checking size of of int" >&5
echo $ECHO_N "checking size of of int... $ECHO_C" >&6
cat > conftest.C <<EOF
#include <stdio.h>
#ifdef _ALL_SOURCE
#undef _ALL_SOURCE
#endif
#include "confdefs.h"

int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(int));
    return 0;
}
EOF
# AIX really, really sucks.  If you use the mpCC compiler (wrapper to
# the underlying C++ compiler), it expects that your program is
# parallel, so trying to run it with "./foo" won't work.  Hence, we
# have to switch compilers here.
REALCXX="$CXX"
if test "`basename $CXX`" = "mpCC"; then
    case "$host" in
    *aix*)
	REALCXX="xlC"
	;;
    esac
fi
$REALCXX $CXXFLAGS -o conftest conftest.C 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    mpi2cpp_ac_size=`cat conftestval`
else
    mpi2cpp_ac_size=0
fi
echo "$as_me:$LINENO: result: $mpi2cpp_ac_size" >&5
echo "${ECHO_T}$mpi2cpp_ac_size" >&6
if test -n "MPI2CPP_SIZEOF_INT"; then
    cat >>confdefs.h <<_ACEOF
#define MPI2CPP_SIZEOF_INT $mpi2cpp_ac_size
_ACEOF

fi
/bin/rm -f conftest*

# Don't ask.  It's an AIX thing.  <sob>
#if test "$?host" = "0"; then
#
#fi
# Determine datatype size.
# First arg is type, 2nd (optional) arg is config var to define.
echo "$as_me:$LINENO: checking size of of MPI2CPP_BOOL_T" >&5
echo $ECHO_N "checking size of of MPI2CPP_BOOL_T... $ECHO_C" >&6
cat > conftest.C <<EOF
#include <stdio.h>
#ifdef _ALL_SOURCE
#undef _ALL_SOURCE
#endif
#include "confdefs.h"

int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(MPI2CPP_BOOL_T));
    return 0;
}
EOF
# AIX really, really sucks.  If you use the mpCC compiler (wrapper to
# the underlying C++ compiler), it expects that your program is
# parallel, so trying to run it with "./foo" won't work.  Hence, we
# have to switch compilers here.
REALCXX="$CXX"
if test "`basename $CXX`" = "mpCC"; then
    case "$host" in
    *aix*)
	REALCXX="xlC"
	;;
    esac
fi
$REALCXX $CXXFLAGS -o conftest conftest.C 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    mpi2cpp_ac_size=`cat conftestval`
else
    mpi2cpp_ac_size=0
fi
echo "$as_me:$LINENO: result: $mpi2cpp_ac_size" >&5
echo "${ECHO_T}$mpi2cpp_ac_size" >&6
if test -n "SIZEOF_MPI2CPP_BOOL_T"; then
    cat >>confdefs.h <<_ACEOF
#define SIZEOF_MPI2CPP_BOOL_T $mpi2cpp_ac_size
_ACEOF

fi
/bin/rm -f conftest*

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 "$as_me:$LINENO: checking type of MPI attributes" >&5
echo $ECHO_N "checking type of MPI attributes... $ECHO_C" >&6
if test "$cross_compiling" = yes; then
  sizeof_same=no
else
  cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
int main()
{
  if (sizeof(int) != sizeof(int *))
    return -1;
  return 0;
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  (eval $ac_link) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  sizeof_same=yes
else
  echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
( exit $ac_status )
sizeof_same=no
fi
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$sizeof_same" = "yes"; then
    ATTR_TYPE="int"
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_ATTR int
_ACEOF

else
    ATTR_TYPE="long"
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_ATTR long
_ACEOF

fi
echo "$as_me:$LINENO: result: $ATTR_TYPE" >&5
echo "${ECHO_T}$ATTR_TYPE" >&6


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

echo "$as_me:$LINENO: checking for signal declaration" >&5
echo $ECHO_N "checking for signal declaration... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include<signal.h>
extern "C" void bsd_handler(int sig, int code, struct sigcontext *scp, char *addr);

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
signal(1, bsd_handler);
  struct sigaction n;
  n.sa_handler= bsd_handler;

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  bsd_signal="yes"
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
bsd_signal="no"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test "$bsd_signal" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_BSD_SIGNAL 1
_ACEOF

    echo "$as_me:$LINENO: result: BSD" >&5
echo "${ECHO_T}BSD" >&6
else
#
# Sanity check.  Make sure that it is SYSV
#

cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include<signal.h>
extern "C" void sysv_handler(int sig) {};

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
signal(1, sysv_handler);

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  sysv_signal="yes"
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
sysv_signal="no"
fi
rm -f conftest.$ac_objext conftest.$ac_ext
    if test "$sysv_signal" = "yes"; then
        cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SYSV_SIGNAL 1
_ACEOF

        echo "$as_me:$LINENO: result: SYSV" >&5
echo "${ECHO_T}SYSV" >&6
    else
        echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6
        { { echo "$as_me:$LINENO: error: cannot determine if signals are bsd/sysv" >&5
echo "$as_me: error: cannot determine if signals are bsd/sysv" >&2;}
   { (exit 1); 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 "$as_me:$LINENO: checking for namespace support" >&5
echo $ECHO_N "checking for namespace support... $ECHO_C" >&6
if test "$FORCE_NAMESPACE" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USENAMESPACE_ 1
_ACEOF

    echo "$as_me:$LINENO: result: yes (forced)" >&5
echo "${ECHO_T}yes (forced)" >&6
elif test "$FORCE_NAMESPACE" = "no"; then
    cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USENAMESPACE_ 0
_ACEOF

    echo "$as_me:$LINENO: result: no (forced)" >&5
echo "${ECHO_T}no (forced)" >&6
else
    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
void blah();
namespace N {
  extern const int global;
  class foo {
    //g++ does not like :: operator for global scope
    // but I think I can work around this
    //    friend void ::blah();
  public:
    static int foobar();
  };
  // Sun CC 5.0 has problem with overloaded static namespace functions
  static inline int foofoo();
  static inline int foofoo(int yow, double baz);
}

//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; }
inline int N::foofoo() { return 0; }
inline int N::foofoo(int, double) { return 0; }
void blah() { }

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{

  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  namespace_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
namespace_found=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
    if test "$namespace_found" = "yes"; then
	cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USENAMESPACE_ 1
_ACEOF

	echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
    else
	cat >>confdefs.h <<\_ACEOF
#define _MPIPP_USENAMESPACE_ 0
_ACEOF

	echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
    fi
fi

#
# Test to see if the no namespace workaround will work.  If not (broken g++
# version 2.7.2 and others), exit so that the user won't waste time
if test "$namespace_found" = "no" ; then
    echo "$as_me:$LINENO: checking that workaround for missing namespace works" >&5
echo $ECHO_N "checking that workaround for missing namespace works... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"

class PMPI {
    public:
    class Comm;
   class Comm {
       public:
       typedef void Efn( Comm& );
   };
};
class MPI {
    public:
    class Comm;
    class Comm {
       public:
       typedef void Efn( Comm& );
    };
};
#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
int a=0;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
{ { echo "$as_me:$LINENO: error: C++ interface requires working namespace or nested classes" >&5
echo "$as_me: error: C++ interface requires working namespace or nested classes" >&2;}
   { (exit 1); exit 1; }; }

fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi

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

echo "$as_me:$LINENO: checking for FORTRAN constants" >&5
echo $ECHO_N "checking for FORTRAN constants... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Datatype a = MPI_INTEGER;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  fortran_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
fortran_found=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test "$fortran_found" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_FORTRAN 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
    echo "$as_me:$LINENO: checking for optional FORTRAN constants" >&5
echo $ECHO_N "checking for optional FORTRAN constants... $ECHO_C" >&6
    cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Datatype b = MPI_8REAL;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  all_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
all_found=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
    if test "$all_found" = "yes"; then
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_ALL_OPTIONAL_FORTRAN 1
_ACEOF

	echo "$as_me:$LINENO: result: all" >&5
echo "${ECHO_T}all" >&6
    else
	cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_ALL_OPTIONAL_FORTRAN 0
_ACEOF

	cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Datatype c = MPI_2REAL;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  some_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
some_found=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
	if test "$some_found" = "yes"; then
	    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SOME_OPTIONAL_FORTRAN 1
_ACEOF

	    echo "$as_me:$LINENO: result: some" >&5
echo "${ECHO_T}some" >&6
	else
	    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_SOME_OPTIONAL_FORTRAN 0
_ACEOF

	    echo "$as_me:$LINENO: result: none" >&5
echo "${ECHO_T}none" >&6
	fi
    fi
else
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_FORTRAN 0
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi

#
# Check for optional C stuff.
#

echo "$as_me:$LINENO: checking for optional C constants" >&5
echo $ECHO_N "checking for optional C constants... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <mpi.h>

#ifdef F77_DUMMY_MAIN
#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
MPI_Datatype d = MPI_UNSIGNED_LONG_LONG; MPI_Datatype e = MPI_LONG_LONG;
  ;
  return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  (eval $ac_compile) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); } &&
         { ac_try='test -s conftest.$ac_objext'
  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  (eval $ac_try) 2>&5
  ac_status=$?
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  (exit $ac_status); }; }; then
  c_found=yes
else
  echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
c_found=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
if test "$c_found" = "yes"; then
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_OPTIONAL_C 1
_ACEOF

    echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
    cat >>confdefs.h <<\_ACEOF
#define MPI2CPP_OPTIONAL_C 0
_ACEOF

    echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
CXXFLAGS=$CXXFLAGS_SAVE

#
# Substitute them in...
#
















#
# Party on
#

ac_config_files="$ac_config_files Makefile src/Makefile src/mpi2c++/Makefile contrib/Makefile balky/Makefile balky/balky balky/mini-balky"
ac_config_commands="$ac_config_commands default"


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

# VPATH may cause trouble with some makes, so we remove $(srcdir),
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
s/^\([^=]*=[ 	]*\):*/\1/;
s/:*$//;
s/^[^=]*=[ 	]*$//;
}'
fi

DEFS=-DHAVE_CONFIG_H


: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
echo "$as_me: creating $CONFIG_STATUS" >&6;}
cat >$CONFIG_STATUS <<_ACEOF
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.

debug=false
SHELL=\${CONFIG_SHELL-$SHELL}
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF

## --------------------- ##
## M4sh Initialization.  ##
## --------------------- ##

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  set -o posix
fi

# NLS nuisances.
# Support unset when possible.
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
  as_unset=unset
else
  as_unset=false
fi

(set +x; test -n "`(LANG=C; export LANG) 2>&1`") &&
    { $as_unset LANG || test "${LANG+set}" != set; } ||
      { LANG=C; export LANG; }
(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") &&
    { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } ||
      { LC_ALL=C; export LC_ALL; }
(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") &&
    { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } ||
      { LC_TIME=C; export LC_TIME; }
(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") &&
    { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } ||
      { LC_CTYPE=C; export LC_CTYPE; }
(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") &&
    { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } ||
      { LANGUAGE=C; export LANGUAGE; }
(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") &&
    { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } ||
      { LC_COLLATE=C; export LC_COLLATE; }
(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") &&
    { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } ||
      { LC_NUMERIC=C; export LC_NUMERIC; }
(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") &&
    { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } ||
      { LC_MESSAGES=C; export LC_MESSAGES; }


# Name of the executable.
as_me=`(basename "$0") 2>/dev/null ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)$' \| \
	 .     : '\(.\)' 2>/dev/null ||
echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  	  /^X\/\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`

# PATH needs CR, and LINENO needs CR and PATH.
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! /bin/sh" >conftest.sh
  echo  "exit 0"   >>conftest.sh
  chmod +x conftest.sh
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conftest.sh
fi


  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  # Find who we are.  Look in the path if we contain no path at all
  # relative or not.
  case $0 in
    *[\\/]* ) as_myself=$0 ;;
    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done

       ;;
  esac
  # We did not find ourselves, most probably we were run as `sh COMMAND'
  # in which case we are not to be found in the path.
  if test "x$as_myself" = x; then
    as_myself=$0
  fi
  if test ! -f "$as_myself"; then
    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
   { (exit 1); exit 1; }; }
  fi
  case $CONFIG_SHELL in
  '')
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  for as_base in sh bash ksh sh5; do
	 case $as_dir in
	 /*)
	   if ("$as_dir/$as_base" -c '
  as_lineno_1=$LINENO
  as_lineno_2=$LINENO
  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  test "x$as_lineno_1" != "x$as_lineno_2" &&
  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
	     CONFIG_SHELL=$as_dir/$as_base
	     export CONFIG_SHELL
	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
	   fi;;
	 esac
       done
done
;;
  esac

  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  # uniformly replaced by the line number.  The first 'sed' inserts a
  # line-number line before each line; the second 'sed' does the real
  # work.  The second script uses 'N' to pair each line-number line
  # with the numbered line, and appends trailing '-' during
  # substitution so that $LINENO is not a special case at line end.
  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  sed '=' <$as_myself |
    sed '
      N
      s,$,-,
      : loop
      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
      t loop
      s,-$,,
      s,^['$as_cr_digits']*\n,,
    ' >$as_me.lineno &&
  chmod +x $as_me.lineno ||
    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
   { (exit 1); exit 1; }; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensible to this).
  . ./$as_me.lineno
  # Exit status is that of the last command.
  exit
}


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  *c*,-n*) ECHO_N= ECHO_C='
' ECHO_T='	' ;;
  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac

if expr a : '\(a\)' >/dev/null 2>&1; then
  as_expr=expr
else
  as_expr=false
fi

rm -f conf$$ conf$$.exe conf$$.file
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
  # We could just check for DJGPP; but this test a) works b) is more generic
  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  if test -f conf$$.exe; then
    # Don't use ln at all; we don't have any links
    as_ln_s='cp -p'
  else
    as_ln_s='ln -s'
  fi
elif ln conf$$.file conf$$ 2>/dev/null; then
  as_ln_s=ln
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.file

as_executable_p="test -f"

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"


# IFS
# We need space, tab and new line, in precisely that order.
as_nl='
'
IFS=" 	$as_nl"

# CDPATH.
$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; }

exec 6>&1

# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.  Logging --version etc. is OK.
exec 5>>config.log
{
  echo
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
} >&5
cat >&5 <<_CSEOF

This file was extended by $as_me, which was
generated by GNU Autoconf 2.53.  Invocation command line was

  CONFIG_FILES    = $CONFIG_FILES
  CONFIG_HEADERS  = $CONFIG_HEADERS
  CONFIG_LINKS    = $CONFIG_LINKS
  CONFIG_COMMANDS = $CONFIG_COMMANDS
  $ $0 $@

_CSEOF
echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
echo >&5
_ACEOF

# Files that config.status was made for.
if test -n "$ac_config_files"; then
  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_headers"; then
  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_links"; then
  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
fi

if test -n "$ac_config_commands"; then
  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
fi

cat >>$CONFIG_STATUS <<\_ACEOF

ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.

Usage: $0 [OPTIONS] [FILE]...

  -h, --help       print this help, then exit
  -V, --version    print version number, then exit
  -d, --debug      don't remove temporary files
      --recheck    update $as_me by reconfiguring in the same conditions
  --file=FILE[:TEMPLATE]
                   instantiate the configuration file FILE
  --header=FILE[:TEMPLATE]
                   instantiate the configuration header FILE

Configuration files:
$config_files

Configuration headers:
$config_headers

Configuration commands:
$config_commands

Report bugs to <bug-autoconf@gnu.org>."
_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
configured by $0, generated by GNU Autoconf 2.53,
  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
INSTALL="$INSTALL"
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF
# If no file are specified by the user, then we need to provide default
# value.  By we need to know if files were specified by the user.
ac_need_defaults=:
while test $# != 0
do
  case $1 in
  --*=*)
    ac_option=`expr "x$1" : 'x\([^=]*\)='`
    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
    shift
    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
    shift
    ;;
  -*);;
  *) # This is not an option, so the user has probably given explicit
     # arguments.
     ac_need_defaults=false;;
  esac

  case $1 in
  # Handling of the options.
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
  --version | --vers* | -V )
    echo "$ac_cs_version"; exit 0 ;;
  --he | --h)
    # Conflict between --help and --header
    { { echo "$as_me:$LINENO: error: ambiguous option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: ambiguous option: $1
Try \`$0 --help' for more information." >&2;}
   { (exit 1); exit 1; }; };;
  --help | --hel | -h )
    echo "$ac_cs_usage"; exit 0 ;;
  --debug | --d* | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    shift
    CONFIG_FILES="$CONFIG_FILES $1"
    ac_need_defaults=false;;
  --header | --heade | --head | --hea )
    shift
    CONFIG_HEADERS="$CONFIG_HEADERS $1"
    ac_need_defaults=false;;

  # This is an error.
  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
Try \`$0 --help' for more information." >&5
echo "$as_me: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2;}
   { (exit 1); exit 1; }; } ;;

  *) ac_config_targets="$ac_config_targets $1" ;;

  esac
  shift
done

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF
#
# INIT-COMMANDS section.
#



_ACEOF



cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
  case "$ac_config_target" in
  # Handling of arguments.
  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
  "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
  "src/mpi2c++/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mpi2c++/Makefile" ;;
  "contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
  "balky/Makefile" ) CONFIG_FILES="$CONFIG_FILES balky/Makefile" ;;
  "balky/balky" ) CONFIG_FILES="$CONFIG_FILES balky/balky" ;;
  "balky/mini-balky" ) CONFIG_FILES="$CONFIG_FILES balky/mini-balky" ;;
  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
  "src/mpi2c++/mpi2c++_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/mpi2c++/mpi2c++_config.h" ;;
  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
   { (exit 1); exit 1; }; };;
  esac
done

# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used.  Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi

# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  trap '{ (exit 1); exit 1; }' 1 2 13 15
}

# Create a (secure) tmp directory for tmp files.
: ${TMPDIR=/tmp}
{
  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
  test -n "$tmp" && test -d "$tmp"
}  ||
{
  tmp=$TMPDIR/cs$$-$RANDOM
  (umask 077 && mkdir $tmp)
} ||
{
   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
   { (exit 1); exit 1; }
}

_ACEOF

cat >>$CONFIG_STATUS <<_ACEOF

#
# CONFIG_FILES section.
#

# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
if test -n "\$CONFIG_FILES"; then
  # Protect against being on the right side of a sed subst in config.status.
  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
s,@SHELL@,$SHELL,;t t
s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
s,@exec_prefix@,$exec_prefix,;t t
s,@prefix@,$prefix,;t t
s,@program_transform_name@,$program_transform_name,;t t
s,@bindir@,$bindir,;t t
s,@sbindir@,$sbindir,;t t
s,@libexecdir@,$libexecdir,;t t
s,@datadir@,$datadir,;t t
s,@sysconfdir@,$sysconfdir,;t t
s,@sharedstatedir@,$sharedstatedir,;t t
s,@localstatedir@,$localstatedir,;t t
s,@libdir@,$libdir,;t t
s,@includedir@,$includedir,;t t
s,@oldincludedir@,$oldincludedir,;t t
s,@infodir@,$infodir,;t t
s,@mandir@,$mandir,;t t
s,@build_alias@,$build_alias,;t t
s,@host_alias@,$host_alias,;t t
s,@target_alias@,$target_alias,;t t
s,@DEFS@,$DEFS,;t t
s,@ECHO_C@,$ECHO_C,;t t
s,@ECHO_N@,$ECHO_N,;t t
s,@ECHO_T@,$ECHO_T,;t t
s,@LIBS@,$LIBS,;t t
s,@VERSION@,$VERSION,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@PACKAGE@,$PACKAGE,;t t
s,@ACLOCAL@,$ACLOCAL,;t t
s,@AUTOCONF@,$AUTOCONF,;t t
s,@AUTOMAKE@,$AUTOMAKE,;t t
s,@AUTOHEADER@,$AUTOHEADER,;t t
s,@MAKEINFO@,$MAKEINFO,;t t
s,@SET_MAKE@,$SET_MAKE,;t t
s,@GREP@,$GREP,;t t
s,@build@,$build,;t t
s,@build_cpu@,$build_cpu,;t t
s,@build_vendor@,$build_vendor,;t t
s,@build_os@,$build_os,;t t
s,@host@,$host,;t t
s,@host_cpu@,$host_cpu,;t t
s,@host_vendor@,$host_vendor,;t t
s,@host_os@,$host_os,;t t
s,@AWK@,$AWK,;t t
s,@WC@,$WC,;t t
s,@MPI_CXX@,$MPI_CXX,;t t
s,@WANT_PROFILE@,$WANT_PROFILE,;t t
s,@MPI2CPP_LIBRARY@,$MPI2CPP_LIBRARY,;t t
s,@WANT_PROFILING_TRUE@,$WANT_PROFILING_TRUE,;t t
s,@WANT_PROFILING_FALSE@,$WANT_PROFILING_FALSE,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@ac_ct_CXX@,$ac_ct_CXX,;t t
s,@EXEEXT@,$EXEEXT,;t t
s,@OBJEXT@,$OBJEXT,;t t
s,@CXXCPP@,$CXXCPP,;t t
s,@LN_S@,$LN_S,;t t
s,@BALKY_CXX@,$BALKY_CXX,;t t
s,@TEMPLATE_REP@,$TEMPLATE_REP,;t t
s,@CLEANFILES@,$CLEANFILES,;t t
s,@LSC_EXCEPTION_CXXFLAGS@,$LSC_EXCEPTION_CXXFLAGS,;t t
s,@LSC_EXCEPTION_LDFLAGS@,$LSC_EXCEPTION_LDFLAGS,;t t
s,@MINI_BALKY_CXXFLAGS@,$MINI_BALKY_CXXFLAGS,;t t
s,@BALKY_CXXFLAGS@,$BALKY_CXXFLAGS,;t t
s,@DEPFLAGS@,$DEPFLAGS,;t t
s,@MINI_BALKY_LDFLAGS@,$MINI_BALKY_LDFLAGS,;t t
s,@BALKY_LDFLAGS@,$BALKY_LDFLAGS,;t t
s,@OPTFLAGS@,$OPTFLAGS,;t t
s,@TEST_OPTFLAGS@,$TEST_OPTFLAGS,;t t
s,@EXAM_OPTFLAGS@,$EXAM_OPTFLAGS,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@AR@,$AR,;t t
s,@BINSH@,$BINSH,;t t
s,@MPILIB_DIR@,$MPILIB_DIR,;t t
s,@INSTALL@,$INSTALL,;t t
s,@TOPDIR@,$TOPDIR,;t t
s,@INSTALLDIR@,$INSTALLDIR,;t t
s,@IV_DESTRUCTORS@,$IV_DESTRUCTORS,;t t
CEOF

_ACEOF

  cat >>$CONFIG_STATUS <<\_ACEOF
  # 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_lines=48
  ac_sed_frag=1 # Number of current file.
  ac_beg=1 # First line for current file.
  ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag
    else
      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
    fi
    if test ! -s $tmp/subs.frag; then
      ac_more_lines=false
    else
      # The purpose of the label and of the branching condition is to
      # speed up the sed processing (if there are no `@' at all, there
      # is no need to browse any of the substitutions).
      # These are the two extra sed commands mentioned above.
      (echo ':t
  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
      if test -z "$ac_sed_cmds"; then
  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
      else
  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
      fi
      ac_sed_frag=`expr $ac_sed_frag + 1`
      ac_beg=$ac_end
      ac_end=`expr $ac_end + $ac_max_sed_lines`
    fi
  done
  if test -z "$ac_sed_cmds"; then
    ac_sed_cmds=cat
  fi
fi # test -n "$CONFIG_FILES"

_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case $ac_file in
  - | *:- | *:-:* ) # input from stdin
        cat >$tmp/stdin
        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  * )   ac_file_in=$ac_file.in ;;
  esac

  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$ac_file" : 'X\(//\)[^/]' \| \
         X"$ac_file" : 'X\(//\)$' \| \
         X"$ac_file" : 'X\(/\)' \| \
         .     : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
  { case "$ac_dir" in
  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
  *)                      as_incr_dir=.;;
esac
as_dummy="$ac_dir"
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
  case $as_mkdir_dir in
    # Skip DOS drivespec
    ?:) as_incr_dir=$as_mkdir_dir ;;
    *)
      as_incr_dir=$as_incr_dir/$as_mkdir_dir
      test -d "$as_incr_dir" ||
        mkdir "$as_incr_dir" ||
	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }
    ;;
  esac
done; }

  ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
# absolute.
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`


  case $INSTALL in
  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
  esac

  if test x"$ac_file" != x-; then
    { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}
    rm -f "$ac_file"
  fi
  # Let's still pretend it is `configure' which instantiates (i.e., don't
  # use $as_me), people would be surprised to read:
  #    /* config.h.  Generated by config.status.  */
  if test x"$ac_file" = x-; then
    configure_input=
  else
    configure_input="$ac_file.  "
  fi
  configure_input=$configure_input"Generated from `echo $ac_file_in |
                                     sed 's,.*/,,'` by configure."

  # First look for the input files in the build tree, otherwise in the
  # src tree.
  ac_file_inputs=`IFS=:
    for f in $ac_file_in; do
      case $f in
      -) echo $tmp/stdin ;;
      [\\/$]*)
         # Absolute (can't be DOS-style, as IFS=:)
         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
         echo $f;;
      *) # Relative
         if test -f "$f"; then
           # Build tree
           echo $f
         elif test -f "$srcdir/$f"; then
           # Source tree
           echo $srcdir/$f
         else
           # /dev/null tree
           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
         fi;;
      esac
    done` || { (exit 1); exit 1; }
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
  sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s,@configure_input@,$configure_input,;t t
s,@srcdir@,$ac_srcdir,;t t
s,@abs_srcdir@,$ac_abs_srcdir,;t t
s,@top_srcdir@,$ac_top_srcdir,;t t
s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
s,@builddir@,$ac_builddir,;t t
s,@abs_builddir@,$ac_abs_builddir,;t t
s,@top_builddir@,$ac_top_builddir,;t t
s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
s,@INSTALL@,$ac_INSTALL,;t t
" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
  rm -f $tmp/stdin
  if test x"$ac_file" != x-; then
    mv $tmp/out $ac_file
  else
    cat $tmp/out
    rm -f $tmp/out
  fi

done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF

#
# CONFIG_HEADER section.
#

# 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=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'

for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case $ac_file in
  - | *:- | *:-:* ) # input from stdin
        cat >$tmp/stdin
        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  * )   ac_file_in=$ac_file.in ;;
  esac

  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
echo "$as_me: creating $ac_file" >&6;}

  # First look for the input files in the build tree, otherwise in the
  # src tree.
  ac_file_inputs=`IFS=:
    for f in $ac_file_in; do
      case $f in
      -) echo $tmp/stdin ;;
      [\\/$]*)
         # Absolute (can't be DOS-style, as IFS=:)
         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
         echo $f;;
      *) # Relative
         if test -f "$f"; then
           # Build tree
           echo $f
         elif test -f "$srcdir/$f"; then
           # Source tree
           echo $srcdir/$f
         else
           # /dev/null tree
           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
   { (exit 1); exit 1; }; }
         fi;;
      esac
    done` || { (exit 1); exit 1; }
  # Remove the trailing spaces.
  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in

_ACEOF

# Transform confdefs.h into two sed scripts, `conftest.defines' and
# `conftest.undefs', that substitutes the proper values into
# config.h.in to produce config.h.  The first handles `#define'
# templates, and the second `#undef' templates.
# 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.defines conftest.undefs
# Using a here document instead of a string reduces the quoting nightmare.
# Putting comments in sed scripts is not portable.
#
# `end' is used to avoid that the second main sed command (meant for
# 0-ary CPP macros) applies to n-ary macro definitions.
# See the Autoconf documentation for `clear'.
cat >confdef2sed.sed <<\_ACEOF
s/[\\&,]/\\&/g
s,[\\$`],\\&,g
t clear
: clear
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
_ACEOF
# If some macros were called several times there might be several times
# the same #defines, which is useless.  Nevertheless, we may not want to
# sort them, since we want the *last* AC-DEFINE to be honored.
uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
rm -f confdef2sed.sed

# 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.undefs <<\_ACEOF
s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
_ACEOF

# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
echo '  if egrep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo '  :' >>$CONFIG_STATUS
rm -f conftest.tail
while grep . conftest.defines >/dev/null
do
  # Write a limited-size here document to $tmp/defines.sed.
  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
  # Speed up: don't consider the non `#define' lines.
  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
  # Work around the forget-to-reset-the-flag bug.
  echo 't clr' >>$CONFIG_STATUS
  echo ': clr' >>$CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
  echo 'CEOF
  sed -f $tmp/defines.sed $tmp/in >$tmp/out
  rm -f $tmp/in
  mv $tmp/out $tmp/in
' >>$CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
  rm -f conftest.defines
  mv conftest.tail conftest.defines
done
rm -f conftest.defines
echo '  fi # egrep' >>$CONFIG_STATUS
echo >>$CONFIG_STATUS

# Break up conftest.undefs because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
while grep . conftest.undefs >/dev/null
do
  # Write a limited-size here document to $tmp/undefs.sed.
  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
  # Speed up: don't consider the non `#undef'
  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
  # Work around the forget-to-reset-the-flag bug.
  echo 't clr' >>$CONFIG_STATUS
  echo ': clr' >>$CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
  echo 'CEOF
  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
  rm -f $tmp/in
  mv $tmp/out $tmp/in
' >>$CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
  rm -f conftest.undefs
  mv conftest.tail conftest.undefs
done
rm -f conftest.undefs

cat >>$CONFIG_STATUS <<\_ACEOF
  # Let's still pretend it is `configure' which instantiates (i.e., don't
  # use $as_me), people would be surprised to read:
  #    /* config.h.  Generated by config.status.  */
  if test x"$ac_file" = x-; then
    echo "/* Generated by configure.  */" >$tmp/config.h
  else
    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
  fi
  cat $tmp/in >>$tmp/config.h
  rm -f $tmp/in
  if test x"$ac_file" != x-; then
    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
    else
      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$ac_file" : 'X\(//\)[^/]' \| \
         X"$ac_file" : 'X\(//\)$' \| \
         X"$ac_file" : 'X\(/\)' \| \
         .     : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
      { case "$ac_dir" in
  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
  *)                      as_incr_dir=.;;
esac
as_dummy="$ac_dir"
for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
  case $as_mkdir_dir in
    # Skip DOS drivespec
    ?:) as_incr_dir=$as_mkdir_dir ;;
    *)
      as_incr_dir=$as_incr_dir/$as_mkdir_dir
      test -d "$as_incr_dir" ||
        mkdir "$as_incr_dir" ||
	{ { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5
echo "$as_me: error: cannot create \"$ac_dir\"" >&2;}
   { (exit 1); exit 1; }; }
    ;;
  esac
done; }

      rm -f $ac_file
      mv $tmp/config.h $ac_file
    fi
  else
    cat $tmp/config.h
    rm -f $tmp/config.h
  fi
done
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF

#
# CONFIG_COMMANDS section.
#
for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$ac_dest" : 'X\(//\)[^/]' \| \
         X"$ac_dest" : 'X\(//\)$' \| \
         X"$ac_dest" : 'X\(/\)' \| \
         .     : '\(.\)' 2>/dev/null ||
echo X"$ac_dest" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  	  /^X\(\/\/\)$/{ s//\1/; q; }
  	  /^X\(\/\).*/{ s//\1/; q; }
  	  s/.*/./; q'`
  ac_builddir=.

if test "$ac_dir" != .; then
  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  # A "../" for each directory in $ac_dir_suffix.
  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
else
  ac_dir_suffix= ac_top_builddir=
fi

case $srcdir in
  .)  # No --srcdir option.  We are building in place.
    ac_srcdir=.
    if test -z "$ac_top_builddir"; then
       ac_top_srcdir=.
    else
       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
    fi ;;
  [\\/]* | ?:[\\/]* )  # Absolute path.
    ac_srcdir=$srcdir$ac_dir_suffix;
    ac_top_srcdir=$srcdir ;;
  *) # Relative path.
    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
    ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
# absolute.
ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd`
ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`


  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
echo "$as_me: executing $ac_dest commands" >&6;}
  case $ac_dest in
    default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > src/mpi2c++/stamp-h ;;
    default ) chmod +x balky/balky balky/mini-balky ;;
  esac
done
_ACEOF

cat >>$CONFIG_STATUS <<\_ACEOF

{ (exit 0); exit 0; }
_ACEOF
chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save


# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded.  So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status.  When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
  ac_cs_success=:
  exec 5>/dev/null
  $SHELL $CONFIG_STATUS || ac_cs_success=false
  exec 5>>config.log
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  # would make configure fail if this is the last instruction.
  $ac_cs_success || { (exit 1); exit 1; }
fi

