#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
--enable-echo                      - Turn on strong echoing.  The default is enable=no. "
ac_help="$ac_help
--enable-strict                    - Turn on strict compilation testing when using gcc"
ac_help="$ac_help
--enable-mpe_graphics              - build X11 part of MPE graphics routines.  If disabled 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.  The default value is enable=yes."
ac_help="$ac_help
--enable-mpedbg                    - Enable the -mpedbg command-line argument (e.g., errors can start an xterm running a debugger).  Only works with some workstation systems when used with MPICH.  The default is enable=yes"
ac_help="$ac_help
--enable-g                         - Turn on/off the compilation flags -g in MPE & SLOG-API code. The default is enable=no."
ac_help="$ac_help
--enable-debugcheck                - Turn on/off the debugging & diagnostic checking code in MPE & SLOG-API code. The default is enable=no."
ac_help="$ac_help
--enable-f77                       - Compile routines that require a Fortran compiler.  If configuring with MPICH, the configure in the top-level MPICH directory will choose the appropriate value for you.  The default is enable=yes."
ac_help="$ac_help
--enable-f2cmpilib                 - Indicates if this MPE build will make its own Fortran to C MPI wrapper library.  The library is needed for profiling Fortran code in Non-MPICH platform.  The default is enable=yes"
ac_help="$ac_help
--enable-mpich                     - Indicates if this MPE will be built as part of the MPICH build.  The default is enable=no"
ac_help="$ac_help
----with-mpiio                     - Include/exclude MPI-IO from mpe logging.  The default is include.  This flag is relevant only when --enable-mpich is used"
ac_help="$ac_help
--enable-checkMPI                  - Turn on/off the linking test for the MPI include files, MPI libraries and MPI_CC compiler. The default is enable=yes"
ac_help="$ac_help
--enable-checkMPIwtime             - Turn on/off the linking test for the MPI_Wtime(). The default is enable=no"
ac_help="$ac_help
--enable-checkMPIO                 - Turn on/off the linking test for MPI-IO routines in MPI implementation.  The default is enable=yes."
ac_help="$ac_help
--with-mpelibname=MPE_LIBNAME      - Set the MPE library name instead of the default 'mpe'.  e.g. if MPE_LIBNAME='mpe_new', then the libraries generated will be libmpe_new.a, liblmpe_new.a, libtmpe_new.a and libampe_new.a."
ac_help="$ac_help
--with-flib_path_leader=FLIB_PATH_LEADER - This option shows how to specify a Fortran library path ."
ac_help="$ac_help
--with-cflags=MPE_CFLAGS           - supply extra MPE CFLAGS to the CC compiler"
ac_help="$ac_help
--with-fflags=MPE_FFLAGS           - supply extra MPE FFLAGS to the Fortran compiler"
ac_help="$ac_help
--enable-broken-procnull           - Handle MPI implementations with buggy handling of MPI_PROC_NULL"
ac_help="$ac_help
--enable-build_include             - Turn on/off the building of include files.  The default is enable=yes.  Disabling this option will render the Makefiles in contrib/* not usable"
ac_help="$ac_help
--with-mpicc=MPI_CC                - C compiler used to compile MPI program and to create parallel executable, e.g. mpcc for IBM MPI"
ac_help="$ac_help
--with-mpif77=MPI_F77              - F77 compiler used to compile MPI program and to create parallel executable, mpxlf for IBM MPI"
ac_help="$ac_help
--with-mpiinc=MPI_INC              - compiler's include flag with prefix -I used in the MPI implementation, usually it specifies where mpi.h and mpif.h are located, e.g. -I/pkgs/MPI/include"
ac_help="$ac_help
--with-mpilibs=MPI_LIBS            - compiler's full library flags with prefix -L to the library path and prefix -l to the name of the libraries used in the MPI implementation, usually specify where MPI libraries is located. e.g. -L/pkgs/MPI/lib -lpmpich -lmpich"
ac_help="$ac_help
--with-f2cmpilibs=F2CMPI_LIBS      - compiler's library flags for Fortran to C MPI wrapper library.  Using this option disables building of MPE's internal Fortran to C MPI library, --disable-f2cmpilib.  The library is needed for profiling MPI Fortran program.  e.g. "-lfmpich" when MPE is building with MPICH. "
ac_help="$ac_help
  --with-x                use the X Window System"
ac_help="$ac_help
--enable-viewers                   - Enable the configuration of all the available log viewers.  The default is enable=yes."
ac_help="$ac_help
--enable-slog2[=build]             - Enable the configuration of all the SLOG-2 tools.  --enable-slog2 without any argument will use the prebuilt jar files.  --enable-slog2=build will rebuild all the jar files from the source code.  The default is enable=yes."

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

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

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

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

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

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

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

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# 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.
ac_unique_file=

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done


ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi



#
echo "Configuring MPE Profiling Libraries with $ac_configure_args"
#
# Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
# top_srcdir is in relative path.
if test "X$srcdir" != "X." -a -s $srcdir/include/mpe.h ; then
    top_srcdir_abs=$srcdir
else
    
echo $ac_n "checking for current directory name""... $ac_c" 1>&6
echo "configure:583: checking for current directory name" >&5
top_srcdir_abs=$PWD
if test "${top_srcdir_abs}" != "" -a -d "${top_srcdir_abs}" ; then 
    if test -r ${top_srcdir_abs}/.foo$$ ; then
        rm -f ${top_srcdir_abs}/.foo$$
	rm -f .foo$$
    fi
    if test -r ${top_srcdir_abs}/.foo$$ -o -r .foo$$ ; then
	top_srcdir_abs=
    else
	echo "test" > ${top_srcdir_abs}/.foo$$
	if test ! -r .foo$$ ; then
            rm -f ${top_srcdir_abs}/.foo$$
	    top_srcdir_abs=
        else
 	    rm -f ${top_srcdir_abs}/.foo$$
	fi
    fi
fi
if test "${top_srcdir_abs}" = "" ; then
    top_srcdir_abs=`pwd | sed -e 's%/tmp_mnt/%/%g'`
fi
if test ! -r ${top_srcdir_abs}/include/mpe.h  ; then
        top_srcdir_abs=`pwd`
    if test ! -r ${top_srcdir_abs}/include/mpe.h  ; then
	print_error "Cannot determine the root directory!" 
        exit 1
    fi
    top_srcdir_abs=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${top_srcdir_abs} ; then 
        print_error "Warning: your default path uses the automounter; this may"
        print_error "cause some problems if you use other NFS-connected systems."
        top_srcdir_abs=`pwd`
    fi
fi
if test -z "${top_srcdir_abs}" ; then
    top_srcdir_abs=`pwd | sed -e 's%/tmp_mnt/%/%g'`
    if test ! -d ${top_srcdir_abs} ; then 
        print_error "Warning: your default path uses the automounter; this may"
        print_error "cause some problems if you use other NFS-connected systems."
        top_srcdir_abs=`pwd`
    fi
fi
echo "$ac_t""${top_srcdir_abs}" 1>&6

fi


# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
  enableval="$enable_echo"
  set -x ; enable_args="$enable_args --enable-echo" 
fi

#
# Check whether --enable-strict or --disable-strict was given.
if test "${enable_strict+set}" = set; then
  enableval="$enable_strict"
  COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL";enable_args="$enable_args --enable-strict" 
fi


VERSION=""
CC=${CC:-cc}
F77=${F77:-f77}
MPI_INC=""
MPI_LIBS=""
MPELIBNAME=""
MPE_CFLAGS=""
MPE_FFLAGS=""
FORTRANNAMES=""
DEBUG_LIBS=""
LOG_LIBS=""
PROF_LIBS=""
TRACE_LIBS=""
ANIM_LIBS=""
XGRAPH_LIBS=""
DBX_NAME=""
GDB_NAME=""
# CPRP is the version of cp that accepts -r and -p arguments.
# See CRAY below
CPRP="cp"
NO_X=0
MAKE=${MAKE:-make}
FROM_MPICH=${FROM_MPICH:-no}
FROM_MPICH2=${FROM_MPICH2:-no}
FROM_LAM=${FROM_LAM:-no}


# Fixup for make

echo $ac_n "checking gnumake""... $ac_c" 1>&6
echo "configure:675: checking gnumake" >&5
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"
	echo "$ac_t""yes using --no-print-directory" 1>&6
    else
	echo "$ac_t""no" 1>&6
    fi
else
    echo "$ac_t""no" 1>&6
fi
rm -f conftest
str=""


echo $ac_n "checking BSD 4.4 make""... $ac_c" 1>&6
echo "configure:701: checking BSD 4.4 make" >&5
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
    echo "$ac_t""Found BSD 4.4 so-called make" 1>&6
    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
    echo "$ac_t""no - whew" 1>&6
fi
str=""


echo $ac_n "checking OSF V3 make""... $ac_c" 1>&6
echo "configure:725: checking OSF V3 make" >&5
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
    echo "$ac_t""Found OSF V3 make" 1>&6
    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
    echo "$ac_t""no" 1>&6
fi
str=""



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


#
# If we are relying on vpath and no vpath is set, then we must exit
if test ! -s include/mpe.h -a -z "$VPATH" ; then
    { echo "configure: error: No virtual MAKE path command found.
	You may need to set your make command
	The GNU make (sometimes available as gnumake) can be used." 1>&2; exit 1; }
fi

# Check whether --enable-mpe_graphics or --disable-mpe_graphics was given.
if test "${enable_mpe_graphics+set}" = set; then
  enableval="$enable_mpe_graphics"
  :
else
  enable_mpe_graphics=yes 
fi

#
# Check whether --enable-mpedbg or --disable-mpedbg was given.
if test "${enable_mpedbg+set}" = set; then
  enableval="$enable_mpedbg"
  enable_mpedbg=yes 
fi

#
if test "$enable_mpedbg" = "yes" ; then
    MPEDBG=1
else
    MPEDBG=0
fi
#
# Check whether --enable-g or --disable-g was given.
if test "${enable_g+set}" = set; then
  enableval="$enable_g"
  enable_args="$enable_args --enable-g=${enableval}" 
fi

#
# Check whether --enable-debugcheck or --disable-debugcheck was given.
if test "${enable_debugcheck+set}" = set; then
  enableval="$enable_debugcheck"
  enable_args="$enable_args --enable-debugcheck=${enableval}" 
fi

#
# Check whether --enable-f77 or --disable-f77 was given.
if test "${enable_f77+set}" = set; then
  enableval="$enable_f77"
  :
else
  enable_f77=yes 
fi

if test "$enable_f77" = "yes" ; then
    NOF77=0
else
    NOF77=1
fi

# Ideally, enable_f2cmpilib should be extracted from the 
# CC/MPI_CC/MPI_INC/MPI_LIBS supplied by the user of MPE. 
# enable_f2cmpilib is used to determine if libmpe_f2cmpi.a( mpe_proff.o ) 
# is needed for profiling of fortran MPI program
# withOUT a PMPICH type of profiling library.
# Check whether --enable-f2cmpilib or --disable-f2cmpilib was given.
if test "${enable_f2cmpilib+set}" = set; then
  enableval="$enable_f2cmpilib"
  :
else
  enable_f2cmpilib=yes 
fi


# Check whether --enable-mpich or --disable-mpich was given.
if test "${enable_mpich+set}" = set; then
  enableval="$enable_mpich"
  :
else
  enable_mpich=no 
fi


BUILDING_MPI=no

if test "$enable_mpich" = "yes" -o "$FROM_MPICH" = "yes" ; then
    echo "$ac_t""This MPE build is part of the MPICH build" 1>&6
    MPI_IMPL="MPICH"
elif test "$FROM_MPICH2" = yes ; then
    echo "$ac_t""This MPE build is part of the MPICH2 build" 1>&6
    MPI_IMPL="MPICH2"
    if test -d "$includebuild_dir" ; then
        MPICPPFLAGS="$MPICPPFLAGS -I$includebuild_dir"
    else
        MPICPPFLAGS="$MPICPPFLAGS -I$master_top_srcdir/src/include -I$master_top_builddir/src/include"
    fi
    BUILDING_MPI=yes
else
    echo "$ac_t""User supplied MPI implmentation (Good Luck!)" 1>&6
    MPI_IMPL="UserSupplied"
fi

# Check whether --with-mpiio or --without-mpiio was given.
if test "${with_mpiio+set}" = set; then
  withval="$with_mpiio"
  :
else
  with_mpiio=yes 
fi


# Check whether --enable-checkMPI or --disable-checkMPI was given.
if test "${enable_checkMPI+set}" = set; then
  enableval="$enable_checkMPI"
  :
else
  enable_checkMPI=yes 
fi


# Check whether --enable-checkMPIwtime or --disable-checkMPIwtime was given.
if test "${enable_checkMPIwtime+set}" = set; then
  enableval="$enable_checkMPIwtime"
  :
else
  enable_checkMPIwtime=no 
fi


# Check whether --with-checkMPIO or --without-checkMPIO was given.
if test "${with_checkMPIO+set}" = set; then
  withval="$with_checkMPIO"
  :
else
  enable_checkMPIO=yes 
fi

#
# Set the MPE Libraries name
#
# Check whether --with-mpelibname or --without-mpelibname was given.
if test "${with_mpelibname+set}" = set; then
  withval="$with_mpelibname"
  MPE_LIBNAME="$withval" 
fi


#
# Set the Fortran Library Leading Character
#
# Check whether --with-flib_path_leader or --without-flib_path_leader was given.
if test "${with_flib_path_leader+set}" = set; then
  withval="$with_flib_path_leader"
  FLIB_PATH_LEADER="$withval" 
fi

if test -z "$FLIB_PATH_LEADER" ; then
    FLIB_PATH_LEADER=-L
fi

#
# Get the user supplied CFLAGS and FFLAGS
#
# Check whether --with-cflags or --without-cflags was given.
if test "${with_cflags+set}" = set; then
  withval="$with_cflags"
  MPE_CFLAGS="$withval" 
fi


# Check whether --with-fflags or --without-fflags was given.
if test "${with_fflags+set}" = set; then
  withval="$with_fflags"
  MPE_FFLAGS="$withval" 
fi


# If we are building within a known MPI implementation, we must avoid the
# tests about an existing implementation
if test "$FROM_MPICH" != no -o "$FROM_MPICH2" != no -o "$FROM_LAM" != no ; then
    WITHIN_KNOWN_MPI_IMPL=yes
else
    WITHIN_KNOWN_MPI_IMPL=no
fi

#
# Append "-g" to MPE_CFLAGS and MPE_FFLAGS if enable_g=yes
if test "$enable_g" = "yes" ; then
    if test -z "`echo $MPE_CFLAGS | grep "\-g"`"; then
        MPE_CFLAGS="-g $MPE_CFLAGS"
    fi
    if test -z "`echo $MPE_FFLAGS | grep "\-g"`"; then
        MPE_FFLAGS="-g $MPE_FFLAGS"
    fi
fi

if test "$enable_debugcheck" = "yes" ; then
    echo $ac_n "checking for malloc in -lefence""... $ac_c" 1>&6
echo "configure:980: checking for malloc in -lefence" >&5
ac_lib_var=`echo efence'_'malloc | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lefence  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 988 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char malloc();

int main() {
malloc()
; return 0; }
EOF
if { (eval echo configure:999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  DEBUG_LIBS="-lefence" 
else
  echo "$ac_t""no" 1>&6
fi

fi

if test -z "$nonopt" ; then nonopt=NONE ; fi
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:1048: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

case "$host" in
   *alpha*)
        MPE_CFLAGS="$MPE_CFLAGS -DDBX_IS_OSF"
        host=alpha
        ;;
   *cray*)
        host=cray
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_CRAY"
        ;;

   *rs6000*)
        host=rs6000
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_rs6000"
        ;;
   *solaris*)
        host=solaris
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_solaris"
        ;;
    *linux*)
        host=linux
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_LINUX"
        ;;
    *sun4*)
        host=sun4
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_sun4"
        ;;
    mips-sgi-irix*)
        host=irix
        MPE_CFLAGS="$MPE_CFLAGS -DMPI_IRIX"
        ;;
esac

# Check whether --enable-broken-procnull or --disable-broken-procnull was given.
if test "${enable_broken_procnull+set}" = set; then
  enableval="$enable_broken_procnull"
  procnull_broken=$enableval
else
  procnull_broken=default
fi


if test "$host" = "irix" -a \
   "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
    if test "$procnull_broken" = "default" ; then
	procnull_broken=yes
    fi
fi

if test "$procnull_broken" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_BROKEN_STATUS_ON_PROC_NULL 1
EOF

fi

if test -z "$SLOG_HOME" ; then
    SLOG_HOME=$top_srcdir_abs/slog_api
fi

# Set the various build directories
#
# includebuild_dir is for all user header files
# libbuild_dir is used to build the libraries in before they are installed.
# binbuild_dir is for the scripts/programs
# sbinbuild_dir is for all system admin stuffs
#
rootbuild_dir=`pwd`
for dir in include lib bin sbin ; do
    dirname=${dir}build_dir
    eval dirvalue=\$"$dirname"
    eval $dirname=$rootbuild_dir/$dir
done

# Check whether --enable-build_include or --disable-build_include was given.
if test "${enable_build_include+set}" = set; then
  enableval="$enable_build_include"
  :
else
  enable_build_include=yes 
fi

if test "$enable_build_include" = "no" ; then
    includebuild_dir=
fi

for dir in include lib bin sbin ; do
    dirname=${dir}build_dir
    eval dirvalue=\$"$dirname"
    if test -n "$dirvalue" ; then
        if test ! -d $dirvalue ; then
            if mkdir -p $dirvalue ; then
                :
            else
                { echo "configure: error: Could not create directory $dirvalue" 1>&2; exit 1; }
            fi
        fi
    fi
done







#
#   Unknown MPI implmentation, i.e. User defined MPI_LIBS and MPI_INC
#
# Check whether --with-mpicc or --without-mpicc was given.
if test "${with_mpicc+set}" = set; then
  withval="$with_mpicc"
  MPI_CC="$withval" 
fi

#
# Check whether --with-mpif77 or --without-mpif77 was given.
if test "${with_mpif77+set}" = set; then
  withval="$with_mpif77"
  MPI_F77="$withval" 
fi

#
# Check whether --with-mpiinc or --without-mpiinc was given.
if test "${with_mpiinc+set}" = set; then
  withval="$with_mpiinc"
  MPI_INC="$withval" 
fi

#
# Check whether --with-mpilibs or --without-mpilibs was given.
if test "${with_mpilibs+set}" = set; then
  withval="$with_mpilibs"
  MPI_LIBS="$withval" 
fi

#
# Check whether --with-f2cmpilibs or --without-f2cmpilibs was given.
if test "${with_f2cmpilibs+set}" = set; then
  withval="$with_f2cmpilibs"
  F2CMPI_LIBS="$withval" ; enable_f2cmpilib=no 
fi




for ac_prog in cc xlC xlc pgcc icc gcc 
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1218: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CC" && break
done

test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1249: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 1260 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1291: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether the C compiler sets its return status correctly""... $ac_c" 1>&6
echo "configure:1296: checking whether the C compiler sets its return status correctly" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext <<EOF
#line 1306 "configure"
#include "confdefs.h"

int main() {
int a = bzzzt;
; return 0; }
EOF
if { (eval echo configure:1313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  notbroken=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  notbroken=yes
fi
rm -f conftest*
echo "$ac_t""$notbroken" 1>&6
if test "$notbroken" = "no" ; then
    { echo "configure: error: installation or configuration problem: C compiler does not
correctly set error code when a fatal error occurs" 1>&2; exit 1; }
fi

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:1330: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

echo $ac_n "checking for object suffix""... $ac_c" 1>&6
echo "configure:1354: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
if { (eval echo configure:1360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  for ac_file in conftest.*; do
    case $ac_file in
    *.c) ;;
    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
    esac
  done
else
  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_objext" 1>&6
OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext

echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:1378: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1383 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_cygwin=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_cygwin=no
fi
rm -f conftest*
rm -f conftest*
fi

echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:1411: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1416 "configure"
#include "confdefs.h"

int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:1423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_mingw32=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_mingw32=no
fi
rm -f conftest*
rm -f conftest*
fi

echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes


echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:1442: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  ac_cv_exeext=.exe
else
  rm -f conftest*
  echo 'int main () { return 0; }' > conftest.$ac_ext
  ac_cv_exeext=
  if { (eval echo configure:1452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    for file in conftest.*; do
      case $file in
      *.c | *.o | *.obj) ;;
      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
      esac
    done
  else
    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
  fi
  rm -f conftest*
  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
fi

EXEEXT=""
test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
echo "$ac_t""${ac_cv_exeext}" 1>&6
ac_exeext=$EXEEXT

# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1475: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -d "$SLOG_HOME"; then
  #
  # For VPATH, we need the directory slog_api for the build of SLOG-API
  if test ! -d slog_api ; then mkdir slog_api ; fi
  echo

  echo "Configuring SLOG-API, for support of scalable logfile format SLOG-1" ; \
  ( cd slog_api && \
    $SLOG_HOME/configure --with-cc="$CC" \
                         --with-cflags="$MPE_CFLAGS" \
                         -prefix=$prefix $enable_args )   

  # Check if there is any error in SLOG-API's configure
  if test $? != 0 ; then
      echo "configure: warning: Configure of SLOG-API failed" 1>&2
      SLOG_HOME=""
      C2S1_SRC=""
  else
      echo "$ac_t""Configure of SLOG-API succeeded" 1>&6
      cat >> confdefs.h <<\EOF
#define HAVE_SLOG1 1
EOF

      C2S1_SRC="c2s_util.c"
  fi

  echo
fi
 
# MPI_CC is only use for MPI programs.  
# CC should be the same compiler that is used within the MPI_CC
# environment.  MPI_LIBS should also be set for linking MPI programs
echo $ac_n "checking whether MPI_CC has been set ""... $ac_c" 1>&6
echo "configure:1536: checking whether MPI_CC has been set " >&5
if test -z "$MPI_CC" ; then
    MPI_CC="$CC $MPICPPFLAGS"
fi
echo "$ac_t""$MPI_CC " 1>&6

if test "$NOF77" = "0" ; then
    if test -z "$F77"; then
  for ac_prog in g77 f77 f2c
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1549: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F77"; then
  ac_cv_prog_F77="$F77" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F77="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F77="$ac_cv_prog_F77"
if test -n "$F77"; then
  echo "$ac_t""$F77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F77" && break
done

    test -z "$F77" && { echo "configure: error: no acceptable Fortran 77 compiler found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1582: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works" >&5

ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

cat > conftest.$ac_ext << EOF

      program conftest
      end

EOF
if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_f77_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_f77_cross=no
  else
    ac_cv_prog_f77_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_f77_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_f77_works" 1>&6
if test $ac_cv_prog_f77_works = no; then
  { echo "configure: error: installation or configuration problem: Fortran 77 compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1621: checking whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_f77_cross" 1>&6
cross_compiling=$ac_cv_prog_f77_cross

echo $ac_n "checking whether we are using GNU Fortran 77""... $ac_c" 1>&6
echo "configure:1626: checking whether we are using GNU Fortran 77" >&5
if eval "test \"`echo '$''{'ac_cv_prog_g77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.fpp <<EOF
#ifdef __GNUC__
  yes
#endif
EOF
if { ac_try='$F77 -E conftest.fpp'; { (eval echo configure:1635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_g77=yes
else
  ac_cv_prog_g77=no
fi
fi

echo "$ac_t""$ac_cv_prog_g77" 1>&6

if test $ac_cv_prog_g77 = yes; then
  G77=yes
  ac_test_FFLAGS="${FFLAGS+set}"
  ac_save_FFLAGS="$FFLAGS"
  FFLAGS=
  echo $ac_n "checking whether $F77 accepts -g""... $ac_c" 1>&6
echo "configure:1650: checking whether $F77 accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_f77_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.f << EOF
       program conftest
       end
EOF
if test -z "`$F77 -g -c conftest.f 2>&1`"; then
  ac_cv_prog_f77_g=yes
else
  ac_cv_prog_f77_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_f77_g" 1>&6
  if test "$ac_test_FFLAGS" = set; then
    FFLAGS="$ac_save_FFLAGS"
  elif test $ac_cv_prog_f77_g = yes; then
    FFLAGS="-g -O2"
  else
    FFLAGS="-O2"
  fi
else
  G77=
  test "${FFLAGS+set}" = set || FFLAGS="-g"
fi

    if test "$F77" = "" ; then
        NOF77=1
    fi
    echo $ac_n "checking whether MPI_F77 has been set ""... $ac_c" 1>&6
echo "configure:1684: checking whether MPI_F77 has been set " >&5
    if test -z "$MPI_F77" ; then
        # FIXME: Temporary for F77 accepting the same flags as CC for 
	# file includes
        MPI_F77="$F77 $MPICPPFLAGS"
    fi
    echo "$ac_t""$MPI_F77 " 1>&6
fi

# Determine the name of the various library being built
if test -z "$MPE_LIBNAME" ; then
    MPE_LIBNAME=mpe
fi

PROF_LIBNAME="$MPE_LIBNAME"
LOG_LIBNAME="l$MPE_LIBNAME"
TRACE_LIBNAME="t$MPE_LIBNAME"
ANIM_LIBNAME="a$MPE_LIBNAME"
F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"

PROF_LIBS="-l$PROF_LIBNAME"
LOG_LIBS="-l$LOG_LIBNAME $PROF_LIBS"
TRACE_LIBS="-l$TRACE_LIBNAME"
ANIM_LIBS="-l$ANIM_LIBNAME $PROF_LIBS"
XGRAPH_LIBS="$PROF_LIBS"

if test "$NOF77" = "0" ; then
    if test "$enable_f2cmpilib" = "yes" ; then
        F2CMPI_LIBS="-l$F2CMPI_LIBNAME"
    fi
#   when --enable-f77 and --disable-f2cmpilib are selected,
#   value supplied in --with-f2cmpilibs will be used.
else
    F2CMPI_LIBS=""
fi

#
#  Check if MPI_INC, MPI_LIBS and MPI_CC provide a linkable environment
#  for a simple MPI program
#
if test "$WITHIN_KNOWN_MPI_IMPL" != yes ; then
    if test "$enable_checkMPI" = "yes" ; then
        echo $ac_n "checking for the linkage of the supplied MPI C definitions ""... $ac_c" 1>&6
echo "configure:1727: checking for the linkage of the supplied MPI C definitions " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 1747 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     ; 
    MPI_Init(&argc, &argv);
     ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:1760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        if test "$mpe_link_ok" = "yes" ; then
            echo "$ac_t""yes" 1>&6
        else
            echo "$ac_t""no" 1>&6
            { echo "configure: error: Cannot link with basic MPI C program!
	Check your MPI include paths, MPI libraries and MPI CC compiler " 1>&2; exit 1; }
        fi
    fi
    if test "$enable_checkMPI" = "yes" -a "$NOF77" = "0" ; then
        echo $ac_n "checking for the linkage of the supplied MPI F77 definitions ""... $ac_c" 1>&6
echo "configure:1796: checking for the linkage of the supplied MPI F77 definitions " >&5
        
    pac_MPI_F77="$MPI_F77"
    pac_MPI_FFLAGS="$FFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    pac_saved_F77="$F77"
    pac_saved_FFLAGS="$FFLAGS"
    pac_saved_LIBS="$LIBS"
    F77="$pac_MPI_F77"
    FFLAGS="$pac_MPI_FFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF

      program main
      call  mpiftest()
      end
	subroutine mpiftest()
	include 'mpif.h'
	integer pac_ierr
	
	integer mytid
	integer ierr
    
	call MPI_Init( pac_ierr )
	 call MPI_Comm_rank( MPI_COMM_WORLD, mytid, ierr ) 
	call MPI_Finalize( pac_ierr )
	return
                 
      end
EOF
if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    F77="$pac_saved_F77"
    FFLAGS="$pac_saved_FFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        if test "$mpe_link_ok" = "yes" ; then
            echo "$ac_t""yes" 1>&6
        else
            echo "$ac_t""no" 1>&6
            { echo "configure: error: Cannot link with basic MPI F77 program!
	    Check your MPI include paths, MPI libraries and MPI F77 compiler  " 1>&2; exit 1; }
        fi
    fi

    #
    # Some MPI's seem to have trouble with MPI_Wtime, PMPI_Wtime, and MPI_Attr_get
    # (Fujitsu for MPI_Wtime and MPI_Attr_get; IBM's PMPI_Wtime returned 0)
    # Check at least that we can link with MPI_Wtime and MPI_Attr_get
    #
    if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIwtime" = "yes" ; then
        echo $ac_n "checking for the C version of MPI_Wtime() ""... $ac_c" 1>&6
echo "configure:1874: checking for the C version of MPI_Wtime() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 1894 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     double d  ; 
    MPI_Init(&argc, &argv);
     d=MPI_Wtime()  ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        if test "$mpe_link_ok" = "yes" ; then
            echo "$ac_t""yes" 1>&6
            cat >> confdefs.h <<\EOF
#define HAVE_MPI_WTIME 1
EOF

        else
            echo "$ac_t""no" 1>&6
            { echo "configure: error: Cannot link with MPI_Wtime()!
	Check your MPI include paths, MPI libraries and MPI CC compiler  " 1>&2; exit 1; }
        fi
    fi

    if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then
        echo $ac_n "checking for the C version of MPI_File_open() ""... $ac_c" 1>&6
echo "configure:1948: checking for the C version of MPI_File_open() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 1968 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     int itmp; MPI_File fh  ; 
    MPI_Init(&argc, &argv);
     itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )  ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:1981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        if test "$mpe_link_ok" = "yes" ; then
            echo "$ac_t""yes" 1>&6
            echo $ac_n "checking for the C version of PMPI_File_open() ""... $ac_c" 1>&6
echo "configure:2010: checking for the C version of PMPI_File_open() " >&5
            
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2030 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     int itmp; MPI_File fh  ; 
    MPI_Init(&argc, &argv);
     itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )  ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

            if test "$mpe_link_ok" = "yes" ; then
                echo "$ac_t""yes" 1>&6
                cat >> confdefs.h <<\EOF
#define HAVE_MPI_IO 1
EOF

                echo $ac_n "checking for ROMIO's MPIO_Request ""... $ac_c" 1>&6
echo "configure:2076: checking for ROMIO's MPIO_Request " >&5
                
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2096 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     MPIO_Request  io_request ; 
    MPI_Init(&argc, &argv);
     ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

                if test "$mpe_link_ok" = "yes" ; then
                    echo "$ac_t""yes" 1>&6
                else
                    echo "$ac_t""no" 1>&6
                    cat >> confdefs.h <<\EOF
#define HAVE_NO_MPIO_REQUEST 1
EOF

                fi
            else
                echo "$ac_t""no, assumed No MPI-IO routines" 1>&6
            fi
        else
            echo "$ac_t""no, assumed No MPI-IO routines" 1>&6
        fi
    fi
fi
# When it is built with MPICH, MPE configure observes --with[out]-mpiio
if test \( "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" \) \
	-a "$with_mpiio" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_MPI_IO 1
EOF

fi

 
if test -z "$CC" -o -z "$MPI_CC"; then
    { echo "configure: error: You must configure MPE with a specific MPI" 1>&2; exit 1; }
fi
 
if test -n "$F77" -a "$NOF77" = 0 ; then 
    echo $ac_n "checking for Fortran 77 libraries""... $ac_c" 1>&6
echo "configure:2168: checking for Fortran 77 libraries" >&5


if eval "test \"`echo '$''{'ac_cv_flibs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo "      END" > conftest.f
foutput=`${F77} -v -o conftest conftest.f 2>&1`
xlf_p=`echo $foutput | grep xlfentry`
if test -n "$xlf_p"; then
  foutput=`echo $foutput | sed 's/,/ /g'`
fi
ld_run_path=`echo $foutput | \
  sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`
case "$ld_run_path" in
  /*)
    if test "$ac_cv_prog_gcc" = yes; then
      ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
    else
      ld_run_path="-R $ld_run_path"
    fi
  ;;
  *)
    ld_run_path=
  ;;
esac
flibs=
lflags=
want_arg=
for arg in $foutput; do
  old_want_arg=$want_arg
  want_arg=
  if test -n "$old_want_arg"; then
    case "$arg" in
      -*)
        old_want_arg=
      ;;
    esac
  fi
  case "$old_want_arg" in
    '')
      case $arg in
        /*.a)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            lflags="$lflags $arg"
          fi
        ;;
        -bI:*)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            if test "$ac_cv_prog_gcc" = yes; then
              lflags="$lflags -Xlinker $arg"
            else
              lflags="$lflags $arg"
            fi
          fi
        ;;
        -lang* | -lcrt0.o | -lc | -lgcc)
          arg=
        ;;
        -[lLR])
          want_arg=$arg
          arg=
        ;;
        -[lLR]*)
          exists=false
          for f in $lflags; do
            if test x$arg = x$f; then
              exists=true
            fi
          done
          if $exists; then
            arg=
          else
            case "$arg" in
              -lkernel32)
                case "$canonical_host_type" in
                  *-*-cygwin*)
                    arg=
                  ;;
                  *)
                    lflags="$lflags $arg"
                  ;;
                esac
              ;;
              -lm)
              ;;
              *)
                lflags="$lflags $arg"
              ;;
            esac
          fi
        ;;
        -u)
          want_arg=$arg
          arg=
        ;;
        -Y)
          want_arg=$arg
          arg=
        ;;
        *)
          arg=
        ;;
      esac
    ;;
    -[lLR])
      arg="$old_want_arg $arg"
    ;;
    -u)
      arg="-u $arg"
    ;;
    -Y)
      arg=`echo $arg | sed -e 's%^P,%%'`
      SAVE_IFS=$IFS
      IFS=:
      list=
      for elt in $arg; do
        list="$list -L$elt"
      done
      IFS=$SAVE_IFS
      arg="$list"
    ;;
  esac
  if test -n "$arg"; then
    flibs="$flibs $arg"
  fi
done
if test -n "$ld_run_path"; then
  flibs_result="$ld_run_path $flibs"
else
  flibs_result="$flibs"
fi
ac_cv_flibs="$flibs_result"
fi

FLIBS="$ac_cv_flibs"
echo "$ac_t""$FLIBS" 1>&6

    echo $ac_n "checking Whether C can link with $FLIBS""... $ac_c" 1>&6
echo "configure:2323: checking Whether C can link with $FLIBS" >&5
# Try to link a C program with all of these libraries
save_LIBS="$LIBS"
LIBS="$LIBS $FLIBS"
cat > conftest.$ac_ext <<EOF
#line 2328 "configure"
#include "confdefs.h"

int main() {
int a;
; return 0; }
EOF
if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  runs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  runs=no
fi
rm -f conftest*
LIBS="$save_LIBS"
echo "$ac_t""$runs" 1>&6
if test "$runs" = "no" ; then
    echo $ac_n "checking which libraries can be used""... $ac_c" 1>&6
echo "configure:2349: checking which libraries can be used" >&5
    pac_ldirs=""
    pac_libs=""
    pac_other=""
    for name in $FLIBS ; do
        case $name in 
        -l*) pac_libs="$pac_libs $name" ;;
        -L*) pac_ldirs="$pac_ldirs $name" ;;
        *)   pac_other="$pac_other $name" ;;
        esac
    done
    save_LIBS="$LIBS"
    keep_libs=""
    for name in $pac_libs ; do 
        LIBS="$save_LIBS $pac_ldirs $pac_other $name"
        cat > conftest.$ac_ext <<EOF
#line 2365 "configure"
#include "confdefs.h"

int main() {
int a;
; return 0; }
EOF
if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  runs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  runs=no
fi
rm -f conftest*
        if test $runs = "yes" ; then keep_libs="$keep_libs $name" ; fi
    done
    echo "$ac_t""$keep_libs" 1>&6
    LIBS="$save_LIBS"
    FLIBS="$pac_ldirs $pac_other $keep_libs"
fi

    
echo $ac_n "checking for Fortran 77 name mangling""... $ac_c" 1>&6
echo "configure:2391: checking for Fortran 77 name mangling" >&5
if eval "test \"`echo '$''{'pac_cv_prog_f77_name_mangle'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
   # 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).
   rm -f conftest*
   cat > conftest.f <<EOF
       subroutine MY_name( a )
       return
       end
EOF
   # This is the ac_compile line used if LANG_FORTRAN77 is selected
   if test "X$ac_fcompile" = "X" ; then
       ac_fcompile='${F77-f77} -c $FFLAGS conftest.f 1>&5'
   fi
   if { (eval echo configure:2415: \"$ac_fcompile\") 1>&5; (eval $ac_fcompile) 2>&5; } && test -s conftest.o ; then
	mv conftest.o fconftestf.o
   else 
	echo "configure: failed program was:" >&5
        cat conftest.f >&5
   fi

   
   ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
   
   save_LIBS="$LIBS"
      LIBS="fconftestf.o $FLIBS $LIBS"
   cat > conftest.$ac_ext <<EOF
#line 2433 "configure"
#include "confdefs.h"

int main() {
my_name();
; return 0; }
EOF
if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 2450 "configure"
#include "confdefs.h"

int main() {
my_name_();
; return 0; }
EOF
if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower underscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 2468 "configure"
#include "confdefs.h"

int main() {
MY_NAME();
; return 0; }
EOF
if { (eval echo configure:2475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="upper"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 2486 "configure"
#include "confdefs.h"

int main() {
my_name__();
; return 0; }
EOF
if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="lower doubleunderscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 2504 "configure"
#include "confdefs.h"

int main() {
MY_name();
; return 0; }
EOF
if { (eval echo configure:2511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="mixed"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   if test  "X$pac_cv_prog_f77_name_mangle" = "X" ; then
     cat > conftest.$ac_ext <<EOF
#line 2522 "configure"
#include "confdefs.h"

int main() {
MY_name_();
; return 0; }
EOF
if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_cv_prog_f77_name_mangle="mixed underscore"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
   fi
   LIBS="$save_LIBS"
   ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

   rm -f fconftest*

fi

echo "$ac_t""$pac_cv_prog_f77_name_mangle" 1>&6
# Make the actual definition
pac_namecheck=`echo X$pac_cv_prog_f77_name_mangle | sed 's/ /-/g'`

case $pac_namecheck in
    X) echo "configure: warning: Cannot determine Fortran naming scheme" 1>&2 ;;
    Xlower) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER 1
EOF
 ;;
    Xlower-underscore) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER_USCORE 1
EOF
 ;;
    Xlower-doubleunderscore) cat >> confdefs.h <<\EOF
#define F77_NAME_LOWER_2USCORE 1
EOF
 ;;
    Xupper) cat >> confdefs.h <<\EOF
#define F77_NAME_UPPER 1
EOF
 ;;
    Xmixed) cat >> confdefs.h <<\EOF
#define F77_NAME_MIXED 1
EOF
 ;;
    Xmixed-underscore) cat >> confdefs.h <<\EOF
#define F77_NAME_MIXED_USCORE 1
EOF
 ;;
    *) echo "configure: warning: Unknown Fortran naming scheme" 1>&2 ;;
esac


fi

if test "$enable_mpe_graphics" = "yes" -a "$NOF77" = "0" ; then
    if test "$enable_checkMPI" = "yes" ; then
        enable_f2c_graphicslib=yes
    else
        enable_f2c_graphicslib=no
        if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then
            cat >> confdefs.h <<\EOF
#define HAVE_MPI_COMM_F2C 1
EOF

        fi
    fi
fi

if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" \
     -o "$enable_f2c_graphicslib" = "yes" ; then
#   Determine MPI_Fint
    if test "$MPI_IMPL" != "MPICH2" ; then
        echo $ac_n "checking for MPI_Fint ""... $ac_c" 1>&6
echo "configure:2605: checking for MPI_Fint " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2625 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
     MPI_Fint aa=1  ; 
    MPI_Init(&argc, &argv);
     ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        echo "$ac_t""$mpe_link_ok" 1>&6
    else
        # MPICH2 include MPI_Fint
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        MPI_FINT_TYPE=MPI_Fint
    else
        echo "$ac_t""Assumed MPI_Fint to be int" 1>&6
        MPI_FINT_TYPE=int
        cat >> confdefs.h <<\EOF
#define MPI_Fint int
EOF

    fi

#   Determmine if MPI_Comm_f2c() and MPI_Comm_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Comm_c2f() and MPI_Comm_f2c() ""... $ac_c" 1>&6
echo "configure:2683: checking for MPI_Comm_c2f() and MPI_Comm_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2703 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Comm comm; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Comm_c2f(comm) ;
			  comm=MPI_Comm_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

        echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_COMM_F2C 1
EOF

    fi
fi


if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" ; then

    if test "$MPI_IMPL" = MPICH2 ; then
        # Use CROSS_MPI_STATUS_SIZE to trick the configure into accepting
	# MPICH2
	if test -n "$SIZEOF_MPI_STATUS" ; then
	    # FIXME: Get true value of MPI_Fint instead of 4
	    CROSS_MPI_STATUS_SIZE=`expr $SIZEOF_MPI_STATUS / 4`
	    MPI_STATUS_SIZE=$CROSS_MPI_STATUS_SIZE
        fi
    fi
#   Determine MPI_STATUS_SIZE (this is the INTEGER status size for Fortran)
    mpe_tmpfile=mpe_mpistatusvalue
    echo $ac_n "checking for the value of MPI_STATUS_SIZE ""... $ac_c" 1>&6
echo "configure:2774: checking for the value of MPI_STATUS_SIZE " >&5
    if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
        if test "X$CROSS_MPI_STATUS_SIZE" != "X" ; then
            mpe_MPI_STATUS_SIZE="$CROSS_MPI_STATUS_SIZE"
            cat >> confdefs.h <<EOF
#define MPI_STATUS_SIZE $mpe_MPI_STATUS_SIZE
EOF

            echo "$ac_t""${mpe_MPI_STATUS_SIZE} " 1>&6
        else
            { echo "configure: error: Undefined CROSS_MPI_STATUS_SIZE! Exiting... " 1>&2; exit 1; }
        fi
    elif test -z "$MPI_STATUS_SIZE" ; then
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_SER_CC="$CC"
    pac_SER_CFLAGS="$CFLAGS"
    pac_SER_LIBS="$LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    rm -rf conftest*
    cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdio.h>
#include "mpi.h"
main()
{
    FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
    if ( ! mpe_file ) exit( 1 );
    fprintf( mpe_file, "%d\n",
             sizeof( MPI_Status )/sizeof( ${MPI_FINT_TYPE} ) );
    fclose( mpe_file );
    exit( 0 );
}
                            
EOF
    pac_compile='${CC-cc} -c $CFLAGS conftest.c 1>&5'
    if { (eval echo configure:2824: \"$pac_compile\") 1>&5; (eval $pac_compile) 2>&5; } && test -s conftest.${ac_objext} ; then
        CC="$pac_SER_CC"
        CFLAGS="$pac_SER_CFLAGS"
        LIBS="$pac_SER_LIBS"
	pac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS conftest.${ac_objext} $LIBS 1>&5'
        if { (eval echo configure:2829: \"$pac_link\") 1>&5; (eval $pac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest${ac_exeext} ; exit) 2>/dev/null ; then
	    pac_mpi_working=yes
	else
	    pac_mpi_working=no
	fi
    else
        pac_mpi_working=no
    fi
    rm -rf conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_run_ok=yes 
    else
        mpe_run_ok=no  
    fi

        if test "$mpe_run_ok" = "yes" ; then
            mpe_MPI_STATUS_SIZE="`cat ${mpe_tmpfile} | sed -e 's/ //g'`"
            cat >> confdefs.h <<EOF
#define MPI_STATUS_SIZE $mpe_MPI_STATUS_SIZE
EOF

            echo "$ac_t""${mpe_MPI_STATUS_SIZE} " 1>&6
            rm -f ${mpe_tmpfile}
        else
            { echo "configure: error: could NOT determine! " 1>&2; exit 1; }
        fi
    else
        echo "$ac_t""$MPI_STATUS_SIZE" 1>&6
        cat >> confdefs.h <<EOF
#define MPI_STATUS_SIZE $MPI_STATUS_SIZE
EOF

    fi

#   Determmine if MPI_Status_f2c() and MPI_Status_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Status_c2f() and MPI_Status_f2c() ""... $ac_c" 1>&6
echo "configure:2876: checking for MPI_Status_c2f() and MPI_Status_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2896 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Status        c_status;
			  ${MPI_FINT_TYPE}  f_status[ ${mpe_MPI_STATUS_SIZE} ];
			  int ierr;
			   ; 
    MPI_Init(&argc, &argv);
    
			  ierr=MPI_Status_c2f( &c_status, f_status ) ;
			  ierr=MPI_Status_f2c( f_status, &c_status ) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi

    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_STATUS_F2C 1
EOF

    fi

#   Determmine if MPI_Type_f2c() and MPI_Type_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Type_c2f() and MPI_Type_f2c() ""... $ac_c" 1>&6
echo "configure:2957: checking for MPI_Type_c2f() and MPI_Type_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 2977 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Datatype type; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Type_c2f(type) ;
			  type=MPI_Type_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_TYPE_F2C 1
EOF

    fi

#   Determmine if MPI_Group_f2c() and MPI_Group_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Group_c2f() and MPI_Group_f2c() ""... $ac_c" 1>&6
echo "configure:3035: checking for MPI_Group_c2f() and MPI_Group_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 3055 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Group group; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Group_c2f(group) ;
			  group=MPI_Group_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_GROUP_F2C 1
EOF

    fi

#   Determmine if MPI_Request_f2c() and MPI_Request_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Request_c2f() and MPI_Request_f2c() ""... $ac_c" 1>&6
echo "configure:3113: checking for MPI_Request_c2f() and MPI_Request_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 3133 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Request request; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Request_c2f(request) ;
			  request=MPI_Request_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:3151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_REQUEST_F2C 1
EOF

    fi

#   Determmine if MPI_Op_f2c() and MPI_Op_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Op_c2f() and MPI_Op_f2c() ""... $ac_c" 1>&6
echo "configure:3191: checking for MPI_Op_c2f() and MPI_Op_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 3211 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Op op; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Op_c2f(op) ;
			  op=MPI_Op_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:3229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_OP_F2C 1
EOF

    fi

#   Determmine if MPI_Errhandler_f2c() and MPI_Errhandler_c2f() are there
    if test "$MPI_IMPL" != MPICH2 ; then
        echo $ac_n "checking for MPI_Errhandler_c2f() and MPI_Errhandler_f2c() ""... $ac_c" 1>&6
echo "configure:3269: checking for MPI_Errhandler_c2f() and MPI_Errhandler_f2c() " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 3289 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
			  MPI_Errhandler errhandler; ${MPI_FINT_TYPE} aa;
			   ; 
    MPI_Init(&argc, &argv);
     
			  aa=MPI_Errhandler_c2f(errhandler) ;
			  errhandler=MPI_Errhandler_f2c(aa) ;
			   ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:3307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_ERRHANDLER_F2C 1
EOF

    fi


#   Determine the Fortran logical values, .TRUE. & .FALSE. in MPI C program
    if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
        echo $ac_n "checking for the Fortran .TRUE. values in MPI C program ""... $ac_c" 1>&6
echo "configure:3348: checking for the Fortran .TRUE. values in MPI C program " >&5
        if test "X$CROSS_FORTRAN2C_TRUE" != "X" ; then
            cat >> confdefs.h <<EOF
#define MPE_F77_TRUE_VALUE $CROSS_FORTRAN2C_TRUE
EOF

            echo "$ac_t""${CROSS_FORTRAN2C_TRUE} " 1>&6
        else
            { echo "configure: error: Undefined CROSS_FORTRAN2C_TRUE! Exiting... " 1>&2; exit 1; }
        fi
        echo $ac_n "checking for the Fortran .FALSE. values in MPI C program ""... $ac_c" 1>&6
echo "configure:3359: checking for the Fortran .FALSE. values in MPI C program " >&5
        if test "X$CROSS_FORTRAN2C_FALSE" != "X" ; then
            cat >> confdefs.h <<EOF
#define MPE_F77_FALSE_VALUE $CROSS_FORTRAN2C_FALSE
EOF

            echo "$ac_t""${CROSS_FORTRAN2C_FALSE} " 1>&6
        else
            { echo "configure: error: Undefined CROSS_FORTRAN2C_FALSE! Exiting... " 1>&2; exit 1; }
        fi
    elif test "$MPI_IMPL" != "MPICH2" ; then
        echo $ac_n "checking for the Fortran logical values in MPI C program ""... $ac_c" 1>&6
echo "configure:3371: checking for the Fortran logical values in MPI C program " >&5
        mpe_tmpfile=mpe_f77logicals
        
    pac_MPI_F77="$F77"
    pac_MPI_FFLAGS="$FFLAGS"
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_SER_CC="$CC"
    pac_SER_CFLAGS="$CFLAGS"
    pac_SER_LIBS="$LIBS"
    
    ac_ext=f
ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5'
ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_f77_cross

    pac_saved_F77="$F77"
    pac_saved_FFLAGS="$FFLAGS"
    pac_saved_LIBS="$LIBS"
    F77="$pac_MPI_F77"
    FFLAGS="$pac_MPI_FFLAGS"
    rm -f conftest*
    cat > conftestf.f <<EOF
	
      subroutine ftest( itrue, ifalse )
      logical itrue, ifalse
      itrue  = .TRUE.
      ifalse = .FALSE.
      return
      end
                                 
EOF
    pac_Fcompile='${F77-f77} -c $FFLAGS conftestf.f 1>&5'
    if { (eval echo configure:3404: \"$pac_Fcompile\") 1>&5; (eval $pac_Fcompile) 2>&5; } && test -s conftestf.${ac_objext} ; then
        pac_mpi_working=yes
    else
        pac_mpi_working=no
    fi
    F77="$pac_saved_F77"
    FFLAGS="$pac_saved_FFLAGS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    cat > conftestc.c <<EOF
#include "confdefs.h"

#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
#define ftest_ ftest
#endif
#include <stdio.h>
#include "mpi.h"
int main()
{
    ${MPI_FINT_TYPE} itrue, ifalse;
    FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
    if ( ! mpe_file ) exit( 1 );
    ftest_( &itrue, &ifalse );
    fprintf( mpe_file, "%d %d\n", itrue, ifalse );
    fclose( mpe_file );
    exit( 0 );
}
                                     
EOF
    pac_Ccompile='${CC-cc} -c $CFLAGS conftestc.c 1>&5'
    if test "$pac_mpi_working" = "yes" && { (eval echo configure:3443: \"$pac_Ccompile\") 1>&5; (eval $pac_Ccompile) 2>&5; } && test -s conftestc.${ac_objext} ; then
        CC="$pac_SER_CC"
	CFLAGS="$pac_SER_CFLAGS"
	LIBS="$pac_SER_LIBS"
        pac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $LDFLAGS conftestc.${ac_objext} conftestf.${ac_objext} $LIBS 1>&5'
	if { (eval echo configure:3448: \"$pac_link\") 1>&5; (eval $pac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest${ac_exeext} ; exit) 2>/dev/null ; then
            pac_mpi_working=yes
        else
            pac_mpi_working=no
        fi
    else
        pac_mpi_working=no
    fi
    rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
         mpe_link_ok=yes 
    else
         mpe_link_ok=no  
    fi

        if test "$mpe_run_ok" = "yes" ; then
            mpe_f77logicals="`cat ${mpe_tmpfile}`"
            true_val="`echo ${mpe_f77logicals} | sed -e 's/ .*//g'`"
            false_val="`echo ${mpe_f77logicals} | sed -e 's/.*  *//g'`"
            if test -n "$true_val" -a -n "$false_val" ; then
                cat >> confdefs.h <<EOF
#define MPE_F77_TRUE_VALUE $true_val
EOF

                cat >> confdefs.h <<EOF
#define MPE_F77_FALSE_VALUE $false_val
EOF

                echo "$ac_t""True=$true_val and False=$false_val " 1>&6
            else
                { echo "configure: error: could NOT determine! " 1>&2; exit 1; }
	        fi
            rm -f ${mpe_tmpfile}
        else
            { echo "configure: error: could NOT determine! " 1>&2; exit 1; }
        fi
    else
         # MPICH2
	 # FIXME: Use the values from the Fortran configure
         true_val=1
         false_val=0
                cat >> confdefs.h <<EOF
#define MPE_F77_TRUE_VALUE $true_val
EOF

                cat >> confdefs.h <<EOF
#define MPE_F77_FALSE_VALUE $false_val
EOF

    fi

# endif test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}"
fi

    if test "$WITHIN_KNOWN_MPI_IMPL" != yes ; then
    #   Determine if MPI_STATUS_IGNORE exists
        echo $ac_n "checking for MPI_STATUS_IGNORE ""... $ac_c" 1>&6
echo "configure:3515: checking for MPI_STATUS_IGNORE " >&5
        
    pac_MPI_CC="$MPI_CC"
    pac_MPI_CFLAGS="$CFLAGS $MPI_INC"
    pac_MPI_LIBS="$MPI_LIBS"
    
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    pac_saved_CC="$CC"
    pac_saved_CFLAGS="$CFLAGS"
    pac_saved_LIBS="$LIBS"
    CC="$pac_MPI_CC"
    CFLAGS="$pac_MPI_CFLAGS"
    LIBS="$pac_MPI_LIBS"
    cat > conftest.$ac_ext <<EOF
#line 3535 "configure"
#include "confdefs.h"
#include "mpi.h"
int main() {

    int argc; char **argv;
    
              MPI_Status*     tmp_status;
              tmp_status = MPI_STATUS_IGNORE;
			   ; 
    MPI_Init(&argc, &argv);
     ;
    MPI_Finalize();
                 
; return 0; }
EOF
if { (eval echo configure:3551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  pac_mpi_working=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_mpi_working=no 
fi
rm -f conftest*
    CC="$pac_saved_CC"
    CFLAGS="$pac_saved_CFLAGS"
    LIBS="$pac_saved_LIBS"
    ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

    if test "$pac_mpi_working" = "yes" ; then
        mpe_link_ok=yes 
    else
        mpe_link_ok=no  
    fi

	echo "$ac_t""$mpe_link_ok" 1>&6
    else
        # All known impls, including MPICH, support STATUS_IGNORE
        # (The MPICH support may have a few bugs, but it is close enough
	# for our needs)
        mpe_link_ok=yes
    fi
    if test "$mpe_link_ok" = "yes" ; then
        cat >> confdefs.h <<\EOF
#define HAVE_MPI_STATUS_IGNORE 1
EOF

    fi

# MPE_HEADERS are header files to be installed into $includedir. 
# It needs to be defined here so we have only ONE source of headers defined,
# otherwise, top_srcdir/Makefile.in and top_srcdir/sbin/mpeinstall will need
# to define MPE_HEADERS separately.
MPE_HEADERS="mpe.h mpe_graphics.h mpe_log.h mpetools.h mpeexten.h basex11.h protofix.h"
if test "$NOF77" = 0 ; then
    # Add the Fortran version of mpef.h
    MPE_HEADERS="$MPE_HEADERS mpef.h"
fi


MPE_GRPAHICS=""
MPEGRAPHICS_SOURCE=""
MPEGRAPHICS_FSOURCE=""
#
# We need to check that this has worked.  The autoconf macro is broken
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:3608: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 3623 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 3640 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 3657 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
   { echo "configure: error: configure could not find a working C preprocessor" 1>&2; exit 1; }
fi
if test "$enable_mpe_graphics" = "yes" ; then
    # If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:3696: checking for X" >&5

# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
  withval="$with_x"
  :
fi

# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
if test "x$with_x" = xno; then
  # The user explicitly disabled X.
  have_x=disabled
else
  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
    # Both variables are already set.
    have_x=yes
  else
if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # One or both of the vars are not set, and there is no cached value.
ac_x_includes=NO ac_x_libraries=NO
rm -fr conftestdir
if mkdir conftestdir; then
  cd conftestdir
  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  cat > Imakefile <<'EOF'
acfindx:
	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
EOF
  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    for ac_extension in a so sl; do
      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
        test -f $ac_im_libdir/libX11.$ac_extension; then
        ac_im_usrlibdir=$ac_im_libdir; break
      fi
    done
    # Screen out bogus values from the imake configuration.  They are
    # bogus both because they are the default anyway, and because
    # using them would break gcc on systems where it needs fixed includes.
    case "$ac_im_incroot" in
	/usr/include) ;;
	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
    esac
    case "$ac_im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test "$ac_x_includes" = NO; then
  # Guess where to find include files, by looking for this one X11 .h file.
  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h

  # First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 3758 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  # We can compile using X headers with no special include directory.
ac_x_includes=
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  # Look for the header file in a standard set of common directories.
# Check X11 before X11Rn because it is often a symlink to the current release.
  for ac_dir in               \
    /usr/X11/include          \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11          \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11/include    \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/include              \
    /usr/local/include        \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
                              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    ; \
  do
    if test -r "$ac_dir/$x_direct_test_include"; then
      ac_x_includes=$ac_dir
      break
    fi
  done
fi
rm -f conftest*
fi # $ac_x_includes = NO

if test "$ac_x_libraries" = NO; then
  # Check for the libraries.

  test -z "$x_direct_test_library" && x_direct_test_library=Xt
  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc

  # See if we find them without any special options.
  # Don't add to $LIBS permanently.
  ac_save_LIBS="$LIBS"
  LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3832 "configure"
#include "confdefs.h"

int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:3839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
ac_x_libraries=
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# First see if replacing the include by lib works.
# Check X11 before X11Rn because it is often a symlink to the current release.
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
    /usr/X11/lib          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    /lib/usr/lib/X11	  \
                          \
    /usr/openwin/lib      \
    /usr/openwin/share/lib \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
      ac_x_libraries=$ac_dir
      break 2
    fi
  done
done
fi
rm -f conftest*
fi # $ac_x_libraries = NO

if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
  # Didn't find X anywhere.  Cache the known absence of X.
  ac_cv_have_x="have_x=no"
else
  # Record where we found X for the cache.
  ac_cv_have_x="have_x=yes \
	        ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
fi
fi
  fi
  eval "$ac_cv_have_x"
fi # $with_x != no

if test "$have_x" != yes; then
  echo "$ac_t""$have_x" 1>&6
  no_x=yes
else
  # If each of the values was on the command line, it overrides each guess.
  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  # Update the cache value to reflect the command line values.
  ac_cv_have_x="have_x=yes \
		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
fi

else
    no_x="yes"
fi
#
if test -z "$no_x" ; then
    MPE_GRAPHICS="-DMPE_GRAPHICS"
    MPEGRAPHICS_SOURCE="mpe_graphics.c xcolor.c xframe.c xinit.c xwmap.c xmouse.c xkey.c"
    MPEGRAPHICS_FSOURCE="mpe_graphicsf.c xmousef.c"
    if test -n "$x_includes" ; then
        X_INC=-I$x_includes
    fi
    if test -n "$x_libraries" ; then
        X_LIB="-L$x_libraries -lX11"
        ANIM_LIBS="$ANIM_LIBS -L$x_libraries -lX11"
        XGRAPH_LIBS="$XGRAPH_LIBS -L$x_libraries -lX11"
    else
        X_LIB="-lX11"
        ANIM_LIBS="$ANIM_LIBS -lX11"
        XGRAPH_LIBS="$XGRAPH_LIBS -lX11"
    fi
else
        echo "configure: warning: Could not find appropriate X windows libraries.  MPE routines that make use of X11 graphics will NOT be built unless you put X windows libraries in your path and reconfigure" 1>&2
    MPE_GRAPHICS="" 
    NO_X=1
fi
#
#
# Extract the first word of "dbx", so it can be a program name with args.
set dummy dbx; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3955: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DBX_NAME'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$DBX_NAME" in
  /*)
  ac_cv_path_DBX_NAME="$DBX_NAME" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_DBX_NAME="$DBX_NAME" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_DBX_NAME="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
DBX_NAME="$ac_cv_path_DBX_NAME"
if test -n "$DBX_NAME"; then
  echo "$ac_t""$DBX_NAME" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

#
# Extract the first word of "gdb", so it can be a program name with args.
set dummy gdb; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3991: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GDB_NAME'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$GDB_NAME" in
  /*)
  ac_cv_path_GDB_NAME="$GDB_NAME" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GDB_NAME="$GDB_NAME" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_GDB_NAME="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
GDB_NAME="$ac_cv_path_GDB_NAME"
if test -n "$GDB_NAME"; then
  echo "$ac_t""$GDB_NAME" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


#   
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:4026: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4031 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 4056 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 4074 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 4095 "configure"
#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
if { (eval echo configure:4106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:4130: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4135 "configure"
#include "confdefs.h"

int main() {

/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this.  */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25, 17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}

; return 0; }
EOF
if { (eval echo configure:4184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_c_const" 1>&6
if test $ac_cv_c_const = no; then
  cat >> confdefs.h <<\EOF
#define const 
EOF

fi


#   -- Check if byteswapping needs to be done.
if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
    echo $ac_n "checking for byte ordering""... $ac_c" 1>&6
echo "configure:4208: checking for byte ordering" >&5
    if test "X$CROSS_BIGENDIAN" != "X" ; then
        if test "$CROSS_BIGENDIAN" = "true" \
             -o "$CROSS_BIGENDIAN" = "false" ; then
            if test "$CROSS_BIGENDIAN" = "true" ; then
                cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

                echo "$ac_t""defined to be big endian" 1>&6
            else
                echo "$ac_t""defined to be little endian" 1>&6
            fi
        else
            cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

            echo "$ac_t""Unknown value $CROSS_BIGENDIAN! Assumed big endian" 1>&6
        fi
    else
        cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

        echo "$ac_t""Undefined CROSS_BIGENDIAN! Assumed big endian" 1>&6
    fi
else
    echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:4237: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
#line 4244 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
 bogus endian macros
#endif
; return 0; }
EOF
if { (eval echo configure:4255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  # It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
#line 4259 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
int main() {

#if BYTE_ORDER != BIG_ENDIAN
 not big endian
#endif
; return 0; }
EOF
if { (eval echo configure:4270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_bigendian=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_c_bigendian=no
fi
rm -f conftest*
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test $ac_cv_c_bigendian = unknown; then
if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 4290 "configure"
#include "confdefs.h"
main () {
  /* Are we little or big endian?  From Harbison&Steele.  */
  union
  {
    long l;
    char c[sizeof (long)];
  } u;
  u.l = 1;
  exit (u.c[sizeof (long) - 1] == 1);
}
EOF
if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_bigendian=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_bigendian=yes
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = yes; then
  cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

fi

fi

#
echo $ac_n "checking for long pointers""... $ac_c" 1>&6
echo "configure:4330: checking for long pointers" >&5
if test "$cross_compiling" = yes; then
  sizeof_void_greater=$CROSS_SIZEOF_VOID_GREATER
else
  cat > conftest.$ac_ext <<EOF
#line 4335 "configure"
#include "confdefs.h"
int main()
{
  if (sizeof(void *) > 4)
    return -1;
  return 0;
}
EOF
if { (eval echo configure:4344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  sizeof_void_greater=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  sizeof_void_greater=yes
fi
rm -fr conftest*
fi

if test "$sizeof_void_greater" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define POINTER_64_BITS 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi
for ac_func in system
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4368: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4373 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_func in sysinfo
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4423: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4428 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

# mkstemp is a better replacement for mktemp
for ac_func in mkstemp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4479: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4484 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* 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_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

echo $ac_n "checking for uname""... $ac_c" 1>&6
echo "configure:4532: checking for uname" >&5
if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4537 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char uname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char uname();

int main() {

/* 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
uname();
#endif

; return 0; }
EOF
if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_uname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_uname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_UNAME 1
EOF
haveuname=1
else
  echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:4583: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4588 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyname(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {

/* 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
gethostbyname();
#endif

; return 0; }
EOF
if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gethostbyname=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_GETHOSTBYNAME 1
EOF
havegethostbyname=1
else
  echo "$ac_t""no" 1>&6
fi

#
# check if Large File support is available for 32-bit OS 
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4639: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4644 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 echo $ac_n "checking for large file support ""... $ac_c" 1>&6
echo "configure:4670: checking for large file support " >&5
    cat > conftest.$ac_ext <<EOF
#line 4672 "configure"
#include "confdefs.h"

        #define _LARGEFILE64_SOURCE 1
        #include <unistd.h>
        
int main() {

        #ifndef _LFS64_LARGEFILE
        #error no largefile support
        #endif
        
; return 0; }
EOF
if { (eval echo configure:4686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define _LARGEFILE64_SOURCE  1
EOF

        cat >> confdefs.h <<\EOF
#define _FILE_OFFSET_BITS 64 
EOF

        echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
    
fi
rm -f conftest*

else
  echo "$ac_t""no" 1>&6
fi
done

# getopt.h is used in clog2slog
for ac_hdr in stdlib.h string.h netdb.h sys/systeminfo.h getopt.h 
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4716: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4721 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6
echo "configure:4754: checking for stdarg.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4759 "configure"
#include "confdefs.h"
#include <stdarg.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_STDARG_H 1
EOF
 havestdarg=1
else
  echo "$ac_t""no" 1>&6
fi

#
# We need to build mpe with the shared library flags
# This should rely on the same approach used in the mpich configure,
# since just using TRY_LINK or TRY_COMPILE doesn't identify warning messages
# about "compiler flag unrecognized".
#
# 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
    echo $ac_n "checking for stdarg is correct""... $ac_c" 1>&6
echo "configure:4800: checking for stdarg is correct" >&5
if test ! -f confdefs.h ; then
    echo "$ac_t"""!! SHELL ERROR !!"" 1>&6
    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 <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 echo configure:4826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  echo "$ac_t""yes" 1>&6
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define USE_STDARG 1
EOF

MPE_CFLAGS="$MPE_CFLAGS -DUSE_STDARG"

   else echo "$ac_t""no" 1>&6
fi
rm -f conftest*

fi
#
echo $ac_n "checking if compiler accepts prototypes""... $ac_c" 1>&6
echo "configure:4842: checking if compiler accepts prototypes" >&5
cat > conftest.$ac_ext <<EOF
#line 4844 "configure"
#include "confdefs.h"

int main() {
int f(double a);
; return 0; }
EOF
if { (eval echo configure:4851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  have_proto=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  have_proto=no
fi
rm -f conftest*
if test "$have_proto" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_PROTOTYPES 1
EOF

    MPE_CFLAGS="$MPE_CFLAGS -DHAVE_PROTOTYPES"
    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for sighandler_t""... $ac_c" 1>&6
echo "configure:4873: checking for sighandler_t" >&5
cat > conftest.$ac_ext <<EOF
#line 4875 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
sighandler_t *f;
; return 0; }
EOF
if { (eval echo configure:4882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_sighandler_t=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_sighandler_t=no
fi
rm -f conftest*
echo "$ac_t""$has_sighandler_t" 1>&6
if test "$has_sighandler_t" = "yes" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_SIGHANDLER_T 1
EOF

fi
#
#
MPE_CFLAGS="$MPE_CFLAGS $COPTIONS"
#
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4906: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="ar"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR=";"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

#
if test -z "$CLINKER" ; then CLINKER="$CC" ; fi
if test -z "$FLINKER" ; then FLINKER="$F77" ; fi










































# Make the directories that do not contain Makefiles (should they?) but 
# are needed for the subsequent directories.
if test ! -d contrib ; then mkdir contrib ; fi
rm -f $srcdir/mpeconf.h

# Determine if the log viewers directory is going to be configured.
# Check whether --enable-viewers or --disable-viewers was given.
if test "${enable_viewers+set}" = set; then
  enableval="$enable_viewers"
  :
else
  enable_viewers=yes 
fi


if test "$enable_viewers" = "yes" -a -s $srcdir/viewers/configure ; then
    viewers_dir="viewers"
    LOGVIEWERS=1
else
    viewers_dir=
    LOGVIEWERS=0
fi
export CLINKER
subdirs="$viewers_dir"



# Determine if the slog2sdk directory is going to be configured.
# Check whether --enable-slog2 or --disable-slog2 was given.
if test "${enable_slog2+set}" = set; then
  enableval="$enable_slog2"
  :
else
  enable_slog2=yes 
fi


if test -s $srcdir/slog2sdk/configure ; then
    if test "$enable_slog2" = "yes" -o "$enable_slog2" = "build" ; then
        slog2_dir="slog2sdk"
        SLOG2TOOLS=1
        if test "$enable_slog2" = "build" ; then
            slog2_enable_source=yes
        else
            slog2_enable_source=no
        fi
        export slog2_enable_source
	# Enabling softerror in SLOG2 configure won't abort the entire process
        slog2_enable_softerror=yes
        export slog2_enable_softerror
    else
        slog2_dir=
        SLOG2TOOLS=0
    fi
else
    slog2_dir=
    SLOG2TOOLS=0
fi
subdirs="$viewers_dir $slog2_dir"




trap '' 1 2 15

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

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 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir

trap 'rm -fr `echo "Makefile sbin/mpeinstall src/Makefile src/Makefile_nompi \
	   src/dbxerr.c contrib/life/Makefile contrib/mandel/Makefile \
	   contrib/mastermind/Makefile contrib/test/Makefile  mpeconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@top_srcdir_abs@%$top_srcdir_abs%g
s%@VPATH@%$VPATH%g
s%@MAKE@%$MAKE%g
s%@BUILDING_MPI@%$BUILDING_MPI%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@includebuild_dir@%$includebuild_dir%g
s%@libbuild_dir@%$libbuild_dir%g
s%@binbuild_dir@%$binbuild_dir%g
s%@sbinbuild_dir@%$sbinbuild_dir%g
s%@CC@%$CC%g
s%@OBJEXT@%$OBJEXT%g
s%@EXEEXT@%$EXEEXT%g
s%@RANLIB@%$RANLIB%g
s%@F77@%$F77%g
s%@FLIBS@%$FLIBS%g
s%@MPE_HEADERS@%$MPE_HEADERS%g
s%@CPP@%$CPP%g
s%@DBX_NAME@%$DBX_NAME%g
s%@GDB_NAME@%$GDB_NAME%g
s%@AR@%$AR%g
s%@MPI_IMPL@%$MPI_IMPL%g
s%@CLINKER@%$CLINKER%g
s%@MPI_CC@%$MPI_CC%g
s%@FLINKER@%$FLINKER%g
s%@MPI_F77@%$MPI_F77%g
s%@NO_X@%$NO_X%g
s%@X_INC@%$X_INC%g
s%@X_LIB@%$X_LIB%g
s%@MPI_INC@%$MPI_INC%g
s%@MPI_LIBS@%$MPI_LIBS%g
s%@DEBUG_LIBS@%$DEBUG_LIBS%g
s%@PROF_LIBNAME@%$PROF_LIBNAME%g
s%@LOG_LIBNAME@%$LOG_LIBNAME%g
s%@TRACE_LIBNAME@%$TRACE_LIBNAME%g
s%@ANIM_LIBNAME@%$ANIM_LIBNAME%g
s%@F2CMPI_LIBNAME@%$F2CMPI_LIBNAME%g
s%@PROF_LIBS@%$PROF_LIBS%g
s%@LOG_LIBS@%$LOG_LIBS%g
s%@TRACE_LIBS@%$TRACE_LIBS%g
s%@ANIM_LIBS@%$ANIM_LIBS%g
s%@XGRAPH_LIBS@%$XGRAPH_LIBS%g
s%@F2CMPI_LIBS@%$F2CMPI_LIBS%g
s%@MPEDBG@%$MPEDBG%g
s%@MPE_GRAPHICS@%$MPE_GRAPHICS%g
s%@MPEGRAPHICS_SOURCE@%$MPEGRAPHICS_SOURCE%g
s%@MPEGRAPHICS_FSOURCE@%$MPEGRAPHICS_FSOURCE%g
s%@MPE_CFLAGS@%$MPE_CFLAGS%g
s%@MPE_FFLAGS@%$MPE_FFLAGS%g
s%@FLIB_PATH_LEADER@%$FLIB_PATH_LEADER%g
s%@CPRP@%$CPRP%g
s%@NOF77@%$NOF77%g
s%@SLOG_HOME@%$SLOG_HOME%g
s%@C2S1_SRC@%$C2S1_SRC%g
s%@subdirs@%$subdirs%g
s%@LOGVIEWERS@%$LOGVIEWERS%g
s%@SLOG2TOOLS@%$SLOG2TOOLS%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"Makefile sbin/mpeinstall src/Makefile src/Makefile_nompi \
	   src/dbxerr.c contrib/life/Makefile contrib/mandel/Makefile \
	   contrib/mastermind/Makefile contrib/test/Makefile "}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac


  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands 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.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="mpeconf.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef 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.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF


EOF
cat >> $CONFIG_STATUS <<\EOF

if test ! -x ./sbin/mpeinstall -a -s ./sbin/mpeinstall; then
    chmod u+x ./sbin/mpeinstall
fi
 

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1

if test "$no_recursion" != yes; then

  # Remove --cache-file and --srcdir arguments so they do not pile up.
  ac_sub_configure_args=
  ac_prev=
  for ac_arg in $ac_configure_args; do
    if test -n "$ac_prev"; then
      ac_prev=
      continue
    fi
    case "$ac_arg" in
    -cache-file | --cache-file | --cache-fil | --cache-fi \
    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
      ac_prev=cache_file ;;
    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
      ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
      ac_prev=srcdir ;;
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
      ;;
    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
    esac
  done

  for ac_config_dir in $viewers_dir $slog2_dir; do

    # Do not complain, so a configure script can configure whichever
    # parts of a large source tree are present.
    if test ! -d $srcdir/$ac_config_dir; then
      continue
    fi

    echo configuring in $ac_config_dir

    case "$srcdir" in
    .) ;;
    *)
      if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
      else
        { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
      fi
      ;;
    esac

    ac_popdir=`pwd`
    cd $ac_config_dir

      # A "../" for each directory in /$ac_config_dir.
      ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`

    case "$srcdir" in
    .) # No --srcdir option.  We are building in place.
      ac_sub_srcdir=$srcdir ;;
    /*) # Absolute path.
      ac_sub_srcdir=$srcdir/$ac_config_dir ;;
    *) # Relative path.
      ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
    esac

    # Check for guested configure; otherwise get Cygnus style configure.
    if test -f $ac_sub_srcdir/configure; then
      ac_sub_configure=$ac_sub_srcdir/configure
    elif test -f $ac_sub_srcdir/configure.in; then
      ac_sub_configure=$ac_configure
    else
      echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
      ac_sub_configure=
    fi

    # The recursion is here.
    if test -n "$ac_sub_configure"; then

      # Make the cache file name correct relative to the subdirectory.
      case "$cache_file" in
      /*) ac_sub_cache_file=$cache_file ;;
      *) # Relative path.
        ac_sub_cache_file="$ac_dots$cache_file" ;;
      esac

      echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
      # The eval makes quoting arguments work.
      if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
      then :
      else
        { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
      fi
    fi

    cd $ac_popdir
  done
fi

