#! /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] 
	           [-make=MAKEPGM]
                   [-cflags=CFLAGS] [-fflags=FFLAGS]
                   [-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
                   [-lib=LIBRARY] [-mpilibname=MPINAME]
		   [-mpichpath=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 '-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 '-mpichpath=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
HAS_FORTRAN=1
MPILIBNAME=mpi
CFLAGS=""
# 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
PREFIX=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
HAS_MPI2=0
cross_compiling=0
# 
BASECC=0
BASEF77=0
#
# 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
	;;

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

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

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

     -mpi2)
	HAS_MPI2=1
	;;

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

     -echo )
	set -x 
        configure_echo=1
	;;

     -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="$*"

#
#

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
MPIR_TRIAL=$PWD
if test "${MPIR_TRIAL}" != "" -a -d "${MPIR_TRIAL}" ; then 
    if test -r ${MPIR_TRIAL}/.foo$$ ; then
        /bin/rm -f ${MPIR_TRIAL}/.foo$$
	/bin/rm -f .foo$$
    fi
    if test -r ${MPIR_TRIAL}/.foo$$ -o -r .foo$$ ; then
	MPIR_TRIAL=
    else
	echo "test" > ${MPIR_TRIAL}/.foo$$
	if test ! -r .foo$$ ; then
            /bin/rm -f ${MPIR_TRIAL}/.foo$$
	    MPIR_TRIAL=
        else
 	    /bin/rm -f ${MPIR_TRIAL}/.foo$$
	fi
    fi
fi
if test "${MPIR_TRIAL}" = "" ; then
    MPIR_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
fi
if test ! -r ${MPIR_TRIAL}/Makefile.in ; then
        MPIR_TRIAL=`pwd`
    if test ! -r ${MPIR_TRIAL}/Makefile.in ; then
	print_error "Cannot determine the root directory!" 
        exit 1
    fi
    MPIR_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPIR_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."
        MPIR_TRIAL=`pwd`
    fi
fi
if test -z "${MPIR_TRIAL}" ; then
    MPIR_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPIR_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."
        MPIR_TRIAL=`pwd`
    fi
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""${MPIR_TRIAL}"
else
echo "$ac_t""${MPIR_TRIAL}" 1>&1
fi

MPIR_HOME=$MPIR_TRIAL
#
if test -n "$mpichpath" ; then
    if test -z "$CC" ; then MPICC=$mpichpath/mpicc ; fi
    if test -z "$FC" ; then MPIF77=$mpichpath/mpif77 ; fi
    if test -z "$CXX" ; then MPICPLUSPLUS=$mpichpath/mpiCC ; fi
    if test -z "$MPIRUN" ; then MPIRUN=$mpichpath/mpirun ; fi
    if test -z "$MPICH_VERSION" ; then 
	MPICH_VERSION="MPICH"
    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`
    if test -z "$ARCH" ; then
       print_error "Error: Couldn't guess target architecture."
    else
        eval "arch_$ARCH=1"
        echo "  configuring for \"$ARCH\" target architecture"
    fi
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 -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
        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
        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
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
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 that the compiler $CC runs""... $ac_c"
else
echo $ac_n "checking that 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
  
  rm -rf conftest*
  eval "ac_cv_ccworks=yes"

else
  rm -rf conftest*
  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 $CFLAGS conftest.c -o conftest $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 that the compiler $F77 runs""... $ac_c"
else
echo $ac_n "checking that the compiler $F77 runs""... $ac_c" 1>&1
fi
cat >conftest.f <<EOF
          program main
          end
EOF
/bin/rm -f conftest.out
$F77 $FFLAGS -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* 

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 gnumake""... $ac_c"
else
echo $ac_n "checking gnumake""... $ac_c" 1>&1
fi
/bin/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
    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
/bin/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 BSD 4.4 make""... $ac_c"
else
echo $ac_n "checking BSD 4.4 make""... $ac_c" 1>&1
fi
/bin/rm -f conftest
cat > conftest <<.
ALL:
	@echo "success"
.
cat > conftest1 <<.
include conftest
.
str=`$MAKE -f conftest1 2>&1`
/bin/rm -f conftest conftest1
if test "$str" != "success" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Found BSD 4.4 so-called make"
else
echo "$ac_t""Found BSD 4.4 so-called make" 1>&1
fi
    echo "The BSD 4.4 make is INCOMPATIBLE with all other makes."
    echo "Using this so-called 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 - whew"
else
echo "$ac_t""no - whew" 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 OSF V3 make""... $ac_c"
else
echo $ac_n "checking OSF V3 make""... $ac_c" 1>&1
fi
/bin/rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
	@# This is a valid comment!
	@echo "success"
.
str=`$MAKE -f conftest 2>&1`
/bin/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=""

#
# 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
  
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"

else
  rm -rf conftest*
  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"

/* DEC Alpha compiler by default does NOT define __STDC__ but DOES
   accept prototypes */
#if !defined(__STDC__)
'bad text'
#endif
#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 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
  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 ; 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
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
  
  rm -rf conftest*
  ldok=1

else
  rm -rf conftest*
  ldok=0
   
fi
rm -f conftest*

if test $ldok = 1 ; then
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
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; 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
rm -fr conftest*
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

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
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
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi;has_long_long=1

else
  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
rm -fr conftest*
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 that compiler can handle loops with long long""... $ac_c"
else
echo $ac_n "checking that 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

#
# Check to see if the compiler accepts prototypes

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 that the compiler $CC accepts ANSI prototypes""... $ac_c"
else
echo $ac_n "checking that 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
  
  rm -rf conftest*
  eval "ac_cv_ccworks=yes"

else
  rm -rf conftest*
  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

#
# 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
  
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"

else
  rm -rf conftest*
  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
  rm -rf conftest*
  {
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
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"
# 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=""
# 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
CC='$CC'
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'
INCLUDE_PATH='$INCLUDE_PATH'
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'
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
cat $top_srcdir/${file}.in | sed -e "
$prsub
$extrasub
s%@CC@%$CC%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%@INCLUDE_PATH@%$INCLUDE_PATH%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%@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%
" >> $file
fi; done


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


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

