#! /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

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

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

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

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

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


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


# We may need to delete this

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether filesystem respects case in file names""... $ac_c"
else
echo $ac_n "checking whether filesystem respects case in file names""... $ac_c" 1>&1
fi
echo 1 > CONFTEST
echo 2 > conftest
if diff CONFTEST conftest 2>&1 >/dev/null ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: You may encounter problems with the commands mpicc and MPICC"
else
echo "$ac_t""Warning: You may encounter problems with the commands mpicc and MPICC" 1>&1
fi
    CASE_SENSITIVE=yes
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
fi
rm -f CONFTEST conftest

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

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

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

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

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

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

fi
MPIR_HOME=$MPIR_TRIAL

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for architecture""... $ac_c"
else
echo $ac_n "checking for architecture""... $ac_c" 1>&1
fi
    ARCH=`$srcdir/bin/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
       print_error "Error: Couldn't guess target architecture, you must"
       print_error "       set an architecture type with -arch=<value>"
       exit 1
    fi
    eval "arch_$ARCH=1"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ARCH"
else
echo "$ac_t""$ARCH" 1>&1
fi
fi
if test -n "$arch_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
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking device""... $ac_c"
else
echo $ac_n "checking device""... $ac_c" 1>&1
fi
    DEVICE=`$srcdir/bin/tdevice $ARCH`
    if test ! -n "$DEVICE" ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
        print_error "Error: Couldn't guess device, you must" 
        print_error "       set a device with -device=<value>" 
        exit 1
    fi
    eval "device_$DEVICE=1" 
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$DEVICE"
else
echo "$ac_t""$DEVICE" 1>&1
fi
fi
#
# Check for a VALID device
if test ! -d "$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)
# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args, or
# /usr/ucb/install on SVR4, which tries to use the nonexistent group
# `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
# anyway.  Sigh.
if test "z${INSTALL}" = "z" ; then
  echo checking for install
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    case $dir in
    /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
    *)
      if test -f $dir/installbsd; then
	INSTALL="$dir/installbsd -c" # OSF1
	INSTALL_PROGRAM='$(INSTALL)'
	INSTALL_DATA='$(INSTALL) -m 644'
	break
      fi
      if test -f $dir/install; then
	if grep dspmsg $dir/install >/dev/null 2>&1; then
	  : # AIX
	else
	  INSTALL="$dir/install -c"
	  INSTALL_PROGRAM='$(INSTALL)'
	  INSTALL_DATA='$(INSTALL) -m 644'
	  break
	fi
      fi
      ;;
    esac
  done
  IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
test -n "$verbose" && echo "	setting INSTALL to $INSTALL"
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_DATA to $INSTALL_DATA"

#
# Using this autoconf macro for ranlib doesn't handle the problem 
# of 'helpful' ranlib's that issue error messages (!).  Once
# we've identified the proper compiler etc, we'll try this 
# ranlib below; if it fails, we'll replace it with ':'
#
if test -z "$RANLIB" ; then
    if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set dummy ranlib; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB"

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

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

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


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

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


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

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

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


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

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

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

fi

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

#
# We should provide a way to specify a particular IRIX version, rather 
# than requiring the this code to figure everything out.
# In particular, there are IRIX-like systems that do not have the 'hinv'
# command.
#
if test -n "$arch_IRIX" ; then
   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for IRIX cpucount""... $ac_c"
else
echo $ac_n "checking for IRIX cpucount""... $ac_c" 1>&1
fi
   cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
   if test "$cpucount" = "" ; then
     cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
   fi
      if test "$cpucount" = "" ; then
     print_error "Could not determine cpucount."
     print_error "Please send "
     hinv
     print_error "to mpi-bugs@mcs.anl.gov"
     exit 1
   fi
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cpucount"
else
echo "$ac_t""$cpucount" 1>&1
fi
   if test -z "$PROCESSOR_COUNT" ; then PROCESSOR_COUNT=$cpucount ; fi
   
{
test -n "$verbose" && \
echo "	defining" PROCESSOR_COUNT to be $PROCESSOR_COUNT
echo "#define" PROCESSOR_COUNT $PROCESSOR_COUNT >> confdefs.h
DEFS="$DEFS -DPROCESSOR_COUNT=$PROCESSOR_COUNT"
SEDDEFS="${SEDDEFS}\${SEDdA}PROCESSOR_COUNT\${SEDdB}PROCESSOR_COUNT\${SEDdC}$PROCESSOR_COUNT\${SEDdD}
\${SEDuA}PROCESSOR_COUNT\${SEDuB}PROCESSOR_COUNT\${SEDuC}$PROCESSOR_COUNT\${SEDuD}
\${SEDeA}PROCESSOR_COUNT\${SEDeB}PROCESSOR_COUNT\${SEDeC}$PROCESSOR_COUNT\${SEDeD}
"
}

            if test -d mpid/sgi -a "$osversion" -ge 6 -a "$osvminor" -ge 1 -a \
	`uname -s` = "IRIX64" ; then
	if test -z "$device_sgi" ; then
	    echo "Consider using -device=sgi for SGI arrays"
	fi
   elif test -n "$device_sgi" ; then
	print_error "The sgi device requires IRIX64 and version 6.1 or later"
        exit 1
   fi
            if test $cpucount -gt 1 ; then
     if test "$COMM" = "ch_p4" ; then
       if test "$default_comm" = "1" ; then
         echo "IRIX multiprocessor & p4, setting -comm=shared"
         echo "  (configure with -comm=ch_p4 to disable shared memory)"
         COMM="shared"
       fi
     fi
   fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for IRIX cpumodel""... $ac_c"
else
echo $ac_n "checking for IRIX cpumodel""... $ac_c" 1>&1
fi
            cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '`
   if test -z "$cputype" ; then
	print_error "Could not get cputype from hinv -t cpu command."
	print_error "Please send "
	hinv -t cpu 2>&1
	hinv -t cpu | cut -f 3 -d' ' 2>&1
	print_error "to mpi-bugs@mcs.anl.gov" 
	exit 1
   fi
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cputype"
else
echo "$ac_t""$cputype" 1>&1
fi
            if test -z "$osversion" ; then
	print_error "Could not determine OS version.  Please send" 
        print_error " " 
	uname -a
	print_error "to mpi-bugs@mcs.anl.gov" 
        exit 1
   elif test $osversion = 4 ; then
			        true
   elif test $osversion = 5 ; then
	true
   elif test $osversion = 6 ; then
	true
   else 
       print_error "Could not recognize the version of IRIX (got $osversion)"
       print_error "MPICH knows about versions 4, 5 and 6; the version being"
       print_error "returned from uname -r is $osversion."
       print_error "Please send"
       uname -a 2>&1
       hinv 2>&1
       print_error "to mpi-bugs@mcs.anl.gov"
       exit 1
   fi
   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for cputype""... $ac_c"
else
echo $ac_n "checking for cputype""... $ac_c" 1>&1
fi
   OLD_ARCH=IRIX
   IRIXARCH="$ARCH_$osversion"
         cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"`
      case $cputype in 
	3000) ;;
	4000) ;;
	4400) ;;
	4600) ;;
	5000) ;;
	8000) ;;
	10000);;
	12000);;
	14000);;
        *)
	print_error "Unexpected IRIX/MIPS chipset $cputype.  Please send the output"
	print_error " "
        uname -a 2>&1
        hinv 2>&1 
 	print_error " " 
        print_error "to mpi-bugs@mcs.anl.gov" 
	print_error "MPICH will continue and assume that the cputype is"
        print_error "compatible with a MIPS 4400 processor."
 	print_error " " 
        cputype=4400
	;;
   esac
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cputype"
else
echo "$ac_t""$cputype" 1>&1
fi
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi


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

if test -n "$arch_EWS_UX_V" ; then
    # This is a Unix System V system running on MIP/SGI processors
    LIB_LIST="$LIB_LIST -lsocket -lnsl -lc"	
fi
#
# End of architecture-specific tests
#
# 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

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

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

# bindir is for executable programs for the USER
if test -z "$bindir" ; then bindir='${exec_prefix}/bin' ; fi

# sbindir is for executable programs for the ADMINISTRATOR
if test -z "$sbindir" ; then sbindir='${exec_prefix}/sbin' ; fi

# libdir is for libraries for the USER
if test -z "$libdir" ; then libdir='${exec_prefix}/lib' ; fi

if test -z "$sharedstatedir" ; then sharedstatedir='${prefix}/com' ; fi

if test -z "$localstatedir" ; then localstatedir='${prefix}/var' ; fi

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


SHARED_LIB_LOCALDIR="$SHAREDLIB_LOCAL_DIR"

# prefix is used to construct the rest of the variables.
if test -z "$prefix" ; then prefix=$PREFIX ; fi

# mandir is the root for the man pages
if test -z "$mandir" ; then mandir='${prefix}/man' ; fi

if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi


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

# 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

if test -z "$datadir" ; then
    datadir='${prefix}/share'
fi

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

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






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


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking if $CPP_COMPILER returns correct error code""... $ac_c"
else
echo $ac_n "checking if $CPP_COMPILER returns correct error code""... $ac_c" 1>&1
fi
        cat > conftest.cc <<EOF
int main(){int a=b;}
EOF
        $CPP_COMPILER -c conftest.cc>conftest.out 2>&1
	if test $? = 0 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!...Cannot use $CPP_COMPILER compiler"
else
echo "$ac_t""no!...Cannot use $CPP_COMPILER compiler" 1>&1
fi
	    CPP_COMPILER=""
        else
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
        fi
	/bin/rm 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?
            if test -z "$GXXTRIAL"; then
  # Extract the first word of `$program', so it can be a program name with args.
  set dummy $program; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      GXXTRIAL="$program"
      break
    fi
  done
  IFS="$saveifs"
fi

test -n "$GXXTRIAL" && test -n "$verbose" && echo "	setting GXXTRIAL to $GXXTRIAL"

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking if $GXXTRIAL returns correct error code""... $ac_c"
else
echo $ac_n "checking if $GXXTRIAL returns correct error code""... $ac_c" 1>&1
fi
                    cat > conftest1.cc <<EOF
int main(){int a=b;}
EOF
                    $GXXTRIAL -c conftest1.cc>conftest1.out 2>&1
	            if test $? = 0; then
	                if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!"
else
echo "$ac_t""no!" 1>&1
fi
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	                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 
        if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that selected C++ compiler can compile iostream.h""... $ac_c"
else
echo $ac_n "checking that selected C++ compiler can compile iostream.h""... $ac_c" 1>&1
fi
        rm -f conftest*
        cat > conftest.cc <<EOF
#include <iostream.h>	
EOF
        if $CPP_COMPILER -c conftest.cc>conftest.out 2>&1 ; then 
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no!...Cannot use $CPP_COMPILER compiler"
else
echo "$ac_t""no!...Cannot use $CPP_COMPILER compiler" 1>&1
fi
	    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++
	if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for g++ compiler exception flags""... $ac_c"
else
echo $ac_n "checking for g++ compiler exception flags""... $ac_c" 1>&1
fi
	cat > conftest.cc <<EOF
int main () {}
EOF
	$CPP_COMPILER -c conftest.cc -fhandle-exceptions 2>conftest.out
	if test ! -s conftest.out ; then
	    CXXFLAGS="$CXXFLAGS -fhandle-exceptions"
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""-fhandle-exceptions"
else
echo "$ac_t""-fhandle-exceptions" 1>&1
fi
	else
	    /bin/rm -f conftest.o conftest.out
	    $CPP_COMPILER -c conftest.cc -fexceptions 2>conftest.out
	    if test ! -s conftest.out ; then
	        CXXFLAGS="$CXXFLAGS -fexceptions"
		if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""-fexceptions"
else
echo "$ac_t""-fexceptions" 1>&1
fi
	    else
		if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""not determined"
else
echo "$ac_t""not determined" 1>&1
fi	
	    fi
	    /bin/rm -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.
        for p in cc gcc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CC"; then
  ac_pg_CC="$CC" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CC="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CC="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CC="$ac_pg_CC"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CC)"
else
echo "$ac_t""found $ac_prog_where ($CC)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

        fi



if test -z "$USERCC" ; then
case $CARCH in 
   cenju3) if test $ARCH = abi
           then
              CCC=CC
              CCLINKER=cjCC
              CC=cc
              F77=f77
              ASM=as
              if test -z "$USERFLINKER" ; then
                  FLINKER="cjabif77 $LDFLAGS"
              fi
              if test -z "$USERCLINKER" ; then
                  CLINKER="cjabicc $LDFLAGS"
              fi
           else
              CCC=CC
              CCLINKER=cjCC
              CC=/usr/necccs/bin/cc
              F77=/usr/necccs/bin/f77
              ASM=/usr/necccs/bin/as
              if test ! -x $CC ; then
                 CC=cc
                 F77=f77
                 ASM=as
              fi
#
              if test -z "$USERFLINKER" ; then
                  FLINKER="cjf77 $LDFLAGS"
              fi
              if test -z "$USERCLINKER" ; then
                  CLINKER="cjcc $LDFLAGS"
              fi
           fi
#
           DEVCFLAGS="$DEVCFLAGS -O -Kmips2"
           MPILIBNAME=mpich
           ASMFILES_O=get_stack.o
          ;;
   intelnx|paragon) CC=icc ; GCC="" 
	  # If this version of the intel compiler accepts the -nx flag, use it.
  	  if icc -nx > /dev/null 2>&1 ; then
	    # For some reason the lib list was commented out; we need
	    # it to link with if we use the NX routines
	    LIB_LIST="$LIB_LIST -nx"
	    CFLAGS="$CFLAGS -nx"
	  fi
	;;
   cm5) CC=cc ; GCC="" ;   
	if test -z "$USERCLINKER" ; then
	     CLINKER="cmmd-ld -comp $CC"
	fi ;;
   cray_t3d)        
	# Some Cray's require -Ccray-t3d instead of -Tcray-t3d.  
        # We have no diagnostic for this behavior yet.
	if test -x /mpp/bin/cc ; then 
            CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3d -DT3D" ; GCC="" 
	fi
        if test -z "$USERCLINKER" ; then 
	       CLINKER="$CC -Tcray-t3d" ; fi ;;
   cray_t3e)        
	# Some Cray's require -Ccray-t3e instead of -Tcray-t3e.  
        # We have no diagnostic for this behavior yet.
	if test -x /mpp/bin/cc ; then 
            CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3e -DT3E" ; GCC="" 
	fi
        if test -z "$USERCLINKER" ; then 
	    CLINKER="$CC -Tcray-t3e" ; fi ;;
   hpux)
	# For some systems, the (linker) option 
        #  -Wl,+vnocompatwarnings 
	# will suppress warning messages about versions of object files.
	if test "`which ${CC-cc}`" = "/usr/convex/bin/cc" ; then 
        CFLAGS="$CFLAGS -or none -U_REENTRANT -D_POSIX_SOURCE -D_HPUX_SOURCE -DMPI_cspp"
         elif test "$CC" != "gcc" ; then
	    # If cflags includes -Ae or -Aa, we don't need to add -Aa
            # In a perfect world, we might want to try -Ae
            # There is also -Aportable...
	    hasarg=`echo A$CFLAGS | sed -n -e '/-A/p'`
	    if test -z "$hasarg" ; then
		# Try to Add -Ae; add -Aa if that doesn't work
	        
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Ae""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Ae""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Ae $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -Ae can be linked with ones compiled  without -Ae""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Ae can be linked with ones compiled  without -Ae""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     hasarg=1
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Ae to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Ae to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -Ae to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Ae to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     hasarg=1
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Aa to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Aa to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -Aa to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Aa to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

		    if test -n "$hasarg" ; then
			CFLAGS="$CFLAGS -Aa"
			AaOPT=1
		    else
			AaOPT=0
		    fi
                fi
	    fi
            # We need these flags to get the correct system include
            # files.
            CFLAGS="$CFLAGS -D_POSIX_SOURCE -D_HPUX_SOURCE"
	    # P4 needs these to get the correct system includes
            P4_CFLAGS="-D_POSIX_SOURCE -D_HPUX_SOURCE"
	    # We MUST have an ANSI compiler for HPUX, even for USER code
	    # If the regular cpp worked, we would not need to do this.
	    if test -z "$AaOPT" ; then
   	        
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c"
else
echo $ac_n "checking that routines compiled with -Aa can be linked with ones compiled  without -Aa""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     AaOPT=1
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Aa to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             AaOPT=0
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -Aa to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             AaOPT=0
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -Aa to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  AaOPT=0
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -Aa to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    AaOPT=0
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         AaOPT=0
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      AaOPT=0
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

            fi
	    if test "$AaOPT" = 1 ; then
	       USER_CFLAGS="$USER_CFLAGS -Aa"
	    fi
	    # Alternate...
	    # -Ae is extended -Aa (only on some PA RISC systems)
	    #CFLAGS="$CFLAGS -Ae +Olibcalls"
	    #CLINKER="cc -Ae"
	    # fort77 is the POSIX-compliant version of f77; fort77 can use 
	    # -Ldirectory
	    #F77=fort77
	    #FLINKER=fort77
	    #FFLAGS="$FFLAGS +ppu"
	    # Try and see that this works
	    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  hpux_ansi=1

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

fi
rm -f conftest*

	    if test $hpux_ansi = 0 ; then
	       print_error "HPUX C compiler does not support ANSI mode!"
	       print_error "This mode is required because severe bugs in HPUX CPP"
	       print_error "cause problems.  Configuration continuing BUT	"
	       print_error "if you have trouble, consider using the GNU C"
	       print_error "compiler gcc instead."
	    else
              print_error "HPUX C compiler is being forced into ANSI mode so that"
              print_error "severe bugs in HPUX CPP do not cause problems"
	    fi
         fi 
	 ;;
    alpha)   ;;
    convex_spp)  CC="/usr/convex/bin/cc" ;;
    ibmpoe)
                           	                   	 CCval=
         # Extract the first word of "xlC", so it can be a program name with args.
set dummy xlC; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "xlC" : "\(.\)"`
  # Use ac_word instead of xlC in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="xlC"
       ac_prog_where=xlC
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="xlC"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "mpCC" : "\(.\)"`
  # Use ac_word instead of mpCC in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="mpCC"
       ac_prog_where=mpCC
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="mpCC"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "xlc" : "\(.\)"`
  # Use ac_word instead of xlc in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="xlc"
       ac_prog_where=xlc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="xlc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "mpcc" : "\(.\)"`
  # Use ac_word instead of mpcc in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="mpcc"
       ac_prog_where=mpcc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="mpcc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

             fi
         fi
         if test -z "$CCval" ; then
            print_error "Could not find mpCC or mpcc!"
            print_error "Make sure that you path is set correctly."
	    exit 1
         fi
         CC="$CCval"
    ;;
    meiko) 
                  CCval=''
      for p in cc apcc pgcc gcc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

      if test -z "$CCval" ; then
          print_error "Could not find a C compiler"
	  exit 1
      elif test "$CCVal" = "cc" ; then
          CC="cc -g -xcg92"
      else
	  CC=$CCval
      fi
	;;
    ncube)   CC=ncc ;;
    rs6000)
      CCval=""
      for p in xlC xlc cc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

      if test -n "$CCval" ; then
	 CC=$CCval
         GCC=""
      fi
      ;;
    *)
      # If no CC has yet been set:
      if test -z "$CC" ; then
          CCval=""
          # Pick the vendor's cc ahead of gcc.
	  # ecc, icc are various Intel compilers
	  # pgcc is the Portland group compiler
          for p in cc gcc pgcc ecc icc
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CCval"; then
  ac_pg_CCval="$CCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CCval="$ac_pg_CCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CCval)"
else
echo "$ac_t""found $ac_prog_where ($CCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

          # For pgcc, we might want to add -Muchar (char == unsigned char)
          if test -n "$CCval" ; then
	      CC=$CCval
	  fi
      fi
      ;;
esac
fi
if test -z "$USERCLINKER" -a -z "$CLINKER" ; then
    CLINKER="$CC"
fi
pac_msg=`$CC -V 2>&1 | grep Itanium`
if test "$CC" = "ecc" -o -n "$pac_msg" ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking if -i_dynamic is required for Itanium C compiler""... $ac_c"
else
echo $ac_n "checking if -i_dynamic is required for Itanium C compiler""... $ac_c" 1>&1
fi
    pac_result=no
    cat > conftest.c <<EOF
int main( int argc, char **argv ) { return 0; }	
EOF
    pac_msg=`$CLINKER -o conftest conftest.c 2>&1 | grep 'bfd assertion fail'`
    if test -n "$pac_msg" ; then
        pac_msg=`$CLINKER -o conftest conftest.c -i_dynamic 2>&1 | grep 'bfd assertion fail'`
	if test -x conftest -a -z "$pac_msg" ; then 
	    pac_result=yes
	    CLINKER="$CLINKER -i_dynamic"
        fi
    fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$pac_result"
else
echo "$ac_t""$pac_result" 1>&1
fi
    rm -f conftest*
fi


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

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

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

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_ccworks"
else
echo "$ac_t""$ac_cv_ccworks" 1>&1
fi
if test $ac_cv_ccworks = "yes" ; then
    :
else
    noproto=1
fi
ac_cv_ccansi="$CC $CFLAGS"
fi

if test -n "$noproto" ; then
    print_error "The compiler $CC does not accept ANSI prototypes"
    CC=""
    # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$CC"; then
  ac_pg_CC="$CC" # Let the user override the test.
else
  ac_first_char=`expr "gcc" : "\(.\)"`
  # Use ac_word instead of gcc in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_CC="gcc"
       ac_prog_where=gcc
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_CC="gcc"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;CC="$ac_pg_CC"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($CC)"
else
echo "$ac_t""found $ac_prog_where ($CC)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

    if test -n "$CC" ; then
	

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

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

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

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


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

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

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

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

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

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

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

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

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_ccworks"
else
echo "$ac_t""$ac_cv_ccworks" 1>&1
fi
if test $ac_cv_ccworks = "yes" ; then
    :
else
    exit 1
fi
ac_cv_ccansi="$CC $CFLAGS"
fi

        print_error "Using $CC as the C compiler instead"
	CLINKER=$CC
    else
	CC=""
        CLINKER=""
	print_error "Could not find a working C compiler!"
	exit 1
    fi
fi


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether we are using GNU C""... $ac_c"
else
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&1
fi
    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
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ac_cv_prog_gcc"
else
echo "$ac_t""$ac_cv_prog_gcc" 1>&1
fi
    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
    
if test -z "$USERF77" ; then
case $CARCH in 
   intelnx|paragon|i860) F77=if77 ;;
   cm5) # TMC Told us this should be f77
        F77=f77 ; if test -z "$USERFLINKER" ; then
		      FLINKER="cmmd-ld -comp $F77 $LDFLAGS"
		  fi ;;
   CRAY)
   # The Fortran compiler might be cf77 or f77
   # This wierd function uses the VALUE of the first argument before
   # the second!
   F77=	
   for p in cf77 f77 f95 f90
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$F77"; then
  ac_pg_F77="$F77" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_F77="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_F77="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;F77="$ac_pg_F77"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($F77)"
else
echo "$ac_t""found $ac_prog_where ($F77)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

   ;;
   cray_t3d)        
# The dp switch on the following lines allows compilation of "double precision"
# at the cost of violating the Fortran standard
   print_error Setting double precision to be the same as real, in violation 
   print_error of the Fortran standard.  This is needed because Cray Fortran 
   print_error for the T3D does not support double precision and hence is 
   print_error not actually Fortran.
   F77="/mpp/bin/cf77"
   FFLAGS="$FFLAGS -Ccray-t3d -dp"
   F77GETARG="call pxfgetarg(i,s,1,ierr)"
   if test -z "$USERFLINKER" ; then
       FLINKER="$F77 -Ccray-t3d $LDFLAGS"
   fi
   ;;
#
#  SX4 Floating Point formats
#
#  float = float0 : Conforms IEEE 754 standard.
#                   C:       sizeof (int)     = 4; sizeof (float) = 4
#                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4
#
#  float = float1 : IBM  floating point format
#                   C:       sizeof (int)     = 4; sizeof (float) = 4
#                   FORTRAN: sizeof (INTEGER) = 4; sizeof (REAL)  = 4
#
#  float = float2 : CRAY floating point format
#                   C:       sizeof (int)     = 4; sizeof (float) = 8
#                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8
#                   !!! Will not work for FORTRAN and MPICH !!!
#
#  float = float2_int64 : CRAY floating point format
#                   C:       sizeof (int)     = 8; sizeof (float) = 8
#                   FORTRAN: sizeof (INTEGER) = 8; sizeof (REAL)  = 8
#
   SX_4_float0 | SX_4_float1 | SX_4_float2 | SX_4_float2_int64)
         arch_SX_4=1
#
         float=`expr $CARCH : 'SX_4_\(float.\).*'`
         w8=`expr $CARCH : "SX_4_float._\(ew\).*" \| "dw"`
         sx4int=`expr $CARCH : ".*_\(int64\).*" \| "int32"`
#
         echo "Generating MPICH for floating point format \`\`$float''"
#
         if test "$w8" = "ew" ; then
            echo "                 and extended numeric storage \`\`$w8''"
         else
            if test "$sx4int" = "int64" ; then
               echo "                 and sizeof (int) = 64"
            elif test "$float" = "float2" ; then
               cat << EOF
***********************************************************************
*
*   WARNING:
*
*   MPICH is generated for floating point format \`\`float2'' without
*         expanding C int's to 64 bits.
*         This version will not run together with FORTRAN codes.
*
***********************************************************************
EOF
            fi
         fi
#
         CCC="CC"
         CC="cc"; ASM="as -m -h $float"
         OPTFLAGSC="-h2 -hsetmain -hnoflunf -pvctl,nomsg"
         CFLAGS="-h$float -DCHAR_PTR_IS_ADDRESS"
         FFLAGS="-$float"
         LIB_LIST="$LIB_LIST -li77sx"
#
         if test -z "$USERCLINKER" ; then
            CLINKER="cc -h$float"; fi
         if test -z "$USERCCLINKER" ; then
            CCLINKER="CC -h$float"; fi
         if test -z "$USERFLINKER" ; then
            FLINKER="f77 -$float $LDFLAGS"; fi
#
         if test "$w8" = "ew" ; then
            FLINKER="$FLINKER -ew $LDFLAGS"
            CFLAGS="$CFLAGS -D_W8"
            FFLAGS="$FFLAGS -ew"
         fi
#
         if test "$sx4int" = "int64" ; then
            CFLAGS="$CFLAGS -hint64"
            CLINKER="$CLINKER -hint64 $LDFLAGS"
            FLINKER="$FLINKER -Wl'-int64' $LDFLAGS"
         fi
#
         CCFLAGS="$CFLAGS"
    ;;
#
   hpux) 
    # This may eliminate the need for +U77 ....
    if test "`which $F77`" != "/usr/convex/bin/fc" ; then 
        F77GETARG="call igetarg(i,s,len(s))"
	# mgates reports that the +T option makes MPICH work on some HPUX
	# platforms.  The documentation for +T is truely scary; it seems
	# to imply that without it, a Fortran program will NOT run correctly.
        # The hpux F90 compiler doesn't accept +T.  Since we currently set
	# F90FLAGS to FFLAGS by default, 
        if test -z "$USER_SET_F90FLAGS" -a -z "$F90FLAGS" ; then
	    F90FLAGS="$FFLAGS"
	    USER_SET_F90FLAGS=1
	fi
	FFLAGS="$FFLAGS +T"
    else
        # The Convex compiler needs to have optimization messages suppressed
        FFLAGS="$FFLAGS -or none"
    fi
    # There are reports that version 10 Fortran requires +U77
    ;;
    convex_spp)  F77="/usr/convex/bin/fc" ;;
    ibmpoe)
         	 	 F77=mpxlf
	 TESTF77=xlf
	 	          if test -z "$F90" ; then 
	     F90="mpxlf -qlanglvl=90ext -qfree=f90"
         fi
	 if test -z "$TESTF90" ; then
   	     TESTF90=xlf90
         fi
    ;;
    meiko) 
      for p in f77 apf77 pgf77
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$FCval"; then
  ac_pg_FCval="$FCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_FCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_FCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;FCval="$ac_pg_FCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($FCval)"
else
echo "$ac_t""found $ac_prog_where ($FCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

      if test -n "$FCval" -a "$FCval" = f77 ; then
	F77="f77 -g -cg92"
      else
        F77="$FCval"
      fi
      ;;
    ncube)   F77=nf77 ;;
    rs6000)  F77=xlf ;;
    LINUX|linux) 
      for p in f77 fort77 g77 pgf77 f95 f90 pgf90
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$FCval"; then
  ac_pg_FCval="$FCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_FCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_FCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;FCval="$ac_pg_FCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($FCval)"
else
echo "$ac_t""found $ac_prog_where ($FCval)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

      if test "$FCval" != "$F77" -a "$USERF77" != 1 ; then 
  	  F77="$FCval"
      fi
      # For pgf77, some people use fflags="-tp p6 -Msignextend"
      ;;
    *)
      # Fujitsu Fortran is frt
      # We must use an FCval (undefined variable) to ensure
      # that we make the tests.  Also, fall back on f90 or f95 
      for p in f77 g77 fort77 frt pgf77 f95 f90
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$FCval"; then
  ac_pg_FCval="$FCval" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_FCval="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_FCval="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;FCval="$ac_pg_FCval"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($FCval)"
else
echo "$ac_t""found $ac_prog_where ($FCval)" 1>&1
fi
   F77FULL=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

      if test "$FCval" != "$F77" -a "$USERF77" != 1 ; then 
  	  F77="$FCval"
      fi
      ;;
esac
fi
if test -z "$F77" -a -n "$F90" ; then
    # If no Fortran 77 compiler has been selected but there is a Fortran 90
    # compiler, choose that.
    F77="$F90"
fi

if test -z "$USERFLINKER" -a -z "$FLINKER" ; then
    FLINKER="$F77 $LDFLAGS"
fi
#
# Check that the Fortran compiler is actually available:
HAS_F77=
if test -n "$F77" ; then
    if test -z "$F77FULL" ; then
        # Extract the first word of "$F77", so it can be a program name with args.
set dummy $F77; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$HAS_F77"; then
  ac_pg_HAS_F77="$HAS_F77" # Let the user override the test.
else
  ac_first_char=`expr "$F77" : "\(.\)"`
  # Use ac_word instead of $F77 in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_HAS_F77="1"
       ac_prog_where=$F77
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_HAS_F77="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_HAS_F77" && ac_pg_HAS_F77="0"
fi;HAS_F77="$ac_pg_HAS_F77"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($HAS_F77)"
else
echo "$ac_t""found $ac_prog_where ($HAS_F77)" 1>&1
fi
   F77FULL=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

    else
	if test -x $F77FULL ; then
	    HAS_F77=1
	fi
    fi
    # if test -n "$F77FULL" ; then
	# Really should replace with full path....
        # but would need to capture arguments as well...
	    # fi
else
    HAS_F77=0
fi
pac_msg=`$F77 -V 2>&1 | grep Itanium`
if test "$F77" = "efc" -o -n "$pac_msg" ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking if -i_dynamic is required for Itanium Fortran compiler""... $ac_c"
else
echo $ac_n "checking if -i_dynamic is required for Itanium Fortran compiler""... $ac_c" 1>&1
fi
    pac_result=no
    cat > conftest.f <<EOF
        program main
        end
EOF
    pac_msg=`$FLINKER -o conftest conftest.f 2>&1 | grep 'bfd assertion fail'`
    if test -n "$pac_msg" ; then
        pac_msg=`$FLINKER -o conftest conftest.f -i_dynamic 2>&1 | grep 'bfd assertion fail'`
	if test -x conftest -a -z "$pac_msg" ; then 
	    pac_result=yes
	    FLINKER="$FLINKER -i_dynamic"
        fi
    fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$pac_result"
else
echo "$ac_t""$pac_result" 1>&1
fi
    rm -f conftest*
fi

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
#

if test -z "$USERAR" ; then
case $CARCH in 
   intelnx|paragon|i860) AR="ar860 crl" ; ARNAME="ar860" ; ARARGS="crl" ;;
   cm5) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr"
   ;;
   meiko|solaris) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr" 
   ;;
   ncube) AR="nar cr" ; ARNAME="nar" ; ARARGS="cr" ;;
   *)
   for p in ar
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$ARNAME"; then
  ac_pg_ARNAME="$ARNAME" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_ARNAME="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_ARNAME="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;ARNAME="$ac_pg_ARNAME"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($ARNAME)"
else
echo "$ac_t""found $ac_prog_where ($ARNAME)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

esac
fi
if test -z "$ARNAME" ; then
    ARNAME="ar"
fi
if test -z "$AR" ; then 
    AR="$ARNAME cr$ARLOCAL" ; ARARGS="cr$ARLOCAL" 
fi


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

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

int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  compile_check=yes

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

fi
rm -f conftest*

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

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

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

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

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

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

#
# Check to see if compiler has old_style CPP concat

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

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

#define concat(a,b) a##b
int main() { exit(0); }
int t() { int concat(a,b);return ab; }
EOF
if eval $compile; then
  
  
  eval "ac_cv_ccworks=yes"

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

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

fi

#
# Check to see if it accepts const
HAVE_NO_C_CONST=0


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

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

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

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

HAVE_NO_C_CONST=1
ROMIO_CFLAGS="$ROMIO_CFLAGS -DHAVE_NO_C_CONST"
fi


# Panic check to see if we have any compiler at all
if test -z "$CC" ; then
    print_error "Could not find a C compiler!"
    exit 1
fi
# 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.
echo checking how to run the C preprocessor
if test -z "$CPP"; then
  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  # make.  It must be expanded now.
  CPP="${CC-cc} -E"
  cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
test ".${verbose}" != "." && echo "	setting CPP to $CPP"


# Check for Unix Variants
echo checking for AIX
cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

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


fi
rm -f conftest*


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

fi
rm -f conftest*

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

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

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

fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for volatile""... $ac_c"
else
echo $ac_n "checking for volatile""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
volatile int a;
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  
  
{
test -n "$verbose" && \
echo "	defining HAS_VOLATILE"
echo "#define" HAS_VOLATILE 1 >> confdefs.h
DEFS="$DEFS -DHAS_VOLATILE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAS_VOLATILE\${SEDdB}HAS_VOLATILE\${SEDdC}1\${SEDdD}
\${SEDuA}HAS_VOLATILE\${SEDuB}HAS_VOLATILE\${SEDuC}1\${SEDuD}
\${SEDeA}HAS_VOLATILE\${SEDeB}HAS_VOLATILE\${SEDeC}1\${SEDeD}
"
}
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi

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



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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -fPIC""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -fPIC""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-fPIC $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled  without -fPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled  without -fPIC""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     CC_SHARED_OPT=-fPIC;SHAREDKIND="gcc"
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -fPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -fPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -fPIC to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -fPIC to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -KPIC""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -KPIC""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-KPIC $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     CC_SHARED_OPT=-KPIC
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -KPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -KPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -KPIC to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -KPIC to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -KPIC""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -KPIC""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-KPIC $CFLAGS"
rm -f conftest.out
echo 'int try(void);int try(void){return 0;}' > conftest2.c
echo 'int main(void);int main(void){return 0;}' > conftest.c
if ${CC-cc} $CFLAGSSAV -o conftest conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
   if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS >conftest.out 2>&1 ; then
      if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
         if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled  without -KPIC""... $ac_c" 1>&1
fi       
         /bin/rm -f conftest.out
         /bin/rm -f conftest.bas
         if ${CC-cc} -c $CFLAGSSAV conftest2.c >conftest2.out 2>&1 ; then
            if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.bas 2>&1 ; then
               if ${CC-cc} $CFLAGS -o conftest conftest2.o conftest.c $LDFLAGS >conftest.out 2>&1 ; then
                  if diff -b conftest.out conftest.bas >/dev/null 2>&1 ; then
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi	  
                     CC_SHARED_OPT=+Z
                  elif test -s conftest.out ; then
	             cat conftest.out >> config.log
	             if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -KPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  else
                     if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                     print_error "Will not add -KPIC to CFLAGS"
                     CFLAGS="$CFLAGSSAV"
	             
                  fi  
               else
	          if test -s conftest.out ; then
	             cat conftest.out >> config.log
	          fi
                  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
                  print_error "Will not add -KPIC to CFLAGS"
                  CFLAGS="$CFLAGSSAV"
                  
               fi
	    else
               # Could not link with the option!
               if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            fi
         else
            if test -s conftest2.out ; then
               cat conftest.out >> config.log
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
            print_error "Will not add -KPIC to CFLAGS"
            CFLAGS="$CFLAGSSAV"
	    
         fi
      else
         cat conftest.out >> config.log
         if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
         
         CFLAGS="$CFLAGSSAV"         
      fi
   else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
      if test -s conftest.out ; then cat conftest.out >> config.log ; fi    
      CFLAGS="$CFLAGSSAV"
   fi
else
    # Could not compile without the option!
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that Fortran compiler accepts option -PIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -PIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-PIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f $LDFLAGS > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f $LDFLAGS > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
            if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -PIC can be linked with ones compiled without -PIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -PIC can be linked with ones compiled without -PIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f $LDFLAGS >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-PIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> config.log
                        
	            fi
                else
                    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> config.log
                    
                fi
            else
                 if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> config.log
                 
            fi
       else
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that Fortran compiler accepts option -fPIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -fPIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-fPIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f $LDFLAGS > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f $LDFLAGS > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
            if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled without -fPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -fPIC can be linked with ones compiled without -fPIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f $LDFLAGS >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-fPIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> config.log
                        
	            fi
                else
                    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> config.log
                    
                fi
            else
                 if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> config.log
                 
            fi
       else
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that Fortran compiler accepts option -KPIC""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option -KPIC""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="-KPIC $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f $LDFLAGS > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f $LDFLAGS > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
            if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled without -KPIC""... $ac_c"
else
echo $ac_n "checking that routines compiled with -KPIC can be linked with ones compiled without -KPIC""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f $LDFLAGS >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			FC_SHARED_OPT=-KPIC
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> config.log
                        
	            fi
                else
                    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> config.log
                    
                fi
            else
                 if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> config.log
                 
            fi
       else
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for argument used to indicate shared lib search dir""... $ac_c"
else
echo $ac_n "checking for argument used to indicate shared lib search dir""... $ac_c" 1>&1
fi
    SHARED_LIB_SEARCH_PATH_LEADER="`${top_srcdir}/util/makesharedlib -kind=$SHAREDKIND -getpathspec`"
    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$SHARED_LIB_SEARCH_PATH_LEADER"
else
echo "$ac_t""$SHARED_LIB_SEARCH_PATH_LEADER" 1>&1
fi
    SHARED_LIB_SEARCH_PATH="${SHARED_LIB_SEARCH_PATH_LEADER}`pwd`"
    
    if test -z "$SHARED_LIB_UTIL" ; then
	echo "Error in configure; SHARED_LIB_UTIL not set"
	exit 1
    fi
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that shared libraries can be built""... $ac_c"
else
echo $ac_n "checking that shared libraries can be built""... $ac_c" 1>&1
fi
    rm -f conftest* libconftest*
    cat >conftest.c <<EOF
int foo(int a);
int foo(int a) {return a+1;}
EOF
    cat >conftest1.c <<EOF
int main(void);
int foo(int);
int main(void){ return foo(-1); }
EOF
    if ${CC-cc} $CFLAGS $CC_SHARED_OPT -c conftest.c >conftest.out 2>&1 ; then
	if $SHARED_LIB_UTIL -obj=conftest.o -lib=libconftest.a >conftest.out 2>&1 ; then
	    :
	else
	    echo "Failed to build shared library" >> config.log
	    cat conftest.out >>config.log
	    # The next statement will fail because there is no library,
	    # which is ok because it does so relatively silently.
	    rm -f conftest.out
	    echo "Steps taken to build the shared library:" >>config.log
	    $SHARED_LIB_UTIL -echo -obj=conftest.o -lib=libconftest.a >>config.log 2>&1 
	fi
	if ${CC-cc} $CFLAGS -o conftest conftest1.c $SHARED_LIB_PATH \
		$SHARED_LIB_SEARCH_PATH -lconftest >conftest.out 2>&1 ; then
	   
	   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that programs remember where the shared lib is""... $ac_c"
else
echo $ac_n "checking that programs remember where the shared lib is""... $ac_c" 1>&1
fi
           mkdir .tmp
           cp conftest .tmp
	   cd .tmp 
	      if ./conftest >conftest.out 2>&1 ; then
		  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	      else
		  echo "Could not run program built with shared libs" >>../config.log
		  if test -s conftest.out ; then 
			echo "Error message was" >> ../config.log
			cat conftest.out >>../config.log
		  fi
		  # Try with LD_LIBRARY_PATH
		  saveLD="$LD_LIBRARY_PATH"
		  if test -z "$LD_LIBRARY_PATH" ; then LD_LIBRARY_PATH="." ; fi
	          LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:`pwd`/.."
		  export LD_LIBRARY_PATH
		  rm -f conftest.out
		  if ./conftest >conftest.out 2>&1 ; then
		      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no: needs path in LD_LIBRARY_PATH!"
else
echo "$ac_t""no: needs path in LD_LIBRARY_PATH!" 1>&1
fi
		      SHARED_LIB_NEEDS_PATH="yes"
		  else
		      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no: LD_LIBRARY_PATH does not work!"
else
echo "$ac_t""no: LD_LIBRARY_PATH does not work!" 1>&1
fi
		      if test -s conftest.out ; then
			echo "Error messages when running program build with shared libs" >> ../config.log
			cat conftest.out >>../config.log
		      fi
		  fi
		  LD_LIBRARY_PATH="$saveLD"
	      fi
           cd ..
	   rm -rf .tmp
	else
           SHAREDKIND=ignore
	   if test -s conftest.out ; then cat conftest.out >> config.log ; fi
	   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	fi
    else
        SHAREDKIND=ignore
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    fi
rm -f conftest* libconftest*

    # Note that configure uses CFLAGS for compiling and linking !
    # Add the shared option only if we're building shared libraries
    # (the shared option is also needed when building the totalview
    # dynamically loadable queue library).
    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"
    
fi






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

    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)

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

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


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

fi
rm -f conftest*
done

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that shared, anonymous mmap works with -1 filedes""... $ac_c"
else
echo $ac_n "checking that shared, anonymous mmap works with -1 filedes""... $ac_c" 1>&1
fi


if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
int main(){
int memsize;
caddr_t shmptr;
memsize = getpagesize();
shmptr = mmap((caddr_t) 0, memsize, 
PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_SHARED
#ifdef MAP_ANON
|MAP_ANON
#endif
,-1, (off_t) 0);
if (shmptr == (caddr_t) -1) {
 return 1;}
return 0;
}

EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    ac_cv_mmap=0

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

      else
        ac_cv_mmap=0

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

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

fi


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that semget works""... $ac_c"
else
echo $ac_n "checking that semget works""... $ac_c" 1>&1
fi
###
### Still need to check for SEMUN_UNDEFINED - see mpid/ch_p4/p4/configure.in
### 
cat > conftest.c <<EOF
#include <sys/types.h>
#include <sys/ipc.h>
#include <errno.h>
#include <sys/sem.h>
int main () {
#ifdef NEEDS_UNION_SEMUN
#if defined(SEMUN_UNDEFINED)    
union semun { int val } arg;
#else
union semun arg;
arg.val = 0;
#endif
#else
int arg = 0;
#endif
key_t key;
int semset_id;
key=ftok(".", 'a');
errno=0;
if ((semset_id=semget(key,10,IPC_CREAT|IPC_EXCL|0666)) == -1) 
printf("%d\n", errno);
else {
printf("%d\n", errno);
semctl(semset_id,0,IPC_RMID,arg); }
return 0; 
}
EOF
echo "${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS $LIBS" >> config.log
if ${CC-cc} $CFLAGS -o conftest conftest.c $LDFLAGS $LIBS >> config.log 2>&1 ; then
    if test -x conftest ; then
	/bin/rm -f conftest.out
	./conftest > conftest.out
	errno=`cat conftest.out`

	# these values are specific to a particular unix.
        # we need to convert number to ERRNO based on the local 
        # system, and then match, if we can
	if test $errno -eq 0 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    SEMGET=1
	elif test $errno -eq 13 ; then  
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    SEMGET=0
            print_error "No access permission rights to the semaphore set"
	    print_error "created with this key!"
            print_error "Configure could have chosen to create a"
            print_error "semaphore set using an unacceptable key value"
        elif test $errno -eq 17 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    SEMGET=0
	    print_error "The semaphore set created with this key"
	    print_error "already exists!"
	    print_error "Try running util/cleanipcs and then reconfiguring"
	    print_error "This may or may not help."
	elif test $errno -eq 43 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    SEMGET=0
	    print_error "The semaphore set created with this key"
	    print_error "is marked to be deleted!"
	    print_error "Try running util/cleanipcs and then"
	    print_error "reconfiguring.  This may or may not help."
	elif test $errno -eq 2 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    SEMGET=0
	    print_error "No semaphore set exists for this key!"
	    print_error "Configure could have chosen to create a" 
	    print_error "semaphore set using an unacceptable key value."
	elif test $errno -eq 12 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
	    SEMGET=0
	    print_error "Not enough memory to create a semaphore set!"
	    print_error "Try running util/cleanipcs and then" 
	    print_error "reconfiguring.  This may or may not help."
	elif test $errno -eq 28 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    SEMGET=0
	    print_error "The system limit for the maximum number of"
	    print_error "semaphore sets (SEMMNI), or the system wide"
            print_error "maximum number of semaphores (SEMMNS)"
	    print_error "has been reached."
        fi
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
        SEMGET=0
	print_error "Could not build executable"
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""undetermined"
else
echo "$ac_t""undetermined" 1>&1
fi
    SEMGET=0
    print_error "Could not compile program"
fi
/bin/rm -f conftest*


    if test $MMAP = 0 -a "$SEMGET" = 0; then
        print_error "Configure detected that both anonymous mmap and semget fail."
        print_error "Configuring MPICH for shared memory may cause problems!"
    fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that Fortran compiler accepts option $P4_MDEPFFLAGS""... $ac_c"
else
echo $ac_n "checking that Fortran compiler accepts option $P4_MDEPFFLAGS""... $ac_c" 1>&1
fi
FFLAGSSAV="$FFLAGS"
FFLAGS="$P4_MDEPFFLAGS $FFLAGS"
cat >conftest.f <<EOF
        program main
        end
EOF
cat >conftest3.f <<EOF
       subroutine try( )
       return
       end
EOF
/bin/rm -f conftest1.out conftest2.out
/bin/rm -f conftest3.out
if $F77 $FFLAGS -o conftest conftest.f $LDFLAGS > conftest1.out 2>&1 ; then
    if $F77 $FFLAGSSAV -o conftest conftest.f $LDFLAGS > conftest2.out 2>&1 ; then
        if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
            if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
            if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that routines compiled with $P4_MDEPFFLAGS can be linked with ones compiled without $P4_MDEPFFLAGS""... $ac_c"
else
echo $ac_n "checking that routines compiled with $P4_MDEPFFLAGS can be linked with ones compiled without $P4_MDEPFFLAGS""... $ac_c" 1>&1
fi
            /bin/rm -f conftest1.out 
            if $F77 -c $FFLAGSSAVE conftest3.f >conftest3.out 2>&1 ;then
                if $F77 $FFLAGS -o conftest conftest3.o conftest.f $LDFLAGS >conftest1.out 2>&1 ; then
                    if diff conftest2.out conftest1.out > /dev/null 2>&1 ; then
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi  
			addflags=1
	            else
                        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
			FFLAGS="$FFLAGSSAV"
                        cat conftest1.out >> config.log
                        
	            fi
                else
                    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
		    FFLAGS="$FFLAGSSAV"
                    cat conftest1.out >> config.log
                    
                fi
            else
                 if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	         FFLAGS="$FFLAGSSAV"
                 cat conftest3.out >> config.log
                 
            fi
       else
           if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	   FFLAGS="$FFLAGSSAV"
	   
       fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        FFLAGS="$FFLAGSSAV"
	
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    FFLAGS="$FFLAGSSAV"
    
fi
rm -f conftest*


	    if test $addflags = 1 ; then 
                FFLAGS="$FFLAGS $P4_MDEPFFLAGS"
	    fi
        fi
        # Warning flags are > 1000
#       CFLAGS="$CFLAGS -woff 1152,1174,1184"
#       1184 not in the p4 list
        if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 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"
   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
   # If tested code does NOT compile, then define _TWO_WORD_FCD
   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

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

fi
rm -f conftest*

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

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

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

fi
rm -f conftest*

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

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

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

fi

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

#
# 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
        # Suggested values for these are
    #CFLAGS=-O
        FLINKER=frt
    FLIBS="$FLIB_PATH $LIB_LIST"
fi
if test -n "$arch_uxpv" ; then
    # This asserts that Fortran passes functions by passing the address of the
    # pointer to the function.
    # We really need a TEST for this
        # Suggested values for these are
    #CFLAGS=-O
    # Thanks to Winfrid Tschiedel <Winfrid.Tschiedel@mch.sni.de> for
    # this information
        FLINKER="frt  -sc -Wl,-dy" # it works already and it is close the final solution
    # This isn't quite correct, but at least this is a place to put this 
    # information.
    FLIBS="$FLIB_PATH $LIB_LIST"
fi
#
# Not all versions of gcc support -munalign-doubles!
#if test -n "$arch_sun4" -o -n "$arch_solaris" ; then
#    if test "$CC" = "gcc" -a "$NOF77" = 0 ; then
#        CC="$CC -munaliged-doubles"
#    fi
#fi

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

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

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

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

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

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

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


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

fi
rm -f conftest*
done

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

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

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

fi
rm -f conftest*

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

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

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

fi
rm -f conftest*

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

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

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

fi
rm -f conftest*

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

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

    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: Posix timers not correctly implemented"
else
echo "$ac_t""Warning: Posix timers not correctly implemented" 1>&1
fi
    fi
fi

#
# Some devices use gettimeofday.  If this is one of them, check to see 
# what form it is

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for how many arguments gettimeofday takes""... $ac_c"
else
echo $ac_n "checking for how many arguments gettimeofday takes""... $ac_c" 1>&1
fi
# Test sets "wierd" only for FAILURE to accept 2


if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/time.h>
main() {struct timeval tp;
gettimeofday(&tp,(void*)0);return 0;}
EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""one!"
else
echo "$ac_t""one!" 1>&1
fi
DEVCFLAGS="$DEVCFLAGS -DUSE_WIERDGETTIMEOFDAY"

    else
      /bin/rm -f conftestout
      if test -s conftest && (./conftest; exit) 2>conftestout; then
          if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""two - whew"
else
echo "$ac_t""two - whew" 1>&1
fi


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

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



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

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

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

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

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

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


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

fi
rm -f conftest*
done

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

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

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

fi
rm -f conftest*

#
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
HAS_WEAK_SYMBOLS=0

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for weak symbol support""... $ac_c"
else
echo $ac_n "checking for weak symbol support""... $ac_c" 1>&1
fi
  
if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that weak symbols are visible to other files""... $ac_c"
else
echo $ac_n "checking that weak symbols are visible to other files""... $ac_c" 1>&1
fi
    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
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    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
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      has_pragma_weak=0
    fi
    rm -f conftest*
fi
#
  if test "$has_pragma_weak" = 1 ; then
        HAS_WEAK_SYMBOLS=1
    
{
test -n "$verbose" && \
echo "	defining HAVE_PRAGMA_WEAK"
echo "#define" HAVE_PRAGMA_WEAK 1 >> confdefs.h
DEFS="$DEFS -DHAVE_PRAGMA_WEAK=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PRAGMA_WEAK\${SEDdB}HAVE_PRAGMA_WEAK\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PRAGMA_WEAK\${SEDuB}HAVE_PRAGMA_WEAK\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PRAGMA_WEAK\${SEDeB}HAVE_PRAGMA_WEAK\${SEDeC}1\${SEDeD}
"
}

  else
    
if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

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

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

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

    else
        
if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"

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

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

        if test "$has_pragma_cri_duplicate" = 1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""pragma _CRI duplicate x as y"
else
echo "$ac_t""pragma _CRI duplicate x as y" 1>&1
fi
	    HAS_WEAK_SYMBOLS=1
	    
{
test -n "$verbose" && \
echo "	defining HAVE_PRAGMA_CRI_DUP"
echo "#define" HAVE_PRAGMA_CRI_DUP 1 >> confdefs.h
DEFS="$DEFS -DHAVE_PRAGMA_CRI_DUP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PRAGMA_CRI_DUP\${SEDdB}HAVE_PRAGMA_CRI_DUP\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PRAGMA_CRI_DUP\${SEDuB}HAVE_PRAGMA_CRI_DUP\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PRAGMA_CRI_DUP\${SEDeB}HAVE_PRAGMA_CRI_DUP\${SEDeC}1\${SEDeD}
"
}

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

    MPI_WITH_PMPI="yes"
else
    MPI_WITH_PMPI="no"
fi

#
#
# 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
    for p in remsh rsh ssh
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$RSHCOMMAND"; then
  ac_pg_RSHCOMMAND="$RSHCOMMAND" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_RSHCOMMAND="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_RSHCOMMAND="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;RSHCOMMAND="$ac_pg_RSHCOMMAND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($RSHCOMMAND)"
else
echo "$ac_t""found $ac_prog_where ($RSHCOMMAND)" 1>&1
fi
  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

    # should check that it works
    rshcommand="$RSHCOMMAND"
fi
#
# Check for perl and perl version
for p in perl5 perl
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$PERL"; then
  ac_pg_PERL="$PERL" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  # Use ac_word instead of $p in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_PERL="$p"
       ac_prog_where=$p
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_PERL="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;PERL="$ac_pg_PERL"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($PERL)"
else
echo "$ac_t""found $ac_prog_where ($PERL)" 1>&1
fi
   PERLFULLPATH=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

if test -n "$PERL" ; then
    PERL="$PERLFULLPATH"
    
    perlversion=`$PERL -e 'print substr($],0,1)."\n";' </dev/null`
    
    # 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
    
fi
#
# Check for Fortran
if test $HAS_F77 = 0 -a "$NOF77" = 0 ; then   
    NOF77=1
    HAS_FORTRAN=0
    
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

    fi

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

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


if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    
    Pac_CV_NAME=0
else
    if test -n "$TESTCC" ; then
      CCsav="$CC"
      CC="$TESTCC"
    fi
    cat > conftest.c <<EOF
#include "confdefs.h"
main () {
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
EOF
        if test -n "$compile" ; then 	
	eval $compile
    else
	eval $ac_compile
	eval $ac_link
    fi
    if test ! -s conftest ; then
        echo "Could not build executable program:" >>config.log
        if test -n "$compile" ; then
	    # Autoconf defined a compile command with all output to dev null
	    # For the configure log, rerun without the redirection
	    compiletmp='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >>config.log 2>&1'
	    echo $compiletmp >>config.log
	    eval $compiletmp 
	    echo "Return status was $?" >>config.log
        else
	    echo $ac_compile >>config.log
   	    eval $ac_compile >>config.log 2>&1
	    echo $ac_link >>config.log
	    eval $ac_link >>config.log 2>&1
        fi
	echo "Test program was" >> config.log
	cat conftest.c >> config.log
    pac_r=1

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

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

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

fi

#
# Check for xdr available and properly installed (our FreeBSD machines
# have incorrect xdr header files, for examples).  Currently, we just
# set a dummy function body and see if rpc/xdr.h is available and
# can be included.
#
# Just to complicate things, some systems have "xdr.h" that is complete
# and can be used by itself; more frequently, xdr.h does NOT include
# definitions that it requires!  rpc.h seems to be more reliable.
#
if test "$IS_HETERO" = 1 ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

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

fi
rm -f conftest*

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

    else 
        print_error  "XDR not available on this system" 
    fi
fi
# Check for the functions that may be needed by the ADI to implement
# Processor_name.  Save these defines in a special place.
SAVEDEFS="$DEFS"
DEFS=""
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

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

fi
rm -f conftest*

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

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

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

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

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

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

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

fi
rm -f conftest*

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for gethostbyname in libnsl""... $ac_c"
else
echo $ac_n "checking for gethostbyname in libnsl""... $ac_c" 1>&1
fi
	if ${CPP_COMPILER} -o conftest conftest.C -lnsl >>config.log 2>&1 ; then
	    CPP_EXTRA_LIBS="$CPP_EXTRA_LIBS -lnsl"
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	fi
   fi
   rm -f conftest*
fi

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

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

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
  have_lib="1"

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

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lnsl";havelibnsl=1
else
   :; 
fi

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

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

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

fi
rm -f conftest*

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

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


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

fi
rm -f conftest*
done

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

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

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

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

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

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

if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
#ifdef __cplusplus
extern "C" { char getdomainname(); };
#else
char getdomainname();
#endif
int main() { return 0; }
int t() {
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_getdomainname) || defined (__stub___getdomainname)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
getdomainname();
#endif

; return 0; }
EOF
rm -f conftest.out
if test -z "$ac_link" ; then
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >conftest.out 2>&1'
fi
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_getdomainname=yes"
else
  echo "$ac_link" >>config.log
  echo "Failed program was" >>config.log
  cat conftest.$ac_ext >>config.log
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
rm -rf conftest*
  eval "ac_cv_func_getdomainname=no"
fi
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'getdomainname`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  has_getdomainname=1
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
has_getdomainname=0
fi

    if test $has_getdomainname = 1 -a \
       \( "$cross_compiling" = 0 -o -z "$cross_compiling" \) ; then
        # Extract the first word of "domainname", so it can be a program name with args.
set dummy domainname; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_domainname"; then
  ac_pg_has_domainname="$has_domainname" # Let the user override the test.
else
  ac_first_char=`expr "domainname" : "\(.\)"`
  # Use ac_word instead of domainname in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_has_domainname="1"
       ac_prog_where=domainname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_domainname="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_domainname" && ac_pg_has_domainname="0"
fi;has_domainname="$ac_pg_has_domainname"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_domainname)"
else
echo "$ac_t""found $ac_prog_where ($has_domainname)" 1>&1
fi
   d_domainname=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_hostname"; then
  ac_pg_has_hostname="$has_hostname" # Let the user override the test.
else
  ac_first_char=`expr "hostname" : "\(.\)"`
  # Use ac_word instead of hostname in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_has_hostname="1"
       ac_prog_where=hostname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_hostname="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_hostname" && ac_pg_has_hostname="0"
fi;has_hostname="$ac_pg_has_hostname"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_hostname)"
else
echo "$ac_t""found $ac_prog_where ($has_hostname)" 1>&1
fi
   d_hostname=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_rup"; then
  ac_pg_has_rup="$has_rup" # Let the user override the test.
else
  ac_first_char=`expr "rup" : "\(.\)"`
  # Use ac_word instead of rup in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_has_rup="1"
       ac_prog_where=rup
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_rup="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_rup" && ac_pg_has_rup="0"
fi;has_rup="$ac_pg_has_rup"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_rup)"
else
echo "$ac_t""found $ac_prog_where ($has_rup)" 1>&1
fi
   d_rup=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

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

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

	    fi
        fi
    fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# 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"
    
fort_works=no
cxx_works=no
rm -f conftest*
cat >> conftest1.c <<EOF
#include "confdefs.h"
void f()
{
EOF
for func in $testfuncs ; do
    echo "$func();" >>conftest1.c
done
echo '}' >>conftest1.c
if ${CC-cc} -c $CFLAGS conftest1.c >>config.log 2>&1 ; then
    if test -n "$F77" ; then
	if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that Fortran programs can link with needed C functions""... $ac_c"
else
echo $ac_n "checking that Fortran programs can link with needed C functions""... $ac_c" 1>&1
fi
        cat > conftest.f <<EOF
        program main
        end
EOF
        if test -z "$FLINKER" ; then FLINKER="$F77 $LDFLAGS" ; fi
	if $FLINKER -o conftest conftest.f conftest1.o $LIBS $F77_LIBS >>config.log 2>&1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    fort_works=yes
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    fort_works=no
	    echo "$FLINKER -o conftest conftest.f conftest1.o $LIBS $F77_LIBS" >>config.log
	    echo "Error linking" >>config.log
	    cat conftest.f >>config.log
	fi
	rm -f conftest.f conftest conftest.o
    fi
    if test -n "$CCC" -a -z "$CXX" ; then CXX="$CCC" ; fi
    if test -z "$CXX" -a -n "$CPP_COMPILER" ; then CXX="$CPP_COMPILER" ; fi
    if test -n "$CXX" ; then
	if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C++ programs can link with needed C functions""... $ac_c"
else
echo $ac_n "checking that C++ programs can link with needed C functions""... $ac_c" 1>&1
fi
	cat > conftest.cc <<EOF
	int main() { return 0; }
EOF
	if $CXX -o conftest conftest.cc conftest1.o $LDFLAGS $LIBS $CXX_LIBS >>config.log 2>&1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    cxx_works=yes
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cxx_works=no
	    echo "$CXX -o conftest conftest.cc conftest1.o $LDFLAGS $LIBS $CXX_LIBS" >>config.log 
	    echo "Error linking" >>config.log
	    cat conftest.cc >>config.log
	fi
    fi
else
    echo "Could not compile " >> config.log
    cat conftest.c >>config.log
fi
rm -f conftest*

    LIBS="$save_LIBS"
    CXX_LIBS="$save_CXX_LIBS"
    F77_LIBS="$save_F77_LIBS"
    if test "$NOF77" = 0 -a "$fort_works" = "no" ; then
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: Fortran programs cannot be linked with the C libraries
Fortran support being turned off"
else
echo "$ac_t""Warning: Fortran programs cannot be linked with the C libraries
Fortran support being turned off" 1>&1
fi
        NOF77=1
        HAS_FORTRAN=0
        
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

    fi
    if test -z "$NOCXX" -a "$cxx_works" = "no" ; then
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: C++ programs cannot be linked with the C libraries
C++ support being turned off"
else
echo "$ac_t""Warning: C++ programs cannot be linked with the C libraries
C++ support being turned off" 1>&1
fi
        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.
for func in catopen catclose catgets
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

fi
rm -f conftest*
done

# 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
 # Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$has_gencat"; then
  ac_pg_has_gencat="$has_gencat" # Let the user override the test.
else
  ac_first_char=`expr "gencat" : "\(.\)"`
  # Use ac_word instead of gencat in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_has_gencat="1"
       ac_prog_where=gencat
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_has_gencat="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
  test -z "$ac_pg_has_gencat" && ac_pg_has_gencat="0"
fi;has_gencat="$ac_pg_has_gencat"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($has_gencat)"
else
echo "$ac_t""found $ac_prog_where ($has_gencat)" 1>&1
fi
   d_gencat=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

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

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

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

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

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

    # Why separate NLS_DEFS?
    NLS_DEFS="$DEFS"
    # Having a separate message catalog directory allows unification 
    # of message catalogs.
    messagecat_dir=${messagecat_dir:-'${libdir}'}
    
 fi
fi

DEFS="$SAVEDEFS"

echo checking for ANSI C header files
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
echo '#include "confdefs.h"
#include <string.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "memchr" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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


fi
rm -fr conftest*

fi
rm -f conftest*


fi
rm -f conftest*


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

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

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

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

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

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

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

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

newflag=""

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

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

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

else
  expandcompile=`echo "$compile" | sed -e 's/>.*//'`
  eval echo "configure:$expandcompile" >> config.log
  echo "configure: failed program was:" >>config.log
  cat confdefs.h >> config.log
  cat conftest.c >> config.log
  if test -s conftest.out ; then cat conftest.out >> config.log 
  else
      ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1
  fi
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
{
test -n "$verbose" && \
echo "	defining HAVE_STDARG_H"
echo "#define" HAVE_STDARG_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_STDARG_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STDARG_H\${SEDdB}HAVE_STDARG_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_STDARG_H\${SEDuB}HAVE_STDARG_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_STDARG_H\${SEDeB}HAVE_STDARG_H\${SEDeC}1\${SEDeD}
"
}

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

#
# It isn't enough to check for stdarg.  Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
# 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
#
# This approach fails for compilers that generate noise.  What we need to 
# do is to run a program that makes use of stdarg and see if it works 
# correctly.  We can fall back on this approach when cross-compiling
#
USE_STDARG=0

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that stdarg is oldstyle""... $ac_c"
else
echo $ac_n "checking that stdarg is oldstyle""... $ac_c" 1>&1
fi

check_compile=2
rm -f conftest*
if test -z "$TRY_COMPLILE_CLEAN" ; then
    echo 'int try(void);int try(void){return 0;}' > conftest.c
    if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
	if test -s conftest.bas ; then 
	    TRY_COMPILE_CLEAN_OUT=`cat conftest.bas`
        fi
        TRY_COMPILE_CLEAN=1
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: Could not compile simple test program!"
else
echo "$ac_t""Warning: Could not compile simple test program!" 1>&1
fi
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
    fi
fi
rm -f conftest*
cat >conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
        if test "$TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then
	check_compile=0
    else
        cat conftest.c >>config.log
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
        check_compile=1
    fi
else
        cat conftest.c >>config.log
    if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi
    check_compile=2
fi
rm -f conftest*

pac_old_warning=no
case $check_compile in 
    0)  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
        
{
test -n "$verbose" && \
echo "	defining USE_STDARG"
echo "#define" USE_STDARG 1 >> confdefs.h
DEFS="$DEFS -DUSE_STDARG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_STDARG\${SEDdB}USE_STDARG\${SEDdC}1\${SEDdD}
\${SEDuA}USE_STDARG\${SEDuB}USE_STDARG\${SEDuC}1\${SEDuD}
\${SEDeA}USE_STDARG\${SEDeB}USE_STDARG\${SEDeC}1\${SEDeD}
"
}

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

	newflag="-DUSE_STDARG -DUSE_OLDSTYLE_STDARG"
	USE_STDARG=1
	;;
    1)  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""hmm, warnings from compiler.  Trying newstyle"
else
echo "$ac_t""hmm, warnings from compiler.  Trying newstyle" 1>&1
fi
	pac_old_warning=yes
	;;
    2)  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	;;
esac

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking stdarg is correct""... $ac_c"
else
echo $ac_n "checking stdarg is correct""... $ac_c" 1>&1
fi
    
check_compile=2
rm -f conftest*
if test -z "$TRY_COMPLILE_CLEAN" ; then
    echo 'int try(void);int try(void){return 0;}' > conftest.c
    if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
	if test -s conftest.bas ; then 
	    TRY_COMPILE_CLEAN_OUT=`cat conftest.bas`
        fi
        TRY_COMPILE_CLEAN=1
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Warning: Could not compile simple test program!"
else
echo "$ac_t""Warning: Could not compile simple test program!" 1>&1
fi
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
    fi
fi
rm -f conftest*
cat >conftest.c <<EOF
#include "confdefs.h"

#include <stdio.h>
#include <stdarg.h>

int func( int a, ... ){
int b;
va_list ap;
va_start( ap, a );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if ${CC-cc} $CFLAGS -c conftest.c >conftest.bas 2>&1 ; then
        if test "$TRY_COMPILE_CLEAN_OUT" = "`cat conftest.bas`" ; then
	check_compile=0
    else
        cat conftest.c >>config.log
	if test -s conftest.bas ; then 	cat conftest.bas >> config.log ; fi
        check_compile=1
    fi
else
        cat conftest.c >>config.log
    if test -s conftest.bas ; then cat conftest.bas >> config.log ; fi
    check_compile=2
fi
rm -f conftest*

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether programs using stdarg link""... $ac_c"
else
echo $ac_n "checking whether programs using stdarg link""... $ac_c" 1>&1
fi

if test -z "$ac_ext" ; then 
    ac_ext=c
fi
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <stdarg.h>
int foo( int a, ... )
{
    va_list Argp;
    int     b;
    va_start( Argp, a );
    b = va_arg(Argp,int);
    va_end(Argp);
    return 2*a-b;
}

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

if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$check_link"
else
echo "$ac_t""$check_link" 1>&1
fi
if test $check_link = no ; then
    check_compile=2
fi
case $check_compile in 
    0)  
{
test -n "$verbose" && \
echo "	defining USE_STDARG"
echo "#define" USE_STDARG 1 >> confdefs.h
DEFS="$DEFS -DUSE_STDARG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_STDARG\${SEDdB}USE_STDARG\${SEDdC}1\${SEDdD}
\${SEDuA}USE_STDARG\${SEDuB}USE_STDARG\${SEDuC}1\${SEDuD}
\${SEDeA}USE_STDARG\${SEDeB}USE_STDARG\${SEDeC}1\${SEDeD}
"
}

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

        USE_STDARG=1
	if test $pac_old_warning = "yes" ; then
	    # A Risky move: if both gave warnings, choose old-style
    	    newflag="-DUSE_STDARG -DUSE_OLDSTYLE_STDARG"
	else
	    newflag="-DUSE_STDARG"
        fi
	;;
    2)  
	;;
esac
fi
if test -n "$newflag" ; then
    USER_CFLAGS="$USER_CFLAGS $newflag"
fi
#
# It isn't enough to check for stdarg.  Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
# 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
#


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

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

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

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

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

fi

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

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


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

fi
rm -f conftest*
done

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

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


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

fi
rm -f conftest*
done

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

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


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

fi
rm -f conftest*
done

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

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

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

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

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

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

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

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

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

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

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

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

#
# Turn off F77
# One problem with this is that some part of the ar will fail.  Lets hope
# it isn't fatal. 
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.
#


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

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

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

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that the compiler $F77 runs""... $ac_c"
else
echo $ac_n "checking that the compiler $F77 runs""... $ac_c" 1>&1
fi
cat >conftest.f <<EOF
          program main
          end
EOF
/bin/rm -f conftest.out
$F77 $FFLAGS $OPTFLAGSF -c conftest.f > conftest.out 2>&1
if test $? != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    echo "Fortran compiler returned non-zero return code"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

              F77="echo no Fortran compiler"
       FLINKER="$F77"
elif test ! -s conftest.o ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    echo "Fortran compiler did not produce object file"
    if test -s conftest.out ; then
	echo "Output from test was"
        cat conftest.out
    fi
    NOF77=1;HAS_FORTRAN=0;HAS_F77=0;
       
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

              F77="echo no Fortran compiler"
       FLINKER="$F77"
else    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    :
fi
rm -f conftest* 

    # 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
    

if test -z "$CCBUGS" ; then CCBUGS=ccbugs ; fi
if test ! -d $CCBUGS -a -d ${top_srcdir}/$CCBUGS ; then
    CCBUGS=${top_srcdir}/$CCBUGS
fi
if test -d $CCBUGS ; then 
    # Use "LTESTCC" as "local Test CC"
    if test -z "$TESTCC" ; then LTESTCC="$CC" ; else LTESTCC="$TESTCC" ; fi
    for file in $CCBUGS/ccfail*.c ; do
        CFILE=`basename $file .c`
        if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
        broken=1
        rm -f conftest.out conftest.rout
        if eval $LTESTCC $CFLAGS $OPTFLAGS -o conftest conftest.c $LDFLAGS $LIBS >conftest.out 2>&1 ; then
	    if test -s conftest ; then
                ./conftest 2>&1 1>conftest.rout
                if test $? = 0 ; then
  	            broken=0
                fi
	    fi
        fi
        if test $broken = 1 ; then 
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test -s conftest.out ; then
	        echo "Output from compile step was:"
		cat conftest.out
	    fi
	    if test -s conftest.rout ; then
	        echo "Output from run step was:"
		cat conftest.rout
	    fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
        fi
	/bin/rm -f conftest conftest.c conftest.o conftest.out conftest.rout
    done
    #
    # These are non-fatal, but must be run
    for file in $CCBUGS/ccnfail*.c ; do
        CFILE=`basename $file .c`
        if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
        nbroken=1
	rm -f conftest.out conftest.rout
        if eval $LTESTCC $CFLAGS $OPTFLAGS -o conftest conftest.c $LDFLAGS $LIBS >conftest.out 2>&1 ; then
	    if test -s conftest ; then
                ./conftest 2>&1 1>conftest.rout
                if test $? = 0 ; then
  	            nbroken=0
                fi
	    fi
        fi
        if test $nbroken = 1 ; then 
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test -s conftest.out ; then
	        echo "Output from compile step was:"
		cat conftest.out
	    fi
	    if test -s conftest.rout ; then
	        echo "Output from run step was:"
		cat conftest.rout
	    fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
        fi
	/bin/rm -f conftest conftest.c conftest.o conftest.out conftest.rout
    done

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c"
else
echo $ac_n "checking `cat $CCBUGS/$CFILE.title`""... $ac_c" 1>&1
fi
        cp $file conftest.c
	echo "${CC-cc} $CFLAGS ... test for quotes in defn" >>config.log
        if eval ${CC-cc} $CFLAGS $OPTFLAGS \
	    -DCONFIGURE_ARGS_CLEAN="'"'"'-A -B'"'"'" -c \
	    conftest.c $LIBS >> config.log 2>&1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	    true 
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    cat $CCBUGS/$CFILE.txt | sed 's/^/\*\#/g' 
	    if test "$CFILE" = "ccwarn1" ; then
	       CONFIGURE_ARGS_CLEAN="`echo $CONFIGURE_ARGS_CLEAN | tr ' ' '_'`"
            fi
        fi
	# set +x
	/bin/rm -f conftest conftest.co
    done
    # 
    # After everything, see if there are any problems
    if test $broken = 1 ; then 
        if test -z "$FAILMSG" ; then
	    echo "Compiler $CC appears broken; aborting configure..."
        else
	    eval echo "$FAILMSG"
        fi
        exit 1
    fi
fi

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that ranlib works""... $ac_c"
else
echo $ac_n "checking that ranlib works""... $ac_c" 1>&1
fi
broken=0
cat <<EOF >conftest.c
int a(){return 1;}
EOF
rm -f conftest.out
compileonly='${CC-cc} -c $CFLAGS conftest.c >conftest.out 2>&1'
if eval $compileonly ; then 
    :
else
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    broken=1;
fi
rm conftest.out
if test $broken = 1 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    print_error "Error in creating test object for ranlib!"
else
    arcmd='$AR foo.a conftest.o >conftest.out 2>&1'
    eval $arcmd
    ranlibtest='$RANLIB foo.a >>conftest.out 2>&1'
    if eval $ranlibtest ; then
        : 
    else
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
        broken=1
    fi
    rm conftest.out
    cat <<EOF >conftest.c
int a(); int main(argc,argv)int argc; char **argv;{ return a();}
EOF
    compileonly='${CC-cc} -c $CFLAGS conftest.c >conftest.out 2>&1'
    if eval $compileonly ; then 
        : 
    else
        broken=1
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    fi
    rm conftest.out
    if test $broken = 1 ; then
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
        print_error "Error in creating test program for ranlib test!"
    else
	# Check that we can link the program
	echo $CLINKER $CFLAGS $LDFLAGS conftest.o -o conftest foo.a $LIBS >> \
		config.log
        if eval $CLINKER $CFLAGS $LDFLAGS conftest.o -o conftest foo.a $LIBS \
		>>config.log 2>&1 ; then
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
	    print_error "Error linking with ranlibed library"
	    broken=1
        fi
    fi
    /bin/rm -f foo.a
    if test $broken = 1 ; then
        print_error "RANLIB ($RANLIB) failed!"
        print_error "Assuming that ranlib is a stub returning non-zero"
        print_error "condition code"
        RANLIB=':'
    fi
fi
rm -f conftest.o conftest.c
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for broken handling of common symbols""... $ac_c"
else
echo $ac_n "checking for broken handling of common symbols""... $ac_c" 1>&1
fi
result="could not test"
cat > conftest.c <<EOF
extern int foo;
int main( int argc, char **argv ) { return foo; }
EOF
cat > conftest1.c <<EOF
extern int foo;
int foo;
EOF
compileonly='${CC-cc} -c $CFLAGS conftest.c >conftest.out 2>&1'
if eval $compileonly ; then 
    :
else
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    broken=1;
fi
compileonly='${CC-cc} -c $CFLAGS conftest1.c >conftest.out 2>&1'
if eval $compileonly ; then 
    arcmd='$AR libfoo.a conftest1.o >conftest.out 2>&1'
    eval $arcmd
    ranlibtest='$RANLIB libfoo.a >>conftest.out 2>&1'
    if eval $ranlibtest ; then
        if ${CLINKER} -o conftest conftest.o -L. -lfoo >>conftest.out 2>&1 ; then
	    result=no
	else
	    # try ranlib -c
	    ranlibtest='$RANLIB -c libfoo.a >>conftest.out 2>&1'
	    if eval $ranlibtest ; then
	        if ${CLINKER} -o conftest conftest.o -L. -lfoo >>conftest.out 2>&1 ; then
		    result="yes! using -c to fix"
		    RANLIB="$RANLIB -c"
                fi
            fi
	fi
    else
	if test -s conftest.out ; then cat conftest.out >> config.log ; fi
        broken=1
    fi
    rm -f libfoo.a conftest*
else
    if test -s conftest.out ; then cat conftest.out >> config.log ; fi
    broken=1;
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$result"
else
echo "$ac_t""$result" 1>&1
fi

fi
#
# Some Sun SOLARIS systems don't have AR (at least, not in a typical user
# path)
# Remove any arguments from the string AR
ARTEST=`expr "$AR" : "\(.*\) "`
# Extract the first word of "$ARTEST", so it can be a program name with args.
set dummy $ARTEST; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$ARFOUND"; then
  ac_pg_ARFOUND="$ARFOUND" # Let the user override the test.
else
  ac_first_char=`expr "$ARTEST" : "\(.\)"`
  # Use ac_word instead of $ARTEST in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_ARFOUND="1"
       ac_prog_where=$ARTEST
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_ARFOUND="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;ARFOUND="$ac_pg_ARFOUND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($ARFOUND)"
else
echo "$ac_t""found $ac_prog_where ($ARFOUND)" 1>&1
fi
   ARLOC=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

if test -z "$ARLOC" ; then 
    # Check for /usr/ccs/bin/ar ; Solaris likes to hide anything remotely
    # useful in this directory
    print_error "The library archiver $AR is not in your path"
    print_error "MPICH cannot be built without this program, which"
    print_error "should be part of ANY program development environment."
    if test -x /usr/ccs/bin/ar ; then 
        print_error "You need /usr/ccs/bin in your path."
    else
        print_error "Check your path; contact your system vendor if your"
        print_error "path appears to be ok."
    fi
    exit 1
fi
#
#
# Check for long pointers.  All such options are placed into DEFS (see
# autoconf manual, AC _ DEFINE)
#
# 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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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

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

      else
        Pac_CV_NAME=""

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

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

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

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

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


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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

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

      else
        Pac_CV_NAME=""

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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

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

      else
        Pac_CV_NAME=""

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

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

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

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

       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""can not determine; assuming it is"
else
echo "$ac_t""can not determine; assuming it is" 1>&1
fi
fi

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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

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

      else
        Pac_CV_NAME=""

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for C integer type for MPI_Aint""... $ac_c"
else
echo $ac_n "checking for C integer type for MPI_Aint""... $ac_c" 1>&1
fi
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""
else
echo "$ac_t""" 1>&1
fi
    for c_type in int long short "long long" ; do
        Pac_name="$c_type"
 Pac_varname=`echo "$Pac_name" | sed -e 's/ /_/g' -e 's/\*/star/g'`
eval Pac_testval=\$"${Pac_varname}_len"
if test -z "$Pac_testval" ; then
   
      
   eval Pac_testval=\$"CROSS_SIZEOF_$C_TYPE"
fi
if test -n "$Pac_testval" ; then
    Pac_CV_NAME=$Pac_testval
else
 if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of $Pac_name""... $ac_c"
else
echo $ac_n "checking for size of $Pac_name""... $ac_c" 1>&1
fi
 /bin/rm -f conftestval
 

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

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

      else
        Pac_CV_NAME=""

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

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

        if test "$type_len" = "$address_size" ; then
            MPI_AINT_FOUND=yes
	    MPI_AINT=$c_type
            break
        fi
    done
    
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "C integer type for MPI_Aint is""... $ac_c"
else
echo $ac_n "C integer type for MPI_Aint is""... $ac_c" 1>&1
fi
    if test "$MPI_AINT_FOUND" = yes ; then 
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$MPI_AINT"
else
echo "$ac_t""$MPI_AINT" 1>&1
fi
    else
        if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""could not find matching C type!"
else
echo "$ac_t""could not find matching C type!" 1>&1
fi
    fi
fi
# 
# Do not test 
# PROBLEM: ROMIO depends on long long in some cases.  For now, leave it
# outside the -no_short_longs test
if test "$NO_LONG_LONG" = "no" ; then
    # This uses CROSS_HAS_LONG_LONG (0 or 1) if cross compiling
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

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

      else
        has_long_long=0

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

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

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

fi

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

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

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

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

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

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

if test $ldok = 1 ; then
    

if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    if test -n "$CROSS_HAS_LONG_DOUBLE" ; then 
    if test "$CROSS_HAS_LONG_DOUBLE" = "yes" ; then 
	
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
"
}

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

    else
      /bin/rm -f conftestout
      if test -s conftest && (./conftest; exit) 2>conftestout; then
          
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
"
}
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi

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

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

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

    if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    # Check for preset size
    ac_name="SIZEOF_DOUBLE"
    eval testsize=\$"CROSS_SIZEOF_$ac_name"
    if test -z "$testsize" ; then
        echo "Cannot check for size of double when cross-compiling"
        ac_cv_sizeof_double=0
    else
        ac_cv_sizeof_double=$testsize
    fi
else
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

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

      else
        ac_cv_sizeof_double=0

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

rm -f cftestval

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

    if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then
    # Check for preset size
    ac_name="SIZEOF_LONG_DOUBLE"
    eval testsize=\$"CROSS_SIZEOF_$ac_name"
    if test -z "$testsize" ; then
        echo "Cannot check for size of long double when cross-compiling"
        ac_cv_sizeof_long_double=0
    else
        ac_cv_sizeof_long_double=$testsize
    fi
else
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

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

      else
        ac_cv_sizeof_long_double=0

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

rm -f cftestval

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for structure alignment""... $ac_c"
else
echo $ac_n "checking for structure alignment""... $ac_c" 1>&1
fi
   rm -f conftest*
   cat confdefs.h "$srcdir/util/structlayout.c" > conftest.c
   eval $compile
   if test ! -s conftest ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not build executable program to test alignment"
else
echo "$ac_t""Could not build executable program to test alignment" 1>&1
fi
   else
	if test -x conftest && (./conftest; exit) 1>conftestout ; then
	    if test -s conftestout ; then
  	        alignvalue=`cat conftestout`
            else
	        alignvalue="Unknown"
            fi
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$alignvalue"
else
echo "$ac_t""$alignvalue" 1>&1
fi
	else
	    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Execution of test program failed"
else
echo "$ac_t""Execution of test program failed" 1>&1
fi
	fi
   fi
   rm -f conftest*
   if test -n "$TESTCC" ; then
       CC="$CCsav"
   fi
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
    
{
test -n "$verbose" && \
echo "	defining USE_BASIC_TWO_ALIGNMENT"
echo "#define" USE_BASIC_TWO_ALIGNMENT 1 >> confdefs.h
DEFS="$DEFS -DUSE_BASIC_TWO_ALIGNMENT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_BASIC_TWO_ALIGNMENT\${SEDdB}USE_BASIC_TWO_ALIGNMENT\${SEDdC}1\${SEDdD}
\${SEDuA}USE_BASIC_TWO_ALIGNMENT\${SEDuB}USE_BASIC_TWO_ALIGNMENT\${SEDuC}1\${SEDuD}
\${SEDeA}USE_BASIC_TWO_ALIGNMENT\${SEDeB}USE_BASIC_TWO_ALIGNMENT\${SEDeC}1\${SEDeD}
"
}

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

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

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

fi

#### was
# We must not make USER_CFLAGS all of CFLAGS...
#
# We really should use MPICHCONF_H instead of CONFIG_H
CFLAGS="$CFLAGS -DHAVE_MPICHCONF_H"
#

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

# Don't include mpid/ch2 since that has default versions of the include
# files.  If a device needs them, it should copy or link them into
# its directory.

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking whether backtrace works""... $ac_c"
else
echo $ac_n "checking whether backtrace works""... $ac_c" 1>&1
fi
       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"
	   
{
test -n "$verbose" && \
echo "	defining HAVE_PRINT_BACKTRACE"
echo "#define" HAVE_PRINT_BACKTRACE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_PRINT_BACKTRACE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PRINT_BACKTRACE\${SEDdB}HAVE_PRINT_BACKTRACE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_PRINT_BACKTRACE\${SEDuB}HAVE_PRINT_BACKTRACE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_PRINT_BACKTRACE\${SEDeB}HAVE_PRINT_BACKTRACE\${SEDeC}1\${SEDeD}
"
}

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

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

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

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

fi

# We really need separate library directories and path indicators.

LIB_PATH_LEADER="-L"

# 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=""
# Extract the first word of "sync", so it can be a program name with args.
set dummy sync; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$SYNCFOUND"; then
  ac_pg_SYNCFOUND="$SYNCFOUND" # Let the user override the test.
else
  ac_first_char=`expr "sync" : "\(.\)"`
  # Use ac_word instead of sync in case the command has options on it.
  if test "$ac_first_char" = "/" -a -x "$ac_word" ; then
       ac_pg_SYNCFOUND="1"
       ac_prog_where=sync
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_SYNCFOUND="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;SYNCFOUND="$ac_pg_SYNCFOUND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($SYNCFOUND)"
else
echo "$ac_t""found $ac_prog_where ($SYNCFOUND)" 1>&1
fi
   SYNCLOC=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

if test -z "$SYNCLOC" ; then SYNCLOC=true ; fi
#
#
# if the device uses the machines file and there is no machines.$ARCH, 
# create one using hostname (or uname)
#
#
# 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.
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that $MPILIBNAME can be used as the library name""... $ac_c"
else
echo $ac_n "checking that $MPILIBNAME can be used as the library name""... $ac_c" 1>&1
fi
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>&2 2>&2'
fi
if test -z "$ac_link" ; then
    ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest $LIBS 1>&2 2>&2'
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
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$canuse"
else
echo "$ac_t""$canuse" 1>&1
fi
if test "$canuse" = "no" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""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"
else
echo "$ac_t""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" 1>&1
fi
exit 1
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
      
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

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

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

void a(i,j)int i,j;{}
#define a(b) a(b,__LINE__)
int main() { exit(0); }
int t() { a(0);return 0; }
EOF
if eval $compile; then
  
  
  ac_cv_cpprworks="yes"

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

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

      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
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Error: ROMIO Configure failed, aborting configure"
else
echo "$ac_t""Error: ROMIO Configure failed, aborting configure" 1>&1
fi
exit 1
  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
if test -z "$RSHCOMMAND" ; then
    RSHCOMMAND=$rshcommand
fi
#
# Variables used by Makefile.in's:

MPICH_VERSION="MPICH $MPIVERSION"

q='"'

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


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

#
# Because the Globus2 device can use a nested mpirun, it needs the
# option to ignore this step
if test "$define_mpirun_device" != "no" ; then
    
{
test -n "$verbose" && \
echo "	defining" MPIRUN_DEVICE to be $q$DEVICE$q
echo "#define" MPIRUN_DEVICE $q$DEVICE$q >> confdefs.h
DEFS="$DEFS -DMPIRUN_DEVICE=$q$DEVICE$q"
SEDDEFS="${SEDDEFS}\${SEDdA}MPIRUN_DEVICE\${SEDdB}MPIRUN_DEVICE\${SEDdC}$q$DEVICE$q\${SEDdD}
\${SEDuA}MPIRUN_DEVICE\${SEDuB}MPIRUN_DEVICE\${SEDuC}$q$DEVICE$q\${SEDuD}
\${SEDeA}MPIRUN_DEVICE\${SEDeB}MPIRUN_DEVICE\${SEDeC}$q$DEVICE$q\${SEDeD}
"
}

fi
# COMM is currently used in mpirun.ch_p4.in to decide if SMP support is
# turned on

# P4_MDEPCFLAGS now used only in doc/port.in - delete this
#
# 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
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

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

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

trap 'rm -fr Makefile util/Makefile examples/Makefile 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  mpichconf.h conftest*; exit 1' 1 3 15
CASE_SENSITIVE='$CASE_SENSITIVE'
HASMPE='$HASMPE'
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
RANLIB='$RANLIB'
VPATH='$VPATH'
includedir='$includedir'
srcdir='$srcdir'
exec_prefix='$exec_prefix'
bindir='$bindir'
sbindir='$sbindir'
libdir='$libdir'
sharedstatedir='$sharedstatedir'
localstatedir='$localstatedir'
sharedlib_dir='$sharedlib_dir'
SHAREDLIB_LOCALDIR='$SHAREDLIB_LOCALDIR'
SHARED_LIB_LOCALDIR='$SHARED_LIB_LOCALDIR'
prefix='$prefix'
mandir='$mandir'
docdir='$docdir'
htmldir='$htmldir'
top_srcdir='$top_srcdir'
datadir='$datadir'
builddir='$builddir'
libbuild_dir='$libbuild_dir'
sharedlibbuild_dir='$sharedlibbuild_dir'
binbuild_dir='$binbuild_dir'
includebuild_dir='$includebuild_dir'
sysconfdir='$sysconfdir'
GXXTRIAL='$GXXTRIAL'
ARNAME='$ARNAME'
HAVE_NO_C_CONST='$HAVE_NO_C_CONST'
CPP='$CPP'
SHARED_LIB_SEARCH_PATH_LEADER='$SHARED_LIB_SEARCH_PATH_LEADER'
CXXENABLE='$CXXENABLE'
CC_SHARED_OPT='$CC_SHARED_OPT'
CC_SHARED_OPT_FOR_TV='$CC_SHARED_OPT_FOR_TV'
CXXFLAGS_FOR_SHARED='$CXXFLAGS_FOR_SHARED'
SHAREDKIND='$SHAREDKIND'
SHAREDKIND_FOR_TV='$SHAREDKIND_FOR_TV'
MPI_STATUS_SIZE='$MPI_STATUS_SIZE'
HAS_WEAK_SYMBOLS='$HAS_WEAK_SYMBOLS'
MPI_WITH_PMPI='$MPI_WITH_PMPI'
PERL='$PERL'
CPP_EXTRA_LIBS='$CPP_EXTRA_LIBS'
messagecat_dir='$messagecat_dir'
GENCAT='$GENCAT'
USE_STDARG='$USE_STDARG'
BACKTRACE='$BACKTRACE'
mpich_includes='$mpich_includes'
LIB_PATH_LEADER='$LIB_PATH_LEADER'
F77_IN_C_LIBS='$F77_IN_C_LIBS'
F90_SUFFIX='$F90_SUFFIX'
F90_MODINCFLAG='$F90_MODINCFLAG'
FLIBNAME='$FLIBNAME'
AUTOMOUNTFIX='$AUTOMOUNTFIX'
RSHCOMMAND='$RSHCOMMAND'
SYNCLOC='$SYNCLOC'
ASM='$ASM'
ASMFILES_O='$ASMFILES_O'
AR='$AR'
ARCH='$ARCH'
BASE_LIB_LIST='$BASE_LIB_LIST'
CC='$CC'
CFLAGS='$CFLAGS'
CLINKER='$CLINKER'
CCFLAGS='$CCFLAGS'
CCLINKER='$CCLINKER'
CPP_COMPILER='$CPP_COMPILER'
CPP_DIR='$CPP_DIR'
CPPFLAGS='$CPPFLAGS'
CXXFLAGS='$CXXFLAGS'
LDFLAGS='$LDFLAGS'
CPPLDFLAGS='$CPPLDFLAGS'
CPRP='$CPRP'
DEFAULT_MACHINE='$DEFAULT_MACHINE'
DEVCFLAGS='$DEVCFLAGS'
DEVCFILES='$DEVCFILES'
DEVOFILES='$DEVOFILES'
DEV_DEFS='$DEV_DEFS'
DEVICE='$DEVICE'
DEVICE_MAKE_INCLUDE='$DEVICE_MAKE_INCLUDE'
F77='$F77'
FAST_COPY='$FAST_COPY'
FFLAGS='$FFLAGS'
FLIB_PATH='$FLIB_PATH'
FLIB_PATH_LEADER='$FLIB_PATH_LEADER'
FLIB_LIST='$FLIB_LIST'
FLINKER='$FLINKER'
GETNAME_DEFS='$GETNAME_DEFS'
HAS_FORTRAN='$HAS_FORTRAN'
HAS_MPI2='$HAS_MPI2'
INCLUDE_PATH='$INCLUDE_PATH'
LIB_LIST='$LIB_LIST'
LIB_PATH='$LIB_PATH'
LIB_DIR='$LIB_DIR'
MAKE='$MAKE'
MPE_DIR='$MPE_DIR'
MPE_MPI_EXT_C='$MPE_MPI_EXT_C'
MPE_MPI_EXT_O='$MPE_MPI_EXT_O'
ENABLE_MPEDBG='$ENABLE_MPEDBG'
MPIVERSION='$MPIVERSION'
CONFIGURE_ARGS_CLEAN='$CONFIGURE_ARGS_CLEAN'
HAVE_MPID_DEFS_H='$HAVE_MPID_DEFS_H'
COMM='$COMM'
MPICH_VERSION='$MPICH_VERSION'
MPIR_HOME='$MPIR_HOME'
MPI_AINT='$MPI_AINT'
MPI_FINT='$MPI_FINT'
MPILIBNAME='$MPILIBNAME'
MPICC='$MPICC'
MPIF77='$MPIF77'
MPIF90='$MPIF90'
MPICPLUSPLUS='$MPICPLUSPLUS'
MPI2OPTIONAL='$MPI2OPTIONAL'
MEMDEBUG='$MEMDEBUG'
NLS_DEFS='$NLS_DEFS'
NEWTESTDIRS='$NEWTESTDIRS'
OPTFLAGS='$OPTFLAGS'
OPTFLAGSC='$OPTFLAGSC'
OPTFLAGSF='$OPTFLAGSF'
P4_ARCH='$P4_ARCH'
P4_DIR='$P4_DIR'
RHS_COMMAND='$RHS_COMMAND'
PREFIX='$PREFIX'
USER_CFLAGS='$USER_CFLAGS'
ROMIO='$ROMIO'
ROMIO_LFLAGS='$ROMIO_LFLAGS'
ROMIO_TCFLAGS='$ROMIO_TCFLAGS'
ROMIO_TCPPFLAGS='$ROMIO_TCPPFLAGS'
ROMIO_TFFLAGS='$ROMIO_TFFLAGS'
buildcpp='$buildcpp'
NOF77='$NOF77'
NO_F90='$NO_F90'
NOMPE='$NOMPE'
hasMPE='$hasMPE'
MPE_OPTS='$MPE_OPTS'
MPI_INTRA='$MPI_INTRA'
LIBS='$LIBS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile util/Makefile examples/Makefile 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 "}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
cat $top_srcdir/${file}.in | sed -e "
$prsub
$extrasub
s%@CASE_SENSITIVE@%$CASE_SENSITIVE%g
s%@HASMPE@%$HASMPE%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
s%@VPATH@%$VPATH%g
s%@includedir@%$includedir%g
s%@srcdir@%$srcdir%g
s%@exec_prefix@%$exec_prefix%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libdir@%$libdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@sharedlib_dir@%$sharedlib_dir%g
s%@SHAREDLIB_LOCALDIR@%$SHAREDLIB_LOCALDIR%g
s%@SHARED_LIB_LOCALDIR@%$SHARED_LIB_LOCALDIR%g
s%@prefix@%$prefix%g
s%@mandir@%$mandir%g
s%@docdir@%$docdir%g
s%@htmldir@%$htmldir%g
s%@top_srcdir@%$top_srcdir%g
s%@datadir@%$datadir%g
s%@builddir@%$builddir%g
s%@libbuild_dir@%$libbuild_dir%g
s%@sharedlibbuild_dir@%$sharedlibbuild_dir%g
s%@binbuild_dir@%$binbuild_dir%g
s%@includebuild_dir@%$includebuild_dir%g
s%@sysconfdir@%$sysconfdir%g
s%@GXXTRIAL@%$GXXTRIAL%g
s%@ARNAME@%$ARNAME%g
s%@HAVE_NO_C_CONST@%$HAVE_NO_C_CONST%g
s%@CPP@%$CPP%g
s%@SHARED_LIB_SEARCH_PATH_LEADER@%$SHARED_LIB_SEARCH_PATH_LEADER%g
s%@CXXENABLE@%$CXXENABLE%g
s%@CC_SHARED_OPT@%$CC_SHARED_OPT%g
s%@CC_SHARED_OPT_FOR_TV@%$CC_SHARED_OPT_FOR_TV%g
s%@CXXFLAGS_FOR_SHARED@%$CXXFLAGS_FOR_SHARED%g
s%@SHAREDKIND@%$SHAREDKIND%g" | sed -e "
s%@SHAREDKIND_FOR_TV@%$SHAREDKIND_FOR_TV%g
s%@MPI_STATUS_SIZE@%$MPI_STATUS_SIZE%g
s%@HAS_WEAK_SYMBOLS@%$HAS_WEAK_SYMBOLS%g
s%@MPI_WITH_PMPI@%$MPI_WITH_PMPI%g
s%@PERL@%$PERL%g
s%@CPP_EXTRA_LIBS@%$CPP_EXTRA_LIBS%g
s%@messagecat_dir@%$messagecat_dir%g
s%@GENCAT@%$GENCAT%g
s%@USE_STDARG@%$USE_STDARG%g
s%@BACKTRACE@%$BACKTRACE%g
s%@mpich_includes@%$mpich_includes%g
s%@LIB_PATH_LEADER@%$LIB_PATH_LEADER%g
s%@F77_IN_C_LIBS@%$F77_IN_C_LIBS%g
s%@F90_SUFFIX@%$F90_SUFFIX%g
s%@F90_MODINCFLAG@%$F90_MODINCFLAG%g
s%@FLIBNAME@%$FLIBNAME%g
s%@AUTOMOUNTFIX@%$AUTOMOUNTFIX%g
s%@RSHCOMMAND@%$RSHCOMMAND%g
s%@SYNCLOC@%$SYNCLOC%g
s%@ASM@%$ASM%g
s%@ASMFILES_O@%$ASMFILES_O%g
s%@AR@%$AR%g
s%@ARCH@%$ARCH%g
s%@BASE_LIB_LIST@%$BASE_LIB_LIST%g
s%@CC@%$CC%g
s%@CFLAGS@%$CFLAGS%g
s%@CLINKER@%$CLINKER%g
s%@CCFLAGS@%$CCFLAGS%g
s%@CCLINKER@%$CCLINKER%g
s%@CPP_COMPILER@%$CPP_COMPILER%g
s%@CPP_DIR@%$CPP_DIR%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@CPPLDFLAGS@%$CPPLDFLAGS%g
s%@CPRP@%$CPRP%g
s%@DEFAULT_MACHINE@%$DEFAULT_MACHINE%g
s%@DEVCFLAGS@%$DEVCFLAGS%g
s%@DEVCFILES@%$DEVCFILES%g
s%@DEVOFILES@%$DEVOFILES%g
s%@DEV_DEFS@%$DEV_DEFS%g
s%@DEVICE@%$DEVICE%g" | sed -e "
s%@DEVICE_MAKE_INCLUDE@%$DEVICE_MAKE_INCLUDE%g
s%@F77@%$F77%g
s%@FAST_COPY@%$FAST_COPY%g
s%@FFLAGS@%$FFLAGS%g
s%@FLIB_PATH@%$FLIB_PATH%g
s%@FLIB_PATH_LEADER@%$FLIB_PATH_LEADER%g
s%@FLIB_LIST@%$FLIB_LIST%g
s%@FLINKER@%$FLINKER%g
s%@GETNAME_DEFS@%$GETNAME_DEFS%g
s%@HAS_FORTRAN@%$HAS_FORTRAN%g
s%@HAS_MPI2@%$HAS_MPI2%g
s%@INCLUDE_PATH@%$INCLUDE_PATH%g
s%@LIB_LIST@%$LIB_LIST%g
s%@LIB_PATH@%$LIB_PATH%g
s%@LIB_DIR@%$LIB_DIR%g
s%@MAKE@%$MAKE%g
s%@MPE_DIR@%$MPE_DIR%g
s%@MPE_MPI_EXT_C@%$MPE_MPI_EXT_C%g
s%@MPE_MPI_EXT_O@%$MPE_MPI_EXT_O%g
s%@ENABLE_MPEDBG@%$ENABLE_MPEDBG%g
s%@MPIVERSION@%$MPIVERSION%g
s%@CONFIGURE_ARGS_CLEAN@%$CONFIGURE_ARGS_CLEAN%g
s%@HAVE_MPID_DEFS_H@%$HAVE_MPID_DEFS_H%g
s%@COMM@%$COMM%g
s%@MPICH_VERSION@%$MPICH_VERSION%g
s%@MPIR_HOME@%$MPIR_HOME%g
s%@MPI_AINT@%$MPI_AINT%g
s%@MPI_FINT@%$MPI_FINT%g
s%@MPILIBNAME@%$MPILIBNAME%g
s%@MPICC@%$MPICC%g
s%@MPIF77@%$MPIF77%g
s%@MPIF90@%$MPIF90%g
s%@MPICPLUSPLUS@%$MPICPLUSPLUS%g
s%@MPI2OPTIONAL@%$MPI2OPTIONAL%g
s%@MEMDEBUG@%$MEMDEBUG%g
s%@NLS_DEFS@%$NLS_DEFS%g
s%@NEWTESTDIRS@%$NEWTESTDIRS%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@OPTFLAGSC@%$OPTFLAGSC%g
s%@OPTFLAGSF@%$OPTFLAGSF%g
s%@P4_ARCH@%$P4_ARCH%g
s%@P4_DIR@%$P4_DIR%g" | sed -e "
s%@RHS_COMMAND@%$RHS_COMMAND%g
s%@PREFIX@%$PREFIX%g
s%@USER_CFLAGS@%$USER_CFLAGS%g
s%@ROMIO@%$ROMIO%g
s%@ROMIO_LFLAGS@%$ROMIO_LFLAGS%g
s%@ROMIO_TCFLAGS@%$ROMIO_TCFLAGS%g
s%@ROMIO_TCPPFLAGS@%$ROMIO_TCPPFLAGS%g
s%@ROMIO_TFFLAGS@%$ROMIO_TFFLAGS%g
s%@buildcpp@%$buildcpp%g
s%@NOF77@%$NOF77%g
s%@NO_F90@%$NO_F90%g
s%@NOMPE@%$NOMPE%g
s%@hasMPE@%$hasMPE%g
s%@MPE_OPTS@%$MPE_OPTS%g
s%@MPI_INTRA@%$MPI_INTRA%g
s%@LIBS@%$LIBS%g
s%@DEFS@%-DHAVE_CONFIG_H%" >> $file
fi; done

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

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

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

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

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

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



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

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

CONFIG_FILES="util/mpicc util/mpicxx util/mpiinstall \
		util/mpirun util/mpichlib.conf util/mpiman \
                util/chkserv util/chkmachine util/tstmachines"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in util/mpicc util/mpicxx util/mpiinstall \
		util/mpirun util/mpichlib.conf util/mpiman \
                util/chkserv util/chkmachine util/tstmachines ; do 
    /bin/rm -f .pactmp
    sed -e '1d' $pac_file > .pactmp
    /bin/rm -f $pac_file
    mv .pactmp $pac_file
    chmod a+x  $pac_file
done

rm -f $includebuild_dir/mpidefs.h 
rm -f $includebuild_dir/mpif.f90
rm -f "$top_srcdir/include/mpidefs.h"
rm -f "$top_srcdir/include/mpif.f90"

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


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

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

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