dnl This is an autoconf script.
dnl To rebuild the `configure' script from this, execute the command
dnl 	autoconf
dnl in the directory containing this script.  You must have autoconf
dnl version 1.7.  This does *not* work with Autoconf 2.x, or with 1.8 or 
dnl later (!).
dnl
dnl The following text appears in the resulting `configure' script,
dnl explaining how to rebuild it.
[#!/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 ;
    }

# The following are used to help move users to the eventual autoconf2 version
found_old=""
# 
# print_dep is for deprecated argument styles (prepare users for autoconf2)
print_dep() {
    echo "Use the argument $2 instead of $1"
    found_old="$found_old
Use the argument $2 instead of $1"
}
print_useenv() {
    msg="$1"
    msg=`echo "$msg" | sed -e 's/=\([^ ]*\) \(.*\)$/="\1 \2"/'`
    echo "Use the environment variable $2 instead of configure argument $msg"
    found_old="$found_old
Use the environment variable $2 instead of configure argument $msg"
}
print_other() {
    echo "Use $2 instead of $1"
    found_old="$found_old
Use $2 instead of $1"
}
# Check that arg is newstyle; print message if it isn't
# Check_dep (arg, newstyle)
check_dep() {
    case $1 in
	-*with-* | -*without-* ) ;;
	-*enable-* | -*disable-* ) ;;
	*) print_dep "$1" "$2"  
	;;
    esac
}

print_usage() {
cat <<EOF
Usage: ${progname} [--with-arch=ARCH_TYPE] [--with-comm=COMM_TYPE]
            [--with-device=DEVICE]
            [--with-mpe] [--without-mpe] 
            [--without-romio]
	    [--disable-f77] [--disable-f90] [--with-f90nag] [--with-f95nag] 
	    [--disable-f90modules]
            [--disable-gencat] [--disable-doc]
            [--enable-cxx ] [--disable-cxx]
            [--with-coll[=filename]]
            [--enable-mpedbg] [--disable-mpedbg] 
            [--enable-devdebug] [--disable-devdebug] 
            [--enable-debug] [--disable-debug] 
	    [--enable-traceback] [--disable-traceback]
            [--enable-long-long] [--disable-long-long]
            [--enable-long-double] [--disable-long-double]
            [-prefix=INSTALL_DIR] 

            [-c++[=C++_COMPILER] ] [noc++] 
            [-opt=OPTFLAGS] 
            [-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
            [-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
            [-c++linker=CC_LINKER] 
            [-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]
            [-mpe_opts=MPE_OPTS]
	    [-make=MAKEPGM ]
            [-memdebug] [-ptrdebug] [-tracing] [-dlast]
	    [-listener_sig=SIGNAL_NAME]
            [-cross]
            [-adi_collective]
            [-automountfix=AUTOMOUNTFIX]
            [-noranlib] [-ar_nolocal] 
            [-rsh=RSHCOMMAND] [-rshnol]
            [-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
   P4_OPTS         = options to pass to the P4 configure (device=ch_p4)
   C++_COMPILER    = default is to use xlC, g++, or CC (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
   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.
   FILE_SYSTEM     = name of the file system ROMIO is to use.  Currently 
                     supported values are nfs, ufs, pfs (Intel), 
                     piofs (IBM), hfs (HP), sfs (NEC), and xfs (SGI).
   SIGNAL_NAME     = name of the signal for the P4 (device=ch_p4) device to
                     use to indicate that a new connection is needed.  By
                     default, it is SIGUSR1.

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.

Packages that may be included with MPICH

--with-device=name     - Use the named device for communication.  Known
                         names include ch_p4, ch_mpl, ch_shmem, and globus2.
                         If not specified, a default is chosen.  Special 
                         options for the device are specified after the 
                         device name, separated by a colon.  E.g., 
                         --with-device=globus2:-flavor=mpi,nothreads
--with-romio[=OPTIONS] - Use ROMIO to provide MPI-I/O from MPI-2 (default).
                         The options include -file_system=FSTYPE, where
                         fstype can be any combination of nfs, ufs, 
                         pfs (intel), piofs (IBM), hfs (HP), sfs (NEC), and 
                         xfs (SGI), combined with '+'.  If romio is not
                         included, the Fortran 90 modules cannot be built.
--with-mpe             - Build the MPE environment (default)
--with-coll[=name]     - Select the implementation of the MPI collective
                         routines that should be used.  By default, uses
                         the most advanced version.  The name is the name of
                         the file (without the suffix) in src/coll that should 
                         be used for the collective routines.  Currently, 
                         name may be either intra_fns_new (the default) or
                         intra_fns .
--with-f90nag          - Choose the NAG f90 compiler for Fortran 
                         (preliminary version intended for use *instead* 
                         of a Fortran 77 compiler)
--with-f95nag          - Choose the NAG f95 compiler for Fortran
--with-cross=file      - Use the file for cross compilation. The file
                         should contain assignments of the form
                            CROSS_SIZEOF_INT=4
                         for each cross compilation variable.  The command
                            egrep 'CROSS_[A-Z_]*=' configure | sed 's/=.*//g'
                         will list each variable.

You can use --without-<featurename> to turn off a feature (except for 
device).
EOF
#
# For each device with a setup file, give the usage output
if test -z "$srcdir" ; then srcdir="." ; fi
for mpid in $srcdir/mpid/* ; do
    if test -d $mpid ; then
	DEVICE=`echo $mpid | sed 's%.*/%%g'`
 	device_setup=$mpid/setup_$DEVICE
        if test -f $device_setup ; then
	    echo "Options for device $DEVICE:" 
	    export DEVICE
	    eval $device_setup --usage 2>&1
	    echo " "
	fi
    fi
done
#
cat <<EOF
Features that may be included with MPICH

--enable-cxx          - Build C++ interfaces to the MPI-1 routines 
                        (default)
--enable-f77          - Build Fortran 77 interfaces to the MPI 
                        routines (default)
--enable-weak-symbols - Use weak symbols for MPI/PMPI routines.  This uses
                        weak symbols, if available, for the profiling 
                        interface (default)
--enable-debug        - Enable support for debuggers to access message 
                        queues
--enable-traceback    - Enable printing of a call stack when MPI and the
		        user's program is built with certain compilers 
			(currently only some versions of gcc are supported).
--enable-mpedbg       - Enable the -mpedbg command-line argument (e.g., 
                        errors can start an xterm running a debugger).  
                        Only works with some workstation systems.
--enable-sharedlib    - Attempt to build shared libraries.  Static 
--enable-sharedlib=dir  libraries are always built.  If a directory is
                        specified, the shared libraries will be placed in 
                        that directory.  This can be used to place the 
                        shared libraries in a uniform location in local 
                        disks on a cluster.
--enable-f90modules   - Build Fortran 90 module support (default if a
                        Fortran 90 or 95 compiler is found).  If ROMIO
                        is not built, no Fortran 90 modules will be built.

The following are intended for MPI implementors and debugging of configure
--enable-strict       - Try and build MPICH using strict options in Gnu gcc
--enable-echo         - Cause configure to echo what it does
--enable-devdebug     - Enable debugging code in the ADI.  

You can use --disable-<featurename> to turn off a feature.

Notes on configure usage:

The suggestions for GNU configure usage suggest that configure not be used
to build different tools, only controlling some basics of the features 
enabled or the packages included.  Our use of configure does not follow 
these rules because configure is too useful but we need the flexibility 
that allows the user to produce variations of MPICH.

More notes on command-line parameters:

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.

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.  

Note that the '-opt' options are not passed to the 'mpicc', 'mpif77', 
'mpiCC', and 'mpif90' scripts.  The '-opt' options are used only in 
building MPICH.

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, to make use of VPATH builds (building in one directory with the
source in a different directory), -make=gnumake may be required.

The option '--disable-short-longs' may be used to suppress support for 
the C types 'long long' (a common extension) and 'long double' (ANSI/ISO C)
when they are the same size as 'long' and 'double' respectively.  Some 
systems allow these long 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). '--disable-long-long' disables just 'long long';
'--disable-long-double' disables just 'long double'.

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 environment variable 'RSHCOMMAND' 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., '--with-device=ch_p4').  
The configure option '-rsh' is supported for backward compatibility.

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 '-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.  

Options for Experts:

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 '-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.  

Sample Configure Usage:

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

  ./configure --with-device=ch_p4 --with-arch=solaris
  make

Known devices are 
        ch_nx     (native Intel NX calls), 
        ch_mpl    (native IBM EUI or MPL calls),
        ch_p4     (p4)
        ch_p4mpd  (p4 with the MPD startup system)
	globus2   (Globus: globus_io/vMPI)
        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)
	ch_gm     (native Myrinet GM, distributed and supported by Myricom)

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)
        alpha     (Compaq alpha)
        CRAY      (CRAY XMP, YMP, C90, J90, T90)
        cray_t3d  (CRAY T3D)
        CYGWIN_NT (PCs using Cygwin) 
        EWS_UX_V  (NEC EWS4800/360AD Series workstation.  Untested.)
        freebsd   (PC clones running FreeBSD)
        hpux      (HP UX)
        intelnx   (Intel i860 or Intel Delta)
        IRIX      (synonym for sgi)
        IRIX32    (IRIX with 32bit objects -32)
        IRIXN32   (IRIX with -n32)
        IRIX64    (IRIX with 64bit objects)
        ksr       (Kendall Square KSR1 and KSR2)
	LINUX     (PC clones running LINUX)
        LINUX_ALPHA (Linux on Alpha processors)
        meiko     (Meiko CS2)
        netbsd    (PC clones running NetBSD)
        paragon   (Intel Paragon)
        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)
        solaris   (Solaris)
	solaris86 (Solaris on Intel platforms)
        sppux     (SPP UX)
        sun4      (SUN OS 4.x)
        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)
	tflops    (Intel TFLOPS)
        UXPM      (UXP/M. Untested.)
        uxpv      (uxp/v. Untested.)

    Others may be recognized.

Special notes:

For SGI (--with-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.

EOF
}
#
# Special environment variables
# MPICH_WARNING_SEP - if set, is echoed around warning messages.  This is
# used to simplify automated testing where we want to ignore warning messages
# Specifically, echo '>'$MPICH_WARNING_SEP preceeds the warning and
#               echo '<'$MPICH_WARNING_SEP follows it
# finderrors and findnosuccess use the same environment variable to 
# skip output
#
UseSharedLibs=0
NEEDS_CC_SHARED_OPT=1
ARCH=""
CPP_DIR=""
MPE_DIR=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
F90=${F90:-""}
f90nag=0
f95nag=0
NOF77=0
NO_F90=0
NOMPE=0
ENABLE_MPEDBG=""
NOCXX=""
AR_LOCAL=${AR_LOCAL:-"l"}
NO_LONG_DOUBLE="no"
NO_LONG_LONG="no"
HAS_FORTRAN=1
MPILIBNAME=${MPILIBNAME:-"mpich"}
do_f90modules="yes"
HAVE_MPID_DEFS_H=0
#
MPI_AINT=long
CFLAGS=${CFLAGS:-""}
# Set this if we pick features that require gcc
needs_gcc=no
#
Use_Intercomm_coll="no"
# Attempt to use weak symbol support
TRY_WEAK_SYMBOLS=1
# We use @ because configure uses %
AUTOMOUNTFIX=${AUTOMOUNTFIX:-'sed -e s@/tmp_mnt/@/@g'}
#
# By not setting FFLAGS, we get the values from the environment
# Most of these should come from the environment if set
MAKE=${MAKE:-"make"}
P4_MDEPCFLAGS=""
ASMFILES_O=""
PREFIX=""
MPE_OPTS=""
P4_OPTS=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
rshcommand=${RSHCOMMAND}
#
# Some autoconf tests check for cross_compiling being empty, rather than
# having a value of 0 or 1 (or no or yes).
cross_compiling=""
cross_file=""
debug_version=0
#
FILE_SYSTEM=""
ROMIO=1
ROMIO_CFLAGS=""
ROMIO_FFLAGS=""
ROMIO_LFLAGS=""
ROMIO_TCFLAGS=""
ROMIO_TCPPFLAGS=""
ROMIO_TFFLAGS=""
usesysv=0
#
# -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"
#
# --with-coll
MPI_INTRA=intra_fns_new
# -devdebug
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
# -dlast
DLAST=""
# Traceback
try_traceback=no
#
# 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
# 
if test -s include/patchlevel.h ; then
    tmpsrcdir=.
else
    # try to determine the source dir
    tmpsrcdir=`echo $0 | sed -e 's%/configure%%' -e "s%^~/%$HOME/%"`
    if test ! -s "$tmpsrcdir/include/patchlevel.h" ; then
        tmpsrcdir=""
    fi
fi
if test -n "$tmpsrcdir" ; then
    MPIVERSION=`grep 'PATCHLEVEL ' $tmpsrcdir/include/patchlevel.h | awk '{print $3}'`
    # Make sure to remove quotes...
    mvk=`grep 'PATCHLEVEL_RELEASE_KIND' $tmpsrcdir/include/patchlevel.h | awk '{print $3}' | \
     sed -e 's/"//g'`
    mv1=`grep 'PATCHLEVEL_SUBMINOR' $tmpsrcdir/include/patchlevel.h | awk '{print $3}'`
    mvtime=`grep 'Date:' $tmpsrcdir/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
    echo "Configuring MPICH Version $MPIVERSION"
fi
#
# 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
    # Code from autoconf 2 to get any option after an =
    case "$arg" in
    -*=*) ac_optarg=`echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) ac_optarg= ;;
    esac
    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 ;;
     -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 ;;

     -datadir=* | --datadir=* )
	datadir=`echo $arg | sed 's/[-a-z_]*=//'` ;;

     -libdir=* | --libdir=* )
	libdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;

     -bindir=* | --bindir=* )
	bindir=`echo $arg | sed 's/[-a-z_]*=//'` ;;

     -sbindir=* | --sbindir=* )
	sbindir=`echo $arg | sed 's/[-a-z_]*=//'` ;;

     -mandir=* | --mandir=* )
	mandir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;

     -docdir=* | --docdir=* )
	docdir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;

     -wwwdir=* | --wwwdir=* )
	htmldir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;

     -htmldir=* | --htmldir=* )
	htmldir=`echo A$arg | sed 's/A[-a-z_]*=//'` ;;

     -includedir=* | --includedir=* )
	includedir=`echo $arg | sed 's/[-a-z_]*=//'` ;;

     -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

#
# Here begin the MPICH options
     -arch=* | --arch=* | -with-arch=* | --with-arch=*)
       check_dep $arg "--with-arch=name"
       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
       # Extract arch-specific args
       ARCH=`echo $package | sed 's/:.*//g'`
       arch_args=`echo $package | sed 's/[^:]*://g'`
       if test "$arch_args" = "$package" ; then arch_args='' ; fi
       eval "arch_`echo $ARCH|sed s/-/_/g`=1"
       ;;

     -comm=* | --comm=* | --with-comm=* | -with-comm=*)
       check_dep $arg "--with-comm=type"
       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" 
	;;

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

     -mpedbg | --mpedbg | --enable-mpedbg | -enable-mpedbg)
	check_dep $arg "--enable-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"
	ENABLE_MPEDBG="--enable-mpedbg"
	;;

     -nompedbg | --nompedbg | --disable-mpedbg | -disable-mpedbg)
	check_dep $arg "--disable-mpedbg"
	# Definitions of DEFS must follow the PREPARE
	MPE_MPI_EXT_C=""
	MPE_MPI_EXT_O=""
	;;

     -sharedlib* | --sharedlib* | --enable-sharedlib* | -enable-sharedlib*)
	check_dep $arg "--enable-sharedlib"
	# Try to build shared libraries
	sharedlib_dir=`echo A$arg|sed -e 's/A-.*sharedlib=//g'`
	if test "$sharedlib_dir" = "A$arg" ; then sharedlib_dir="" ; fi
	if test -z "$sharedlib_dir" ; then
	    enable_args="$enable_args --enable-sharedlib --enable-shared"
	fi
	UseSharedLibs=1
	;;

     -nosharedlib | --nosharedlib | --disable-sharedlib | -disable-sharedlib)
	check_dep $arg "--disable-sharedlib"
	# Done't use shared libraries
	UseSharedLibs=0
	enable_args="$enable_args --disable-shared --disable-sharedlib"
	;;

     --enable-strict|-enable-strict|-strict)
	check_dep $arg "--enable-strict"
	# Setup for gcc strict checking
	# To get -Wuninitialized, we need -O
        # The definition of GCC_WALL allows us to conditionally change the
	# code when gcc generates a spurious error message, particularly
	# for uninitialized data.
	# -wshadow?
	CFLAGS="$CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-cast -DGCC_WALL"
	USER_CFLAGS="$USER_CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-casti -DGCC_WALL"
	ROMIO_CFLAGS="$ROMIO_CFLAGS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wundef -Wpointer-arith -Wbad-function-cast -DGCC_WALL"
	needs_gcc=yes
	if test -z "$CC" ; then
	    CC=gcc
	    USERCC=1
        fi
	COPTIONS="$COPTIONS -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -DGCC_WALL"
        export COPTIONS
        enable_args="$enable_args $arg"
	enable_strict="yes"
	;;

	--enable-coverage|-enable-coverage)
	CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
	;;

     --enable-weak-symbols|-enable-weak-symbols)
	check_dep $arg "--enable-weak-symbols"
	TRY_WEAK_SYMBOLS=1
        enable_args="$enable_args $arg"
	;;
     --disable-weak-symbols|-disable-weak-symbols)
	check_dep $arg "--disable-weak-symbols"
	TRY_WEAK_SYMBOLS=0
	ROMIO_ARGS="$ROMIO_ARGS --disable-weak-symbols"
        enable_args="$enable_args $arg"
	;;

     -disable-gencat | --disable-gencat) 
        ignore_gencat="yes"
	;;
     -ar_nolocal | --ar_nolocal)
        print_useenv $arg "AR_LOCAL=''" 
	AR_LOCAL=''
	;;

     -noranlib | -no_ranlib)
        print_useenv $arg "RANLIB=':'"
        RANLIB=':'
	;;

# which device(s) - ch_shmem etc (device_args)
#dnl     -usesysv)
#dnl	usesysv=1
#dnl 	;;

# end of ch_shmem /ch_lfshmem device

# This is a p4 option.  It should be an env variable or a 
#--with-device=ch_p4:-listenersig=SIGUSR2

      -listenersig=*)
	 check_dep $arg "--with-device=ch_p4:-listenersig=name"
         listener_sig=`echo A$arg|sed -e 's/A-listenersig=//g'`
         ;;

      -listener_sig=*)
 	 check_dep $arg "--with-device=ch_p4:-listenersig=name"
         listener_sig=`echo A$arg|sed -e 's/A-listener_sig=//g'`
         ;;

     -dlast | --dlast | --enable-dlast | -enable-dlast )
	check_dep $arg "--enable-dlast"
	DLAST="-dlast"
	;;

     -p4_opts=* | --p4_opts=*)
#       Not yet - we don't have a good way to pass args to the p4 configure
#	echo "This option is deprecated.  Please use"
#	echo "--with-device=ch_p4:<options to pass p4 configure>"
#	echo "instead."
	package="`echo $arg | sed 's/-*p4_opts=//'`"
	if test -z "$P4_OPTS" ; then
  	    P4_OPTS="$package" 
	else
	    P4_OPTS="$P4_OPTS $package"
	fi
	;;
    
## end of ch_p4 device

     -nodevdebug | --nodevdebug | -disable-devdebug | --disable-devdebug)
	check_dep $arg "--disable-devdebug"
        NODEVDEBUG=1
	DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
	;;

     -devdebug | --devdebug | -enable-devdebug | --enable-devdebug)
	check_dep $arg "--enable-devdebug"
        NODEVDEBUG=0
	DEVDEBUGCFLAGS=""
	;;

     -debug | --debug | --enable-debug | -enable-debug )
	check_dep $arg "--enable-debug"
	debug_version=1
	enable_args="$enable_args --enable-debug"
	;;
	
     -nodebug | --nodebug | --disable-debug | -disable-debug )
	check_dep $arg "--disable-debug"
	debug_version=0
	enable_args="$enable_args --disable-debug"
	;;

     -enable-traceback | --enable-traceback)
	try_traceback=yes
	needs_gcc=yes
	enable_args="$enable_args --enable-traceback"
	;;
     -disable-traceback | --disable-traceback)
	try_traceback=no
	enable_args="$enable_args --disable-traceback"
	;;

     -enable-g | --enable-g | --enable-g=* | -enable-g=* )
	debug_version=1
	OPTFLAGS="$OPTFLAGS -g"	
        if test "$ac_optarg" = "all" ; then
	    MEMDEBUG=1
	    PTRDEBUG=1
	    TRDEBUG=1
	    NODEVDEBUG=0
	    DEVDEBUGCFLAGS=""
	    DLAST="-dlast"
        fi
	enable_args="$enable_args $arg"
	if test -z "$ac_optarg" ; then
	    enable_g="yes"
	else
	    enable_g="$ac_optarg"
	fi
	;;

     -disable-g | --disable-g )
        enable_g="no"
	enable_args="$enable_args --disable-g"
	;;

# This is should be an env variable
     -mpilibname=*)
        print_useenv "$arg" "MPILIBNAME"
	MPILIBNAME=`echo A$arg|sed 's/A-*mpilibname=//'`
	;;

     -no_short_longs | --no_short_longs | --disable-short-longs | -disable-short-longs)
	check_dep $arg "--disable-short-longs"
	NO_LONG_DOUBLE="yes"
	NO_LONG_LONG="yes"
	enable_args="$enable_args --disable-short-longs"
	;;

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

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

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

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

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

     -memdebug | --memdebug)
        print_other $arg "--enable-g=all"
	MEMDEBUG=1
	;;

     -ptrdebug | --ptrdebug)
        print_other $arg "--enable-g=all"
	PTRDEBUG=1
	;;

     -tracing | --tracing)
        print_other $arg "--enable-g=all"
	TRDEBUG=1
	;;

     -with-cross* | --with-cross*)
	withval=`echo $arg | sed 's/-*with-cross[=]*//g'`
	cross_file=$withval
	cross_compiling=1
	with_args="$with_args $arg"
	;;

     -with-flibname* | --with-flibname*)
	withval=`echo $arg | sed 's/-*with-flibname[=]*//g'`
	flibname=$withval
	;;

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

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

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

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

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

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

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

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

     -f90nag | --with-f90nag | -with-f90nag)
	check_dep $arg "--with-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 | --with-f95nag | -with-f95nag)
	check_dep $arg "--with-f95nag"
        # Insert module 
	USER_SET_GETARG=1
	F90UNIX="      use f90_unix_env"
	FC=f95
        F77GETARGDECL=""
	F90GETARGDECL=""
        FXX_MODULE="       use f90_unix_env"
	F77_GETARGDECL=""
	F77_GETARG="       call getarg(i,s)"
	F77_IARGC="       iargc()"
	f95nag=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=*)
        print_useenv "$arg" "F90"
	F90=`echo $arg|sed 's/-*f90=//'`
	USERF90=1
	;;
      -f90flags=*)
        print_useenv "$arg" "F90FLAGS"
	USER_SET_F90FLAGS=1
	F90FLAGS=`echo $arg|sed 's/-*f90flags=//'`
	;;
      -f90inc=*)
        print_useenv "$arg" "F90INC"
	USER_SET_F90INC=1
	F90INC=`echo $arg|sed 's/-*f90inc=//'`	
	;;
      -f90linker=*)
        print_useenv "$arg" "F90LINKER"
	USER_SET_F90LINKER=1
	F90LINKER=`echo $arg|sed 's/-*f90linker=//'`
	;;
      -f90libpath=*)
        print_useenv "$arg" "F90LIB_PATH"
	USER_SET_F90LIB_PATH=1
	F90LIB_PATH=`echo $arg|sed 's/-*f90libpath=//'`
	;;

      -enable-f90modules | --enable-f90modules)
	do_f90modules="yes"
	enable_args="$enable_args --enable-f90modules"
	;;

      -disable-f90modules | --disable-f90modules)
	do_f90modules="no"
	enable_args="$enable_args --disable-f90modules"
	;;

     -noc++ | --noc++ | --disable-c++ | -disable-c++ | -disable-cxx | --disable-cxx )
	check_dep $arg "--disable-c++"
        NOCXX="nocxx"
        ;;

     --enable-c++ | -enable-c++ | --enable-cxx | -enable-cxx ) 
	# enable_args="$enable_args --enable-c++"
	;;

      --enable-altcxx | -enable-altcxx)
        # This is for testing an alternate c++ implementation.  
	# We use cxx instead of c++ to simplify (the eventual) use of 
	# autoconf v 2, which does not allow enable names with + in them.
	CPP_DIR="src/cxx"
	;;		

      --disable-altcxx | -disable-altcxx)
        ;;

     -c++=* | --c++=*)
       #dnl print_useenv "$arg" CPP_COMPILER and --enable-cxx
       # 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`
       if test -z "$package" ; then
           echo "Use the environment variable CXX to specify a c++ compiler if"
	   echo "you do not want the default (often g++)."
       fi
       USERCPP=1
       # 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=*)
        print_useenv "$arg" CC
	CC=`echo $arg|sed 's/-*cc=//'`
	USERCC=1
	;;

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

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

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

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

     -c++linker=* | --c++linker=*)
       print_useenv "$arg" CCLINKER
       # 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=*)
        print_useenv "$arg" FLINKER
	FLINKER=`echo $arg|sed 's/-*flinker=//'`
	USERFLINKER=1
	;;

      -rsh=*)
        print_useenv "$arg" RSHCOMMAND
	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
	;;
    
     -cflags=* | --cflags=*)
       print_useenv "$arg" CFLAGS
       package="`echo $arg|sed 's/-*cflags=//'`"
       USER_CFLAGS="$package"
       ROMIO_CFLAGS="$package"
       CFLAGS="$CFLAGS $package" ;;

     -c++flags=* | --c++flags=*)
       print_useenv "$arg" CCFLAGS
       # 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=*)
       print_useenv "$arg" FFLAGS
       package="`echo $arg|sed 's/-*fflags=//'`"
       ROMIO_FFLAGS="$package"
       FFLAGS="$package" ;;

     -nompe | --nompe | -without-mpe | --without-mpe)
	check_dep $arg "--without-mpe"
       MPE_DIR=""
       NOMPE=1
       echo "Make will not build MPE routines" ;;
 
     -mpe | --mpe | -with-mpe | --with-mpe )
	check_dep $arg "--with-mpe"
       MPE_DIR="mpe"
       NOMPE=0
	with_args="$with_args $arg"
	;;
 
# Another environment variable
     -make=* | --make=*)
       print_useenv "$arg" MAKE
       package=`echo $arg|sed 's/-*make=//'`
       MAKE="$package"
       export MAKE
	;;

     -nof77 | --nof77 | -disable-f77 | --disable-f77 )
       check_dep $arg "--disable-f77"
       echo "Don't build the Fortran interfaces"
       NOF77=1
       NO_F90=1
       HAS_FORTRAN=0
       CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       romio_config_args="$romio_config_args --disable-f77"
       enable_args="$enable_args --disable-f77"
       ;;

     -nof90 | --nof90 | -disable-f90 | --disable-f90 )
	check_dep $arg "--disable-f90"
        enable_args="$enable_args --disable-f90"
	NO_F90=1 ;;
	
     -automountfix=* | --automountfix=*)
        print_useenv "$arg" AUTOMOUNTFIX
	AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`"
	;;

     -nobanner)
	nobanner=1
	;;

     -echo | --enable-echo | -enable-echo )
        check_dep $arg "--enable-echo"
	set -x 
        configure_echo=1
        enable_args="$enable_args --enable-echo"
	;;

     -noromio | --noromio | --without-romio | --with-romio=no ) 
       check_dep $arg "--without-romio"
       ROMIO=0
       with_args="$with_args --without-romio --without-mpiio"
       ;;

     -with-romio* | --with-romio*)
	withval=`echo $arg | sed 's/-*with-romio[=]*//g'`
	ROMIO_ARGS="$ROMIO_ARGS $withval"
	;;

     -with-intercommcoll | --with-intercommcoll)
	Use_Intercomm_coll="yes"
	;;

     --with-coll* | -with-coll* )
     # If there is a name, use it (no .c suffix on name)
     if test -n "$ac_optarg" ; then
          MPI_INTRA=$ac_optarg
     fi
     ;;

     -with-* | --with-* | --without-* | -without-* )
	# Unrecognized with argument.  Just remember it
	with_args="$with_args $arg"
	;;

     -enable-* | --enable-*)
	# Unrecognized enable argument.  Create the enable_feature=value
	# variable and remember the enable argument
    	ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    	# Reject names that are not valid shell variable names.
    	if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      	{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    	fi
    	ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    	case "$ac_option" in
      		*=*) ;;
      		*) ac_optarg=yes ;;
    	esac
    	eval "enable_${ac_feature}='$ac_optarg'" 

	enable_args="$enable_args $arg"
	;;

     -disable-* | --disable-*)
	# Unrecognized disable argument.  Create the enable_feature=no
    	ac_feature=`echo $ac_option|sed -e 's/-*disable-//' -e 's/=.*//'`
    	# Reject names that are not valid shell variable names.
    	if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      	{ echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    	fi
    	ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    	eval "enable_${ac_feature}=no" 

	enable_args="$enable_args $arg"
	;;

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

      -u | -usage | --usage | --usag | --usa | --us | --u | -help | --help )
	print_usage >& 2
	#
        # This produced too many long wrapped lines; fixing the wrapping 
	# broke the code to extract the usage without duplicating the 
	# boilerplate configure usage.  We should fix this by extracting the
	# messages as part of the "updateconfigure" process, rathter than
	# by having the configure do it on the fly (tradeoff between being
	# able to use better tools and portability).
	#echo ; echo "Options acceptable by '-mpe_opts=' :" ; echo
	#TSD=`echo $0 | sed 's%/[^/][^/]*$%%'`
	#if [ "$TSD" = "$0" -o "X$TSD" = "X." ] ; then
	#    TSD=`pwd`
	#fi
	#$TSD/mpe/configure--help
       exit 1 ;;

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

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

dnl Finish the initalization
rm -f config.log
AC_PREPARE()
dnl
dnl Place the definitions into a configuration file, rather than sedding
dnl them into Makefiles.  
dnl Comment out this line (with dnl!) to force the definitions into
dnl the Makefiles.  Also, make sure that this file gets moved into the
dnl library directory before the builds take place.
AC_CONFIG_HEADER(mpichconf.h)
# We may need to delete this
PAC_FIXUP_SRCDIR
# Check that file system understands different file name cases
CASE_SENSITIVE=no
AC_MSG_CHECKING([whether filesystem respects case in file names])
echo 1 > CONFTEST
echo 2 > conftest
if diff CONFTEST conftest 2>&1 >/dev/null ; then
    AC_MSG_RESULT([no])
    AC_MSG_WARN([You may encounter problems with the commands mpicc and MPICC])
    CASE_SENSITIVE=yes
else
    AC_MSG_RESULT([yes])
fi
rm -f CONFTEST conftest
AC_SUBST(CASE_SENSITIVE)
#
#
# Load any cross-compiling definitions
if test -n "$cross_file" -a -s "$cross_file" ; then
    . $cross_file
fi
# 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
    AC_DEFINE(MPID_USE_ADI_COLLECTIVE)
fi
if test -n "$DLAST" ; then
    AC_DEFINE(USE_HOLD_LAST_DEBUG)
    AC_DEFINE(USE_PRINT_LAST_ON_ERROR)
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.
    AC_DEFINE(MPI_KEEP_SEND_QUEUE)
fi
#
# Find the home directory if not specified
if test "X$srcdir" != "X." -a -s $srcdir/src/pt2pt/Makefile.in ; then 
    MPIR_TRIAL="$srcdir"
else
    PAC_GETWD(MPIR_TRIAL,src/pt2pt/Makefile.in)
fi
MPIR_HOME=$MPIR_TRIAL
AC_SUBST(HASMPE)
if test "$NOMPE" = 0 ; then
    MPE_DIR=$MPIR_HOME/mpe
    HASMPE="yes"
else
    HASMPE="no"
fi
hasMPE=$HASMPE
#
#
# 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 "$srcdir/bin/tarch" ; then
    AC_MSG_CHECKING(for architecture)
    ARCH=`$srcdir/bin/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       AC_MSG_RESULT(Unknown!)
       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"
    AC_MSG_RESULT($ARCH)
fi
if test -n "$arch_ppc_vxworks" ; then
     # VXWORKS (Thanks to Gary Cliff <gary.cliff@cdott.com>)
     # 2/27/01
     echo PPC
     arch_IRIX=1
     ARCH=IRIX
fi
if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
fi
# check whether --arch=tflops was given and set defaults
if test -n "$arch_tflops"; then
   if test -z "$USERCC" ; then 
       CC="cicc"
       USERCC=1
       CFLAGS="$CFLAGS -I. -D__COUGAR__ -D__COUGAR -DCORE_FILES -DP_SCHED -DGDB -DEND_OF_USER_MEM=0xc0100000 -DHAVE_LONG_DOUBLE" 
       OPTFLAGS="-Knoieee -Mvect -O3"
   fi
   if test -z "$USERCPP" ; then CPP_COMPILER="ciCC" ; USERCPP=1 ; fi
   if test -z "$USERF77" ; then FC="cif77" ; USERF77=1 ; fi
   if test -z "$USERF90" ; then F90="cif90" ; USERF90=1 ; fi
   if test -z "$DEVICE" ; then DEVICE="ptls" ; fi
   if test -z "$FILE_SYSTEM" ; then FILE_SYSTEM="pfs+ufs+nfs" ; fi
   DEFAULT_MACHINE="tflops"
   CROSS_STRUCT_ALIGNMENT="basic"
   CROSS_HAS_LONG_LONG=1
   CROSS_HAS_LONG_DOUBLE="yes" 
   # See mpireq -show 5556
   CROSS_SIZEOF_CHAR=${CROSS_SIZEOF_CHAR:-1}
   CROSS_SIZEOF_SHORT=${CROSS_SIZEOF_SHORT:-2}
   CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-4}
   CROSS_SIZEOF_LONG=${CROSS_SIZEOF_LONG:-4}
   CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-8}
   CROSS_SIZEOF_FLOAT=${CROSS_SIZEOF_FLOAT:-4}
   CROSS_SIZEOF_DOUBLE=${CROSS_SIZEOF_DOUBLE:-8}
   CROSS_SIZEOF_LONG_DOUBLE=${CROSS_SIZEOF_LONG_DOUBLE:-8}
   CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-4}
   CROSS_OFFSET_KIND=${CROSS_OFFSET_KIND:-4}
   CROSS_ADDRESS_KIND=${CROSS_ADDRESS_KIND:-4}
   CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-4}
   CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-4}
   CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_DOUBLE_PRECISION:-8}
   CROSS_BIGENDIAN=${CROSS_BIGENDIAN:-false}
   FORT_INT8=1
   # Romio now looks at the CROSS_args
#   ROMIO_ARGS="-intsize=$CROSS_SIZEOF_INT -ptrsize=$CROSS_SIZEOF_VOID_P -longsize=$CROSS_SIZEOF_LONG -longlongsize=$CROSS_SIZEOF_LONG_LONG --without-setbytes"

fi
#
# When specifying a specific IRIX architecture, select the appropriate 
# compiler (and we mean compiler; these aren't flags)
if test -n "$arch_IRIX64" ; then
    arch_IRIX=1
    if test -z "$USERCC" ; then CC="cc -64" ; USERCC=1 ; fi
    if test -z "$USERCPP" ; then CPP_COMPILER="CC -64" ; USERCPP=1 ; fi
    if test -z "$USERF77" ; then FC="f77 -64" ; USERF77=1 ; fi
    if test -z "$USERF90" ; then F90="f90 -64" ; USERF90=1 ; fi
fi
if test -n "$arch_IRIX32" ; then
    arch_IRIX=1
    if test -z "$USERCC" ; then CC="cc -32" ; USERCC=1 ; fi
    if test -z "$USERCPP" ; then CPP_COMPILER="CC -32" ; USERCPP=1 ; fi
    if test -z "$USERF77" ; then FC="f77 -32" ; USERF77=1 ; fi
    if test -z "$USERF90" ; then F90="f90 -32" ; USERF90=1 ; fi
fi
if test -n "$arch_IRIXN32" ; then
    arch_IRIX=1
    if test -z "$USERCC" ; then CC="cc -n32" ; USERCC=1 ; fi
    if test -z "$USERCPP" ; then CPP_COMPILER="CC -n32" ; USERCPP=1 ; fi
    if test -z "$USERF77" ; then FC="f77 -n32" ; USERF77=1 ; fi
    if test -z "$USERF90" ; then F90="f90 -n32" ; USERF90=1 ; fi
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 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
#
# Check that a DEVICE was set
# If it wasn't set, try to guess using "bin/tdevice"
#
if test -z "$DEVICE" -a -x "$srcdir/bin/tdevice" ; then
    AC_MSG_CHECKING(device)
    DEVICE=`$srcdir/bin/tdevice $ARCH`
    if test ! -n "$DEVICE" ; then
	AC_MSG_RESULT(Unknown!)
        print_error "Error: Couldn't guess device, you must" 
        print_error "       set a device with -device=<value>" 
        exit 1
    fi
    eval "device_$DEVICE=1" 
    AC_MSG_RESULT($DEVICE)
fi
#
# Check for a VALID device
if test ! -d "$srcdir/mpid/$DEVICE" ; then
    print_error "$DEVICE is not a valid device!" 
    exit 1
fi
#
#
F77="${FC:-f77}"
if test -n "$FC" ; then
    USERF77=1
fi
# CLINKER and FLINKER are set by PAC _GET_CC and F77
#
# Eventually we'll use install (need install-sh)
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
    AC_PROG_RANLIB
fi
#
# Problem: Using the ar_local option can cause low performance; not using it
# can cause failures.  Should we try to get disk space, and pick default 
# based on a guess about the available space?
AR="ar cr$AR_LOCAL"
ARCMD="ar"
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
INCLUDE_PATH=""
LIB_LIST=""
# Fixup for make
PAC_MAKE_IS_GNUMAKE
PAC_MAKE_IS_BSD44
PAC_MAKE_IS_OSF
#
# WARNING: The AIX VPATH can't handle a trailing blank on the VPATH line (!)
# Use
#  find . -name 'Makefile.in' -exec grep '@VPATH@ ' /dev/null \{\} \;
# to discover these problems
# We should add this as a .cvswrapper test for Makefile.in
PAC_MAKE_VPATH
#
# If we are relying on vpath and no vpath is set, then we must exit
if test ! -s src/pt2pt/isend.c -a -z "$VPATH" ; then
    print_error "No virtual MAKE path command found."
    print_error "You may need to set your make command"
    print_error "The GNU make (sometimes available as gnumake) can be used."
    exit 1
fi
#
# Check that a DEVICE was set or found
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 or found
if test -z "$ARCH" ; then
    print_error "You must set an architecture type with -arch=<value>"
    exit 1
fi
#
# If some extensions are set, mark the defs
if test -n "$MPE_MPI_EXT_C" ; then
   AC_DEFINE(MPE_USE_EXTENSIONS)
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
############################################################################
PAC_GET_SPECIAL_SYSTEM_INFO

# 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
#
# Create the "autoconf" style directory names...
#
# When we build with the virtual path feature, we want these directories
# to be relative to the build directory, not the source directory.
# One possibility is to redefine the Makefiles to use a local directory, 
# with the "installation" directory given by the usual autoconf symbols (e.g.,
# libdir, includedir
#
# Default includedir should use prefix.  For installation in place, we should
# just use prefix=localdir
# Alternate is to use build/<arch>/<device>/include
# Include dir for USER PROGRAMS
if test -z "$prefix" ; then prefix=$MPIR_HOME ; fi
if test -z "$includedir" ; then includedir="${prefix}/include" ; fi
AC_SUBST(includedir)
#
# We can't use a relative srcdir path because autoconf1 has a bug that
# resets top_srcdir to srcdir!
# srcdir is the directory that contains SOURCE files.
if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$MPIR_HOME" ; fi
AC_SUBST(srcdir)
if test -z "$exec_prefix" ; then 
    exec_prefix='${prefix}'
fi
# exec_prefix is the prefix for directories containing machine-specific
# files such as libraries and executables.  For the USER
AC_SUBST(exec_prefix)
# bindir is for executable programs for the USER
if test -z "$bindir" ; then bindir='${exec_prefix}/bin' ; fi
AC_SUBST(bindir)
# sbindir is for executable programs for the ADMINISTRATOR
if test -z "$sbindir" ; then sbindir='${exec_prefix}/sbin' ; fi
AC_SUBST(sbindir)
# libdir is for libraries for the USER
if test -z "$libdir" ; then libdir='${exec_prefix}/lib' ; fi
AC_SUBST(libdir)
if test -z "$sharedstatedir" ; then sharedstatedir='${prefix}/com' ; fi
AC_SUBST(sharedstatedir)
if test -z "$localstatedir" ; then localstatedir='${prefix}/var' ; fi
AC_SUBST(localstatedir)
# 
# There are two sharedlib dirs for the future, when we will distinguish
# between the common, visable everywhere (e.g., NFS mounted) location, and
# the local, visable only on the referenceing machine (e.g., UFS mounted, 
# such as /tmp) locations.  SHAREDLIB_LOCALDIR is the local location.
if test -z "$sharedlib_dir" ; then 
    sharedlib_dir='${libdir}/shared'
else 
    SHAREDLIB_LOCALDIR=$sharedlib_dir
fi
AC_SUBST(sharedlib_dir)
AC_SUBST(SHAREDLIB_LOCALDIR)
SHARED_LIB_LOCALDIR="$SHAREDLIB_LOCAL_DIR"
AC_SUBST(SHARED_LIB_LOCALDIR)
# prefix is used to construct the rest of the variables.
if test -z "$prefix" ; then prefix=$PREFIX ; fi
AC_SUBST(prefix)
# mandir is the root for the man pages
if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
AC_SUBST(mandir)
if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
AC_SUBST(docdir)

if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
AC_SUBST(htmldir) 

# top_srcdir is the top level source code directory (mpich home)
if test -z "$top_srcdir" -o "$top_srcdir" = "." ; then 
    top_srcdir=$MPIR_HOME
fi
AC_SUBST(top_srcdir)
if test -z "$datadir" ; then
    datadir='${prefix}/share'
fi
AC_SUBST(datadir)
#
# libbuild_dir is used to build the libraries in before they are installed.
# binbuild_dir is for the scripts/programs
# includebuild_dir is for all user header files
rootbuild_dir=`pwd`
# 
# pwd may provide an effectively invalid directory because of the design
# of automounters
if test -n "$AUTOMOUNTFIX" ; then
    rtest=`echo $rootbuild_dir | $AUTOMOUNTFIX`
    if test -d $rtest ; then
        rootbuild_dir=$rtest
    fi
fi
builddir="$rootbuild_dir"
AC_SUBST(builddir)
# initialize libbuild_dir, binbuild_dir, includebuild_dir
for dir in lib bin include ; do
    dirname=${dir}build_dir
    eval dirvalue=\$"$dirname"
    if test -z "$dirvalue" ; then 
        eval $dirname=$rootbuild_dir/$dir
    fi
    eval dirvalue=\$"$dirname"
    if test ! -d $dirvalue ; then
        if mkdir $dirvalue ; then
	    :
        else
            print_error "Could not create directory $dirvalue"
            exit 1
        fi
    fi
done
# sharedlibbuild_dir is special;  It is set only if shared libs are
# built (see below)

AC_SUBST(libbuild_dir)
AC_SUBST(sharedlibbuild_dir)
AC_SUBST(binbuild_dir)
AC_SUBST(includebuild_dir)

# arch-specific readonly data goes? (message catalogs).  Into sysconfdir
if test -z "$sysconfdir" ; then sysconfdir='${exec_prefix}/etc' ; fi
AC_SUBST(sysconfdir)

if test -z "$NOCXX" ; then
    CPP_DIR="${CPP_DIR:-MPI-2-C++}"
    # Allow standard environment variable for the C++ compiler
    if test -n "$CXX" ; then CPP_COMPILER="$CXX" ; fi
    if test -n "$CPP_COMPILER" ; then
        AC_MSG_CHECKING([if $CPP_COMPILER returns correct error code])
        cat > conftest.cc <<EOF
int main(){int a=b;}
EOF
        $CPP_COMPILER -c conftest.cc>conftest.out 2>&1
	if test $? = 0 ; then
	    AC_MSG_RESULT([no!...Cannot use $CPP_COMPILER compiler])
	    CPP_COMPILER=""
        else
            AC_MSG_RESULT(yes)
        fi
	/bin/rm conftest*
    elif 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!
        # We need to check that the compiler actually works!
	# (note that g++ doesn't work on some Solaris 2.7 (64bit) platforms)
        # Allow user to use CXX or CCC as an alternative for the compiler
	for program in "$GXX" "$CXX" "$CCC" xlC g++ c++ aCC CC cxx ; do
	    # Skip empty values
	    if test -z "$program" ; then continue ; fi
	    # Does program exist?
            AC_PROGRAM_CHECK(GXXTRIAL,$program,$program,)
  	    if test "$GXXTRIAL" = "xlC" -a "$DEVICE" = "ch_mpl" ; then
	        GXXTRIAL=mpCC
            fi
            # Test that this really works: compile iostream.h
            # Don't assume that g++ works (it can be installed improperly; 
            # it also doesn't work with 64-bit Solaris 2.7)
            # (the autoconf tests are too GNU-centric)
	    if test -n "$GXXTRIAL" ; then 
                cat > conftest.cc <<EOF
#include <iostream.h>
EOF
	        rm -f conftest.out
  	        if $GXXTRIAL -c conftest.cc >conftest.out 2>&1 ; then
		    AC_MSG_CHECKING([if $GXXTRIAL returns correct error code])
                    cat > conftest1.cc <<EOF
int main(){int a=b;}
EOF
                    $GXXTRIAL -c conftest1.cc>conftest1.out 2>&1
	            if test $? = 0; then
	                AC_MSG_RESULT([no!])
	            else
                        AC_MSG_RESULT(yes)
	                echo Compiling C++ interface with $GXXTRIAL	
                        CPP_COMPILER="$GXXTRIAL"
		        GXX="$GXXTRIAL"
                    fi
	        else
		    print_error "C++ compiler $GXXTRIAL failed to compile a simple program"
		    print_error "C++ interface will not be built with this compiler"
	            if test -s conftest.out ; then 
		        cat conftest.out >>config.log
		    fi
                    if test -s conftest.out ; then
                        cat conftest.out >>config.log
	            fi
	            GXX=""
	        fi
	        /bin/rm -f conftest*
		GXXTRIAL=""
	    fi
	    # If we found a working C++ compiler, then stop looking.
	    if test -n "$GXX" ; then break ; fi
	done
    fi
    # If we have a compiler, check that it works.  
    # pgCC failed to compile iostream.h on some Linux platforms
    # (we need this test here because the test for compiling iostream.h
    # used above is used only to *find* a compiler; if the user selected
    # a compiler that doesn't work, we still need the test.
    if test -n "$CPP_COMPILER" ; then 
        AC_MSG_CHECKING([that selected C++ compiler can compile iostream.h])
        rm -f conftest*
        cat > conftest.cc <<EOF
#include <iostream.h>	
EOF
        if $CPP_COMPILER -c conftest.cc>conftest.out 2>&1 ; then 
            AC_MSG_RESULT(yes)
	else
	    AC_MSG_RESULT([no!...Cannot use $CPP_COMPILER compiler])
	    CPP_COMPILER=""
	    NOCXX=1
        fi
	/bin/rm conftest*
    fi
    # Note that C++ doesn't support VPATH build yet.
    # It does (sort of!)
    if test -d ${top_srcdir}/${CPP_DIR} -a -n "$CPP_COMPILER" ; then
	echo ' '
	if test -d ${top_srcdir}/${CPP_DIR}/balky ; then
  	    echo 'Include C++ bindings for MPI from http://www.osl.iu.edu/research/mpi2c++'
	    echo 'Send bug reports about the C++ to mpi2cpp-devel@osl.iu.edu'
	fi
	echo ' '
	if test ! -d ${CPP_DIR} ; then mkdir ${CPP_DIR} ; fi
	buildcpp=1
    else
	# No compiler found; set the C++ directory to null
	CPP_DIR=""
    fi
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!

    # The following are suitable ONLY while building C++
    # autoconf2 uses CPPFLAGS for C PreProcessor
#    CXXFLAGS="-I$MPIR_HOME/$CPP_DIR/src -I`pwd`/$CPP_DIR"
#    CXXLDFLAGS="-L`pwd`/$CPP_DIR/src"
    # This is for the Notre Dame version.  The altcxx version just uses
    # the mpi include dir
    if test "$CPP_DIR" = "MPI-2-C++" ; then
        CXXFLAGS='-I${includedir}/mpi2c++'
    fi
    if test "$CPP_COMPILER" = "g++" ; then 
	# Particularly for LDFLAGS, -fhandle-exceptions must ONLY be used
	# for GNU g++
	AC_MSG_CHECKING([for g++ compiler exception flags])
	cat > conftest.cc <<EOF
int main () {}
EOF
	$CPP_COMPILER -c conftest.cc -fhandle-exceptions 2>conftest.out
	if test ! -s conftest.out ; then
	    CXXFLAGS="$CXXFLAGS -fhandle-exceptions"
	    AC_MSG_RESULT(-fhandle-exceptions)
	else
	    /bin/rm -f conftest.o conftest.out
	    $CPP_COMPILER -c conftest.cc -fexceptions 2>conftest.out
	    if test ! -s conftest.out ; then
	        CXXFLAGS="$CXXFLAGS -fexceptions"
		AC_MSG_RESULT(-fexceptions)
	    else
		AC_MSG_RESULT(not determined)	
	    fi
	    /bin/rm -f 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
if test -n "$CCC" ; then 
    CPP_COMPILER=${CCC}
fi
#
# For autoconf 2, we may need evaluated values for these routines (since
# the values for these can be Makefile expressions, rather than sh expressions)

# Check all of the devices first; they need to be known 
# before doing the transport layer
# 
# Get the C compiler, Fortran compiler, and archiver
CARCH=$ARCH
case $DEVICE in
    ch_cenju3)       CARCH=cenju3 ;;
    ch_mpl|ch_eui)   CARCH=ibmpoe ;;
    ch_meiko|meiko)  CARCH=meiko ;;
    ch_nx|nx)        CARCH=intelnx ;;
esac

# First, check for the basic CC
# Note that get_ansi_cc does a programs_check
if test -z "$USERCC" ; then
    # We do NOT want to use PROG_CC because it prefers gcc over the 
    # vendor's compiler.  This is ok for the GNU tools, but is not
    # what we want for MPICH.
    # PROG_CC simply looks for gcc and then cc.  We just flip this around.
    dnl _PROG_CC
    PAC_PROGRAMS_CHECK(CC,cc gcc)
    dnl This also eliminates the gcc short-circuit in the tests.  A good
    dnl thing too, since gcc might change!
fi
dnl GET_ANSI_CC looks for a compiler that accepts prototypes.  It tries 
dnl gcc if the selected CC doesn't accept prototypes
PAC_GET_ANSI_CC($CARCH)

if test "$needs_gcc" = "yes" ; then
    # Check that compiler is gcc
    dnl In autoconf 2, you can use AC_PROG_CC_GNU
    AC_MSG_CHECKING([whether we are using GNU C])
dnl The semicolon is to pacify NeXT's syntax-checking cpp.
    cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
    if ${CC-cc} -E conftest.c | egrep yes >/dev/null 2>&1 ; then
        ac_cv_prog_gcc=yes
    else
        ac_cv_prog_gcc=no
    fi
    AC_MSG_RESULT($ac_cv_prog_gcc)
    if test $ac_cv_prog_gcc = "no" ; then
	print_error "gcc required for these configure options"
	exit 1
    fi
    rm -f conftest*
fi

if test $NOF77 = 0 ; then
    PAC_GET_F77($CARCH)
else
    HAS_F77=0
fi
if test -z "$TESTF77" ; then
    TESTF77="$F77"
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 -disable-f77"
fi
#
PAC_GET_AR($CARCH)
AC_SUBST(ARNAME)
#
# Check to see if the compilers work at all (you'd be surprised!)
AC_COMPILE_CHECK([whether compiler works],,,compile_check=yes,compile_check=no)
if test "$compile_check" = "no" ; then
    print_error "Compiler $CC failed to compile a simple program!"
    exit 1 
fi
#
# Check to see if the compiler accepts prototypes
PAC_CHECK_CC_PROTOTYPES(AC_DEFINE(HAVE_PROTOTYPES))
#
# Check to see if compiler has old_style CPP concat
PAC_CHECK_CPP_CONCAT(,AC_DEFINE(OLD_STYLE_CPP_CONCAT))
#
# Check to see if it accepts const
HAVE_NO_C_CONST=0
AC_SUBST(HAVE_NO_C_CONST)
PAC_CHECK_CC_CONST(,AC_DEFINE(HAVE_NO_C_CONST)
HAVE_NO_C_CONST=1
ROMIO_CFLAGS="$ROMIO_CFLAGS -DHAVE_NO_C_CONST")

# 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
# We must NOT check for Unix variants until after we have determined the
# compiler that we will use.  This is due to a bug in autoconf: it tries to 
# use the C preprocessor directly, without invoking the compiler.
# Unfortunately, the preprocessor that it uses may bear no relationship to the
# compiler.
AC_PROG_CPP

# Check for Unix Variants
AC_AIX
AC_MINIX
#
# Before we go any farther, check for cross-compiling
# We can't do this yet, but we need to 
#
# Check to see if it accepts volatile (needed in src/nerrmsgs.c as well as
# some devices)
PAC_HAVE_VOLATILE

# 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
#
# This needs a script that makes the tests and returns the answer; 
# we can later let autoconf figure out how to include the needed info
# One option is to use libtool if it is available.
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!)
    # +Z for HPUX
    #
    # 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.  These are provided by the makesharedlib script
    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
            PAC_CHECK_COMPILER_OPTION(-fPIC,CC_SHARED_OPT=-fPIC;SHAREDKIND="gcc")
            # Check that we can link with that option
  	    # Note that this does NOT work with SunOS
        fi
        if test -z "$CC_SHARED_OPT" ; then
            PAC_CHECK_COMPILER_OPTION(-KPIC,CC_SHARED_OPT=-KPIC)
            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$libdir/shared"
	    elif test $ARCH = "IRIX" -o $ARCH = "IRIX64" -o $ARCH = "IRIXN32" ; then
		# for testing only
		SHAREDKIND=irix
            elif test $ARCH = "ALPHA" -o $ARCH = "OSF" ; then
	        SHAREDKIND=osf
            fi
	    if test -z "$CC_SHARED_OPT" -a "$ARCH" = "hpux" ; then
                PAC_CHECK_COMPILER_OPTION(-KPIC,CC_SHARED_OPT=+Z)
	    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
    if test "$SHAREDKIND" != "ignore" ; then
        # Fortran choices
	# (none)
        # -PIC (SunOS)
        # -KPIC (Solaris, IRIX)
	# -fPIC (gcc/g77)
	# This is made more compilicated by the fact that some systems
	# accept -PIC, but for very different options (e.g., absoft).
	#
        # CHECK_COMPILER_OPTION adds option if successful
        FFLAGSSAV="$FFLAGS"
        if test -z "$FC_SHARED_OPT" ; then
            PAC_CHECK_FC_COMPILER_OPTION(-PIC,FC_SHARED_OPT=-PIC)
        fi
        if test -z "$FC_SHARED_OPT" ; then
            PAC_CHECK_FC_COMPILER_OPTION(-fPIC,FC_SHARED_OPT=-fPIC)
        fi
        if test -z "$FC_SHARED_OPT" ; then
            PAC_CHECK_FC_COMPILER_OPTION(-KPIC,FC_SHARED_OPT=-KPIC)
        fi
	# Handle the special case of a predefined value of <none needed>
	if test "$FC_SHARED_OPT" = "none" ; then
	    FC_SHARED_OPT=""
	fi
        FFLAGS="$FFLAGSSAV"
    fi
    # Check that the shared libraries work
    export CC
    export CLINKER
    SHARED_LIB_PATH="-L."
    export SHARED_LIB_PATH
    SHARED_LIB_UTIL="${top_srcdir}/util/makesharedlib -noecho -kind=$SHAREDKIND -local -link -noverbose"
    # We need to put the execution of makesharedlib within "" because the
    # value may have a trailing blank.
    AC_MSG_CHECKING([for argument used to indicate shared lib search dir])
    SHARED_LIB_SEARCH_PATH_LEADER="`${top_srcdir}/util/makesharedlib -kind=$SHAREDKIND -getpathspec`"
    AC_SUBST(SHARED_LIB_SEARCH_PATH_LEADER)
    AC_MSG_RESULT([$SHARED_LIB_SEARCH_PATH_LEADER])
    SHARED_LIB_SEARCH_PATH="${SHARED_LIB_SEARCH_PATH_LEADER}`pwd`"
    PAC_SHARED_LIBS_OK(,SHAREDKIND=ignore)
    # 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).
    SHAREDKIND_FOR_TV="$SHAREDKIND"
    if test "$SHAREDKIND" = "ignore" ; then 
	UseSharedLibs=0
	SHARED_LIB_SEARCH_PATH_LEADER=""
	SHARED_LIB_PATH=""
    fi
    if test "$UseSharedLibs" = 1 ; then 
	# If CFLAGS will have the SHARED_OPT, the TV build won't need its
        # own copy.  If we aren't building the shared libs, then 
        # we set the OPT_FOR_TV in the other branch of the if.
        CFLAGS="$CC_SHARED_OPT $CFLAGS"
        FFLAGS="$FC_SHARED_OPT $FFLAGS"
    else
        CC_SHARED_OPT_FOR_TV="$CC_SHARED_OPT"
	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
if test $UseSharedLibs = 1 ; then
    if test -z "$sharedlibbuild_dir" ; then 
        sharedlibbuild_dir="$libbuild_dir/shared"
    fi
    if test ! -d $sharedlibbuild_dir ; then
        if mkdir $sharedlibbuild_dir ; then
            :
        else
            print_error "Could not create directory $sharedlibbuild_dir"
            exit 1
	fi
    fi
    # This allows us to pass this argument to the c++ configure.
    CXXENABLE="--enable-shared"
    AC_SUBST(CXXENABLE)
fi

AC_SUBST(CC_SHARED_OPT)
AC_SUBST(CC_SHARED_OPT_FOR_TV)
AC_SUBST(CXXFLAGS_FOR_SHARED)
AC_SUBST(SHAREDKIND)
AC_SUBST(SHAREDKIND_FOR_TV)
#
# Base size of MPI_Status is four integers.  The selected device may need to
# increase the size in order to store extra information
#
MPI_STATUS_SIZE=4
export MPI_STATUS_SIZE
AC_SUBST(MPI_STATUS_SIZE)dnl
#
#
# Various systems have known special needs (particularly libraries);
# get thos here
#    
DEFAULT_MACHINE=$DEVICE
#
#
# we could have some "blessed" devices using an dnl include
# statement, which would simplify some of the setup.  However, it increases
# the inter-relationships between the main configure and the individual 
# devices.
#
eval top_srcdir_val="$top_srcdir"
device_setupfile="setup_$DEVICE"
if test -f "$srcdir/mpid/$DEVICE/$device_setupfile" ; then
    # Source the file.  This way it inherits all variables and can
    # change any that it wants.  The alternative is to have an explicit
    # import/export list.
    # If this device has any special needs, such as #defines, it should
    # use a configure with a header file specific for that device, rather
    # than including them in the master mpichconf.h file.
    # Should set DEFAULT_MACHINE type
    # Should set MPIBOOT and MPIUNBOOT if provided
    # Create any device-specific configuration header files
    # This is run in the TOP directory; if the setup script needs to run in 
    # the device directory, it should change to that directory
    #
    # The setup program should also be careful to remove any 
    # configuration-specific files (such as config.h files) from both the 
    # local directory and the source directory in case a VPATH build is 
    # being done.
    # if we're the developers, we may need to create the
    # initial configure files.
    if test ! -x "$top_srcdir_val/mpid/$DEVICE/configure" -a \
	      -s "$top_srcdir_val/mpid/$DEVICE/configure.in" -a \
	      -x "$top_srcdir_val/mpid/$DEVICE/makeconfigure" ; then
	(cd "$top_srcdir_val/mpid/$DEVICE" ; ./makeconfigure)
    fi
    echo "Running device-specific setup program"
    #
    # Any device-specific args (--with-device=DEVICE:deviceargs) are
    # in the variable device_args.
    #
    # Note that configure uses "set dummy $p" this resets the positional 
    # parameters.  We clear this with
    set dummy
    shift
    if test ! -d mpid/$DEVICE ; then
	if test ! -d mpid ; then mkdir mpid ; fi
        mkdir mpid/$DEVICE
    fi
    # We must run this from the relative directory, since we may be building
    # a build tree in another location (. != $srcdir)
    . "$srcdir/mpid/$DEVICE/$device_setupfile"
    if test $? != 0 ; then
	print_error "Setup of $DEVICE failed!  Aborting configure"
	exit 1
    fi
    # If we created an mpich-mpid.h file, add that definition
    if test -s mpid/$DEVICE/mpich-mpid.h ; then
        AC_DEFINE(HAVE_MPICH_MPID_H,,[define if the device creates an mpich-mpid.h include file])
    fi
fi

#
# ch_shmem/ch_lfshmem have a setup_ch_shmem file 
#
# ch_gm have a setup file
#
# meiko and ch_meiko have a setup file
#
# ch_mpl has a setup file
#
# Globus has a setup file (previously BEFORE the CC/FC find steps)

dnl if test -n "$device_ch_spp" ; then
dnl    DEFAULT_MACHINE="convex_spp"
dnl   if test -z "$OPTFLAGS" ; then
dnl	# If optimization is turned on, the wrong code is generated for
dnl	# some operations with unsigned chars.
dnl	OPTFLAGS=-O0
dnl   fi
dnl   AC_RETSIGTYPE
dnl   PAC_HAVE_VOLATILE
dnl   PAC_SIGNALS_WORK
dnl   #  
dnl   LIB_LIST="$LIB_LIST -lcnx_syscall /lib/libail.sl"
dnl fi
#
# The following is shared with some devices.  How should we do this?
# It should be a common macro PAC _WORKING_ANON_MMAP
# Later devices use /dev/zero trick
if test \( -n "$device_ch_p4" -a "$COMM" = "shared" \) ; then 
    MMAP=0
    PAC_HAVE_ANON_MMAP(MMAP=1,AC_DEFINE(HAVE_NO_ANON_MMAP))

    # We need to check that semctl is ok.
    PAC_SEMGET_WORKS(SEMGET=1,SEMGET=0,print_error)

    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
dnl

if test -n "$device_ch_p4"; then
  P4EXT=""
fi
if test -n "$device_ch_p4mpd"; then
  P4EXT="mpd"
  if test "$COMM" = "ch_p4mpd"; then
    COMM="ch_p4"
    echo "Setting COMM to ch_p4 for ch_p4mpd device"
  fi
fi

#
# Architecture-specific tests.  These should go into aclocal files (e.g., 
# acarch_$archname, which aclocal.m4 loads with include
# PAC _OS_VERSION (already in special system macro)
# PAC _ARCH_CC_FLAGS
# PAC _ARCH_FC_FLAGS
# PAC _ARCH_SPECIFIC
# 
# Note that some of these tests need to be made more generic
# (e.g., FORTRAN_SPECIAL_POINTER)
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 stress 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=""
        # We should not use/need these tests (I just had to add cputype =
        # 12000) 
	if test $cputype -ge 8000 ; 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
	    PAC_CHECK_FC_COMPILER_OPTION($P4_MDEPFFLAGS,addflags=1)
	    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 1185,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)
#       !!!! overriding the SYMTYPE eliminates the ability to select compiler
#       option for the symbol type.  Instead, we MANDATE that IRIX64 implies
#       -64 and IRIXN32 implies -n32.
        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"
   dnl AC_HAVE_ LIBRARY ( sun )
fi

# for symm_ptx, add the ptx_ifile to  LIB_LIST
if test -n "$arch_symm_ptx"; then
  LIB_LIST="$LIB_LIST $MPIR_HOME/util/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"
   # According to Laurie Costello <lmc@cray.com>, the Triton needs this
   # definition
dnl
   # If tested code does NOT compile, then define _TWO_WORD_FCD
   AC_COMPILE_CHECK([whether TWO_WORD_FCDs are used],
[#include <fortran.h>],[void  *buf;_fcd temp;temp = _fcdtocp(buf);],
compile_check=yes,compile_check=no)
if test "$compile_check" = "no" ; then
    TEMP_CFLAGS=$CFLAGS
    CFLAGS="-D_TWO_WORD_FCD $CFLAGS"
    AC_COMPILE_CHECK([whether program compiles if _TWO_WORD_FCD is defined ],
[#include <fortran.h>],[void  *buf;_fcd temp;temp = _fcdtocp(buf);],
compile_check=yes,compile_check=no)
    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
        AC_DEFINE(_TWO_WORD_FCD)
    fi
    CFLAGS=$TEMP_CFLAGS
fi
   # 
dnl   if test -n "$arch_CRAYTS" ; then 
dnl       AC_DEFINE(_TWO_WORD_FCD)
dnl   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
   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"
   AC_DEFINE(MPI_NO_MPEDBG)
   # 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)
   AC_DEFINE(_TWO_WORD_FCD)
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

#
# We need to check for this - it is probably the Fujitsu problem with
# attributes.
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
    dnl AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
    # Suggested values for these are
    #CFLAGS=-O
    dnl    #FFLAGS=-Oe,-U -Aabe ( Parameter e is not supported on  uxp/m )
    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
    dnl AC_DEFINE(FORTRAN_SPECIAL_FUNCTION_PTR)
    # Suggested values for these are
    #CFLAGS=-O
    # Thanks to Winfrid Tschiedel <Winfrid.Tschiedel@mch.sni.de> for
    # this information
    dnl FLINKER="ld -dy -J /usr/ccs/lib/crt0.o /usr/lang/lib/fj90rt0.o /usr/ccs/lib/values-Xt.o"
    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.
dnl    FLIBS="$FLIB_PATH $LIB_LIST  -lfj90 -lfj90fv -lfj90f -lfjsamp -lm -lelf        -lsocket -lnsl -lgen -lpx -ljsp -lvfl -lc"
    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

dnl if test -n "$arch_SX4" ; then 
dnl     CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
dnl 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.
    dnl CFLAGS="$CFLAGS -pvctl,nomsg -DCHAR_PTR_IS_ADDRESS"
    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"
dnl    # We've learned that if Fortran is selected, you should use Fortran to
dnl    # link with.
dnl    if test "$USERCLINKER" != 1 -a "$NOF77" != 1 -a -n "$FLINKER" ; then 
dnl	CLINKER="$FLINKER"
dnl    fi
fi

#
# Finally, we are ready to check to see if we are cross-compiling.
#
if test "$cross_compiling" = 0 -o -z "$cross_compiling" ; then
    AC_CROSS_CHECK()
fi
#
if test "$cross_compiling" = 1 ; then
    if test $DEVICE = ch_shmem -o $DEVICE = ch_p4 -o $DEVICE = ch_p4mpd \
                               -o $DEVICE = ch_lfshmem ; then
        print_error "Configure was unable to compile and run a simple program."
    fi
fi
#
# clock_gettime is the POSIX gettimeofday
# gethrtime is the Solaris high-resolution timer
AC_HAVE_FUNCS(gethrtime)
# POSIX *requires* that the include for clock_gettime is <time.h>.
# Unfortunately, FreeBSD incorrectly uses sys/time.h.  Since time.h is
# provided, we need to check that CLOCK_REALTIME is defined
AC_FUNC_CHECK(clock_gettime,have_clock_gettime=yes,have_clock_gettime=no)
AC_FUNC_CHECK(clock_getres,have_clock_getres=yes,have_clock_getres=no)
if test "$have_clock_gettime" = "yes" -a "$have_clock_getres" = "yes" ; then
    AC_COMPILE_CHECK([whether CLOCK_REALTIME is defined in time.h],
[#include <time.h>],[clockid_t cid = CLOCK_REALTIME;],
    posix_time=yes,posix_time=no)
    if test "$posix_time" = "yes" ; then
        AC_DEFINE(HAVE_CLOCK_GETTIME,,[have posix gettime])
        AC_DEFINE(HAVE_CLOCK_GETRES,,[have posix getres])
    else
        AC_MSG_WARN([Posix timers not correctly implemented])
    fi
fi

#
# Some devices use gettimeofday.  If this is one of them, check to see 
# what form it is
PAC_IS_GETTIMEOFDAY_OK(,DEVCFLAGS="$DEVCFLAGS -DUSE_WIERDGETTIMEOFDAY")

# Look for sigaction routine (instead of signal)
# This is used in one of the TEST programs (sigchk.c)
# FIXME!!! (move to test configure?)
PAC_CHECK_HEADERS(signal.h)
AC_HAVE_FUNCS(sigaction)
AC_COMPILE_CHECK(for struct sigaction,[#include <signal.h>],[
struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_ok="yes",sigaction_ok="no")
#
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
HAS_WEAK_SYMBOLS=0
AC_SUBST(HAS_WEAK_SYMBOLS)
if test $TRY_WEAK_SYMBOLS = 1 ; then
  AC_MSG_CHECKING(for weak symbol support)
  AC_TRY_LINK([
extern int PFoo(int a);
#pragma weak PFoo = Foo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_weak=1)
#
# Some systems (Linux ia64 and ecc, for example), support weak symbols
# only within a single object file!  This tests that case.
if test "$has_pragma_weak" = 1 ; then
    AC_MSG_RESULT([pragma weak])
    AC_MSG_CHECKING([that weak symbols are visible to other files])
    rm -f conftest*
    cat >>conftest1.c <<EOF
extern int PFoo(int a);
#pragma weak PFoo = Foo
int Foo(int);
int Foo(a) { return a; }
EOF
    cat >>conftest2.c <<EOF
int main() {
return PFoo(0);}
EOF
    ac_link2='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
    if eval $ac_link2 ; then
        AC_MSG_RESULT(yes)
    else
      echo "$ac_link2" >>config.log
      echo "Failed program was" >>config.log
      cat conftest1.c >>config.log
      cat conftest2.c >>config.log
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi
      AC_MSG_RESULT(no)
      has_pragma_weak=0
    fi
    rm -f conftest*
fi
#
  if test "$has_pragma_weak" = 1 ; then
    dnl    AC_MSG_RESULT([pragma weak]) (setup above)
    HAS_WEAK_SYMBOLS=1
    AC_DEFINE(HAVE_PRAGMA_WEAK)
  else
    AC_TRY_LINK([
#pragma _HP_SECONDARY_DEF Foo  PFoo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_hp_secondary=1)
    if test "$has_pragma_hp_secondary" = 1 ; then 
        AC_MSG_RESULT([pragma _HP_SECONDARY_DEF])
        HAS_WEAK_SYMBOLS=1
        AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF)
    else
        AC_TRY_LINK([
#pragma _CRI duplicate PFoo as Foo
int Foo(a) { return a; }
],[return PFoo(1);],has_pragma_cri_duplicate=1)
        if test "$has_pragma_cri_duplicate" = 1 ; then
	    AC_MSG_RESULT([pragma _CRI duplicate x as y])
	    HAS_WEAK_SYMBOLS=1
	    AC_DEFINE(HAVE_PRAGMA_CRI_DUP)
        else    
            AC_MSG_RESULT(no)
        fi
    fi
  fi
fi
if test "$HAS_WEAK_SYMBOLS" = "1" ; then
    AC_DEFINE(HAVE_WEAK_SYMBOLS)
    MPI_WITH_PMPI="yes"
else
    MPI_WITH_PMPI="no"
fi
AC_SUBST(MPI_WITH_PMPI)
#
#
# Check for remote shell program (not needed for all devices)
# PARTIAL FIX: use only for DEVICE_KIND == network.  
# FIXME: Who needs this?
if test $DEVICE_KIND = network -a -z "$rshcommand" ; then
    PAC_PROGRAMS_CHECK(RSHCOMMAND,remsh rsh ssh)
    # should check that it works
    rshcommand="$RSHCOMMAND"
fi
#
# Check for perl and perl version
PAC_PROGRAMS_CHECK(PERL,perl5 perl,,,PERLFULLPATH)
if test -n "$PERL" ; then
    PERL="$PERLFULLPATH"
    changequote(<<,>>)
dnl    perlversion=`$PERL -v | grep 'This is perl' | \
dnl	sed -e 's/^.*version *\([0-9]\).*$/\1/'`
dnl This might not work in previous versions of perl.
dnl In particular, perl v 4 returns a long string for $] rather than
dnl a useful version number.
    perlversion=`$PERL -e 'print <<substr>>($],0,1)."\n";' </dev/null`
    changequote([,])
    # Should do a test first for ch_p4 etc.
    if test "$perlversion" != 5 ; then
        if test "$perlversion" = "\$" ; then
            # Get the entire string
            perlversion=`$PERL -e 'print $]."\n";' </dev/null`
	fi
        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
    AC_SUBST(PERL)
fi
#
# Check for Fortran
if test $HAS_F77 = 0 -a "$NOF77" = 0 ; then   
    NOF77=1
    HAS_FORTRAN=0
    AC_DEFINE(MPID_NO_FORTRAN)
    dnl CFLAGS="$CFLAGS -DMPID_NO_FORTRAN"
fi

# Check for byte ordering
PAC_WORDS_BIGENDIAN
#
# 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
    AC_COMPILE_CHECK("XDR includes and functions",[#include <rpc/rpc.h>],[
    int a=1;
    ],HAS_XDR=1,HAS_XDR=0)
    if test "$HAS_XDR" = 1 ; then
	AC_DEFINE(HAS_XDR)
    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=""
AC_FUNC_CHECK(uname,AC_DEFINE(HAVE_UNAME)haveuname=1)
PAC_CHECK_HEADERS(netdb.h)
AC_FUNC_CHECK(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME)havegethostbyname=1)
#
# Horrible problem.  Some builds use a C compiler that has such libraries
# but the C++ compiler does not.  In that case, the C++ compiler script will
# need to include additional libraries.  We need a general check for 
# this: for each function that is available in the default libraries,
# ensure that the other compilers can see it.
#
if test -z "$NOCXX" -a "$havegethostbyname" = 1 ; then
   cat > conftest.C <<EOF
#include "confdefs.h"	
extern "C" {
    char gethostbyname(void);
}
int main() {
    gethostbyname(); return 0; }
EOF
   # Try to compile and link with the C++ compiler
   AC_MSG_CHECKING([that C++ compiler also has gethostbyname])
   if ${CPP_COMPILER} -o conftest conftest.C >>config.log 2>&1 ; then
	AC_MSG_RESULT(yes)
   else
	AC_MSG_RESULT(no)
	AC_MSG_CHECKING([for gethostbyname in libnsl])
	if ${CPP_COMPILER} -o conftest conftest.C -lnsl >>config.log 2>&1 ; then
	    CPP_EXTRA_LIBS="$CPP_EXTRA_LIBS -lnsl"
	    AC_MSG_RESULT(yes)
	else
	    AC_MSG_RESULT(no)
	fi
   fi
   rm -f conftest*
fi
dnl
dnl Another problem is long long.  Some C compilers may handle these in 
dnl a different way than the C compiler
AC_SUBST(CPP_EXTRA_LIBS)
#
# Warning: Under Solaris 5.8, -lnsl *must* be followed by -lthread, or the
# resulting executable may hang (even if it doesn't do anything).  This is
# sometimes seen in the C++ configure when the first test program (sizeof int)
# is run.
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 (!)
    AC_HAVE_LIBRARY(nsl,LIB_LIST="$LIB_LIST -lnsl";havelibnsl=1)
    if test "$havelibnsl" = 1 ; then
	echo "checking for gethostbyname in libnsl"
        AC_FUNC_CHECK(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME)havegethostbyname=1)
    fi
fi
# If we have uname and gethostbyname, we can skip getdomainname ...
if test "$haveuname" != 1 -o "$havegethostbyname" != 1 ; then
    AC_HAVE_FUNCS(gethostname sysinfo)
    #
    # systeminfo is needed for sysinfo 
    PAC_CHECK_HEADERS(sys/systeminfo.h)
    #
    # getdomainname is special BECAUSE IT MAY BE USELESS (!Network computing 
    # indeed - stuff like this is why Windows95/NT WILL WIN). 
    AC_CHECK_FUNC(getdomainname,has_getdomainname=1,has_getdomainname=0)
    if test $has_getdomainname = 1 -a \
       \( "$cross_compiling" = 0 -o -z "$cross_compiling" \) ; then
        PAC_PROGRAM_CHECK(has_domainname,domainname,1,0,d_domainname)
        PAC_PROGRAM_CHECK(has_hostname,hostname,1,0,d_hostname)
        PAC_PROGRAM_CHECK(has_rup,rup,1,0,d_rup)
        # 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
changequote(,)
            fullhost=`$d_hostname | sed -e 's/^\([^\.]*\)\..*/\1/'`
changequote([,])
#	    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
                AC_DEFINE(HAVE_GETDOMAINNAME)
	    fi
        fi
    fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# Test that the functions used by the device are availble to the C++ and
# Fortran compilers.
testfuncs="gethostbyname"
if test -n "$device_functions" ; then 
    testfuncs="$testfuncs $device_functions"
fi    
if test -n "$testfuncs" ; then 
    save_LIBS="$LIBS"
    LIBS="$LIB_LIST"
    save_CXX_LIBS="$CXX_LIBS"
    CXX_LIBS="$CXX_LIBS $CPP_EXTRA_LIBS"
    save_F77_LIBS="$F77_LIBS"
    F77_LIBS="$F77_LIBS $FLIB_LIST"
    PAC_FUNC_INTER_LANG($testfuncs,fort_works,cxx_works)
    LIBS="$save_LIBS"
    CXX_LIBS="$save_CXX_LIBS"
    F77_LIBS="$save_F77_LIBS"
    if test "$NOF77" = 0 -a "$fort_works" = "no" ; then
        AC_MSG_WARN([Fortran programs cannot be linked with the C libraries
Fortran support being turned off])
        NOF77=1
        HAS_FORTRAN=0
        AC_DEFINE(MPID_NO_FORTRAN)
    fi
    if test -z "$NOCXX" -a "$cxx_works" = "no" ; then
        AC_MSG_WARN([C++ programs cannot be linked with the C libraries
C++ support being turned off])
        NOCXX=1
        buildcpp=0
    fi
fi
#
# 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.
AC_HAVE_FUNCS(catopen catclose catgets)
# 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
GENCAT="true"
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)."
elif test "$ignore_gencat" = "yes" ; then
  # Ignore message catalog 
  :
else
 PAC_PROGRAM_CHECK(has_gencat,gencat,1,0,d_gencat)
 GENCAT="gencat"
 if test $has_gencat = 1 ; then
    AC_DEFINE(HAVE_GENCAT)
    PAC_CHECK_HEADERS(nl_types.h)
    # Why separate NLS_DEFS?
    NLS_DEFS="$DEFS"
    # Having a separate message catalog directory allows unification 
    # of message catalogs.
    messagecat_dir=${messagecat_dir:-'${libdir}'}
    AC_SUBST(messagecat_dir)
 fi
fi
AC_SUBST(GENCAT)
DEFS="$SAVEDEFS"

AC_STDC_HEADERS

SAVEDEFS="$DEFS"
DEFS=""
PAC_CHECK_HEADERS(stdlib.h string.h)
PAC_CHECK_HEADERS(unistd.h)
newflag=""
PAC_STDARG([newflag="-DUSE_STDARG"],
[newflag="-DUSE_STDARG -DUSE_OLDSTYLE_STDARG"])
if test -n "$newflag" ; then
    USER_CFLAGS="$USER_CFLAGS $newflag"
fi
dnl PAC_CHECK_HEADER(stdarg.h,[AC_DEFINE(HAVE_STDARG_H)
dnl havestdarg=1])
#
# 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).
#
# The original test tried the two-arg version first; the old-style
# va_start took only a single arg.
# This turns out to be VERY tricky, because some compilers (e.g., Solaris) 
# are quite happy to accept the *wrong* number of arguments to a macro!
# Instead, we try to find a clean compile version, using our special
# TRY_COMPILE_CLEAN command
#
dnl USE_STDARG=0
AC_SUBST(USE_STDARG)
dnl #
dnl AC_MSG_CHECKING([that stdarg is oldstyle])
dnl PAC_TRY_COMPILE_CLEAN([#include <stdio.h>
dnl #include <stdarg.h>],
dnl [int func( int a, ... ){
dnl int b;
dnl va_list ap;
dnl va_start( ap );
dnl b = va_arg(ap, int);
dnl printf( "%d-%d\n", a, b );
dnl va_end(ap);
dnl fflush(stdout);
dnl return 0;
dnl }
dnl int main() { func( 1, 2 ); return 0;}],check_compile)
dnl case $check_compile in 
dnl     0)  AC_MSG_RESULT(yes)
dnl        AC_DEFINE(USE_STDARG)
dnl	AC_DEFINE(USE_OLDSTYLE_STDARG)
dnl        USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG -DUSE_OLDSTYLE_STDARG"
dnl	USE_STDARG=1
dnl	;;
dnl    1)  AC_MSG_RESULT([hmm, warnings from compiler.  Trying newstyle])
dnl	;;
dnl    2)  AC_MSG_RESULT(no)
dnl	;;
dnl esac
dnl
dnl if test -n "$havestdarg" -a "$USE_STDARG" != 1 ; then
dnl     AC_MSG_CHECKING([stdarg is correct])
dnl     PAC_TRY_COMPILE_CLEAN([
dnl #include <stdio.h>
dnl #include <stdarg.h>],[
dnl int func( int a, ... ){
dnl int b;
dnl va_list ap;
dnl va_start( ap, a );
dnl b = va_arg(ap, int);
dnl printf( "%d-%d\n", a, b );
dnl va_end(ap);
dnl fflush(stdout);
dnl return 0;
dnl }
dnl int main() { func( 1, 2 ); return 0;}],check_compile)
dnl case $check_compile in 
dnl     0)  AC_MSG_RESULT(yes)
dnl         AC_DEFINE(USE_STDARG)
dnl         USE_STDARG=1
dnl         USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG"
dnl 	;;
dnl     1)  AC_MSG_RESULT([yes with warnings])
dnl        AC_DEFINE(USE_STDARG)
dnl        USE_STDARG=1
dnl        USER_CFLAGS="$USER_CFLAGS -DUSE_STDARG"
dnl	;;
dnl    2)  AC_MSG_RESULT(no)
dnl	;;
dnl esac
dnl fi

# FIXME: In the above, this should go into the include files for the 
# device-specific case.

PAC_MALLOC_RETURNS_VOID()
USER_CFLAGS="$USER_CFLAGS $DEFS"
# FIXME: In the above, this should go into the include files for the 
# device-specific case.  IS THIS NEEDED?!!
DEFS="$SAVEDEFS $DEFS"
#
# System is used only in MPE; i860's do not support it.
# Should only be in mpe configure? (actually used in dbxerr.c?)
AC_HAVE_FUNCS(system)
#
# Nice is used only in env/init.c
AC_HAVE_FUNCS(nice)
#
# strdup is used in MPI_Info_xxx
AC_HAVE_FUNCS(strdup)
#
# Look for headers that might have memset()....
# (string.h might also, but it is also needed by MPE)
PAC_CHECK_HEADERS(memory.h)
#
# Check for header files needed to obtain list of networking interfaces
#
PAC_CHECK_HEADERS(sys/ioctl.h)
PAC_CHECK_HEADERS(sys/sockio.h)
#
# Turn off F77
# One problem with this is that some part of the ar will fail.  Lets hope
# it isn't fatal. 
if test $NOF77 = 1 ; then
  F77="echo no Fortran compiler"
  FLINKER="$F77"
  enable_args="$enable_args --disable-f77"
fi
# This simplifies some of the Makefiles in the examples and tests
if test "$NO_F90" = 1 ; then
  F90="echo no Fortran 90 compiler"
  F90LINKER="$F90"
  do_f90modules="no"
  enable_args="$enable_args --disable-f90 --disable-f90modules"
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
elif test -z "$TESTCC" ; then
    # 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.
#
PAC_CHECK_COMPILER_OK(cc_works=1,cc_works=0)
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
    PAC_CHECK_F77_COMPILER_OK(,NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       AC_DEFINE(MPID_NO_FORTRAN)
       dnl CFLAGS="-DMPID_NO_FORTRAN $CFLAGS"
       F77="echo no Fortran compiler"
       FLINKER="$F77")
    # Finally, add FLIBS to FLIB_LIST
    # (FLIBS may have been set when finding how to access command-line
    # arguments)
    FLIB_LIST="$FLIB_LIST $FLIBS"
fi

if test $do_test = 1 ; then
    PAC_CORRECT_COMPILER()
fi
#
if test "$RANLIB" != ":" ; then
    PAC_RANLIB_WORKS
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" : "\(.*\) "`
PAC_PROGRAM_CHECK(ARFOUND,$ARTEST,1,,ARLOC)
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)
#
# replace these with autoconf-2 style tests for
# SIZEOF_VOID_P
# SIZEOF_INT
# Then the test in the files should be
# #if SIZEOF_INT != SIZEOF_VOID_P 
# ...
# Alternately, do the test here and use a different value such as 
# USE_INTEGER_INDEX
PAC_POINTER_64_BITS()
PAC_INT_LT_POINTER()
if test -n "$F77IDX" ; then
    AC_DEFINE(POINTER_64_BITS)
fi
dnl
PAC_GET_TYPE_SIZE(void *,address_size)
if test "$address_size" != "unknown" ; then
    AC_MSG_CHECKING([for C integer type for MPI_Aint])
    AC_MSG_RESULT()
    for c_type in int long short "long long" ; do
        PAC_GET_TYPE_SIZE($c_type,type_len)
        if test "$type_len" = "$address_size" ; then
            MPI_AINT_FOUND=yes
	    MPI_AINT=$c_type
            break
        fi
    done
    AC_MSG(C integer type for MPI_Aint is)
    if test "$MPI_AINT_FOUND" = yes ; then 
        AC_MSG_RESULT($MPI_AINT)
    else
        AC_MSG_RESULT(could not find matching C type!)
    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 "$NO_LONG_LONG" = "no" ; then
    # This uses CROSS_HAS_LONG_LONG (0 or 1) if cross compiling
    PAC_LONG_LONG_INT()
fi
if test "$NO_LONG_DOUBLE" = "no" ; then
    # If not cross-compiling, we could dynamically check
    dnl The A C _LONG_DOUBLE macro is junk (it doesn't check that 
    dnl long double exists at all!
    PAC_LONG_DOUBLE()
    PAC_CHECK_SIZEOF(double,SIZEOF_DOUBLE)
    PAC_CHECK_SIZEOF(long double,SIZEOF_LONG_DOUBLE)
    if test $SIZEOF_DOUBLE -eq $SIZEOF_LONG_DOUBLE ; then
	# Suppress long double if == double?
     print_error "If you get warning messages about long doubles not supported"
     print_error "on $ARCH, use the -disable-long-double argument to configure."
    fi
fi

#
# Check for structure alignment using util/structlayout.c
if test "$cross_compiling" = 0 -o -z "$cross_compiling" ; then
   if test -n "$TESTCC" ; then
       CCsav="$CC"
       CC="$TESTCC"
   fi
   AC_MSG_CHECKING([for structure alignment])
   rm -f conftest*
   cat confdefs.h "$srcdir/util/structlayout.c" > conftest.c
   eval $compile
   if test ! -s conftest ; then
	AC_MSG_RESULT([Could not build executable program to test alignment])
   else
	if test -x conftest && (./conftest; exit) 1>conftestout ; then
	    if test -s conftestout ; then
  	        alignvalue=`cat conftestout`
            else
	        alignvalue="Unknown"
            fi
	    AC_MSG_RESULT($alignvalue)
	else
	    AC_MSG_RESULT(Execution of test program failed)
	fi
   fi
   rm -f conftest*
   if test -n "$TESTCC" ; then
       CC="$CCsav"
   fi
else
    # Pick value from CROSS or use default
    CROSS_STRUCT_ALIGNMENT=${CROSS_STRUCT_ALIGNMENT:-"largest"}
    alignvalue=$CROSS_STRUCT_ALIGNMENT
fi

# Make this the default.  Eventually, use the --enable stuff to allow
# a user to turn this off.
if test "$alignvalue" = "two" ; then
    AC_DEFINE(USE_BASIC_TWO_ALIGNMENT)
elif test "$alignvalue" = "four" ; then
    AC_DEFINE(USE_BASIC_FOUR_ALIGNMENT)
elif test "$alignvalue" = "eight" ; then
    AC_DEFINE(USE_BASIC_EIGHT_ALIGNMENT)
else
    AC_DEFINE(USE_BASIC_ALIGNMENT)
fi

#### was
# We must not make USER_CFLAGS all of CFLAGS...
#
dnl definitions should be passed to the configuration file
dnl CFLAGS="$CFLAGS $DEFS"
# We really should use MPICHCONF_H instead of CONFIG_H
CFLAGS="$CFLAGS -DHAVE_MPICHCONF_H"
#
AC_DEFINE(MPI_ADI2)
# 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.

# For now, add user_cflags to ccflags.  This is needed to ensure that 
# the few defines needed by mpi.h are included.
CCFLAGS="$CCFLAGS $USER_CFLAGS"

mpich_includes="-I$top_srcdir/include -I$includebuild_dir -I$rootbuild_dir/mpid/$DEVICE -I$top_srcdir/mpid/util"
if test "$top_srcdir" != "$rootbuild_dir" ; then
    mpich_includes="$mpich_includes -I$top_srcdir/mpid/$DEVICE"
fi

#
# Check for traceback
if test "$try_traceback" = "yes" ; then
   if test "$ac_cv_prog_gcc" = "yes" ; then
       # Try the program to see if it actually works
       AC_MSG_CHECKING([whether backtrace works])
       bktrace_works=no
       
       if $TESTCC -o conftest -DTEST_BACKTRACE "$top_srcdir_val/src/util/backtrace.c" ; then
           if ./conftest >conftest.out 2>&1 ; then
	       #cat conftest.out
	       bktrace_works=yes
	   fi
       fi
       rm -f conftest*
       if test "$bktrace_works" = "yes" ; then
           BACKTRACE="backtrace.o"
	   AC_DEFINE(HAVE_PRINT_BACKTRACE)
           AC_MSG_RESULT(yes)
       else
           AC_MSG_RESULT(no)
       fi
       AC_SUBST(BACKTRACE)
   fi
fi
#
AC_SUBST(mpich_includes)
if test "$MEMDEBUG" = "1" ; then 
    AC_DEFINE(MPIR_MEMDEBUG)
    AC_DEFINE(MPIR_OBJDEBUG) 
fi
if test "$TRDEBUG" = "1" ; then 
    AC_DEFINE(DEBUG_TRACE)
fi
if test "$PTRDEBUG" = 1 ; then 
    AC_DEFINE(MPIR_PTRDEBUG)
fi

# We really need separate library directories and path indicators.

LIB_PATH_LEADER="-L"
AC_SUBST(LIB_PATH_LEADER)
# This exact format is important: it lets us define LIB_PATH in terms
# of another variable (libdir) that we can set separately.
# Evenually, we should construct this from the LIB_PATH_LEADER and libdir
LIB_PATH='-L${libdir}'" $LIB_PATH"
#
if test -n "$F90" -a "$NO_F90" != 1 ; then
    if test -z "$USER_SET_F90LIB_PATH" -a -z "$F90LIB_PATH" ; then
	F90LIB_PATH="$FLIB_PATH_LEADER$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=""
PAC_PROGRAM_CHECK(SYNCFOUND,sync,1,,SYNCLOC)
if test -z "$SYNCLOC" ; then SYNCLOC=true ; fi
#
#
# if the device uses the machines file and there is no machines.$ARCH, 
# create one using hostname (or uname)
#
dnl # Where should util be if it is not local?  top_srcdir?  bindir?
dnl # This should be done by the device.  (as part of the device setup)
dnl if test $DEVICE_KIND = network ; then
dnl     if test ! -s util/machines/machines.$ARCH ; then
dnl         if test ! -d util ; then mkdir util ; fi
dnl         if test ! -d util/machines ; then mkdir util/machines ; fi
dnl         HOST=""
dnl         PAC_PROGRAM_CHECK(HOSTNAME_PGM,hostname,,,hostname)
dnl         if test -x "$hostname" ; then
dnl 	    HOST="`$hostname`"
dnl         fi
dnl         # Note that uname -n may not produce a usable hostname.  
dnl 	# Any suggestions?
dnl         if test "$HOST" = "" ; then
dnl 	    HOST="`uname -n`"
dnl         fi
dnl    	cat > util/machines/machines.$ARCH <<EOF
dnl # Change this file to contain the machines that you want to use
dnl # to run MPI jobs on.  The format is one host name per line, with either
dnl #    hostname
dnl # or 
dnl #    hostname:n
dnl # where n is the number of processors in an SMP.  The hostname should
dnl # be the same as the result from the command "hostname"
dnl $HOST
dnl $HOST
dnl $HOST
dnl $HOST
dnl $HOST
dnl EOF
dnl 	print_machines_message=1
dnl     fi
dnl fi
#
# 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
# 
# Before we accept MPILIBNAME, we need to make sure that it does not conflict
# with other libraries.  We had this problem at NCSA, where -L. -lmpich gives
# does not give libmpich.a in the current directory; instead, it uses 
# libmpich.a in another, system directory.  This is really a misconfigured
# ecc.cfg file, but here is the place to check for it.
AC_MSG_CHECKING([that $MPILIBNAME can be used as the library name])
canuse=yes
cat >conftest.c <<EOF
int foobar( int );
int foobar( int a ) { return a; }
EOF
if test -z "$ac_compile" ; then
    ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.c -c 1>&AC_FD_CC 2>&AC_FD_CC'
fi
if test -z "$ac_link" ; then
    ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
fi
if eval $ac_compile ; then
    # Create the library (AR includes the cr options)
    rm -f lib$MPILIBNAME.a
    ${AR} lib$MPILIBNAME.a conftest.o
    ${RANLIB} lib$MPILIBNAME.a
    rm -f conftest*
    # create the main program
    cat >conftest.c <<EOF
extern int foobar( int );
int main( int argc, char **argv ) { return foobar(0); }
EOF
    save_LIBS="$LIBS"
    LIBS="-L. -l$MPILIBNAME"
    if eval $ac_link ; then
        :
    else
	canuse=no
    fi
    LIBS="$save_LIBS"
fi
AC_MSG_RESULT($canuse)
if test "$canuse" = "no" ; then
    AC_MSG_ERROR([$MPILIBNAME cannot be used as the name for the MPICH library
Pick another name and set the environment variable MPILIBNAME to that name
and rerun configure])
fi
#
rm -rf conftest* lib$MPILIBNAME.a
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=$binbuild_dir/mpicc
if test $NOF77 = 0 ; then
	MPIF77=$binbuild_dir/mpif77
else
        # should this be "true"?
	MPIF77=""
fi
if test "$NO_F90" = "0" ; then 
    MPIF90=$binbuild_dir/mpif90
fi
MPICPLUSPLUS=$binbuild_dir/mpiCC
### FIXME: IS THIS CORRECT OR NEEDED???
LIB_DIR=$exec_prefix
#
# Some mpi2 commands supported (for the testing scripts)
HAS_MPI2=1
#
# The FIRST subsystem to configure is the Fortran subsystem because it
# may make changes in the way Fortran is handled (e.g., force a different
# name mangling)
if test "$NOF77" != 1 ; then
  # instead of ROMIO flags, should export CFLAGS, FFLAGS, and LDFLAGS
  # (but not those names)
  echo "Configuring Fortran subsystem"
  # In case we are doing a VPATH build
  if test ! -d src ; then mkdir src ; fi
  if test ! -d src/fortran ; then mkdir src/fortran ; fi
  # Combine the libraries by default
  if test -z "$flibname" ; then
	flibname=$MPILIBNAME
  fi
  if test -z "$fwrapname" ; then
        fwrapname=f$MPILIBNAME
  fi
  # The brackets are necessary to prevent libname from being replaced by 
  # nsl (! a bug in HAVE_LIBRARY in autoconf 1.7)
  # if we're the developers, we may need to create the
  # initial configure files.
  if test ! -x "$top_srcdir_val/src/fortran/configure" -a \
            -s "$top_srcdir_val/src/fortran/configure.in" -a \
	    -x "$top_srcdir_val/src/fortran/makeconfigure" ; then
      (cd "$top_srcdir_val/src/fortran" ; ./makeconfigure)
  fi
  # The test versions (e.g., TESTCC) are used for cross-compilation cases when
  # they allow programs to be built and run
  # We need prefix and libdir for the mpif77 scripts
  # Export the F77_xxx and F90xxx incase they were set with the -nagxxx switch
  (cd src/fortran ; \
  export CC ;\
  export CFLAGS ;\
  export F77 ;\
  export FFLAGS ;\
  export F90 ;\
  export LDFLAGS ;\
  export TESTCC ;\
  export TESTF77 ;\
  export TESTF90 ;\
  export mpich_includes ;\
  export LIB_PATH ;\
  export BASE_LIB_LIST ;\
  export ROMIO_LFLAGS ;\
  export ROMIO_TFFLAGS ;\
  export MPILIBNAME ;\
  export SHAREDKIND ;\
  export SHARED_LIB_SEARCH_PATH_LEADER ;\
  export SHARED_LIB_LOCALDIR ;\
  export sharedlibbuild_dir ;\
  export sharedlib_dir ;\
  export MPI_WITH_PMPI ;\
  export F90UNIX ;\
  export F90INC ;\
  export F90FLAGS ;\
  export F90LINKER ;\
  export F90LIB_PATH ;\
  export f90nag ;\
  export f95nag ;\
  export F77GETARGDECL; \
  export F90GETARGDECL; \
  export FXX_MODULE; \
  export F77_GETARGDECL; \
  export F77_GETARG; \
  export F77_IARGC; \
  export MPIVERSION ;\
  export MPIR_HOME ;\
  export libbuild_dir ;\
  export includebuild_dir ;\
  export CROSS_SIZEOF_CHAR ;\
  export CROSS_SIZEOF_SHORT ;\
  export CROSS_SIZEOF_INT ;\
  export CROSS_SIZEOF_LONG ;\
  export CROSS_SIZEOF_LONG_LONG ;\
  export CROSS_SIZEOF_FLOAT ;\
  export CROSS_SIZEOF_DOUBLE ;\
  export CROSS_SIZEOF_LONG_DOUBLE ;\
  export CROSS_SIZEOF_VOID_P ;\
  export CROSS_OFFSET_KIND ;\
  export CROSS_ADDRESS_KIND ;\
  export CROSS_F77_SIZEOF_INTEGER ;\
  export CROSS_F77_SIZEOF_REAL ;\
  export CROSS_F77_SIZEOF_DOUBLE_PRECISION ;\
  export CROSS_HAS_LONG_DOUBLE ;\
  export CROSS_HAS_LONG_LONG ;\
  [${top_srcdir}/src/fortran/configure --with-mpichbuilding --with-mpich \
	--with-flibname=$flibname $with_args $enable_args \
	--with-fwrapname=$fwrapname \
        --prefix=$prefix --libdir=$libdir --sysconfdir=$sysconfdir] )
  if test $? != 0 ; then
      echo "Error configuring the Fortran subsystem!"
      echo "Turning off Fortran support"
      NOF77=1
      NO_F90=1
      HAS_FORTRAN=0
      HAS_F77=0
      AC_DEFINE(MPID_NO_FORTRAN)
      do_f90modules="no"
  else
      echo "Done configuring Fortran subsystem"
      # Extract files into the "build" directories
      # Note that we may update mpif.h after the romio step below
      if test -s src/fortran/include/mpif.h ; then
	cp src/fortran/include/mpif.h $includebuild_dir/mpif.h
	# update includedir and libdir for the builddir versions
	sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
	    -e "s%^libdir=.*%libdir=$libbuild_dir%g" \
	    -e "s%^sharedlibdir=.*%sharedlibdir=$sharedlibbuild_dir%g" \
	    src/fortran/src/mpif77 > $binbuild_dir/mpif77
	chmod a+x $binbuild_dir/mpif77
	sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
	    -e "s%^libdir=.*%libdir=$libbuild_dir%g" \
	    -e "s%^sharedlibdir=.*%sharedlibdir=$sharedlibbuild_dir%g" \
	    src/fortran/src/mpif90 > $binbuild_dir/mpif90
	chmod a+x $binbuild_dir/mpif90
 	#cp src/fortran/src/mpif77 $binbuild_dir/mpif77
	cp src/fortran/include/mpi_fortdefs.h $includebuild_dir/mpi_fortdefs.h
	# Get updated version of F77 (in case we had to add args to it)
	if test "$F77" = "$TESTF77" ; then
  	     F77="`${MAKE} -f src/fortran/Makefile f77name`"
 	     TESTF77="$F77"
	else
	     # Just replace the "test" compiler
  	     TESTF77="`${MAKE} -f src/fortran/Makefile f77name`"
        fi
        F77_IN_C_LIBS="`${MAKE} -f src/fortran/Makefile f77in_clibs`"
        AC_SUBST(F77_IN_C_LIBS)
	# We really need to do the same things with the F90 steps.
        # These are needed for the test examples:
        F90_SUFFIX="`${MAKE} -f src/fortran/Makefile f90_suffix`"
	F90_MODINCFLAG="`${MAKE} -f src/fortran/Makefile f90_modincflag`"
        AC_SUBST(F90_SUFFIX)
	AC_SUBST(F90_MODINCFLAG)
	changequote(<<,>>)
        OFFSET_KIND=`grep 'MPI_OFFSET_KIND=' $includebuild_dir/mpif.h | \
			  sed -e 's/^.*=\([0-9]*\)).*$/\1/'`
        FORT_INT8=`grep 'MPI_INTEGER8=' $includebuild_dir/mpif.h | \
			  sed -e 's/^.*=\([0-9]*\)).*$/\1/'`
        changequote([,])			  
      fi
  fi
fi
FLIBNAME=$flibname
AC_SUBST(FLIBNAME)
#
#  Configure ROMIO if specified
#
if test $ROMIO = 1 ; then
  # If we find that we can't build ROMIO, set the appropriate
  # --with args so that subdirectory configures won't assume that
  # ROMIO is present
  if test -d "${top_srcdir}/romio" ; then 
      echo "Configuring ROMIO, for support of MPI-IO"
      # Check first for some ROMIO-specific requirements
      PAC_MACRO_NAME_IN_MACRO(,ROMIO=0)
      if test $ROMIO = 0 ; then
          print_error "Cannot build ROMIO with the C compiler $CC"
	  with_args="$with_args --without-romio --without-mpiio"
      fi
  else
      ROMIO=0
      with_args="$with_args --without-romio --without-mpiio"
  fi
fi
if test $ROMIO = 1 -a -d "${top_srcdir}/romio" ; then
  # If integer*8 not supported, then tell ROMIO not to use it.
  # We do this indirectly by telling ROMIO to use an offset type of int.
  if test "$NOF77" = "0" ; then
    if test -z "$FORT_INT8" -o "$FORT_INT8" = 0 ; then
      if test -z "$f_integer_size" -o "$f_integer_size" = "unavailable" ; then
        f_integer_size=4
      fi
      if test "$OFFSET_KIND" = 8 ; then
        # F90 has an 8-byte integer kind but F77 doesn't support it
        # as integer*8.
	if test "$F90" != "FC" ; then
          ROMIO_ARGS="$ROMIO_ARGS -longlongsize=int"
        fi
      else 	   
          ROMIO_ARGS="$ROMIO_ARGS -longlongsize=int"
      fi
    fi
  fi
  if test -z "$FILE_SYSTEM" ; then
      ROMIO_FILE_SYSTEM=""
  else
      ROMIO_FILE_SYSTEM="--with-file-system=$FILE_SYSTEM"
  fi
  FROM_MPICH=yes
  if test ! -d romio ; then mkdir romio ; fi
  # We set -fc to F77 since we set F77 to either $FC or the value f77
#            -mpiincdir=$includebuild_dir \
#	    -mpibindir=$binbuild_dir \
#            -mpilib=$libbuild_dir/lib$MPILIBNAME.a \
#            -mpiolib=$libbuild_dir/lib$MPILIBNAME.a \
#            -cc="$CC" -cflags="$ROMIO_CFLAGS $CC_SHARED_OPT" \
#            -fc="$F77" -fflags="$ROMIO_FFLAGS $FC_SHARED_OPT" \
#	    -f90="$F90"
  MPI_BIN_DIR=$binbuild_dir 
  MPI_LIB=$libbuild_dir/lib$MPILIBNAME.a
  MPI_INCLUDE_DIR=$includebuild_dir
  (cd romio ; \
  LIBNAME=$libbuild_dir/lib$MPILIBNAME.a ; export LIBNAME ; \
  export MPI_BIN_DIR ; export MPI_LIB ; export MPI_INCLUDE_DIR ; \
  export CROSS_SIZEOF_INT; \
  export CROSS_SIZEOF_VOID_P; \
  export CROSS_SIZEOF_LONG_LONG; \
  export CROSS_SIZEOF_LONG;\
  export MAKE;\
  export ARCH;\
  export CC; export F77; export F90; export MPILIBNAME ; \
  export FROM_MPICH;\
  export int_len ; export void_star_len ; export OFFSET_KIND ; \
  export long_long_len ; \
  "${top_srcdir}/romio/configure" $ROMIO_ARGS $ROMIO_FILE_SYSTEM \
            --with-mpi=mpich $romio_config_args $enable_args $with_args )
  rc=$?
  if test "$rc" != 0 ; then
      AC_MSG_ERROR([ROMIO Configure failed, aborting configure])
  fi
  rm -f include/mpio.h "${top_srcdir}/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`"
  OLD_BASE_LIB_LIST="$BASE_LIB_LIST"
  BASE_LIB_LIST="$BASE_LIB_LIST `$MAKE -f romio/Makefile romio_liblist`"
  if test "$OLD_BASE_LIB_LIST" != "$BASE_LIB_LIST " -o \
          -n "$ROMIO_LFLAGS" ; then
	# Romio added a library.  We need to update the Fortran compile
	# scripts to include this value.
	if test "$NOF77" = 0 -a -x src/fortran/src/mpif77 ; then
	    for file in mpif77 mpif77.conf mpif90 mpif90.conf ; do 
	       if test ! -s src/fortran/src/$file ; then continue ; fi
	       rm -rf .tmp
	       make_x=no
	       if test -x src/fortran/src/$file ; then make_x=yes ; fi
  	       cp src/fortran/src/$file .tmp
	       rm -f src/fortran/src/$file
       sed -e 's%BASE_LIB_LIST=.*%BASE_LIB_LIST="'"$BASE_LIB_LIST"'"%' \
	   -e 's%F90_LDFLAGS="\(.*\)"%F90_LDFLAGS="\1'"$ROMIO_LFLAGS"'"%' \
	   -e 's%F77_LDFLAGS="\(.*\)"%F77_LDFLAGS="\1'"$ROMIO_LFLAGS"'"%' \
	      .tmp > src/fortran/src/$file
	       # update includedir and libdir for the builddir versions
	       if test -s $binbuild_dir/$file ; then
	           sed -e "s%^includedir=.*%includedir=$includebuild_dir%g" \
	               -e "s%^libdir=.*%libdir=$libbuild_dir%g" \
	                src/fortran/src/$file > $binbuild_dir/$file
		   if test "$make_x" = "yes" ; then
  	               chmod a+x $binbuild_dir/$file
                   fi
	       fi
	       if test "$make_x" = "yes" ; then 
	           chmod a+x src/fortran/src/$file
	       fi
	    done
	    rm -rf .tmp
        fi
  fi
# mpif.h prepared for ROMIO at end of configure
  # If a VPATH build, the examples dir may not exist
  if test ! -d examples ; then mkdir examples ; fi
  if test ! -d examples/test ; then mkdir examples/test ; fi
  (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
#
# Configure MPE
# - MPE must be configured after Fortran in case the Fortran step
#   modifies the Fortran compiler
# - the option to MPE configure, --with-f2cmpilibs, allows different
#   Fortran to C MPI wrapper library name.  This should allow MPICH
#   to use a different name if it is needed.
if test "$NOMPE" = 0 -a -d "${top_srcdir}/mpe" ; then
    MPE_ARGS="$ENABLE_MPEDBG $MPE_OPTS";
    if test "$NOF77" != "0" ; then
        MPE_ARGS="$MPE_ARGS --disable-f77"
    fi
    if test ! -d mpe ; then mkdir mpe ; fi
    ( cd mpe ; \
      MAKE=$MAKE ; export MAKE ; \
      MPI_CC=${binbuild_dir}/mpicc ; export MPI_CC ; \
      MPI_F77=${binbuild_dir}/mpif77 ; export MPI_F77 ; \
      CC="${TESTCC}" ; export CC ; \
      F77="${TESTF77}" ; export F77 ; \
      export CLINKER ; export FLINKER ; \
      export CROSS_SIZEOF_CHAR ; \
      export CROSS_SIZEOF_SHORT ; \
      export CROSS_SIZEOF_INT ; \
      export CROSS_SIZEOF_LONG_LONG ; \
      export CROSS_BIGENDIAN ; \
      "${top_srcdir}/mpe/configure" --enable-mpich --disable-checkMPI \
                                  --with-f2cmpilibs=-lf$MPILIBNAME \
                                  --with-flib_path_leader=$LIB_PATH_LEADER \
                                  --prefix=${prefix} $enable_args $with_args \
                                  --libdir=${libdir} --bindir=${bindir} \
				  --includedir=${includedir} \
				  $MPE_ARGS )
    if test $? = 0 ; then
        echo "Done configuring MPE Profiling Libraries" ; echo
    else
        echo "Error configuring MPE Profiling Libraries"
        echo "Turning off building MPE Profiling Libraries" ; echo
        NOMPE=1
    fi
fi
#
if test "$Use_Intercomm_coll" = "yes" ; then
    MPI2OPTIONAL="src/coll2"
fi
#
# Substitute variables
# Variables used in scripts only
AC_SUBST(AUTOMOUNTFIX)dnl
if test -z "$RSHCOMMAND" ; then
    RSHCOMMAND=$rshcommand
fi
AC_SUBST(RSHCOMMAND)dnl
#
AC_SUBST(SYNCLOC)dnl
dnl # Variables defined ONLY for the doc/port file:
dnl AC_SUBST(CONFIGURE_ARGS)dnl
dnl AC_SUBST(NODEVDEBUG)dnl
dnl AC_SUBST(PKTSIZE)dnl
dnl AC_SUBST(LIMITEDBUFFERS)dnl
dnl AC_SUBST(ADI_COLLECTIVE)dnl
dnl AC_SUBST(cross_compiling)dnl
# Variables used by Makefile.in's:
AC_SUBST(ASM)dnl
AC_SUBST(ASMFILES_O)dnl
AC_SUBST(AR)dnl
AC_SUBST(ARCH)dnl
AC_SUBST(BASE_LIB_LIST)dnl
AC_SUBST(CC)dnl
AC_SUBST(CFLAGS)dnl
AC_SUBST(CLINKER)dnl
AC_SUBST(CCFLAGS)dnl
AC_SUBST(CCLINKER)dnl
AC_SUBST(CPP_COMPILER)dnl
AC_SUBST(CPP_DIR)dnl
AC_SUBST(CPPFLAGS)dnl
AC_SUBST(CXXFLAGS)dnl
AC_SUBST(LDFLAGS)dnl
AC_SUBST(CPPLDFLAGS)dnl
AC_SUBST(CPRP)dnl
AC_SUBST(DEFAULT_MACHINE)dnl
AC_SUBST(DEVCFLAGS)dnl
AC_SUBST(DEVCFILES)dnl
AC_SUBST(DEVOFILES)dnl
AC_SUBST(DEV_DEFS)dnl
AC_SUBST(DEVICE)dnl
AC_SUBST(DEVICE_MAKE_INCLUDE)dnl
AC_SUBST(F77)dnl
AC_SUBST(FAST_COPY)dnl
AC_SUBST(FFLAGS)dnl
AC_SUBST(FLIB_PATH)dnl
AC_SUBST(FLIB_PATH_LEADER)dnl
AC_SUBST(FLIB_LIST)dnl
AC_SUBST(FLINKER)dnl
AC_SUBST(GETNAME_DEFS)dnl
AC_SUBST(HAS_FORTRAN)dnl
AC_SUBST(HAS_MPI2)dnl
AC_SUBST(INCLUDE_PATH)dnl
AC_SUBST(LIB_LIST)dnl
AC_SUBST(LIB_PATH)dnl
AC_SUBST(LIB_DIR)dnl
AC_SUBST(MAKE)dnl
AC_SUBST(MPE_DIR)dnl
AC_SUBST(MPE_MPI_EXT_C)dnl
AC_SUBST(MPE_MPI_EXT_O)dnl
AC_SUBST(ENABLE_MPEDBG)
MPICH_VERSION="MPICH $MPIVERSION"
AC_SUBST(MPIVERSION)
AC_SUBST(CONFIGURE_ARGS_CLEAN)dnl 
AC_SUBST(HAVE_MPID_DEFS_H)dnl
dnl initutil 
dnl We can't put the quotes in '"' because the sed line generated by configure
dnl also uses quotes.
q='"'
AC_DEFINE_UNQUOTED(CONFIGURE_ARGS_CLEAN,$q$CONFIGURE_ARGS_CLEAN$q)
AC_DEFINE_UNQUOTED(MPIRUN_MACHINE,$q$DEFAULT_MACHINE$q)
#
# Because the Globus2 device can use a nested mpirun, it needs the
# option to ignore this step
if test "$define_mpirun_device" != "no" ; then
    AC_DEFINE_UNQUOTED(MPIRUN_DEVICE,$q$DEVICE$q)
fi
# COMM is currently used in mpirun.ch_p4.in to decide if SMP support is
# turned on
AC_SUBST(COMM)
dnl This is used to make sure that we get the correct mpirun.
AC_SUBST(MPICH_VERSION)dnl
dnl do we need mpir_home?
AC_SUBST(MPIR_HOME)dnl
AC_SUBST(MPI_AINT)dnl
AC_SUBST(MPI_FINT)dnl
AC_SUBST(MPILIBNAME)dnl
dnl The next four should not be needed; they should build on bindir
AC_SUBST(MPICC)dnl
AC_SUBST(MPIF77)dnl
AC_SUBST(MPIF90)dnl
AC_SUBST(MPICPLUSPLUS)dnl
dnl
AC_SUBST(MPI2OPTIONAL)dnl
dnl
AC_SUBST(MEMDEBUG)dnl
AC_SUBST(NLS_DEFS)dnl
AC_SUBST(NEWTESTDIRS)dnl
AC_SUBST(OPTFLAGS)dnl
AC_SUBST(OPTFLAGSC)dnl
AC_SUBST(OPTFLAGSF)dnl
dnl Where are p4_arch/p4_dir used?
AC_SUBST(P4_ARCH)dnl
AC_SUBST(P4_DIR)dnl
AC_SUBST(RHS_COMMAND)dnl
# P4_MDEPCFLAGS now used only in doc/port.in - delete this
dnl AC_SUBST(P4_MDEPCFLAGS)dnl
AC_SUBST(PREFIX)dnl
AC_SUBST(RANLIB)dnl
AC_SUBST(USER_CFLAGS)dnl
AC_SUBST(ROMIO)dnl
AC_SUBST(ROMIO_LFLAGS)dnl
AC_SUBST(ROMIO_TCFLAGS)dnl
AC_SUBST(ROMIO_TCPPFLAGS)dnl
AC_SUBST(ROMIO_TFFLAGS)dnl
dnl why is this?  Why not test on CCC or CPP_COMPILER?
AC_SUBST(buildcpp)dnl
AC_SUBST(NOF77)dnl
AC_SUBST(NO_F90)dnl
AC_SUBST(NOMPE)dnl
AC_SUBST(hasMPE)dnl
AC_SUBST(MPE_OPTS)dnl
dnl MPI_INTRA is the name of the file that implements the collective routines
dnl (intra_fns_new is the default)
AC_SUBST(MPI_INTRA)dnl
#
# End configuration file
#
# Make sure we remove any configuration file incase there is out-of-date data.
# We remove the version in include in case this is a vpath build
/bin/rm -f mpichconf.h "${top_srcdir}/include/mpichconf.h include/mpichconf.h"

# Make the directories that do not contain Makefiles (should they?) but 
# are needed for the subsequent directories.
if test ! -d src ; then mkdir src ; fi
AC_OUTPUT(Makefile util/Makefile examples/Makefile src/pt2pt/Makefile \
          src/coll/Makefile src/context/Makefile src/dmpi/Makefile \
	  src/env/Makefile src/topol/Makefile src/profile/Makefile \
	  src/coll2/Makefile \
	  src/util/Makefile src/infoexport/Makefile examples/basic/Makefile \
	  src/misc2/Makefile src/external/Makefile )
#
# 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
# Removed mpif77 because it is created by the Fortran subsystem.
# Removed mpif90 for the same reason.
# Note that some of these scripts are needed only by some devices; they 
# should eventually be built by only those devices (which should also know
# about installing them)
# FIXME: mv util/chkserv util/chkmachine and util/tstmachines elsewhere.
PAC_OUTPUT_EXEC(util/mpicc util/mpicxx util/mpiinstall \
		util/mpirun util/mpichlib.conf util/mpiman \
                util/chkserv util/chkmachine util/tstmachines, a+x )
dnl
dnl mpif.h created by the Fortran subsystem
rm -f $includebuild_dir/mpidefs.h 
rm -f $includebuild_dir/mpif.f90
dnl rm -f $includebuild_dir/mpif.h 
rm -f "$top_srcdir/include/mpidefs.h"
rm -f "$top_srcdir/include/mpif.f90"
dnl rm -f "$top_srcdir/include/mpif.h"
PAC_OUTPUT_EXEC(include/mpidefs.h,a+r)
PAC_OUTPUT_EXEC(include/mpif.f90,a+r)
dnl PAC_OUTPUT_EXEC(include/mpif.h,a+r)
# We must undo the assignment to CONFIG_HEADERS
unset CONFIG_HEADERS

# Get the files needed by USER programs into the includebuild_dir
if test ! -s "$includebuild_dir/mpi.h" ; then
    cp "${top_srcdir}/include/mpi.h" "$includebuild_dir"
    cp "${top_srcdir}/include/mpi_errno.h" "$includebuild_dir"
fi
if test ! -s "$includebuild_dir/mpidefs.h" ; then 
    cp "${top_srcdir}/include/mpidefs.h" "$includebuild_dir"
    dnl cp ${top_srcdir}/include/mpif.h $includebuild_dir
fi

# 
# Update mpif.h with mpiof.h if both romio and fortran were selected and
# successful
if test "$NOF77" = "0" -a "$ROMIO" = "1" -a -s romio/include/mpiof.h -a \
	-s src/fortran/include/mpif.h ; then
    echo "Creating mpif.h from Fortran and Romio contributions"
    # Special case:  Both ROMIO and the Fortran module may have defined
    # MPI_OFFSET_KIND.  If so, remove the Romio definition.
    if grep MPI_OFFSET_KIND src/fortran/include/mpif.h >/dev/null 2>&1 ; then
        sed -e '/OFFSET_KIND/d' romio/include/mpiof.h | \
	cat src/fortran/include/mpif.h - > \
	    $includebuild_dir/mpif.h
    else
        cat src/fortran/include/mpif.h romio/include/mpiof.h > \
	    $includebuild_dir/mpif.h
    fi
fi

dnl if test "$NOF77" = "0" ; then
dnl     PAC_OUTPUT_EXEC(src/env/farg.f src/env/farg90.f)
dnl fi
#
# Configure the tests (now that the compiler scripts are built)
echo "Configuring the test suite..."
unset CONFIG_FILES
if test ! -d examples/test ; then 
    mkdir examples/test
fi
#
testargs=""
if test "$NO_LONG_LONG" = "yes" ; then
    testargs="$testargs --disable-long-long"
fi
if test "$NO_LONG_DOUBLE" = "yes" ; then
    testargs="$testargs --disable-long-double"
fi
if test "$HAS_F77" != "0" ; then
    testargs="$testargs -basefc=\"$F77\" -fc=\"$MPIF77\""
else
    testargs="$testargs -nof77"
fi
if test "$ROMIO" = "1" ; then
    testargs="$testargs --enable-io"
else
    testargs="$testargs --disable-io"
fi
#
# The eval causes the \" in the f77 case above to be properly expanded.
( cd examples/test ;
  export MPIBOOT ; export MPIUNBOOT ; \
  eval "$srcdir/examples/test/configure" -basecc=\"$CC\" -cc=\"$MPICC\" \
                                  -make=\"$MAKE\" -device="$DEVICE" \
			          -mpichpath="$binbuild_dir" \
				  --enable-boot \
			          -cflags=\"$CFLAGS\" $testargs )
				 
if test ! -d examples/perftest ; then 
    mkdir examples/perftest
fi
echo "Configuring the performance tests ..."
if test "$HAS_F77" = 0 ; then otherargs="--disable-fortran" 
else otherargs=""
fi
# This is the autoconf 2 version.
# if we're the developers, we may need to create the
# initial configure files.
if test ! -x "$top_srcdir_val/examples/perftest/configure" -a \
          -s "$top_srcdir_val/examples/perftest/configure.in" -a \
	  -x "$top_srcdir_val/examples/perftest/makeconfigure" ; then
    (cd "$top_srcdir_val/examples/perftest" ; ./makeconfigure)
fi
(cd examples/perftest ; \
    export MAKE ; export CC ; export F77 ; export MPICC ; export MPIF77 ; \
    export MPILIBNAME ; export TESTCC ; export TESTF77 ; \
    export F90 ; export TESTF90 ; \
    "$srcdir/examples/perftest/configure" \
	--with-mpichbuilding --with-mpich=$binbuild_dir \
	-prefix=$prefix $otherargs )

#if test "$HAS_F77" != "0" ; then
#    ( cd examples/perftest ; \
#       $srcdir/examples/perftest/configure -cc="$MPICC" -basecc="$CC" \
#				-fc="$MPIF77" -basefc="$F77" \
#				-f77_extra_flag="$F77_EXTRA_FLAG" \
#				-make="$MAKE" )
#else
#    ( cd examples/perftest ; \
#       $srcdir/examples/perftest/configure -cc="$MPICC" -basecc="$CC" -nof77 \
#				-make="$MAKE" )
#fi
#
# Configure JUST the correct device file
CONFIG_FILES="mpid/$DEVICE/Makefile"
if test -f "$srcdir/mpid/tests/Makefile.in" ; then
    CONFIG_FILES="$CONFIG_FILES mpid/tests/Makefile"
fi
export CONFIG_FILES
${CONFIG_SHELL-/bin/sh} ./config.status
CONFIG_FILES=""
unset CONFIG_FILES
#
# Set the final choices of flags
#
# If the test suite is part of the directory, generate its makefiles
# This should have it's own configure
if test -d tsuite ; then
    CONFIG_FILES="tsuite/Makefile tsuite/coll/Makefile tsuite/mpitc2/Makefile"
    export CONFIG_FILES
    ${CONFIG_SHELL-/bin/sh} ./config.status
    CONFIG_FILES=""
    unset CONFIG_FILES
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
    CONFIG_FILES=""
    unset CONFIG_FILES
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
    CONFIG_FILES=""
    unset CONFIG_FILES
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"

  if test "$print_machines_message" = 1 ; then
      print_error "Created util/machines/machines.$ARCH with five copies of $HOST"
      print_error "You may want to edit this file to add and delete hosts"
      print_error "(These hosts are used by mpirun.)"
  fi
  print_error "---< "
fi
if test -n "$found_old" ; then
    echo "Old style arguments to configure were found:"
    echo $found_old
    echo ""
fi
echo 'Configuration completed.'
exit 0
