#! /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] [-comm=COMM_TYPE]
            [-device=DEVICE]
            [-prefix=INSTALL_DIR] 
            [-c++[=C++_COMPILER] | --enable-c++ ] [-noc++ | --disable-c++]
            [-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
            [-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
            [-c++linker=CC_LINKER] 
            [-nompe] [-mpe] [-mpe_opts=MPE_OPTS] [-jumpshot_opts=JUMPSHOT_OPTS]
	    [-nof77] [-f90nag] [-f95nag] [-opt=OPTFLAGS] 
	    [-make=MAKEPGM ]
            [-cflags=CFLAGS] [-fflags=FFLAGS] [-c++flags=CCFLAGS]
            [-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
            [-f90=F90_COMPILER] [-f90flags=F90_FLAGS]
            [-f90inc=INCLUDE_DIRECTORY_SPEC_FORMAT_FOR_F90]
            [-f90linker=F90_LINKER] 
            [-f90libpath=LIBRARY_PATH_SPEC_FORMAT_FOR_F90]
            [-lib=LIBRARY] [-mpilibname=MPINAME]
            [-no_short_longs] [-memdebug] [-ptrdebug]
	    [-listener_sig=name]
            [-usesysv]
            [-mpedbg] [-nompedbg] [-cross] [-devdebug] [-nodevdebug] 
            [-debug | --enable-debug ] [-nodebug | --disable-debug ] 
            [-tracing] [-dlast]
	    [-pkt_size=LENGTH] [-adi_collective]
            [-adi_coll_world]
            [-fortnames=FORTRANNAMES]
            [-ar_nolocal] [-automountfix=AUTOMOUNTFIX]
            [-noranlib] [-rsh=RSHCOMMAND] [-rshnol]
	    [-globusdir=GLOBUSDIR] [-noromio] [-file_system=FILE_SYSTEM]
            [-p4_opts=P4_OPTS]
where
   ARCH_TYPE       = the type of machine that MPI is to be configured for
   COMM_TYPE       = communications layer or option to be used
   DEVICE          = communications device to be used
   INSTALL_DIR     = directory where MPI will be installed (optional)
   MPE_OPTS        = options to pass to the mpe configure
   JUMPSHOT_OPTS   = options to pass to the jumpshot configure
   P4_OPTS         = options to pass to the P4 configure (device=ch_p4)
   C++_COMPILER    = default is to use g++ (optional)
   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
   LENGTH          = Length of message at which ADI switches from short
                     to long message protocol
   FORTRANNAMES    = Form of the Fortran names.  See below.
   AUTOMOUNTFIX    = Command to fix automounters
   RSHCOMMAND      = Command to use for remote shell
   MPILIBNAME      = Name to use instead of mpich in the name of the MPI
                     library.  If set, libMPILIBNAME will be used instead
                     or libmpich.  This can be used on systems with
                     several different MPI implementations.
   GLOBUSDIR       = the location of the Globus distribution
   FILE_SYSTEM     = name of the file system ROMIO is to use.  Currently values
                     are nfs, ufs, pfs (Intel), piofs (IBM), hfs (HP), 
                     sfs (NEC), xfs (SGI)

All arguments are optional, but if 'arch', 'comm', or 'prefix' arguments
are provided, there must be only one.  'arch' must be specified before
'comm' if they both appear.

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.

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.

If '-mpe is included as an option, then the MPE 'helper' libraries will be
built.  If '-nompe' is included as an option, then the MPE libraries are not 
built.  The default is to build the libraries ('-mpe').  

The option '-mpedbg' enables the '-mpedbg' command line switch in MPI
programs.  When used with an MPI program, the default error handler
(i.e., MPI_COMM_WORLD's error handler) tries to start xterm's running dbx
for each process that detects an error.  This option is intended
primarily for workstation environments but should work on some MPPs (such
as IBM SP2).

The option '-nof77' prevents the compilation of routines that require a
Fortran compiler.  If this option is selected, you may not use the
Fortran interface to MPI.

The option '--disable-c++' prevents the compilation of the C++ interface 
routines.

The option '-f90nag' allows you to use the NAG Fortran 90 instead of
Fortran 77.  This is a preliminary version and is based on the version
for NeXTs.  The version '-f95nag' may provide support for the NAG f95
compiler; this is based on mail from a user and has not been tested.

The option '-opt' allows you to specify optimization 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.  Use -cflags and
-fflags for options not related to optimization.

The option '-globusdir=GLOBUS' allows one to specify the location of an
installed version of Globus.  You can acquire Globus from
http://www.globus.org .

The option '-lib' allows you to specify the location of a library that
may be needed by a particular device.  Most devices do NOT need this
option; check the installation instructions for those that might.

The option '-make' may be used to select an alternate make program.  For
example, on FreeBSD systems, -make=gnumake may be required because makes
derived from BSD 4.4 do not support the include operation (instead using
the form .include, unlike all other makes); this is used in the wrappergen
utility.

The option '-no_short_longs' may be used to suppress support for ANSI C
types 'long long int' and 'long double' when they are the same size as
'long' and 'double' respectively.  Some systems allow these long ANSI C
types, but generate a warning message when they are used; this option may
be used to suppress these messages (and support for these types).

The option '-fortnames=FORTRANNAMES' allows you to specify the form of
the Fortran names.  This is used primarily to generate names with and
without trailing underscores for those systems that support both.
Possible values are
    FORTRANNAMES value     if Fortran MPI_SEND looks like
    DOUBLEUNDERSCORE       mpi_send__
    UNDERSCORE             mpi_send_
    CAPS                   MPI_SEND
    NOUNDERSCORE           mpi_send 

This option should normally NOT be used; configure determines what the
Fortran compiler generates.  This can be used to override that choice.

The option -finttype=<type> allows you to specify the C integer type
that corresponds to a Fortran INTEGER.  This is int by default.

The option '-ar_nolocal' prevents the library archive command from
attempting to use the local directory for temporary space.  This option
should be used when (a) there isn't much space (less than 20 MB)
available in the partition where MPICH resides and (b) there is enough
space in /tmp (or wherever ar places temporary files by default).

The option '-noranlib' causes the 'ranlib' step (needed on some systems
to build an object library) to be skipped.  This is particularly useful
on systems where 'ranlib' is optional (allowed but not needed; because it
is allowed, configure chooses to use it just in case) but can fail (some
'ranlib's are implemented as scripts using 'ar'; if they don't use the
local directory, they can fail (destroying the library in the process) if
the temporary directory (usually '/tmp') does not have enough space.
This has occured on some OSF systems.

The option '-usesysv' applies to the ch_shmem device, and causes the device to
attempt and use System V shared memory and semaphore routines, rather than
what would be chosen by default (often mmap or a system-specific method).

The option '-memdebug' enables extensive internal memory debugging code.
This should be used only if you are trying to find a memory problem (it
can be used to help find memory problems in user code as well).  Running
programs with the option '-mpidb memdump' will produce a summary, when 
'MPI_Finalize' is called, of all unfreed memory allocated my MPI.   For
example, a user-created datatype that was not later freed would be reported.

The option '--enable-debug' enables the collection of additional information 
for parallel debuggers such as Totalview.

The option '-tracing' enables tracing of internal calls.  This should be
used only for debugging the MPICH implementation itself.

The option '-dlast' enables tracing of the most recent operations performed
by the device.  These can be output when a signal (like SIGINT), error, 
or call to a special routine occurs.  There is a performance penalty for
this option, but it can be very useful for implementors attempting to debug
problems.  

The option '-rsh' allows you to select an alternative remote shell
command (by default, configure will use 'rsh' or 'remsh' from your
'PATH').  If your remote shell command does not support the '-l' option
(some AFS versions of 'rsh' have this bug), also give the option
'-rshnol'.  These options are useful only when building a network version
of MPICH (e.g., '-device=ch_p4' or '-device=ch_tcp').

Special Tuning Options:

There are a number of options for tuning the behavoir of the ADI
(Abstract Device Interface) which is the low-level message-passing
interface.  These should NOT be used unless you are sure you know what
you are doing.

The option '-nodevdebug' disables the debugging code in the MPI ADI code.
This should be used only when you are sure that everything is working
correctly.  (This option is also present to remind benchmarkers that the
low level code by default may contain debugging code.)  Note also that
some of the device code (in mpid/*) has had the debugging code removed
from the source code.  '-devdebug' turns on the debugging code.
'-nodevdebug' is the default.

The option '-pkt_size=LENGTH' allows you to choose the message length at
which the ADI (Abstract Device Interface) switches from its short to long
message format.  LENGTH must be positive.

The option '-adi_collective' allows the ADI to provide some collective
operations in addition to the basic point-to-point operations.
Currently, most systems do not support this option (it is ignored) and on
the others it has not been extensively tested.  The option
'-adi_coll_world' asks the ADI to try and use any collective operations
that are supported only on the MPI_COMM_WORLD communicator (and any
communicator with a similiar group).  This is also untested.

The option -noromio causes ROMIO (portable implementation of MPI I/O) to not
be configured and built.  The default is to build it.  Currently ROMIO can
utilize as its underlying file system NFS, IBM's PIOFS, Intel's PFS, HP's XFS,
NEC's SFS, and SGI's XFS file systems.  It also can use any Unix-compatible
file system (UFS).  The file system to be used can be specified with the
-file_system=FILE_SYSTEM option, but configure will attempt to choose the
approprate one.  Valid values of FILE_SYSTEM are nfs, ufs, pfs, piofs, xfs,
sfs, and hfs.  Multiple choices can be specified with a '+', as in ufs+nfs.

Sample Configure Usage:

To make for running on sun4's running SunOS with ch_p4 as the device,
 and with the installation directory equal to the current directory:

  ./configure -device=ch_p4 -arch=sun4
  make

Known devices are 
        ch_nx     (native Intel NX calls), 
        ch_mpl    (native IBM EUI or MPL calls),
        ch_p4     (p4)
	globus    (Globus)
        ch_meiko  (for Meiko CS2, using NX compatibility library),
        ch_shmem  (for shared memory systems, such as SMPs), 
        ch_lfshmem(for shared memory systems, such as SMPs; uses
                   lock-free message buffers), 
        ch_cenju3 (native NEC Cenju-3 calls)

The following devices were supported with ADI-1, but are currently
unsupported.  Please contact us if you are interested in helping us
support these devices:
        meiko     (for Meiko CS2, using elan tport library), and
	nx        (for Intel Paragon),
	t3d	  (for the Cray T3D, using Cray shmem library).
        ch_nc     (native nCUBE calls, requires -arch=ncube),
        ch_cmmd   (native TMC CM-5 CMMD calls)
These are no longer distributed with the MPICH distribution.      

Known architectures include (case is important)
        sun4      (SUN OS 4.x)
        solaris   (Solaris)
	solaris86 (Solaris on Intel platforms)
        hpux      (HP UX)
        sppux     (SPP UX)
        rs6000    (AIX for IBM RS6000)
        sgi       (Silicon Graphics IRIX 4.x, 5.x or 6.x)
        sgi5      (Silicon Graphics IRIX 5.x on R4400's, for the MESHINE)
        IRIX      (synonym for sgi)
        IRIX32    (IRIX with 32bit objects -32)
        IRIXN32   (IRIX with -n32)
        IRIX64    (IRIX with 64bit objects)
        alpha     (DEC alpha)
        intelnx   (Intel i860 or Intel Delta)
        paragon   (Intel Paragon)
        meiko     (Meiko CS2)
        CRAY      (CRAY XMP, YMP, C90, J90, T90)
        cray_t3d  (CRAY T3D)
        freebsd   (PC clones running FreeBSD)
        netbsd    (PC clones running NetBSD)
	LINUX     (PC clones running LINUX)
        ksr       (Kendall Square KSR1 and KSR2)
        EWS_UX_V  (NEC EWS4800/360AD Series workstation.  Untested.)
        UXPM      (UXP/M. Untested.)
        uxpv      (uxp/v. Untested.)
        SX_4_float0
                  (NEC SX-4; Floating point format float0
                             Conforms IEEE 754 standard.
                   C:       sizeof (int)     = 4; sizeof (float) = 4
                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4)
        SX_4_float1
                  (NEC SX-4; Floating point format float1
                             IBM floating point format.
                   C:       sizeof (int)     = 4; sizeof (float) = 4
                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4)
        SX_4_float2
                  (NEC SX-4; Floating point format float2
                             CRAY floating point format.
                   C:       sizeof (int)     = 4; sizeof (float) = 8
                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8)
                   !!! WARNING !!! This version will not run
                                   together with FORTRAN routines.
                                   sizeof (INTEGER) != sizeof (int)
        SX_4_float2_int64
                   (NEC SX-4; Floating point format float2 and
                              64-bit int's)
                    C:       sizeof (int)     = 8; sizeof (float) = 8
                    FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8)

Special notes:

For SGI (-arch=IRIX) multiprocessors running the ch_p4 device, use
-comm=ch_p4 to disable the use of the shared-memory p4 communication
device, and -comm=shared to enable the shared-memory p4 communication
device.  The default is to enable the shared-memory communication device.

Others may be recognized.
.
}
#
UseSharedLibs=0
NEEDS_CC_SHARED_OPT=1
ARCH=""
CPP_DIR=""
MPE_DIR=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
F90=""
f90nag=0
NOF77=0
NOMPE=0
NOCXX=""
AR_LOCAL=l
NOSHORTLONGS=0
HAS_FORTRAN=1
MPILIBNAME=mpich
# Nag F90 names are call f90_unix_MP_getarg(i,s) and 
# f90_unix_MP_iargc().
F77GETARGDECL="external getarg"
F77GETARG="call getarg(i,s)"
F77IARGC="iargc()"
F90UNIX="C"
MPI_FOBJECTS="\$(MPI_FOBJECTS)"
MPI_FINT=int
MPI_AINT=long
CFLAGS=""
# We use @ because configure uses %
AUTOMOUNTFIX='sed -e s@/tmp_mnt/@/@g'
#
# By not setting FFLAGS, we get the values from the environment
MAKE=make
P4_MDEPCFLAGS=""
ASMFILES_O=""
PREFIX=""
MPE_OPTS=""
P4_OPTS=""
JUMPSHOT_OPTS=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
cross_compiling=0
is_adi1=0
debug_version=0
#
FILE_SYSTEM=""
ROMIO=1
ROMIO_CFLAGS=""
ROMIO_FFLAGS=""
ROMIO_LFLAGS=""
ROMIO_TCFLAGS=""
ROMIO_TCPPFLAGS=""
ROMIO_TFFLAGS=""
usesysv=0
#
#MPIFDEP="mpif.h"
# The dependency on mpif.h is now handled by mpif77
MPIFDEP=
#
# -mpedbg
#MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
#MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
# dbxerr.c support has become too difficult to make part of the basic
# system (both because it is in MPE, which is now separately built and 
# configured after MPICH, and because of diverging (even for a single vendor)
# command syntax for the debuggers.  Add dbxdee.c/.o when we have a better
# solution.
MPE_MPI_EXT_C="$MPE_MPI_EXT_C mpehname.c"
MPE_MPI_EXT_O="$MPE_MPI_EXT_O mpehname.o"
#
# -devdebug
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
# -dlast
DLAST=""
#
# 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
#
# Test for C++ support
# We can only set this if there is a C++ compiler....
buildcpp=0
# 
MPIVERSION=`grep 'PATCHLEVEL ' include/patchlevel.h | awk '{print $3}'`
# Make sure to remove quotes...
mvk=`grep 'PATCHLEVEL_RELEASE_KIND' include/patchlevel.h | awk '{print $3}' | \
 sed -e 's/"//g'`
mv1=`grep 'PATCHLEVEL_SUBMINOR' include/patchlevel.h | awk '{print $3}'`
mvtime=`grep 'Date:' include/patchlevel.h | sed -e 's/^.*$Date\(.*\)\$".*$/\1/g'`
if test -n "$mvk" ; then
    MPIVERSION="$MPIVERSION.$mv1 ($mvk) of $mvtime"
else
    MPIVERSION="$MPIVERSION.$mv1 of $mvtime"
fi
# Also check for exp version by looking for "mpich-exp" in the directory
# path
mpidirname=`pwd | sed -e 's%^.*/mpich-exp$%FOUND%g'`
if test "$mpidirname" = "FOUND" ; then
    MPIVERSION="$MPIVERSION (experimental)"
fi
echo "Configuring MPICH Version $MPIVERSION"
#
# IS_HETERO is set if the device supports heterogeneous machines.
# This requires additional coding, including checking for XDR
IS_HETERO=0
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"
       ;;

     -bopt=* | --bopt=*)
       package=`echo $arg|sed 's/-*bopt=//'`
       # 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 bopt value" ; exit 1
       fi
       BOPT=`echo $package|sed s/-/_/g`
       eval "bopt_`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
       ;;

     -adi1)
        CFLAGS="$CFLAGS -DMPI_ADI1"
	is_adi1=1
	;;

     -adi1ok)
	# THIS IS A SECRET FLAG.  DON'T USE THIS UNLESS YOU KNOW WHAT
	# YOU ARE DOING.  IF YOU DON'T KNOW WHAT WE'RE TALKING ABOUT,
	# DON'T USE IT.
	adi1_ok=1
	;;

      -listenersig=*)
         listener_sig=`echo A$arg|sed -e 's/A-listenersig=//g'`
         ;;

     -mpedbg | --mpedbg)
	# Definitions of DEFS must follow the PREPARE
	MPE_MPI_EXT_C="$MPE_MPI_EXT_C dbxerr.c mpehname.c"
	MPE_MPI_EXT_O="$MPE_MPI_EXT_O dbxerr.o mpehname.o"
	;;

     -nompedbg | --nompedbg)
	# Definitions of DEFS must follow the PREPARE
	MPE_MPI_EXT_C=""
	MPE_MPI_EXT_O=""
	;;

     -sharedlib | --sharedlib)
	# UNDOCUMENTED OPTION
	# Try to build shared libraries
	UseSharedLibs=1
	;;

     -nosharedlib | --nosharedlib)
	# UNDOCUMENTED OPTION
	# Done't use shared libraries
	UseSharedLibs=0
	;;

     -strict)
	# Setup for gcc strict checking
	CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes"
	USER_CFLAGS="$USER_CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes"
	ROMIO_CFLAGS="$ROMIO_CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes"
	if test -z "$CC" ; then
	    CC=gcc
	    USERCC=1
        fi
	;;

     -ar_nolocal | --ar_nolocal)
	AR_LOCAL=''
	;;

     -noranlib | -no_ranlib)
        RANLIB=':'
	;;

     -usesysv)
	usesysv=1
	;;

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

     -nodevdebug | --nodevdebug)
        NODEVDEBUG=1
	DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
	;;

     -devdebug | --devdebug)
        NODEVDEBUG=0
	DEVDEBUGCFLAGS=""
	;;

     -debug | --debug | --enable-debug | -enable-debug )
	debug_version=1
	;;
	
     -dlast | --dlast)
	DLAST="-dlast"
	;;

     -nodebug | --nodebug | --disable-debug | -disable-debug )
	debug_version=0
	;;

     -no_short_longs | --no_short_longs)
	NOSHORTLONGS=1
	;;

     -memdebug | --memdebug)
	MEMDEBUG=1
	;;

     -ptrdebug | --ptrdebug)
	PTRDEBUG=1
	;;

     -tracing | --tracing)
	TRDEBUG=1
	;;

     -cross)
	cross_compiling=1
	;;

     -pkt_size=* | --pkt_size=*)
	pktsize=`echo $arg|sed 's/-*pkt_size=//'`
	PKTSIZE=$pktsize
       	DEVCFLAGS="$DEVCFLAGS -DMPID_PKT_MAX_DATA_SIZE=$pktsize"
	;;

     -limited_buffers | --limited_buffers)
	LIMITEDBUFFERS=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_LIMITED_BUFFERS"
	;;

     -tiny_buffers | --tiny_buffers)
	TINYBUFFERS=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_TINY_BUFFERS"
	;;

     -nolimited_buffers | --nolimited_buffers)
	LIMITEDBUFFERS=0
	DEVCFLAGS="$DEVCFLAGS -DMPID_NO_LIMITED_BUFFERS"
	;;

     -notiny_buffers | --notiny_buffers)
	TINYBUFFERS=0
	DEVCFLAGS="$DEVCFLAGS -DMPID_NO_TINY_BUFFERS"
	;;

	# This is for p4 (and p3?)
      -socksize=*|--socksize=*)
   	SOCKSIZE="`echo $arg|sed 's/-*socksize=//'`"
     	;;

     -adi_collective | --adi_collective)
	ADI_COLLECTIVE=1
	;;

     -adi_coll_world | --adi_coll_world)
	ADI_COLL_WORLD=1
	;;

     -f77idx)
	# Force POINTER_64_BITS definition
	F77IDX=1
	;;

     -f90nag)
        # Insert module 
	F90UNIX="      use f90_unix"
	FC=f90
	f90nag=1
	# -mismatch allows type mismatches in arguments.  This 
	# is necessary until we have a Fortran 90 module with
	# generic paramters
	FFLAGS="$FFLAGS -mismatch"
	# Still to do - make sure that the Fortran interface is correctly
	# selected.
        ;;

     -f95nag)
        # Insert module 
	F90UNIX="      use f90_unix_env"
	FC=f95
        F77GETARGDECL=""
	#f90nag=1
	# -mismatch allows type mismatches in arguments.  This 
	# is necessary until we have a Fortran 90 module with
	# generic paramters
	#FFLAGS="$FFLAGS -mismatch"
	# Still to do - make sure that the Fortran interface is correctly
	# selected.
        ;;

      -f90=*)
	F90=`echo $arg|sed 's/-*f90=//'`
	;;
      -f90flags=*)
	USER_SET_F90FLAGS=1
	F90FLAGS=`echo $arg|sed 's/-*f90flags=//'`
	;;
      -f90inc=*)
	USER_SET_F90INC=1
	F90INC=`echo $arg|sed 's/-*f90inc=//'`	
	;;
      -f90linker=*)
	USER_SET_F90LINKER=1
	F90LINKER=`echo $arg|sed 's/-*f90linker=//'`
	;;
      -f90libpath=*)
	USER_SET_F90LIB_PATH=1
	F90LIB_PATH=`echo $arg|sed 's/-*f90libpath=//'`
	;;

     -noc++ | --noc++ | --disable-c++ | -disable-c++ )
        NOCXX="nocxx"
        ;;

     --enable-c++ | -enable-c++) 
	;;

     -c++=* | --c++=*)
       # We use .. instead of \+\+ because \+ is interpreted differently
       # by various sed's
       package=`echo $arg|sed 's/-*c..=//'`
       # 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 c++ compiler name"; exit 1
       #fi
       CPP_DIR="MPI-2-C++"
       CPP_COMPILER=`echo $package`		
       # We need to use mpCC for ch_mpl device!
       if test "$CPP_COMPILER" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
	    CPP_COMPILER=mpCC
       fi
       echo Compiling C++ interface with $CPP_COMPILER ;;

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

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

     -fortnames=*)
	# Valid values are
	# FORTRANDOUBLEUNDERSCORE
	# FORTRANUNDERSCORE
	# FORTRANCAPS
	# FORTRANNOUNDERSCORE
	FORTRANNAMES="FORTRAN`echo $arg|sed 's/-*fortnames=//'`"
	;;

     -finttype=*)
	MPI_FINT=`echo a$arg | sed -e '/a-finttype=//g'`
	;;

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

     -c++linker=* | --c++linker=*)
       # We use .. instead of \+\+ because \+ is interpreted differently
       # by various sed's
	CCLINKER=`echo $arg|sed 's/-*c..linker=//'`
        # We need to use mpCC for ch_mpl device!
        if test "$CCLINKER" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
	    CCLINKER=mpCC
        fi
	USERCCLINKER=1
	;;

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

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

      -rshnol)
	rshnol=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" ;;

     -mpe_opts=* | --mpe_opts=*)
	package="`echo $arg | sed 's/-*mpe_opts=//'`"
	if test -z "$MPE_OPTS" ; then
  	    MPE_OPTS="$package" 
	else
	    MPE_OPTS="$MPE_OPTS $package"
	fi
	;;
    
     -p4_opts=* | --p4_opts=*)
	package="`echo $arg | sed 's/-*p4_opts=//'`"
	if test -z "$P4_OPTS" ; then
  	    P4_OPTS="$package" 
	else
	    P4_OPTS="$P4_OPTS $package"
	fi
	;;
    
     -jumpshot_opts=* | --jumpshot_opts=*)
	package="`echo $arg | sed 's/-*jumpshot_opts=//'`"
	if test -z "$JUMPSHOT_OPTS" ; then
	    JUMPSHOT_OPTS="$package" 
	else
	    JUMPSHOT_OPTS="$JUMPSHOT_OPTS $package" 
	fi
	;;

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

     -c++flags=* | --c++flags=*)
       # We use .. instead of \+\+ because \+ is interpreted differently
       # by various sed's
       package="`echo $arg|sed 's/-*c..flags=//'`"
       USER_CCFLAGS="$package"
       CCFLAGS="$CCFLAGS $package" ;;

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

     -mpe | --mpe)
       echo "Make will build MPE routines" ;;

     -nompe | --nompe)
       MPE_DIR=""
       NOMPE=1
       echo "Make will not build MPE routines" ;;
 
     -mpe | --mpe)
       MPE_DIR="mpe"
       NOMPE=0
	;;
 
     -make=* | --make=*)
       package=`echo $arg|sed 's/-*make=//'`
       MAKE="$package"
	;;

     -nof77 | --nof77)
       echo "Don't build the Fortran interfaces"
       NOF77=1
       HAS_FORTRAN=0
       CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       romio_config_args="$romio_config_args -nof77"
       MPI_FOBJECTS="" ;;
	
     -automountfix=* | --automountfix=*)
	AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`"
	;;

     -nobanner)
	nobanner=1
	;;

     -echo )
	set -x 
        configure_echo=1
	;;

     -globusdir=* | --globusdir=*)
	GLOBUSDIR="`echo $arg|sed 's/-*globusdir=//'`"
       ;;

     -noromio | --noromio )
        ROMIO=0
       ;;

     -file_system=* | --file_system=* )
        FILE_SYSTEM="`echo $arg|sed 's/-*file_system=//'`"
       ;;

      -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" 
	exit 1
	;;
    esac
  fi
done

rm -f config.log
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 "$NOCXX" ; then
    CPP_DIR="MPI-2-C++"
    if test -z "$CPP_COMPILER" ; then
	# aCC is the HPUX ANSI C++ compiler (CC is their older one)
	# We need to use xlC in preference to g++ on AIX 
	# And we need to use mpCC for ch_mpl device!
	for p in xlC g++ c++ aCC CC cxx
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$GXX"; then
  ac_pg_GXX="$GXX" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_GXX="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_GXX="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;GXX="$ac_pg_GXX"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($GXX)"
else
echo "$ac_t""found $ac_prog_where ($GXX)" 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

test -n "$GXX" && break
done
if test -z "$GXX" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    GXX="gcc"
fi

	if test "$GXX" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
	    GXX=mpCC
        fi
	if test "$GXX" != "gcc" ; then
	    # Test that this really work: compile iostream.h
cat > conftest.cc <<EOF
#include <iostream.h>
EOF
	    if $GXX -c conftest.cc >/dev/null 2>&1 ; then
                CPP_COMPILER="$GXX"
	        echo Compiling C++ interface with $GXX
	    else
		GXX=""
	    fi
	    /bin/rm -f conftest*
	fi
    fi
    if test -d MPI-2-C++ -a -n "$CPP_COMPILER" ; then
	echo ' '
	echo 'Include C++ bindings for MPI from http://www.mpi.nd.edu/research/mpi2c++'
	echo ' '
	buildcpp=1
    else
	# No compiler found; set the C++ directory to null
	CPP_DIR=""
    fi
fi
# Make sure we remove any configuration file incase there is out-of-date data.
/bin/rm -f mpichconf.h

# 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: 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.
# (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

#
# There are definitions in aclocal.m4 that must be in the same directory
# as this configure file for autoconf to properly build configure.
#
# Set basic defintions based on flags set from commandline
#
if test "$ADI_COLLECTIVE" = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining MPID_USE_ADI_COLLECTIVE"
echo "#define" MPID_USE_ADI_COLLECTIVE 1 >> confdefs.h
DEFS="$DEFS -DMPID_USE_ADI_COLLECTIVE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_USE_ADI_COLLECTIVE\${SEDdB}MPID_USE_ADI_COLLECTIVE\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_USE_ADI_COLLECTIVE\${SEDuB}MPID_USE_ADI_COLLECTIVE\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_USE_ADI_COLLECTIVE\${SEDeB}MPID_USE_ADI_COLLECTIVE\${SEDeC}1\${SEDeD}
"
}

fi
if test "$ADI_COLL_WORLD" = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining MPID_COLL_WORLD"
echo "#define" MPID_COLL_WORLD 1 >> confdefs.h
DEFS="$DEFS -DMPID_COLL_WORLD=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_COLL_WORLD\${SEDdB}MPID_COLL_WORLD\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_COLL_WORLD\${SEDuB}MPID_COLL_WORLD\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_COLL_WORLD\${SEDeB}MPID_COLL_WORLD\${SEDeC}1\${SEDeD}
"
}

fi
#
if test -n "$DEVDEBUGCFLAGS" ; then 
    DEVCFLAGS="$DEVCFLAGS $DEVDEBUGCFLAGS"
fi
#
# Definitions for special debugging features.  
if test $debug_version = 1 ; then
    # Make the code keep separate send queues.
    
{
test -n "$verbose" && \
echo "	defining MPI_KEEP_SEND_QUEUE"
echo "#define" MPI_KEEP_SEND_QUEUE 1 >> confdefs.h
DEFS="$DEFS -DMPI_KEEP_SEND_QUEUE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPI_KEEP_SEND_QUEUE\${SEDdB}MPI_KEEP_SEND_QUEUE\${SEDdC}1\${SEDdD}
\${SEDuA}MPI_KEEP_SEND_QUEUE\${SEDuB}MPI_KEEP_SEND_QUEUE\${SEDuC}1\${SEDuD}
\${SEDeA}MPI_KEEP_SEND_QUEUE\${SEDeB}MPI_KEEP_SEND_QUEUE\${SEDeC}1\${SEDeD}
"
}

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 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}/src/pt2pt/Makefile.in ; then
        MPIR_TRIAL=`pwd`
    if test ! -r ${MPIR_TRIAL}/src/pt2pt/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 "$NOMPE" = 0 ; then
    MPE_DIR=$MPIR_HOME/mpe
fi
#
#
# Check that an ARCH was set
# If it wasn't set, try to guess using "bin/tarch"
#
if test -z "$ARCH" ; then 
    # First check for some special cases
    if test -n "$device_t3d" ; then 
	ARCH=cray_t3d
        arch_cray_t3d=1
    fi
fi
if test -z "$ARCH" -a -x bin/tarch ; 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 architecture""... $ac_c"
else
echo $ac_n "checking for architecture""... $ac_c" 1>&1
fi
    ARCH=`./bin/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
       print_error "Error: Couldn't guess target architecture, you must"
       print_error "       set an architecture type with -arch=<value>"
       exit 1
    fi
    eval "arch_$ARCH=1"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ARCH"
else
echo "$ac_t""$ARCH" 1>&1
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
#
# Check that a DEVICE was set
# If it wasn't set, try to guess using "bin/tdevice"
#
if test -z "$DEVICE" -a -x bin/tdevice ; 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 device""... $ac_c"
else
echo $ac_n "checking device""... $ac_c" 1>&1
fi
    DEVICE=`bin/tdevice $ARCH`
    if test ! -n "$DEVICE" ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
       print_error "Error: Couldn't guess device, you must" 
       print_error "       set a device with -device=<value>" 
       exit 1
    fi
    eval "device_$DEVICE=1" 
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$DEVICE"
else
echo "$ac_t""$DEVICE" 1>&1
fi
fi
#
# Check for a VALID device
if test ! -d mpid/$DEVICE ; then
    print_error "$DEVICE is not a valid device!" 
    exit 1
fi
#
# Set Default values of variables
if test -z "$NOCXX" ; then
    if test -n "$CPP_COMPILER" -a -z "$CCLINKER" ; then
        CCLINKER="$CPP_COMPILER"
    fi
    # -O conflicted with -O3, which the C++ configure uses with IRIX64
    # Note that the C++ configure takes -O by default!
    CPPFLAGS="-I$MPIR_HOME/$CPP_DIR/src"
    CPPLDFLAGS="-L$MPIR_HOME/$CPP_DIR/src"
    if test "$CPP_COMPILER" = "g++" ; then 
	# Particularly for LDFLAGS, -fhandle-exceptions must ONLY be used
	# for GNU g++
	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 g++ compiler exception flags""... $ac_c"
else
echo $ac_n "checking for g++ compiler exception flags""... $ac_c" 1>&1
fi
	cat > conftest.cc <<EOF
int main () {}
EOF
	$CPP_COMPILER -c conftest.cc -fhandle-exceptions 2>conftest.out
	if test ! -s conftest.out ; then
	    CPPFLAGS="$CPPFLAGS -fhandle-exceptions"
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""-fhandle-exceptions"
else
echo "$ac_t""-fhandle-exceptions" 1>&1
fi
	else
	    /bin/rm conftest.o conftest.out
	    $CPP_COMPILER -c conftest.cc -fexceptions 2>conftest.out
	    if test ! -s conftest.out ; then
	        CPPFLAGS="$CPPFLAGS -fexceptions"
		if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""-fexceptions"
else
echo "$ac_t""-fexceptions" 1>&1
fi
	    else
		if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""not determined"
else
echo "$ac_t""not determined" 1>&1
fi	
	    fi
	    /bin/rm conftest.o conftest.out conftest.cc
	fi	
	# These LDFLAGS break configure tests that try to link when the
	# compiler is not the C++ compiler.
	# These should be CPPLDFLAGS, if those are required
        #CPPLDFLAGS="$LDFLAGS -fhandle-exceptions"
    fi
fi
#
CC=${CC:-cc}
F77=${FC:-f77}
if test -n "$FC" ; then
    USERF77=1
fi
# CLINKER and FLINKER are set by PAC _GET_CC and F77
#
# First, check for the basic CC and Ranlib 
if test -z "$USERCC" ; 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*

fi
# AC _PROG_INSTALL
#
# Using this autoconf macro for ranlib doesn't handle the problem 
# of 'helpful' ranlib's that issue error messages (!).  Once
# we've identified the proper compiler etc, we'll try this 
# ranlib below; if it fails, we'll replace it with ':'
#
if test -z "$RANLIB" ; then
    if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set dummy ranlib; 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
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB"

fi
AR="ar cr$AR_LOCAL"
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
INCLUDE_PATH=""
USER_INCLUDE_PATH=""
USER_DEFS=""
LIB_LIST=""
# 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 that a DEVICE was set
if test -z "$DEVICE" ; then
    print_error "You must set a device type with -device=<value>" 
    exit 1
fi
#
# Check that an ARCH was set
if test -z "$ARCH" ; then
    print_error "You must set an architecture type with -arch=<value>"
    exit 1
fi
#
# Set comm from device?
if test -z "$COMM" ; then
    COMM=$DEVICE
    # Remember that COMM set as default, not explicitly, 7/13/95, bri@sgi.com
    default_comm=1
fi
# If some extensions are set, mark the defs
if test -n "$MPE_MPI_EXT_C" ; then
   
{
test -n "$verbose" && \
echo "	defining MPE_USE_EXTENSIONS"
echo "#define" MPE_USE_EXTENSIONS 1 >> confdefs.h
DEFS="$DEFS -DMPE_USE_EXTENSIONS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPE_USE_EXTENSIONS\${SEDdB}MPE_USE_EXTENSIONS\${SEDdC}1\${SEDdD}
\${SEDuA}MPE_USE_EXTENSIONS\${SEDuB}MPE_USE_EXTENSIONS\${SEDuC}1\${SEDuD}
\${SEDeA}MPE_USE_EXTENSIONS\${SEDeB}MPE_USE_EXTENSIONS\${SEDeC}1\${SEDeD}
"
}

fi

############################################################################
# In order to determine the correct compilers and options to use, 
# we sometimes need to get more detailed information on the system
# This is osversion, osvminor, and cputype.
# Currently, only IRIX uses this
############################################################################

#
# We should provide a way to specify a particular IRIX version, rather 
# than requiring the this code to figure everything out.
# In particular, there are IRIX-like systems that do not have the 'hinv'
# command.
#
if test -n "$arch_IRIX" ; 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 IRIX OS version""... $ac_c"
else
echo $ac_n "checking for IRIX OS version""... $ac_c" 1>&1
fi
                     osversion=`uname -r | sed 's/\..*//'`
                     osvminor=`uname -r | sed 's/[0-9]\.\([0-9]*\).*/\1/'`
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$osversion"
else
echo "$ac_t""$osversion" 1>&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 for IRIX cpucount""... $ac_c"
else
echo $ac_n "checking for IRIX cpucount""... $ac_c" 1>&1
fi
   cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
   if test "$cpucount" = "" ; then
     cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
   fi
      if test "$cpucount" = "" ; then
     print_error "Could not determine cpucount."
     print_error "Please send "
     hinv
     print_error "to mpi-bugs@mcs.anl.gov"
     exit 1
   fi
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cpucount"
else
echo "$ac_t""$cpucount" 1>&1
fi
   if test -z "$PROCESSOR_COUNT" ; then PROCESSOR_COUNT=$cpucount ; fi
   
{
test -n "$verbose" && \
echo "	defining" PROCESSOR_COUNT to be $PROCESSOR_COUNT
echo "#define" PROCESSOR_COUNT $PROCESSOR_COUNT >> confdefs.h
DEFS="$DEFS -DPROCESSOR_COUNT=$PROCESSOR_COUNT"
SEDDEFS="${SEDDEFS}\${SEDdA}PROCESSOR_COUNT\${SEDdB}PROCESSOR_COUNT\${SEDdC}$PROCESSOR_COUNT\${SEDdD}
\${SEDuA}PROCESSOR_COUNT\${SEDuB}PROCESSOR_COUNT\${SEDuC}$PROCESSOR_COUNT\${SEDuD}
\${SEDeA}PROCESSOR_COUNT\${SEDeB}PROCESSOR_COUNT\${SEDeC}$PROCESSOR_COUNT\${SEDeD}
"
}

            if test -d mpid/sgi -a "$osversion" -ge 6 -a "$osvminor" -ge 1 -a \
	`uname -s` = "IRIX64" ; then
	if test -z "$device_sgi" ; then
	    echo "Consider using -device=sgi for SGI arrays"
	fi
   elif test -n "$device_sgi" ; then
	print_error "The sgi device requires IRIX64 and version 6.1 or later"
        exit 1
   fi
            if test $cpucount -gt 1 ; then
     if test "$COMM" = "ch_p4" ; then
       if test "$default_comm" = "1" ; then
         echo "IRIX multiprocessor & p4, setting -comm=shared"
         echo "  (configure with -comm=ch_p4 to disable shared memory)"
         COMM="shared"
       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 IRIX cpumodel""... $ac_c"
else
echo $ac_n "checking for IRIX cpumodel""... $ac_c" 1>&1
fi
            cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '`
   if test -z "$cputype" ; then
	print_error "Could not get cputype from hinv -t cpu command."
	print_error "Please send "
	hinv -t cpu 2>&1
	hinv -t cpu | cut -f 3 -d' ' 2>&1
	print_error "to mpi-bugs@mcs.anl.gov" 
	exit 1
   fi
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cputype"
else
echo "$ac_t""$cputype" 1>&1
fi
            if test -z "$osversion" ; then
	print_error "Could not determine OS version.  Please send" 
        print_error " " 
	uname -a
	print_error "to mpi-bugs@mcs.anl.gov" 
        exit 1
   elif test $osversion = 4 ; then
			        true
   elif test $osversion = 5 ; then
	true
   elif test $osversion = 6 ; then
	true
   else 
       print_error "Could not recognize the version of IRIX (got $osversion)"
       print_error "MPICH knows about versions 4, 5 and 6; the version being"
       print_error "returned from uname -r is $osversion."
       print_error "Please send"
       uname -a 2>&1
       hinv 2>&1
       print_error "to mpi-bugs@mcs.anl.gov"
       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 for cputype""... $ac_c"
else
echo $ac_n "checking for cputype""... $ac_c" 1>&1
fi
   OLD_ARCH=IRIX
   IRIXARCH="$ARCH_$osversion"
         cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"`
      case $cputype in 
	3000) ;;
	4000) ;;
	4400) ;;
	4600) ;;
	5000) ;;
	8000) ;;
	10000);;
        *)
	print_error "Unexpected IRIX/MIPS chipset $cputype.  Please send the output"
	print_error " "
        uname -a 2>&1
        hinv 2>&1 
 	print_error " " 
        print_error "to mpi-bugs@mcs.anl.gov" 
	print_error "MPICH will continue and assume that the cputype is"
        print_error "compatible with a MIPS 4400 processor."
 	print_error " " 
        cputype=4400
	;;
   esac
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cputype"
else
echo "$ac_t""$cputype" 1>&1
fi
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi


# special case 'sgi5' for use on MESHINE which is much like an SGI running
# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
# work
if test -n "$arch_sgi5"; then
   osversion=5
   cputype=4400
   IRIXARCH="$ARCH_$osversion"
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi

if test -n "$arch_EWS_UX_V" ; then
    # This is a Unix System V system running on MIP/SGI processors
    LIB_LIST="$LIB_LIST -lsocket -lnsl -lc"	
fi
#
# End of architecture-specific tests
#
if test ! -d build ; then
   mkdir build
fi
if test ! -d build/$ARCH ; then 
   mkdir build/$ARCH
fi
#
# Comm is an option to the device.  It MAY augment the device name, but
# must not be used as a synonym.
if test ! -d build/$ARCH/$DEVICE ; then 
   mkdir build/$ARCH/$DEVICE
fi
for dir in lib include bin data ; do 
    if test ! -d build/$ARCH/$DEVICE/$dir ; then
	mkdir build/$ARCH/$DEVICE/$dir
    fi
done

# Check all of the devices first; they need to be known 
# before doing the transport layer

# check whether --device=chameleon was given
if test -n "$device_chameleon"; then
  echo "Chameleon is no longer supported.  There are specific devices for"
  echo "each system that Chameleon provided (except for PVM, which is not"
  echo "supported)."
  exit 1
fi
# 
# Check for Unix Variants
echo checking for AIX
echo checking how to run the C preprocessor
if test -z "$CPP"; then
  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  # make.  It must be expanded now.
  CPP="${CC-cc} -E"
  cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
test ".${verbose}" != "." && echo "	setting CPP to $CPP"

cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining _ALL_SOURCE"
echo "#define" _ALL_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_ALL_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


echo checking for minix/config.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <minix/config.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  MINIX=1

fi
rm -f conftest*

# The Minix shell can't assign to the same variable on the same line!
if test -n "$MINIX"; then
  
{
test -n "$verbose" && \
echo "	defining _POSIX_SOURCE"
echo "#define" _POSIX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_POSIX_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
"
}

  
{
test -n "$verbose" && \
echo "	defining" _POSIX_1_SOURCE to be 2
echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
DEFS="$DEFS -D_POSIX_1_SOURCE=2"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
\${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
\${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
"
}

  
{
test -n "$verbose" && \
echo "	defining _MINIX"
echo "#define" _MINIX 1 >> confdefs.h
DEFS="$DEFS -D_MINIX=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
\${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
\${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
"
}

fi

#
# For Globus, find the device, get the libraries and info needed to build
# the Globus device.
if test -n "$device_globus"; then
  DEVICE_KIND=network
  if test -z "$GLOBUSDIR" ; then
	print_error "You must set the directory for Globus with -globusdir=dir"
	exit 1
  fi
  if test ! -d $GLOBUSDIR ; then
	print_error "Could not find Globus in $GLOBUSDIR"
	exit 1
  fi
  # Check the version
  globusversion=`$MAKE -f $GLOBUSDIR/etc/Makefile.mpich globusversion`
  if test $? != 0 ; then
       print_error "Your version of globus does not support globusversion"
       exit 1
  fi
  # Get the libraries, etc (there's also a globuslibpath and globuslib)
  # For some reason, Globus thinks that only MPICH is interested in this
  # information.  I'm surprised that no other Globus users need this info.
  USERLIB="$USERLIB `$MAKE -f $GLOBUSDIR/etc/Makefile.mpich userlibpath`"
  if test $? != 0 ; then
       print_error "Your version of globus does not support userlibpath"
       exit 1
  fi
  USERLIB="$USERLIB `$MAKE -f $GLOBUSDIR/etc/Makefile.mpich userlib`"
  if test $? != 0 ; then
       print_error "Your version of globus does not support userlib"
       exit 1
  fi
  # User include directories (should there be any?)
  USER_CFLAGS="$USER_CFLAGS `$MAKE -f $GLOBUSDIR/etc/Makefile.mpich userincdir`"
  if test $? != 0 ; then
       print_error "Your version of globus does not support userincdir"
       exit 1
  fi
  # Globus requires different compilers 
  CC=`$MAKE -f $GLOBUSDIR/etc/Makefile.mpich cc`
  if test $? != 0 ; then
       print_error "Your version of globus does not support cc target"
       exit 1
  fi
  CLINKER=`$MAKE -f $GLOBUSDIR/etc/Makefile.mpich clinker`
  if test $? != 0 ; then
       print_error "Your version of globus does not support clinker target"
       exit 1
  fi
  if test -z "$CC" -o -z "$CLINKER" ; then
       print_error "Globus did not specify C compiler or C linker"
       exit 1
  fi
  if test "$USERCC" = 1 ; then
      print_error "Globus device over-rode choice of C compiler"
  fi
  # Set usercc as if -cc was used, since the globus compiler must take
  # precedence
  USERCC=1
  if test "$USERCLINKER" = 1 ; then
      print_error "Globus device over-rode choice of C linker"
  fi
  # Set userclinker as if -clinker was used, since the globus compiler must 
  # take precedence
  USERCLINKER=1
  #
  FLINKER=`$MAKE -f $GLOBUSDIR/etc/Makefile.mpich flinker`
  if test $? != 0 ; then
       print_error "Your version of globus does not support flinker target"
       exit 1
  fi
  if test -n "$FLINKER" ; then 
      USERFLINKER=1
  fi
  # Globus requires an ANSI compiler.  Check that 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
    cc_proto=1
else
    cc_proto=0
fi

  if test $cc_proto = 0 ; then
	print_error "Globus requires a C compiler that supports prototypes"
	exit 1
  fi

  GLOBUS_INCLUDE_DIR=`$MAKE -f $GLOBUSDIR/etc/Makefile.mpich globusincdir`
  if test $? != 0 ; then
       print_error "Your version of globus does not support globusincdir"
       exit 1
  fi
  #LIB_PATH="$LIB_PATH $GLOBUS_LIB_PATH $GLOBUS_EXTRA_LIB_PATH"
  #LIB_LIST="$LIB_LIST $GLOBUS_LIBS $GLOBUS_EXTRA_LIBS"
  # These files are only included by files in mpich/mpid/globus/*.c
  # and not by the user.
  INCLUDE_PATH="$INCLUDE_PATH $GLOBUS_INCLUDE_DIR"
fi
# Get the C compiler, Fortran compiler, and archiver
CARCH=$ARCH
case $DEVICE in
    ch_cenju3)       CARCH=cenju3 ;;
#    ch_cmmd)         CARCH=cm5 ;;
    ch_mpl|ch_eui)   CARCH=ibmpoe ;;
    ch_meiko|meiko)  CARCH=meiko ;;
    ch_nx|nx)        CARCH=intelnx ;;
#    ch_nc)           CARCH=ncube ;;
#    ch_spp)          CARCH=convex_spp ;;
esac


if test -z "$USERCC" ; then
case $CARCH in 
   cenju3) if test $ARCH = abi
           then
              CCC=CC
              CCLINKER=cjCC
              CC=cc
              F77=f77
              ASM=as
              if test -z "$USERFLINKER" ; then
                  FLINKER=cjabif77
              fi
              if test -z "$USERFLINKER" ; then
                  CLINKER=cjabicc
              fi
           else
              CCC=CC
              CCLINKER=cjCC
              CC=/usr/necccs/bin/cc
              F77=/usr/necccs/bin/f77
              ASM=/usr/necccs/bin/as
              if test ! -x $CC ; then
                 CC=cc
                 F77=f77
                 ASM=as
              fi
#
              if test -z "$USERFLINKER" ; then
                  FLINKER=cjf77
              fi
              if test -z "$USERFLINKER" ; then
                  CLINKER=cjcc
              fi
           fi
#
           DEVCFLAGS="$DEVCFLAGS -O -Kmips2"
           MPILIBNAME=mpich
           ASMFILES_O=get_stack.o
          ;;
   intelnx|paragon) CC=icc ; GCC="" 
	  # If this version of the intel compiler accepts the -nx flag, use it.
  	  if icc -nx > /dev/null 2>&1 ; then
	    # For some reason the lib list was commented out; we need
	    # it to link with if we use the NX routines
	    LIB_LIST="$LIB_LIST -nx"
	    CFLAGS="$CFLAGS -nx"
	  fi
	;;
   cm5) CC=cc ; GCC="" ;   if test -z "$USERCLINKER" ; then
		      CLINKER="cmmd-ld -comp $CC"
		  fi ;;
   cray_t3d)        
	# Some Cray's require -Ccray-t3d instead of -Tcray-t3d.  
        # We have no diagnostic for this behavior yet.
                    CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3d -DT3D" ; GCC="" 
                    if test -z "$USERCLINKER" ; then 
	            CLINKER="$CC -Tcray-t3d" ; fi ;;
   cray_t3e)        
	# Some Cray's require -Ccray-t3e instead of -Tcray-t3e.  
        # We have no diagnostic for this behavior yet.
                    CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3e -DT3E" ; GCC="" 
                    if test -z "$USERCLINKER" ; then 
	            CLINKER="$CC -Tcray-t3e" ; fi ;;
   hpux) if test "`which ${CC-cc}`" = "/usr/convex/bin/cc" ; then 
        CFLAGS="$CFLAGS -or none -U_REENTRANT -D_POSIX_SOURCE -D_HPUX_SOURCE -DMPI_cspp"
         elif test "$CC" != "gcc" ; then
	    # If cflags includes -Ae or -Aa, we don't need to add -Aa
            # In a perfect world, we might want to try -Ae
            # There is also -Aportable...
	    hasarg=`echo A$CFLAGS | sed -n -e '/-A/p'`
	    if test -z "$hasarg" ; then
		# Try to Add -Ae; add -Aa if that doesn't work
	        
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 C compiler accepts option -Ae""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Ae""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Ae $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -Ae can be linked with ones compiled  without -Ae""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Ae can be linked with ones compiled  without -Ae""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -Ae to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    hasarg=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
                print_error "Will not add -Ae to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Ae to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            
        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
    
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

		if test -n "$hasarg" ; then
                    CFLAGS="$CFLAGS -Ae"
                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 that C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -Aa to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    hasarg=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
                print_error "Will not add -Aa to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Aa to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            
        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
    
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

		    if test -n "$hasarg" ; then
			CFLAGS="$CFLAGS -Aa"
		    fi
                fi
	    fi
            # We need these flags to get the correct system include
            # files.
            CFLAGS="$CFLAGS -D_POSIX_SOURCE -D_HPUX_SOURCE"
	    # P4 needs these to get the correct system includes
            P4_CFLAGS="-D_POSIX_SOURCE -D_HPUX_SOURCE"
	    # We MUST have an ANSI compiler for HPUX, even for USER code
	    # If the regular cpp worked, we would not need to do this.
 	    
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 C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        AaOPT=0
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -Aa to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            AaOPT=0
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    AaOPT=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
                print_error "Will not add -Aa to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        AaOPT=0
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Aa to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            AaOPT=0
        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
    AaOPT=0
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

	    if test "$AaOPT" = 1 ; then
	       USER_CFLAGS="$USER_CFLAGS -Aa"
	    fi
	    # Alternate...
	    # -Ae is extended -Aa (only on some PA RISC systems)
	    #CFLAGS="$CFLAGS -Ae +Olibcalls"
	    #CLINKER="cc -Ae"
	    # fort77 is the POSIX-compliant version of f77; fort77 can use 
	    # -Ldirectory
	    #F77=fort77
	    #FLINKER=fort77
	    #FFLAGS="$FFLAGS +ppu"
	    # Try and see that this works
	    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 Checking that HP compiler has ANSI option...""... $ac_c"
else
echo $ac_n "checking for Checking that HP compiler has ANSI option...""... $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() {  }
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*
  hpux_ansi=1

else
  rm -rf conftest*
  hpux_ansi=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 $hpux_ansi = 0 ; then
	       print_error "HPUX C compiler does not support ANSI mode!"
	       print_error "This mode is required because severe bugs in HPUX CPP"
	       print_error "cause problems.  Configuration continuing BUT	"
	       print_error "if you have trouble, consider using the GNU C"
	       print_error "compiler gcc instead."
	    else
              print_error "HPUX C compiler is being forced into ANSI mode so that"
              print_error "severe bugs in HPUX CPP do not cause problems"
	    fi
         fi 
	 ;;
    alpha)   ;;
    convex_spp)  CC="/usr/convex/bin/cc" ;;
    ibmpoe)
                           	                   	 CCval=
         # Extract the first word of "xlC", so it can be a program name with args.
set dummy xlC; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "xlC" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "xlC" ; then
       ac_pg_CCval="xlC"
       ac_prog_where=xlC
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="xlC"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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 -n "$CCval" ; then
             TESTCC="$CCval"
	     CCval=""
             # Extract the first word of "mpCC", so it can be a program name with args.
set dummy mpCC; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "mpCC" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "mpCC" ; then
       ac_pg_CCval="mpCC"
       ac_prog_where=mpCC
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="mpCC"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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
	     # Extract the first word of "xlc", so it can be a program name with args.
set dummy xlc; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "xlc" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "xlc" ; then
       ac_pg_CCval="xlc"
       ac_prog_where=xlc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="xlc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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 -n "$CCval" ; then
                 TESTCC="$CCval"
	         CCval=""
                 # Extract the first word of "mpcc", so it can be a program name with args.
set dummy mpcc; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "mpcc" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "mpcc" ; then
       ac_pg_CCval="mpcc"
       ac_prog_where=mpcc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="mpcc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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
         fi
         if test -z "$CCval" ; then
            print_error "Could not find mpCC or mpcc!"
            print_error "Make sure that you path is set correctly."
	    exit 1
         fi
         CC="$CCval"
    ;;
    meiko) 
                  CCval=''
      for p in cc apcc pgcc gcc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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

test -n "$CCval" && break
done
if test -z "$CCval" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    CCval=""
fi

      if test -z "$CCval" ; then
          print_error "Could not find a C compiler"
	  exit 1
      elif test "$CCVal" = "cc" ; then
          CC="cc -g -xcg92"
      else
	  CC=$CCval
      fi
	;;
    ncube)   CC=ncc ;;
    rs6000)
      CCval=""
      for p in xlC xlc cc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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

test -n "$CCval" && break
done
if test -z "$CCval" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    CCval=""
fi

      if test -n "$CCval" ; then
	 CC=$CCval
         GCC=""
      fi
      ;;
    *)
      CCval=""
      # Pick the vendor's cc ahead of gcc.
      for p in cc gcc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 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

test -n "$CCval" && break
done
if test -z "$CCval" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    CCval=""
fi

      if test -n "$CCval" ; then
	 CC=$CCval
      fi
      ;;
esac
fi
if test -z "$USERCLINKER" -a -z "$CLINKER" ; then
    CLINKER="$CC"
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 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
    :
else
    noproto=1
fi

if test -n "$noproto" ; then
    print_error "The compiler $CC does not accept ANSI prototypes"
    CC=""
    # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CC"; then
  ac_pg_CC="$CC" # Let the user override the test.
else
  ac_first_char=`expr "gcc" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "gcc" ; then
       ac_pg_CC="gcc"
       ac_prog_where=gcc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CC="gcc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CC="$ac_pg_CC"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CC)"
else
echo "$ac_t""found $ac_prog_where ($CC)" 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 -n "$CC" ; 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 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
    :
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
    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 $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
    :
else
    exit 1
fi

        print_error "Using $CC as the C compiler instead"
	CLINKER=$CC
    else
	CC=""
        CLINKER=""
    fi
fi

if test $NOF77 = 0 ; then
    
if test -z "$USERF77" ; then
case $CARCH in 
   intelnx|paragon|i860) F77=if77 ;;
   cm5) # TMC Told us this should be f77
        F77=f77 ; if test -z "$USERFLINKER" ; then
		      FLINKER="cmmd-ld -comp $F77"
		  fi ;;
   CRAY)
   # The Fortran compiler might be cf77 or f77
   # This wierd function uses the VALUE of the first argument before
   # the second!
   F77=	
   for p in cf77 f77
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$F77"; then
  ac_pg_F77="$F77" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_F77="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_F77="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;F77="$ac_pg_F77"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($F77)"
else
echo "$ac_t""found $ac_prog_where ($F77)" 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

test -n "$F77" && break
done
if test -z "$F77" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    F77=""
fi

   ;;
   cray_t3d)        
# The dp switch on the following lines allows compilation of "double precision"
# at the cost of violating the Fortran standard
   print_error Setting double precision to be the same as real, in violation 
   print_error of the Fortran standard.  This is needed because Cray Fortran 
   print_error for the T3D does not support double precision and hence is 
   print_error not actually Fortran.
   F77="/mpp/bin/cf77"
   FFLAGS="$FFLAGS -Ccray-t3d -dp"
   F77GETARG="call pxfgetarg(i,s,1,ierr)"
   if test -z "$USERFLINKER" ; then
       FLINKER="$F77 -Ccray-t3d"
   fi
   ;;
#
#  SX4 Floating Point formats
#
#  float = float0 : Conforms IEEE 754 standard.
#                   C:       sizeof (int)     = 4; sizeof (float) = 4
#                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4
#
#  float = float1 : IBM  floating point format
#                   C:       sizeof (int)     = 4; sizeof (float) = 4
#                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4
#
#  float = float2 : CRAY floating point format
#                   C:       sizeof (int)     = 4; sizeof (float) = 8
#                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8
#                   !!! Will not work for FORTRAN and MPICH !!!
#
#  float = float2_int64 : CRAY floating point format
#                   C:       sizeof (int)     = 8; sizeof (float) = 8
#                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8
#
   SX_4_float0 | SX_4_float1 | SX_4_float2 | SX_4_float2_int64)
         arch_SX_4=1
#
         float=`expr $CARCH : 'SX_4_\(float.\).*'`
         w8=`expr $CARCH : "SX_4_float._\(ew\).*" \| "dw"`
         sx4int=`expr $CARCH : ".*_\(int64\).*" \| "int32"`
#
         echo "Generating MPICH for floating point format \`\`$float''"
#
         if test "$w8" = "ew" ; then
            echo "                 and extended numeric storage \`\`$w8''"
         else
            if test "$sx4int" = "int64" ; then
               echo "                 and sizeof (int) = 64"
            elif test "$float" = "float2" ; then
               cat << EOF
***********************************************************************
*
*   WARNING:
*
*   MPICH is generated for floating point format \`\`float2'' without
*         expanding C int's to 64 bits.
*         This version will not run together with FORTRAN codes.
*
***********************************************************************
EOF
            fi
         fi
#
         CCC="CC"
         CC="cc"; ASM="as -m -h $float"
         OPTFLAGSC="-h2 -hsetmain -hnoflunf -pvctl,nomsg"
         CFLAGS="-h$float -DCHAR_PTR_IS_ADDRESS"
         FFLAGS="-$float"
         LIB_LIST="$LIB_LIST -li77sx"
#
         if test -z "$USERCLINKER" ; then
            CLINKER="cc -h$float"; fi
         if test -z "$USERCCLINKER" ; then
            CCLINKER="CC -h$float"; fi
         if test -z "$USERFLINKER" ; then
            FLINKER="f77 -$float"; fi
#
         if test "$w8" = "ew" ; then
            FLINKER="$FLINKER -ew"
            CFLAGS="$CFLAGS -D_W8"
            FFLAGS="$FFLAGS -ew"
         fi
#
         if test "$sx4int" = "int64" ; then
            CFLAGS="$CFLAGS -hint64"
            CLINKER="$CLINKER -hint64"
            FLINKER="$FLINKER -Wl'-int64'"
         fi
#
         CCFLAGS="$CFLAGS"
    ;;
#
   hpux) 
    # This may eliminate the need for +U77 ....
    if test "`which $F77`" != "/usr/convex/bin/fc" ; then 
        F77GETARG="call igetarg(i,s,len(s))"
	# mgates reports that the +T option makes MPICH work on some HPUX
	# platforms.  The documentation for +T is truely scary; it seems
	# to imply that without it, a Fortran program will NOT run correctly.
        # The hpux F90 compiler doesn't accept +T.  Since we currently set
	# F90FLAGS to FFLAGS by default, 
        if test -z "$USER_SET_F90FLAGS" -a -z "$F90FLAGS" ; then
	    F90FLAGS="$FFLAGS"
	    USER_SET_F90FLAGS=1
	fi
	FFLAGS="$FFLAGS +T"
    else
        # The Convex compiler needs to have optimization messages suppressed
        FFLAGS="$FFLAGS -or none"
    fi
    # There are reports that version 10 Fortran requires +U77
    ;;
    convex_spp)  F77="/usr/convex/bin/fc" ;;
    ibmpoe)
         	 F77=mpxlf
    ;;
    meiko) 
      for p in f77 apf77 pgf77
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$FCval"; then
  ac_pg_FCval="$FCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_FCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_FCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;FCval="$ac_pg_FCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($FCval)"
else
echo "$ac_t""found $ac_prog_where ($FCval)" 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

test -n "$FCval" && break
done
if test -z "$FCval" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    FCval=""
fi

      if test -n "$FCval" -a "$FCval" = f77 ; then
	F77="f77 -g -cg92"
      else
        F77="$FCval"
      fi
      ;;
    ncube)   F77=nf77 ;;
    rs6000)  F77=xlf ;;
    LINUX|linux) 
      for p in f77 fort77 g77
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$F77"; then
  ac_pg_F77="$F77" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_F77="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_F77="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;F77="$ac_pg_F77"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($F77)"
else
echo "$ac_t""found $ac_prog_where ($F77)" 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

test -n "$F77" && break
done
if test -z "$F77" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    F77=""
fi

      ;;
esac
fi
if test -z "$USERFLINKER" -a -z "$FLINKER" ; then
    FLINKER="$F77"
fi
#
# Check that the Fortran compiler is actually available:
HAS_F77=
if test -n "$F77" ; then
    # Extract the first word of "$F77", so it can be a program name with args.
set dummy $F77; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$HAS_F77"; then
  ac_pg_HAS_F77="$HAS_F77" # Let the user override the test.
else
  ac_first_char=`expr "$F77" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$F77" ; then
       ac_pg_HAS_F77="1"
       ac_prog_where=$F77
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_HAS_F77="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_HAS_F77" && ac_pg_HAS_F77="0"
fi;HAS_F77="$ac_pg_HAS_F77"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($HAS_F77)"
else
echo "$ac_t""found $ac_prog_where ($HAS_F77)" 1>&1
fi
   F77FULL=$ac_prog_where  
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 -n "$F77FULL" ; then
	# Really should replace with full path....
        # but would need to capture arguments as well...
	    # fi
fi

else
    HAS_F77=0
fi
# if HAS_F77 = 0, then define the same variables as if the -nof77 switch
# was given at configure time
if test "$HAS_F77" = "0" ; then
    echo "Will not  build the Fortran interfaces"
    NOF77=1
    HAS_FORTRAN=0
    CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
    romio_config_args="$romio_config_args -nof77"
    MPI_FOBJECTS="" 
fi
#

if test -z "$USERAR" ; then
case $CARCH in 
   intelnx|paragon|i860) AR="ar860 crl" ; ARNAME="ar860" ; ARARGS="crl" ;;
   cm5) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr"
   ;;
   meiko|solaris) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr" 
   ;;
   ncube) AR="nar cr" ; ARNAME="nar" ; ARARGS="cr" ;;
esac
fi
if test -z "$AR" ; then 
    AR="ar cr$ARLOCAL" ; ARNAME="ar" ; ARARGS="cr$ARLOCAL" 
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"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PROTOTYPES\${SEDdB}HAVE_PROTOTYPES\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PROTOTYPES\${SEDuB}HAVE_PROTOTYPES\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PROTOTYPES\${SEDeB}HAVE_PROTOTYPES\${SEDeC}1\${SEDeD}
"
}

else
    :
fi

#
# Check to see if it accepts const

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 const modifier""... $ac_c"
else
echo $ac_n "checking that the compiler $CC accepts const modifier""... $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(const int a){return a;}
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
    :
else
    
{
test -n "$verbose" && \
echo "	defining HAVE_NO_C_CONST"
echo "#define" HAVE_NO_C_CONST 1 >> confdefs.h
DEFS="$DEFS -DHAVE_NO_C_CONST=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NO_C_CONST\${SEDdB}HAVE_NO_C_CONST\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NO_C_CONST\${SEDuB}HAVE_NO_C_CONST\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NO_C_CONST\${SEDeB}HAVE_NO_C_CONST\${SEDeC}1\${SEDeD}
"
}

ROMIO_CFLAGS="$ROMIO_CFLAGS -DHAVE_NO_C_CONST"
fi


# Panic check to see if we have any compiler at all
if test -z "$CC" ; then
    print_error "Could not find a C compiler!"
    exit 1
fi
#
# Check for shared library options
if test -z "$SHAREDKIND" ; then 
    SHAREDKIND="ignore"
fi
if test -z "$SHAREDKIND_FOR_TV" ; then
    SHAREDKIND_FOR_TV="ignore"
fi
if test "$UseSharedLibs" = 1 -o "$debug_version" = 1 ; then
    # Options are -fPIC for C (gcc)
    # -KPIC (Solaris SunPro)
    # (none) (AIX, but making the library itself is a mess, and allows -KPIC
    #         as an option!)
    # (none) (Alpha, but allows -fPIC as an option!)
    #
    # There are also needed linker options.  For example, under solaris, 
    # -R<mpich-lib-dir>:$LD_RUN_PATH is needed; this should be determined
    # at mpicc LINK time
    if test "$CC" != "gcc" -a "$ARCH" = "rs6000" ; then
        NEEDS_CC_SHARED_OPT=0
    fi
    if test "$CC" != "gcc" -a "$ARCH" = "alpha" ; then
        NEEDS_CC_SHARED_OPT=0
    fi

    if test "$NEEDS_CC_SHARED_OPT" = 1 ; then 
        # CHECK_COMPILER_OPTION adds option if successful
        CFLAGSSAV="$CFLAGS"
        if test -z "$CC_SHARED_OPT" ; 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 C compiler accepts option -fPIC""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -fPIC""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-fPIC $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -fPIC can be linked with ones compiled  without -fPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled  without -fPIC""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -fPIC to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    CC_SHARED_OPT=-fPIC
                fi
            else
                if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                print_error "Will not add -fPIC to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -fPIC to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            
        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
    
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

            # Check that we can link with that option
  	    # Note that this does NOT work with SunOS
            SHAREDKIND=gcc
        fi
        if test -z "$CC_SHARED_OPT" ; 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 C compiler accepts option -KPIC""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -KPIC""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-KPIC $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -KPIC to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    CC_SHARED_OPT=-KPIC
                fi
            else
                if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                print_error "Will not add -KPIC to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -KPIC to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            
        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
    
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

            if test $ARCH = "solaris" ; then
	        SHAREDKIND=solaris
	        # This only works with some compilers.
	        # Also note that this overrides LD_RUN_PATH
		# -R is used for RUNTIME linking (dlopen)
	        #LDFLAGS="$LDFLAGS -R$MPIR_HOME/build/$ARCH/$DEVICE/lib/shared"
            fi
        fi
	CFLAGS="$CFLAGSSAV"
        # This isn't quite right, but it will work for some systems 
        # Export the shared option to the MPI-2-C++ configure
        CXXFLAGS_FOR_SHARED=$CC_SHARED_OPT
    fi
    # Fortran choices
    # -PIC (SunOS)
    # -KPIC (Solaris)
    # CHECK_COMPILER_OPTION adds option if successful
    FFLAGSSAV="$FFLAGS"
    if test -z "$FC_SHARED_OPT" ; 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 Fortran compiler accepts option -PIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -PIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-PIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -PIC can be linked with ones compiled without -PIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -PIC can be linked with ones compiled without -PIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-PIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> 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
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> 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
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> 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
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


    fi
    if test -z "$FC_SHARED_OPT" ; 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 Fortran compiler accepts option -fPIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -fPIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-fPIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -fPIC can be linked with ones compiled without -fPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled without -fPIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-fPIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> 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
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> 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
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> 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
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


    fi
    if test -z "$FC_SHARED_OPT" ; 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 Fortran compiler accepts option -KPIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -KPIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-KPIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -KPIC can be linked with ones compiled without -KPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled without -KPIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-KPIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> 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
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> 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
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> 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
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


    fi
    FFLAGS="$FFLAGSSAV"
    # Check that the shared libraries work
    export CC
    export CLINKER
    SHARED_LIB_PATH="-L."
    export SHARED_LIB_PATH
    SHARED_LIB_UTIL="util/makesharedlib -noecho -kind=$SHAREDKIND -local -link -noverbose"
    
    if test -z "$SHARED_LIB_UTIL" ; then
	echo "Error in configure; SHARED_LIB_UTIL not set"
	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 shared libraries can be built""... $ac_c"
else
echo $ac_n "checking that shared libraries can be built""... $ac_c" 1>&1
fi
    rm -f conftest* libconftest*
    cat >conftest.c <<EOF
int foo(int a);
int foo(int a) {return a+1;}
EOF
    cat >conftest1.c <<EOF
int main(void);
int foo(int);
int main(void){ return foo(-1); }
EOF
    if $CC $CFLAGS $CC_SHARED_OPT -c conftest.c >conftest.out 2>&1 ; then
	$SHARED_LIB_UTIL -obj=conftest.o -lib=libconftest.a
	if $CC $CFLAGS -o conftest conftest1.c $SHARED_LIB_PATH \
		-lconftest >conftest.out 2>&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
           SHAREDKIND=ignore
	   if test -s conftest.out ; then cat conftest.out >> config.log ; fi
	   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	fi
    else
        SHAREDKIND=ignore
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
	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* libconftest*

    # Note that configure uses CFLAGS for compiling and linking !
    # Add the shared option only if we're building shared libraries
    # (the shared option is also needed when building the totalview
    # dynamically loadable queue library).
    CC_SHARED_OPT_FOR_TV="$CC_SHARED_OPT"
    SHAREDKIND_FOR_TV="$SHAREDKIND"
    if test "$UseSharedLibs" = 1 ; then 
        CFLAGS="$CC_SHARED_OPT $CFLAGS"
        FFLAGS="$FC_SHARED_OPT $FFLAGS"
    else
	CC_SHARED_OPT=""
	FC_SHARED_OPT=""
	CXXFLAGS_FOR_SHARED=""
        SHAREDKIND="ignore"
    fi
    # If we can't find the appropriate options, we should switch to 
    # UseSharedLibs=0
fi





#
#
# Various systems have known special needs (particularly libraries);
# get thos here
#    
DEFAULT_MACHINE=$DEVICE
#
if test -n "$device_nx"; then
  DEFAULT_MACHINE="paragon"
  is_adi1=1
  # Check for fast collective routines
  if test  -r /usr/lib/libjmc.a; then
    CFLAGS="$CFLAGS -DICCLIB"
    ICCLIB="iCClib"
  fi
fi

if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
  if test -n "$arch_solaris" ; then
    LIBS_save="${LIBS}"
LIBS="${LIBS} -lthread"
have_lib=""
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 -lthread""... $ac_c"
else
echo $ac_n "checking for -lthread""... $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() { main(); }
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*
  have_lib="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*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lthread"
else
   :; 
fi

    # the C compiler might include this for us, but the Fortran compiler
    # does not
    LIBS_save="${LIBS}"
LIBS="${LIBS} -lnsl"
have_lib=""
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 -lnsl""... $ac_c"
else
echo $ac_n "checking for -lnsl""... $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() { main(); }
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*
  have_lib="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*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lnsl"
else
   :; 
fi

  fi
  if test -n "$arch_ksr" ; then
    LIBS_save="${LIBS}"
LIBS="${LIBS} -lrpc"
have_lib=""
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 -lrpc""... $ac_c"
else
echo $ac_n "checking for -lrpc""... $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() { main(); }
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*
  have_lib="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*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lrpc"
else
   :; 
fi

  fi
  if test -n "$arch_alpha" ; then
    LIBS_save="${LIBS}"
LIBS="${LIBS} -lrpc"
have_lib=""
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 -lrpc""... $ac_c"
else
echo $ac_n "checking for -lrpc""... $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() { main(); }
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*
  have_lib="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*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lrpc"
else
   :; 
fi

  fi
fi
#
if test -n "$device_ch_meiko" -o -n "$device_meiko" ; then
  is_adi1=1
  DEFAULT_MACHINE="meiko"
  # Jim Cownie claims that -laio is no longer needed ...
  if test -s /opt/MEIKOcs2/lib/libmpsc.a ; then
      if test -n "$device_meiko" ; then
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lew -lelan"
      else
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lmpsc -lew -lelan"
      fi
  else
      print_error "Could not find the library /opt/MEIKOcs2/lib/libmpsc.a"
      print_error "Cannot build MEIKO version"
      exit 1
  fi
  # This include is needed for the elan.h files
  DEVCFLAGS="$DEVCFLAGS -I/opt/MEIKOcs2/include"
  # These were recommended by Jim Cownie
  if test -z "$OPTFLAGS" ; then
#      OPTFLAGS="-xcg92 -xO2"
       OPTFLAGS="-O"
  fi
  #RANLIB=true
fi
#
if test -n "$device_ch_mpl" ; then
    # Check for ANL default machine:
    if test -d /etc/FRAMES -a -d /mcs ; then
        DEFAULT_MACHINE="anlspx"
    fi
    # check for mpproto.h
    ac_safe=`echo "mpproto.h" | 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 mpproto.h""... $ac_c"
else
echo $ac_n "checking for mpproto.h""... $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 <mpproto.h>
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
  pre_req=1
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
pre_req=0
fi

    if test $pre_req = 0 ; then
	print_error "Could not find the header file mpproto.h that is needed"
	print_error "by the ch_mpl device.  Check that you have"
	print_error "IBMs parallel operating environment (POE), which is "
	print_error "required for this device."
	exit 1
    fi
    if test $MPILIBNAME = "mpi" ; then 
	print_error "You should select a name for the MPICH library with"
	print_error "-mpilibname=name_of_library.  Using mpich as the"
	print_error "library name."
	MPILIBNAME="mpich"
    fi
    # We need to check for gettimeofday in case we are not using the Switch
    # timer
    for func in gettimeofday
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

fi
#
if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" -o \
      \( -n "$device_ch_p4" -a "$COMM" = "shared" \) ; then 
for func in mmap
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

# Check that MMAP works!
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 anonymous mmap works""... $ac_c"
else
echo $ac_n "checking that anonymous mmap works""... $ac_c" 1>&1
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 <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
int main(){
int memsize, errno;
caddr_t shmptr;
memsize = getpagesize();
errno = 0;
shmptr = mmap((caddr_t) 0, memsize, 
PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_SHARED
#ifdef MAP_ANON
|MAP_ANON
#endif
,-1, (off_t) 0);
if (errno){
 return 1;}
return 0;
}

EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    MMAP=0

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

      else
	if test MMAP=1 != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        MMAP=0

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

if test $MMAP = 0 ; then 
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!"
else
echo "$ac_t""no!" 1>&1
fi
   
{
test -n "$verbose" && \
echo "	defining HAVE_NO_ANON_MMAP"
echo "#define" HAVE_NO_ANON_MMAP 1 >> confdefs.h
DEFS="$DEFS -DHAVE_NO_ANON_MMAP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NO_ANON_MMAP\${SEDdB}HAVE_NO_ANON_MMAP\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NO_ANON_MMAP\${SEDuB}HAVE_NO_ANON_MMAP\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NO_ANON_MMAP\${SEDeB}HAVE_NO_ANON_MMAP\${SEDeC}1\${SEDeD}
"
}

else
   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 semget works""... $ac_c"
else
echo $ac_n "checking that semget works""... $ac_c" 1>&1
fi
SEMGET=1
cat > conftest.c <<EOF
#include <sys/types.h>
#include <sys/ipc.h>
#include <errno.h>
#include <sys/sem.h>
int main () {
key_t key;
int semset_id;
key=ftok(".", 'a');
errno=0;
if ((semset_id=semget(key,10,IPC_CREAT|IPC_EXCL|0666)) == -1) 
printf("%d\n", errno);
else {
printf("%d\n", errno);
semctl(semset_id,0,IPC_RMID,0); }
return 0; 
}
EOF
    if $CC $CFLAGS -o conftest conftest.c $LIBS > /dev/null 2>&1 ; then
	if test -x conftest ; then
	    /bin/rm -f conftest.out
	    ./conftest > conftest.out
	    errno=`cat conftest.out`

	    if test $errno -eq 0 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    elif test $errno -eq 13 ; then  
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	        SEMGET=0
                print_error "No access permission rights to the semaphore set"
		print_error "created with this key!"
                print_error "Configure could have chosen to create a"
                print_error "semaphore set using an unacceptable key value"
	     elif test $errno -eq 17 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	        SEMGET=0
	        print_error "The semaphore set created with this key"
	        print_error "already exists!"
	        print_error "Try running util/cleanipcs and then reconfiguring"
		print_error "This may or may not help."
	     elif test $errno -eq 43 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	        SEMGET=0
	        print_error "The semaphore set created with this key"
		print_error "is marked to be deleted!"
		print_error "Try running util/cleanipcs and then"
	        print_error "reconfiguring.  This may or may not help."
	    elif test $errno -eq 2 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		SEMGET=0
		print_error "No semaphore set exists for this key!"
		print_error "Configure could have chosen to create a" 
		print_error "semaphore set using an unacceptable key value."
	    elif test $errno -eq 12 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
		SEMGET=0
		print_error "Not enough memory to create a semaphore set!"
	        print_error "Try running util/cleanipcs and then" 
		print_error "reconfiguring.  This may or may not help."
	    elif test $errno -eq 28 ; then
	        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		SEMGET=0
		print_error "The system limit for the maximum number of"
	        print_error "semaphore sets (SEMMNI), or the system wide"
                print_error "maximum number of semaphores (SEMMNS)"
		print_error "has been reached."
	    fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
	    print_error "Could not build executable"
	fi
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
	print_error "Could not compile program"
    fi
    /bin/rm -f conftest*
if test $MMAP = 0 -a "$SEMGET" = 0; then
    print_error "Configure detected that both anonymous mmap and semget fail."
    print_error "Configuring MPICH for shared memory may cause problems!"
fi
fi
# Shared-memory (processes) device.  Only need to set mpirun default machine.
if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
   DEFAULT_MACHINE="smp"
      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 msem_init""... $ac_c"
else
echo $ac_n "checking for msem_init""... $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_msem_init) || defined (__stub___msem_init)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char msem_init(); msem_init();
#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 HAVE_MSEM_INIT"
echo "#define" HAVE_MSEM_INIT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_MSEM_INIT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_MSEM_INIT\${SEDdB}HAVE_MSEM_INIT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_MSEM_INIT\${SEDuB}HAVE_MSEM_INIT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_MSEM_INIT\${SEDeB}HAVE_MSEM_INIT\${SEDeC}1\${SEDeD}
"
}
have_msem_init=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*

   if test "$have_msem_init" = 1 ; then
       # If have msem_init, we need to see if we need struct msemaphore or just
       # msemaphore.
       true
       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 Is msemaphore a typedef or struct name?""... $ac_c"
else
echo $ac_n "checking for Is msemaphore a typedef or struct name?""... $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>
#include <sys/mman.h>
int main() { exit(0); }
int t() { 
typedef struct msemaphore MPID_Msemaphore;
typedef struct { MPID_Msemaphor lock; int a; } Msem;
Msem sem;
        }
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*
  is_struct=1

else
  rm -rf conftest*
  is_struct=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 $is_struct = 1 ; then
	    
{
test -n "$verbose" && \
echo "	defining MSEMAPHORE_IS_STRUCT"
echo "#define" MSEMAPHORE_IS_STRUCT 1 >> confdefs.h
DEFS="$DEFS -DMSEMAPHORE_IS_STRUCT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MSEMAPHORE_IS_STRUCT\${SEDdB}MSEMAPHORE_IS_STRUCT\${SEDdC}1\${SEDdD}
\${SEDuA}MSEMAPHORE_IS_STRUCT\${SEDuB}MSEMAPHORE_IS_STRUCT\${SEDuC}1\${SEDuD}
\${SEDeA}MSEMAPHORE_IS_STRUCT\${SEDeB}MSEMAPHORE_IS_STRUCT\${SEDeC}1\${SEDeD}
"
}

	    echo struct
        else
	    echo typedef
        fi
   fi
   #
   # Here's a horrible "feature".  Solaris include null stubs for 
   # mutex_init in libc (!), so that users can build threaded code that
   # doesn't work (rather than putting this null stubs in -lnothread, 
   # where they belong).  Thus, if mutex_init IS found, we need to 
   # check for -lthread.   (Which we should have done above)
   #
   for func in mutex_init
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in shmat
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in semop
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   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 volatile""... $ac_c"
else
echo $ac_n "checking for volatile""... $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"
volatile int a;
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAS_VOLATILE"
echo "#define" HAS_VOLATILE 1 >> confdefs.h
DEFS="$DEFS -DHAS_VOLATILE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAS_VOLATILE\${SEDdB}HAS_VOLATILE\${SEDdC}1\${SEDdD}
\${SEDuA}HAS_VOLATILE\${SEDuB}HAS_VOLATILE\${SEDuC}1\${SEDuD}
\${SEDeA}HAS_VOLATILE\${SEDeB}HAS_VOLATILE\${SEDeC}1\${SEDeD}
"
}
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
   
fi
rm -f conftest*


   #
  # This should check for shmat and semop first
  if test "$usesysv" = 1 ; then
	
{
test -n "$verbose" && \
echo "	defining SHMEM_PICKED"
echo "#define" SHMEM_PICKED 1 >> confdefs.h
DEFS="$DEFS -DSHMEM_PICKED=1"
SEDDEFS="${SEDDEFS}\${SEDdA}SHMEM_PICKED\${SEDdB}SHMEM_PICKED\${SEDdC}1\${SEDdD}
\${SEDuA}SHMEM_PICKED\${SEDuB}SHMEM_PICKED\${SEDuC}1\${SEDuD}
\${SEDeA}SHMEM_PICKED\${SEDeB}SHMEM_PICKED\${SEDeC}1\${SEDeD}
"
}

	
{
test -n "$verbose" && \
echo "	defining USE_SHMAT"
echo "#define" USE_SHMAT 1 >> confdefs.h
DEFS="$DEFS -DUSE_SHMAT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_SHMAT\${SEDdB}USE_SHMAT\${SEDdC}1\${SEDdD}
\${SEDuA}USE_SHMAT\${SEDuB}USE_SHMAT\${SEDuC}1\${SEDuD}
\${SEDeA}USE_SHMAT\${SEDeB}USE_SHMAT\${SEDeC}1\${SEDeD}
"
}

	
{
test -n "$verbose" && \
echo "	defining LOCKS_PICKED"
echo "#define" LOCKS_PICKED 1 >> confdefs.h
DEFS="$DEFS -DLOCKS_PICKED=1"
SEDDEFS="${SEDDEFS}\${SEDdA}LOCKS_PICKED\${SEDdB}LOCKS_PICKED\${SEDdC}1\${SEDdD}
\${SEDuA}LOCKS_PICKED\${SEDuB}LOCKS_PICKED\${SEDuC}1\${SEDuD}
\${SEDeA}LOCKS_PICKED\${SEDeB}LOCKS_PICKED\${SEDeC}1\${SEDeD}
"
}

	
{
test -n "$verbose" && \
echo "	defining USE_SEMOP"
echo "#define" USE_SEMOP 1 >> confdefs.h
DEFS="$DEFS -DUSE_SEMOP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_SEMOP\${SEDdB}USE_SEMOP\${SEDdC}1\${SEDdD}
\${SEDuA}USE_SEMOP\${SEDuB}USE_SEMOP\${SEDuC}1\${SEDuD}
\${SEDeA}USE_SEMOP\${SEDeB}USE_SEMOP\${SEDeC}1\${SEDeD}
"
}

  fi
   # Look for sigaction routine (instead of signal)
   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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   # To use sigaction, you also need the struct sigaction.  We've had
   # some systems mess this up
   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 for struct sigaction""... $ac_c"
else
echo $ac_n "checking for for struct sigaction""... $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 <signal.h>
int main() { exit(0); }
int t() { 
struct sigaction act; sigaddset( &act.sa_mask, SIGINT ); }
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*
  sigaction_ok="yes"

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

   for func in sigprocmask
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in signal
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in sigmask
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in sigset
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   # Also need to get signal hander arg count 1? 3? 4? something 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 that signals work correctly""... $ac_c"
else
echo $ac_n "checking that signals work correctly""... $ac_c" 1>&1
fi
cat >conftest.c <<EOF
#include <signal.h>
static int rc = 0, irc = 1, maxcnt=5;
void handler( sig )
int sig;
{
void (*oldsig)();
oldsig = signal( SIGUSR1, handler );
if (oldsig != handler) rc = 1;
irc = 0;
}
int main(argc, argv)
int argc;
char **argv;
{
(void)signal( SIGUSR1, handler );
kill( getpid(), SIGUSR1 );
while (irc && maxcnt) { sleep(1); maxcnt--;}
return rc;
}
EOF
rm -f conftest.out
if eval $CC $CFLAGS -o conftest conftest.c > conftest.out 2>&1 ; then
    if ./conftest ; 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 -s conftest.out ; then cat conftest.out >> config.log ; fi
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Signals reset when used!"
else
echo "$ac_t""Signals reset when used!" 1>&1
fi
	
{
test -n "$verbose" && \
echo "	defining SIGNALS_RESET_WHEN_USED"
echo "#define" SIGNALS_RESET_WHEN_USED 1 >> confdefs.h
DEFS="$DEFS -DSIGNALS_RESET_WHEN_USED=1"
SEDDEFS="${SEDDEFS}\${SEDdA}SIGNALS_RESET_WHEN_USED\${SEDdB}SIGNALS_RESET_WHEN_USED\${SEDdC}1\${SEDdD}
\${SEDuA}SIGNALS_RESET_WHEN_USED\${SEDuB}SIGNALS_RESET_WHEN_USED\${SEDuC}1\${SEDuD}
\${SEDeA}SIGNALS_RESET_WHEN_USED\${SEDeB}SIGNALS_RESET_WHEN_USED\${SEDeC}1\${SEDeD}
"
}

    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not compile test program!"
else
echo "$ac_t""Could not compile test program!" 1>&1
fi
fi
/bin/rm -f conftest conftest.c conftest.o conftest.out

   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 return type of signal handlers""... $ac_c"
else
echo $ac_n "checking for return type of signal handlers""... $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 <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();
int main() { exit(0); }
int t() { int i; }
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" RETSIGTYPE to be void
echo "#define" RETSIGTYPE void >> confdefs.h
DEFS="$DEFS -DRETSIGTYPE=void"
SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
\${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
\${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
"
}


else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" RETSIGTYPE to be int
echo "#define" RETSIGTYPE int >> confdefs.h
DEFS="$DEFS -DRETSIGTYPE=int"
SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
\${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
\${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
"
}

    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*


   #
   for func in gettimeofday
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

   for func in BSDgettimeofday
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

fi
if test -n "$device_ch_tcp" ; then
    DEVICE_KIND=network
    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 vprintf""... $ac_c"
else
echo $ac_n "checking for vprintf""... $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() { vprintf(); }
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 HAVE_VPRINTF"
echo "#define" HAVE_VPRINTF 1 >> confdefs.h
DEFS="$DEFS -DHAVE_VPRINTF=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  vprintf_missing=1
    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 -n "$vprintf_missing"; 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 _doprnt""... $ac_c"
else
echo $ac_n "checking for _doprnt""... $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() { _doprnt(); }
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 HAVE_DOPRNT"
echo "#define" HAVE_DOPRNT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_DOPRNT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
"
}


   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*

fi

fi

if test -n "$device_ch_p4"; then
  echo "About to do p4 device"
  DEVICE_KIND=network
#  INCLUDE_PATH="$INCLUDE_PATH -I$MPIR_HOME/mpid/ch_p4/p4/include"
# This needs to get the other libraries as required for the specific
# architecture.  
#
# P4's arch specification is different from MPI's (sun4 vs. SUN, etc.)
# Here we set P4_ARCH to the right value, which we deduce from $ARCH and $COMM
# Note that the IRIX code further below may make further changes to 
# P4_ARCH
  if test "$ARCH" = "rs6000"; then
    case $COMM in
      eui|mpl)
        P4_ARCH=SP1_EUI ;;
      p4)
        P4_ARCH=RS6000 ;;
      *)
        P4_ARCH=RS6000 ;;
    esac

########################################################################
#
# Document the IRIX p4 parameter selection a bit, 7/13/95, bri@sgi.com
#
#       OS      COMM    CPU             P4_ARCH         DEFAULT_MACHINE
#       --      ----    ---             -------         ---------------
#       6.x     shared  R8000           SGI_CH64        sgi_mp
#       6.x     shared  *               SGI_CH
#       6.x     *       R8000           SGI             sgi
#       6.x     *       *               SGI
#       5.x     shared  *               SGI_MP          sgi_mp
#       5.x     *       *               SGI
#       *       *       *               SGI
#
# What to do with R10000?  R5000?
########################################################################
# NEW TABLE
#
#       OS      COMM    CPU             P4_ARCH         Other options
#       --      ----    ---             -------         ---------------
#       6                               SGI6
#       6       shared                  SGI6            -p4comm=shared
#       5                               SGI5
#       5       shared                  SGI5            -p4comm=shared
#       *                               SGI
#       *       shared                  SGI             -p4comm=shared
#
# Also supported are special cases of SGI6: SGIN32, SGI32, and SGI64
#              
########################################################################

  elif test "$ARCH" = "IRIX64" ; then
    P4_ARCH=SGI6       #SGI_CH64
#    DEFAULT_MACHINE="sgi_mp"
  elif test "$ARCH" = "IRIX" ; then
    P4_ARCH=SGI
    if test $osversion = 6 ; then
#        if test "$COMM" = "shared" ; then
#  	    # Use IRIX64 for SGI_CH64
# 	    P4_ARCH=SGI_CH32
##	    if test $cputype = 8000 ; then
##	        P4_ARCH=SGI_CH32
#	        DEFAULT_MACHINE="sgi_mp"
##	    fi
#	else
     	    P4_ARCH=SGI6
#	    if test $cputype = 8000 ; then
#	        P4_ARCH=SGI6
#	        #DEFAULT_MACHINE="sgi"
#	    fi
#	fi
    elif test $osversion = 5 ; then 
        P4_ARCH=SGI5         # SGI
#        if test "$COMM" = "shared" ; then
#	    P4_ARCH=SGI_MP
#	    DEFAULT_MACHINE="sgi_mp"
#	fi
    fi
    if test "$COMM" = "shared" ; then
	DEFAULT_MACHINE="sgi_mp"
    fi
  else
    # Note that this will change IRIXxxx to SGIxxx (i.e., IRIX32 to SGI32)
    P4_ARCH=`echo $ARCH | sed \
	    -e 's/sun4/SUN/g'              -e 's/intelnx/IPSC860/g'  \
	    -e 's/IRIX/SGI/g'              -e 's/hpux/HP/g'          \
	    -e 's/solaris86/I86_SOLARIS/g' -e 's/solaris/SUN_SOLARIS/g' \
	    -e 's/c2mp/CONVEX/g'           -e 's/uxpv/UXPV/g'          \
	    -e 's/alpha/ALPHA/g'           -e 's/dec5000/DEC5000/g'       \
	    -e 's/NeXT/NEXT/g'             -e 's/paragon/PARAGONIP/g'     \
	    -e 's/inteldelta/DELTA/g'      -e 's/symmetry/SYMMETRY/g'\
	    -e 's/cray/CRAY/g'             -e 's/tc2000/TC_2000/g'   \
	    -e 's/ksr/KSR/g'               -e 's/freebsd/FREEBSD/g'  \
	    -e 's/cm5/CM5/g'               -e 's/meiko/MEIKO_CS2/g'  \
            -e 's/rs6000/RS6000/g'	   -e 's/symm_ptx/SYMMETRY_PTX/g' \
            -e 's/sppux/HP/g'              -e 's/netbsd/NETBSD/g'`
  fi
echo "Finished setting p4arch..."
#
echo "Configuring p4 subsystem..."
# Make sure that the lib Makefile gets remade
  if test -n "$SOCKSIZE" ; then
      otherargs="-socksize=$SOCKSIZE"
  fi
  if test -n "$configure_echo" ; then
      otherargs="$otherargs -echo"
  fi
  if test -n "$rshcommand" ; then
      otherargs="$otherargs -rsh=$rshcommand"
  fi
  if test -n "$rshnol" ; then
      otherargs="$otherargs -rshnol"
  fi
  if test -n "$DLAST" ; then
      otherargs="$otherargs $DLAST"
  fi
  if test -n "$listener_sig" ; then
      otherargs="$otherargs -listenersig=$listener_sig"
  fi
  if test -n "$P4_OPTS" ; then
      otherargs="$otherargs $P4_OPTS"
  fi
  # specify the C compiler in case it is different from the P4 choice
  (cd mpid/ch_p4/p4 ; \
	./configure -p4arch=$P4_ARCH -p4make="$MAKE" -opt="$OPTFLAGS" -cc="$CC" -p4comm="$COMM" -cflags="$USER_CFLAGS $P4_CFLAGS $CC_SHARED_OPT" $otherargs )
  if test $? != 0 ; then
      print_error "Configure of the p4 sub-system may have failed!"
      exit 1
  fi
  echo "Finished configuring the p4 subsystem"
  P4_MDEPLIBS=`$MAKE -f mpid/ch_p4/p4/lib/Makefile p4mdeplibs | grep -v make`
  LIB_LIST="$LIB_LIST $P4_MDEPLIBS"
  #
  P4_MDEPCFLAGS=`$MAKE -f mpid/ch_p4/p4/lib/Makefile p4mdepcflags | grep -v make`
  if test -n "$P4_MDEPCFLAGS" ; then
      CFLAGS="$CFLAGS $P4_MDEPCFLAGS"
  fi
  P4_MDEPFFLAGS=`$MAKE -f mpid/ch_p4/p4/lib/Makefile p4mdepfflags | grep -v make`
  if test -n "$P4_MDEPFFLAGS" ; then
      FFLAGS="$FFLAGS $P4_MDEPFFLAGS"
  fi

  # These directories are built above.  
  #if test ! -d build/$ARCH/ch_p4/lib ; then 
  #    mkdir build/$ARCH/ch_p4/lib
  #fi 
#   
#   We need to change the makefile.protos in mpid/ch_p4/p4 to use
#   the correct libraries
#   if test -n "$COMM" ; then 
#       COMM="ch_p4_$COMM"
#   else
       COMM="ch_p4"
#   fi
#  if test ! -d build/$ARCH/$COMM/lib ; then 
#       mkdir build/$ARCH/$COMM/lib
#  fi 
#   p4 library is intergrated with libmpi.a...
#   LIB_PATH="$LIB_PATH -L$build/$ARCH/$COMM/lib"
#   LIB_LIST="$LIB_LIST -lp4";
  IS_HETERO=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 that signals work correctly""... $ac_c"
else
echo $ac_n "checking that signals work correctly""... $ac_c" 1>&1
fi
cat >conftest.c <<EOF
#include <signal.h>
static int rc = 0, irc = 1, maxcnt=5;
void handler( sig )
int sig;
{
void (*oldsig)();
oldsig = signal( SIGUSR1, handler );
if (oldsig != handler) rc = 1;
irc = 0;
}
int main(argc, argv)
int argc;
char **argv;
{
(void)signal( SIGUSR1, handler );
kill( getpid(), SIGUSR1 );
while (irc && maxcnt) { sleep(1); maxcnt--;}
return rc;
}
EOF
rm -f conftest.out
if eval $CC $CFLAGS -o conftest conftest.c > conftest.out 2>&1 ; then
    if ./conftest ; 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 -s conftest.out ; then cat conftest.out >> config.log ; fi
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Signals reset when used!"
else
echo "$ac_t""Signals reset when used!" 1>&1
fi
	
{
test -n "$verbose" && \
echo "	defining SIGNALS_RESET_WHEN_USED"
echo "#define" SIGNALS_RESET_WHEN_USED 1 >> confdefs.h
DEFS="$DEFS -DSIGNALS_RESET_WHEN_USED=1"
SEDDEFS="${SEDDEFS}\${SEDdA}SIGNALS_RESET_WHEN_USED\${SEDdB}SIGNALS_RESET_WHEN_USED\${SEDdC}1\${SEDdD}
\${SEDuA}SIGNALS_RESET_WHEN_USED\${SEDuB}SIGNALS_RESET_WHEN_USED\${SEDuC}1\${SEDuD}
\${SEDeA}SIGNALS_RESET_WHEN_USED\${SEDeB}SIGNALS_RESET_WHEN_USED\${SEDeC}1\${SEDeD}
"
}

    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not compile test program!"
else
echo "$ac_t""Could not compile test program!" 1>&1
fi
fi
/bin/rm -f conftest conftest.c conftest.o conftest.out

  # For the timers, we try for gettimeofday.  Just for the device
  for func in gettimeofday
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

  for func in BSDgettimeofday
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

fi

#
# This is incomplete

if test -n "$arch_IRIX"; then
   # We now have to look at  all sorts of things to determine the
   # various flags.  We need to set both the CFLAGS and various options
   # for the linkers (by setting CLINKER and FLINKER).
   # The OS version and chipset were determined above so that they could
   # be used to set the P4_ARCH if necessary.
   #
   # Latest information we have is that (thanks to Winfrid Tschiedel 
   # <Winfrid.Tschiedel@mch.sni.de>):
   #  cputype          Instruction sets
   #  R4X00            -mips2 -mips3 (mips2 requires -32)
   #  R5000, R8000 and R10000 : -mips2 (-32) and -mips3 (-n32 or -64)
   #                            -mips4 (-n32 or -64)
   # Also, IRIX 6.2 supports R4X00 only in 32 bit mode (requires -n32)
   # EXCEPT for R4400, which also supports -64.
   # In 6.2, the defaults SEEM to be -32 -mips 2
   # but you may need -64 -mips3 OR -mips 4 OR -n32 -mips3 or -mips4
   # Also, some systems REQUIRE -non_shared and others REQUIRE NOT 
   # -non_shared.  
   # 
   # Finally, compilation with optimization may stree the linker;
   # include -TENV:large_GOT=ON in this case
   #
   if test $osversion = 4 ; then
	# Nathan's tests showed that we needed this.
	RANLIB="ar ts"
   elif test $osversion = 5 ; then
        # Turn off warnings about long doubles not being supported.
	if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 728"
	    # Other useful woff values are: 852,635,813,831,835
        fi
   elif test $osversion = 6 ; then
#       these flags settings are handled by including MDEPCFLAGS from p4
	SYMTYPE=""
	if test $cputype = 8000 -o $cputype = 10000 ; then
	    if test -n "$arch_IRIX64" ; then
	        SYMTYPE="-64 -mips4"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
	elif test $cputype -gt 4000 ; then
	    if test -n "$arch_IRIX64" ; then
		SYMTYPE="-64 -mips3"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
        else
	    # According to winfrid.tschiedel@mch.sni.de, need -n32 for R4000
	    SYMTYPE="-n32"
            # Not "-n32 -mips3"?
        fi
	if test -n "$P4_MDEPFFLAGS" ; then
	    # This no longer works.  At least at MCS, the Fortran compiler
	    # won't accept these.
	    addflags=0
	    
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 Fortran compiler accepts option $P4_MDEPFFLAGS""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option $P4_MDEPFFLAGS""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="$P4_MDEPFFLAGS $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with $P4_MDEPFFLAGS can be linked with ones compiled without $P4_MDEPFFLAGS""... $ac_c"
else
echo $ac_n "checking that routines compiled with $P4_MDEPFFLAGS can be linked with ones compiled without $P4_MDEPFFLAGS""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			addflags=1
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> 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
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> 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
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> 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
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


	    if test $addflags = 1 ; then 
                FFLAGS="$FFLAGS $P4_MDEPFFLAGS"
	    fi
        fi
        # Warning flags are > 1000
#       CFLAGS="$CFLAGS -woff 1152,1174,1184"
#       1184 not in the p4 list
        if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 1184,1174"
        fi
	# Check whether we need to add SYMTYPE to CFLAGS and FFLAGS
	hasarg=`echo A$CFLAGS | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#       override SYMTYPE computed above (2/21)
        SYMTYPE=""
	if test -z "$hasarg" ; then
            CC="$CC $SYMTYPE"
	    F77="$F77 $SYMTYPE"
	    CLINKER="$CC $SYMTYPE"
	    FLINKER="$F77 $SYMTYPE"
#	else 
#	    hasarg=`echo A$CLINKER | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#	    if test -z "$hasarg" ; then
#		# We need to make the linker compatible with the compiler.
#	    fi
	fi
   fi
   echo "Messages about long doubles not being supported are being suppressed"
   fi

# for symm_ptx, add the ptx_ifile to  LIB_LIST
if test -n "$arch_symm_ptx"; then
  LIB_LIST="$LIB_LIST $MPIR_HOME/ptx_ifile"
fi

# check whether --arch=intelnx was given
# Use this for both i860 and Delta
if test -n "$arch_intelnx"; then
  DEFAULT_MACHINE="i860"
  # Note that RANLIB may be set incorrectly if we are cross-compiling...
  RANLIB=true
  # inteldelta is used to select the appropriate args to killproc...
  DEVCFLAGS="$DEVCFLAGS -Dinteldelta"
  #
  # X11 includes are in /usr/ipsc/XDEV/i860/include-ipsc/X11
  # X11 libs are in /usr/ipsc/XDEV/i860/lib-coff
  # at least on one system
fi

# check whether --arch=paragon was given
if test -n "$arch_paragon"; then
  DEFAULT_MACHINE="paragon"
  #OPTFLAGS="-O"
  # Note that RANLIB may be set incorrectly if we are cross-compiling...
  RANLIB=true
  #echo "If you get errors about killproc, uncomment this line"
  #DEVCFLAGS="$DEVCFLAGS -DPARAGON_HAS_NO_KILLPROC"
fi


if test -n "$arch_CRAY"; then
   # The CRAY cp doesn't even support -r (!!) but at least there 
   # is a version that does work.
   if test -x /usr/ucb/cp ; then
       CPRP="/usr/ucb/cp"
   else
       print_error "Using default cp for copy; install may fail if -r and -p"
       print_error "switches are not supported."
   fi
   # It might be better to use AR="bld qvz" than the regular ar clr
   DEVCFLAGS="$DEVCFLAGS -DMPID_FLOAT_CRAY"
   # We might want to add
   # -DMPIR_FORT_INT_T=long
   # to the defines.
   # According to Laurie Costello <lmc@cray.com>, the Triton needs this
   # definition
   # If tested code does NOT compile, then define _TWO_WORD_FCD
   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 TWO_WORD_FCDs are used""... $ac_c"
else
echo $ac_n "checking for whether TWO_WORD_FCDs are used""... $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 <fortran.h>
int main() { exit(0); }
int t() { void  *buf;_fcd temp;temp = _fcdtocp(buf); }
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*
  compile_check=yes

else
  rm -rf conftest*
  compile_check=no
    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 "$compile_check" = "no" ; then
    TEMP_CFLAGS=$CFLAGS
    CFLAGS="-D_TWO_WORD_FCD $CFLAGS"
    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 program compiles if _TWO_WORD_FCD is defined ""... $ac_c"
else
echo $ac_n "checking for whether program compiles if _TWO_WORD_FCD is defined ""... $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 <fortran.h>
int main() { exit(0); }
int t() { void  *buf;_fcd temp;temp = _fcdtocp(buf); }
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*
  compile_check=yes

else
  rm -rf conftest*
  compile_check=no
    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 "$compile_check" = "no" ; then
	print_error "You may have problems compiling the Fortran interface",
	print_error "specifically calls to  _fcdtocp"
    elif test "$compile_check" = "yes" ; then
        
{
test -n "$verbose" && \
echo "	defining _TWO_WORD_FCD"
echo "#define" _TWO_WORD_FCD 1 >> confdefs.h
DEFS="$DEFS -D_TWO_WORD_FCD=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_TWO_WORD_FCD\${SEDdB}_TWO_WORD_FCD\${SEDdC}1\${SEDdD}
\${SEDuA}_TWO_WORD_FCD\${SEDuB}_TWO_WORD_FCD\${SEDuC}1\${SEDuD}
\${SEDeA}_TWO_WORD_FCD\${SEDeB}_TWO_WORD_FCD\${SEDeC}1\${SEDeD}
"
}

    fi
    CFLAGS=$TEMP_CFLAGS
fi
   # 
fi
#
# The compilers are in /mpp/bin (at least on some systems)
# You may also need 
# setenv TARGET cray-t3d
# Also need -lsma library
if test -n "$arch_cray_t3d"; then
   is_adi1=0
   DEFAULT_MACHINE="cray_t3d"
   LIB_LIST="$LIB_LIST -lsma"
   RANLIB=true
   # dbxerr not supported by T3D (-mpedbg)
   MPE_MPI_EXT_C="mpehname.c"
   MPE_MPI_EXT_O="mpehname.o"
   
{
test -n "$verbose" && \
echo "	defining MPI_NO_MPEDBG"
echo "#define" MPI_NO_MPEDBG 1 >> confdefs.h
DEFS="$DEFS -DMPI_NO_MPEDBG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPI_NO_MPEDBG\${SEDdB}MPI_NO_MPEDBG\${SEDdC}1\${SEDdD}
\${SEDuA}MPI_NO_MPEDBG\${SEDuB}MPI_NO_MPEDBG\${SEDuC}1\${SEDuD}
\${SEDeA}MPI_NO_MPEDBG\${SEDeB}MPI_NO_MPEDBG\${SEDeC}1\${SEDeD}
"
}

   # The CRAY cp doesn't even support -r (!!) but at least there 
   # is a version that does work.
   if test -x /usr/ucb/cp ; then
       CPRP="/usr/ucb/cp"
   else
       print_error "Using default cp for copy; install may fail if -r and -p"
       print_error "switches are not supported."
   fi
   #  ASMFILES_O="shmem_stack.o get_stack.o"
   # Some users needed /mpp/bin/asm, others /opt/ctl/bin/cam
   for asm in /mpp/bin/cam /opt/ctl/bin/cam /mpp/bin/asm ; do
       if test -s $asm ; then
           ASM=$asm
           break
       fi
   done
   if test -z "$ASM" ; then 
        print_error Cannot find assembler needed to build MPICH
        print_error Neither /mpp/bin/cam, /opt/ctl/bin/cam,  nor 
        print_error /mpp/bin/asm is available
        exit 1
   fi
   # 
   # This is needed for the Fortran interfaces (also for the triton CRAY TS)
   
{
test -n "$verbose" && \
echo "	defining _TWO_WORD_FCD"
echo "#define" _TWO_WORD_FCD 1 >> confdefs.h
DEFS="$DEFS -D_TWO_WORD_FCD=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_TWO_WORD_FCD\${SEDdB}_TWO_WORD_FCD\${SEDdC}1\${SEDdD}
\${SEDuA}_TWO_WORD_FCD\${SEDuB}_TWO_WORD_FCD\${SEDuC}1\${SEDuD}
\${SEDeA}_TWO_WORD_FCD\${SEDeB}_TWO_WORD_FCD\${SEDeC}1\${SEDeD}
"
}

fi

# In default (pre-ANSI) mode, nested #if's cause most of the file to
# be SILENTLY skipped.  
if test -n "$arch_hpux" -o -n "$arch_sppux" ; then
    if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
       ASMFILES_O="amem.o"
       DEVCFILES="mem.c"
       DEVOFILES="mem.o"
    fi
    if test -n "$device_ch_shmem" -a -n "$comm_convex_spp" ; then
       DEVCFILES="shmem1stbar.c cnxCxdb.c cnxQuerySC.c cnxGlobalop.c cnxCopy.c"
       DEVOFILES="shmem1stbar.o cnxCxdb.o cnxQuerySC.o cnxGlobalop.o cnxCopy.o"
    fi
    # We can also remove +U77 and -lU77 from the p4 lib/defs.all file.
fi

if test -n "$arch_UXPM" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
    
{
test -n "$verbose" && \
echo "	defining FORTRAN_SPECIAL_FUNCTION_PTR"
echo "#define" FORTRAN_SPECIAL_FUNCTION_PTR 1 >> confdefs.h
DEFS="$DEFS -DFORTRAN_SPECIAL_FUNCTION_PTR=1"
SEDDEFS="${SEDDEFS}\${SEDdA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDdB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDdC}1\${SEDdD}
\${SEDuA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDuB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDuC}1\${SEDuD}
\${SEDeA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDeB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDeC}1\${SEDeD}
"
}

    # Suggested values for these are
    #CFLAGS=-O
        FLINKER=frt
    FLIBS="$(FLIB_PATH) $(LIB_LIST)"
fi
if test -n "$arch_uxpv" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
    
{
test -n "$verbose" && \
echo "	defining FORTRAN_SPECIAL_FUNCTION_PTR"
echo "#define" FORTRAN_SPECIAL_FUNCTION_PTR 1 >> confdefs.h
DEFS="$DEFS -DFORTRAN_SPECIAL_FUNCTION_PTR=1"
SEDDEFS="${SEDDEFS}\${SEDdA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDdB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDdC}1\${SEDdD}
\${SEDuA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDuB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDuC}1\${SEDuD}
\${SEDeA}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDeB}FORTRAN_SPECIAL_FUNCTION_PTR\${SEDeC}1\${SEDeD}
"
}

    # Suggested values for these are
    #CFLAGS=-O
    # Thanks to Winfrid Tschiedel <Winfrid.Tschiedel@mch.sni.de> for
    # this information
        FLINKER="frt  -sc -Wl,-dy" # it works already and it is close the final solution
    # This isn't quite correct, but at least this is a place to put this 
    # information.
    FLIBS="$(FLIB_PATH) $(LIB_LIST)"
fi
#
# Not all versions of gcc support -munalign-doubles!
#if test -n "$arch_sun4" -o -n "$arch_solaris" ; then
#    if test "$CC" = "gcc" -a "$NOF77" = 0 ; then
#        CC="$CC -munaliged-doubles"
#    fi
#fi
#
# check whether --comm=p4 was given
if test -n "$comm_p4"; then
  echo "Please use -device=ch_p4 instead of -device=chameleon -comm=p4"
  exit 1
fi

# This really needs to look at arches of the form SX_4_float[012] and
# SX_4_float2_int64
issx4=`expr "$ARCH" : "\(SX_4_float\)012"`
if test "$issx4" = "SX_4_float" ; then
    arch_SX4=1
fi
if test -n "$arch_SX4" ; then 
    # The -pvctl,nomsg option suppresses "vec inf: Unvectorized loop"
    # messages from the compiler.  Need to test that this is a valid
    # option....
    # Also note that it causes -hobjlst (assembly listing) to silently fail.
        if test -n "$device_ch_lfshmem" ; then
       ASMFILES_O="vtest1.o syncvset0.o syncvset1.o vmemcpy.o tslock.o tsunlock.o tslock_init.o"
       DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_TSLOCKS -DMPID_USE_SX4_VOPS"
#
	if test -z "$sx4int" ; then
	    if test "$ARCH" = SX_4_float2_int64 ; then
		sx4int=int64
	    else
	        sx4int=int32
	    fi
	fi
       for file in $ASMFILES_O
       do
          files=`echo $file | sed -e "s/.o$/.s/"`
          rm -f mpid/$DEVICE/$files
          cp mpid/$DEVICE/sx4_$sx4int/$files mpid/$DEVICE/$files
       done
    else
       DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_SEMOP"
    fi
    DEVCFLAGS="$DEVCFLAGS -DHAVE_SHMAT=1 -DHAVE_SEMOP=1 -DRETSIGTYPE=void -DHAVE_SIGACTION -DMPI_SX_4 -DMPID_SETUP_SIGNALS"
fi
# check whether --comm=pvm3 was given
if test -n "$comm_pvm3"; then
  echo "PVM 3 no longer supported."
  echo "Note that MPICH was NEVER implemented on top of PVM; PVM was merely"
  echo "one of the many devices supported from the very beginning."
  exit 1
fi

#
# Finally, we are ready to check to see if we are cross-compiling.
#
if test $cross_compiling = 0 ; 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 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

fi
if test $cross_compiling = 1 ; then
    if test $DEVICE = ch_shmem -o $DEVICE = ch_p4 -o $DEVICE = ch_tcp -o \
	$DEVICE = ch_lfshmem ; then
        print_error "Configure was unable to compile and run a simple program."
    fi
fi
#
# Some devices use gettimeofday.  If this is one of them, check to see 
# what form it is
if test -n "$arch_solaris" -o -n "$arch_SX_4" ; 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 how many arguments gettimeofday takes""... $ac_c"
else
echo $ac_n "checking for how many arguments gettimeofday takes""... $ac_c" 1>&1
fi
# Test sets "wierd" only for FAILURE to accept 2
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/time.h>
main() {struct timeval tp;
gettimeofday(&tp,(void*)0);return 0;}
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""two - whew"
else
echo "$ac_t""two - whew" 1>&1
fi


else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""one!"
else
echo "$ac_t""one!" 1>&1
fi
DEVCFLAGS="$DEVCFLAGS -DUSE_WIERDGETTIMEOFDAY"
fi
rm -fr conftest*

fi

# Look for sigaction routine (instead of signal)
# 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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

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 for struct sigaction""... $ac_c"
else
echo $ac_n "checking for for struct sigaction""... $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 <signal.h>
int main() { exit(0); }
int t() { 
struct sigaction act; sigaddset( &act.sa_mask, SIGINT ); }
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*
  sigaction_ok="yes"

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

#
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
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 weak symbol support""... $ac_c"
else
echo $ac_n "checking for weak symbol support""... $ac_c" 1>&1
fi
if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

#pragma weak PFoo = Foo
int Foo(a) { return a; }

int main() { return 0; }
int t() {
return PFoo(1);
; return 0; }
EOF
rm -f conftest.out
if test -z "$ac_link" ; then
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
fi
if eval $ac_link; then
  rm -rf conftest*
  has_pragma_weak=1
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
fi
rm -f conftest*

if test "$has_pragma_weak" = 1 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""pragma weak"
else
echo "$ac_t""pragma weak" 1>&1
fi
else
    if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

#pragma _HP_SECONDARY_DEF Foo = PFoo
int Foo(a) { return a; }

int main() { return 0; }
int t() {
return PFoo(1);
; return 0; }
EOF
rm -f conftest.out
if test -z "$ac_link" ; then
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
fi
if eval $ac_link; then
  rm -rf conftest*
  has_pragma_hp_secondary=1
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
fi
rm -f conftest*

    if test "$has_pragma_hp_secondary" = 1 ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""pragma _HP_SECONDARY_DEF"
else
echo "$ac_t""pragma _HP_SECONDARY_DEF" 1>&1
fi
    else
        if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

#pragma _CRI duplicate PFoo as Foo
int Foo(a) { return a; }

int main() { return 0; }
int t() {
return PFoo(1);
; return 0; }
EOF
rm -f conftest.out
if test -z "$ac_link" ; then
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
fi
if eval $ac_link; then
  rm -rf conftest*
  has_pragma_cri_duplicate=1
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
fi
rm -f conftest*

        if test "$has_pragma_cri_duplicate" = 1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""pragma _CRI duplicate x as y"
else
echo "$ac_t""pragma _CRI duplicate x as y" 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
fi
#
# Check for remote shell program
#
if test -z "$rshcommand" ; then
    for p in remsh rsh
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$RSHCOMMAND"; then
  ac_pg_RSHCOMMAND="$RSHCOMMAND" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_RSHCOMMAND="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_RSHCOMMAND="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;RSHCOMMAND="$ac_pg_RSHCOMMAND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($RSHCOMMAND)"
else
echo "$ac_t""found $ac_prog_where ($RSHCOMMAND)" 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

test -n "$RSHCOMMAND" && break
done
if test -z "$RSHCOMMAND" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    RSHCOMMAND=""
fi

    rshcommand="$RSHCOMMAND"
fi
#
# Check for perl and perl version
for p in perl5 perl
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$PERL"; then
  ac_pg_PERL="$PERL" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_PERL="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_PERL="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;PERL="$ac_pg_PERL"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($PERL)"
else
echo "$ac_t""found $ac_prog_where ($PERL)" 1>&1
fi
   PERLFULLPATH=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

test -n "$PERL" && break
done
if test -z "$PERL" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    PERL=""
fi

if test -n "$PERL" ; then
    PERL="$PERLFULLPATH"
    
    perlversion=`$PERL -v | grep 'This is perl' | \
	sed -e 's/^.*version *\([0-9]\).*$/\1/'`
    
    # Should do a test first for ch_p4 etc.
    if test "$perlversion" != 5 ; then
        echo "Some scripts require perl version 5, which configure did not find."
        echo "You can set the environment variable PERL to contain the "
        echo "location of perl version 5."
	echo "Configure believes that $PERL is version $perlversion ."
	PERL=""
    fi
    
fi
#
# Check for Fortran
if test $HAS_F77 = 0 -a $NOF77 = 0 ; then
    NOF77=1
    HAS_FORTRAN=0
    
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

        MPI_FOBJECTS="" 
elif test $HAS_F77 = 1 ; then
    # msg_yes set to yes if the command line routine is found
    msg_yes=no
    # Some Fortran compilers want -lU77 to get getarg etc.
    # Create a test program for these functions.
    # Note that there has been an unfortunate split in the Fortran
    # command line support from Unix.  Apparently, POSIX defines
    # *DIFFERENT* interface, call pxfgetarg(i,str,len,ierr), for
    # getarg.  We need to rearrange these tests to try the various 
    # different interfaces.  
cat > conftest.f <<EOF
        program main
$F90UNIX
        integer i
        character*20 s

	$F77GETARGDECL
        $F77GETARG
        i=$F77IARGC
        end
EOF
     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 Fortran has routines to get commandline""... $ac_c"
else
echo $ac_n "checking that Fortran has routines to get commandline""... $ac_c" 1>&1
fi
     if $F77 $FFLAGS -o conftest conftest.f $FLIBS > /dev/null 2>&1 ; then
        if test -x conftest ; 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
	    msg_yes=yes
        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
     if test "$msg_yes" = "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 that -lU77 provides commandline functions""... $ac_c"
else
echo $ac_n "checking that -lU77 provides commandline functions""... $ac_c" 1>&1
fi
         FLIBSAVE="$FLIBS"
         FLIBS="-lU77 $FLIBS"
         if $F77 $FFLAGS -o conftest conftest.f $FLIBS > /dev/null 2>&1 ; then
	     if test -x conftest ;  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
	         FLIB_LIST="$FLIB_LIST $FLIBS"
	         msg_yes=yes
             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
     fi
     if test "$msg_yes" = "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 that -N109 compile option works with -lU77""... $ac_c"
else
echo $ac_n "checking that -N109 compile option works with -lU77""... $ac_c" 1>&1
fi
         FFLAGS_SAVE="$FFLAGS"
	 FFLAGS="-N109 $FFLAGS"
         if $F77 $FFLAGS -o conftest conftest.f $FLIBS > /dev/null 2>&1 ; then 
	     if test -x conftest ; 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
	         FLIB_LIST="$FLIB_LIST $FLIBS"
	         msg_yes=yes
	         USER_SET_F90FLAGS=1
	     else
	         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	         FLIBS="$FLIBSAVE"
	         FFLAGS="$FFLAGS_SAVE"
	     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 
     # If at the end of all the tests we haven't found a workable solution,
     # report the problem.
     if test "$msg_yes" = "no" ; then
	 F77GETARGDECL=""
	 F77GETARG="print *, 'ERROR - CANNOT FIND COMMAND LINE ARGS'"
	 F77IARGC=0
	 print_error "Command line options will not work with Fortran"
	 print_error "You will not be able to run MPI programs "
	 print_error "if MPI_INIT is called from Fortran."
     fi
     
   # Check for strange behavior of Fortran.  For example, some FreeBSD
   # systems use f2c to implement f77, and the version of f2c that they 
   # use generates TWO (!!!) trailing underscores
   # Currently, WDEF is not used but could be...
   #
   # Eventually, we want to be able to override the choices here and
   # force a particular form.  This is particularly useful in systems
   # where a Fortran compiler option is used to force a particular
   # external name format (rs6000 xlf, for example).
   cat > confftest.f <<EOF
       subroutine mpir_init_fop( a )
       integer a
       a = 1
       return
       end
EOF
   $F77 $FFLAGS -c confftest.f > /dev/null 2>&1
   if test ! -s confftest.o ; then
        print_error "Unable to test Fortran compiler"
        print_error "(compiling a test program failed to produce an "
        print_error "object file)."
	NOF77=1
        HAS_FORTRAN=0
   elif test -z "$FORTRANNAMES" ; then
    # We have to be careful here, since the name may occur in several
    # forms.  We try to handle this by testing for several forms
    # directly.
    if test $arch_CRAY ; then
     # Cray doesn't accept -a ...
     nameform1=`strings confftest.o | grep mpir_init_fop_  | sed -n -e '1p'`
     nameform2=`strings confftest.o | grep MPIR_INIT_FOP   | sed -n -e '1p'`
     nameform3=`strings confftest.o | grep mpir_init_fop   | sed -n -e '1p'`
     nameform4=`strings confftest.o | grep mpir_init_fop__ | sed -n -e '1p'`
    else
     nameform1=`strings -a confftest.o | grep mpir_init_fop_  | sed -n -e '1p'`
     nameform2=`strings -a confftest.o | grep MPIR_INIT_FOP   | sed -n -e '1p'`
     nameform3=`strings -a confftest.o | grep mpir_init_fop   | sed -n -e '1p'`
     nameform4=`strings -a confftest.o | grep mpir_init_fop__ | sed -n -e '1p'`
    fi
    /bin/rm -f confftest.f confftest.o
    if test -n "$nameform4" ; then
	echo "Fortran externals are lower case and have 1 or 2 trailing underscores"
	FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
    elif test -n "$nameform1" ; then
        # We don't set this in CFLAGS; it is a default case
        echo "Fortran externals have a trailing underscore and are lowercase"
	FORTRANNAMES="FORTRANUNDERSCORE"
    elif test -n "$nameform2" ; then
	echo "Fortran externals are uppercase"     
	FORTRANNAMES="FORTRANCAPS" 
    elif test -n "$nameform3" ; then
	echo "Fortran externals are lower case"
	FORTRANNAMES="FORTRANNOUNDERSCORE"
    else
	print_error "Unable to determine the form of Fortran external names"
	print_error "Make sure that the compiler $F77 can be run on this system"
#	print_error "If you have problems linking, try using the -nof77 option"
#        print_error "to configure and rebuild MPICH."
	print_error "Turning off Fortran (-nof77 being assumed)."
	NOF77=1
        HAS_FORTRAN=0
    fi
#   case $nameform in 
#       MPIR_INIT_FOP | _MPIR_INIT_FOP)
#	echo "Fortran externals are uppercase"     
#	WDEF=-DFORTRANCAPS 
#	;;
#       mpir_init_fop_ | _mpir_init_fop_)   
#	 # We don't set this in CFLAGS; it is a default case
#        echo "Fortran externals have a trailing underscore and are lowercase"
#	WDEF=-DFORTRANUNDERSCORE ;;
#
#       mpir_init_fop | _mpir_init_fop)     
#	echo "Fortran externals are lower case"
#	WDEF=-DFORTRANNOUNDERSCORE 
#	;;
#
#           # Fortran no underscore is the "default" case for the wrappers; 
#	   # having this defined allows us to have an explicit test, 
#	   # particularly since the most common UNIX case is FORTRANUNDERSCORE
#       mpir_init_fop__ | _mpir_init_fop__)  
#	echo "Fortran externals are lower case and have 1 or 2 trailing underscores"
#	WDEF=-DFORTRANDOUBLEUNDERSCORE
#        ;;
#
#       *)
#	print_error "Unable to determine the form of Fortran external names"
#	print_error "If you have problems linking, try using the -nof77 option"
#        print_error "to configure and rebuild MPICH."
#	NOF77=1
#        HAS_FORTRAN=0
#	;;
#   esac
    fi
    if test -n "$FORTRANNAMES" ; then
        WDEF="-D$FORTRANNAMES"
    fi
    
     if test $HAS_FORTRAN = 0 ; then
         	 
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

         MPI_FOBJECTS=""
     elif test -n "$WDEF" ; then
         CFLAGS="$CFLAGS $WDEF"
     fi
fi  #elif
if test $HAS_FORTRAN != 0 ; 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 Fortran include argument""... $ac_c"
else
echo $ac_n "checking for Fortran include argument""... $ac_c" 1>&1
fi
cat > $MPIR_HOME/include/conftestf.h <<EOF
       call sub()
EOF
cat > conftest.f <<EOF
       program main
       include 'conftestf.h'
       end
EOF
if $F77 $FFLAGS -c -I$MPIR_HOME/include conftest.f > /dev/null 2>&1 ; then
    FINC="-I@MPIR_HOME@/include"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""supports -I for include"
else
echo "$ac_t""supports -I for include" 1>&1
fi
else
    true
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""does NOT support -I for include"
else
echo "$ac_t""does NOT support -I for include" 1>&1
fi
fi
/bin/rm -f conftest.f $MPIR_HOME/include/conftestf.h

    # some systems support FINC="-Wf,-I@MPIR_HOME@/include" (SGI for one)
    # If I can find others, I'll try them.  For this, I'll need
    # to test for it (the test above tries -I$1 for a file created for the test)

    
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 accepts ! for comments""... $ac_c"
else
echo $ac_n "checking for Fortran accepts ! for comments""... $ac_c" 1>&1
fi
cat > conftest.f <<EOF
       program main
!      This is a comment
       end
EOF
if $F77 $FFLAGS -c conftest.f > /dev/null 2>&1 ; then
    fixupmpif=yes
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
else
    fixupmpif=no
    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.f


    # Check that pmpi_wtime and pmpi_wtick can be in the mpif.h file
    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 unused externals are ok""... $ac_c"
else
echo $ac_n "checking that unused externals are ok""... $ac_c" 1>&1
fi
    rm -f conftest*
    cat > conftest.f <<EOF
        program main
        external bar
        end
EOF
    if $F77 $FFLAGS -o conftest conftest.f >conftest.out 2>&1 ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	MPIFPMPI=",PMPI_WTIME, PMPI_WTICK"
    else 
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	MPIFPMPI=""
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
	print_error "Removed PMPI_WTIME and PMPI_WTICK from mpif.h"
	print_error
    fi   
    
    rm -f conftest* 
    # Check for extra Fortran types
       
FIX_FILE=0
FORT_INT1=1
FORT_INT2=1
FORT_INT4=1
FORT_INT8=1
FORT_REAL4=1
FORT_REAL8=1
FORT_DOUBLE_COMPLEX=1
COUNT=13
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 integer * 1""... $ac_c"
else
echo $ac_n "checking for integer * 1""... $ac_c" 1>&1
fi
cat > testfort.f <<EOF
        subroutine forttype( a )
        integer*1 a
        return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_INT1=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 integer * 2""... $ac_c"
else
echo $ac_n "checking for integer * 2""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        integer*2 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_INT2=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 integer * 4""... $ac_c"
else
echo $ac_n "checking for integer * 4""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        integer*4 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_INT4=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 integer * 8""... $ac_c"
else
echo $ac_n "checking for integer * 8""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        integer*8 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_INT8=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 integer * 16""... $ac_c"
else
echo $ac_n "checking for integer * 16""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        integer*16 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_INT16=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 real * 4""... $ac_c"
else
echo $ac_n "checking for real * 4""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        real*4 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_REAL4=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 real * 8""... $ac_c"
else
echo $ac_n "checking for real * 8""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        real*8 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_REAL8=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 real * 16""... $ac_c"
else
echo $ac_n "checking for real * 16""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        real*16 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_REAL16=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 double complex""... $ac_c"
else
echo $ac_n "checking for double complex""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        double complex a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_DOUBLE_COMPLEX=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 complex * 8""... $ac_c"
else
echo $ac_n "checking for complex * 8""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        complex*8 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_COMPLEX8=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 complex * 16""... $ac_c"
else
echo $ac_n "checking for complex * 16""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        complex*16 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_COMPLEX16=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
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 complex * 32""... $ac_c"
else
echo $ac_n "checking for complex * 32""... $ac_c" 1>&1
fi
    cat > testfort.f <<EOF
        subroutine forttype( a )
        complex*32 a
	return
        end
EOF
   $F77 $FFLAGS -c testfort.f > /dev/null 2>&1
   if test ! -s testfort.o ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
       FORT_COMPLEX32=0
       FIX_FILE=1
       COUNT=`expr ${COUNT} - 1`
   else
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
   fi
   /bin/rm -f testfort.f testfort.o
   
    # Defines FORT_INT1=1, FORT_INT2=1, FORT_INT4=1, FORT_INT8=1,
    # FORT_INT16=1, FORT_REAL4=1, 
    # FORT_REAL8=1, FORT_REAL16=1, FORT_COMPLEX8=1, FORT_COMPLEX16=1,
    # FORT_COMPLEX32=1, FORT_DOUBLE_COMPLEX=1 if the types are available.
    # For each defined type, find the corresponding C MPI_DATATYPE.
    # If none can be found, use MPI_DATATYPE_NULL.
    for c_type in char short int long "long long" float double "long double"; do
	Pac_name="$c_type"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
typelen=$Pac_CV_NAME

    done
    if test -z "$FORT_REAL_LEN" ; 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 size of Fortran REAL""... $ac_c"
else
echo $ac_n "checking for size of Fortran REAL""... $ac_c" 1>&1
fi
/bin/rm -f conftestval
/bin/rm -f conftestf.f conftestf.o
cat <<EOF > conftestf.f
      subroutine isize( )
      real i(2)
      call cisize( i(1), i(2) )
      end
EOF
if $F77 $FFLAGS -c conftestf.f >/dev/null 2>&1 ; then 
    SaveLIBS="$LIBS"
    LIBS="conftestf.o $LIBS"
    

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>
#ifdef FORTRANCAPS
#define cisize_ CISIZE
#define isize_  ISIZE
#elif defined(FORTRANNOUNDERSCORE)
#define cisize_ cisize
#define isize_  isize
#endif
static int isize_val;
void cisize_( i1p, i2p )
char *i1p, *i2p;
{
	isize_val = (i2p - i1p) * sizeof(char);
}
main() { 
  FILE *f=fopen("conftestval","w");
  
  if (!f) exit(1);
  isize_();
  fprintf( f, "%d\n", isize_val);
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

LIBS="$SaveLIBS"
else
   :
fi
/bin/rm -f conftestf.f conftestf.o
if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
fi
fort_real_len=$Pac_CV_NAME

	if test -z "$fort_real_len" ; then
	    print_error "Unable to determine the length of a FORTRAN real"
	    print_error "You can set the environment variable FORT_REAL_LEN"
	    print_error "with the number of bytes in a FORTRAN real and rerun"
	    print_error "configure."
	fi
    else 
	fort_real_len=$FORT_REAL_LEN
    fi
    # Set the corresponding MPI_Datatypes
    char_mpi=1
    short_mpi=4
    int_mpi=6
    long_mpi=8
    long_long_mpi=13
    float_mpi=10
    double_mpi=11
    long_double_mpi=13
    # Warning: float_cplx is Fortran COMPLEX, not (float,float)
    float_cplx_mpi=23
    # Warning: double_cplx is Fortran DOUBLE COMPLEX, not (double,double)
    double_cplx_mpi=24
    for len in 1 2 4 8 16 ; do
        eval testval=\$"FORT_INT$len"
        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 INTEGER*$len""... $ac_c"
else
echo $ac_n "checking for Fortran INTEGER*$len""... $ac_c" 1>&1
fi
        found=0
	if test "$testval" = 1 ; then
	    for c_type in char short int long "long_long" ; do
		eval typelen=\$"${c_type}"_len
		if test $len = "$typelen" ; then
		    # Fortran type FORT_INT$len corresponds to C type
		    # $ctype
		    eval FORT_INT$len=\$"${c_type}_mpi"
		    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found"
else
echo "$ac_t""found" 1>&1
fi
		    found=1
		    break
		fi 
            done
        fi
        if test $found = 0 ; then
	    eval FORT_INT$len=0
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""not supported"
else
echo "$ac_t""not supported" 1>&1
fi
        fi
    done
    for len in 4 8 16 ; do
	# Use len2 for Complex.
        len2=`expr $len + $len`
	lenby2=`expr $len / 2`
        eval testval=\$"FORT_REAL$len"
        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 REAL*$len and COMPLEX*$len2""... $ac_c"
else
echo $ac_n "checking for Fortran REAL*$len and COMPLEX*$len2""... $ac_c" 1>&1
fi
        found=0
	if test "$testval" = 1 ; then
	    for c_type in float double "long_double" ; do
		eval typelen=\$"${c_type}"_len
		if test $len = "$typelen" ; then
		    # Fortran type FORT_REAL$len corresponds to C type
		    # $ctype
		    eval FORT_REAL$len=\$"${c_type}_mpi"
		    # Notes that we may not have been able to determine 
		    # fort_real_len
		    # The corresponding Complex type
		    if test "$fort_real_len" = "$len" ; then 
			eval FORT_COMPLEX$len2=$float_cplx_mpi
		    elif test "$fort_real_len" = "$lenby2" ; then
			eval FORT_COMPLEX$len2=$double_cplx_mpi
		    else
			eval FORT_COMPLEX$len2=0
		    fi
		    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found"
else
echo "$ac_t""found" 1>&1
fi
		    found=1
		    break
		fi 
            done
        fi
        if test $found = 0 ; then
	    eval FORT_REAL$len=0
            eval FORT_COMPLEX$len2=0
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""not supported"
else
echo "$ac_t""not supported" 1>&1
fi
        fi
    done
    
    
    
    
    
    
    
    
    
    
    
#    if test "$fixupmpif" = "yes" ; then
#	if test ! -s include/mpif.h.orig ; then
#	    mv include/mpif.h include/mpif.h.orig
#	fi
#        sed -e 's/^C/\!/g' include/mpif.h.orig > include/mpif.h
#    fi
fi
#
# Check for Fortran 90
# Currently, we allow Fortran 90, but build for Fortran 77.  
# The following definitions must be provided for Fortran 90
# F90     - Name of F90 compiler
# F90INC  - How to specify include/use module directory (often -I<dir>)
# F90FLAGS - Flags to F90 for compilation
# F90LINKER - Name of F90 linker (often $F90)
# F90LIB_PATH - How to specify library search paths (often -L<dir>)
# If F90 is defined but not the other items, take them from the
#   Fortran 77 values
if test -z "$F90" ; then
    if test "$f90nag" = 0 ; then
    # Try to find an F90 compiler
    for p in f90 xlf90
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$F90"; then
  ac_pg_F90="$F90" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_F90="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_F90="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;F90="$ac_pg_F90"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($F90)"
else
echo "$ac_t""found $ac_prog_where ($F90)" 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

test -n "$F90" && break
done
if test -z "$F90" ; then
    # We have to set this outside of the loop lest the first failure in 
    # PROGRAM_CHECK set the value (which then terminates the effect of the
    # loop, since autoconf macros only set values that are null, they 
    # don't override them
    F90=""
fi

    fi
fi
if test -n "$F90" ; then  
    F90_SUFFIX="f90"
    if test "$f90nag" = 0 ; then 
        if test -z "$USER_SET_F90INC" -a -z "$F90INC" ; then 
	    F90INC=$FINC
        fi
        if test -z "$USER_SET_F90FLAGS" -a -z "$F90FLAGS" ; then
	    # We should check these individually; at least things like
            # Fortran shared library flags.
	    F90FLAGS="$FFLAGS"
        fi
        if test -z "$USER_SET_F90LINKER" -a -z "$F90LINKER" ; then
	    F90LINKER="$F90"
        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 $F90 runs""... $ac_c"
else
echo $ac_n "checking that the compiler $F90 runs""... $ac_c" 1>&1
fi
cat >conftest.f <<EOF
          program main
          end
EOF
/bin/rm -f conftest.out
$F90 $F90FLAGS -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 90 compiler returned non-zero return code"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    F90=""
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 90 compiler did not produce object file"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    F90=""
else    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    :
    /bin/mv -f conftest.f conftest.f90
    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 $F90 accepts .f90 suffix""... $ac_c"
else
echo $ac_n "checking that the compiler $F90 accepts .f90 suffix""... $ac_c" 1>&1
fi
    $F90 $F90FLAGS -c conftest.f90 > conftest.out 2>&1
    if test $? != 0 ; then
        F90_SUFFIX="f"
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    else
        F90_SUFFIX="f90"
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    fi
fi
rm -f conftest* 

    fi
    ## Remove all comments from mpif.h
    #if test ! -s include/mpif.h.orig ; then
    #    cp include/mpif.h include/mpif.h.orig
    #fi
    #/bin/rm -f include/mpif.h
    #sed -e 's/^C/\!/g' include/mpif.h.orig > include/mpif.h
fi







#
# Check that the C compiler will generate code that will work with Fortran.
# Fortran requires that doubles be accessible on float/integer boundaries.
# The following C-only code attempts to test this by forcing accesses to
# doubles on an odd number int boundary.
#
# The test program can core dump.  To avoid having core files around,
# we create a non-writable core file
if test $HAS_FORTRAN != 0 ; then
    # If we're cross-compiling, we can't actually tell.  Be quiet and hope
    # for the best.
    touch core
    chmod a-w core
    CC_F77_SAFE=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 that C compiler allows unaligned doubles""... $ac_c"
else
echo $ac_n "checking that C compiler allows unaligned doubles""... $ac_c" 1>&1
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"

void fetch_double();
int main( argc, argv )
int argc;
char **argv;
{
int p[4];
double *p_val;
fetch_double( (double *)&(p[0]) );
p_val = (double *)&(p[0]);
if (*p_val != 1.0) return 1;
fetch_double( (double *)&(p[1]) );
p_val = (double *)&(p[1]);
if (*p_val != 1.0) return 1;
return 0;
}
void fetch_double( v )
double *v;
{
*v = 1.0;
}

EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    CC_F77_SAFE=0

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

      else
	if test CC_F77_SAFE=1 != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        CC_F77_SAFE=0

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

    if test $CC_F77_SAFE = 0 ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!"
else
echo "$ac_t""no!" 1>&1
fi
        print_error "Your C compiler $CC does not support unaligned accesses"
        print_error "to doubles.  This is required for interoperation with "
        print_error "Fortran (the Fortran standard requires it)."
        # See if the compiler is gcc and allows munaligned-doubles
        hasopt=0
        if test "$CC" = "gcc" ; 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 C compiler accepts option -munaligned-doubles""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -munaligned-doubles""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-munaligned-doubles $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
    if test -s conftest.out ; then
        cat conftest.out >> config.log
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        hasopt=0
        CFLAGS="$CFLAGSSAV"         
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&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 routines compiled with -munaligned-doubles can be linked with ones compiled  without -munaligned-doubles""... $ac_c"
else
echo $ac_n "checking that routines compiled with -munaligned-doubles can be linked with ones compiled  without -munaligned-doubles""... $ac_c" 1>&1
fi       
        /bin/rm -f conftest.out
        if ${CC-cc} -c $CFLAGSSAVE conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c >conftest.out 2>&1 ; then
                if test -s conftest.out ; then
	            cat conftest.out >> config.log
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                    print_error "Will not add -munaligned-doubles to CFLAGS"
                    CFLAGS="$CFLAGSSAV"
	            hasopt=0
                else
	            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                    hasopt=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
                print_error "Will not add -munaligned-doubles to CFLAGS"
                CFLAGS="$CFLAGSSAV"
	        hasopt=0
            fi  
        else
            if test -s conftest2.out ; then 
                cat conftest2.out >> config.log 
            fi
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -munaligned-doubles to CFLAGS"
            CFLAGS="$CFLAGSSAV"
            hasopt=0
        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
    hasopt=0
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
    CFLAGS="$CFLAGSSAV"
fi
rm -f conftest*

            if test "$hasopt" = 1 ; then
		
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "Adding -munaligned-double to CFLAGS""... $ac_c"
else
echo $ac_n "Adding -munaligned-double to CFLAGS""... $ac_c" 1>&1
fi
                CFLAGS="$CFLAGS -munaligned-doubles"
            fi
        fi
        if test "$hasopt" = 0 ; then
        print_error "Some C compilers support special options that allow"
	print_error "unaligned access; for gcc, try -munaligned-doubles."
	print_error "Configure will continue, but some Fortran programs"
	print_error "may fail.  Another option is to use a Fortran option"
	print_error "that forces all double precision quantities to be"
	print_error "double aligned; for SunOS, the option is -dalign."
        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
    chmod +w core
    rm -f core
fi
# Check for byte ordering
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 byte ordering""... $ac_c"
else
echo $ac_n "checking byte ordering""... $ac_c" 1>&1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
main () {
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  pac_r=1
fi
rm -fr conftest*
if test -z "$pac_r" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""little endian"
else
echo "$ac_t""little endian" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""big endian"
else
echo "$ac_t""big endian" 1>&1
fi
    
{
test -n "$verbose" && \
echo "	defining WORDS_BIGENDIAN"
echo "#define" WORDS_BIGENDIAN 1 >> confdefs.h
DEFS="$DEFS -DWORDS_BIGENDIAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}WORDS_BIGENDIAN\${SEDdB}WORDS_BIGENDIAN\${SEDdC}1\${SEDdD}
\${SEDuA}WORDS_BIGENDIAN\${SEDuB}WORDS_BIGENDIAN\${SEDuC}1\${SEDuD}
\${SEDeA}WORDS_BIGENDIAN\${SEDeB}WORDS_BIGENDIAN\${SEDeC}1\${SEDeD}
"
}

fi

#
# Check for xdr available and properly installed (our FreeBSD machines
# have incorrect xdr header files, for examples).  Currently, we just
# set a dummy function body and see if rpc/xdr.h is available and
# can be included.
#
# Just to complicate things, some systems have "xdr.h" that is complete
# and can be used by itself; more frequently, xdr.h does NOT include
# definitions that it requires!  rpc.h seems to be more reliable.
#
if test "$IS_HETERO" = 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 for "XDR includes and functions"""... $ac_c"
else
echo $ac_n "checking for "XDR includes and functions"""... $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 <rpc/rpc.h>
int main() { exit(0); }
int t() { 
    int a=1;
     }
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*
  HAS_XDR=1

else
  rm -rf conftest*
  HAS_XDR=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 "$HAS_XDR" = 1 ; then
	
{
test -n "$verbose" && \
echo "	defining HAS_XDR"
echo "#define" HAS_XDR 1 >> confdefs.h
DEFS="$DEFS -DHAS_XDR=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAS_XDR\${SEDdB}HAS_XDR\${SEDdC}1\${SEDdD}
\${SEDuA}HAS_XDR\${SEDuB}HAS_XDR\${SEDuC}1\${SEDuD}
\${SEDeA}HAS_XDR\${SEDeB}HAS_XDR\${SEDeC}1\${SEDeD}
"
}

    else 
        print_error  "XDR not available on this system" 
    fi
fi
# Check for the functions that may be needed by the ADI to implement
# Processor_name.  Save these defines in a special place.
SAVEDEFS="$DEFS"
DEFS=""
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 uname""... $ac_c"
else
echo $ac_n "checking for uname""... $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_uname) || defined (__stub___uname)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char uname(); uname();
#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 HAVE_UNAME"
echo "#define" HAVE_UNAME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_UNAME=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNAME\${SEDdB}HAVE_UNAME\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_UNAME\${SEDuB}HAVE_UNAME\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_UNAME\${SEDeB}HAVE_UNAME\${SEDeC}1\${SEDeD}
"
}
haveuname=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*

for ac_hdr in netdb.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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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

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 gethostbyname""... $ac_c"
else
echo $ac_n "checking for gethostbyname""... $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_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char gethostbyname(); gethostbyname();
#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 HAVE_GETHOSTBYNAME"
echo "#define" HAVE_GETHOSTBYNAME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_GETHOSTBYNAME=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETHOSTBYNAME\${SEDdB}HAVE_GETHOSTBYNAME\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_GETHOSTBYNAME\${SEDuB}HAVE_GETHOSTBYNAME\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_GETHOSTBYNAME\${SEDeB}HAVE_GETHOSTBYNAME\${SEDeC}1\${SEDeD}
"
}
havegethostbyname=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*

if test -z "$havegethostbyname" ; then
    # Try again after adding libnsl.  We do it this way instead of just
    # testing for nsl because some systems (IRIX for one) generate many
    # warning messages when libnsl and libc are combined (!)
    LIBS_save="${LIBS}"
LIBS="${LIBS} -lnsl"
have_lib=""
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 -lnsl""... $ac_c"
else
echo $ac_n "checking for -lnsl""... $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() { main(); }
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*
  have_lib="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*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lnsl";havelibnsl=1
else
   :; 
fi

    if test "$havelibnsl" = 1 ; then
	echo "checking for gethostbyname in libnsl"
        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 gethostbyname""... $ac_c"
else
echo $ac_n "checking for gethostbyname""... $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_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char gethostbyname(); gethostbyname();
#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 HAVE_GETHOSTBYNAME"
echo "#define" HAVE_GETHOSTBYNAME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_GETHOSTBYNAME=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETHOSTBYNAME\${SEDdB}HAVE_GETHOSTBYNAME\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_GETHOSTBYNAME\${SEDuB}HAVE_GETHOSTBYNAME\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_GETHOSTBYNAME\${SEDeB}HAVE_GETHOSTBYNAME\${SEDeC}1\${SEDeD}
"
}
havegethostbyname=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*

    fi
fi
# If we have uname and gethostbyname, we can skip getdomainname ...
if test "$haveuname" != 1 -o "$havegethostbyname" != 1 ; then
    for func in gethostname sysinfo
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

    #
    # systeminfo is needed for sysinfo 
    for ac_hdr in sys/systeminfo.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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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

    #
    # getdomainname is special BECAUSE IT MAY BE USELESS (!Network computing 
    # indeed - stuff like this is why Windows95/NT WILL WIN). 
    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 getdomainname""... $ac_c"
else
echo $ac_n "checking for getdomainname""... $ac_c" 1>&1
fi
if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
#ifdef __cplusplus
extern "C" { char getdomainname(); };
#else
char getdomainname();
#endif
int main() { return 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_getdomainname) || defined (__stub___getdomainname)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
getdomainname();
#endif

; return 0; }
EOF
rm -f conftest.out
if test -z "$ac_link" ; then
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
fi
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_getdomainname=yes"
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
rm -rf conftest*
  eval "ac_cv_func_getdomainname=no"
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_func_'getdomainname`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  has_getdomainname=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_getdomainname=0
fi

    if test $has_getdomainname = 1 -a $cross_compiling = 0 ; then
        # Extract the first word of "domainname", so it can be a program name with args.
set dummy domainname; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_domainname"; then
  ac_pg_has_domainname="$has_domainname" # Let the user override the test.
else
  ac_first_char=`expr "domainname" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "domainname" ; then
       ac_pg_has_domainname="1"
       ac_prog_where=domainname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_domainname="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_domainname" && ac_pg_has_domainname="0"
fi;has_domainname="$ac_pg_has_domainname"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_domainname)"
else
echo "$ac_t""found $ac_prog_where ($has_domainname)" 1>&1
fi
   d_domainname=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

        # Extract the first word of "hostname", so it can be a program name with args.
set dummy hostname; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_hostname"; then
  ac_pg_has_hostname="$has_hostname" # Let the user override the test.
else
  ac_first_char=`expr "hostname" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "hostname" ; then
       ac_pg_has_hostname="1"
       ac_prog_where=hostname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_hostname="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_hostname" && ac_pg_has_hostname="0"
fi;has_hostname="$ac_pg_has_hostname"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_hostname)"
else
echo "$ac_t""found $ac_prog_where ($has_hostname)" 1>&1
fi
   d_hostname=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

        # Extract the first word of "rup", so it can be a program name with args.
set dummy rup; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_rup"; then
  ac_pg_has_rup="$has_rup" # Let the user override the test.
else
  ac_first_char=`expr "rup" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "rup" ; then
       ac_pg_has_rup="1"
       ac_prog_where=rup
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_rup="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_rup" && ac_pg_has_rup="0"
fi;has_rup="$ac_pg_has_rup"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_rup)"
else
echo "$ac_t""found $ac_prog_where ($has_rup)" 1>&1
fi
   d_rup=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

        # Form hostname.domainname, do rup to it
        # rup may not be enabled, but short of running a program to lookup the
        # local host, there does not seem to be a better alternative.
        #
        if test $has_domainname = 1 -a $has_hostname = 1 -a $has_rup = 1 ; then

            fullhost=`$d_hostname | sed -e 's/^\([^\.]*\)\..*/\1/'`

#	    echo $fullhost
            fullhost="${fullhost}.`$d_domainname`"
            response=`($d_rup $fullhost 2>&1) | egrep '(Unknown host|translation failed)'`
#	    echo $fullhost
            if test -n "$response" ; then
   print_error "The getdomainname system routine has been rendered USELESS"
   print_error "on your system.  This is not a bug and will not affect"
   print_error "MPICH.  Some MPE routines (particularly those that"
   print_error "interact with X Windows) may not work."
            else
                
{
test -n "$verbose" && \
echo "	defining HAVE_GETDOMAINNAME"
echo "#define" HAVE_GETDOMAINNAME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_GETDOMAINNAME=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GETDOMAINNAME\${SEDdB}HAVE_GETDOMAINNAME\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_GETDOMAINNAME\${SEDuB}HAVE_GETDOMAINNAME\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_GETDOMAINNAME\${SEDeB}HAVE_GETDOMAINNAME\${SEDeC}1\${SEDeD}
"
}

	    fi
        fi
    fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# Check for message archive routines (to be used for internationalization)
#
SAVEDEFS="$DEFS"
DEFS=""
# 
# Some systems have these in /usr/xpg2lib/libxpg.a (our Suns did)
# The includes (for nl_types) might be in /usr/xpg2include 
# This hasn't been handled yet.
for func in catopen catclose catgets
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

# Will need to generate binary form of file
# !!! We have a report that on Cray, gencat is a completely different command
# (parallel fscks?).  We're supposed to use 
# caterr -c cat_file msg_file.  Instead, we'll skip it
if test -n "$device_td3" ; then 
 # May try caterr -c cat_file msg_file
 print_error "Configure needs the gencat program to generate message catalogs"
 print_error "Some (all?) Cray T3D systems have a program named gencat"
 print_error "that performs file system checks instead.  For this reason,"
 print_error "message catalogs will not be created for the T3D device."
 print_error "You may be able to use the caterr command instead."
 print_error "MPICH will work without the message catalogs (though the"
 print_error "ability to generate error messages in languages other than"
 print_error "US English will be lost)."
else
 # Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_gencat"; then
  ac_pg_has_gencat="$has_gencat" # Let the user override the test.
else
  ac_first_char=`expr "gencat" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "gencat" ; then
       ac_pg_has_gencat="1"
       ac_prog_where=gencat
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_gencat="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_gencat" && ac_pg_has_gencat="0"
fi;has_gencat="$ac_pg_has_gencat"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_gencat)"
else
echo "$ac_t""found $ac_prog_where ($has_gencat)" 1>&1
fi
   d_gencat=$ac_prog_where  
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_gencat = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining HAVE_GENCAT"
echo "#define" HAVE_GENCAT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_GENCAT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_GENCAT\${SEDdB}HAVE_GENCAT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_GENCAT\${SEDuB}HAVE_GENCAT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_GENCAT\${SEDeB}HAVE_GENCAT\${SEDeC}1\${SEDeD}
"
}

    for ac_hdr in nl_types.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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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

    NLS_DEFS="$DEFS"
    # Generate the cataloge
    
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n ""Generating message catalogs"""... $ac_c"
else
echo $ac_n ""Generating message catalogs"""... $ac_c" 1>&1
fi
    # WARNING: IRIX systems seem to use a DIFFERENT MESSAGE CATALOG FORMAT
    # AND (AS USUAL) MAY NOT WORK AS EXPECTED.  This is the "....cat.m" file.
    (cd src/env ; \
    for file in mpich.*.msg ; do \
	fileroot=`basename $file .msg` ; \
        /bin/rm -f $fileroot.cat $fileroot.cat.m ; \
        gencat $fileroot.cat $file > /dev/null 2>&1 ; \
        if test -s $fileroot.cat ; then \
	    /bin/rm -f ../../build/$ARCH/$fileroot.cat ; \
	    cp $fileroot.cat ../../build/$ARCH ; \
        fi ; \
        if test -s $fileroot.cat.m ; then \
	    /bin/rm -f ../../build/$ARCH/$fileroot.cat.m ; \
	    cp $fileroot.cat.m ../../build/$ARCH ; \
        fi ; \
    done \
    )
    if test -s src/env/mpich.En_US.cat ; then
	if test ! -s build/$ARCH/mpich.cat ; then
	   (cd build/$ARCH ; ln -s mpich.En_US.cat mpich.cat )
        fi
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""done""
else
echo "$ac_t"""done"" 1>&1
fi
    else
	# You can't put a ; in the message (!)
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""Could not create catalog. US English messages will be used""
else
echo "$ac_t"""Could not create catalog. US English messages will be used"" 1>&1
fi
    fi
 fi
fi
DEFS="$SAVEDEFS"
#
echo checking for ANSI C header files
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
echo '#include "confdefs.h"
#include <string.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "memchr" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining STDC_HEADERS"
echo "#define" STDC_HEADERS 1 >> confdefs.h
DEFS="$DEFS -DSTDC_HEADERS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
\${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
\${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
"
}


fi
rm -fr conftest*

fi
rm -f conftest*


fi
rm -f conftest*

SAVEDEFS="$DEFS"
DEFS=""
for ac_hdr in stdlib.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
  
  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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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
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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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

ac_safe=`echo "stdarg.h" | 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 stdarg.h""... $ac_c"
else
echo $ac_n "checking for stdarg.h""... $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 <stdarg.h>
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
  
{
test -n "$verbose" && \
echo "	defining HAVE_STDARG_H"
echo "#define" HAVE_STDARG_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_STDARG_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STDARG_H\${SEDdB}HAVE_STDARG_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_STDARG_H\${SEDuB}HAVE_STDARG_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_STDARG_H\${SEDeB}HAVE_STDARG_H\${SEDeC}1\${SEDeD}
"
}

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

#
# It isn't enough to check for stdarg.  Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
if test -n "$havestdarg" ; 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 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*
  
{
test -n "$verbose" && \
echo "	defining USE_STDARG"
echo "#define" USE_STDARG 1 >> confdefs.h
DEFS="$DEFS -DUSE_STDARG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_STDARG\${SEDdB}USE_STDARG\${SEDdC}1\${SEDdD}
\${SEDuA}USE_STDARG\${SEDuB}USE_STDARG\${SEDuC}1\${SEDuD}
\${SEDeA}USE_STDARG\${SEDeB}USE_STDARG\${SEDeC}1\${SEDeD}
"
}

USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG"

   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*

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 malloc return type""... $ac_c"
else
echo $ac_n "checking for malloc return type""... $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 <stdlib.h>
int main() { exit(0); }
int t() { extern void *malloc(); }
EOF
if eval $compile; then
  
  rm -rf conftest*
  eval "ac_cv_malloc=void"

else
  rm -rf conftest*
  eval "ac_cv_malloc=char"
   
fi
rm -f conftest*

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_malloc"
else
echo "$ac_t""$ac_cv_malloc" 1>&1
fi
if test "$ac_cv_malloc" = void ; then
    
{
test -n "$verbose" && \
echo "	defining MALLOC_RET_VOID"
echo "#define" MALLOC_RET_VOID 1 >> confdefs.h
DEFS="$DEFS -DMALLOC_RET_VOID=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MALLOC_RET_VOID\${SEDdB}MALLOC_RET_VOID\${SEDdC}1\${SEDdD}
\${SEDuA}MALLOC_RET_VOID\${SEDuB}MALLOC_RET_VOID\${SEDuC}1\${SEDuD}
\${SEDeA}MALLOC_RET_VOID\${SEDeB}MALLOC_RET_VOID\${SEDeC}1\${SEDeD}
"
}

fi

USER_DEFS="$USER_DEFS $DEFS"
DEFS="$SAVEDEFS $DEFS"
#
# System is used only in MPE; i860's do not support it.
for func in system
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

#
# Nice is used only in env/init.c
for func in nice
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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


   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

#
# Look for headers that might have memset()....
# (string.h might also, but it is also needed by MPE)
for ac_hdr in memory.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"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
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

#
# Turn off F77
# One problem with this is that some part of the ar will fail.  Lets hope
# it isn't fatal.  We've tried to fix this by defining MPI_FOBJECTS
# as the object files created from Fortran.
if test $NOF77 = 1 ; then
  F77="echo no Fortran compiler"
  FLINKER="$F77"
fi
#
#
# Check for erroneous C compilers
broken=0
do_test=1
if test $cross_compiling = 1 ; then
   if test "$CC" = mpcc ; then 
	TESTCC=xlc
   elif test "$CC" = mpCC ; then
        TESTCC=xlC
   else
        do_test=0
   fi
else 
    # If not cross compiling, testcc is just the compiler
    TESTCC="$CC"
fi
# 
# 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 "$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 "$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;
       
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

              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;
       
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

              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* 

    # 
    # This test will allow us to make MPI_BOTTOM a 0 pointer on
    # some (many?) systems.  Currently here just for testing.
    if test $NOF77 = 0 ; 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 Fortran has pointer declaration""... $ac_c"
else
echo $ac_n "checking Fortran has pointer declaration""... $ac_c" 1>&1
fi
cat > conftest.f <<EOF
        program main
        integer M
        pointer (MPTR,M)
        data MPTR/0/
        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
    if test -n "$F77_VERBOSE" ; then
        echo "Fortran compiler returned non-zero return code"
        if test -s conftest.out ; then
	    echo "Output from test was"
            cat conftest.out
        fi
    fi
    f77_pointer=0
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
    if test -n "$F77_VERBOSE" ; then
        echo "Fortran compiler did not produce object file"
        if test -s conftest.out ; then
	    echo "Output from test was"
            cat conftest.out
        fi
    fi
    f77_pointer=0
else    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    f77_pointer=1
fi
rm -f conftest* 

    fi
    # In order to use the Fortran linker to with C programs, it may be
    # necessary to add some libraries from the C linker.  We HOPE that we
    # we can use the -v option with the compiler to extract the libraries
    # Code from /tmp/petsc/bin/findftnlibs ...
    # Create the sample programs
    #trap  '/bin/rm -f t1$$.c t1$$.f t1$$c t1$$u t1$$f t1$$.o t1$$' 0 2 3 10
    cat > t1$$.f <<EOF
      program main
      end
EOF
    cat > t1$$.c <<EOF
      int main() { return 0; }
EOF
    # Compile and link with the -v option; extract library options
    # Some compilers will generate multiple refs.  We may need to 
    # know about that, but for now, we depend on finding unique differences
    # We split on , as well as blank because some systems (AIX4) use exec 
    # notation with , separating args.
    # We can't split on , and blank, since for some systems (Solaris), the
    # comma is important in some options.
    # Rather, we try to identify
    # , separated: ... /bin/ld(ld,options,moreoptions)
    # blank separated: ... bin/ld option option ...
    $CC -o t1$$ -v t1$$.c 2>&1 | grep '/ld' > t1$$c1
    # 
    # Try to detect , separated form
    if grep 'ld,' t1$$c1 >/dev/null 2>&1 ; then
        cat t1$$c1 | tr ',' '\012' | \
            sed -n -e '/^-l/p' -e '/^-L/p' | \
  	    sed -e 's/^P,/-P,/g' | sort | uniq > t1$$c
    else
        cat t1$$c1 | tr ' ' '\012' | \
            sed -n -e '/^-l/p' -e '/^-L/p' | \
	    sed -e 's/^P,/-P,/g' | sort | uniq > t1$$c
    fi
    $F77 -o t1$$ -v t1$$.f 2>&1 | grep '/ld' > t1$$f1
    if grep 'ld,' t1$$f1 >/dev/null 2>&1 ; then
        cat t1$$f1 | tr ',' '\012' | \
            sed -n -e '/^-l/p' -e '/^-L/p' -e '/^P,/p' | \
	    sed -e 's/^P,/-P,/g' | sort | uniq > t1$$f
    else
        cat t1$$f1 | tr ' ' '\012' | \
            sed -n -e '/^-l/p' -e '/^-L/p' -e '/^P,/p' | \
	    sed -e 's/^P,/-P,/g' | sort | uniq > t1$$f
    fi

    # Now, remove common libraries/search paths
    cat t1$$c t1$$f | sort | uniq -u > t1$$u
    #
    # Finally, since the ORDER is important, we extract those lines from
    # the original t1$$f file
    #echo 'u'
    #cat t1$$u
    #echo 'f'
    #cat t1$$f
    #echo 'c'
    #cat t1$$c
    #set -x
    #echo 'results'
    foundany=0
    # Find lines in the C linker output that are not in the Fortran linker 
    # output
    for line in `cat t1$$c` ; do
        #line=`echo $line | sed -e 's/-/\\\\-/'`
        pureline=`echo $line | sed -e 's/-/./'`
#        if grep "'""$line\$""'" t1$$u 2>&1 >/dev/null ; then
        if grep "$pureline\$" t1$$u 2>&1 >/dev/null ; then
            # Special case: P,dirpath needs to be expanded
	    matchnum=`expr "$line" : '-P,'`
    	    if test "$matchnum" -eq 3 ; then
	        newline=`echo $line | sed -e 's/^-P,/-L/g' -e 's/:/ -L/g'`
	        line=$newline
            fi
	    $F77 -o t1$$ t1$$.f $line 2>&1 | grep 'undefined reference' > tout
	    if test ! -s tout ; then
	    	echo "Fortran linker needs $line"
           	FLIB_LIST="$FLIB_LIST $line"
            	foundany=1
	    else
	        print_error "$line which is in the C linker"
		print_error "does not work with Fortran programs and is not"
	        print_error "being added to the Fortran linker line.  This"
	        print_error "may cause problems when linking Fortran programs." 
	    fi
	    /bin/rm tout
        fi
    done
    /bin/rm -f t1$$.c t1$$.f t1$$c t1$$u t1$$f t1$$.o t1$$ t1$$c1 t1$$f1 tout

    # Add a test here for MPI_FINT
    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 size of Fortran INTEGER""... $ac_c"
else
echo $ac_n "checking for size of Fortran INTEGER""... $ac_c" 1>&1
fi
/bin/rm -f conftestval
/bin/rm -f conftestf.f conftestf.o
cat <<EOF > conftestf.f
      subroutine isize( )
      integer i(2)
      call cisize( i(1), i(2) )
      end
EOF
if $F77 $FFLAGS -c conftestf.f >/dev/null 2>&1 ; then 
    SaveLIBS="$LIBS"
    LIBS="conftestf.o $LIBS"
    

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>
#ifdef FORTRANCAPS
#define cisize_ CISIZE
#define isize_  ISIZE
#elif defined(FORTRANNOUNDERSCORE)
#define cisize_ cisize
#define isize_  isize
#endif
static int isize_val;
void cisize_( i1p, i2p )
char *i1p, *i2p;
{
	isize_val = (i2p - i1p) * sizeof(char);
}
main() { 
  FILE *f=fopen("conftestval","w");
  
  if (!f) exit(1);
  isize_();
  fprintf( f, "%d\n", isize_val);
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

LIBS="$SaveLIBS"
else
   :
fi
if test -z "$Pac_CV_NAME" ; then
    # Try to compile/link with the Fortran compiler instead.  This
    # worked for the NEC SX-4
    compile_f='${CC-cc} $CFLAGS -c conftest.c; ${F77-f77} $FFLAGS -o conftest conftest.o $LIBS >/dev/null 2>&1'
    eval $compile_f
    if test ! -s conftest ; then 
	echo "Could not build executable program:"
	echo "${F77-f77} $FFLAGS -o conftest conftest.o $LIBS"
    else
	/bin/rm -f conftestout
	if test -s conftest && (./conftest;exit) 2>conftestout ; then
	    Pac_CV_NAME=`cat conftestval`
        fi
    fi

fi
/bin/rm -f conftestf.f conftestf.o
if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
fi
f_integer_size=$Pac_CV_NAME

    if test "$f_integer_size" != "unavailable" ; 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 C integer type for MPI_Fint""... $ac_c"
else
echo $ac_n "checking for C integer type for MPI_Fint""... $ac_c" 1>&1
fi
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""
else
echo "$ac_t""" 1>&1
fi
	for c_type in int long short "long long" ; do
	    Pac_name="$c_type"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
type_len=$Pac_CV_NAME

            if test "$type_len" = "$f_integer_size" ; then
                MPI_FINT_FOUND=yes
		MPI_FINT=$c_type
	        break
	    fi
        done
        
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "C integer type for MPI_Fint is""... $ac_c"
else
echo $ac_n "C integer type for MPI_Fint is""... $ac_c" 1>&1
fi
	if test "$MPI_FINT_FOUND" = yes ; then 
   	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$MPI_FINT"
else
echo "$ac_t""$MPI_FINT" 1>&1
fi
        else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""could not find matching C type!"
else
echo "$ac_t""could not find matching C type!" 1>&1
fi
	fi
    fi
fi

if test $do_test = 1 ; then
    

if test -z "$CCBUGS" ; then CCBUGS=ccbugs ; fi
if test -d $CCBUGS ; then 
    # Use "LTESTCC" as "local Test CC"
    if test -z "$TESTCC" ; then LTESTCC="$CC" ; else LTESTCC="$TESTCC" ; fi
    for file in $CCBUGS/ccfail*.c ; do
        CFILE=`basename $file .c`
        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 `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
        broken=1
        rm -f conftest.out conftest.rout
        if eval $LTESTCC $CFLAGS -o conftest conftest.c $LIBS >conftest.out 2>&1 ; then
	    if test -s conftest ; then
                ./conftest 2>&1 1>conftest.rout
                if test $? = 0 ; then
  	            broken=0
                fi
	    fi
        fi
        if test $broken = 1 ; then 
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test -s conftest.out ; then
	        echo "Output from compile step was:"
		cat conftest.out
	    fi
	    if test -s conftest.rout ; then
	        echo "Output from run step was:"
		cat conftest.rout
	    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
	/bin/rm -f conftest conftest.c conftest.o conftest.out conftest.rout
    done
    #
    # These are non-fatal, but must be run
    for file in $CCBUGS/ccnfail*.c ; do
        CFILE=`basename $file .c`
        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 `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
        nbroken=1
	rm -f conftest.out conftest.rout
        if eval $LTESTCC $CFLAGS -o conftest conftest.c $LIBS >conftest.out 2>&1 ; then
	    if test -s conftest ; then
                ./conftest 2>&1 1>conftest.rout
                if test $? = 0 ; then
  	            nbroken=0
                fi
	    fi
        fi
        if test $nbroken = 1 ; then 
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test -s conftest.out ; then
	        echo "Output from compile step was:"
		cat conftest.out
	    fi
	    if test -s conftest.rout ; then
	        echo "Output from run step was:"
		cat conftest.rout
	    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
	/bin/rm -f conftest conftest.c conftest.o conftest.out conftest.rout
    done

    # 
    # Now, try the warnings.  Note that this just does compiles, not runs
    for file in $CCBUGS/ccwarn*.c ; do
        CFILE=`basename $file .c`
        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 `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
        if eval $CC $CFLAGS \
	    -DCONFIGURE_ARGS_CLEAN="'"'"'-A -B'"'"'" -c \
	    conftest.c $LIBS > /dev/null 2>&1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    true 
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test "$CFILE" = "ccwarn1" ; then
	       CONFIGURE_ARGS_CLEAN="`echo $CONFIGURE_ARGS_CLEAN | tr ' ' '_'`"
            fi
        fi
	# set +x
	/bin/rm -f conftest conftest.co
    done
    # 
    # After everything, see if there are any problems
    if test $broken = 1 ; then 
        if test -z "$FAILMSG" ; then
	    echo "Compiler $CC appears broken; aborting configure..."
        else
	    eval echo "$FAILMSG"
        fi
        exit 1
    fi
fi

fi
#
if test "$RANLIB" != ":" ; 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 ranlib works""... $ac_c"
else
echo $ac_n "checking that ranlib works""... $ac_c" 1>&1
fi
broken=0
cat <<EOF >conftest.c
int a(){return 1;}
EOF
rm -f conftest.out
compileonly='$CC -c $CFLAGS conftest.c >conftest.out 2>&1'
if eval $compileonly ; then 
    :
else
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    broken=1;
fi
rm conftest.out
if test $broken = 1 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    print_error "Error in creating test object for ranlib!"
else
    arcmd='$AR foo.a conftest.o >conftest.out 2>&1'
    eval $arcmd
    ranlibtest='$RANLIB foo.a >>conftest.out 2>&1'
    if eval $ranlibtest ; then
        : 
    else
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
        broken=1
    fi
    rm conftest.out
    cat <<EOF >conftest.c
int a(); int main(argc,argv)int argc; char **argv;{ return a();}
EOF
    compileonly='$CC -c $CFLAGS conftest.c >conftest.out 2>&1'
    if eval $compileonly ; then 
        : 
    else
        broken=1
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    fi
    rm conftest.out
    if test $broken = 1 ; then
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        print_error "Error in creating test program for ranlib test!"
    else
	# Check that we can link the program
	echo $CLINKER $CFLAGS $LDFLAGS conftest.o -o conftest foo.a $LIBS >> \
		config.log
        if eval $CLINKER $CFLAGS $LDFLAGS conftest.o -o conftest foo.a $LIBS \
		>>config.log 2>&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
	    print_error "Error linking with ranlibed library"
	    broken=1
        fi
    fi
    /bin/rm -f foo.a
    if test $broken = 1 ; then
        print_error "RANLIB ($RANLIB) failed!"
        print_error "Assuming that ranlib is a stub returning non-zero"
        print_error "condition code"
        RANLIB=':'
    fi
fi
rm -f conftest.o conftest.c

fi
#
# Some Sun SOLARIS systems don't have AR (at least, not in a typical user
# path)
# Remove any arguments from the string AR
ARTEST=`expr "$AR" : "\(.*\) "`
# Extract the first word of "$ARTEST", so it can be a program name with args.
set dummy $ARTEST; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$ARFOUND"; then
  ac_pg_ARFOUND="$ARFOUND" # Let the user override the test.
else
  ac_first_char=`expr "$ARTEST" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$ARTEST" ; then
       ac_pg_ARFOUND="1"
       ac_prog_where=$ARTEST
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_ARFOUND="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;ARFOUND="$ac_pg_ARFOUND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($ARFOUND)"
else
echo "$ac_t""found $ac_prog_where ($ARFOUND)" 1>&1
fi
   ARLOC=$ac_prog_where  
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 -z "$ARLOC" ; then 
    # Check for /usr/ccs/bin/ar ; Solaris likes to hide anything remotely
    # useful in this directory
    print_error "The library archiver $AR is not in your path"
    print_error "MPICH cannot be built without this program, which"
    print_error "should be part of ANY program development environment."
    if test -x /usr/ccs/bin/ar ; then 
        print_error "You need /usr/ccs/bin in your path."
    else
        print_error "Check your path; contact your system vendor if your"
        print_error "path appears to be ok."
    fi
    exit 1
fi
#
#
# Check for long pointers.  All such options are placed into DEFS (see
# autoconf manual, AC _ DEFINE)
#

pointersize=""
Pac_name="void *"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
pointersize=$Pac_CV_NAME

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 pointers greater than 32 bits""... $ac_c"
else
echo $ac_n "checking for pointers greater than 32 bits""... $ac_c" 1>&1
fi
if test -z "$pointersize" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""can not determine; assuming not"
else
echo "$ac_t""can not determine; assuming not" 1>&1
fi
elif test $pointersize -gt 4 ; then
    
{
test -n "$verbose" && \
echo "	defining POINTER_64_BITS"
echo "#define" POINTER_64_BITS 1 >> confdefs.h
DEFS="$DEFS -DPOINTER_64_BITS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}POINTER_64_BITS\${SEDdB}POINTER_64_BITS\${SEDdC}1\${SEDdD}
\${SEDuA}POINTER_64_BITS\${SEDuB}POINTER_64_BITS\${SEDuC}1\${SEDuD}
\${SEDeA}POINTER_64_BITS\${SEDeB}POINTER_64_BITS\${SEDeC}1\${SEDeD}
"
}

    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


intsize=""
Pac_name="int"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
intsize=$Pac_CV_NAME

if test -z "$pointersize" ; then
    Pac_name="void *"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
pointersize=$Pac_CV_NAME

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 int large enough for pointers""... $ac_c"
else
echo $ac_n "checking for int large enough for pointers""... $ac_c" 1>&1
fi
if test -n "$pointersize" -a -n "$intsize" ; then
    if test $pointersize -le $intsize ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else
       
{
test -n "$verbose" && \
echo "	defining INT_LT_POINTER"
echo "#define" INT_LT_POINTER 1 >> confdefs.h
DEFS="$DEFS -DINT_LT_POINTER=1"
SEDDEFS="${SEDDEFS}\${SEDdA}INT_LT_POINTER\${SEDdB}INT_LT_POINTER\${SEDdC}1\${SEDdD}
\${SEDuA}INT_LT_POINTER\${SEDuB}INT_LT_POINTER\${SEDuC}1\${SEDuD}
\${SEDeA}INT_LT_POINTER\${SEDeB}INT_LT_POINTER\${SEDeC}1\${SEDeD}
"
}

       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""can not determine; assuming it is"
else
echo "$ac_t""can not determine; assuming it is" 1>&1
fi
fi

if test -n "$F77IDX" ; then
    
{
test -n "$verbose" && \
echo "	defining POINTER_64_BITS"
echo "#define" POINTER_64_BITS 1 >> confdefs.h
DEFS="$DEFS -DPOINTER_64_BITS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}POINTER_64_BITS\${SEDdB}POINTER_64_BITS\${SEDdC}1\${SEDdD}
\${SEDuA}POINTER_64_BITS\${SEDuB}POINTER_64_BITS\${SEDuC}1\${SEDuD}
\${SEDeA}POINTER_64_BITS\${SEDeB}POINTER_64_BITS\${SEDeC}1\${SEDeD}
"
}

fi
Pac_name="void *"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
address_size=$Pac_CV_NAME

if test "$address_size" != "unknown" ; 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 C integer type for MPI_Aint""... $ac_c"
else
echo $ac_n "checking for C integer type for MPI_Aint""... $ac_c" 1>&1
fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""
else
echo "$ac_t""" 1>&1
fi
    for c_type in int long short "long long" ; do
        Pac_name="$c_type"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
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 size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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>
main() { 
  FILE *f=fopen("conftestval","w");
  if (!f) exit(1);
  fprintf( f, "%d\n", sizeof($Pac_name));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
	if test Pac_CV_NAME=`cat conftestval` != "MMAP=1"; then
            echo "Execution of test program failed"
	fi
        Pac_CV_NAME=""

        if test -s conftestout ; then
            cat conftestout
        fi
      fi
    fi
  if test -n "$TESTCC" ; then
        CC="$CCsav"
  fi
  rm -fr conftest*
fi

 if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
    eval ${Pac_varname}_len=$Pac_CV_NAME
 else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
fi
 fi
fi
type_len=$Pac_CV_NAME

        if test "$type_len" = "$address_size" ; then
            MPI_AINT_FOUND=yes
	    MPI_AINT=$c_type
            break
        fi
    done
    
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "C integer type for MPI_Aint is""... $ac_c"
else
echo $ac_n "C integer type for MPI_Aint is""... $ac_c" 1>&1
fi
    if test "$MPI_AINT_FOUND" = yes ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$MPI_AINT"
else
echo "$ac_t""$MPI_AINT" 1>&1
fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""could not find matching C type!"
else
echo "$ac_t""could not find matching C type!" 1>&1
fi
    fi
fi
# 
# Do not test 
# PROBLEM: ROMIO depends on long long in some cases.  For now, leave it
# outside the -no_short_longs test
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"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_LONG_INT\${SEDdB}HAVE_LONG_LONG_INT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_LONG_INT\${SEDuB}HAVE_LONG_LONG_INT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_LONG_INT\${SEDeB}HAVE_LONG_LONG_INT\${SEDeC}1\${SEDeD}
"
}

fi

if test "$NOSHORTLONGS" = 0 ; then
    # If not cross-compiling, we could dynamically check
            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"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
"
}

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"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
"
}
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 "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    echo "Cannot check for size of double when cross-compiling"
    ac_cv_sizeof_double=0
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 size of double""... $ac_c"
else
echo $ac_n "checking size of double""... $ac_c" 1>&1
fi
if test -n "$TESTCC" ; then
    CCsav="$CC"
    CC="$TESTCC"
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("cftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(double));
  exit(0);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_sizeof_double=`cat cftestval`

else
  ac_cv_sizeof_double=0
fi
rm -fr conftest*
rm -f cftestval
if test -n "$TESTCC" ; then
    CC="$CCsav"
fi

if test "$ac_cv_sizeof_double" = 0 ; then
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""double unsupported"
else
echo "$ac_t""double unsupported" 1>&1
fi
else
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_sizeof_double"
else
echo "$ac_t""$ac_cv_sizeof_double" 1>&1
fi
fi
doublesize=$ac_cv_sizeof_double
fi

    if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    echo "Cannot check for size of long double when cross-compiling"
    ac_cv_sizeof_long_double=0
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 size of long double""... $ac_c"
else
echo $ac_n "checking size of long double""... $ac_c" 1>&1
fi
if test -n "$TESTCC" ; then
    CCsav="$CC"
    CC="$TESTCC"
fi
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("cftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long double));
  exit(0);
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_sizeof_long_double=`cat cftestval`

else
  ac_cv_sizeof_long_double=0
fi
rm -fr conftest*
rm -f cftestval
if test -n "$TESTCC" ; then
    CC="$CCsav"
fi

if test "$ac_cv_sizeof_long_double" = 0 ; then
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""long double unsupported"
else
echo "$ac_t""long double unsupported" 1>&1
fi
else
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_sizeof_long_double"
else
echo "$ac_t""$ac_cv_sizeof_long_double" 1>&1
fi
fi
longdoublesize=$ac_cv_sizeof_long_double
fi

    if test $doublesize -eq $longdoublesize ; then
	# Suppress long double if == double?
	# NOSHORTLONGS=1
     print_error "If you get warning messages about long doubles not supported"
     print_error "on $ARCH, use the -no_short_longs argument to configure."
    fi
fi

#
# Check for structure alignment using util/structlayout.c
if test "$cross_compiling" = 0 ; then
   if test -n "$TESTCC" ; then
       CCsav="$CC"
       CC="$TESTCC"
   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 structure alignment""... $ac_c"
else
echo $ac_n "checking for structure alignment""... $ac_c" 1>&1
fi
   rm -f conftest*
   cat confdefs.h util/structlayout.c > conftest.c
   eval $compile
   if test ! -s conftest ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not build executable program to test alignment"
else
echo "$ac_t""Could not build executable program to test alignment" 1>&1
fi
   else
	if test -x conftest && (./conftest; exit) 1>conftestout ; then
	    if test -s conftestout ; then
  	        alignvalue=`cat conftestout`
            else
	        alignvalue="Unknown"
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$alignvalue"
else
echo "$ac_t""$alignvalue" 1>&1
fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Execution of test program failed"
else
echo "$ac_t""Execution of test program failed" 1>&1
fi
	fi
   fi
   rm -f conftest*
   if test -n "$TESTCC" ; then
       CC="$CCsav"
   fi
fi

#### was
#USER_CFLAGS="$CFLAGS $USER_DEFS"
# We must not make USER_CFLAGS all of CFLAGS...
USER_CFLAGS="$USER_CFLAGS $USER_DEFS"
#
# We really should use MPICHCONF_H instead of CONFIG_H
CFLAGS="$CFLAGS -DHAVE_CONFIG_H -DHAVE_MPICHCONF_H"
#
if test $is_adi1 = 0 ; then
    
{
test -n "$verbose" && \
echo "	defining MPI_ADI2"
echo "#define" MPI_ADI2 1 >> confdefs.h
DEFS="$DEFS -DMPI_ADI2=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPI_ADI2\${SEDdB}MPI_ADI2\${SEDdC}1\${SEDdD}
\${SEDuA}MPI_ADI2\${SEDuB}MPI_ADI2\${SEDuC}1\${SEDuD}
\${SEDeA}MPI_ADI2\${SEDeB}MPI_ADI2\${SEDeC}1\${SEDeD}
"
}

            # Don't include mpid/ch2 since that has default versions of the include
    # files.  If a device needs them, it should copy or link them into
    # its directory.
    CFLAGS="$CFLAGS -I../../build/$ARCH/$DEVICE/include"
    if test "$MEMDEBUG" = "1" ; then 
	
{
test -n "$verbose" && \
echo "	defining MPIR_MEMDEBUG"
echo "#define" MPIR_MEMDEBUG 1 >> confdefs.h
DEFS="$DEFS -DMPIR_MEMDEBUG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPIR_MEMDEBUG\${SEDdB}MPIR_MEMDEBUG\${SEDdC}1\${SEDdD}
\${SEDuA}MPIR_MEMDEBUG\${SEDuB}MPIR_MEMDEBUG\${SEDuC}1\${SEDuD}
\${SEDeA}MPIR_MEMDEBUG\${SEDeB}MPIR_MEMDEBUG\${SEDeC}1\${SEDeD}
"
}

	
{
test -n "$verbose" && \
echo "	defining MPIR_OBJDEBUG"
echo "#define" MPIR_OBJDEBUG 1 >> confdefs.h
DEFS="$DEFS -DMPIR_OBJDEBUG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPIR_OBJDEBUG\${SEDdB}MPIR_OBJDEBUG\${SEDdC}1\${SEDdD}
\${SEDuA}MPIR_OBJDEBUG\${SEDuB}MPIR_OBJDEBUG\${SEDuC}1\${SEDuD}
\${SEDeA}MPIR_OBJDEBUG\${SEDeB}MPIR_OBJDEBUG\${SEDeC}1\${SEDeD}
"
}

	    fi
    if test "$TRDEBUG" = "1" ; then 
	
{
test -n "$verbose" && \
echo "	defining DEBUG_TRACE"
echo "#define" DEBUG_TRACE 1 >> confdefs.h
DEFS="$DEFS -DDEBUG_TRACE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}DEBUG_TRACE\${SEDdB}DEBUG_TRACE\${SEDdC}1\${SEDdD}
\${SEDuA}DEBUG_TRACE\${SEDuB}DEBUG_TRACE\${SEDuC}1\${SEDuD}
\${SEDeA}DEBUG_TRACE\${SEDeB}DEBUG_TRACE\${SEDeC}1\${SEDeD}
"
}

            fi
    if test "$PTRDEBUG" = 1 ; then 
	
{
test -n "$verbose" && \
echo "	defining MPIR_PTRDEBUG"
echo "#define" MPIR_PTRDEBUG 1 >> confdefs.h
DEFS="$DEFS -DMPIR_PTRDEBUG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPIR_PTRDEBUG\${SEDdB}MPIR_PTRDEBUG\${SEDdC}1\${SEDdD}
\${SEDuA}MPIR_PTRDEBUG\${SEDuB}MPIR_PTRDEBUG\${SEDuC}1\${SEDuD}
\${SEDeA}MPIR_PTRDEBUG\${SEDeB}MPIR_PTRDEBUG\${SEDeC}1\${SEDeD}
"
}

    fi
fi
if test $is_adi1 = 1 -a -z "$adi1_ok" ; then
    cat <<EOF
The MPICH implementation of MPI no longer supports the ADI-1 interface.
The supported devices are all ADI-2 interfaces (e.g., ch_p4, ch_shmem, 
ch_nx, etc.).  

All implementors that we know about are notified about changes in the MPICH
implementation.  If you are an implementor using MPICH, please let us know
about you so that we can add you to the list of MPICH developers.  Send
mail to mpi-bugs@mcs.anl.gov and asked to be added to the MPICH developers 
list.
EOF
    exit 1
fi

#if test -z "$PREFIX" ; then 
	LIB_PATH="-L$MPIR_HOME/build/$ARCH/$COMM/lib $LIB_PATH"
#else
#	LIB_PATH="-L$PREFIX/build/$ARCH/$COMM/lib $LIB_PATH"
#fi
#
# hpux's Fortran compiler f77 (but not the POSIX version fort77) does
# not accept -L <dir> for library search path.
# Eventually, we should check this to see if it works, not guess based on
# the system
FLIB_PATH_LEADER="-L"
FLIB_PATH="$FLIB_PATH $LIB_PATH"
if test "$F77" = "f77" -a \( -n "$arch_hpux" -o -n "$arch_sppux" \) ; then
   FLIB_PATH=`echo $FLIB_PATH | sed -e 's/-L/-Wl,-L,/g'`
   FLIB_PATH_LEADER="-Wl,-L,"
   FLIB_LIST=`echo $FLIB_LIST | sed -e 's/-L/-Wl,-L,/g'`
fi
#
if test -n "$F90" ; then
    if test -z "$USER_SET_F90LIB_PATH" -a -z "$F90LIB_PATH" ; then
	F90LIB_PATH="$FLIB_PATH"
    fi
fi
# Add any user libraries
if test -n "$USERLIB" ; then
    LIB_LIST="$LIB_LIST $USERLIB"
fi
#
# mpirun needs sync to try and fix NFS problems on some machines.  Some
# users may not have sync in their path, so we try to find it here.
SYNCLOC=""
# Extract the first word of "sync", so it can be a program name with args.
set dummy sync; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$SYNCFOUND"; then
  ac_pg_SYNCFOUND="$SYNCFOUND" # Let the user override the test.
else
  ac_first_char=`expr "sync" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "sync" ; then
       ac_pg_SYNCFOUND="1"
       ac_prog_where=sync
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_SYNCFOUND="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;SYNCFOUND="$ac_pg_SYNCFOUND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($SYNCFOUND)"
else
echo "$ac_t""found $ac_prog_where ($SYNCFOUND)" 1>&1
fi
   SYNCLOC=$ac_prog_where  
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 -z "$SYNCLOC" ; then SYNCLOC=true ; fi
#
# Make this the default.  Eventually, use the --enable stuff to allow
# a user to turn this off.

{
test -n "$verbose" && \
echo "	defining USE_BASIC_ALIGNMENT"
echo "#define" USE_BASIC_ALIGNMENT 1 >> confdefs.h
DEFS="$DEFS -DUSE_BASIC_ALIGNMENT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_BASIC_ALIGNMENT\${SEDdB}USE_BASIC_ALIGNMENT\${SEDdC}1\${SEDdD}
\${SEDuA}USE_BASIC_ALIGNMENT\${SEDuB}USE_BASIC_ALIGNMENT\${SEDuC}1\${SEDuD}
\${SEDeA}USE_BASIC_ALIGNMENT\${SEDeB}USE_BASIC_ALIGNMENT\${SEDeC}1\${SEDeD}
"
}

#
# if the device uses the machines file and there is no machines.$ARCH, 
# create one using hostname (or uname)
#
if test $DEVICE_KIND = network ; then
    if test ! -s util/machines/machines.$ARCH ; then
        HOST=""
        # Extract the first word of "hostname", so it can be a program name with args.
set dummy hostname; ac_word=$2
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_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$HOSTNAME_PGM"; then
  ac_pg_HOSTNAME_PGM="$HOSTNAME_PGM" # Let the user override the test.
else
  ac_first_char=`expr "hostname" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "hostname" ; then
       ac_pg_HOSTNAME_PGM=""
       ac_prog_where=hostname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_HOSTNAME_PGM=""
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;HOSTNAME_PGM="$ac_pg_HOSTNAME_PGM"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($HOSTNAME_PGM)"
else
echo "$ac_t""found $ac_prog_where ($HOSTNAME_PGM)" 1>&1
fi
   hostname=$ac_prog_where  
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 -x "$hostname" ; then
	    HOST="`$hostname`"
        fi
        # Note that uname -n may not produce a usable hostname.  
	# Any suggestions?
        if test "$HOST" = "" ; then
	    HOST="`uname -n`"
        fi
   	cat > util/machines/machines.$ARCH <<.
$HOST
$HOST
$HOST
$HOST
$HOST
.
	echo "Created util/machines/machines.$ARCH with five copies of $HOST"
	echo "You may want to edit this file to add and delete hosts"
	echo "(These hosts are used by mpirun.)"
    fi
fi
#
# Make sure that configure is group writable
#
chmod g+w configure > /dev/null 2>&1
#
# BASE_LIB_LIST lets us separate the MPI library from the other libs
BASE_LIB_LIST="$LIB_LIST"
# used to be LIB_LIST="$LIB_LIST -lmpi" I switched it, inspired by HPUX
LIB_LIST="-l$MPILIBNAME $LIB_LIST"
#
# Generate the name for the MPI-C, MPI-CC, and MPI-F77 compilers (for use
# in Makefiles that should not be MPICH dependent
MPICC=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpicc
if test $NOF77 = 0 ; then
	MPIF77=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpif77
else
	MPIF77=""
fi
MPIF90=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpif90
MPICPLUSPLUS=$MPIR_HOME/build/$ARCH/$DEVICE/bin/mpiCC
LIB_DIR=$MPIR_HOME/build/$ARCH/$DEVICE
#
# Some mpi2 commands supported (for the testing scripts)
HAS_MPI2=1
#
#  Configure ROMIO if specified
#
if test $ROMIO = 1 -a -d romio ; then
    # first test that romio will configure if on LINUX.
    # ROMIO uses this test for LINUX
    if test `bin/tarch` = "LINUX" ; 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 linux/nfs_fs.h is correct""... $ac_c"
else
echo $ac_n "checking that linux/nfs_fs.h 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 <sys/types.h>
#include <sys/vfs.h>
#include <linux/nfs_fs.h>
int main() { exit(0); }
int t() { return 0; }
EOF
if eval $compile; then
  
  :
else
  rm -rf conftest*
  ROMIO=0
   
fi
rm -f conftest*

	if test $ROMIO = 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
	    print_error "ROMIO cannot be built because linux/nfs_fs.h is broken"
	    print_error "Get an updated version of LINUX to fix this"
	fi
    fi
fi
if test $ROMIO = 1 -a -d romio ; then
  echo "Configuring ROMIO, for support of MPI-IO"
  (cd romio ; \
  ./configure -arch="$ARCH" -file_system="$FILE_SYSTEM" \
            -mpi=mpich -from_mpich \
	    -make="$MAKE" \
            -mpiincdir=$MPIR_HOME/include \
            -mpilib=$MPIR_HOME/build/$ARCH/$DEVICE/lib/lib$MPILIBNAME.a \
            -mpiolib=$MPIR_HOME/build/$ARCH/$DEVICE/lib/lib$MPILIBNAME.a \
            -cc="$CC" -cflags="$ROMIO_CFLAGS $CC_SHARED_OPT" \
            -fc="$FC" -fflags="$ROMIO_FFLAGS $FC_SHARED_OPT" -f90="$F90" $romio_config_args )
  /bin/rm -f include/mpio.h
  cp romio/include/mpio.h include
  ROMIO_LFLAGS="`$MAKE -f romio/Makefile romio_lflags`"
  ROMIO_TCFLAGS="`$MAKE -f romio/Makefile romio_tcflags`"
  ROMIO_TCPPFLAGS="`$MAKE -f romio/Makefile romio_tcppflags`"
  ROMIO_TFFLAGS="`$MAKE -f romio/Makefile romio_tfflags`"
  LIB_LIST="$LIB_LIST `$MAKE -f romio/Makefile romio_liblist`"
# mpif.h prepared for ROMIO at end of configure
  (cd examples; \rm -f io; ln -s ../romio/test io; \
   (cd test; \rm -f io; ln -s ../../romio/test io))
  echo "Finished configuring ROMIO"
fi
if test "$ROMIO" = 1 ; then
    NEWTESTDIRS="$NEWTESTDIRS io"
fi
#
# Substitute variables
# Variables used in scripts only
if test -z "$RSHCOMMAND" ; then
    RSHCOMMAND=$rshcommand
fi
# FINC contains an @MPIR_HOME@, so it needs to come first
# Variables defined ONLY for the doc/port file:
# Variables used by Makefile.in's:
MPICH_VERSION="MPICH $MPIVERSION"
# P4_MDEPCFLAGS now used only in doc/port.in
#
# src/env/farg.f
# 
# 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 -fr Makefile util/Makefile examples/Makefile examples/perftest/Makefile src/pt2pt/Makefile src/coll/Makefile src/context/Makefile src/dmpi/Makefile src/env/Makefile src/topol/Makefile src/profile/Makefile src/util/Makefile src/infoexport/Makefile examples/basic/Makefile src/misc2/Makefile src/external/Makefile  mpichconf.h conftest*; exit 1' 1 3 15
CC='$CC'
RANLIB='$RANLIB'
CPP='$CPP'
CC_SHARED_OPT='$CC_SHARED_OPT'
CC_SHARED_OPT_FOR_TV='$CC_SHARED_OPT_FOR_TV'
CXXFLAGS_FOR_SHARED='$CXXFLAGS_FOR_SHARED'
SHAREDKIND='$SHAREDKIND'
SHAREDKIND_FOR_TV='$SHAREDKIND_FOR_TV'
PERL='$PERL'
MPIFPMPI='$MPIFPMPI'
FORT_INT1='$FORT_INT1'
FORT_INT2='$FORT_INT2'
FORT_INT4='$FORT_INT4'
FORT_INT8='$FORT_INT8'
FORT_INT16='$FORT_INT16'
FORT_REAL4='$FORT_REAL4'
FORT_REAL8='$FORT_REAL8'
FORT_REAL16='$FORT_REAL16'
FORT_COMPLEX8='$FORT_COMPLEX8'
FORT_COMPLEX16='$FORT_COMPLEX16'
FORT_COMPLEX32='$FORT_COMPLEX32'
F90='$F90'
F90INC='$F90INC'
F90FLAGS='$F90FLAGS'
F90LINKER='$F90LINKER'
F90LIB_PATH='$F90LIB_PATH'
f90nag='$f90nag'
F90_SUFFIX='$F90_SUFFIX'
AUTOMOUNTFIX='$AUTOMOUNTFIX'
RSHCOMMAND='$RSHCOMMAND'
FINC='$FINC'
wishloc='$wishloc'
TK_DIR='$TK_DIR'
TCL_DIR='$TCL_DIR'
TK_VERSION='$TK_VERSION'
SYNCLOC='$SYNCLOC'
COMPRESSEDPKT='$COMPRESSEDPKT'
CONFIGURE_ARGS='$CONFIGURE_ARGS'
CONFIGURE_ARGS_CLEAN='$CONFIGURE_ARGS_CLEAN'
NODEVDEBUG='$NODEVDEBUG'
PKTSIZE='$PKTSIZE'
VARPKT='$VARPKT'
LIMITEDBUFFERS='$LIMITEDBUFFERS'
ADI_COLLECTIVE='$ADI_COLLECTIVE'
cross_compiling='$cross_compiling'
ASM='$ASM'
ASMFILES_O='$ASMFILES_O'
AR='$AR'
ARCH='$ARCH'
BASE_LIB_LIST='$BASE_LIB_LIST'
BOPT='$BOPT'
CFLAGS='$CFLAGS'
CLINKER='$CLINKER'
CCFLAGS='$CCFLAGS'
CCLINKER='$CCLINKER'
COMM='$COMM'
CPP_COMPILER='$CPP_COMPILER'
CPP_DIR='$CPP_DIR'
CPPFLAGS='$CPPFLAGS'
LDFLAGS='$LDFLAGS'
CPPLDFLAGS='$CPPLDFLAGS'
CPRP='$CPRP'
DEFAULT_MACHINE='$DEFAULT_MACHINE'
DEVCFLAGS='$DEVCFLAGS'
DEVCFILES='$DEVCFILES'
DEVOFILES='$DEVOFILES'
DEV_DEFS='$DEV_DEFS'
DEVICE='$DEVICE'
DEVICE_MAKE_INCLUDE='$DEVICE_MAKE_INCLUDE'
F77='$F77'
FAST_COPY='$FAST_COPY'
FFLAGS='$FFLAGS'
FLIB_PATH='$FLIB_PATH'
FLIB_PATH_LEADER='$FLIB_PATH_LEADER'
FLIB_LIST='$FLIB_LIST'
FLINKER='$FLINKER'
GETNAME_DEFS='$GETNAME_DEFS'
HAS_FORTRAN='$HAS_FORTRAN'
HAS_MPI2='$HAS_MPI2'
ICCLIB='$ICCLIB'
INCLUDE_PATH='$INCLUDE_PATH'
LIB_LIST='$LIB_LIST'
LIB_PATH='$LIB_PATH'
LIB_DIR='$LIB_DIR'
MAKE='$MAKE'
MPE_DIR='$MPE_DIR'
MPE_MPI_EXT_C='$MPE_MPI_EXT_C'
MPE_MPI_EXT_O='$MPE_MPI_EXT_O'
MPICH_VERSION='$MPICH_VERSION'
MPIR_HOME='$MPIR_HOME'
MPIFDEP='$MPIFDEP'
MPI_FOBJECTS='$MPI_FOBJECTS'
MPI_AINT='$MPI_AINT'
MPI_FINT='$MPI_FINT'
MPILIBNAME='$MPILIBNAME'
MPICC='$MPICC'
MPIF77='$MPIF77'
MPIF90='$MPIF90'
MPICPLUSPLUS='$MPICPLUSPLUS'
MEMDEBUG='$MEMDEBUG'
GLOBUSDIR='$GLOBUSDIR'
NLS_DEFS='$NLS_DEFS'
NEWTESTDIRS='$NEWTESTDIRS'
OPTFLAGS='$OPTFLAGS'
OPTFLAGSC='$OPTFLAGSC'
OPTFLAGSF='$OPTFLAGSF'
P4_ARCH='$P4_ARCH'
P4_DIR='$P4_DIR'
RHS_COMMAND='$RHS_COMMAND'
P4_MDEPCFLAGS='$P4_MDEPCFLAGS'
PREFIX='$PREFIX'
USER_CFLAGS='$USER_CFLAGS'
USER_INCLUDE_PATH='$USER_INCLUDE_PATH'
ROMIO='$ROMIO'
ROMIO_LFLAGS='$ROMIO_LFLAGS'
ROMIO_TCFLAGS='$ROMIO_TCFLAGS'
ROMIO_TCPPFLAGS='$ROMIO_TCPPFLAGS'
ROMIO_TFFLAGS='$ROMIO_TFFLAGS'
buildcpp='$buildcpp'
NOF77='$NOF77'
NOMPE='$NOMPE'
MPE_OPTS='$MPE_OPTS'
JUMPSHOT_OPTS='$JUMPSHOT_OPTS'
F77IARGC='$F77IARGC'
F77GETARGDECL='$F77GETARGDECL'
F77GETARG='$F77GETARG'
F90UNIX='$F90UNIX'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile util/Makefile examples/Makefile examples/perftest/Makefile src/pt2pt/Makefile src/coll/Makefile src/context/Makefile src/dmpi/Makefile src/env/Makefile src/topol/Makefile src/profile/Makefile src/util/Makefile src/infoexport/Makefile examples/basic/Makefile src/misc2/Makefile src/external/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%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@CC_SHARED_OPT@%$CC_SHARED_OPT%g
s%@CC_SHARED_OPT_FOR_TV@%$CC_SHARED_OPT_FOR_TV%g
s%@CXXFLAGS_FOR_SHARED@%$CXXFLAGS_FOR_SHARED%g
s%@SHAREDKIND@%$SHAREDKIND%g
s%@SHAREDKIND_FOR_TV@%$SHAREDKIND_FOR_TV%g
s%@PERL@%$PERL%g
s%@MPIFPMPI@%$MPIFPMPI%g
s%@FORT_INT1@%$FORT_INT1%g
s%@FORT_INT2@%$FORT_INT2%g
s%@FORT_INT4@%$FORT_INT4%g
s%@FORT_INT8@%$FORT_INT8%g
s%@FORT_INT16@%$FORT_INT16%g
s%@FORT_REAL4@%$FORT_REAL4%g
s%@FORT_REAL8@%$FORT_REAL8%g
s%@FORT_REAL16@%$FORT_REAL16%g
s%@FORT_COMPLEX8@%$FORT_COMPLEX8%g
s%@FORT_COMPLEX16@%$FORT_COMPLEX16%g
s%@FORT_COMPLEX32@%$FORT_COMPLEX32%g
s%@F90@%$F90%g
s%@F90INC@%$F90INC%g
s%@F90FLAGS@%$F90FLAGS%g
s%@F90LINKER@%$F90LINKER%g
s%@F90LIB_PATH@%$F90LIB_PATH%g
s%@f90nag@%$f90nag%g
s%@F90_SUFFIX@%$F90_SUFFIX%g
s%@AUTOMOUNTFIX@%$AUTOMOUNTFIX%g
s%@RSHCOMMAND@%$RSHCOMMAND%g
s%@FINC@%$FINC%g
s%@wishloc@%$wishloc%g
s%@TK_DIR@%$TK_DIR%g
s%@TCL_DIR@%$TCL_DIR%g
s%@TK_VERSION@%$TK_VERSION%g
s%@SYNCLOC@%$SYNCLOC%g
s%@COMPRESSEDPKT@%$COMPRESSEDPKT%g
s%@CONFIGURE_ARGS@%$CONFIGURE_ARGS%g
s%@CONFIGURE_ARGS_CLEAN@%$CONFIGURE_ARGS_CLEAN%g
s%@NODEVDEBUG@%$NODEVDEBUG%g" | sed -e "
s%@PKTSIZE@%$PKTSIZE%g
s%@VARPKT@%$VARPKT%g
s%@LIMITEDBUFFERS@%$LIMITEDBUFFERS%g
s%@ADI_COLLECTIVE@%$ADI_COLLECTIVE%g
s%@cross_compiling@%$cross_compiling%g
s%@ASM@%$ASM%g
s%@ASMFILES_O@%$ASMFILES_O%g
s%@AR@%$AR%g
s%@ARCH@%$ARCH%g
s%@BASE_LIB_LIST@%$BASE_LIB_LIST%g
s%@BOPT@%$BOPT%g
s%@CFLAGS@%$CFLAGS%g
s%@CLINKER@%$CLINKER%g
s%@CCFLAGS@%$CCFLAGS%g
s%@CCLINKER@%$CCLINKER%g
s%@COMM@%$COMM%g
s%@CPP_COMPILER@%$CPP_COMPILER%g
s%@CPP_DIR@%$CPP_DIR%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@CPPLDFLAGS@%$CPPLDFLAGS%g
s%@CPRP@%$CPRP%g
s%@DEFAULT_MACHINE@%$DEFAULT_MACHINE%g
s%@DEVCFLAGS@%$DEVCFLAGS%g
s%@DEVCFILES@%$DEVCFILES%g
s%@DEVOFILES@%$DEVOFILES%g
s%@DEV_DEFS@%$DEV_DEFS%g
s%@DEVICE@%$DEVICE%g
s%@DEVICE_MAKE_INCLUDE@%$DEVICE_MAKE_INCLUDE%g
s%@F77@%$F77%g
s%@FAST_COPY@%$FAST_COPY%g
s%@FFLAGS@%$FFLAGS%g
s%@FLIB_PATH@%$FLIB_PATH%g
s%@FLIB_PATH_LEADER@%$FLIB_PATH_LEADER%g
s%@FLIB_LIST@%$FLIB_LIST%g
s%@FLINKER@%$FLINKER%g
s%@GETNAME_DEFS@%$GETNAME_DEFS%g
s%@HAS_FORTRAN@%$HAS_FORTRAN%g
s%@HAS_MPI2@%$HAS_MPI2%g
s%@ICCLIB@%$ICCLIB%g
s%@INCLUDE_PATH@%$INCLUDE_PATH%g
s%@LIB_LIST@%$LIB_LIST%g" | sed -e "
s%@LIB_PATH@%$LIB_PATH%g
s%@LIB_DIR@%$LIB_DIR%g
s%@MAKE@%$MAKE%g
s%@MPE_DIR@%$MPE_DIR%g
s%@MPE_MPI_EXT_C@%$MPE_MPI_EXT_C%g
s%@MPE_MPI_EXT_O@%$MPE_MPI_EXT_O%g
s%@MPICH_VERSION@%$MPICH_VERSION%g
s%@MPIR_HOME@%$MPIR_HOME%g
s%@MPIFDEP@%$MPIFDEP%g
s%@MPI_FOBJECTS@%$MPI_FOBJECTS%g
s%@MPI_AINT@%$MPI_AINT%g
s%@MPI_FINT@%$MPI_FINT%g
s%@MPILIBNAME@%$MPILIBNAME%g
s%@MPICC@%$MPICC%g
s%@MPIF77@%$MPIF77%g
s%@MPIF90@%$MPIF90%g
s%@MPICPLUSPLUS@%$MPICPLUSPLUS%g
s%@MEMDEBUG@%$MEMDEBUG%g
s%@GLOBUSDIR@%$GLOBUSDIR%g
s%@NLS_DEFS@%$NLS_DEFS%g
s%@NEWTESTDIRS@%$NEWTESTDIRS%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@OPTFLAGSC@%$OPTFLAGSC%g
s%@OPTFLAGSF@%$OPTFLAGSF%g
s%@P4_ARCH@%$P4_ARCH%g
s%@P4_DIR@%$P4_DIR%g
s%@RHS_COMMAND@%$RHS_COMMAND%g
s%@P4_MDEPCFLAGS@%$P4_MDEPCFLAGS%g
s%@PREFIX@%$PREFIX%g
s%@USER_CFLAGS@%$USER_CFLAGS%g
s%@USER_INCLUDE_PATH@%$USER_INCLUDE_PATH%g
s%@ROMIO@%$ROMIO%g
s%@ROMIO_LFLAGS@%$ROMIO_LFLAGS%g
s%@ROMIO_TCFLAGS@%$ROMIO_TCFLAGS%g
s%@ROMIO_TCPPFLAGS@%$ROMIO_TCPPFLAGS%g
s%@ROMIO_TFFLAGS@%$ROMIO_TFFLAGS%g
s%@buildcpp@%$buildcpp%g
s%@NOF77@%$NOF77%g
s%@NOMPE@%$NOMPE%g
s%@MPE_OPTS@%$MPE_OPTS%g
s%@JUMPSHOT_OPTS@%$JUMPSHOT_OPTS%g
s%@F77IARGC@%$F77IARGC%g" | sed -e "
s%@F77GETARGDECL@%$F77GETARGDECL%g
s%@F77GETARG@%$F77GETARG%g
s%@F90UNIX@%$F90UNIX%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" >> $file
fi; done

CONFIG_HEADERS=${CONFIG_HEADERS-"mpichconf.h"}
for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
echo creating $file

# These sed commands are put into SEDDEFS when defining a macro.
# They are broken into pieces to make the sed script easier to manage.
# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
# is the cpp macro being defined and VALUE is the value it is being given.
# Each defining turns into a single global substitution command.
#
# SEDd sets the value in "#define NAME VALUE" lines.
SEDdA='s@^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
SEDdB='\([ 	][ 	]*\)[^ 	]*@\1#\2'
SEDdC='\3'
SEDdD='@g'
# SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
SEDuA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDuB='\([ 	]\)@\1#\2define\3'
SEDuC=' '
SEDuD='\4@g'
# SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
SEDeA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDeB='$@\1#\2define\3'
SEDeC=' '
SEDeD='@g'
rm -f conftest.sed
EOF
# Turn off quoting long enough to insert the sed commands.
rm -f conftest.sh
cat > conftest.sh <<EOF
$SEDDEFS
EOF

# Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
# on the size of here documents.

# Maximum number of lines to put in a single here document.
maxshlines=9

while :
do
  # wc gives bogus results for an empty file on some systems.
  lines=`grep -c . conftest.sh`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2
  sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  # Write a limited-size here document to append to conftest.sed.
  echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  cat conftest.s1 >> config.status
  echo 'CONFEOF' >> config.status
  rm -f conftest.s1 conftest.sh
  mv conftest.s2 conftest.sh
done
rm -f conftest.sh

# Now back to your regularly scheduled config.status.
cat >> config.status <<\EOF
# This sed command replaces #undef's with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it in
# mpichconf.h.
cat >> conftest.sed <<\CONFEOF
s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
CONFEOF
rm -f conftest.h
# Break up the sed commands because old seds have small limits.
maxsedlines=20
cp $top_srcdir/$file.in conftest.h1
while :
do
  lines=`grep -c . conftest.sed`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2 conftest.h2
  sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  sed -f conftest.s1 < conftest.h1 > conftest.h2
  rm -f conftest.s1 conftest.h1 conftest.sed
  mv conftest.h2 conftest.h1
  mv conftest.s2 conftest.sed
done
rm -f conftest.sed conftest.h
echo "/* $file.  Generated automatically by configure.  */" > conftest.h
cat conftest.h1 >> conftest.h
rm -f conftest.h1
if cmp -s $file conftest.h 2>/dev/null; then
  # The file exists and we would not be changing it.
  echo "$file is unchanged"
  rm -f conftest.h
else
  rm -f $file
  mv conftest.h $file
fi
fi; done



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

#
# Once we've done one output of the header file, we don't need to do it
# again.  By defining the header as null, we hope to avoid messages about
# "mpichconf.h unchanged"
CONFIG_HEADERS=""
export CONFIG_HEADERS

CONFIG_FILES="util/mpicc util/mpiCC util/mpif77 util/mpif90 util/mpiinstall util/chkserv util/chkmachine"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in util/mpicc util/mpiCC util/mpif77 util/mpif90 util/mpiinstall util/chkserv util/chkmachine ; 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


CONFIG_FILES="include/mpidefs.h include/mpif.h"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in include/mpidefs.h include/mpif.h ; do 
    /bin/rm -f .pactmp
    sed -e '1d' $pac_file > .pactmp
    /bin/rm -f $pac_file
    mv .pactmp $pac_file
    chmod a+r $pac_file
done

/bin/rm -f build/$ARCH/$DEVICE/include/mpidefs.h
cp include/mpidefs.h build/$ARCH/$DEVICE/include/mpidefs.h
if test -n "$F90" ; then
    # Remove all comments from mpif.h
    /bin/rm -f include/mpif.h.copy
    cp include/mpif.h include/mpif.h.copy
    if test "$fixupmpif" = "no" ; then
	# Regular Fortran doesn't have ! for comments, so we just delete them
        sed -e '/^C/d' -e 's/\!.*$//g' include/mpif.h.copy > include/mpif.h
    else
        sed -e 's/^C/\!/g' include/mpif.h.copy > include/mpif.h
    fi
    /bin/rm -f include/mpif.h.copy
else
    # ROMIO might have added ! comments to mpif.h
    if test -z "$fixupmpif" -o "$fixupmpif" = "no" ; then
        /bin/rm -f include/mpif.h.copy
        cp include/mpif.h include/mpif.h.copy
	# Regular Fortran doesn't have ! for comments, so we just delete them
        sed -e '/^C/d' -e 's/\!.*$//g' include/mpif.h.copy > include/mpif.h
        /bin/rm -f include/mpif.h.copy
    fi
fi
/bin/rm -f build/$ARCH/$DEVICE/include/mpif.h

cp include/mpif.h build/$ARCH/$DEVICE/include/mpif.h

CONFIG_FILES="src/env/farg.f"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in src/env/farg.f ; do 
    /bin/rm -f .pactmp
    sed -e '1d' $pac_file > .pactmp
    /bin/rm -f $pac_file
    mv .pactmp $pac_file
    
done

for file in mpicc mpiCC mpif77 mpif90 mpiinstall ; do
    if test -s util/$file ; then 
        rm -f bin/$file
	mv util/$file bin/$file
    fi
done
#
# Scripts in util: Copy to bin directory (for users of a single device/arch)
for src in mpicc mpiCC mpif77 mpif90 mpiinstall ; do 
  cp bin/$src build/$ARCH/$DEVICE/bin
done
#
# Configure the tests (now that the compiler scripts are built)
echo "Configuring the test suite..."
#echo "(cd examples/test ; ./configure -cc=$MPICC -fc=$MPIF77 -mpichpath=$MPIR_HOME/build/$ARCH/$DEVICE/bin )"
# Building a dummy library allows mpicc et al to build non-MPI programs
#built_dummy_lib=0
#set -x
#if test ! -s build/$ARCH/$DEVICE/lib/lib$MPILIBNAME.a ; then
#    $AR cr build/$ARCH/$DEVICE/lib/lib$MPILIBNAME.a /dev/null # >/dev/null 2>&1
#    built_dummy_lib=1
#fi
#set +x
unset CONFIG_FILES
if test "$HAS_F77" = "1" ; then
    ( cd examples/test ; ./configure -basecc="$CC" -cc="$MPICC" \
	 			     -basefc="$F77" -fc="$MPIF77" \
			     -mpichpath="$MPIR_HOME/build/$ARCH/$DEVICE/bin")
else
    ( cd examples/test ; ./configure -basecc="$CC" -cc="$MPICC" \
	 			     -basefc="$F77" -fc="$MPIF77" -nof77 \
			      -mpichpath="$MPIR_HOME/build/$ARCH/$DEVICE/bin")
fi
#if test $build_dummy_lib = 1 ; then
#    rm -f build/$ARCH/$DEVICE/lib/lib$MPILIBNAME.a
#fi
#
# Configure JUST the correct device file
CONFIG_FILES="mpid/$DEVICE/Makefile"
if test -f mpid/tests/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES mpid/tests/Makefile"
fi
if test -n "$device_ch_shmem" ; then
    if test -s mpid/ch_shmem/p2ptest/Makefile.in ; then
        CONFIG_FILES="$CONFIG_FILES mpid/ch_shmem/p2ptest/Makefile"
    fi
fi
if test -n "$device_ch_tcp" -a -s mpid/ch_tcp/p3/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES  mpid/ch_tcp/p3/Makefile"
fi
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
#
# Set the final choices of flags
#
# If the test suite is part of the directory, generate its makefiles
if test -d tsuite ; then
    CONFIG_FILES="tsuite/Makefile tsuite/coll/Makefile tsuite/pt2pt/Makefile tsuite/mpitc2/Makefile"
    export CONFIG_FILES
    ${CONFIG_SHELL-/bin/sh} ./config.status
fi
#
# If the bugs directory is available, generate its makefiles
if test -d bugs ; then
    CONFIG_FILES=""
    if test -s bugs/Makefile.in ; then
	CONFIG_FILES="bugs/Makefile.in"
    fi
    for dir in irecv fort sockperf srleak ssend testsendrecv wait ; do
	if test -s bugs/$dir/Makefile.in ; then
	    CONFIG_FILES="$CONFIG_FILES bugs/$dir/Makefile"
	fi
    done
    export CONFIG_FILES
    ${CONFIG_SHELL-/bin/sh} ./config.status
fi
#
# If the xmpi directory is available, generate its files
if test -d xmpi ; then 
    CONFIG_FILES="xmpi/buildinfo.tcl"
    export CONFIG_FILES
    ${CONFIG_SHELL-/bin/sh} ./config.status
fi
#
# If the mpich-ibm testsuite is available, generate its files
if test -d examples/test/mpitc ; then
    CONFIG_FILES="examples/test/mpitc examples/test/mpitc/ccl examples/test/mpitc/comm examples/test/mpitc/dtyp examples/test/mpitc/env examples/test/mpitc/group examples/test/mpitc/pt2pt examples/test/mpitc/topo"
    export CONFIG_FILES
    ${CONFIG_SHELL-/bin/sh} ./config.status
fi
#
# If the doc/port.in file is available, generate it
if test -f doc/port.in ; then
    
CONFIG_FILES="doc/port doc/portbuild doc/portperf doc/porttest"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in doc/port doc/portbuild doc/portperf doc/porttest ; 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

fi
#
# Remove the old config.status and copy new one; this allows mpireconfig to
# work with the current configuration.
# 
/bin/rm -f build/$ARCH/$DEVICE/bin/config.status
cp ./config.status build/$ARCH/$DEVICE/bin
#
# If we put the DEF values into this file, copy it to the library directory
# We also need the .in file for config.status (used by mpireconfig)
if test -f mpichconf.h ; then
    mv mpichconf.h build/$ARCH/$DEVICE/include
    cp mpichconf.h.in build/$ARCH/$DEVICE/include
fi
#
# add ROMIO part of mpif.h if it exists
if test -f romio/include/mpiof.h ; then
  echo "preparing mpif.h for ROMIO"
  cat include/mpif.h romio/include/mpiof.h > mpif-tmp.h
  rm -f include/mpif.h
  mv mpif-tmp.h include/mpif.h
  rm -f build/$ARCH/$DEVICE/include/mpif.h
  cp include/mpif.h build/$ARCH/$DEVICE/include/mpif.h
#else
#  echo "not preparing mpif.h for ROMIO"
fi
#
if test ! -f .mpich -a -z "$nobanner" ; then
  print_error "--->"
  print_error You should register your copy of MPICH with us by sending mail
  print_error to majordomo@mcs.anl.gov containing the message
  print_error subscribe mpi-users
  print_error This will allow us to notify you of new releases of MPICH.
  print_error " "
  print_error "You can also check the MPICH home page at "
  print_error "http://www.mcs.anl.gov/mpi/mpich/index.html"
  print_error "---< "
fi
#
# Issue warnings about multiple devices with same architecture
dev_count=0
for dir in build/$ARCH/*/include ; do
    if test -s $dir/mpidefs.h ; then 
        dev_count=`expr $dev_count + 1`
    fi
done
if test $dev_count -gt 1 ; then
    /bin/rm -f include/mpidefs.h
    # We need include/mpif.h for the build of files in env/*.f
    #/bin/rm -f include/mpif.h
    /bin/rm -f include/mpichconf.h
    echo "When building multiple MPICH devices for the same architecture"
    echo "make sure that you use the commands and mpidefs include file in"
    echo "build/$ARCH/$DEVICE/bin,include instead of bin/ and include/ ."
fi
echo 'Configuration completed.'
exit 0
