#! /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]
                   [-prefix=INSTALL_DIR]  
          	   [-cc=C_COMPILER]
                   [-opt=OPTFLAGS] [-make=MAKEPGM]
where
   ARCH_TYPE    = the type of machine that wrappergen is to be configured for
   INSTALL_DIR  = directory where wrappergen will be installed (optional)
   OPTFLAGS     = optimization flags to give the compilers (e.g. -g)
   MAKEPGM      = version of make to use
                  
One and only one 'arch', and 'prefix' argument should be provided.

The option '-opt' allows you to specify options for the C compiler
For example, '-opt=-O' chooses optimized code generation on many
systems.

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.

Sample Configure Usage:

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

  ./configure -arch=sun4 
  make 

Known architectures include
                  sun4      (SUN OS 4.x)
                  solaris   (Solaris; probably 2.x)
                  hpux      (HP UX)
                  rs6000    (AIX for IBM RS6000)
                  sgi       (Silicon Graphics IRIX 5.x or 6.x)
                  IRIX      (synonym for sgi)
                  meiko     (Meiko CS2)
                  CRAY      (CRAY XMP, YMP, C90)

         
Others may be recognized.
.
}
# End of print_usage.
ARCH=""
LIB_PATH=""
OPTFLAGS="-g"
CFLAGS=""
MAKE=make
PREFIX=""
DEVCFLAGS=""
MYPWD=`pwd`
#
# Specific options
#
CONFIGURE_ARGS="$*"
echo "Configuring with args $CONFIGURE_ARGS"
#
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
         echo "configure: $package: invalid architecture name" >&2; exit 1
       fi
       ARCH=`echo $package|sed s/-/_/g`
       eval "arch_`echo $package|sed s/-/_/g`=1"
       ;;

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

     -pwd=* | --pwd=*)
        MYPWD="`echo $arg|sed 's/-*pwd=//'`"
	;;

     -opt=* | --opt=*)
       package="`echo $arg|sed 's/-*opt=//'`"
       # Delete all the valid chars; see if any are left.
       OPTFLAGS=$package ;;

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

     -debug )
        DEBUGFLAG="-DDEBUG"
	;;

     -echo )
	set -x
	;;

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

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

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

#
# record top-level directory (this one)

if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you 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
WG_TRIAL=$PWD
if test "${WG_TRIAL}" != "" -a -d "${WG_TRIAL}" ; then 
    if test -r ${WG_TRIAL}/.foo$$ ; then
        rm -f ${WG_TRIAL}/.foo$$
	rm -f .foo$$
    fi
    if test -r ${WG_TRIAL}/.foo$$ -o -r .foo$$ ; then
	WG_TRIAL=
    else
	echo "test" > ${WG_TRIAL}/.foo$$
	if test ! -r .foo$$ ; then
            rm -f ${WG_TRIAL}/.foo$$
	    WG_TRIAL=
        else
 	    rm -f ${WG_TRIAL}/.foo$$
	fi
    fi
fi
if test "${WG_TRIAL}" = "" ; then
    WG_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
fi
if test ! -r ${WG_TRIAL}/readproto.c ; then
        WG_TRIAL=`pwd`
    if test ! -r ${WG_TRIAL}/readproto.c ; then
	print_error "Cannot determine the root directory!" 
        exit 1
    fi
    WG_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${WG_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."
        WG_TRIAL=`pwd`
    fi
fi
if test -z "${WG_TRIAL}" ; then
    WG_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${WG_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."
        WG_TRIAL=`pwd`
    fi
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""${WG_TRIAL}"
else
echo "$ac_t""${WG_TRIAL}" 1>&1
fi

WG_HOME=$WG_TRIAL
cd ../..

if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you 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_HOME=$PWD
if test "${MPIR_HOME}" != "" -a -d "${MPIR_HOME}" ; then 
    if test -r ${MPIR_HOME}/.foo$$ ; then
        rm -f ${MPIR_HOME}/.foo$$
	rm -f .foo$$
    fi
    if test -r ${MPIR_HOME}/.foo$$ -o -r .foo$$ ; then
	MPIR_HOME=
    else
	echo "test" > ${MPIR_HOME}/.foo$$
	if test ! -r .foo$$ ; then
            rm -f ${MPIR_HOME}/.foo$$
	    MPIR_HOME=
        else
 	    rm -f ${MPIR_HOME}/.foo$$
	fi
    fi
fi
if test "${MPIR_HOME}" = "" ; then
    MPIR_HOME=`pwd | sed -e 's%/tmp_mnt/%/%g'`
fi
if test ! -r ${MPIR_HOME}/src/pt2pt/iprobe.c ; then
        MPIR_HOME=`pwd`
    if test ! -r ${MPIR_HOME}/src/pt2pt/iprobe.c ; then
	print_error "Cannot determine the root directory!" 
        exit 1
    fi
    MPIR_HOME=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPIR_HOME} ; 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_HOME=`pwd`
    fi
fi
if test -z "${MPIR_HOME}" ; then
    MPIR_HOME=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${MPIR_HOME} ; 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_HOME=`pwd`
    fi
fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""${MPIR_HOME}"
else
echo "$ac_t""${MPIR_HOME}" 1>&1
fi

cd $WG_HOME
#
#
# If the "root" directories haven't been set, set them here using WG_HOME.
#
CC=${CC:-cc}
#
# 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
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"

CLINKER=$CC
AR="ar clr"
INCLUDE_PATH=""
#
# 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
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
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
rm -f conftest
cat > conftest <<.
ALL:
	@echo "success"
.
cat > conftest1 <<.
include conftest
.
str=`$MAKE -f conftest1 2>&1`
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
rm -f conftest
cat > conftest <<.
SHELL=/bin/sh
ALL:
	@# This is a valid comment!
	@echo "success"
.
str=`$MAKE -f conftest 2>&1`
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 an ARCH was set
if test -z "$ARCH" ; then
    ARCH=`../../util/tarch`
    if test -z "$ARCH" ; then
        echo "You must set an architecture type with -arch=<value>"
        exit 1
    fi
    echo "Configuring for -arch=$ARCH"
fi
if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
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"
}


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

  
{
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"
}

  
{
test -n "$verbose" && \
echo "	defining _MINIX"
echo "#define" _MINIX 1 >> confdefs.h
DEFS="$DEFS -D_MINIX=1"
}

fi

#
# Get the compiler
CARCH=$ARCH

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Ae""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Ae""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Ae $CFLAGS"
rm -f conftest.out
echo 'int main(){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
  if test -s conftest.out ; then
      cat conftest.out >> config.log
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
  else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
      hasarg=1
  fi
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
  
fi
rm -f conftest*
CFLAGS="$CFLAGSSAV"

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int main(){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
  if test -s conftest.out ; then
      cat conftest.out >> config.log
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      
  else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
      hasarg=1
  fi
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
  
fi
rm -f conftest*
CFLAGS="$CFLAGSSAV"

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

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c"
else
echo $ac_n "checking that C compiler accepts option -Aa""... $ac_c" 1>&1
fi
CFLAGSSAV="$CFLAGS"
CFLAGS="-Aa $CFLAGS"
rm -f conftest.out
echo 'int main(){return 0;}' > conftest.c
if ${CC-cc} $CFLAGS -o conftest conftest.c >conftest.out 2>&1 ; then
  if test -s conftest.out ; then
      cat conftest.out >> config.log
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
      AaOPT=0
  else
      if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""yes"
else
echo "$ac_t""yes" 1>&1
fi
      AaOPT=1
  fi
else
  if test -s conftest.out ; then cat conftest.out >> config.log ; fi
  if test -z "$ac_echo_test" -a 1 = 1 ; then
echo "$ac_t""no"
else
echo "$ac_t""no" 1>&1
fi
  AaOPT=0
fi
rm -f conftest*
CFLAGS="$CFLAGSSAV"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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



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

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

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

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


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

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

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

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

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

if test $cc_works = 0 ; then
    print_error "Could not compile a simple file with $CC!"
    print_error "Check for license and path restrictions on $CC."
    exit 1
fi

#
# Get the defaults if they were not set...

if test -n "$arch_IRIX"; then
   # Every version and machine under IRIX is incompatible with every other
   # version.  This block of code replaces a generic "IRIX" arch value 
   # with 
   #  IRIX_<version>_<chip>
   #  For example
   #  IRIX_5_4400 (IRIX 5.x, using MIPS 4400)
   osversion=`uname -r | sed 's/\..*//'`
   cputype=`hinv -t cpu | cut -f 3 -d' '`
   echo "osversion and cputype"
   # cputype may contain R4400, R2000A/R3000, or something else.  
   # We may eventually need to look at it.
   if test -z "$osversion" ; then
	echo "Could not determine OS version (got $osversion).  Please send"
        echo " "
	uname -a
	echo "to gropp@mcs.anl.gov"
        exit 1
   elif test $osversion = 4 ; then
	echo "IRIX Version 4 is not supported.  Currently, IRIX 5.2 and"
	echo "IRIX 6.0 systems are available to us."
        exit 1
   elif test $osversion = 5 ; then
	true
   elif test $osversion = 6 ; then
	true
   else 
       echo "Could not recognize the version of IRIX (got $osversion)"
       echo "Wrappergen knows about versions 5 and 6; the version being"
       echo "returned from uname -r is $osversion."
       echo "Please send"
       uname -a
       hinv
       echo "to gropp@mcs.anl.gov"
       exit 1
   fi
   echo "getting cputype..."
   OLD_ARCH=IRIX
   IRIXARCH="$ARCH_$osversion"
   # Now, handle the chip set
   cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr A-Za-z ''`
   case $cputype in 
	3000) ;;
	4000) ;;
	4400) ;;
	4600) ;;
	8000) ;;
        *)
	echo "Unexpected IRIX/MIPS chipset $cputype.  Please send the output"
        uname -a 2>&1
        hinv 2>&1
        echo "to gropp@mcs.anl.gov"
	echo "Wrappergen will contine and assume that the cputype is"
	echo "compatible with a MIPS 4400 processor."
        cputype=4400
	;;
   esac
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi

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

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

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

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

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

            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


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.
   if test $osversion = 5 ; then
        # Turn off warnings about long doubles not being supported.
        CFLAGS="$CFLAGS -woff 728"
   elif test $osversion = 6 ; then
	if test $cputype = 8000 ; then
	    CLINKER="$CC -64 -mips4 -non_shared"
	    FLINKER="$F77 -64 -mips4 -non_shared"
        else
	    CLINKER="$CC -64 -mips3 -non_shared"
	    FLINKER="$F77 -64 -mips3 -non_shared"
        fi
        # Warning flags are > 1000
        CFLAGS="$CFLAGS -woff 1152,1174,1184"
   fi
   fi


if test -n "$arch_sun4" ; then
  if test "$STATIC_LINKING" = 1 ; then
      CLINKER="$CLINKER -Bstatic"
      FLINKER="$FLINKER -Bstatic"
  fi
fi
# 
if test -n "$arch_rs6000" ; then
  if test "$STATIC_LINKING" = 1 ; then
      CLINKER="xlc -bnso"
      FLINKER="xlf -bnso"
  fi
fi
# Some autoconf tests check for cross_compiling being empty, rather than
# having a value of 0 or 1 (or no or yes).
cross_compiling=""
if test -z "$ac_echo_n" ; then
ac_echo_n=yes
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi
ac_echo_test=`echo foo 1>&1`
if test -z "$ac_echo_test" ; then
     print_error "Your sh shell does not handle the output redirection"
     print_error "1>&1 correctly.  Configure will work around this problem,"
     print_error "but you should report the problem to your vendor."
fi

fi
if test -z "$ac_echo_test" -a 1 = 1 ; then
echo $ac_n "checking 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 "$cross_compiling" != 0 ; then
    echo "Cross-compiling; many tests may not work..."
fi
# 

# Check for the functions that may be needed to implement
# Processor_name.  Save these defines in a special place.
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"
}


fi
rm -fr conftest*

fi
rm -f conftest*


fi
rm -f conftest*

#
# Set the final choices of flags
if test -n "$DEBUGFLAG" ; then
    CFLAGS="$CFLAGS $DEBUGFLAG"
fi
CFLAGS="$CFLAGS $DEFS"
#
chmod g+w configure > /dev/null 2>&1
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

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

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

trap 'rm -f Makefile; exit 1' 1 3 15
CC='$CC'
RANLIB='$RANLIB'
CPP='$CPP'
ARCH='$ARCH'
CFLAGS='$CFLAGS'
CLINKER='$CLINKER'
MAKE='$MAKE'
MPIR_HOME='$MPIR_HOME'
OPTFLAGS='$OPTFLAGS'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
cat $top_srcdir/${file}.in | sed -e "
$prsub
$extrasub
s%@CC@%$CC%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@ARCH@%$ARCH%g
s%@CFLAGS@%$CFLAGS%g
s%@CLINKER@%$CLINKER%g
s%@MAKE@%$MAKE%g
s%@MPIR_HOME@%$MPIR_HOME%g
s%@OPTFLAGS@%$OPTFLAGS%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%$DEFS%
" >> $file
fi; done


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