


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

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

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

progname="`echo $0 | sed 's:^\./\./:\./:'`"
print_error() {
    echo "*# $*" 2>&1 ;
    }
print_usage() {
cat <<.
Usage: ${progname} [-arch=ARCH_TYPE] [-comm=COMM_TYPE]
            [-device=DEVICE]
            [-prefix=INSTALL_DIR]  [-c++[=C++_COMPILER]]
            [-cc=C_COMPILER] [-fc=FORTRAN_COMPILER]
            [-clinker=C_LINKER] [-flinker=FORTRAN_LINKER]
            [-c++linker=CC_LINKER] 
            [-mpe] [-nompe] [-nof77] [-f90nag] [-opt=OPTFLAGS] 
	    [-make=MAKEPGM]
            [-cflags=CFLAGS] [-fflags=FFLAGS] [-c++flags=CCFLAGS]
            [-optcc=C_OPTFLAGS] [-optf77=F77_OPTFLAGS]
            [-lib=LIBRARY] [-mpilibname=MPINAME]
            [-no_mpegraphics] [-no_short_longs] [-memdebug]
            [-x11_lib=X11LIB] [-x11_inc=X11INC]
            [-mpedbg] [-nompedbg] [-cross] [-devdebug] [-nodevdebug] 
            [-debug] [-nodebug] [-tracing]
	    [-var_pkt] [-pkt_size=LENGTH] [-adi_collective]
            [-adi_coll_world]
            [-wish=WISH] [-tcldir=TCLDIR] [-tkdir=TKDIR]
            [-fortnames=FORTRANNAMES]
            [-ar_nolocal] [-automountfix=AUTOMOUNTFIX]
            [-noranlib] [-rsh=RSHCOMMAND] [-rshnol]
	    [-nexusthreads] [-nexusdir=NEXUSDIR] [-nexuslib=NEXUSLIB]
            [-nexusdebug]
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)
   C++_COMPILER = default is to use g++ (optional)
   OPTFLAGS     = optimization flags to give the compilers (e.g. -g)
   CFLAGS       = flags to give C compiler
   FFLAGS       = flags to give Fortran compiler
   MAKEPGM      = version of make to use
   LENGTH       = Length of message at which ADI switches from short
                  to long message protocol
   WISH         = Name of tcl/tk wish executable.  Configure will attempt
                  to find a version of wish for you, but if there is
                  no wish in your path or you need to use a different
                  version, use this option.  Used only for the display
                  tools (nupshot and upshot).  tk 3.x required for nupshot;
                  tk 3.x or 4.x for upshot.
   TCLDIR       = Directory containing tcl.  Must have lib/libtcl.a and
                  include/tcl.h .  Used only for nupshot.
   TKDIR        = Directory containing tk 3.3, 3.4, 3.5, or 3.6.  Must have 
                  lib/libtk.a and include/tk.h .  Used only for nupshot.  
                  May be the same as TCLDIR.
   FORTRANNAMES = Form of the Fortran names.  See below.
   X11LIB       = Full path name for libX11.a
   X11INC       = Full path name for X11.h
   AUTOMOUNTFIX = Command to fix automounters
   RSHCOMMAND   = Command to use for remote shell
   MPILIBNAME   = Name to use instead of mpi in the name of the MPI
                  library.  If set, libMPILIBNAME will be used instead
                  or libmpi.  This can be used on systems with
                  several different MPI implementations.
   NEXUSDIR     = the location of the nexus distribution
   NEXUSLIB     = the location of the nexus library, if not in the standard
                  place within the distribution

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.

If '-c++' is included as an option, then the C++ interface is also built.
By default, g++ is used as the c++ compiler.  THIS IS CURRENTLY
UNSUPPORTED.

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

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

If '-mpe' is included as an option, then the MPE 'helper' libraries will
also be built.  '-nompe' causes the MPE libraries to not be built.  The
default is '-mpe'.  If '-no_mpegraphics' is used, then the MPE routines
that make use of X11 graphics will NOT be built; this is appropriate for
systems that either do not have the X11 include files or that do not
support X11 graphics (some message-passing systems cannot interoperate
with X11).  The options -x11_inc and -x11_lib may be used to specify the
locations of the X11 include files and libraries in the event that
configure cannot find them (they should both be specified in that case).

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

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

The option '-f90nag' allows you to use the NAG Fortran 90 instead of
Fortran 77.  This is a preliminary version and is based on the version
for NeXTs.

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

The option '-nexusthreads' enables multithreading within the ch_nexus
device.  The default version of the ch_nexus device is configured as
single-threaded.

The option '-nexusdebug' enables special debugging services in the
ch_nexus device.  The default version of the ch_nexus device is
configured without debugging.

The option '-nexusdir=NEXUSDIR' allows one to specify the location of an
installed version of Nexus.  The default is to use a version that is
distributed with MPICH, in the mpid/ch_nexus directory.

The option '-nexuslib=NEXUSLIB' allows one to specify a specific nexus
library to link against.  The default is -lnexus_dl.  Note that this is
not a path name.

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

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

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

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

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

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

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

The option '-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).

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

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

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

Special Tuning Options:

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

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

The option '-var_pkt' allows you to set the message size at which MPICH
changes from its short to long message protocol.

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

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


Sample Configure Usage:

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

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

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

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

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

Special notes:

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

Others may be recognized.
.
}
#
ARCH=""
CPP_DIR=""
LIB_PATH=""
FLIB_PATH=""
OPTFLAGS=""
OPTFLAGSF=""
NOF77=0
AR_LOCAL=l
NOSHORTLONGS=0
HAS_FORTRAN=1
MPILIBNAME=mpi
# Nag F90 names are call f90_unix_MP_getarg(i,s) and 
# f90_unix_MP_iargc().
F77GETARG="call getarg(i,s)"
F77IARGC="iargc()"
F90UNIX="C"
MPI_FOBJECTS="\$(MPI_FOBJECTS)"
CFLAGS=""
# We use @ because configure uses %
AUTOMOUNTFIX='sed -e s@/tmp_mnt/@/@g'
#
# By not setting FFLAGS, we get the values from the environment
MPE_GRAPHICS="-DMPE_GRAPHICS"
MAKE=make
P4_MDEPCFLAGS=""
ASMFILES_O=""
PREFIX=""
DEVCFLAGS=""
CONFIGURE_ARGS="$*"
DEFAULT_MACHINE=''
DEVICE_KIND=MPP
cross_compiling=0
is_adi1=0
debug_version=0
# Note default directory is relative to mpid/ch_nexus, but user may override
# with full path
NEXUSDEFAULTDIR="nexus"
NEXUSDIR="$NEXUSDEFAULTDIR"
NEXUSLIB="-lnexus_dl"
nexusthreads=0
#
MPIFDEP="mpif.h"
#
# -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"
#
# -mpe
MPE_DIR="mpe"
# -devdebug
DEVDEBUGCFLAGS="-DMPID_DEBUG_NONE -DMPID_STAT_NONE"
#
# 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
# 
MPIVERSION=`cat include/patchlevel.h | awk '{print $3}' | sed -e 's/\.[0-9]//' | tr '\012' '.'`
# Also check for exp version by looking for "mpich-exp" in the directory
# path
mpidirname=`pwd | sed -e 's%^.*/mpich-exp$%FOUND%g'`
if test "$mpidirname" = "FOUND" ; then
    MPIVERSION="$MPIVERSION (experimental)"
fi
echo "Configuring MPICH Version $MPIVERSION"
#
# IS_HETERO is set if the device supports heterogeneous machines.
# This requires additional coding, including checking for XDR
IS_HETERO=0
for arg
do
  # Handle --exec-prefix with a space before the argument.
  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  # Handle --prefix with a space before the argument.
  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  # Handle --srcdir with a space before the argument.
  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  else
    case $arg in
     # For backward compatibility, also recognize exact --exec_prefix.
     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
	next_exec_prefix=yes ;;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

     -cross)
	cross_compiling=1
	;;

     -var_pkt | --var_pkt)
        VARPKT=1
	DEVCFLAGS="$DEVCFLAGS -DMPID_PKT_VAR_SIZE"
	;;

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

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

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

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

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

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

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

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

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

     -f90nag)
        # Insert module 
	F90UNIX="      use f90_unix"
	FC=f90
	# Still to do - make sure that the Fortran interface is correctly
	# selected.
        ;;

     -c++ | --c++)
       CPP_DIR="src/c++"
       CPP_COMPILER="g++"
       echo Compiling C++ interface with g++ ;;

     -c++=* | --c++=*)
       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="src/c++"
       CPP_COMPILER=`echo $package`		
       echo Compiling C++ interface with $package ;;

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

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

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

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

     -c++linker=* | --c++linker=*)
	CCLINKER=`echo $arg|sed 's/-*c++linker=//'`
	USERCCLINKER=1
	;;

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

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

      -rshnol)
	rshnol=1
	;;

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

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

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

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

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

     -c++flags=* | --c++flags=*)
       package="`echo $arg|sed 's/-*c++flags=//'`"
       USER_CCFLAGS="$package"
       CCFLAGS="$CCFLAGS $package" ;;

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

     -mpe | --mpe)
       MPE_DIR="mpe"
       echo "Make will build MPE routines" ;;
 
     -nompe | --nompe)
       MPE_DIR=""
       echo "Make will not build MPE routines" ;;
 
     -no_mpegraphics | --no_mpegraphics)
       MPE_GRAPHICS=""
       echo "Make will not build MPE graphics routines" ;;

     -x11_lib=* | --x11_lib=* )
       USERXLIB=1
       X11LIB="`echo $arg|sed 's/-*x11_lib=//'`"
       ;;

     -x11_inc=* | --x11_inc=* )
       USERXLIB=1
       X11INC="`echo $arg|sed 's/-*x11_inc=//'`"
       ;;

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

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

     -tkdir=* | --tkdir=*)
	TK_DIR="`echo $arg|sed 's/-*tkdir=//'`"
       ;;

     -tcldir=* | --tcldir=*)
	TCL_DIR="`echo $arg|sed 's/-*tcldir=//'`"
       ;;

     -automountfix=* | --automountfix=*)
	AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`"
	;;

     -nobanner)
	nobanner=1
	;;

     -echo )
	set -x 
        configure_echo=1
	;;

     -nexusthreads | --nexusthreads )
        nexusthreads=1
        ;;

     -nexusdebug | --nexusdebug )
        nexusdebug=1
        ;;

     -nexusdir=* | --nexusdir=*)
	NEXUSDIR="`echo $arg|sed 's/-*nexusdir=//'`"
       ;;

     -nexuslib=* | --nexuslib=*)
	NEXUSLIB="`echo $arg|sed 's/-*nexuslib=//'`"
       ;;

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

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

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

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


# Make sure we remove any configuration file incase there is out-of-date data.
/bin/rm -f mpichconf.h

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

if test ! -f .mpich -a -z "$nobanner" ; then
  print_error " "
  print_error You should register your copy of MPICH with us by sending mail
  print_error to majordomo@mcs.anl.gov containing the message
  print_error subscribe mpi-users
  print_error This will allow us to notify you of new releases of MPICH.
  print_error " "
  print_error "You can also check the MPICH home page at "
  print_error "http://www.mcs.anl.gov/mpi/mpich/index.html"
  print_error " "
fi
#
# There are definitions in aclocal.m4 that must be in the same directory
# as this configure file for autoconf to properly build configure.
#
# Set basic defintions based on flags set from commandline
#
if test "$ADI_COLLECTIVE" = 1 ; then
    
{
test -n "$verbose" && \
echo "	defining MPID_USE_ADI_COLLECTIVE"
echo "#define" MPID_USE_ADI_COLLECTIVE 1 >> confdefs.h
DEFS="$DEFS -DMPID_USE_ADI_COLLECTIVE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_USE_ADI_COLLECTIVE\${SEDdB}MPID_USE_ADI_COLLECTIVE\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_USE_ADI_COLLECTIVE\${SEDuB}MPID_USE_ADI_COLLECTIVE\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_USE_ADI_COLLECTIVE\${SEDeB}MPID_USE_ADI_COLLECTIVE\${SEDeC}1\${SEDeD}
"
}

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

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

fi
#

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

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

MPIR_HOME=$MPIR_TRIAL
#
#
# Check that an ARCH was set
# If it wasn't set, try to guess using "util/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 util/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=`./util/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
       print_error "Error: Couldn't guess target architecture, you must"
       print_error "       set an architecture type with -arch=<value>"
       exit 1
    fi
    eval "arch_$ARCH=1"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$ARCH"
else
echo "$ac_t""$ARCH" 1>&1
fi
fi
if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
fi
if test -n "$arch_IRIX64" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIX32" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIXN32" ; then
    arch_IRIX=1
fi
#  Handle solaris on Intel platforms, needed to get heterogeneity right in p4
if test -n "$arch_solaris86" ; then
    arch_solaris=1
    ARCH=solaris86
fi
if test -n "$arch_sgi5" ; then
    arch_IRIX5=1
    ARCH=IRIX
fi
if test -n "$arch_cray" ; then
    arch_CRAY=1
    ARCH=CRAY
fi
#
# Check that a DEVICE was set
# If it wasn't set, try to guess using "util/tdevice"
#
if test -z "$DEVICE" -a -x util/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=`util/tdevice $ARCH`
    if test ! -n "$DEVICE" ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Unknown!"
else
echo "$ac_t""Unknown!" 1>&1
fi
       print_error "Error: Couldn't guess device, you must" 
       print_error "       set a device with -device=<value>" 
       exit 1
    fi
    eval "device_$DEVICE=1" 
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$DEVICE"
else
echo "$ac_t""$DEVICE" 1>&1
fi
fi
#
# Check for a VALID device
if test ! -d mpid/$DEVICE ; then
    print_error "$DEVICE is not a valid device!" 
    exit 1
fi
#
#
# Set Default values of variables
CC=${CC:-cc}
F77=${FC:-f77}
if test -n "$FC" ; then
    USERF77=1
fi
# CLINKER and FLINKER are set by PAC _GET_CC and F77
#
# First, check for the basic CC and Ranlib 
if test -z "$USERCC" ; then
    if test -z "$CC"; then
  # Extract the first word of `gcc', so it can be a program name with args.
  set dummy gcc; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      CC="gcc"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$CC" && CC="cc"
test -n "$CC" && test -n "$verbose" && echo "	setting CC to $CC"

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

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

fi
AR="ar cr$AR_LOCAL"
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
INCLUDE_PATH=""
USER_INCLUDE_PATH=""
USER_DEFS=""
LIB_LIST=""
MPE_LIBS=""
# Fixup for make

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

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


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking BSD 4.4 make""... $ac_c"
else
echo $ac_n "checking BSD 4.4 make""... $ac_c" 1>&1
fi
/bin/rm -f conftest
cat > conftest <<.
ALL:
	@echo "success"
.
cat > conftest1 <<.
include conftest
.
str=`$MAKE -f conftest1 2>&1`
/bin/rm -f conftest conftest1
if test "$str" != "success" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Found BSD 4.4 so-called make"
else
echo "$ac_t""Found BSD 4.4 so-called make" 1>&1
fi
    echo "The BSD 4.4 make is INCOMPATIBLE with all other makes."
    echo "Using this so-called make may cause problems when building programs."
    echo "You should consider using gnumake instead."
    
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no - whew"
else
echo "$ac_t""no - whew" 1>&1
fi
fi
str=""


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

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

#
# Check that a DEVICE was set
if test -z "$DEVICE" ; then
    print_error "You must set a device type with -device=<value>" 
    exit 1
fi
#
# Check that an ARCH was set
if test -z "$ARCH" ; then
    print_error "You must set an architecture type with -arch=<value>"
    exit 1
fi
#
# Set comm from device?
if test -z "$COMM" ; then
    COMM=$DEVICE
    # Remember that COMM set as default, not explicitly, 7/13/95, bri@sgi.com
    default_comm=1
fi
# If some extensions are set, mark the defs
if test -n "$MPE_MPI_EXT_C" ; then
   
{
test -n "$verbose" && \
echo "	defining MPE_USE_EXTENSIONS"
echo "#define" MPE_USE_EXTENSIONS 1 >> confdefs.h
DEFS="$DEFS -DMPE_USE_EXTENSIONS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPE_USE_EXTENSIONS\${SEDdB}MPE_USE_EXTENSIONS\${SEDdC}1\${SEDdD}
\${SEDuA}MPE_USE_EXTENSIONS\${SEDuB}MPE_USE_EXTENSIONS\${SEDuC}1\${SEDuD}
\${SEDeA}MPE_USE_EXTENSIONS\${SEDeB}MPE_USE_EXTENSIONS\${SEDeC}1\${SEDeD}
"
}

fi

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for IRIX cpucount""... $ac_c"
else
echo $ac_n "checking for IRIX cpucount""... $ac_c" 1>&1
fi
   cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
   if test "$cpucount" = "" ; then
     cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
   fi
      if test "$cpucount" = "" ; then
     print_error "Could not determine cpucount."
     print_error "Please send "
     hinv
     print_error "to mpi-bugs@mcs.anl.gov"
     exit 1
   fi
   if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$cpucount"
else
echo "$ac_t""$cpucount" 1>&1
fi

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

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

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

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


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

if test -n "$arch_EWS_UX_V" ; then
    # This is a Unix System V system running on MIP/SGI processors
    LIB_LIST="$LIB_LIST -lsocket -lnsl -lc"	
fi
#
# End of architecture-specific tests
#
if test ! -d lib ; then 
   mkdir lib
fi
if test ! -d lib/$ARCH ; then 
   mkdir lib/$ARCH
fi
if test ! -d lib/$ARCH/$COMM ; then 
   mkdir lib/$ARCH/$COMM
fi

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

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

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

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


fi
rm -f conftest*


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

fi
rm -f conftest*

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

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

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

fi

#
# This is a first cut at the information needed.  Information that I am
# providing is:
#
# 1. path to Nexus libraries && libraries to include
# 2. path to Nexus include files
# 3. compiler (if necessary)
# 4. path to debugger \___ for debugging Nexus
# 5. path to xterm    /    programs with xterm
# 5. ?
#
#  More can be needed if necessary.
if test -n "$device_ch_nexus"; then
  CC=gcc
  USERCC=1
  DEVICE_KIND=network
  # find some way to find Nexus since there is no standard location for
  # it, currently (/usr/local/nexus ?)
  DEVCFLAGS="$DEVCFLAGS -DHAVE_GETTIMEOFDAY "
  case $ARCH in
    rs6000)
      # DCE threads assumed until QT works correctly
      # (only with full Nexus)
      # NEXUS_EXTRA_LIBS="-lpthreads"
      # MPL assumed.  We need to give user option between:
      #
      #  A.  MPL <-------------------\
      #  B.  TCP                      |----> need CC=mpxlc
      #  C.  MPL+TCP (preferred) <---/
      for p in mpCC mpcc "$CC"
do
if test -z "$CCval"; then
  # Extract the first word of `$p', so it can be a program name with args.
  set dummy $p; 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
      CCval="$p"
      break
    fi
  done
  IFS="$saveifs"
fi

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

test -n "$CCval" && break
done

      if test -n "$CCval" ; then
	    CC=$CCval
	    if test "$CC" = mpcc ; then 
	        TESTCC=xlc
	    elif test "$CC" = mpCC ; then
        	TESTCC=xlC
	    fi
      else
            echo "Could not find mpCC or mpcc!"
	    exit 1
      fi
      for p in mpxlf "$F77"
do
if test -z "$F77val"; then
  # Extract the first word of `$p', so it can be a program name with args.
  set dummy $p; 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
      F77val="$p"
      break
    fi
  done
  IFS="$saveifs"
fi

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

test -n "$F77val" && break
done

      if test -n "$F77val" ; then
	    F77=$F77val
            USERF77=1
	    FLINKER=$F77val
      else
            echo "Could not find mpxlf!"
      fi
      ;;
    IRIX)
      # (only with full Nexus)
            #if [ "x$pac_inc_dir" != "x" ] ; then
      #  NEXUS_EXTRA_INC_PATH="-I$pac_inc_dir"
      #else
      #  print_error "Could not locate Quickthreads header file"
      #  exit 1
      #fi
            #if [ "x$pac_lib_dir" != "x" ] ; then
      #  NEXUS_EXTRA_LIB_PATH="-L$pac_lib_dir"
      #  NEXUS_EXTRA_LIBS="-lqt"
      #else
      #  print_error "Could not locate Quickthreads library"
      #  exit 1
      #fi
      # CC="ncc"
      ;;
    sun4)
      # FSU pthreads assumed until QT is tested.  We need a way to find
      # where the preferred threads library is located on the machine
      # (only with full Nexus)
            #if [ "x$pac_inc_dir" != "x" ] ; then
      #	NEXUS_EXTRA_INC_PATH="-I$pac_inc_dir"
      #else
      #	print_error "Path to pthreads include files not found"
      #	exit 1
      #fi
            #if [ "x$pac_lib_dir" != "x" ] ; then
      #	NEXUS_EXTRA_LIB_PATH="-L$pac_lib_dir"
      #	NEXUS_EXTRA_LIBS="-lgthreads -lmalloc"
      #else
      #	print_error "Path to pthreads libraries not found"
      #	exit 1
      #fi
      # FSU pthreads requires gcc 2.7.0 to work properly. Or to have the
      # pthread include files to be munged for earlier versions.  Assume
      # that the default compiler can work with the installed include
      # files.

      # For interoperation with Fortran to work correctly, gcc 2.7.0
      # must be used with the -munaligned-doubles command line option
      # This isn't quite correct.  We need to check that the option is
      # accepted.  Note that there are MANY ANSI-C compilers for the Sun,
      # and only gcc uses these flags.
      CFLAGS="$CFLAGS -munaligned-doubles"
      ;;
    solaris)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="-lnsl -lsocket";;
    alpha)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="";;
    NeXT)
      # This should just work.  Thank goodness for one sane platform. :)
      NEXUS_EXTRA_LIBS="";;
    paragon)
      # More stuff, but I've never tried this version, so I don't know
      # them, yet.
      NEXUS_EXTRA_LIBS="";;
    freebsd)
      # Working on this version, but the department needs to upgrade to
      # 2.0.5 or later because of severe VM problems that hit earlier
      # versions and crash the entire machine.
      NEXUS_EXTRA_LIBS="";;
  esac
  # We must have an ANSI 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 the compiler $CC accepts ANSI prototypes""... $ac_c"
else
echo $ac_n "checking that the compiler $CC accepts ANSI prototypes""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
int f(double a){return 0;}
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  
  rm -rf conftest*
  eval "ac_cv_ccworks=yes"

else
  rm -rf conftest*
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

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

  if test $notansi = 1 ; then
      print_error "NEXUS requires an ANSI C compiler; $CC failed to"
      print_error "handle a routine prototype."
      exit 1
  fi
  
  # Here we override the above code that hunts for 
  # the nexus libraries in favor of using either the default location
  # (inside the distribution) or a location specified as an argument to
  # configure.  Then we will build nexus ourselves.

  NEXUS_INCLUDE_DIR=$NEXUSDIR/include
  NEXUS_LIB_DIR=$NEXUSDIR/lib

  # Here we build Nexus from the source files included here, if the default
  # location for Nexus was not overridden to specify a previously-installed
  # Nexus


  if test "$NEXUSDIR" = "$NEXUSDEFAULTDIR" ; then
    # By default, Nexus will be built w/o threads unless specified
    # as an option to configure (--without-threads is the Nexus configure
    # flag which must be propagated.

    echo "Configuring Nexus subsystem..."

    if test "$nexusthreads" = 0; then
        nexusthreadsflag="--without-threads"
    else
        nexusthreadsflag=""
    fi
    if test "$nexusdebug" = 1; then
        nexusdebugflag="--enable-debug"
    else
        nexusdebugflag=""
    fi

    if test "$USERCC" = "1" && test "$ARCH" != "rs6000" \
       && test "$CC" != "mpCC" && test "$CC" != "mpcc" ; then
	export CC
    fi
    export MAKE

    rm -f mpid/ch_nexus/$NEXUSDIR/config.cache

    (cd mpid/ch_nexus/$NEXUSDIR; ./configure $nexusthreadsflag $nexusdebugflag)

    if test $? != 0 ; then
      print_error "Configure of the Nexus sub-system may have failed!"
    fi
  fi

  # Need a way to find where Nexus is located.
  if test -z "$NEXUS_INCLUDE_DIR" ; 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 include directory for nexus""... $ac_c"
else
echo $ac_n "checking for include directory for nexus""... $ac_c" 1>&1
fi
pac_inc_dir=""
for dir in /usr/local/nexus/include /usr/local/iway/app/nexus/include /usr/local/iway/app/nexus/nexus/include \
    /usr \
    /usr/local \
    /usr/local/nexus \
    /usr/contrib \
    /usr/contrib/nexus \
    $HOME/nexus \
    /opt/nexus \
    /opt/local \
    /opt/local/nexus \
    /local/encap/nexus ; do
    if test -r $dir/nexus.h ; then
	pac_inc_dir=$dir
	break
    fi
    if test -r $dir/include/nexus.h ; then
	pac_inc_dir=$dir/include
	break
    fi
    if test -r $dir/lib/libnexus.a ; then
	pac_lib_file=$dir/lib/libnexus.a
	break
    fi
    if test -r $dir/lib/libnexus.so ; then
	pac_lib_file=$dir/lib/libnexus.so
	break
    fi
done
if test -n "$pac_inc_dir" ; then 
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $pac_inc_dir"
else
echo "$ac_t""found $pac_inc_dir" 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 "$pac_inc_dir" ; then
          NEXUS_INCLUDE_PATH=-I$pac_inc_dir
      else
          print_error "Could not find NEXUS include files"
          exit 1
      fi
  else
      NEXUS_INCLUDE_PATH=-I$NEXUS_INCLUDE_DIR
  fi
  if test -z "$NEXUS_LIB_DIR" ; 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 library nexuslite_opt""... $ac_c"
else
echo $ac_n "checking for library nexuslite_opt""... $ac_c" 1>&1
fi
pac_lib_file=""
pac_lib_dir=""
for dir in /usr/local/nexus /usr/local/iway/app/nexus/lib /usr/local/iway/app/nexus/nexus/lib \
    /usr \
    /usr/local \
    /usr/local/nexuslite_opt \
    /usr/contrib \
    /usr/contrib/nexuslite_opt \
    $HOME/nexuslite_opt \
    /opt/nexuslite_opt \
    /opt/local \
    /opt/local/nexuslite_opt \
    /local/encap/nexuslite_opt ; do
    for suffix in a so ; do
        if test -n "$pac_lib_dir" ; then break ; fi
        if test -r $dir/nexuslite_opt.$suffix ; then
	    pac_lib_file=$dir/nexuslite_opt.$suffix
            pac_lib_dir=$dir
	    break
        fi
        if test -r $dir/libnexuslite_opt.$suffix ; then
	    pac_lib_file=$dir/libnexuslite_opt.$suffix
            pac_lib_dir=$dir
	    break
        fi
        if test -r $dir/lib/nexuslite_opt.$suffix ; then
	    pac_lib_file=$dir/lib/nexuslite_opt.$suffix
            pac_lib_dir=$dir/lib
	    break
        fi
        if test -r $dir/lib/libnexuslite_opt.$suffix ; then
	    pac_lib_file=$dir/lib/libnexuslite_opt.$suffix
            pac_lib_dir=$dir/lib
	    break
        fi
    done
done
if test -n "$pac_lib_file" ; then 
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $pac_lib_file"
else
echo "$ac_t""found $pac_lib_file" 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 "$pac_lib_dir" ; then
          NEXUS_LIB_PATH="-L$pac_lib_dir"
      else
          print_error "Could not find NEXUS library"
          exit 1
      fi
  else
      NEXUS_LIB_PATH="-L$NEXUS_LIB_DIR"
  fi
  #
  # Need a way to find which Nexus to use. (i.e., Lite vs. Full)
  # Lite is assumed currently
  #
  #NEXUS_LIBS="-lnexuslite_opt"
  if test "$nexusdebug" = "1" ; then
     NEXUSLIB="-lnexus_dl"
  else
     NEXUSLIB="-lnexus_l"
  fi
  NEXUS_LIBS=$NEXUSLIB

  # test whether we are using an external Nexus or the one in ch_nexus
  if test "$NEXUSDIR" = "$NEXUSDEFAULTDIR" ; then
    NEXUS_LIB_PATH="-L$MPIR_HOME/mpid/ch_nexus/$NEXUSDIR/lib"
    # get nexus includes, followed by device includes
    CFLAGS="-I$MPIR_HOME/mpid/ch_nexus/$NEXUSDIR/include -I$MPIR_HOME/mpid/ch_nexus $CFLAGS"
  else
    NEXUS_LIB_PATH="-L$NEXUS_LIB_DIR"
    CFLAGS="-I$NEXUS_INCLUDE_DIR -I$MPIR_HOME/mpid/ch_nexus $CFLAGS"
  fi

  LIB_PATH="$LIB_PATH $NEXUS_LIB_PATH $NEXUS_EXTRA_LIB_PATH"
  LIB_LIST="$LIB_LIST $NEXUS_LIBS $NEXUS_EXTRA_LIBS"
  # These files are only included by files in mpich/mpid/ch_nexus/*.c
  # and not by the user.
  INCLUDE_PATH="$INCLUDE_PATH $NEXUS_INCLUDE_PATH $NEXUS_EXTRA_INC_PATH"

  # Determine where the XTERM and dbx/gdb executables live
  XTERMLOC=""
  # Extract the first word of "xterm", so it can be a program name with args.
set dummy xterm; 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 "$XTERM"; then
  ac_pg_XTERM="$XTERM" # Let the user override the test.
else
  ac_first_char=`expr "xterm" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "xterm" ; then
       ac_pg_XTERM="1"
       ac_prog_where=xterm
  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_XTERM="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;XTERM="$ac_pg_XTERM"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($XTERM)"
else
echo "$ac_t""found $ac_prog_where ($XTERM)" 1>&1
fi
   XTERMLOC=$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

  GDBLOC=""
  # Extract the first word of "gdb", so it can be a program name with args.
set dummy gdb; 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 "$GDB"; then
  ac_pg_GDB="$GDB" # Let the user override the test.
else
  ac_first_char=`expr "gdb" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "gdb" ; then
       ac_pg_GDB="1"
       ac_prog_where=gdb
  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_GDB="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;GDB="$ac_pg_GDB"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($GDB)"
else
echo "$ac_t""found $ac_prog_where ($GDB)" 1>&1
fi
   GDBLOC=$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

  DBXLOC=""
  # Extract the first word of "dbx", so it can be a program name with args.
set dummy dbx; 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 "$DBX"; then
  ac_pg_DBX="$DBX" # Let the user override the test.
else
  ac_first_char=`expr "dbx" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "dbx" ; then
       ac_pg_DBX="1"
       ac_prog_where=dbx
  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_DBX="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;DBX="$ac_pg_DBX"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($DBX)"
else
echo "$ac_t""found $ac_prog_where ($DBX)" 1>&1
fi
   DBXLOC=$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

  
  
  
# Nexus doesn't yet have long doubles, even though gcc does
  NOSHORTLONGS=1
  echo "Finished configuring Nexus subsystem"
fi

# Get the C compiler, Fortran compiler, and archiver
CARCH=$ARCH
case $DEVICE in
    ch_cenju3)       CARCH=cenju3 ;;
    ch_cmmd)         CARCH=cm5 ;;
    ch_mpl|ch_eui)   CARCH=ibmpoe ;;
    ch_meiko|meiko)  CARCH=meiko ;;
    ch_nx|nx)        CARCH=intelnx ;;
    ch_nc)           CARCH=ncube ;;
    ch_spp)          CARCH=convex_spp ;;
esac

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test -n "$CCval" && break
done

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

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

test -n "$CCval" && break
done

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

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

test -n "$CCval" && break
done

      if test -n "$CCval" ; then
	 CC=$CCval
      fi
      ;;
esac
fi
if test -z "$USERCLINKER" -a -z "$CLINKER" ; then
    CLINKER="$CC"
fi

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

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

test -n "$F77" && break
done

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

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

test -n "$FCval" && break
done

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

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

    # if test -n "$F77FULL" ; then
	# Really should replace with full path....
        # but would need to capture arguments as well...
	    # fi
fi

else
    HAS_F77=0
fi

if test -z "$USERAR" ; then
case $CARCH in 
   intelnx|paragon|i860) AR="ar860 crl" ; ARNAME="ar860" ; ARARGS="crl" ;;
   cm5) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr"
   ;;
   meiko|solaris) AR="ar cr" ; ARNAME="ar" ; ARARGS="cr" 
   ;;
   ncube) AR="nar cr" ; ARNAME="nar" ; ARARGS="cr" ;;
esac
fi
if test -z "$AR" ; then 
    AR="ar cr$ARLOCAL" ; ARNAME="ar" ; ARARGS="cr$ARLOCAL" 
fi

#
# Check to see if the compiler accepts prototypes

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

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

else
  rm -rf conftest*
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

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

MPE_CFLAGS="$MPE_CFLAGS -DHAVE_PROTOTYPES"
else
    :
fi

#
# Check to see if it accepts const

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

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

else
  rm -rf conftest*
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

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

MPE_CFLAGS="$MPE_CFLAGS -DHAVE_NO_C_CONST"
fi

#
# Special flags for dbx versions; this should go into aclocal eventually
if test "$CARCH" = "alpha" ; then
    MPE_CFLAGS="$MPE_CFLAGS -DDBX_IS_OSF"
fi
#
# Various systems have known special needs (particularly libraries);
# get thos here
#    
DEFAULT_MACHINE=$DEVICE
#
if test -n "$device_nx"; then
  DEFAULT_MACHINE="paragon"
  is_adi1=1
  # Check for fast collective routines
  if test  -r /usr/lib/libjmc.a; then
    CFLAGS="$CFLAGS -DICCLIB"
    ICCLIB="iCClib"
  fi
fi

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

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

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lthread"
else
   :; 
fi

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

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

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lnsl"
else
   :; 
fi

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

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

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lrpc"
else
   :; 
fi

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

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

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIB_LIST="$LIB_LIST -lrpc"
else
   :; 
fi

  fi
fi
#
if test -n "$device_ch_meiko" -o -n "$device_meiko" ; then
  is_adi1=1
  DEFAULT_MACHINE="meiko"
  # Jim Cownie claims that -laio is no longer needed ...
  if test -s /opt/MEIKOcs2/lib/libmpsc.a ; then
      if test -n "$device_meiko" ; then
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lew -lelan"
      else
          LIB_LIST="$LIB_LIST -L/opt/MEIKOcs2/lib -lmpsc -lew -lelan"
      fi
  else
      print_error "Could not find the library /opt/MEIKOcs2/lib/libmpsc.a"
      print_error "Cannot build MEIKO version"
      exit 1
  fi
  # This include is needed for the elan.h files
  DEVCFLAGS="$DEVCFLAGS -I/opt/MEIKOcs2/include"
  # These were recommended by Jim Cownie
  if test -z "$OPTFLAGS" ; then
#      OPTFLAGS="-xcg92 -xO2"
       OPTFLAGS="-O"
  fi
  #RANLIB=true
fi
#
if test -n "$device_ch_mpl" ; then
    # Check for ANL default machine:
    if test -d /etc/FRAMES -a -d /mcs ; then
        DEFAULT_MACHINE="anlspx"
    fi
    # check for mpproto.h
    ac_safe=`echo "mpproto.h" | tr '[a-z]./' '[A-Z]__'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

#include <mpproto.h>
int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  pre_req=1
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
pre_req=0
fi

    if test $pre_req = 0 ; then
	print_error "Could not find the header file mpproto.h that is needed"
	print_error "by the ch_mpl device.  Check that you have"
	print_error "IBMs parallel operating environment (POE), which is "
	print_error "required for this device."
	exit 1
    fi
    if test $MPILIBNAME = "mpi" ; then 
	print_error "You should select a name for the MPICH library with"
	print_error "-mpilibname=name_of_library.  Using mpich as the"
	print_error "library name."
	MPILIBNAME="mpich"
    fi
    # We need to check for gettimeofday in case we are not using the Switch
    # timer
    for func in gettimeofday
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

fi
#
#
# Shared-memory (processes) device.  Only need to set mpirun default machine.
if test -n "$device_ch_shmem" -o -n "$device_ch_lfshmem" ; then
   DEFAULT_MACHINE="smp"
   # Check for MMAP
   # mmap doesn't help if it does not have MAP_ANONYMOUS
   for func in mmap
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

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

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

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

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

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

#include <ctype.h>
#include <sys/mman.h>
int main() { exit(0); }
int t() { 
typedef struct msemaphore MPID_Msemaphore;
typedef struct { MPID_Msemaphor lock; int a; } Msem;
Msem sem;
        }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  is_struct=1

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

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

	    echo struct
        else
	    echo typedef
        fi
   fi
   #
   # Here's a horrible "feature".  Solaris include null stubs for 
   # mutex_init in libc (!), so that users can build threaded code that
   # doesn't work (rather than putting this null stubs in -lnothread, 
   # where they belong).  Thus, if mutex_init IS found, we need to 
   # check for -lthread.   (Which we should have done above)
   #
   for func in mutex_init
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

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

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


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

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

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


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

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

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

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


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

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


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

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

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


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

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

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


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

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

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

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

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


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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that signals work correctly""... $ac_c"
else
echo $ac_n "checking that signals work correctly""... $ac_c" 1>&1
fi
cat >conftest.c <<EOF
#include <signal.h>
static int rc = 0, irc = 1, maxcnt=5;
void handler( sig )
int sig;
{
void (*oldsig)();
oldsig = signal( SIGUSR1, handler );
if (oldsig != handler) rc = 1;
irc = 0;
}
int main(argc, argv)
int argc;
char **argv;
{
(void)signal( SIGUSR1, handler );
kill( getpid(), SIGUSR1 );
while (irc && maxcnt) { sleep(1); maxcnt--;}
return rc;
}
EOF
if eval $CC $CFLAGS -o conftest conftest.c > /dev/null 2>&1 ; then
    if ./conftest ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Signals reset when used!"
else
echo "$ac_t""Signals reset when used!" 1>&1
fi
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not compile test program!"
else
echo "$ac_t""Could not compile test program!" 1>&1
fi
fi
/bin/rm -f conftest conftest.c conftest.o

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

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


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

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


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

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


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

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

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


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


fi

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

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

int main() { exit(0); }
int t() { vprintf(); }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_VPRINTF"
echo "#define" HAVE_VPRINTF 1 >> confdefs.h
DEFS="$DEFS -DHAVE_VPRINTF=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
"
}


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

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

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

int main() { exit(0); }
int t() { _doprnt(); }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_DOPRNT"
echo "#define" HAVE_DOPRNT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_DOPRNT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
"
}


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

fi

fi

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

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

  elif test "$ARCH" = "IRIX64" ; then
    P4_ARCH=SGI6       #SGI_CH64
#    DEFAULT_MACHINE="sgi_mp"
  elif test "$ARCH" = "IRIX" ; then
    P4_ARCH=SGI
    if test $osversion = 6 ; then
#        if test "$COMM" = "shared" ; then
#  	    # Use IRIX64 for SGI_CH64
# 	    P4_ARCH=SGI_CH32
##	    if test $cputype = 8000 ; then
##	        P4_ARCH=SGI_CH32
#	        DEFAULT_MACHINE="sgi_mp"
##	    fi
#	else
     	    P4_ARCH=SGI6
#	    if test $cputype = 8000 ; then
#	        P4_ARCH=SGI6
#	        #DEFAULT_MACHINE="sgi"
#	    fi
#	fi
    elif test $osversion = 5 ; then 
        P4_ARCH=SGI5         # SGI
#        if test "$COMM" = "shared" ; then
#	    P4_ARCH=SGI_MP
#	    DEFAULT_MACHINE="sgi_mp"
#	fi
    fi
    if test "$COMM" = "shared" ; then
	DEFAULT_MACHINE="sgi_mp"
    fi
  else
    # Note that this will change IRIXxxx to SGIxxx (i.e., IRIX32 to SGI32)
    P4_ARCH=`echo $ARCH | sed \
	    -e 's/sun4/SUN/g'              -e 's/intelnx/IPSC860/g'  \
	    -e 's/IRIX/SGI/g'              -e 's/hpux/HP/g'          \
	    -e 's/solaris86/I86_SOLARIS/g' -e 's/solaris/SUN_SOLARIS/g' \
	    -e 's/c2mp/CONVEX/g'           -e 's/uxpv/UXPV/g'          \
	    -e 's/alpha/ALPHA/g'           -e 's/dec5000/DEC5000/g'       \
	    -e 's/NeXT/NEXT/g'             -e 's/paragon/PARAGONIP/g'     \
	    -e 's/inteldelta/DELTA/g'      -e 's/symmetry/SYMMETRY/g'\
	    -e 's/cray/CRAY/g'             -e 's/tc2000/TC_2000/g'   \
	    -e 's/ksr/KSR/g'               -e 's/freebsd/FREEBSD/g'  \
	    -e 's/cm5/CM5/g'               -e 's/meiko/MEIKO_CS2/g'  \
            -e 's/rs6000/RS6000/g'	   -e 's/symm_ptx/SYMMETRY_PTX/g'`
  fi
echo "Finished setting p4arch..."
#
echo "Configuring p4 subsystem..."
# Make sure that the lib Makefile gets remade
  if test -n "$SOCKSIZE" ; then
      otherargs="-socksize=$SOCKSIZE"
  fi
  if test -n "$configure_echo" ; then
      otherargs="$otherargs -echo"
  fi
  if test -n "$rshcommand" ; then
      otherargs="$otherargs -rsh=$rshcommand"
  fi
  if test -n "$rshnol" ; then
      otherargs="$otherargs -rshnol"
  fi
  if test "$USERCC" = 1 ; then 
      (cd mpid/ch_p4/p4-1.4 ; \
	./configure -p4arch=$P4_ARCH -p4make="$MAKE" -opt="$OPTFLAGS" -cc="$CC" -p4comm="$COMM" -cflags="$USER_CFLAGS $P4_CFLAGS" $otherargs )
      if test $? != 0 ; then
          print_error "Configure of the p4 sub-system may have failed!"
      fi
    else
      (cd mpid/ch_p4/p4-1.4 ; \
	./configure -p4arch=$P4_ARCH -p4make="$MAKE" -opt="$OPTFLAGS" -p4comm="$COMM" -cflags="$USER_CFLAGS $P4_CFLAGS" $otherargs )
      if test $? != 0 ; then
          print_error "Configure of the p4 sub-system may have failed"
      fi
  fi
  echo "Finished configuring the p4 subsystem"
  P4_MDEPLIBS=`$MAKE -f mpid/ch_p4/p4-1.4/lib/Makefile p4mdeplibs | grep -v make`
  LIB_LIST="$LIB_LIST $P4_MDEPLIBS"
  #
  P4_MDEPCFLAGS=`$MAKE -f mpid/ch_p4/p4-1.4/lib/Makefile p4mdepcflags | grep -v make`
  if test -n "$P4_MDEPCFLAGS" ; then
      CFLAGS="$CFLAGS $P4_MDEPCFLAGS"
      # Note that USER_CFLAGS inherits all of CFLAGS.
  fi
  if test ! -d lib/$ARCH/ch_p4 ; then 
      mkdir lib/$ARCH/ch_p4
  fi 
#   
#   We need to change the makefile.protos in mpid/ch_p4/p4-1.4 to use
#   the correct libraries
#   if test -n "$COMM" ; then 
#       COMM="ch_p4_$COMM"
#   else
       COMM="ch_p4"
#   fi
  if test ! -d lib/$ARCH/$COMM ; then 
       mkdir lib/$ARCH/$COMM
  fi 
#   p4 library is intergrated with libmpi.a...
#   LIB_PATH="$LIB_PATH -L$lib/$ARCH/$COMM"
#   LIB_LIST="$LIB_LIST -lp4";
  IS_HETERO=1
  

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that signals work correctly""... $ac_c"
else
echo $ac_n "checking that signals work correctly""... $ac_c" 1>&1
fi
cat >conftest.c <<EOF
#include <signal.h>
static int rc = 0, irc = 1, maxcnt=5;
void handler( sig )
int sig;
{
void (*oldsig)();
oldsig = signal( SIGUSR1, handler );
if (oldsig != handler) rc = 1;
irc = 0;
}
int main(argc, argv)
int argc;
char **argv;
{
(void)signal( SIGUSR1, handler );
kill( getpid(), SIGUSR1 );
while (irc && maxcnt) { sleep(1); maxcnt--;}
return rc;
}
EOF
if eval $CC $CFLAGS -o conftest conftest.c > /dev/null 2>&1 ; then
    if ./conftest ; then
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    else
	if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Signals reset when used!"
else
echo "$ac_t""Signals reset when used!" 1>&1
fi
    fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""Could not compile test program!"
else
echo "$ac_t""Could not compile test program!" 1>&1
fi
fi
/bin/rm -f conftest conftest.c conftest.o

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

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


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

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

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


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

fi

#
# This is incomplete

if test -n "$arch_IRIX"; then
   # We now have to look at  all sorts of things to determine the
   # various flags.  We need to set both the CFLAGS and various options
   # for the linkers (by setting CLINKER and FLINKER).
   # The OS version and chipset were determined above so that they could
   # be used to set the P4_ARCH if necessary.
   #
   # Latest information we have is that (thanks to Winfrid Tschiedel 
   # <Winfrid.Tschiedel@mch.sni.de>):
   #  cputype          Instruction sets
   #  R4X00            -mips2 -mips3 (mips2 requires -32)
   #  R5000, R8000 and R10000 : -mips2 (-32) and -mips3 (-n32 or -64)
   #                            -mips4 (-n32 or -64)
   # Also, IRIX 6.2 supports R4X00 only in 32 bit mode (requires -n32)
   # EXCEPT for R4400, which also supports -64.
   # In 6.2, the defaults SEEM to be -32 -mips 2
   # but you may need -64 -mips3 OR -mips 4 OR -n32 -mips3 or -mips4
   # Also, some systems REQUIRE -non_shared and others REQUIRE NOT 
   # -non_shared.  
   # 
   # Finally, compilation with optimization may stree the linker;
   # include -TENV:large_GOT=ON in this case
   #
   if test $osversion = 4 ; then
	# Nathan's tests showed that we needed this.
	RANLIB="ar ts"
   elif test $osversion = 5 ; then
        # Turn off warnings about long doubles not being supported.
	if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 728"
	    # Other useful woff values are: 852,635,813,831,835
        fi
   elif test $osversion = 6 ; then
#       these flags settings are handled by including MDEPCFLAGS from p4
	SYMTYPE=""
	if test $cputype = 8000 -o $cputype = 10000 ; then
	    if test -n "$arch_IRIX64" ; then
	        SYMTYPE="-64 -mips4"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
	elif test $cputype -gt 4000 ; then
	    if test -n "$arch_IRIX64" ; then
		SYMTYPE="-64 -mips3"
            elif test -n "$arch_IRIXN32" ; then
		SYMTYPE="-n32"
            else 
		SYMTYPE="-32"
            fi
        else
	    # According to winfrid.tschiedel@mch.sni.de, need -n32 for R4000
	    SYMTYPE="-n32"
            # Not "-n32 -mips3"?
        fi
	if test -n "$P4_MDEPCFLAGS" ; then
  	    FFLAGS="$FFLAGS $P4_MDEPCFLAGS"
        fi
        # Warning flags are > 1000
#       CFLAGS="$CFLAGS -woff 1152,1174,1184"
#       1184 not in the p4 list
        if test "$CC" != "gcc" ; then
            CFLAGS="$CFLAGS -woff 1184,1174"
        fi
	# Check whether we need to add SYMTYPE to CFLAGS and FFLAGS
	hasarg=`echo A$CFLAGS | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#       override SYMTYPE computed above (2/21)
        SYMTYPE=""
	if test -z "$hasarg" ; then
            CC="$CC $SYMTYPE"
	    F77="$F77 $SYMTYPE"
	    CLINKER="$CC $SYMTYPE"
	    FLINKER="$F77 $SYMTYPE"
#	else 
#	    hasarg=`echo A$CLINKER | sed -n -e '/-n32/p' -e '/-32/p' -e '/-64/p'`
#	    if test -z "$hasarg" ; then
#		# We need to make the linker compatible with the compiler.
#	    fi
	fi
   fi
   echo "Messages about long doubles not being supported are being suppressed"
   fi

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

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

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


if test -n "$arch_CRAY"; then
   # The CRAY cp doesn't even support -r (!!) but at least there 
   # is a version that does work.
   if test -x /usr/ucb/cp ; then
       CPRP="/usr/ucb/cp"
   else
       print_error "Using default cp for copy; install may fail if -r and -p"
       print_error "switches are not supported."
   fi
   # It might be better to use AR="bld qvz" than the regular ar clr
   DEVCFLAGS="$DEVCFLAGS -DMPID_FLOAT_CRAY"
   # We might want to add
   # -DMPIR_FORT_INT_T=long
   # to the defines.
   # According to Laurie Costello <lmc@cray.com>, the Triton needs this
   # definition
   if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

   # 
fi

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

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

fi

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

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

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

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

if test -n "$arch_SX_4" ; 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"
#
       for file in $ASMFILES_O
       do
          files=`echo $file | sed -e "s/.o$/.s/"`
          rm -f mpid/$DEVICE/$files
          cp mpid/$DEVICE/sx4_$sx4int/$files mpid/$DEVICE/$files
       done
    else
       DEVCFLAGS="$DEVCFLAGS -DLOCKS_PICKED -DUSE_SEMOP"
    fi
    DEVCFLAGS="$DEVCFLAGS -DHAVE_SHMAT=1 -DHAVE_SEMOP=1 -DRETSIGTYPE=void -DHAVE_SIGACTION -DMPI_SX_4 -DMPID_SETUP_SIGNALS"
fi
# check whether --comm=pvm3 was given
if test -n "$comm_pvm3"; then
  echo "PVM 3 no longer supported."
  echo "Note that MPICH was NEVER implemented on top of PVM; PVM was merely"
  echo "one of the many devices supported from the very beginning."
  exit 1
fi

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

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

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

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

fi
if test $cross_compiling = 1 ; then
    if test $DEVICE = ch_shmem -o $DEVICE = ch_p4 -o $DEVICE = ch_tcp -o \
	$DEVICE = ch_lfshmem ; then
        print_error "Configure was unable to compile and run a simple program."
    fi
fi
#
# Some devices use gettimeofday.  If this is one of them, check to see 
# what form it is
if test -n "$arch_solaris" -o -n "$arch_SX_4" ; then
    
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for how many arguments gettimeofday takes""... $ac_c"
else
echo $ac_n "checking for how many arguments gettimeofday takes""... $ac_c" 1>&1
fi
# Test sets "wierd" only for FAILURE to accept 2
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/time.h>
main() {struct timeval tp;
gettimeofday(&tp,(void*)0);return 0;}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""two - whew"
else
echo "$ac_t""two - whew" 1>&1
fi


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

fi
#
#
# 
# Tests for X etc should go here ...
#
MPEGRAPHICS_SOURCE=""
MPEGRAPHICS_OBJS=""
MPEGRAPHICS_FSOURCE=""
MPEGRAPHICS_FOBJS=""
X_INC=""
X_LIB=""

if test -n "$MPE_DIR"; then
  MPE_DIR="$MPIR_HOME/$MPE_DIR"
  if test -n "$MPE_GRAPHICS"; then
   # FIND_X doesn't always work correctly when cross compiling, so we
   # try to be more careful and conservative
   
   # FIND_X doesn't always work correctly when cross compiling, so we
   # try to be more careful and conservative
   if test -z "$USERXLIB" ; then 
    # The user has specified the libraries/include paths; pick them up 
    # below....
    if test -z "$cross_compiling" -o "$cross_compiling" = 0 ; then 
       # If we find X, set shell vars x_includes and x_libraries to the paths.
no_x=true
echo checking for X include and library files with xmkmf
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  cat > Imakefile <<\EOF
acfindx:
	@echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    no_x=
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `make acfindx | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
      im_usrlibdir=$im_libdir
    fi
    case "$im_incroot" in
	/usr/include) ;;
	*) x_includes="$im_incroot" ;;
    esac
    case "$im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) x_libraries="$im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test -z "$im_usrlibdir"; then
echo checking for X include and library files directly
cat > conftest.c <<EOF
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  no_x=

else
  rm -rf conftest*
  for dir in \
    /usr/local/include \
    /usr/unsupported/include \
    /usr/x386/include \
    /usr/local/X11R6/include \
    /usr/local/X11R5/include \
    /usr/local/x11r6/include \
    /usr/local/x11r5/include \
    /usr/include/X11R6 \
    /usr/include/X11R5 \
    /usr/include/X11R4 \
    /usr/X11R6/include \
    /usr/X11R5/include \
    /usr/X11/include \
    /usr/openwin/include \
    /usr/openwin/share/include \
    /usr/lpp/Xamples/include \
    ; \
  do
    if test -r $dir/X11/Intrinsic.h; then
      x_includes=$dir; no_x=
      break
    fi
  done
fi
rm -f conftest*

# Check for the libraries.  First see if replacing the `include' by
# `lib' works.
LIBS_save="${LIBS}"
LIBS="${LIBS} -lXt"
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 -lXt""... $ac_c"
else
echo $ac_n "checking for -lXt""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; no_x=
else
   :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  /usr/local/lib \
  /usr/unsupported/lib \
  /usr/x386/lib \
  /usr/local/X11R6/lib \
  /usr/local/X11R5/lib \
  /usr/local/x11r6/lib \
  /usr/local/x11r5/lib \
  /usr/lib/X11 \
  /usr/lib/X11R4 \
  /usr/X11R6/lib \
  /usr/X11R5/lib \
  /usr/X11/lib \
  /usr/openwin/lib \
  /usr/lpp/Xamples/lib \
  ; \
do
  for extension in a so sl; do
    if test -r $dir/libXt.$extension; then
      x_libraries=$dir; no_x=
      break 2
    fi
  done
done
fi

fi
if test -n "$verbose"; then
  test -n "$x_includes" && echo "	found X11 headers in $x_includes"
  test -n "$x_libraries" && echo "	found X11 libraries in $x_libraries"
fi
       if test -n "$no_x" ; then
	  print_error "Did not find X11 libraries and/or include files"
       fi
    else
       # Try to compile a program with an include file.
       # I didn't use HEADER_CHECK because I want to insist that the 
       # code try to compile with the header
       no_x=true
       if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for X11 headers""... $ac_c"
else
echo $ac_n "checking for X11 headers""... $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 <X11/Xlib.h>
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  no_x=""

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

       if test -z "$no_x" ; then 
          # Try to link a simple X program
          LIBS_save="${LIBS}"
LIBS="${LIBS} -lX11"
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 -lX11""... $ac_c"
else
echo $ac_n "checking for -lX11""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; no_x=""
else
   :; no_x="true"
fi

       fi
       if test -n "$no_x" ; then
         print_error " " 
         print_error "X11 is not used when cross compiling (because of the"
         print_error "difficulties in finding the correct libraries)"
         print_error " "
       fi
     fi
   else
	# Pick up the paths from the user if possible
	if test -z "$x_includes" -a -n "$X11INC" ; then 
	    x_includes="$X11INC"
            XINCLUDES="-Ix_includes"
	fi
	if test -z "$x_libraries" -a -n "$X11LIB" ; then 
	    x_libraries="$X11LIB"
	fi
   fi
   if test -n "$x_includes" ; then
       XINCLUDES="-I$x_includes"
   fi
   if test -z "$no_x" ; then
       # may STILL not have x if the include files aren't around
       if test -n "$x_includes" ; then
           f_test=$x_includes/X11/Xlib.h
       else
           f_test=/usr/include/X11/Xlib.h
       fi
       if test ! -f $f_test ; then
           no_x=yes
	   print_error "X11 include files were not found in $f_test!"
       fi
   fi

  fi
  if test -n "$MPE_GRAPHICS" -a -z "$no_x" ; then
    MPE_LIBS="-lmpe -lpmpi -lX11 -lm"
    MPEGRAPHICS_SOURCE="mpe_graphics.c xcolor.c xframe.c xinit.c xwmap.c xmouse.c"
    MPEGRAPHICS_OBJS="mpe_graphics.o xcolor.o xframe.o xinit.o xwmap.o xmouse.o"
    MPEGRAPHICS_FSOURCE="mpe_graphicsf.c"
    MPEGRAPHICS_FOBJS="mpe_graphicsf.o"
    if test -z "$x_includes" ; then
      X_INC=""
    else
      X_INC="-I$x_includes"
    fi
    if test -z "$x_libraries" ; then
      X_LIB=""
    else
      X_LIB="-L$x_libraries"
      MPE_LIBS="$X_LIB -lmpe -lX11 -lm"
    fi
    # On the Meiko CS2, you have to add additional libraries to satisfy
    # the externals needed by -X11.
    if test -n "$arch_meiko" ; then
        MPE_LIBS="$MPE_LIBS -lsocket -lnsl"
    fi
  else
    MPE_GRAPHICS=""
    MPE_LIBS="-lmpe"
  fi
else
  MPE_GRAPHICS=""
fi
#
# Check for remote shell program
#
RSH_COMMAND=
if test -z "$RSHCOMMAND" ; then
    for p in remsh rsh
do
# Extract the first word of "$p", so it can be a program name with args.
set dummy $p; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$RSH_COMMAND"; then
  ac_pg_RSH_COMMAND="$RSH_COMMAND" # Let the user override the test.
else
  ac_first_char=`expr "$p" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "$p" ; then
       ac_pg_RSH_COMMAND="$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_RSH_COMMAND="$p"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;RSH_COMMAND="$ac_pg_RSH_COMMAND"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($RSH_COMMAND)"
else
echo "$ac_t""found $ac_prog_where ($RSH_COMMAND)" 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 "$RSH_COMMAND" && break
done

else
    RSH_COMMAND=$RSHCOMMAND
    echo "Using $RSHCOMMAND for remote shell"
fi
#
if test $HAS_F77 = 0 -a $NOF77 = 0 ; then
    NOF77=1
    HAS_FORTRAN=0
    
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

        MPI_FOBJECTS="" 
elif test $HAS_F77 = 1 ; then
    
   # Check for strange behavior of Fortran.  For example, some FreeBSD
   # systems use f2c to implement f77, and the version of f2c that they 
   # use generates TWO (!!!) trailing underscores
   # Currently, WDEF is not used but could be...
   #
   # Eventually, we want to be able to override the choices here and
   # force a particular form.  This is particularly useful in systems
   # where a Fortran compiler option is used to force a particular
   # external name format (rs6000 xlf, for example).
   cat > confftest.f <<EOF
       subroutine mpir_init_fop( a )
       integer a
       a = 1
       return
       end
EOF
   $F77 $FFLAGS -c confftest.f > /dev/null 2>&1
   if test ! -s confftest.o ; then
        print_error "Unable to test Fortran compiler"
        print_error "(compiling a test program failed to produce an "
        print_error "object file)."
	NOF77=1
        HAS_FORTRAN=0
   elif test -z "$FORTRANNAMES" ; then
    # We have to be careful here, since the name may occur in several
    # forms.  We try to handle this by testing for several forms
    # directly.
    if test $arch_CRAY ; then
     # Cray doesn't accept -a ...
     nameform1=`strings confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings confftest.o | grep mpir_init_fop__ | head -1`
    else
     nameform1=`strings -a confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings -a confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings -a confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings -a confftest.o | grep mpir_init_fop__ | head -1`
    fi
    /bin/rm -f confftest.f confftest.o
    if test -n "$nameform4" ; then
	echo "Fortran externals are lower case and have 1 or 2 trailing underscores"
	FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
    elif test -n "$nameform1" ; then
        # We don't set this in CFLAGS; it is a default case
        echo "Fortran externals have a trailing underscore and are lowercase"
	FORTRANNAMES="FORTRANUNDERSCORE"
    elif test -n "$nameform2" ; then
	echo "Fortran externals are uppercase"     
	FORTRANNAMES="FORTRANCAPS" 
    elif test -n "$nameform3" ; then
	echo "Fortran externals are lower case"
	FORTRANNAMES="FORTRANNOUNDERSCORE"
    else
	print_error "Unable to determine the form of Fortran external names"
	print_error "Make sure that the compiler $F77 can be run on this system"
#	print_error "If you have problems linking, try using the -nof77 option"
#        print_error "to configure and rebuild MPICH."
	print_error "Turning off Fortran (-nof77 being assumed)."
	NOF77=1
        HAS_FORTRAN=0
    fi
#   case $nameform in 
#       MPIR_INIT_FOP | _MPIR_INIT_FOP)
#	echo "Fortran externals are uppercase"     
#	WDEF=-DFORTRANCAPS 
#	;;
#       mpir_init_fop_ | _mpir_init_fop_)   
#	 # We don't set this in CFLAGS; it is a default case
#        echo "Fortran externals have a trailing underscore and are lowercase"
#	WDEF=-DFORTRANUNDERSCORE ;;
#
#       mpir_init_fop | _mpir_init_fop)     
#	echo "Fortran externals are lower case"
#	WDEF=-DFORTRANNOUNDERSCORE 
#	;;
#
#           # Fortran no underscore is the "default" case for the wrappers; 
#	   # having this defined allows us to have an explicit test, 
#	   # particularly since the most common UNIX case is FORTRANUNDERSCORE
#       mpir_init_fop__ | _mpir_init_fop__)  
#	echo "Fortran externals are lower case and have 1 or 2 trailing underscores"
#	WDEF=-DFORTRANDOUBLEUNDERSCORE
#        ;;
#
#       *)
#	print_error "Unable to determine the form of Fortran external names"
#	print_error "If you have problems linking, try using the -nof77 option"
#        print_error "to configure and rebuild MPICH."
#	NOF77=1
#        HAS_FORTRAN=0
#	;;
#   esac
    fi
    if test -n "$FORTRANNAMES" ; then
        WDEF="-D$FORTRANNAMES"
    fi
    
    if test $HAS_FORTRAN = 0 ; then
		
{
test -n "$verbose" && \
echo "	defining MPID_NO_FORTRAN"
echo "#define" MPID_NO_FORTRAN 1 >> confdefs.h
DEFS="$DEFS -DMPID_NO_FORTRAN=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPID_NO_FORTRAN\${SEDdB}MPID_NO_FORTRAN\${SEDdC}1\${SEDdD}
\${SEDuA}MPID_NO_FORTRAN\${SEDuB}MPID_NO_FORTRAN\${SEDuC}1\${SEDuD}
\${SEDeA}MPID_NO_FORTRAN\${SEDeB}MPID_NO_FORTRAN\${SEDeC}1\${SEDeD}
"
}

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for Fortran include argument""... $ac_c"
else
echo $ac_n "checking for Fortran include argument""... $ac_c" 1>&1
fi
cat > conftest.f <<EOF
       program main
       include 'mpif.h'
       end
EOF
if $F77 $FFLAGS -c -Iinclude conftest.f > /dev/null 2>&1 ; then
    FINC="-I@MPIR_HOME@/include"
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""supports -I"
else
echo "$ac_t""supports -I" 1>&1
fi
else
    true
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""does NOT support -I"
else
echo "$ac_t""does NOT support -I" 1>&1
fi
fi
/bin/rm -f conftest.f

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

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

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

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

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

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

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

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

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

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

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

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

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

	    fi
        fi
    fi
fi
GETNAME_DEFS="$DEFS"
DEFS="$SAVEDEFS"
#
# Check for message archive routines (to be used for internationalization)
#
SAVEDEFS="$DEFS"
DEFS=""
# 
# Some systems have these in /usr/xpg2lib/libxpg.a (our Suns did)
# The includes (for nl_types) might be in /usr/xpg2include 
# This hasn't been handled yet.
for func in catopen catclose catgets
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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


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

# Will need to generate binary form of file
# !!! We have a report that on Cray, gencat is a completely different command
# (parallel fscks?).  We're supposed to use 
# caterr -c cat_file msg_file.  Instead, we'll skip it
if test -n "$device_td3" ; then 
 # May try caterr -c cat_file msg_file
 print_error "Configure needs the gencat program to generate message catalogs"
 print_error "Some (all?) Cray T3D systems have a program named gencat"
 print_error "that performs file system checks instead.  For this reason,"
 print_error "message catalogs will not be created for the T3D device."
 print_error "You may be able to use the caterr command instead."
 print_error "MPICH will work without the message catalogs (though the"
 print_error "ability to generate error messages in languages other than"
 print_error "US English will be lost)."
else
 # Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

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

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

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

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

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


fi
rm -fr conftest*

fi
rm -f conftest*


fi
rm -f conftest*

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  
{
test -n "$verbose" && \
echo "	defining HAVE_STDARG_H"
echo "#define" HAVE_STDARG_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_STDARG_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STDARG_H\${SEDdB}HAVE_STDARG_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_STDARG_H\${SEDuB}HAVE_STDARG_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_STDARG_H\${SEDeB}HAVE_STDARG_H\${SEDeC}1\${SEDeD}
"
}

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

#
# It isn't enough to check for stdarg.  Even gcc doesn't get it right;
# on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
# OPTIONS (causing it to choose the OLD STYLE va_start etc).
#
if test -n "$havestdarg" ; then
    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

/* DEC Alpha compiler by default does NOT define __STDC__ but DOES
   accept prototypes */
#if !defined(__STDC__)
'bad text'
#endif
#include <stdio.h>
#include <stdarg.h>
int func( int a, ... ){
int b;
va_list ap;
va_start( ap, a );
b = va_arg(ap, int);
printf( "%d-%d\n", a, b );
va_end(ap);
fflush(stdout);
return 0;
}
int main() { func( 1, 2 ); return 0;}
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining USE_STDARG"
echo "#define" USE_STDARG 1 >> confdefs.h
DEFS="$DEFS -DUSE_STDARG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_STDARG\${SEDdB}USE_STDARG\${SEDdC}1\${SEDdD}
\${SEDuA}USE_STDARG\${SEDuB}USE_STDARG\${SEDuC}1\${SEDuD}
\${SEDeA}USE_STDARG\${SEDeB}USE_STDARG\${SEDeC}1\${SEDeD}
"
}

MPE_CFLAGS="$MPE_CFLAGS -DUSE_STDARG"

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

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

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

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

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

fi

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

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


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

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

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


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

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

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

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

else
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
   
fi
rm -f conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
  
{
test -n "$verbose" && \
echo "	defining $ac_tr_hdr"
echo "#define" $ac_tr_hdr 1 >> confdefs.h
DEFS="$DEFS -D$ac_tr_hdr=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$ac_tr_hdr\${SEDdB}$ac_tr_hdr\${SEDdC}1\${SEDdD}
\${SEDuA}$ac_tr_hdr\${SEDuB}$ac_tr_hdr\${SEDuC}1\${SEDuD}
\${SEDeA}$ac_tr_hdr\${SEDeB}$ac_tr_hdr\${SEDeC}1\${SEDeD}
"
}
 
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
done

#
# Turn off F77
# One problem with this is that some part of the ar will fail.  Lets hope
# it isn't fatal.  We've tried to fix this by defining MPI_FOBJECTS
# as the object files created from Fortran.
if test $NOF77 = 1 ; then
  F77="echo no Fortran compiler"
  FLINKER="$F77"
fi
#
#
# Check for erroneous C compilers
broken=0
do_test=1
if test $cross_compiling = 1 ; then
   if test "$CC" = mpcc ; then 
	TESTCC=xlc
   elif test "$CC" = mpCC ; then
        TESTCC=xlC
   else
        do_test=0
   fi
else 
    # If not cross compiling, testcc is just the compiler
    TESTCC="$CC"
fi
# 
# Should eventually use a file like $file.run to see if the program should
# be run or just compiled.  And eventually, this should be run EARLY,
# before checking for things like functions and include files.
#


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

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

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

else
  rm -rf conftest*
  eval "ac_cv_ccworks=no"
   
fi
rm -f conftest*

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

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

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

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking Fortran has pointer declaration""... $ac_c"
else
echo $ac_n "checking Fortran has pointer declaration""... $ac_c" 1>&1
fi
cat > conftest.f <<EOF
        program main
        integer M
        pointer (MPTR,M)
        data MPTR/0/
        end
EOF
/bin/rm -f conftest.out
$F77 $FFLAGS -c conftest.f > conftest.out 2>&1
if test $? != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    if test -n "$F77_VERBOSE" ; then
        echo "Fortran compiler returned non-zero return code"
        if test -s conftest.out ; then
	    echo "Output from test was"
            cat conftest.out
        fi
    fi
    f77_pointer=0
elif test ! -s conftest.o ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
    if test -n "$F77_VERBOSE" ; then
        echo "Fortran compiler did not produce object file"
        if test -s conftest.out ; then
	    echo "Output from test was"
            cat conftest.out
        fi
    fi
    f77_pointer=0
else    
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
    f77_pointer=1
fi
rm -f conftest* 

    fi

fi
if test $do_test = 1 ; then
    

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

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

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

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

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

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

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

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

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

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

pointersize=""
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but 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 void *""... $ac_c"
else
echo $ac_n "checking for size of void *""... $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(void *));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
        echo "Execution of test program failed"
        Pac_CV_NAME=""

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

if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
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=""
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but 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 int""... $ac_c"
else
echo $ac_n "checking for size of int""... $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(int));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
        echo "Execution of test program failed"
        Pac_CV_NAME=""

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

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for size of void *""... $ac_c"
else
echo $ac_n "checking for size of void *""... $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(void *));
  exit(0);
}
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    Pac_CV_NAME=""

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

      else
        echo "Execution of test program failed"
        Pac_CV_NAME=""

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

if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$Pac_CV_NAME"
else
echo "$ac_t""$Pac_CV_NAME" 1>&1
fi
else
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""unavailable"
else
echo "$ac_t""unavailable" 1>&1
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

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

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

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

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

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

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

if test $ldok = 1 ; then
cat > conftest.c <<EOF
#include "confdefs.h"
int main() {
/* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
exit(sizeof(long double) < sizeof(double)); }
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_DOUBLE"
echo "#define" HAVE_LONG_DOUBLE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LONG_DOUBLE\${SEDdB}HAVE_LONG_DOUBLE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LONG_DOUBLE\${SEDuB}HAVE_LONG_DOUBLE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LONG_DOUBLE\${SEDeB}HAVE_LONG_DOUBLE\${SEDeC}1\${SEDeD}
"
}
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi

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

    if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but 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 int""... $ac_c"
else
echo $ac_n "checking for long long int""... $ac_c" 1>&1
fi
cat > conftest.c <<EOF
#include "confdefs.h"
int main() {
/* See long double test; this handles the possibility that long long int 
   has the same problem on some systems */
exit(sizeof(long long int) < sizeof(long)); }
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; 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}
"
}
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi

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

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

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

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

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

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

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

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

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

    if test $doublesize -eq $longdoublesize ; then
	# Suppress long double if == double?
	# NOSHORTLONGS=1
     print_error "If you get warning messages about long doubles not supported"
     print_error "on $ARCH, use the -no_short_longs argument to configure."
    fi
fi
#
# Look for wish (the tcl/tk windowing shell; this is used by the new
# Upshot
#
if test -z "$wishloc" ; then
    wishloc=""
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but 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 wish""... $ac_c"
else
echo $ac_n "checking for wish""... $ac_c" 1>&1
fi
# Look for wish in the path
IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
for dir in $PATH ; do 
    if test -x $dir/wish ; then
	wishloc=$dir/wish
        break
    elif test -x $dir/tcl7.3-tk3.6/bin/wish ; then
	wishloc=$dir/tcl7.3-tk3.6/bin/wish
	break
    elif test -x $dir/tcl7.4-tk4.0/bin/wish ; then
        wishloc=$dir/tcl7.4-tk4.0/bin/wish
	break
    fi
done
IFS="$saveifs"
# Look for wish elsewhere
if test -z "$wishloc" ; then
for dir in \
    /usr/local/bin \
    /usr/local/tk-3.3/bin \
    /usr/local/tcl7.3-tk3.6/bin \
    /usr/local/tcl7.0/bin \
    /usr/local/tcl7.0-tk3.3/bin \
    /usr/contrib/bin \
    /usr/contrib/tk3.6/bin \
    /usr/contrib/tcl7.3-tk3.6/bin \
    /usr/contrib/tk3.3/bin \
    /usr/contrib/tcl7.0-tk3.3/bin \
    $HOME/tcl/bin \
    $HOME/tcl7.3/bin \
    /opt/Tcl/bin \
    /opt/bin \
    /usr/unsupported \
    /usr/unsupported/bin \
    /usr/bin \
    /bin \
    /usr/sgitcl \
    /local/encap/tcl-7.1/bin ; do
    if test -x $dir/wish ; then
	wishloc=$dir/wish
        break
    fi
done
fi
if test -n "$wishloc" ; then 
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $wishloc"
else
echo "$ac_t""found $wishloc" 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
#
# Test that wish exists
if test -n "$wishloc" ; then
   namelen=`expr "$wishloc" : ".*"`
   if test $namelen -gt 26 ; then
	print_error "The path for wish, $wishloc, may be too long"
        print_error "for some Unix systems to accept as a command interpreter."
	print_error "This may cause problems when using upshot."
        print_error "(Some systems limit the length to 26 characters!)"
   fi
   if test ! -x $wishloc ; then
       wishloc=
   fi
fi
if test -z "$wishloc" ; then
    print_error "Could not find executable wish (needed for Upshot)"
fi
if test -z "$TCL_DIR" ; then
    
# Look for Tcl
if test -z "$TCL_DIR" ; then
# Extract the first word of "tclsh", so it can be a program name with args.
set dummy tclsh; 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 "$TCLSH"; then
  ac_pg_TCLSH="$TCLSH" # Let the user override the test.
else
  ac_first_char=`expr "tclsh" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "tclsh" ; then
       ac_pg_TCLSH="1"
       ac_prog_where=tclsh
  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_TCLSH="1"
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;TCLSH="$ac_pg_TCLSH"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($TCLSH)"
else
echo "$ac_t""found $ac_prog_where ($TCLSH)" 1>&1
fi
   tclshloc=$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 "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but 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 Tcl""... $ac_c"
else
echo $ac_n "checking for Tcl""... $ac_c" 1>&1
fi
# See if tclsh is in the path
if test -n "$tclshloc" ; then
    cat >conftest <<EOF
puts stdout \$tcl_library
EOF
    tcllibloc=`$tclshloc conftest`
    # The tcllibloc is the directory containing the .tcl files.  
    # The .a files may be one directory up
    tcllibloc=`dirname $tcllibloc`
    # and the lib directory one above that
    tcllibs="$tcllibloc `dirname $tcllibloc`"
    /bin/rm -f conftest   
fi
for dir in $tcllibs \
    /usr \
    /usr/local \
    /usr/local/tcl7.5 \
    /usr/local/tcl7.3 \
    /usr/local/tcl7.3-tk3.6 \
    /usr/local/tcl7.0 \
    /usr/local/tcl7.0-tk3.3 \
    /usr/local/tcl7.* \
    /usr/contrib \
    /usr/contrib/tk3.6 \
    /usr/contrib/tcl7.3-tk3.6 \
    /usr/contrib/tk3.3 \
    /usr/contrib/tcl7.0-tk3.3 \
    $HOME/tcl \
    $HOME/tcl7.3 \
    $HOME/tcl7.5 \
    /opt/Tcl \
    /opt/local \
    /opt/local/tcl7.5 \
    /opt/local/tcl7.* \
    /usr/bin \
    /Tools/tcl \
    /usr/sgitcl \
    /local/encap/tcl-7.1 ; do
    if test -r $dir/include/tcl.h ; then 
        if test -r $dir/lib/libtcl.a -o -r $dir/lib/libtcl.so ; then
 	    TCL_DIR=$dir
	    break
        fi
	for file in $dir/lib/libtcl*.a ; do
	    if test -r $file ; then 
                TCL_DIR_W="$TCL_DIR_W $file"
	    fi
	done
    fi
done
fi
if test -n "$TCL_DIR" ; then 
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $TCL_DIR/include/tcl.h and $TCL_DIR/lib/libtcl"
else
echo "$ac_t""found $TCL_DIR/include/tcl.h and $TCL_DIR/lib/libtcl" 1>&1
fi
else
  if test -n "$TCL_DIR_W" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $TCL_DIR_W but need libtcl.a"
else
echo "$ac_t""found $TCL_DIR_W but need libtcl.a" 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
# Look for Tk (look in tcl dir if the code is nowhere else)
if test -z "$TK_DIR" ; 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 Tk""... $ac_c"
else
echo $ac_n "checking for Tk""... $ac_c" 1>&1
fi
if test -n "$wishloc" ; then
    cat >conftest <<EOF
puts stdout \$tk_library
exit
EOF
    tklibloc=`$wishloc -file conftest`
    # The tklibloc is the directory containing the .k files.  
    # The .a files may be one directory up
    tklibloc=`dirname $tklibloc`
    # and the lib directory one above that
    tklibs="$tklibloc `dirname $tklibloc`"
    /bin/rm -f conftest   
fi
for dir in $tklibs \
    /usr \
    /usr/local \
    /usr/local/tk3.6 \
    /usr/local/tcl7.3-tk3.6 \
    /usr/local/tk3.3 \
    /usr/local/tcl7.0-tk3.3 \
    /usr/contrib \
    /usr/contrib/tk3.6 \
    /usr/contrib/tcl7.3-tk3.6 \
    /usr/contrib/tk3.3 \
    /usr/contrib/tcl7.0-tk3.3 \
    $HOME/tcl \
    $HOME/tcl7.3 \
    /opt/Tcl \
    /opt/local \
    /opt/local/tk3.6 \
    /usr/bin \
    /Tools/tk \
    /usr/sgitcl \
    /local/encap/tk-3.4 $TCL_DIR ; do
    if test -r $dir/include/tk.h ; then 
        if test -r $dir/lib/libtk.a -o -r $dir/lib/libtk.so ; then
	    TK_DIR=$dir
	    break
	fi
	for file in $dir/lib/libtk*.a ; do
	    if test -r $file ; then 
                TK_DIR_W="$TK_DIR_W $file"
	    fi
	done
    fi
done
fi
if test -n "$TK_DIR" ; then 
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $TK_DIR/include/tk.h and $TK_DIR/lib/libtk"
else
echo "$ac_t""found $TK_DIR/include/tk.h and $TK_DIR/lib/libtk" 1>&1
fi
else
  if test -n "$TK_DIR_W" ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $TK_DIR_W but need libtk.a (and version 3.6) "
else
echo "$ac_t""found $TK_DIR_W but need libtk.a (and version 3.6) " 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 -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

fi
#
# Test the tcl was found
if test -z "$TCL_DIR" ; then
    print_error "Could not find libraries for TCL and TK (needed for Nupshot)"
fi
#
# Get TK version for Upshot.
TK_VERSION="3.6"
if test -n "$TK_DIR" -a $cross_compiling != 1 ; then
    if test -z "$XINCLUDES" ; then
	# Try to find X11 needed for TK_VERSION
	
   # FIND_X doesn't always work correctly when cross compiling, so we
   # try to be more careful and conservative
   if test -z "$USERXLIB" ; then 
    # The user has specified the libraries/include paths; pick them up 
    # below....
    if test -z "$cross_compiling" -o "$cross_compiling" = 0 ; then 
       # If we find X, set shell vars x_includes and x_libraries to the paths.
no_x=true
echo checking for X include and library files with xmkmf
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  cat > Imakefile <<\EOF
acfindx:
	@echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    no_x=
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `make acfindx | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
      im_usrlibdir=$im_libdir
    fi
    case "$im_incroot" in
	/usr/include) ;;
	*) x_includes="$im_incroot" ;;
    esac
    case "$im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) x_libraries="$im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test -z "$im_usrlibdir"; then
echo checking for X include and library files directly
cat > conftest.c <<EOF
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  no_x=

else
  rm -rf conftest*
  for dir in \
    /usr/local/include \
    /usr/unsupported/include \
    /usr/x386/include \
    /usr/local/X11R6/include \
    /usr/local/X11R5/include \
    /usr/local/x11r6/include \
    /usr/local/x11r5/include \
    /usr/include/X11R6 \
    /usr/include/X11R5 \
    /usr/include/X11R4 \
    /usr/X11R6/include \
    /usr/X11R5/include \
    /usr/X11/include \
    /usr/openwin/include \
    /usr/openwin/share/include \
    /usr/lpp/Xamples/include \
    ; \
  do
    if test -r $dir/X11/Intrinsic.h; then
      x_includes=$dir; no_x=
      break
    fi
  done
fi
rm -f conftest*

# Check for the libraries.  First see if replacing the `include' by
# `lib' works.
LIBS_save="${LIBS}"
LIBS="${LIBS} -lXt"
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 -lXt""... $ac_c"
else
echo $ac_n "checking for -lXt""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; no_x=
else
   :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  /usr/local/lib \
  /usr/unsupported/lib \
  /usr/x386/lib \
  /usr/local/X11R6/lib \
  /usr/local/X11R5/lib \
  /usr/local/x11r6/lib \
  /usr/local/x11r5/lib \
  /usr/lib/X11 \
  /usr/lib/X11R4 \
  /usr/X11R6/lib \
  /usr/X11R5/lib \
  /usr/X11/lib \
  /usr/openwin/lib \
  /usr/lpp/Xamples/lib \
  ; \
do
  for extension in a so sl; do
    if test -r $dir/libXt.$extension; then
      x_libraries=$dir; no_x=
      break 2
    fi
  done
done
fi

fi
if test -n "$verbose"; then
  test -n "$x_includes" && echo "	found X11 headers in $x_includes"
  test -n "$x_libraries" && echo "	found X11 libraries in $x_libraries"
fi
       if test -n "$no_x" ; then
	  print_error "Did not find X11 libraries and/or include files"
       fi
    else
       # Try to compile a program with an include file.
       # I didn't use HEADER_CHECK because I want to insist that the 
       # code try to compile with the header
       no_x=true
       if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for X11 headers""... $ac_c"
else
echo $ac_n "checking for X11 headers""... $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 <X11/Xlib.h>
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
  rm -rf conftest*
  no_x=""

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

       if test -z "$no_x" ; then 
          # Try to link a simple X program
          LIBS_save="${LIBS}"
LIBS="${LIBS} -lX11"
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 -lX11""... $ac_c"
else
echo $ac_n "checking for -lX11""... $ac_c" 1>&1
fi
if test ! -f confdefs.h ; then
    if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t"""!! SHELL ERROR !!""
else
echo "$ac_t"""!! SHELL ERROR !!"" 1>&1
fi
    echo "The file confdefs.h created by configure has been removed"
    echo "This may be a problem with your shell; some versions of LINUX"
    echo "have this problem.  See the Installation guide for more"
    echo "information."
    exit 1
fi
cat > conftest.c <<EOF
#include "confdefs.h"

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

   else if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; no_x=""
else
   :; no_x="true"
fi

       fi
       if test -n "$no_x" ; then
         print_error " " 
         print_error "X11 is not used when cross compiling (because of the"
         print_error "difficulties in finding the correct libraries)"
         print_error " "
       fi
     fi
   else
	# Pick up the paths from the user if possible
	if test -z "$x_includes" -a -n "$X11INC" ; then 
	    x_includes="$X11INC"
            XINCLUDES="-Ix_includes"
	fi
	if test -z "$x_libraries" -a -n "$X11LIB" ; then 
	    x_libraries="$X11LIB"
	fi
   fi
   if test -n "$x_includes" ; then
       XINCLUDES="-I$x_includes"
   fi
   if test -z "$no_x" ; then
       # may STILL not have x if the include files aren't around
       if test -n "$x_includes" ; then
           f_test=$x_includes/X11/Xlib.h
       else
           f_test=/usr/include/X11/Xlib.h
       fi
       if test ! -f $f_test ; then
           no_x=yes
	   print_error "X11 include files were not found in $f_test!"
       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 version of TK""... $ac_c"
else
echo $ac_n "checking for version of TK""... $ac_c" 1>&1
fi
/bin/rm -f conftestval
#
# Some systems have a separate tcl dir; since we need both tcl and tk
# we include both directories
if test -n "$TK_DIR" -a -n "$TCL_DIR" ; then
  CFLAGSsave="$CFLAGS"
  CFLAGS="$CFLAGS -I$TK_DIR/include -I$TCL_DIR/include $XINCLUDES"
  

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 "tk.h"
#include <stdio.h>
main() { FILE *fp = fopen( "conftestval", "w" ); 
fprintf( fp, "%d.%d", TK_MAJOR_VERSION, TK_MINOR_VERSION );
return 0; }
EOF
    eval $compile
    if test ! -s conftest ; then
      echo "Could not build executable program:"
      echo "${CC-cc} $CFLAGS conftest.c -o conftest $LIBS"
      ${CC-cc} $CFLAGS conftest.c -o conftest $LIBS 
    TK_VERSION="unavailable"

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

      else
        echo "Execution of test program failed"
        TK_VERSION="unavailable"

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

  CFLAGS="$CFLAGSsave"
elif test -n "$wishloc" ; then
  # It is possible to use a wish program with
  # set tk_version [ string range $tk_patchLevel 0 2 ]
  # puts stdout $tk_version
  TK_VERSION="unavailable"
else
  TK_VERSION="unavailable"
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""$TK_VERSION"
else
echo "$ac_t""$TK_VERSION" 1>&1
fi

fi
#
# Set the location of the bitmaps
#
USER_CFLAGS="$CFLAGS $USER_DEFS"
CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
#
if test $is_adi1 = 0 ; then
    
{
test -n "$verbose" && \
echo "	defining MPI_ADI2"
echo "#define" MPI_ADI2 1 >> confdefs.h
DEFS="$DEFS -DMPI_ADI2=1"
SEDDEFS="${SEDDEFS}\${SEDdA}MPI_ADI2\${SEDdB}MPI_ADI2\${SEDdC}1\${SEDdD}
\${SEDuA}MPI_ADI2\${SEDuB}MPI_ADI2\${SEDuC}1\${SEDuD}
\${SEDeA}MPI_ADI2\${SEDeB}MPI_ADI2\${SEDeC}1\${SEDeD}
"
}

        CFLAGS="$CFLAGS -I../../mpid/ch2 -I../../lib/$ARCH/$COMM"
    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
fi
if test $is_adi1 = 1 -a -z "$adi1_ok" ; then
    cat <<EOF
The MPICH implementation of MPI no longer supports the ADI-1 interface.
The supported devices are all ADI-2 interfaces (e.g., ch_p4, ch_shmem, 
ch_nx, etc.).  

All implementors that we know about are notified about changes in the MPICH
implementation.  If you are an implementor using MPICH, please let us know
about you so that we can add you to the list of MPICH developers.  Send
mail to mpi-bugs@mcs.anl.gov and asked to be added to the MPICH developers 
list.
EOF
    exit 1
fi
LIB_PATH="-L$MPIR_HOME/lib/$ARCH/$COMM $LIB_PATH"
#
# hpux's Fortran compiler f77 (but not the POSIX version fort77) does
# not accept -L <dir> for library search path.
FLIB_PATH_LEADER="-L"
if test -n "$arch_hpux" -a "$F77" = "f77" ; then
   FLIB_PATH=`echo $LIB_PATH | sed -e 's/-L/-Wl,-L,/g'`
   FLIB_PATH_LEADER="-Wl,-L,"
else
   FLIB_PATH="$LIB_PATH"
fi
#
# Add any user libraries
if test -n "$USERLIB" ; then
    LIB_LIST="$LIB_LIST $USERLIB"
fi
#
# mpirun needs sync to try and fix NFS problems on some machines.  Some
# users may not have sync in their path, so we try to find it here.
SYNCLOC=""
# Extract the first word of "sync", so it can be a program name with args.
set dummy sync; ac_word=$2
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

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

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking for $ac_word""... $ac_c"
else
echo $ac_n "checking for $ac_word""... $ac_c" 1>&1
fi
ac_prog_where=""
if test -n "$HOSTNAME_PGM"; then
  ac_pg_HOSTNAME_PGM="$HOSTNAME_PGM" # Let the user override the test.
else
  ac_first_char=`expr "hostname" : "\(.\)"`
  if test "$ac_first_char" = "/" -a -x "hostname" ; then
       ac_pg_HOSTNAME_PGM=""
       ac_prog_where=hostname
  else
      IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
      for ac_dir in $PATH; do
        test -z "$ac_dir" && ac_dir=.
        if test -f $ac_dir/$ac_word; then
          ac_pg_HOSTNAME_PGM=""
          ac_prog_where=$ac_dir/$ac_word
          break
        fi
      done
      IFS="$ac_save_ifs"
  fi
fi;HOSTNAME_PGM="$ac_pg_HOSTNAME_PGM"
if test -n "$ac_prog_where" ; then
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""found $ac_prog_where ($HOSTNAME_PGM)"
else
echo "$ac_t""found $ac_prog_where ($HOSTNAME_PGM)" 1>&1
fi
   hostname=$ac_prog_where  
else
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
fi

        if test -x "$hostname" ; then
	    HOST="`$hostname`"
        fi
        # Note that uname -n may not produce a usable hostname.  
	# Any suggestions?
        if test "$HOST" = "" ; then
	    HOST="`uname -n`"
        fi
   	cat > util/machines/machines.$ARCH <<.
$HOST
$HOST
$HOST
$HOST
$HOST
.
	echo "Created util/machines/machines.$ARCH with five copies of $HOST"
	echo "You may want to edit this file to add and delete hosts"
	echo "(These hosts are used by mpirun.)"
    fi
fi
#
# Make sure that configure is group writable
#
chmod g+w configure > /dev/null 2>&1
#
# BASE_LIB_LIST lets us separate the MPI library from the other libs
BASE_LIB_LIST="$LIB_LIST"
# used to be LIB_LIST="$LIB_LIST -lmpi" I switched it, inspired by HPUX
LIB_LIST="-l$MPILIBNAME $LIB_LIST"
#
# Generate the name for the MPI-C, MPI-CC, and MPI-F77 compilers (for use
# in Makefiles that should not be MPICH dependent
MPICC=$MPIR_HOME/lib/$ARCH/$COMM/mpicc
MPIF77=$MPIR_HOME/lib/$ARCH/$COMM/mpif77
MPICPLUSPLUS=$MPIR_HOME/lib/$ARCH/$COMM/mpiCC
LIB_DIR=$MPIR_HOME/lib/$ARCH/$COMM
#
# Some mpi2 commands supported (for the testing scripts)
HAS_MPI2=1
#
# Substitute variables
# Variables used in scripts only
# We really need to unify RSHCOMMAND and RSH_COMMAND
RSHCOMMAND=$rshcommand
# FINC contains an @MPIR_HOME@, so it needs to come first
# Variables defined ONLY for the doc/port file:
# Variables used by Makefile.in's:
# P4_MDEPCFLAGS now used only in doc/port.in
#
# src/env/farg.f
# 
# End configuration file
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

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

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

trap 'rm -fr Makefile util/Makefile examples/Makefile examples/test/Makefile examples/test/pt2pt/Makefile examples/test/coll/Makefile examples/test/topol/Makefile examples/test/context/Makefile examples/test/env/Makefile examples/test/profile/Makefile examples/test/lederman/Makefile examples/contrib/Makefile examples/contrib/usingmpi/Makefile examples/contrib/life/Makefile examples/contrib/nuclei/Makefile examples/contrib/C++/Makefile examples/contrib/mandel-pvm/Makefile examples/perftest/Makefile src/pt2pt/Makefile src/coll/Makefile src/context/Makefile src/dmpi/Makefile src/env/Makefile src/topol/Makefile src/profile/Makefile src/util/Makefile src/c++/Makefile mpe/Makefile mpe/Makefile_nompi examples/basic/Makefile profiling/examples/Makefile profiling/lib/Makefile mpe/contrib/mandel/Makefile mpe/contrib/mastermind/Makefile mpe/contrib/life/Makefile mpe/test/Makefile  mpichconf.h conftest*; exit 1' 1 3 15
CC='$CC'
RANLIB='$RANLIB'
CPP='$CPP'
CCval='$CCval'
F77val='$F77val'
XTERMLOC='$XTERMLOC'
GDBLOC='$GDBLOC'
DBXLOC='$DBXLOC'
AUTOMOUNTFIX='$AUTOMOUNTFIX'
RSHCOMMAND='$RSHCOMMAND'
RSH_COMMAND='$RSH_COMMAND'
FINC='$FINC'
wishloc='$wishloc'
TK_DIR='$TK_DIR'
TCL_DIR='$TCL_DIR'
TK_VERSION='$TK_VERSION'
SYNCLOC='$SYNCLOC'
COMPRESSEDPKT='$COMPRESSEDPKT'
CONFIGURE_ARGS='$CONFIGURE_ARGS'
CONFIGURE_ARGS_CLEAN='$CONFIGURE_ARGS_CLEAN'
NODEVDEBUG='$NODEVDEBUG'
PKTSIZE='$PKTSIZE'
VARPKT='$VARPKT'
LIMITEDBUFFERS='$LIMITEDBUFFERS'
ADI_COLLECTIVE='$ADI_COLLECTIVE'
cross_compiling='$cross_compiling'
ASM='$ASM'
ASMFILES_O='$ASMFILES_O'
AR='$AR'
ARCH='$ARCH'
BASE_LIB_LIST='$BASE_LIB_LIST'
BOPT='$BOPT'
CFLAGS='$CFLAGS'
CLINKER='$CLINKER'
CCFLAGS='$CCFLAGS'
CCLINKER='$CCLINKER'
COMM='$COMM'
CPP_COMPILER='$CPP_COMPILER'
CPP_DIR='$CPP_DIR'
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'
FLINKER='$FLINKER'
GETNAME_DEFS='$GETNAME_DEFS'
HAS_FORTRAN='$HAS_FORTRAN'
HAS_MPI2='$HAS_MPI2'
ICCLIB='$ICCLIB'
INCLUDE_PATH='$INCLUDE_PATH'
LIB_LIST='$LIB_LIST'
LIB_PATH='$LIB_PATH'
LIB_DIR='$LIB_DIR'
MAKE='$MAKE'
MPEGRAPHICS_FOBJS='$MPEGRAPHICS_FOBJS'
MPEGRAPHICS_FSOURCE='$MPEGRAPHICS_FSOURCE'
MPEGRAPHICS_OBJS='$MPEGRAPHICS_OBJS'
MPEGRAPHICS_SOURCE='$MPEGRAPHICS_SOURCE'
MPE_CFLAGS='$MPE_CFLAGS'
MPE_DIR='$MPE_DIR'
MPE_GRAPHICS='$MPE_GRAPHICS'
MPE_LIBS='$MPE_LIBS'
MPE_MPI_EXT_C='$MPE_MPI_EXT_C'
MPE_MPI_EXT_O='$MPE_MPI_EXT_O'
MPIR_HOME='$MPIR_HOME'
MPIFDEP='$MPIFDEP'
MPI_FOBJECTS='$MPI_FOBJECTS'
MPILIBNAME='$MPILIBNAME'
MPICC='$MPICC'
MPIF77='$MPIF77'
MPICPLUSPLUS='$MPICPLUSPLUS'
MEMDEBUG='$MEMDEBUG'
NEXUSDIR='$NEXUSDIR'
NLS_DEFS='$NLS_DEFS'
OPTFLAGS='$OPTFLAGS'
OPTFLAGSC='$OPTFLAGSC'
OPTFLAGSF='$OPTFLAGSF'
P4_ARCH='$P4_ARCH'
P4_DIR='$P4_DIR'
RHS_COMMAND='$RHS_COMMAND'
P4_MDEPCFLAGS='$P4_MDEPCFLAGS'
PREFIX='$PREFIX'
USER_CFLAGS='$USER_CFLAGS'
USER_INCLUDE_PATH='$USER_INCLUDE_PATH'
X_INC='$X_INC'
X_LIB='$X_LIB'
F77IARGC='$F77IARGC'
F77GETARG='$F77GETARG'
F90UNIX='$F90UNIX'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile util/Makefile examples/Makefile examples/test/Makefile examples/test/pt2pt/Makefile examples/test/coll/Makefile examples/test/topol/Makefile examples/test/context/Makefile examples/test/env/Makefile examples/test/profile/Makefile examples/test/lederman/Makefile examples/contrib/Makefile examples/contrib/usingmpi/Makefile examples/contrib/life/Makefile examples/contrib/nuclei/Makefile examples/contrib/C++/Makefile examples/contrib/mandel-pvm/Makefile examples/perftest/Makefile src/pt2pt/Makefile src/coll/Makefile src/context/Makefile src/dmpi/Makefile src/env/Makefile src/topol/Makefile src/profile/Makefile src/util/Makefile src/c++/Makefile mpe/Makefile mpe/Makefile_nompi examples/basic/Makefile profiling/examples/Makefile profiling/lib/Makefile mpe/contrib/mandel/Makefile mpe/contrib/mastermind/Makefile mpe/contrib/life/Makefile mpe/test/Makefile "}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  sed -e "
$prsub
$extrasub
s%@CC@%$CC%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@CCval@%$CCval%g
s%@F77val@%$F77val%g
s%@XTERMLOC@%$XTERMLOC%g
s%@GDBLOC@%$GDBLOC%g
s%@DBXLOC@%$DBXLOC%g
s%@AUTOMOUNTFIX@%$AUTOMOUNTFIX%g
s%@RSHCOMMAND@%$RSHCOMMAND%g
s%@RSH_COMMAND@%$RSH_COMMAND%g
s%@FINC@%$FINC%g
s%@wishloc@%$wishloc%g
s%@TK_DIR@%$TK_DIR%g
s%@TCL_DIR@%$TCL_DIR%g
s%@TK_VERSION@%$TK_VERSION%g
s%@SYNCLOC@%$SYNCLOC%g
s%@COMPRESSEDPKT@%$COMPRESSEDPKT%g
s%@CONFIGURE_ARGS@%$CONFIGURE_ARGS%g
s%@CONFIGURE_ARGS_CLEAN@%$CONFIGURE_ARGS_CLEAN%g
s%@NODEVDEBUG@%$NODEVDEBUG%g
s%@PKTSIZE@%$PKTSIZE%g
s%@VARPKT@%$VARPKT%g
s%@LIMITEDBUFFERS@%$LIMITEDBUFFERS%g
s%@ADI_COLLECTIVE@%$ADI_COLLECTIVE%g
s%@cross_compiling@%$cross_compiling%g
s%@ASM@%$ASM%g
s%@ASMFILES_O@%$ASMFILES_O%g
s%@AR@%$AR%g
s%@ARCH@%$ARCH%g
s%@BASE_LIB_LIST@%$BASE_LIB_LIST%g
s%@BOPT@%$BOPT%g
s%@CFLAGS@%$CFLAGS%g
s%@CLINKER@%$CLINKER%g
s%@CCFLAGS@%$CCFLAGS%g
s%@CCLINKER@%$CCLINKER%g
s%@COMM@%$COMM%g
s%@CPP_COMPILER@%$CPP_COMPILER%g
s%@CPP_DIR@%$CPP_DIR%g
s%@CPRP@%$CPRP%g
s%@DEFAULT_MACHINE@%$DEFAULT_MACHINE%g
s%@DEVCFLAGS@%$DEVCFLAGS%g
s%@DEVCFILES@%$DEVCFILES%g
s%@DEVOFILES@%$DEVOFILES%g
s%@DEV_DEFS@%$DEV_DEFS%g
s%@DEVICE@%$DEVICE%g
s%@DEVICE_MAKE_INCLUDE@%$DEVICE_MAKE_INCLUDE%g
s%@F77@%$F77%g
s%@FAST_COPY@%$FAST_COPY%g
s%@FFLAGS@%$FFLAGS%g
s%@FLIB_PATH@%$FLIB_PATH%g
s%@FLIB_PATH_LEADER@%$FLIB_PATH_LEADER%g
s%@FLINKER@%$FLINKER%g
s%@GETNAME_DEFS@%$GETNAME_DEFS%g
s%@HAS_FORTRAN@%$HAS_FORTRAN%g
s%@HAS_MPI2@%$HAS_MPI2%g
s%@ICCLIB@%$ICCLIB%g
s%@INCLUDE_PATH@%$INCLUDE_PATH%g
s%@LIB_LIST@%$LIB_LIST%g
s%@LIB_PATH@%$LIB_PATH%g
s%@LIB_DIR@%$LIB_DIR%g
s%@MAKE@%$MAKE%g
s%@MPEGRAPHICS_FOBJS@%$MPEGRAPHICS_FOBJS%g
s%@MPEGRAPHICS_FSOURCE@%$MPEGRAPHICS_FSOURCE%g
s%@MPEGRAPHICS_OBJS@%$MPEGRAPHICS_OBJS%g
s%@MPEGRAPHICS_SOURCE@%$MPEGRAPHICS_SOURCE%g
s%@MPE_CFLAGS@%$MPE_CFLAGS%g
s%@MPE_DIR@%$MPE_DIR%g
s%@MPE_GRAPHICS@%$MPE_GRAPHICS%g
s%@MPE_LIBS@%$MPE_LIBS%g
s%@MPE_MPI_EXT_C@%$MPE_MPI_EXT_C%g
s%@MPE_MPI_EXT_O@%$MPE_MPI_EXT_O%g
s%@MPIR_HOME@%$MPIR_HOME%g
s%@MPIFDEP@%$MPIFDEP%g
s%@MPI_FOBJECTS@%$MPI_FOBJECTS%g
s%@MPILIBNAME@%$MPILIBNAME%g
s%@MPICC@%$MPICC%g
s%@MPIF77@%$MPIF77%g
s%@MPICPLUSPLUS@%$MPICPLUSPLUS%g
s%@MEMDEBUG@%$MEMDEBUG%g
s%@NEXUSDIR@%$NEXUSDIR%g
s%@NLS_DEFS@%$NLS_DEFS%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@OPTFLAGSC@%$OPTFLAGSC%g
s%@OPTFLAGSF@%$OPTFLAGSF%g
s%@P4_ARCH@%$P4_ARCH%g
s%@P4_DIR@%$P4_DIR%g
s%@RHS_COMMAND@%$RHS_COMMAND%g
s%@P4_MDEPCFLAGS@%$P4_MDEPCFLAGS%g
s%@PREFIX@%$PREFIX%g
s%@USER_CFLAGS@%$USER_CFLAGS%g
s%@USER_INCLUDE_PATH@%$USER_INCLUDE_PATH%g
s%@X_INC@%$X_INC%g
s%@X_LIB@%$X_LIB%g
s%@F77IARGC@%$F77IARGC%g
s%@F77GETARG@%$F77GETARG%g
s%@F90UNIX@%$F90UNIX%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $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


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


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

#
# Configure JUST the correct device file
CONFIG_FILES="mpid/$DEVICE/Makefile"
if test -f mpid/tests/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES mpid/tests/Makefile"
fi
if test -n "$device_ch_shmem" ; then
    if test -s mpid/ch_shmem/p2ptest/Makefile.in ; then
        CONFIG_FILES="$CONFIG_FILES mpid/ch_shmem/p2ptest/Makefile"
    fi
fi
if test -n "$device_ch_tcp" -a -s mpid/ch_tcp/p3/Makefile.in ; then
    CONFIG_FILES="$CONFIG_FILES  mpid/ch_tcp/p3/Makefile"
fi
export CONFIG_FILES
./config.status
CONFIG_FILES=""
#
# The programs that run on the front end need a different compiler
if test $cross_compiling != 1 ; then
    CONFIG_FILES="profiling/wrappergen/Makefile"
    # nupshot is handled with its own configure file
    #  "profiling/nupshot/Makefile"
    export CONFIG_FILES
    ./config.status
    CONFIG_FILES=""
else
    print_error Not creating Makefiles in profiling/wrappergen and nupshot
    print_error when cross-compiling for arch $ARCH and device $DEVICE.
    print_error profiling/nupshot and profiling/wrappergen both have
    print_error their own configure scripts.  You can use these on 
    print_error another platform to build these programs.
fi
#
# Scripts in util: Copy to lib directory
for src in mpicc mpiCC mpif77 mpiinstall ; do 
  (cd util ; cp $src ../lib/$ARCH/$COMM ) 
done
#
# Set the final choices of flags
if test "$is_adi1" = 1 ; then 
    if test "$MEMDEBUG" = "1" ; then
        /bin/rm -f include/mpisys.h
        (cd include ; echo "#define MPIR_MEMDEBUG" | cat - mpisys.h.in > mpisys.h)
    else 
        /bin/rm -f include/mpisys.h
        cp include/mpisys.h.in include/mpisys.h
    fi
fi

#
# If the test suite is part of the directory, generate its makefiles
if test -d tsuite ; then
    CONFIG_FILES="tsuite/Makefile tsuite/coll/Makefile tsuite/pt2pt/Makefile tsuite/mpitc2/Makefile"
    export CONFIG_FILES
    ./config.status
fi
#
# If the bugs directory is available, generate its makefiles
if test -d bugs ; then
    CONFIG_FILES="bugs/Makefile bugs/irecv/Makefile bugs/fort/Makefile bugs/sockperf/Makefile bugs/srleak/Makefile bugs/ssend/Makefile bugs/testsendrecv/Makefile bugs/wait/Makefile"
    export CONFIG_FILES
    ./config.status
fi
#
# If the xmpi directory is available, generate its files
if test -d xmpi ; then 
    CONFIG_FILES="xmpi/buildinfo.tcl"
    export CONFIG_FILES
    ./config.status
fi
#
# If the mpich-ibm testsuite is available, generate its files
if test -d examples/test/mpitc ; then
    CONFIG_FILES="examples/test/mpitc examples/test/mpitc/ccl examples/test/mpitc/comm examples/test/mpitc/dtyp examples/test/mpitc/env examples/test/mpitc/group examples/test/mpitc/pt2pt examples/test/mpitc/topo"
    export CONFIG_FILES
    ./config.status
fi
#
# If the doc/port.in file is available, generate it
if test -f doc/port.in ; then
    
CONFIG_FILES="doc/port doc/portbuild doc/portperf doc/porttest"
export CONFIG_FILES
./config.status
CONFIG_FILES=""
for pac_file in doc/port doc/portbuild doc/portperf doc/porttest ; do 
    /bin/rm -f .pactmp
    sed -e '1d' $pac_file > .pactmp
    /bin/rm -f $pac_file
    mv .pactmp $pac_file
    chmod a+x $pac_file
done

fi
#
# Remove the old config.status and copy new one; this allows mpireconfig to
# work with the current configuration.
# 
/bin/rm -f lib/$ARCH/$COMM/config.status
cp ./config.status lib/$ARCH/$COMM
#
# If we put the DEF values into this file, copy it to the library directory
# We also need the .in file for config.status (used by mpireconfig)
if test -f mpichconf.h ; then
    mv mpichconf.h lib/$ARCH/$COMM
    cp mpichconf.h.in lib/$ARCH/$COMM
fi
#
# Try to update the upshot script
#if test -f profiling/upshot/bin/upshot.in
#    CONFIG_FILES="profiling/upshot/bin/upshot"
#    export CONFIG_FILES
#    ./config.status
#    (cd profiling/upshot/bin ; /bin/rm -f .run1 ; \
#	sed -e '1d' upshot > .run1 ; \
#    /bin/rm -f upshot ; /bin/mv .run1 upshot ; chmod a+x upshot )
#fi
exit 0
