#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

progname="`echo $0 | sed 's:^\./\./:\./:'`"
print_error() {
    echo "*# $*" 2>&1 ;
    }
print_usage() {
cat <<.
Usage: ${progname} [-arch=ARCH_TYPE]
                   [-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
		   [-basecc=C_COMPILER] [-basefc=FORTRAN_COMPILER]
                   [-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
                   [-nof77] [-opt=OPTFLAGS]
                   [-f77_extra_flag=F77_EXTRA_FLAG] 
	           [-make=MAKEPGM]
		   [-device=DEVICE]
                   [-cflags=CFLAGS] [-fflags=FFLAGS]
                   [-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
                   [-lib=LIBRARY] [-mpilibname=MPINAME]
		   [-mpichpath=path] [--with-mpich=path]
                   [-cross] [-mpi2]
where
   ARCH_TYPE    = the type of machine that MPI is to be configured for
   OPTFLAGS     = optimization flags to give the compilers (e.g. -g)
   CFLAGS       = flags to give C compiler
   FFLAGS       = flags to give Fortran compiler
   MAKEPGM      = version of make to use

One and only one 'arch' argument should be provided.

You can select a different C and Fortran compiler by using the '-cc' and 'fc'
switches.  The environment variables 'CC' and 'FC' can also provide values for
these but their settings may be overridden by the configure script.  Using
'-cc=\$CC -fc=\$FC' will force configure to use those compilers.
These should be the compilers that you use for MPI programs.

If '-cross' is given, configure assumes that you are cross-compiling.  If it
is not given, configure expects to be able to run programs.  Even if '-cross'
is not selected, configure will try to determine if you are cross-compiling;
this switch is needed only on systems where attempting to run a cross-compiled
program causes the configure script to hang.

The option '-nof77' prevents the compilation of routines that require a
Fortran compiler.  If this option is selected, some tests will not be 
available.

The option '-opt' allows you to specify options for the compilers (both C and
Fortran).  For example, '-opt=-O' chooses optimized code generation on many
systems.  '-optcc' and '-optf77' allow you to specify options for just the C
or Fortran compilers

The option '-f77_extra_flag' is the option Fortran code needs to compile, but 
cannot link with this option.  This is needed currently for the Absoft compiler
(-f option), but it could be used for other cases as well.

The option '-make' may be used to select an alternate make program.  For
example, on FreeBSD systems, -make=gnumake may be required because of bugs in
the system make.

The option '-mpi2' enables testing of some MPI 2 functions.  Currently, only a
few simple functions are tested.

The option '-with-mpich=bindir' sets both the directory to look for compiler
and mpirun commands in and specifies that MPICH is the version of MPI being
tested.

Sample Configure Usage:

To make for an MPI with the MPI compile commands in your path:

  ./configure -cc=mpicc -fc=mpif77
  make

To test an installed MPICH configuration (installed into /usr/local/mpich for
architecture solaris and device ch_p4), use

  ./configure -mpichpath=/usr/local/mpich/build/solaris/ch_p4/bin -mpi2
  make
.
}
#
ARCH=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
NOF77=0
enable_coverage=no
HAS_CXX=no
F77_EXTRA_FLAG=""
HAS_FORTRAN=1
MPILIBNAME=
CFLAGS=""
NOSHORTLONGS=no
NO_LONG_LONG=no
NO_LONG_DOUBLE=no
#
# --enable-boot causes the runtest to start and stop any mpirun demons
USE_BOOT=no
#
# Change MPIFDEP to make Fortran builds depend on an mpif link.
MPIFDEP=""
#
# By not setting FFLAGS, we get the values from the environment
MAKE=${MAKE:-"make"}
PREFIX=""
DEVICE=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
HAS_MPI2=0
IO=""
# Some autoconf tests check for cross_compiling being empty, rather than
# having a value of 0 or 1 (or no or yes).
cross_compiling=""
# 
BASECC=0
BASEF77=0
#
#
MPIINCDIR=
#
# This next variable is a version without quotes.
# We could also consider `echo $a | sed -e 's/"/\\"/g'`
CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
if test -n "$CONFIGURE_ARGS" ; then 
    echo "Configuring with args $CONFIGURE_ARGS"
fi
#
for arg
do
  # Handle --exec-prefix with a space before the argument.
  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  # Handle --prefix with a space before the argument.
  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  # Handle --srcdir with a space before the argument.
  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  else
    case $arg in
     # For backward compatibility, also recognize exact --exec_prefix.
     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
	next_exec_prefix=yes ;;

     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
	PREFIX=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
	next_prefix=yes ;;

     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
	srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
	next_srcdir=yes ;;

     -arch=* | --arch=*)
       package=`echo $arg|sed 's/-*arch=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid architecture name"; exit 1
       fi
       ARCH=`echo $package|sed s/-/_/g`
       eval "arch_`echo $package|sed s/-/_/g`=1"
       ;;

     -comm=* | --comm=*)
       package=`echo $arg|sed 's/-*comm=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid communications layer name";
	  exit 1
       fi
       COMM=`echo $package|sed s/-/_/g`	
       eval "comm_`echo $package|sed s/-/_/g`=1" 
       # Handle possible synonyms
       if test -n "$comm_ch_eui" ; then
           comm_ch_mpl=1
           COMM=ch_mpl
       fi
	;;

     -device=* | --device=*)
       package=`echo $arg|sed 's/-*device=//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         print_error "configure: $package: invalid device name" ; exit 1
       fi
       DEVICE=$package    #|sed s/-/_/g`
       # Can't have - in variable names
       package=`echo $package | sed s/-/_/g`
       eval "device_$package=1" 
       # Handle possible synonyms
       if test -n "$device_ch_eui"; then
           device_ch_mpl=1
           DEVICE=ch_mpl
       fi
       ;;

     -mpilibname=*)
	MPILIBNAME=`echo A$arg|sed 's/A-*mpilibname=//'`
	;;

     -cross)
	cross_compiling=1
	;;

     -basecc=* | --basecc=*)
	CC=`echo A$arg | sed 's/A-*basecc=//'`
	BASECC=1
	;;

     -cc=* | --cc=*)
	MPICC=`echo A$arg|sed 's/A-*cc=//'`
	USERCC=1
	;;

     -fc=* | --fc=*)
	MPIF77=`echo A$arg|sed 's/A-*fc=//'`
	USERF77=1
	;;

     -basefc=* | --basefc=*)
	FC=`echo A$arg|sed 's/A-*basefc=//'`
	BASEF77=1
	;;

     -clinker=* | --clinker=*)
	CLINKER=`echo $arg|sed 's/-*clinker=//'`
	USERCLINKER=1
	;;

     -flinker=* | --flinker=*)
	FLINKER=`echo $arg|sed 's/-*flinker=//'`
	USERFLINKER=1
	;;

     -mpiboot=* | --mpiboot=*)
	MPIBOOT=`echo A$arg|sed 's/A-*mpiboot=//'`
	;;

     -mpiunboot=* | --mpiunboot=*)
	MPIUNBOOT=`echo A$arg|sed 's/A-*mpiunboot=//'`
	;;

     -lib=* | --lib=*)
       package="`echo $arg|sed 's/-*lib=//'`"
       USERLIB="$package" ;;

     -opt=* | --opt=*)
       package="`echo $arg|sed 's/-*opt=//'`"
       OPTFLAGS="$package" ;;

     -optcc=* | --optcc=*)
       package="`echo $arg|sed 's/-*optcc=//'`"
       OPTFLAGSC="$package" ;;

     -optf77=* | --optf77=*)
       package="`echo $arg|sed 's/-*optf77=//'`"
       OPTFLAGSF="$package" ;;

     -cflags=* | --cflags=*)
       package="`echo $arg|sed 's/-*cflags=//'`"
       USER_CFLAGS="$package"
       CFLAGS="$CFLAGS $package" ;;

     -fflags=* | --fflags=*)
       package="`echo $arg|sed 's/-*fflags=//'`"
       FFLAGS="$package" ;;

     -f77_extra_flag=* | --f77_extra_flag=*)
       package="`echo $arg |sed 's/-*f77_extra_flag=//'`"
       F77_EXTRA_FLAG="$package" ;;

     -make=* | --make=*)
       package=`echo $arg|sed 's/-*make=//'`
       MAKE="$package"
	;;

     -mpichpath=*|--mpichpath=*)
	mpichpath=`echo A$arg | sed 's/A-*mpichpath=//'`
	if test ! -x $mpichpath/mpicc -a -x $mpichpath/bin/mpicc ; then
	    mpichpath=$mpichpath/bin
	fi
	MPIRUNARGS='"-mvhome"'
	MPIRUNMVBACK="-mvback"
	MPIINCDIR=$mpichpath/../include
	;;

     -with-mpich=*|--with-mpich=*)
        mpichpath=`echo A$arg | sed 's/A-*with-mpich=//'`
	# Let the user provide the top-level path for MPICH as well
	# as the bin directory
	if test ! -x "$mpichpath/mpicc" -a -x "$mpichpath/bin/mpicc" ; then
	    mpichpath="$mpichpath/mpicc"
	fi
	# Check for mpiexec; if found, use it, otherwise, set MPICH-1 specific
	# mpirun options
        if test -x "$mpichpath/mpiexec" ; then
	    MPIRUN="$mpichpath/mpiexec"
        elif test -z "$MPIRUN" ; then
	    MPIRUNARGS='"-mvhome"'
	    MPIRUNMVBACK="-mvback"
        fi
	MPIINCDIR=$mpichpath/../include
	;;
     -mpi2)
	HAS_MPI2=1
	# add I/O test
	IO="io"
	;;

     -nof77 | --nof77 | -disable-f77 | --disable-f77)
       echo "Don't build the tests that need Fortran"
       NOF77=1
       HAS_FORTRAN=0
       FC=true
       ;;

     -enable-f77 | --enable-f77) 
       # Nothing to do
       ;;

     -disable-coverage|--disable-coverage)
       # Nothing to do
       ;;

     -enable-coverage|--enable-coverage)
       enable_coverage=yes
       ;;
	
     -no-io | -disable-io | --disable-io)
       IO=""
       ;;
     -enable-io | --enable-io | --enable-romio | -enable-romio)
       IO="io"
       ;;

     -enable-boot | --enable-boot ) 
       enable_boot=yes
       USE_BOOT=yes
       ;;
     -disable-boot | --disable-boot)
       enable_boot=no
       USE_BOOT=no
       ;;
     -nobanner)
	nobanner=1
	;;

     -echo|--enable-echo|-enable-echo )
	set -x 
        configure_echo=1
	;;

     -no_short_longs | --no_short_longs | --disable-short-longs | -disable-short-longs)
	NOSHORTLONGS=yes
	NO_LONG_LONG="yes"
	NO_LONG_DOUBLE="yes"
	;;

     --enable-short-longs | -enable-short-longs)
	NOSHORTLONGS=no
	NO_LONG_LONG="no"
	NO_LONG_DOUBLE="no"
	;;

     --disable-long-long | -disable-long-long)
	NO_LONG_LONG="yes"
	enable_args="$enable_args --disable-long-long"
	;;

     --enable-long-long | --enable-long-long)
	NO_LONG_LONG="no"
	enable_args="$enable_args --enable-long-long"
	;;

     --disable-long-double | -disable-long-double)
	NO_LONG_DOUBLE="yes"
	enable_args="$enable_args --disable-long-double"
	;;

     --enable-long-double | --enable-long-double)
	NO_LONG_DOUBLE="no"
	enable_args="$enable_args --enable-long-double"
	;;

     --enable-c++ | -enable-c++)
        HAS_CXX=yes
        ;;

     -u | -usage | --usage | --usag | --usa | --us | --u | -help | --help )
	print_usage >& 2
       exit 1 ;;

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

     *) 
	print_error "Unrecognized configure option $arg" 
	;;
    esac
  fi
done

trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
trap 'rm -f confdefs*' 0

# NLS nuisances.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi

rm -f conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'

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

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  srcdirdefaulted=yes
  # Try the directory containing this script, then `..'.
  prog=$0
  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  test "X$confdir" = "X$prog" && confdir=.
  srcdir=$confdir
  if test ! -r $srcdir/$unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$unique_file; then
  if test x$srcdirdefaulted = xyes; then
    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  else
    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  fi
  exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
  .|/*|~*) ;;
  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac


# Save the original args to write them into config.status later.
configure_args="$*"


# Find the source files, if location was not specified.
if test "$srcdirdefaulted" = "yes" ; then
  srcdir=""
  # Try the directory containing this script, then `..'.
  prog=$0
  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  # Remove all trailing /'s 
  confdir=`echo $confdir|sed 's%[/*]$%%'`
  test "X$confdir" = "X$prog" && confdir=.
  srcdir=$confdir
  if test ! -r $srcdir/$unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$unique_file; then
  if test x$srcdirdefaulted = xyes; then
    echo "configure: Cannot find sources in \`${confdir}' or \`..'." 1>&2
  else
    echo "configure: Cannot find sources in \`${srcdir}'." 1>&2
  fi
  exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# (and preserve ./ and .//)
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
  .|./|.//|/*|~*) ;;
  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac

#
#
## Find the Toplevel directory
if test -z "$srcdir" ; then srcdir="." ; fi
if test "X$srcdir" != "X." -a -s $srcdir/pt2pt/runtests.in ; then 
    MPITEST_TRIAL=$srcdir
else
    
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for current directory name""... $ac_c"
else
echo $ac_n "checking for current directory name""... $ac_c" 1>&1
fi
MPITEST_TRIAL=$PWD
if test "${MPITEST_TRIAL}" != "" -a -d "${MPITEST_TRIAL}" ; then 
    if test -r ${MPITEST_TRIAL}/.foo$$ ; then
        rm -f ${MPITEST_TRIAL}/.foo$$
	rm -f .foo$$
    fi
    if test -r ${MPITEST_TRIAL}/.foo$$ -o -r .foo$$ ; then
	MPITEST_TRIAL=
    else
	echo "test" > ${MPITEST_TRIAL}/.foo$$
	if test ! -r .foo$$ ; then
            rm -f ${MPITEST_TRIAL}/.foo$$
	    MPITEST_TRIAL=
        else
 	    rm -f ${MPITEST_TRIAL}/.foo$$
	fi
    fi
fi
if test "${MPITEST_TRIAL}" = "" ; then
    MPITEST_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
fi
if test ! -r ${MPITEST_TRIAL}/$srcdir/pt2pt/runtests.in ; then
        MPITEST_TRIAL=`pwd`
    if test ! -r ${MPITEST_TRIAL}/$srcdir/pt2pt/runtests.in ; then
	print_error "Cannot determine the root directory!" 
        exit 1
    fi
    MPITEST_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPITEST_TRIAL} ; then 
        print_error "Warning: your default path uses the automounter; this may"
        print_error "cause some problems if you use other NFS-connected systems."
        MPITEST_TRIAL=`pwd`
    fi
fi
if test -z "${MPITEST_TRIAL}" ; then
    MPITEST_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPITEST_TRIAL} ; then 
        print_error "Warning: your default path uses the automounter; this may"
        print_error "cause some problems if you use other NFS-connected systems."
        MPITEST_TRIAL=`pwd`
    fi
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""${MPITEST_TRIAL}"
else
echo "$ac_t""${MPITEST_TRIAL}" 1>&1
fi

fi
MPITEST_HOME=$MPITEST_TRIAL
#
if test -z "$prefix" -a -n "$PREFIX" ; then prefix=$PREFIX ; fi

if test -z "$top_srcdir" -o "$top_srcdir" = "." ; then 
    top_srcdir=$MPITEST_HOME
fi

# We can't use a relative srcdir path because autoconf1 has a bug that
# resets top_srcdir to srcdir!
# srcdir is the directory that contains SOURCE files.
if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$MPITEST_HOME" ; fi

if test -n "$mpichpath" ; then
    MPIPATH=$mpichpath
    if test ! -x $mpichpath/mpicc -a -x $mpichpath/bin/mpicc ; then
        mpichpath="$mpichpath/bin"
    fi
    if test -z "$MPICC" ; then MPICC=$mpichpath/mpicc ; fi
    if test -z "$MPIF77" ; then MPIF77=$mpichpath/mpif77 ; fi
    if test -z "$MPICPLUSPLUS" ; then MPICPLUSPLUS=$mpichpath/mpiCC ; fi
    if test -z "$MPIRUN" ; then MPIRUN=$mpichpath/mpirun ; fi
    if test -z "$MPICH_VERSION" ; then 
	MPICH_VERSION="MPICH"
    fi
    if test -z "$MPI_VERSION" ; then MPI_VERSION="MPICH" ; fi
    if test -z "$DEVICE" ; then
        # Try to find out if ch_p4mpd is in the path
	test_device=`echo $mpichpath | sed -e 's/^.*\(ch_p4mpd\).*/\1/'`
	if test "$test_device" = "$mpichpath" ; then
	    if test -x "$mpichpath/mpdman" ; then
	        test_device=ch_p4mpd
	    fi
	fi
	if test "$test_device" = "ch_p4mpd" ; then
	    DEVICE=ch_p4mpd
	    if test "$enable_boot" != "no" ; then
	        USE_BOOT=yes
		if test -z "$MPIBOOT" ; then 
		    MPIBOOT="$mpichpath/mpichboot"
		    MPIUNBOOT="$mpichpath/mpichstop"
		fi
	    fi
	fi
    fi
    if test "$DEVICE" = "ch_p4mpd" ; then
	MPIRUNARGS=""
	MPIRUNMVBACK=""
	if test "$enable_boot" != "no" ; then
	    USE_BOOT=yes
	    if test -z "$MPIBOOT" ; then 
		MPIBOOT="$mpichpath/mpichboot"
		MPIUNBOOT="$mpichpath/mpichstop"
	    fi
	fi
    fi
fi
#
if test $BASECC = 0 ; then
    CC="$MPICC"
fi
if test $BASEF77 = 0 ; then
    FC="$MPIF77"
fi
F77="$FC"
#
#
# Check that an ARCH was set
# If it wasn't set, try to guess using "util/tarch"
#
if test -z "$ARCH" -a -x tarch ; then
    echo "Trying to guess architecture ..."
    ARCH=`./tarch | sed s/-/_/g`
fi
if test -z "$ARCH" -a -x bin/tarch ; then
    ARCH=`bin/tarch | sed s/-/_/g`
fi
if test -z "$ARCH" -a -x ../../bin/tarch ; then
    ARCH=`../../bin/tarch | sed s/-/_/g`
fi
if test -z "$ARCH" -a -x $top_srcdir/../../bin/tarch ; then
    ARCH=`$top_srcdir/../../bin/tarch | sed s/-/_/g`
fi
if test -z "$ARCH" ; then
    print_error "Error: Couldn't guess target architecture."
else
    eval "arch_$ARCH=1"
    # Don't echo the architecture because it may not be accurate.
    # in particular, even though IRIXN32 is chosen (i.e., by using 
    # CC="cc -n32"), this may echo IRIX64.
    #echo "  configuring for \"$ARCH\" target architecture"
fi

if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
fi
if test -n "$arch_IRIX64" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIX32" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIXN32" ; then
    arch_IRIX=1
fi
#  Handle solaris on Intel platforms, needed to get heterogeneity right in p4
if test -n "$arch_solaris86" ; then
    arch_solaris=1
    ARCH=solaris86
fi
if test -n "$arch_sgi5" ; then
    arch_IRIX5=1
    ARCH=IRIX
fi
if test -n "$arch_cray" ; then
    arch_CRAY=1
    ARCH=CRAY
fi
# End of arch setup
# 
# Should eventually use a file like $file.run to see if the program should
# be run or just compiled.  And eventually, this should be run EARLY,
# before checking for things like functions and include files.
#
if test -z "$CC" ; then
    echo "No C compiler specified!"
    exit 1
fi


if test -n "$pac_cv_cross_compiling" ; then
    if test "$pac_cv_cross_compiling" = "yes" ; then
	cross_compiling=1
    fi
else
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether cross-compiling""... $ac_c"
else
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&1
fi
    # If we cannot run a trivial program, we must be cross compiling.
            cat > conftest.c <<EOF
#include "confdefs.h"
main(){exit(0);}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  pac_ok=1

else
  pac_ok=0
fi
rm -fr conftest*
    if test $pac_ok = 1 ; then
        cat > conftest.c <<EOF
#include "confdefs.h"
main(){exit(1);}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  pac_ok=0 

fi
rm -fr conftest*
        if test $pac_ok = 1 ; then
	    pac_cv_cross_compiling="no"
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        else
            cross_compiling=1
	    pac_cv_cross_compiling="yes"
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
        fi
    else
        cross_compiling=1
        pac_cv_cross_compiling="yes"
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    fi
fi


if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether the compiler $CC runs""... $ac_c"
else
echo $ac_n "checking whether the compiler $CC runs""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { return 0; }
EOF
if eval $compile; then
  
  
  eval "ac_cv_ccworks=yes"

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_ccworks"
else
echo "$ac_t""$ac_cv_ccworks" 1>&1
fi
if test $ac_cv_ccworks = "yes" ; then
    cc_works=1
else
# Generate output from failed test.  See COMPILE_CHECK code
# It really would be better if the compile tests put the output into
# a file for later analysis, like conftest.out
#
cat > conftest.c <<EOF
#include "confdefs.h"
int main() { exit(0); }
int t() { return 0; }
EOF
${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS
rm -f conftest* 
#
# End of output
    cc_works=0
fi

if test $cc_works = 0 ; then
    print_error "Could not compile a simple file with $CC!"
    print_error "Check for license and path restrictions on $CC."
    exit 1
fi
if test $NOF77 = 0 ; then
    if test -z "$FC" ; then
	echo "No Fortran compiler specified!"
	exit 1
    fi
    
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether the compiler $F77 runs""... $ac_c"
else
echo $ac_n "checking whether the compiler $F77 runs""... $ac_c" 1>&1
fi
cat >conftest.f <<EOF
          program main
          end
EOF
rm -f conftest.out
$F77 $FFLAGS $OPTFLAGSF -c conftest.f > conftest.out 2>&1
if test $? != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    echo "Fortran compiler returned non-zero return code"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       F77="echo no Fortran compiler"
       FLINKER="$F77"
       MPI_FOBJECTS=""
elif test ! -s conftest.o ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    echo "Fortran compiler did not produce object file"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       F77="echo no Fortran compiler"
       FLINKER="$F77"
       MPI_FOBJECTS=""
else    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    :
fi
rm -f conftest* 

    # If the Fortran compiler is g77, then we want to add -Wno-globals
    # to suppress noise about using different types of variables in calls
    # to MPI communication and address functions.  Note that the name
    # may be f77; we need to detect that it is in fact g77.  In autoconf2
    # we can use A C PROG_F77_GNU.  The following test is taken from there
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c"
else
echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&1
fi
    cat > conftest.fpp <<EOF
#ifdef __GNUC__
    yes
#endif    
EOF
    if ($F77 -E conftest.fpp 2>&1 ) | egrep yes > /dev/null 2>&1 ; then
        ac_cv_prog_g77=yes
    else
        ac_cv_prog_g77=no
    fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_prog_g77"
else
echo "$ac_t""$ac_cv_prog_g77" 1>&1
fi
    if test $ac_cv_prog_g77 = "yes" ; then
        if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether GNU Fortran compiler accepts -Wno-globals""... $ac_c"
else
echo $ac_n "checking whether GNU Fortran compiler accepts -Wno-globals""... $ac_c" 1>&1
fi
        cat > conftest.f << EOF
       program main
       print *, 'Hello World'
       end
EOF
        if $F77 -Wno-globals -c conftest.f >/dev/null 2>&1 ; then  
            ac_vc_g77_supports_wno_globals=yes   
        else     
            ac_vc_g77_supports_wno_globals=no                   
        fi  
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_vc_g77_supports_wno_globals"
else
echo "$ac_t""$ac_vc_g77_supports_wno_globals" 1>&1
fi   
        if test $ac_vc_g77_supports_wno_globals = "yes" ; then
            FFLAGS="$FFLAGS -Wno-globals"
        fi
    fi
fi
#
# Fixup for make

if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for gnumake""... $ac_c"
else
echo $ac_n "checking for gnumake""... $ac_c" 1>&1
fi
rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
	@(dir=`pwd` ; cd .. ; \$(MAKE) -f \$\$dir/conftest SUB)
SUB:
	@echo "success"
.
str=`$MAKE -f conftest 2>&1`
if test "$str" != "success" ; then
    str=`$MAKE --no-print-directory -f conftest 2>&1`
    if test "$str" = "success" ; then
        MAKE="$MAKE --no-print-directory"
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes using --no-print-directory"
else
echo "$ac_t""yes using --no-print-directory" 1>&1
fi
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	echo "Unexpected output from make with program" >>config.log
	cat conftest >>config.log
	echo "str" >> config.log
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest
str=""


if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether make supports include""... $ac_c"
else
echo $ac_n "checking whether make supports include""... $ac_c" 1>&1
fi
rm -f conftest
cat > conftest <<.
ALL:
	@echo "success"
.
cat > conftest1 <<.
include conftest
.
str=`$MAKE -f conftest1 2>&1`
rm -f conftest conftest1
if test "$str" != "success" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
fi
str=""


if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for OSF V3 make""... $ac_c"
else
echo $ac_n "checking for OSF V3 make""... $ac_c" 1>&1
fi
rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
	@# This is a valid comment!
	@echo "success"
.
str=`$MAKE -f conftest 2>&1`
rm -f conftest 
if test "$str" != "success" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Found OSF V3 make"
else
echo "$ac_t""Found OSF V3 make" 1>&1
fi
    echo "The OSF V3 make does not allow comments in target code."
    echo "Using this make may cause problems when building programs."
    echo "You should consider using gnumake instead."
    
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
str=""



if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for virtual path format""... $ac_c"
else
echo $ac_n "checking for virtual path format""... $ac_c" 1>&1
fi
rm -rf conftest*
mkdir conftestdir
cat >conftestdir/a.c <<EOF
A sample file
EOF
cat > conftest <<EOF
all: a.o
VPATH=.:conftestdir
.c.o:
	@echo \$<
EOF
ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
if test -n "$ac_out" ; then 
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""VPATH"
else
echo "$ac_t""VPATH" 1>&1
fi
    VPATH='VPATH=.:$(srcdir)'
else
    rm -f conftest
    cat > conftest <<EOF
all: a.o
.PATH: . conftestdir
.c.o:
	@echo \$<
EOF
    ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`
    if test -n "$ac_out" ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"".PATH"
else
echo "$ac_t"".PATH" 1>&1
fi
        VPATH='.PATH: . $(srcdir)'
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""neither VPATH nor .PATH works"
else
echo "$ac_t""neither VPATH nor .PATH works" 1>&1
fi
    fi
fi
rm -rf conftest*

#
# Check for header files
# stdlib.h is used mostly for things like malloc and free, so it isn't
# so important that stdlib.h be exactly "right".
for ac_hdr in stdlib.h
do
ac_safe=`echo "$ac_hdr" | tr '[a-z]./' '[A-Z]__'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_hdr""... $ac_c"
else
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

#include <$ac_hdr>
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  
  eval "ac_cv_header_$ac_safe=yes"

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

for ac_hdr in unistd.h string.h
do
ac_safe=`echo "$ac_hdr" | tr '[a-z]./' '[A-Z]__'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_hdr""... $ac_c"
else
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

#include <$ac_hdr>
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  
  eval "ac_cv_header_$ac_safe=yes"

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

#
# Check for stdarg correct (used in test.h)

if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for stdarg is correct""... $ac_c"
else
echo $ac_n "checking for stdarg is correct""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap, a );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if test -z "$ac_compile_link" ; then 
    ac_compile_link='${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >>config.log 2>&1'
fi
echo "$ac_compile_link" >>config.log
cat conftest.c >>config.log
if eval $ac_compile_link; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  stdarg_ok=1

else
    rm -rf conftest*
    stdarg_ok=0
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

if test $stdarg_ok = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining USE_STDARG"
echo "#define" USE_STDARG 1 >> confdefs.h
DEFS="$DEFS -DUSE_STDARG=1"
}

fi
#
# Check for special types.  Note that some systems cannot support long double,
# even though the compiler can.  For example, there is no standard XDR form
# for long double, so heterogeneous builds may need to ignore it.
# 
if test "$NOSHORTLONGS" = "no" -a "$NO_LONG_DOUBLE" = "no" ; then
    if test -z "$CC"; then
  # Extract the first word of `gcc', so it can be a program name with args.
  set dummy gcc; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      CC="gcc"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$CC" && CC="cc"
test -n "$CC" && test -n "$verbose" && echo "	setting CC to $CC"

# Find out if we are using GNU C, under whatever name.
cat > conftest.c <<EOF
#ifdef __GNUC__
  yes
#endif
EOF
${CC-cc} -E conftest.c > conftest.out 2>&1
if egrep yes conftest.out >/dev/null 2>&1; then
  GCC=1 # For later tests.
fi
rm -f conftest*

if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for long double""... $ac_c"
else
echo $ac_n "checking for long double""... $ac_c" 1>&1
fi
if test -n "$GCC"; then

{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
}

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
else
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { long double a;return 0; }
EOF
if eval $compile; then
  
  
  ldok=1

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  ldok=0
   
fi
rm -f conftest*

if test $ldok = 1 ; then
    

if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    if test -n "$CROSS_HAS_LONG_DOUBLE" ; then 
    if test "$CROSS_HAS_LONG_DOUBLE" = "yes" ; then 
	
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
}

        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    fi
fi
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"
int main() {
/* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
exit(sizeof(long double) < sizeof(double)); }
EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi

    else
      rm -f conftestout
      if test -s conftest && (./conftest; exit) 2>conftestout; then
          
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
}
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi

      else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi

	if test -s conftestout ; then cat conftestout >> config.log ; fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
        
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
fi #GCC

fi
if test "$NOSHORTLONGS" = "no" -a "$NO_LONG_LONG" = "no" ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for long long""... $ac_c"
else
echo $ac_n "checking for long long""... $ac_c" 1>&1
fi


if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    has_long_long=${CROSS_HAS_LONG_LONG:-0};
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"
int main() {
/* See long double test; this handles the possibility that long long
   has the same problem on some systems */
exit(sizeof(long long) < sizeof(long)); }
EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    has_long_long=0

    else
      rm -f conftestout
      if test -s conftest && (./conftest; exit) 2>conftestout; then
          has_long_long=1

      else
        has_long_long=0

	if test -s conftestout ; then cat conftestout >> config.log ; fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
        
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

if test "$has_long_long" = 1 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
if test "$has_long_long" = 1 ; then
   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether compiler can handle loops with long long""... $ac_c"
else
echo $ac_n "checking whether compiler can handle loops with long long""... $ac_c" 1>&1
fi
         
   cat > conftest.c <<EOF
void MPIR_SUM_ext( invec, inoutvec, len )
void *invec, *inoutvec;
int  len;
{
    int i;
    long long *a = (long long *)inoutvec; long long *b = (long long *)invec;
    for ( i=0; i<len; i++ )
      a[i] = a[i]+b[i];
}
int main(){return 0;}
EOF
    
    if eval $compile ; then
        rm -rf conftest*
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else
        rm -rf conftest*
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!"
else
echo "$ac_t""no!" 1>&1
fi
        has_long_long=0
    fi
fi
if test "$has_long_long" = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_LONG_INT"
echo "#define" HAVE_LONG_LONG_INT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_LONG_INT=1"
}

fi

fi

#
# Check to see if the compiler accepts prototypes

if test "$ac_cv_ccansi" != "$CC $CFLAGS" ; then
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether the compiler $CC accepts ANSI prototypes""... $ac_c"
else
echo $ac_n "checking whether the compiler $CC accepts ANSI prototypes""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
int f(double a){return 0;}
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  
  
  eval "ac_cv_ccworks=yes"

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_ccworks"
else
echo "$ac_t""$ac_cv_ccworks" 1>&1
fi
if test $ac_cv_ccworks = "yes" ; then
    
{
test -n "$verbose" && \
echo "	defining HAVE_PROTOTYPES"
echo "#define" HAVE_PROTOTYPES 1 >> confdefs.h
DEFS="$DEFS -DHAVE_PROTOTYPES=1"
}

else
    :
fi
ac_cv_ccansi="$CC $CFLAGS"
fi

#
# This is used in one of the TEST programs (sigchk.c)
for ac_hdr in signal.h
do
ac_safe=`echo "$ac_hdr" | tr '[a-z]./' '[A-Z]__'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_hdr""... $ac_c"
else
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

#include <$ac_hdr>
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  
  eval "ac_cv_header_$ac_safe=yes"

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

for func in sigaction
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for ${func}""... $ac_c"
else
echo $ac_n "checking for ${func}""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    expandcompile=`echo "$compile" | sed -e 's/>.*//'`
    eval echo "configure:$expandcompile" >> config.log
    echo "configure: failed program was:" >>config.log
    cat confdefs.h >> config.log
    cat conftest.c >> config.log
    if test -s conftest.out ; then cat conftest.out >> config.log 
    else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
    fi

fi
rm -f conftest*
done

#
for func in sleep
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for ${func}""... $ac_c"
else
echo $ac_n "checking for ${func}""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    expandcompile=`echo "$compile" | sed -e 's/>.*//'`
    eval echo "configure:$expandcompile" >> config.log
    echo "configure: failed program was:" >>config.log
    cat confdefs.h >> config.log
    cat conftest.c >> config.log
    if test -s conftest.out ; then cat conftest.out >> config.log 
    else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
    fi

fi
rm -f conftest*
done

#
for func in sysconf
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for ${func}""... $ac_c"
else
echo $ac_n "checking for ${func}""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    expandcompile=`echo "$compile" | sed -e 's/>.*//'`
    eval echo "configure:$expandcompile" >> config.log
    echo "configure: failed program was:" >>config.log
    cat confdefs.h >> config.log
    cat conftest.c >> config.log
    if test -s conftest.out ; then cat conftest.out >> config.log 
    else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
    fi

fi
rm -f conftest*
done

#
INCLUDE_PATH=""
USER_INCLUDE_PATH=""
USER_DEFS=""
LIB_LIST=""
MPE_LIBS=""
#
# Generate the name for the MPI-C, MPI-CC, and MPI-F77 compilers (for use
# in Makefiles that should not be MPICH dependent
# MPICC etc should be set on the configure line
if test -z "$MPICC" ; then
    if  -x $MPIR_HOME/build/$ARCH/$DEVICE/bin/mpicc  ; then
	MPICC=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpicc
    else
	# MPICH 1.1.1 and earlier
        MPICC=$MPIR_HOME/lib/$ARCH/$DEVICE/mpicc
    fi
fi
if test -z "$MPIF77" ; then
    if test $NOF77 = 1 ; then
	MPIF77=:
    else
	if  -x $MPIR_HOME/build/$ARCH/$DEVICE/bin/mpif77  ; then
	    MPIF77=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpif77
	else
 	    # MPICH 1.1.1 and earlier
            MPIF77=$MPIR_HOME/lib/$ARCH/$DEVICE/mpif77
        fi
    fi
fi
if test -z "$LIB_DIR" ; then
    LIB_DIR="."
fi
# 
# Default name for MPIRUN command
if test -z "$MPIRUN" ; then
    MPIRUN="mpirun"
fi
#
#
MPE_CFLAGS="$MPE_CFLAGS $DEFS"

#
# We can check for MPICH by trying to compile a program that uses MPICH_NAME
if test -z "$MPI_VERSION" ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for whether MPI is MPICH""... $ac_c"
else
echo $ac_n "checking for whether MPI is MPICH""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include "mpi.h"
int main() { exit(0); }
int t() { 
    int a=MPICH_NAME; }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  MPI_VERSION=MPICH

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    expandcompile=`echo "$compile" | sed -e 's/>.*//'`
    eval echo "configure:$expandcompile" >> config.log
    echo "configure: failed program was:" >>config.log
    cat confdefs.h >> config.log
    cat conftest.c >> config.log
    if test -s conftest.out ; then cat conftest.out >> config.log 
    else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
    fi

fi
rm -f conftest*

fi
#
# Check that we can link MPI_Init using the MPICC program (if not MPICH)
# (We don't test mpich because we may be configuring this before MPICH 
# is built.)
if test -z "$MPICH_VERSION" ; then
    rm -f conftest*
    cat >> conftest.c <<EOF
#include "mpi.h"
int main(int argc, char **argv)
{MPI_Init( &argc, &argv );
 MPI_Finalize();
 return 0;
}
EOF
    if test -n "$MPILIBNAME" ; then
        TLIB_LIST="$LIB_LIST -l$MPILIBNAME"
    fi
    if $MPICC -o conftest conftest.c $LIB_LIST > conftest.log 2>&1 ; then
        :
    elif $MPICC -o conftest conftest.c $TLIB_LIST >conftest.log 2>&1 ; then
        # Accept the -l$MPILIBNAME in the liblist
        LIB_LIST=$TLIB_LIST
    else
        # Try adding -lmpi instead of $MPILIBNAME
        rm conftest.log
        if $MPICC -o conftest conftest.c $LIB_LIST -lmpi >conftest.log 2>&1 ; then
            LIB_LIST="$LIB_LIST -lmpi"
        else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: Could not compile/link a program containing MPI_Init"
else
echo "$ac_t""Warning: Could not compile/link a program containing MPI_Init" 1>&1
fi
	    echo "Test program was:"
	    cat conftest.c
	    echo "Compiler output was:"
            if test -s conftest.log ; then cat conftest.log ; fi
        fi
    fi
    rm -f conftest*
fi
#
# Eventually add C++
# For now, just test mpiCC

#

if test "$enable_coverage" = "yes" ; then
    # This will only work with GCC.  Note that the switches must be
    # passed to both the linker and the compiler
    CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
    CLINKER="$CLINKER -fprofile-arcs -ftest-coverage"
fi
if test "$USE_BOOT" != "yes" ; then
    MPIBOOT=""
    MPIUNBOOT=""
fi


#

#
# Special values for the ROMIO tests.  These are approximate only
# The long term solution is to move most of these into a separate
# file that ROMIO's configure can define; for the command-line
# values, these should be optional (they really are not needed 
# by the tests).
# Override by setting all 5 in the environment.
# Set a default for LL just in case
LL="ld"
if test -z "$FTESTDEFINE" -a "$HAS_FORTRAN" = 1 ; then
    # FIXME: We need to know if %lld is available as a format
    LL="lld"
    # We really should try to compute the size of MPI_Offset in bytes
    # and then use that value.
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for sizeof MPI_Offset""... $ac_c"
else
echo $ac_n "checking for sizeof MPI_Offset""... $ac_c" 1>&1
fi
    rm -f cftestval
    saveCPPFLAGS="$CPPFLAGS"
    saveCFLAGS="$CFLAGS"
    if test -n "$MPIINCDIR" ; then
        CPPFLAGS="$CPPFLAGS -I$MPIINCDIR"
	# Older autoconfs do not include CPPFLAGS in the compile test
	CFLAGS="$CFLAGS -I$MPIINCDIR"
    fi
    

if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
#include "mpi.h"
int main()
{
  FILE *f=fopen("cftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(MPI_Offset));
  return 0;
}
EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    pac_cv_sizeof_mpi_offset=0

    else
      rm -f conftestout
      if test -s conftest && (./conftest; exit) 2>conftestout; then
          pac_cv_sizeof_mpi_offset=`cat cftestval`

      else
        pac_cv_sizeof_mpi_offset=0

	if test -s conftestout ; then cat conftestout >> config.log ; fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
        
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

rm -f cftestval
    CPPFLAGS="$saveCPPFLAGS"
    CFLAGS="$saveCFLAGS"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$pac_cv_sizeof_mpi_offset"
else
echo "$ac_t""$pac_cv_sizeof_mpi_offset" 1>&1
fi

    if test "$pac_cv_sizeof_mpi_offset" -gt 0 ; then
        FORTRAN_MPI_OFFSET="integer*$pac_cv_sizeof_mpi_offset"
    else
        FORTRAN_MPI_OFFSET="integer*8"
    fi
    # See if the compiler supports the extraction of command line arguments.
    # Check COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT first since these
    # are now standard (Fortran 2003), and are supported by several of the
    # newer compilers, including gfortran.
    FTESTDEFINE=""
    F77IARGC="COMMAND_ARGUMENT_COUNT()"
    F77GETARG="call GET_COMMAND_ARGUMENT(i,str)"
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for Fortran 2003 command line extraction intrinsics""... $ac_c"
else
echo $ac_n "checking for Fortran 2003 command line extraction intrinsics""... $ac_c" 1>&1
fi
    fcompile='$MPIF77 -o conftest conftest.f >>config.log 2>&1'
    cat >conftest.f <<EOF
       PROGRAM MAIN
       CHARACTER*1024 STR
       INTEGER ARGC, I
       ARGC = COMMAND_ARGUMENT_COUNT()
       I = 0
       DO WHILE (I .LT. ARGC)
           I = I + 1
           CALL GET_COMMAND_ARGUMENT(I, STR)
           PRINT *, "argument ", I, " = ", STR
       END DO
       END
EOF
    if eval $fcompile ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        # Use upper case because this works with the Absoft compiler, which
        # is not monocase.  Since all other Fortran compilers, following the
        # Fortran standard, map all names to a single case, using upper
        # case works for all compilers that provide IARGC and GETARG
        FTESTDEFINE="external IARGC, GETARG"
        F77IARGC="IARGC()"
        F77GETARG="call GETARG(i,str)"
        # Some Fortran compilers require additional libraries to
        # provide IARGC etc.  
        # Intel ifc: -lPEPCF90 (or /4Yportlib
        # Absoft f77: -lU77
        fcompile='$MPIF77 -o conftest conftest.f $F77EXTRALIBS $ftestlib >>config.log 2>&1'
        if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for libraries needed for Fortran command line access""... $ac_c"
else
echo $ac_n "checking for libraries needed for Fortran command line access""... $ac_c" 1>&1
fi
        cat >conftest.f <<EOF
       PROGRAM MAIN
       PRINT *, "arg count = ", IARGC()
       END
EOF
        if eval $fcompile ; then 
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""none"
else
echo "$ac_t""none" 1>&1
fi
        else
            addlib=""
            for ftestlib in -lPEPCF90 -lU77 ; do
                echo "$fcompile" >>config.log
                fc=`echo $fcompile`
                echo "fcompile = $fc" >> config.log
                if eval $fcompile ; then 
                    addlib="$ftestlib"
                    break
                fi
            done
            if test -z "$addlib" ; then
                if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unable to determine"
else
echo "$ac_t""unable to determine" 1>&1
fi
            else
                if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$addlib"
else
echo "$ac_t""$addlib" 1>&1
fi
                F77EXTRALIBS="$F77EXTRALIBS $addlib"
            fi
        fi
    fi
    rm -f conftest*
fi
# Use F77MPIOINC to add an "include 'mpiof.h'" statement if necessary
# (conforming MPI implementations should not require this)
F77MPIOINC=""







# End of the values for the ROMIO tests

# Substitute variables
# Variables used in scripts only
# FINC contains an @MPIR_HOME@, so it needs to come first
# Variables used by Makefile.in's:

MPICH_VERSION=""
#
if test -n "$IO" ; then
   # Look for romio relative to the srcdir
   if test -s $srcdir/../../romio/test/Mfile.in ; then
       # Copy the files (always copy in case there was an update).
       # We must put them into the source directory inorder for configure
       # to work correctly
       if test ! -d $srcdir/$IO ; then mkdir $srcdir/$IO ; fi
       for file in $srcdir/../../romio/test/* ; do 
           if test -s $file -a ! -d $file ; then
	       cp -f $file $srcdir/$IO
	   fi
       done
   else 
       # Check to see if we already HAVE the I/O tests
       # (This is the case for stand-alone MPICH1 tests)
       if test ! -s $IO/Mfile.in ; then
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: No IO directory available for tests"
else
echo "$ac_t""Warning: No IO directory available for tests" 1>&1
fi
       fi
   fi
fi
# End configuration file
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $configure_args

for arg
do
  case "\$arg" in
    -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
    exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
    *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  esac
done

trap 'rm -f Makefile pt2pt/Makefile coll/Makefile topol/Makefile \
	context/Makefile env/Makefile profile/Makefile ; exit 1' 1 3 15
prefix='$prefix'
top_srcdir='$top_srcdir'
MPIPATH='$MPIPATH'
VPATH='$VPATH'
CC='$CC'
HAS_CXX='$HAS_CXX'
MPIBOOT='$MPIBOOT'
MPIUNBOOT='$MPIUNBOOT'
MPIRUNARGS='$MPIRUNARGS'
LL='$LL'
FORTRAN_MPI_OFFSET='$FORTRAN_MPI_OFFSET'
FTESTDEFINE='$FTESTDEFINE'
F77IARGC='$F77IARGC'
F77GETARG='$F77GETARG'
F77MPIOINC='$F77MPIOINC'
F77EXTRALIBS='$F77EXTRALIBS'
FINC='$FINC'
ARCH='$ARCH'
CFLAGS='$CFLAGS'
CLINKER='$CLINKER'
COMM='$COMM'
DEVICE='$DEVICE'
F77='$F77'
FFLAGS='$FFLAGS'
FLIB_PATH='$FLIB_PATH'
FLIB_PATH_LEADER='$FLIB_PATH_LEADER'
FLINKER='$FLINKER'
HAS_FORTRAN='$HAS_FORTRAN'
F77_EXTRA_FLAG='$F77_EXTRA_FLAG'
INCLUDE_PATH='$INCLUDE_PATH'
IO='$IO'
LIB_LIST='$LIB_LIST'
LIB_PATH='$LIB_PATH'
LIB_DIR='$LIB_DIR'
MAKE='$MAKE'
MPE_CFLAGS='$MPE_CFLAGS'
MPICH_VERSION='$MPICH_VERSION'
MPIR_HOME='$MPIR_HOME'
MPI_FOBJECTS='$MPI_FOBJECTS'
MPIFDEP='$MPIFDEP'
MPILIBNAME='$MPILIBNAME'
MPICC='$MPICC'
MPIF77='$MPIF77'
MPICPLUSPLUS='$MPICPLUSPLUS'
MPIRUN='$MPIRUN'
MPIRUNMVBACK='$MPIRUNMVBACK'
MPI_VERSION='$MPI_VERSION'
OPTFLAGS='$OPTFLAGS'
OPTFLAGSC='$OPTFLAGSC'
OPTFLAGSF='$OPTFLAGSF'
HAS_MPI2='$HAS_MPI2'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile pt2pt/Makefile coll/Makefile topol/Makefile \
	context/Makefile env/Makefile profile/Makefile "}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  sed -e "
$prsub
$extrasub
s%@prefix@%$prefix%g
s%@top_srcdir@%$top_srcdir%g
s%@MPIPATH@%$MPIPATH%g
s%@VPATH@%$VPATH%g
s%@CC@%$CC%g
s%@HAS_CXX@%$HAS_CXX%g
s%@MPIBOOT@%$MPIBOOT%g
s%@MPIUNBOOT@%$MPIUNBOOT%g
s%@MPIRUNARGS@%$MPIRUNARGS%g
s%@LL@%$LL%g
s%@FORTRAN_MPI_OFFSET@%$FORTRAN_MPI_OFFSET%g
s%@FTESTDEFINE@%$FTESTDEFINE%g
s%@F77IARGC@%$F77IARGC%g
s%@F77GETARG@%$F77GETARG%g
s%@F77MPIOINC@%$F77MPIOINC%g
s%@F77EXTRALIBS@%$F77EXTRALIBS%g
s%@FINC@%$FINC%g
s%@ARCH@%$ARCH%g
s%@CFLAGS@%$CFLAGS%g
s%@CLINKER@%$CLINKER%g
s%@COMM@%$COMM%g
s%@DEVICE@%$DEVICE%g
s%@F77@%$F77%g
s%@FFLAGS@%$FFLAGS%g
s%@FLIB_PATH@%$FLIB_PATH%g
s%@FLIB_PATH_LEADER@%$FLIB_PATH_LEADER%g
s%@FLINKER@%$FLINKER%g
s%@HAS_FORTRAN@%$HAS_FORTRAN%g
s%@F77_EXTRA_FLAG@%$F77_EXTRA_FLAG%g
s%@INCLUDE_PATH@%$INCLUDE_PATH%g
s%@IO@%$IO%g
s%@LIB_LIST@%$LIB_LIST%g
s%@LIB_PATH@%$LIB_PATH%g
s%@LIB_DIR@%$LIB_DIR%g
s%@MAKE@%$MAKE%g
s%@MPE_CFLAGS@%$MPE_CFLAGS%g
s%@MPICH_VERSION@%$MPICH_VERSION%g
s%@MPIR_HOME@%$MPIR_HOME%g
s%@MPI_FOBJECTS@%$MPI_FOBJECTS%g
s%@MPIFDEP@%$MPIFDEP%g
s%@MPILIBNAME@%$MPILIBNAME%g
s%@MPICC@%$MPICC%g
s%@MPIF77@%$MPIF77%g
s%@MPICPLUSPLUS@%$MPICPLUSPLUS%g
s%@MPIRUN@%$MPIRUN%g
s%@MPIRUNMVBACK@%$MPIRUNMVBACK%g
s%@MPI_VERSION@%$MPI_VERSION%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@OPTFLAGSC@%$OPTFLAGSC%g
s%@OPTFLAGSF@%$OPTFLAGSF%g
s%@HAS_MPI2@%$HAS_MPI2%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%$DEFS%
" $top_srcdir/${file}.in >> $file
fi; done


exit 0
EOF
chmod +x config.status
${CONFIG_SHELL-/bin/sh} ./config.status


# Optionally build the io/Mfile
if test -n "$IO" ; then
    if test -d "$srcdir/$IO" ; then
        CONFIG_FILES=io/Mfile
        export CONFIG_FILES
        ${CONFIG_SHELL-/bin/sh} ./config.status
        CONFIG_FILES=""
        unset CONFIG_FILES
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: No IO directory found in $srcdir/$IO"
else
echo "$ac_t""Warning: No IO directory found in $srcdir/$IO" 1>&1
fi
    fi
fi   


CONFIG_FILES="pt2pt/runtests coll/runtests topol/runtests context/runtests \
	command/runtests env/runtests profile/runtests"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in pt2pt/runtests coll/runtests topol/runtests context/runtests \
	command/runtests env/runtests profile/runtests ; do 
    rm -f .pactmp
    sed -e '1d' $pac_file > .pactmp
    rm -f $pac_file
    mv .pactmp $pac_file
    chmod a+x $pac_file
done


# Optionally build the programs and test files
if test -n "$IO" ; then
    if test -d "$srcdir/$IO" ; then
        CONFIG_FILES="io/rtest io/misc.c io/fmisc.f io/fcoll_test.f io/pfcoll_test.f io/large_file.c io/fperf.f"
        export CONFIG_FILES
        ${CONFIG_SHELL-/bin/sh} ./config.status
        rm -f .pactmp
        for file in $CONFIG_FILES ; do
            sed -e '1d' $file > .pactmp
            rm -f $file
            mv .pactmp $file
        done
        CONFIG_FILES=""
        unset CONFIG_FILES
        chmod a+x io/rtest
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: No IO directory found in $srcdir/$IO"
else
echo "$ac_t""Warning: No IO directory found in $srcdir/$IO" 1>&1
fi
    fi
fi

if test -s io/Mfile ; then
    mv -f io/Mfile io/Makefile
fi
if test -x io/rtest ; then
    mv -f io/rtest io/runtests
fi
