#! /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-aio - Request use of asynchronous I/O routines"
ac_help="$ac_help
--enable-echo  - Turn on strong echoing. The default is enable=no. "
ac_help="$ac_help
--enable-f77 - Turn on support for Fortran 77 (default)"
ac_help="$ac_help
--enable-weak-symbols - Turn on support for weak symbols"
ac_help="$ac_help
--enable-debug - Build a debugging version"
ac_help="$ac_help

--with-file-system=name - Build with support for the named file systems"
ac_help="$ac_help

--with-mpi=name - Specify MPI implementation to build ROMIO for"

# 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=adio/include/romioconf.h.in

# 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

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
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

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


VERSION=1.2.6
echo "$ac_t""Configuring ROMIO Version $VERSION" 1>&6
CONFIGURE_ARGS="$*"
if test -n "$CONFIGURE_ARGS" ; then
    echo "Configuring with args $CONFIGURE_ARGS"
fi



NOF77=0
ARCH=""
arch_IRIX=""
MPI=""
MPI_INCLUDE_DIR=""
ROMIO_INCLUDE=""
TEST_LIBNAME=""
FILE_SYSTEM=""
# Do not set variables to empty that may be communicated from the
# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME)
DEBUG=no
MIPS=0
BITS=0
FROM_MPICH=${FROM_MPICH:-no}
FROM_MPICH2=${FROM_MPICH2:-no}
if test "$FROM_MPICH" = yes -a "$FROM_MPICH2" = yes ; then
    echo "configure: warning: Both FROM_MPICH and FROM_MPICH set to yes; at most one should  be yes" 1>&2
    
fi
FROM_LAM=${FROM_LAM:-no}
if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi
CFLAGS=${CFLAGS:-""}
LL="\%lld"
AR_LOCAL=l
DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST"
HAVE_MPI_INFO=""
BUILD_MPI_INFO=""
MPI_FINFO1=""
MPI_FINFO2=""
MPI_FINFO3=""
MPI_FINFO4=""
MPI_FARRAY1=""
MPI_FARRAY2=""
MPI_FARRAY3=""
MPI_FARRAY4=""
MPI_FARRAY5=""
MPI_FARRAY6=""
MPI_FARRAY7=""
DEFS=""
ROMIO_LFLAGS=""
ROMIO_LIBLIST=""
ROMIO_TCFLAGS=""
ROMIO_TCPPFLAGS=""
ROMIO_TFFLAGS=""
NOPROFILE=0
MPIRUN=""
FORTRAN_TEST=""
MAKE=${MAKE:-"make"}
# foll. needed for f77 test programs
F77GETARG="call getarg(i,str)"
F77IARGC="iargc()"
F77MPIOINC=""
FTESTDEFINE=""
FORTRAN_MPI_OFFSET=""
MPIOF_H_INCLUDED=0
MPI_OFFSET_KIND1="!"
MPI_OFFSET_KIND2="!"
F90=""
TEST_CC=""
TEST_F77=""
TRY_WEAK_SYMBOLS=1
#
# Error handlers (not used with MPICH2, which provides its own routines)
MPIO_EXTRA_OBJECTS="get_errh.o set_errh.o"
MPIO_EXTRA_TMP_POBJECTS="get_errh.p set_errh.p"
MPIO_EXTRA_REAL_POBJECTS="_get_errh.o _set_errh.o"
#
# Completion routines for MPIO_Requests.  MPI Implementations with
# generalized requests do not need these
MPIO_REQOBJECTS="iotest.o iotestall.o iotestany.o iotestsome.o iowait.o iowaitall.o iowaitany.o iowaitsome.o ioreq_c2f.o ioreq_f2c.o"
MPIO_REQ_TMP_POBJECTS="iotest.p iowait.p iowaitall.p iowaitany.p iotestall.p iotestany.p iowaitsome.p iotestsome.p"
MPIO_REQ_REAL_POBJECTS="_iotest.o _iowait.o _iowaitall.o _iowaitany.o _iotestall.o _iotestany.o _iowaitsome.o _iotestsome.o"
#
have_aio=no
#
known_filesystems="nfs ufs pfs piofs pvfs pvfs2 testfs xfs hfs sfs"
known_mpi_impls="mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi"
#
# Defaults
# Check whether --enable-aio or --disable-aio was given.
if test "${enable_aio+set}" = set; then
  enableval="$enable_aio"
  :
else
  enable_aio=notgiven
fi

# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
  enableval="$enable_echo"
  set -x
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

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

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

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

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

if test "$enable_f77" != "yes" ; then
   NOF77=1
fi
if test "$enable_debug" = "yes" ; then
    DEBUG=yes
fi
MPI=$with_mpi
FILE_SYSTEM=$with_file_system
#
ac_aux_dir=
for ac_dir in confdb $srcdir/confdb; 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 confdb $srcdir/confdb" 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.


#
# Check that an arch was set
# If it wasn't set, try to guess using "util/tarch"
#
if test -z "$ARCH" -a -x $srcdir/util/tarch ; then
    echo $ac_n "checking for architecture""... $ac_c" 1>&6
echo "configure:713: checking for architecture" >&5
    ARCH=`$srcdir/util/tarch | sed s/-/_/g`
    if test -z "$ARCH" ; then
       echo "$ac_t""Unknown!" 1>&6
       { echo "configure: error: Error: Couldn\'t guess target architecture, you must 
set an architecture type with the environment variable ARCH" 1>&2; exit 1; } 
    fi 
    eval "arch_$ARCH=1"
    echo "$ac_t""$ARCH" 1>&6
fi
#
# check for valid architecture.  Use __ so that _ALPHA_ does not match
# LINUX_ALPHA_
#### WE SHOULD REMOVE THIS SOON
grep __"$ARCH"_ $srcdir/.config_params > /dev/null 2>&1
if test $? != 0 ; then
   echo "configure: warning: Unknown architecture $arch... proceeding anyway" 1>&2
fi
#
#
# Find the home directory if not specified
if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then 
    ROMIO_HOME_TRIAL=$srcdir
else
    # Take advantage of autoconf2 features
    if test -n "$ac_confdir" ; then
        ROMIO_HOME_TRIAL=$ac_confdir
    else
        if test -s configure ; then
	    ROMIO_HOME_TRIAL=`pwd`
	else
	    ac_confdir=`dirname "$0" 2>/dev/null`
	    if test -n "$ac_confdir" ; then
	        ROMIO_HOME_TRIAL=$ac_confdir
	    fi
	fi
    fi
fi
echo "$ac_t""ROMIO home directory is $ROMIO_HOME_TRIAL" 1>&6
ROMIO_HOME=$ROMIO_HOME_TRIAL
#
# Create the "autoconf" style directory names...
# Most of these are done for us; add the documentation directories
#
# mandir is the root for the man pages
if test -z "$mandir" ; then mandir='${prefix}/man' ; fi

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

if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
 
#
# check for valid file system
if test -n "$FILE_SYSTEM" ; then
   # if multiple filesystems are passed in, they are '+'-delimited
   # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var
   # is used in multiple places in the build system: get rid of the '+'s so we
   # can use the 'for x in $FILE_SYSTEM ...' idiom 
   FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'`
   for x in $FILE_SYSTEM
   do
      found=no
      # We could also do test -d "ad_$y" to test for known file systems
      # based on having access to the adio code.  Then adding a file 
      # system would not require changing configure to change known_filesystems
      for y in $known_filesystems ; do 
          if test $x = $y ; then
	      found=yes
	      eval "file_system_`echo $x`=1"
	      break
	  fi
      done
      if test "$found" = "no" ; then
         echo "configure: warning: Unknown file system $x... proceeding anyway" 1>&2
      fi
   done
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
# check for valid MPI implementation
if test -n "$MPI" ; then
   found=no
   for mpi in $known_mpi_impls ; do
      if test "${MPI}_mpi" = "$mpi" ; then
          found=yes
	  break
      fi
   done
   if test $found = no ; then
      echo "configure: warning: Unknown MPI implementation $MPI... proceeding anyway" 1>&2
   fi
fi
#
# check for valid MPI include directory if specified
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   if test -n "$MPI_INCLUDE_DIR"; then
      if test ! -f "$MPI_INCLUDE_DIR/mpi.h" ; then
         { echo "configure: error: Include file $MPI_INCLUDE_DIR/mpi.h not found" 1>&2; exit 1; }
      fi
   else
#     assume that mpi.h is in the default path
#     set MPI_INCLUDE_DIR to ".", so that it translates to -I. in the
#     compile command. Some compilers complain if it's only -I
      MPI_INCLUDE_DIR=.
   fi
else 
   MPI_INCLUDE_DIR=.
fi
#
# check for valid MPI library if specified
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   if test -n "$MPI_LIB" ; then
      if test ! -f "$MPI_LIB" ; then
         { echo "configure: error: MPI library $MPI_LIB not found" 1>&2; exit 1; }
      fi
   fi
fi
#
#
AR="${AR:-ar} cr$AR_LOCAL"
if test -z "$RANLIB" ; then
    # 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:843: 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

fi
MAKE=${MAKE:-make}
#
# USER_CFLAGS and USER_FFLAGS are used only in test/Makefile.in
if test $DEBUG = "yes"; then
    USER_CFLAGS="$CFLAGS -g"
    USER_FFLAGS="$FFLAGS -g"
else
    USER_CFLAGS="$CFLAGS -O"
    USER_FFLAGS="$FFLAGS -O"
fi
#
# Here begin the architecture-specific tests.  
# --------------------------------------------------------------------------
# We must first select the C and Fortran compilers.  Because of the 
# way that the PROG_CC autoconf macro works (and all of the macros that
# require it, includint CHECK_HEADERS), that macro must occur exactly
# once in the configure.in file, at least as of autoconf 2.57 .  
# Unfortunately, this requirement is not enforced.  To handle this,
# we first case on the architecture; then use PROG_CC, then case on the
# architecture again for any arch-specific features.  We also set the
# C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected.
# 
# For the MPICH and MPICH2 configures, the compilers will already be
# selected, so most of the compiler-selection code will be bypassed.
# --------------------------------------------------------------------------
# For historical reasons
if test -z "$FC" ; then 
    FC=$F77
fi
#
C_DEBUG_FLAG="-g"
F77_DEBUG_FLAG="-g"
C_OPT_FLAG=${CFLAGS:-"-O"}
case $ARCH in 
     sun4)
     CC=${CC:-gcc}
     F77=${FC:-f77}
     ;;

     solaris|solaris86)
     CC=${CC:-cc}
     F77=${FC:-f77}
     if test "$CC" != "gcc" ; then
	C_DEBUG_FLAG="-g -v"
     fi
     ;;
     
     rs6000)
     F77=${FC}
     # Try to use mpcc if no CC specified
     for ac_prog in mpcc
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:926: 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 -n "$CC" || CC="cc"

     if test $NOF77 = 0 && test -z "$F77"; then 
        for ac_prog in mpxlf
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:962: 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 -n "$F77" || F77="f77"

     fi
     ;;

     paragon)
     CC=${CC:-icc}
     F77=${FC:-if77}
     if test "$CC" = "icc"; then
         C_OPT_FLAG="-Knoieee -Mvect -O3"
     fi
     ;;

     tflop|tflops)
     CC=${CC:-pgcc}
     F77=${FC:-pgf77}
     CFLAGS="$CFLAGS -cougar -D__PUMA"
     if test "$CC" = "pgcc" ; then
         C_OPT_FLAG="-Knoieee -Mvect -O3"
     fi
     ;;
     
     freebsd|LINUX|netbsd|openbsd|LINUX_ALPHA)
     CC=${CC:-gcc}
     # Let the prog_f77 file g77/f77/others
     F77=${FC} 
     ;;

     SX4)
     CC=${CC:-mpicc}
     F77=${FC:-mpif90}
     if test $DEBUG != "yes" ; then
        USER_FFLAGS="$FFLAGS -Chopt"
        F77_OPT_FLAG="-Chopt"
    fi
    ;;

    hpux|sppux)
    C_DEBUG_FLAG="-g +w1"
    ;;

    alpha|ALPHA)
    CC=${CC:-cc}
    F77=${FC:-f77}
        C_DEBUG_FLAG="-g -verbose"
    ;;

    CRAY)
    CC=${CC:-cc}
    F77=${FC:-f90}
    NOF77=1
    CFLAGS="$CFLAGS -D_UNICOS"
    ;;

    sgi|IRIX64|IRIX32|IRIXN32)
    arch_IRIX=1
    CC=${CC:-cc}
    F77=${FC:-f77}
    C_DEBUG_FLAG="-g -fullwarn"
    ;;

    sgi5)
    ;;

    *)
    # Fall-through case.  Take FC 
    F77=${FC:-f77}
    ;;
esac

# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1063: 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="gcc"
      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

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1093: 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_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
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

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1144: 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="cl"
      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
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1176: 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 1187 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1192: \"$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:1218: 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 we are using GNU C""... $ac_c" 1>&6
echo "configure:1223: 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:1232: \"$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

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1251: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

if test "$NOF77" != 1 ; then
    # Grrr.   The autoconf test for F77 will abort the configure
    # if no compiler is found.  We'd prefer to simply turn off
    # support for Fortran, and/or give a more informative message.
    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:1292: 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:1325: 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:1338: \"$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:1364: 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:1369: 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:1378: \"$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:1393: 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

fi
if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then
     C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes"
fi
if test $DEBUG = "yes" ; then
    CFLAGS="$CFLAGS $C_DEBUG_FLAG"
else 
    CFLAGS="$CFLAGS $C_OPT_FLAG"
fi
# ---------------------------------------------------------------------------
# Here go the rest of the tests
# ---------------------------------------------------------------------------
if test -n "$arch_sun4" ; then 
    if test "$enable_aio" != "no" ; then
        # Check for aio
	save_libs=$LIBS
	LIBS=
	
echo $ac_n "checking for library containing aiowrite""... $ac_c" 1>&6
echo "configure:1442: checking for library containing aiowrite" >&5
if eval "test \"`echo '$''{'ac_cv_search_aiowrite'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_aiowrite="no"
cat > conftest.$ac_ext <<EOF
#line 1449 "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 aiowrite();

int main() {
aiowrite()
; return 0; }
EOF
if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aiowrite="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_aiowrite" = "no" && for i in aio rt; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 1471 "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 aiowrite();

int main() {
aiowrite()
; return 0; }
EOF
if { (eval echo configure:1482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aiowrite="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_aiowrite" 1>&6
if test "$ac_cv_search_aiowrite" != "no"; then
  test "$ac_cv_search_aiowrite" = "none required" || LIBS="$ac_cv_search_aiowrite $LIBS"
  
else :
  enable_aio=no
fi
	ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
	LIBS=$save_libs
    fi
    if test "$enable_aio" = "no" ; then
        have_aio=no
    else 
        cat >> confdefs.h <<\EOF
#define AIO_SUN 1
EOF

	have_aio=yes
    fi

    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="ufs nfs"
        echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
    fi
fi
#
if test -n "$arch_solaris" || test -n "$arch_solaris86" ; then
    if test "$enable_aio" != "no" ; then
        # Check for aio
	save_libs=$LIBS
	LIBS=
	
echo $ac_n "checking for library containing aiowrite""... $ac_c" 1>&6
echo "configure:1534: checking for library containing aiowrite" >&5
if eval "test \"`echo '$''{'ac_cv_search_aiowrite'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_aiowrite="no"
cat > conftest.$ac_ext <<EOF
#line 1541 "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 aiowrite();

int main() {
aiowrite()
; return 0; }
EOF
if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aiowrite="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_aiowrite" = "no" && for i in aio rt; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 1563 "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 aiowrite();

int main() {
aiowrite()
; return 0; }
EOF
if { (eval echo configure:1574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aiowrite="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_aiowrite" 1>&6
if test "$ac_cv_search_aiowrite" != "no"; then
  test "$ac_cv_search_aiowrite" = "none required" || LIBS="$ac_cv_search_aiowrite $LIBS"
  
else :
  enable_aio=no
fi
	ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
	MPI_LIB="$MPI_LIB $LIBS"
	LIBS=$save_libs
    fi
    if test "$enable_aio" = "no" ; then
        have_aio=no
    else 
        cat >> confdefs.h <<\EOF
#define AIO_SUN 1
EOF

	have_aio=yes
    fi

    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="ufs nfs"
        echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
    fi
    cat >> confdefs.h <<\EOF
#define SOLARIS 1
EOF

    if test $MPI = "mpich" ; then
        TEST_CC=mpicc
        TEST_F77=mpif77
    else
        TEST_CC="$CC"
        TEST_F77="$F77"
    fi
    AR="ar cr"
# solaris does not have l option to ar
# solaris f90 does not have 8-byte integer type
# (it does now!!!! 11/29/01)
fi
#
if test -n "$arch_rs6000"; then
    # Check that aio is available (many systems appear to have aio
    # either installed improperly or turned off).
    # The test is the following: if not cross compiling, try to run a 
    # program that includes a *reference* to aio_write but does not call it
    # If the libraries are not set up correctly, then this will fail.
    echo $ac_n "checking whether aio routines can be used""... $ac_c" 1>&6
echo "configure:1642: checking whether aio routines can be used" >&5
    if test "$cross_compiling" = yes; then
  aio_runs=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 1647 "configure"
#include "confdefs.h"

int main( int argc, char **argv )
{
    if (argc > 10) aio_write();
    return 0;
}

EOF
if { (eval echo configure:1657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  aio_runs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  aio_runs=no
fi
rm -fr conftest*
fi

    echo "$ac_t""$aio_runs" 1>&6						 
    if test "$enable_aio" != "no" -a "$aio_runs" = "no" ; then
        enable_aio=no
    fi
    if test "$enable_aio" = "no" ; then
        have_aio=no
    else
        cat >> confdefs.h <<\EOF
#define NO_FD_IN_AIOCB 1
EOF

        cat >> confdefs.h <<\EOF
#define AIO_HANDLE_IN_AIOCB 1
EOF

	have_aio=yes
    fi
    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        if test "$CC" = "mpcc" || test "$CC" = "mpCC" ; then
            file_system_piofs=1
            FILE_SYSTEM="piofs"
            echo "$ac_t""configuring for file systems piofs, ufs, and nfs" 1>&6
        else 
            echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
        fi
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="$FILE_SYSTEM ufs nfs"
    fi
    cat >> confdefs.h <<\EOF
#define AIX 1
EOF

# assume long long exists.
    longlongsize=${longlongsize:-8} 
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
fi    
#
if test -n "$arch_paragon"; then
    AR="ar860 cr$AR_LOCAL"
    MPI_LIB="$MPI_LIB -nx"
    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_pfs=1
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="pfs ufs nfs"
        echo "$ac_t""configuring for file systems pfs, ufs, and nfs" 1>&6
    fi
    cat >> confdefs.h <<\EOF
#define PARAGON 1
EOF

    have_aio=no
# NO_AIO is if configuring for NFS/UFS. It doesn't affect PFS asynch. I/O.
# long long does not exist
    longlongsize=${longlongsize:-0} 
fi    
#
if test -n "$arch_tflop" || test -n "$arch_tflops"; then
    # TFLOP_FLAGS="-cougar -D__PUMA"
    have_aio=no
    AR="xar cr$AR_LOCAL"
    RANLIB="xranlib"
    MPI_LIB="$MPI_LIB"
    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        FILE_SYSTEM="ufs"
        echo "$ac_t""configuring for file system ufs" 1>&6
    fi
fi
#
if test -n "$arch_freebsd" || test -n "$arch_LINUX" || test -n "$arch_LINUX_ALPHA" || test -n "$arch_netbsd" || test -n "$arch_openbsd" ; then
    if test -n "$arch_freebsd" || test -n "$arch_netbsd" || test -n "$arch_openbsd"; then
       cat >> confdefs.h <<\EOF
#define FREEBSD 1
EOF

       
  echo $ac_n "checking if MOUNT_NFS is defined in the include files""... $ac_c" 1>&6
echo "configure:1761: checking if MOUNT_NFS is defined in the include files" >&5
  rm -f conftest.c
  cat > conftest.c <<EOF
#include <sys/param.h>
#include <sys/mount.h>
     main()
     {
         int i=MOUNT_NFS;
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -o conftest conftest.c > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     ROMIO_HAVE_MOUNT_NFS=1
     cat >> confdefs.h <<\EOF
#define HAVE_MOUNT_NFS 
EOF

  else
     ROMIO_HAVE_MOUNT_NFS=0
     echo "$ac_t""no" 1>&6
  fi
  rm -f conftest conftest.c

       if test "$ROMIO_HAVE_MOUNT_NFS" = "1"; then
	  # Gaaa.  The Intel V7.1 compiler replaces types.h (!!) with
	  # a version that *DOES NOT CONTAIN THE DEFINITIONS NEEDED BY OTHER
	  # INCLUDE FILES*!!!!  (Specifically, __SWORD_TYPE, used 
	  # by statfs.h .  This problem was observed on Redhat 8.0 .
	  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1792: 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 1807 "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:1813: \"$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 1824 "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:1830: \"$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 1841 "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:1847: \"$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

for ac_hdr in sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1875: 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 1880 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1885: \"$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

	  echo $ac_n "checking whether struct statfs properly defined""... $ac_c" 1>&6
echo "configure:1912: checking whether struct statfs properly defined" >&5
	  cat > conftest.$ac_ext <<EOF
#line 1914 "configure"
#include "confdefs.h"

#ifdef HAVE_SYS_STATVFS_H
#include <sys/statvfs.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
int main() {

     struct statfs f;
; return 0; }
EOF
if { (eval echo configure:1934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_have_statfs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_have_statfs=no
fi
rm -f conftest*
          echo "$ac_t""$pac_cv_have_statfs" 1>&6
	  # At this point, we could check for whether defining 
	  # __SWORD_TYPE as sizet_t or int/long (size of pointer)
	  # would help.  FIXME

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

	  fi
	  
       		echo $ac_n "checking for struct statfs.f_fstypename""... $ac_c" 1>&6
echo "configure:1957: checking for struct statfs.f_fstypename" >&5
		cat > conftest.$ac_ext <<EOF
#line 1959 "configure"
#include "confdefs.h"

			#include <sys/param.h>
			#include <sys/mount.h>
			#include <string.h>
int main() {

			struct statfs f;
			memset(&f, 0, sizeof(f));
			strncmp("nfs", f.f_fstypename, 3);
; return 0; }
EOF
if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_have_statfs_f_fstypename=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_have_statfs_f_fstypename=no
fi
rm -f conftest*
		echo "$ac_t""$pac_cv_have_statfs_f_fstypename" 1>&6
		if test $pac_cv_have_statfs_f_fstypename = yes ; then
		    cat >> confdefs.h <<\EOF
#define ROMIO_HAVE_STATFS_F_FSTYPENAME 1
EOF

		else
		    cat >> confdefs.h <<\EOF
#define ROMIO_HAVE_STATFS_F_FSTYPENAME 0
EOF

		fi
       fi
       longlongsize=${longlongsize:-0}
# printf doesn't work properly and no integer*8 as far as I can tell
    else 
       cat >> confdefs.h <<\EOF
#define LINUX 1
EOF

    fi
    # Find the CPP before the header check
    echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2005: 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 2020 "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:2026: \"$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 2037 "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:2043: \"$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 2054 "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:2060: \"$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 "$enable_aio" != "yes" ; then
        have_aio=no
    else
	save_libs=$LIBS
	LIBS=
        # Try to find the aio routines
	use_aio=no
        ac_safe=`echo "aio.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for aio.h""... $ac_c" 1>&6
echo "configure:2093: checking for aio.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 2098 "configure"
#include "confdefs.h"
#include <aio.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2103: \"$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
  has_aio_h=yes
else
  echo "$ac_t""no" 1>&6
has_aio_h=no
fi

	
echo $ac_n "checking for library containing aio_write""... $ac_c" 1>&6
echo "configure:2127: checking for library containing aio_write" >&5
if eval "test \"`echo '$''{'ac_cv_search_aio_write'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_aio_write="no"
cat > conftest.$ac_ext <<EOF
#line 2134 "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 aio_write();

int main() {
aio_write()
; return 0; }
EOF
if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aio_write="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_aio_write" = "no" && for i in aio; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 2156 "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 aio_write();

int main() {
aio_write()
; return 0; }
EOF
if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aio_write="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_aio_write" 1>&6
if test "$ac_cv_search_aio_write" != "no"; then
  test "$ac_cv_search_aio_write" = "none required" || LIBS="$ac_cv_search_aio_write $LIBS"
  
else :
  
fi
	# What function do we want -lrt for?  In recent Linux, aio_write64
	# is here, as is lio_listio
	
echo $ac_n "checking for library containing aio_write64""... $ac_c" 1>&6
echo "configure:2191: checking for library containing aio_write64" >&5
if eval "test \"`echo '$''{'ac_cv_search_aio_write64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_aio_write64="no"
cat > conftest.$ac_ext <<EOF
#line 2198 "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 aio_write64();

int main() {
aio_write64()
; return 0; }
EOF
if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aio_write64="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_aio_write64" = "no" && for i in rt; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 2220 "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 aio_write64();

int main() {
aio_write64()
; return 0; }
EOF
if { (eval echo configure:2231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_aio_write64="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_aio_write64" 1>&6
if test "$ac_cv_search_aio_write64" != "no"; then
  test "$ac_cv_search_aio_write64" = "none required" || LIBS="$ac_cv_search_aio_write64 $LIBS"
  
else :
  
fi
	
echo $ac_n "checking for library containing pthread_create""... $ac_c" 1>&6
echo "configure:2253: checking for library containing pthread_create" >&5
if eval "test \"`echo '$''{'ac_cv_search_pthread_create'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_pthread_create="no"
cat > conftest.$ac_ext <<EOF
#line 2260 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_pthread_create="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_pthread_create" = "no" && for i in pthread; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 2282 "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 pthread_create();

int main() {
pthread_create()
; return 0; }
EOF
if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_pthread_create="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_pthread_create" 1>&6
if test "$ac_cv_search_pthread_create" != "no"; then
  test "$ac_cv_search_pthread_create" = "none required" || LIBS="$ac_cv_search_pthread_create $LIBS"
  has_pthread=yes
else :
  has_pthread=no
fi
        echo $ac_n "checking for aio_write""... $ac_c" 1>&6
echo "configure:2314: checking for aio_write" >&5
if eval "test \"`echo '$''{'ac_cv_func_aio_write'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2319 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char aio_write(); 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 aio_write();

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_aio_write) || defined (__stub___aio_write)
choke me
#else
aio_write();
#endif

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

if eval "test \"`echo '$ac_cv_func_'aio_write`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  has_aio_write=yes
else
  echo "$ac_t""no" 1>&6
has_aio_write=no
fi

	if test "$has_aio_h" = "yes" -a "$has_aio_write" = "yes" -a \
	        "$has_pthread" = "yes" ; then
	    use_aio=yes	
	fi    
	# Check for aiocb_t as a shorthand for struct aiocb
	echo $ac_n "checking for aiocb_t""... $ac_c" 1>&6
echo "configure:2368: checking for aiocb_t" >&5
	cat > conftest.$ac_ext <<EOF
#line 2370 "configure"
#include "confdefs.h"
#include <aio.h>
int main() {
aiocb_t a;
; return 0; }
EOF
if { (eval echo configure:2377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  has_aiocb_t=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  has_aiocb_t=no
fi
rm -f conftest*
	echo "$ac_t""$has_aiocb_t" 1>&6
	if test "$has_aiocb_t" = "no" ; then 
	    cat >> confdefs.h <<\EOF
#define NEEDS_AIOCB_T 1
EOF

        fi
	if test "$use_aio" = "yes" ; then
	    ROMIO_LIBLIST="$ROMIO_LIBLIST $LIBS"
	    have_aio=yes
	else
	    have_aio=no
	fi
	LIBS=$save_libs
    fi
    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="ufs nfs"
        echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
    fi
fi    
#
if test -n "$arch_SX4" ; then
    have_aio=no
    cat >> confdefs.h <<\EOF
#define SX4 1
EOF

    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_sfs=1
        file_system_nfs=1
        FILE_SYSTEM="sfs nfs"
        echo "$ac_t""configuring for file systems sfs and nfs" 1>&6
    fi
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
fi
#
if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
    have_aio=no
    RANLIB=":"
    if test -z "$MPI"; then
        if test -f "/opt/mpi/include/mpi.h" ; then
            echo "assuming that you want to use ROMIO with HP MPI"
            MPI=hp
        else 
            echo "assuming that you want to use ROMIO with MPICH"
            MPI=mpich
        fi            
    fi
    if test $MPI = "mpich" ; then
        mpi_mpich=1
        MPI_LIB="$MPI_LIB -lV3"
        CC=${CC:-cc -Ae}
        F77=${FC:-f77 +U77}
    fi
    if test $MPI = "hp" ; then
        mpi_hp=1
        CC=${CC:-mpicc -Ae}
        F77=${FC:-mpif77 +U77}
    fi
    if test $MPI = "lam" && test "$FC" != ""; then
        F77="$F77 +U77"
    fi
    FTESTDEFINE="external iargc, getarg"
    if test -n "$arch_hpux" ; then
        CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
        cat >> confdefs.h <<\EOF
#define HPUX 1
EOF

        if test $MPI = "hp" ; then
           F77=${FC:-mpif90 +U77}
        else
           F77=${FC:-f90 +U77}
        fi
    else
        cat >> confdefs.h <<\EOF
#define SPPUX 1
EOF

    fi
    if test -z "$FILE_SYSTEM" ; then
        if test -n "$arch_hpux" ; then
	   echo $ac_n "checking for struct flock64""... $ac_c" 1>&6
echo "configure:2481: checking for struct flock64" >&5
           cat > conftest.$ac_ext <<EOF
#line 2483 "configure"
#include "confdefs.h"
#include <fcntl.h>
int main() {

struct flock64 fl; int i=F_SETLKW64;
; return 0; }
EOF
if { (eval echo configure:2491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  flock64_ok="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  flock64_ok="no"
fi
rm -f conftest*
           echo "$ac_t""$flock64_ok" 1>&6
        else
            flock64_ok="yes"
        fi
        if test $flock64_ok = "yes" ; then
            file_system_hfs=1
            file_system_nfs=1
            FILE_SYSTEM="hfs nfs"
            echo "$ac_t""configuring for file systems hfs and nfs" 1>&6
        else
            file_system_ufs=1
            file_system_nfs=1
            FILE_SYSTEM="ufs nfs"
            echo "$ac_t""no flock64; configuring for file systems ufs and nfs" 1>&6
        fi
    fi
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
    if test "$CC" != "gcc" ; then
        ROMIO_TCFLAGS="-Ae"
    fi
    if test "$F77" != "g77" ; then
        ROMIO_TFFLAGS="+U77"
    fi
fi
#
if test -n "$arch_alpha" || test -n "$arch_ALPHA" ; then
    cat >> confdefs.h <<\EOF
#define AIO_PRIORITY_DEFAULT 1
EOF

    if test -z "$MPI" ; then
        MPI=mpich
        mpi_mpich=1
    fi
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="ufs nfs"
        echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
    fi
    cat >> confdefs.h <<\EOF
#define DEC 1
EOF

    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
    ROMIO_LIBLIST="$ROMIO_LIBLIST -laio"
fi    
#
if test -n "$arch_CRAY" ; then
    NOF77=1
    FTESTDEFINE="integer ilen"
    F77GETARG="call pxfgetarg(i, str, ilen, ierr)"
    have_aio=no
    RANLIB=":"
    cat >> confdefs.h <<\EOF
#define CRAY 1
EOF

    if test -z "$MPI" || test -n "$mpi_sgi" ; then
        MPI=cray
        mpi_cray=1
        mpi_sgi=""
# above is to disable configure tests specific to SGI MPI
        cat >> confdefs.h <<\EOF
#define MPISGI 1
EOF

        cat >> confdefs.h <<\EOF
#define HAVE_MPI_COMBINERS 1
EOF

        cat >> confdefs.h <<\EOF
#define NO_MPI_SGI_type_is_contig 1
EOF

    fi
#       MPISGI needed because of error in Cray's and SGI's 
#       MPI_Type_get_contents (does not increment reference count).
#       Others needed because MPISGI needed.
    if test -z "$FILE_SYSTEM" ; then
        file_system_ufs=1
        file_system_nfs=1
        FILE_SYSTEM="ufs nfs"
        echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
    fi
    MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
    MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
fi
#
if test -n "$arch_sgi" ; then
    arch_IRIX=1
    ARCH=IRIX
fi
if test -n "$arch_IRIX64" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIX32" ; then
    arch_IRIX=1
fi
if test -n "$arch_IRIXN32" ; then
    arch_IRIX=1
fi
if test -n "$arch_sgi5" ; then
    arch_IRIX5=1
    ARCH=IRIX
fi
#

#
if test -n "$arch_IRIX"; then
   echo $ac_n "checking for IRIX OS version""... $ac_c" 1>&6
echo "configure:2614: checking for IRIX OS version" >&5
               osversion=`uname -r | sed 's/\..*//'`
               osvminor=`uname -r | sed 's/[0-9]\.\([0-9]*\)\..*/\1/'`
      echo "$ac_t""$osversion" 1>&6
      echo $ac_n "checking for IRIX cpucount""... $ac_c" 1>&6
echo "configure:2619: checking for IRIX cpucount" >&5
      cpucount=`hinv | grep '[0-9]* [0-9]* MHZ IP[0-9]* Proc' | cut -f 1 -d' '`
   if test "$cpucount" = "" ; then
     cpucount=`hinv | grep 'Processor [0-9]*:' | wc -l | sed -e 's/ //g'`
   fi
      if test "$cpucount" = "" ; then
     echo "$ac_t""Could not determine cpucount.  Please send" 1>&6
     hinv
     { echo "configure: error: to romio-maint@mcs.anl.gov" 1>&2; exit 1; }
   fi
   echo "$ac_t""$cpucount" 1>&6
      echo $ac_n "checking for IRIX cpumodel""... $ac_c" 1>&6
echo "configure:2631: checking for IRIX cpumodel" >&5
            cputype=`hinv -t cpu | tail -1 | cut -f 3 -d' '`
   if test -z "$cputype" ; then
        echo "$ac_t""Could not get cputype from hinv -t cpu command. Please send" 1>&6
        hinv -t cpu 2>&1
        hinv -t cpu | cut -f 3 -d' ' 2>&1
	{ echo "configure: error: to romio-maint@mcs.anl.gov" 1>&2; exit 1; }
   fi
   echo "$ac_t""$cputype" 1>&6
            if test -z "$osversion" ; then
        echo "$ac_t""Could not determine OS version.  Please send" 1>&6
        uname -a
        { echo "configure: error: to romio-maint@mcs.anl.gov" 1>&2; exit 1; }
   elif test $osversion = 4 ; then
        true
   elif test $osversion = 5 ; then
        true
   elif test $osversion = 6 ; then
        true
   else 
       echo "$ac_t""Could not recognize the version of IRIX (got $osversion).
ROMIO knows about versions 4, 5 and 6; the version being returned from 
uname -r is $osversion.  Please send" 1>&6
       uname -a 2>&1
       hinv 2>&1
       { echo "configure: error: to romio-maint@mcs.anl.gov" 1>&2; exit 1; }
   fi
   echo $ac_n "checking for cputype""... $ac_c" 1>&6
echo "configure:2659: checking for cputype" >&5
   OLD_ARCH=IRIX
   IRIXARCH="$ARCH_$osversion"
         cputype=`echo $cputype | sed -e 's%.*/%%' -e 's/R//' | tr -d "[A-Z]"`
      case $cputype in 
        3000) ;;
        4000) ;;
        4400) ;;
        4600) ;;
        5000) ;;
        8000) ;;
        10000);;
	12000);;
        *)
	echo "configure: warning: Unexpected IRIX/MIPS chipset $cputype.  Please send the output" 1>&2
        uname -a 2>&1
        hinv 2>&1 
        echo "configure: warning: to romio-maint@mcs.anl.gov
ROMIO will continue and assume that the cputype is
compatible with a MIPS 4400 processor." 1>&2
        cputype=4400
        ;;
   esac
   echo "$ac_t""$cputype" 1>&6
   IRIXARCH="$IRIXARCH_$cputype"
   echo "IRIX-specific architecture is $IRIXARCH"
fi

#
# special case 'sgi5' for use on MESHINE which is much like an SGI running
# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
# work
if test -n "$arch_sgi5"; then
   osversion=5
   cputype=4400
   IRIXARCH="$ARCH_$osversion"
   IRIXARCH="$IRIXARCH_$cputype"
# now set arch_IRIX to 1
   arch_IRIX=1
   echo "IRIX-specific architecture is $IRIXARCH"
   cat >> confdefs.h <<\EOF
#define IRIX 1
EOF

fi
#
if test -n "$arch_IRIX"; then
   if test $osversion = 4 ; then
	RANLIB="ar ts"
        if test -n "$mpi_sgi"; then
            { echo "configure: error: SGI\'s MPI does not work with IRIX 4.x" 1>&2; exit 1; }
        fi
   elif test $osversion = 5 ; then
        if test -n "$mpi_sgi"; then
            { echo "configure: error: SGI\'s MPI does not work with IRIX 5.x" 1>&2; exit 1; }
        fi
   elif test $osversion = 6 ; then
	if test -z "$MPI"; then
	    if test "$FROM_MPICH2" = "yes" ; then
	        # Building with MPICH2.  Distinguish from MPICH-1
		MPI=mpich2
		mpi_mpich2=1
            elif test -f "/usr/include/mpi.h" ; then
                echo "configure: warning: assuming that you want to use ROMIO with SGI\'s MPI" 1>&2
                MPI=sgi
                mpi_sgi=1
            else 
	        echo "configure: warning: assuming that you want to use ROMIO with MPICH" 1>&2
                MPI=mpich
                mpi_mpich=1
            fi            
	fi
        RANLIB=":"
        cat >> confdefs.h <<\EOF
#define AIO_SIGNOTIFY_NONE 1
EOF

	if test $cputype -ge 5000 ; then
            MIPS=4
        else 
            MIPS=3
        fi
   fi
   if test -n "$mpi_sgi" && test -z "$MPI_LIB" ; then
       MPI_LIB="-lmpi"
   fi
#  check if pread64 is defined
   
  echo $ac_n "checking if pread64 is defined""... $ac_c" 1>&6
echo "configure:2748: checking if pread64 is defined" >&5
  rm -f conftest.c
  cat > conftest.c <<EOF
#include <unistd.h>
     main()
     {
         int fd=0, buf=0, i=0;
         off64_t off=0;
         pread64(fd, &buf, i, off);
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -o conftest conftest.c > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define HAVE_PREAD64 
EOF

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

#
   if test -z "$FILE_SYSTEM" ; then
       file_system_nfs=1
       FILE_SYSTEM="nfs"
       echo $ac_n "checking for xfs""... $ac_c" 1>&6
echo "configure:2777: checking for xfs" >&5
       cat > conftest.$ac_ext <<EOF
#line 2779 "configure"
#include "confdefs.h"

#include <aio.h>
int main() {
aiocb64_t *t1;
; return 0; }
EOF
if { (eval echo configure:2787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  file_system_xfs=1;FILE_SYSTEM="xfs $FILE_SYSTEM";
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
       if test "$file_system_xfs" = 1 ; then 
          echo "$ac_t""yes" 1>&6
       else
          echo "$ac_t""no" 1>&6
          file_system_ufs=1
          FILE_SYSTEM="ufs $FILE_SYSTEM"
       fi
       echo "$ac_t""configuring for file systems $FILE_SYSTEM" 1>&6
   fi
   cat >> confdefs.h <<\EOF
#define IRIX 1
EOF

   MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
   MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=8)"
fi

# 
# If no system selected, turn of AIO
if test "$have_aio" != yes ; then
    cat >> confdefs.h <<\EOF
#define NO_AIO 1
EOF

fi


for ac_func in memalign
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2825: 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 2830 "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:2853: \"$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


#
# Question: Should ROMIO under MPICH2 ignore the Fortran tests, since 
# MPICH2 provides all of the Fortran interface routines?
#
if test $NOF77 = 0 ; then
    echo "checking Fortran external names"
    
   rm -f confftest.f confftest.o
   cat > confftest.f <<EOF
       subroutine mpir_init_fop( a )
       integer a
       a = 1
       return
       end
EOF
   $F77 $FFLAGS -c confftest.f > /dev/null 2>&1
   if test ! -s confftest.o ; then
	echo "configure: warning: Unable to test Fortran compiler.  Compiling a test 
program failed to produce an object file" 1>&2
	NOF77=1
   elif test -z "$FORTRANNAMES" ; then
    if test $arch_CRAY ; then
     # Cray doesn't accept -a ...
     nameform1=`strings confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings confftest.o | grep mpir_init_fop__ | head -1`
    else
     nameform1=`strings -a confftest.o | grep mpir_init_fop_  | head -1`
     nameform2=`strings -a confftest.o | grep MPIR_INIT_FOP   | head -1`
     nameform3=`strings -a confftest.o | grep mpir_init_fop   | head -1`
     nameform4=`strings -a confftest.o | grep mpir_init_fop__ | head -1`
    fi
    rm -f confftest.f confftest.o
    if test -n "$nameform4" ; then
	echo "Fortran externals are lower case and have two trailing underscores"
	FORTRANNAMES="FORTRANDOUBLEUNDERSCORE"
    elif test -n "$nameform1" ; then
        # We don't set this in CFLAGS; it is a default case
        echo "Fortran externals have a trailing underscore and are lowercase"
	FORTRANNAMES="FORTRANUNDERSCORE"
    elif test -n "$nameform2" ; then
	echo "Fortran externals are uppercase"     
	FORTRANNAMES="FORTRANCAPS" 
    elif test -n "$nameform3" ; then
	echo "Fortran externals are lower case"
	FORTRANNAMES="FORTRANNOUNDERSCORE"
    else
	echo "configure: warning: Unable to determine the form of Fortran external names.
Make sure that the compiler $F77 can be run on this system.
Turning off Fortran (-nof77 being assumed" 1>&2
	NOF77=1
    fi
    fi
    if test -n "$FORTRANNAMES" ; then
        WDEF="-D$FORTRANNAMES"
    fi
    rm -f confftest.f confftest.o
    
    if test -n "$WDEF" ; then
        CFLAGS="$CFLAGS $WDEF"
    fi
            rm -f test/mpif.h
    if test "$MPI_INCLUDE_DIR" != "." && test $WITHIN_KNOWN_MPI_IMPL = no ; then
        if test ! -d test ; then mkdir test ; fi
        ln -s $MPI_INCLUDE_DIR/mpif.h test
    fi
else 
    F77=":"
fi
#
echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:2950: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
  cat > conftest.$ac_ext <<EOF
#line 2957 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:2964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_c_inline=$ac_kw; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done

fi

echo "$ac_t""$ac_cv_c_inline" 1>&6
case "$ac_cv_c_inline" in
  inline | yes) ;;
  no) cat >> confdefs.h <<\EOF
#define inline 
EOF
 ;;
  *)  cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF
 ;;
esac


# Header files
# Find the CPP before the header check
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2993: 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 3008 "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:3014: \"$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 3025 "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:3031: \"$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 3042 "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:3048: \"$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

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:3076: 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 3081 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3086: \"$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

#
CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-0}
CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-0}
echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:3116: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=$CROSS_SIZEOF_INT
else
  cat > conftest.$ac_ext <<EOF
#line 3124 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) return(1);
  fprintf(f, "%d\n", sizeof(int));
  return(0);
}
EOF
if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF


echo $ac_n "checking size of void*""... $ac_c" 1>&6
echo "configure:3155: checking size of void*" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_voidp=$CROSS_SIZEOF_VOID_P
else
  cat > conftest.$ac_ext <<EOF
#line 3163 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) return(1);
  fprintf(f, "%d\n", sizeof(void*));
  return(0);
}
EOF
if { (eval echo configure:3174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_voidp=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_voidp=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_voidp" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
EOF


echo $ac_n "checking for int large enough for pointers""... $ac_c" 1>&6
echo "configure:3194: checking for int large enough for pointers" >&5
if eval "test \"`echo '$''{'pac_cv_int_hold_pointer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$ac_cv_sizeof_int" = "0" -o \
	"$ac_cv_sizeof_voidp" = "0" ; then
    pac_cv_int_hold_pointer=unknown
elif test "$ac_cv_sizeof_int" -lt "$ac_cv_sizeof_voidp" ; then
    pac_cv_int_hold_pointer=no
else
    pac_cv_int_hold_pointer=yes
fi

fi

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

fi
#
CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-0}
echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:3220: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long_long=$CROSS_SIZEOF_LONG_LONG
else
  cat > conftest.$ac_ext <<EOF
#line 3228 "configure"
#include "confdefs.h"
#include <stdio.h>
int main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) return(1);
  fprintf(f, "%d\n", sizeof(long long));
  return(0);
}
EOF
if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
EOF


if test "$ac_cv_sizeof_long_long" != 0 ; then
    if test "$ac_cv_sizeof_long_long" = "8" ; then
       cat >> confdefs.h <<\EOF
#define HAVE_LONG_LONG_64 1
EOF

       MPI_OFFSET_TYPE="long long"
       DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
       FORTRAN_MPI_OFFSET="integer*8"
       LL="\%lld"
    elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_int" ; then
       MPI_OFFSET_TYPE="int"
       DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
       FORTRAN_MPI_OFFSET="integer"
       cat >> confdefs.h <<\EOF
#define MPI_OFFSET_IS_INT 1
EOF

       LL="\%d"
       MPI_OFFSET_KIND1="!"
       MPI_OFFSET_KIND2="!"
    else
       echo "defining MPI_Offset as long in C and integer in Fortran" 
       MPI_OFFSET_TYPE="long"
       DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
       FORTRAN_MPI_OFFSET="integer"
       LL="\%ld"
       MPI_OFFSET_KIND1="!"
       MPI_OFFSET_KIND2="!"
    fi
else
    echo "defining MPI_Offset as long in C and integer in Fortran" 
    MPI_OFFSET_TYPE="long"
    DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
    FORTRAN_MPI_OFFSET="integer"
    LL="\%ld"
    MPI_OFFSET_KIND1="!"
    MPI_OFFSET_KIND2="!"
fi


#
if test -n "$longlongsize"; then
   if test $WITHIN_KNOWN_MPI_IMPL = no ; then
       
  echo $ac_n "checking if MPI_LONG_LONG_INT is defined in mpi.h""... $ac_c" 1>&6
echo "configure:3304: checking if MPI_LONG_LONG_INT is defined in mpi.h" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         long long i;   
         MPI_Init(&argc,&argv);
         MPI_Send(&i, 1, MPI_LONG_LONG_INT, 0, 0, MPI_COMM_WORLD);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define HAVE_MPI_LONG_LONG_INT 
EOF

  else
      echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.c

   else
       cat >> confdefs.h <<\EOF
#define HAVE_MPI_LONG_LONG_INT 1
EOF

   fi
fi
#
if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then 
  MPI_OFFSET_KIND1="        INTEGER MPI_OFFSET_KIND"
  MPI_OFFSET_KIND2="        PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)"
else
 if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 ; then
   echo $ac_n "checking for Fortran 90 KIND parameter for 8-byte integers""... $ac_c" 1>&6
echo "configure:3343: checking for Fortran 90 KIND parameter for 8-byte integers" >&5
rm -f kind.f kind.o kind
cat <<EOF > kind.f
      program main
      integer i
      i = selected_int_kind(16)
      open(8, file="k.out", form="formatted")
      write (8,*) i
      close(8)
      stop
      end
EOF
if test -z "$F90" ; then
   F90=f90
fi
KINDVAL=""
if $F90 -o kind kind.f >/dev/null 2>&1 ; then
    ./kind >/dev/null 2>&1
    if test -s k.out ; then 
        KINDVAL=`cat k.out`
    fi
fi
rm -f kind k.out kind.f kind.o k.out
if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
   echo "$ac_t""$KINDVAL" 1>&6
   MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
   MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
else
    echo "$ac_t""unavailable" 1>&6
fi

 fi
 #
  if test "$FORTRAN_MPI_OFFSET" = "integer" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 ; then
   echo $ac_n "checking for Fortran 90 KIND parameter for 4-byte integers""... $ac_c" 1>&6
echo "configure:3378: checking for Fortran 90 KIND parameter for 4-byte integers" >&5
rm -f kind.f kind.o kind
cat <<EOF > kind.f
      program main
      integer i
      i = selected_int_kind(8)
      open(8, file="k.out", form="formatted")
      write (8,*) i
      close(8)
      stop
      end
EOF
if test -z "$F90" ; then
   F90=f90
fi
KINDVAL=""
if $F90 -o kind kind.f >/dev/null 2>&1 ; then
    ./kind >/dev/null 2>&1
    if test -s k.out ; then 
        KINDVAL=`cat k.out`
    fi
fi
rm -f kind k.out kind.f kind.o
if test -n "$KINDVAL" -a "$KINDVAL" != "-1" ; then
   echo "$ac_t""$KINDVAL" 1>&6
   MPI_OFFSET_KIND1="      INTEGER MPI_OFFSET_KIND"
   MPI_OFFSET_KIND2="      PARAMETER (MPI_OFFSET_KIND=$KINDVAL)"
else
    echo "$ac_t""unavailable" 1>&6
fi

  fi
fi
#
# check if MPI_Info functions are defined in the MPI implementation
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   
  echo $ac_n "checking if MPI_Info functions are defined in the MPI implementation""... $ac_c" 1>&6
echo "configure:3416: checking if MPI_Info functions are defined in the MPI implementation" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         MPI_Info info;
         MPI_Init(&argc,&argv);
         MPI_Info_create(&info);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define HAVE_MPI_INFO 1
EOF

      HAVE_MPI_INFO="#define HAVE_MPI_INFO"
      MPI_FINFO1="!"
      MPI_FINFO2="!"
      MPI_FINFO3="!"
      MPI_FINFO4="!"
  else
      echo "$ac_t""no" 1>&6
      BUILD_MPI_INFO=1
      MPI_FINFO1="      INTEGER MPI_MAX_INFO_KEY, MPI_MAX_INFO_VAL"
      MPI_FINFO2="      PARAMETER (MPI_MAX_INFO_KEY=255, MPI_MAX_INFO_VAL=1024)"
      MPI_FINFO3="      INTEGER MPI_INFO_NULL"
      MPI_FINFO4="      PARAMETER (MPI_INFO_NULL=0)"
  fi
  rm -f conftest mpitest.c

else
   cat >> confdefs.h <<\EOF
#define HAVE_MPI_INFO 1
EOF

   HAVE_MPI_INFO="#define HAVE_MPI_INFO"
   MPI_FINFO1="!"
   MPI_FINFO2="!"
   MPI_FINFO3="!"
   MPI_FINFO4="!"
fi   
#
if test -n "$mpi_sgi"; then
   if test -z "$HAVE_MPI_INFO" ; then
      
  echo $ac_n "checking if MPI_INFO_NULL is defined in mpi.h""... $ac_c" 1>&6
echo "configure:3467: checking if MPI_INFO_NULL is defined in mpi.h" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
	int i;
	i = MPI_INFO_NULL;
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      cp adio/sgi/mpi3.1/*.h include
  else
      echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.c
  # is MPI_INFO_NULL defined in mpi.h?
   fi
   
  echo $ac_n "checking if MPI_SGI_type_is_contig is defined""... $ac_c" 1>&6
echo "configure:3490: checking if MPI_SGI_type_is_contig is defined" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         MPI_Datatype type;
         int i;

         MPI_Init(&argc,&argv);
         i = MPI_SGI_type_is_contig(type);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
  else
     echo "$ac_t""no" 1>&6
     cat >> confdefs.h <<\EOF
#define NO_MPI_SGI_type_is_contig 
EOF

  fi
  rm -f conftest mpitest.c

   
  echo $ac_n "checking if MPI-2 combiners are defined in mpi.h""... $ac_c" 1>&6
echo "configure:3519: checking if MPI-2 combiners are defined in mpi.h" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         int i;

         MPI_Init(&argc,&argv);
         i = MPI_COMBINER_STRUCT;
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
#define HAVE_MPI_COMBINERS 
EOF

  else
     echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.c

   
  echo $ac_n "checking if MPI_OFFSET_KIND is defined in mpif.h""... $ac_c" 1>&6
echo "configure:3547: checking if MPI_OFFSET_KIND is defined in mpif.h" >&5
  rm -f mpitest.f
  cat > mpitest.f <<EOF
      program main
      implicit none
      include 'mpif.h'
      integer i
      i = MPI_OFFSET_KIND
      stop
      end
EOF
  rm -f conftest
  $F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.f $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     MPI_OFFSET_KIND1="!"
     MPI_OFFSET_KIND2="!"
  else
     echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.f

fi
#
# check if darray and subarray constructors are defined in the MPI 
# implementation 
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   
  echo $ac_n "checking if darray and subarray constructors are defined in the MPI implementation""... $ac_c" 1>&6
echo "configure:3576: checking if darray and subarray constructors are defined in the MPI implementation" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         int i=MPI_DISTRIBUTE_CYCLIC;
         MPI_Datatype t;
         MPI_Init(&argc,&argv);
         MPI_Type_create_darray(i, i, i, &i, &i, &i, &i, i, MPI_INT, &t);
         MPI_Type_create_subarray(i, &i, &i, &i, i, MPI_INT, &t);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      cat >> confdefs.h <<\EOF
#define HAVE_MPI_DARRAY_SUBARRAY 
EOF

      HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
      MPI_FARRAY1="!"
      MPI_FARRAY2="!"
      MPI_FARRAY3="!"
      MPI_FARRAY4="!"
      MPI_FARRAY5="!"
      MPI_FARRAY6="!"
      MPI_FARRAY7="!"
  else
      echo "$ac_t""no" 1>&6
      BUILD_MPI_ARRAY=1
      MPI_FARRAY1="      INTEGER MPI_ORDER_C, MPI_ORDER_FORTRAN"
      MPI_FARRAY2="      PARAMETER (MPI_ORDER_C=56, MPI_ORDER_FORTRAN=57)"
      MPI_FARRAY3="      INTEGER MPI_DISTRIBUTE_BLOCK, MPI_DISTRIBUTE_CYCLIC"
      MPI_FARRAY4="      INTEGER MPI_DISTRIBUTE_NONE, MPI_DISTRIBUTE_DFLT_DARG"
      MPI_FARRAY5="      PARAMETER (MPI_DISTRIBUTE_BLOCK=121, MPI_DISTRIBUTE_CYCLIC=122)"
      MPI_FARRAY6="      PARAMETER (MPI_DISTRIBUTE_NONE=123)"
      MPI_FARRAY7="      PARAMETER (MPI_DISTRIBUTE_DFLT_DARG=-49767)"
  fi
  rm -f conftest mpitest.c

fi
if test $FROM_MPICH2 = yes ; then
         echo "$ac_t"""Overriding Array test for MPICH2"" 1>&6
   unset BUILD_MPI_ARRAY
   cat >> confdefs.h <<\EOF
#define HAVE_MPI_DARRAY_SUBARRAY 1
EOF

   HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
   MPI_FARRAY1="!"
   MPI_FARRAY2="!"
   MPI_FARRAY3="!"
   MPI_FARRAY4="!"
   MPI_FARRAY5="!"
   MPI_FARRAY6="!"
   MPI_FARRAY7="!"
fi   
#
#
# Test for weak symbol support...
# We can't put # in the message because it causes autoconf to generate
# incorrect code
HAVE_WEAK_SYMBOLS=0
if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
# multiple secondary definitions not allowed by HP compilers
# Fortran interface for HP already uses one secondary defn. 
# therefore, do not use this method for profiling interface.
# build profiling interface explicitly.
   TRY_WEAK_SYMBOLS=0
fi
if test $TRY_WEAK_SYMBOLS = 1 ; then
  echo $ac_n "checking for weak symbol support""... $ac_c" 1>&6
echo "configure:3651: checking for weak symbol support" >&5
  cat > conftest.$ac_ext <<EOF
#line 3653 "configure"
#include "confdefs.h"

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

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  has_pragma_weak=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  #
  # Some systems (Linux ia64 and ecc, for example), support weak symbols
  # only within a single object file!  This tests that case.
  # Note that there is an extern int PFoo declaration before the
  # pragma.  Some compilers require this in order to make the weak symbol
  # extenally visible.  
if test "$has_pragma_weak" = 1 ; then
    echo "$ac_t""pragma weak" 1>&6
    echo $ac_n "checking that weak symbols are visible to other files""... $ac_c" 1>&6
echo "configure:3681: checking that weak symbols are visible to other files" >&5
    rm -f conftest*
    cat >>conftest1.c <<EOF
extern int PFoo(int);
#pragma weak PFoo = Foo
int Foo(int);
int Foo(int a) { return a; }
EOF
    cat >>conftest2.c <<EOF
extern int PFoo(int);
int main(int argc, char **argv) {
return PFoo(0);}
EOF
    ac_link2='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
    if eval $ac_link2 ; then
        echo "$ac_t""yes" 1>&6
    else
      echo "$ac_link2" 1>&5
      echo "Failed program was" 1>&5
      cat conftest1.c 1>&5
      cat conftest2.c 1>&5
      if test -s conftest.out ; then cat conftest.out 1>&5 ; fi
      echo "$ac_t""no" 1>&6
      has_pragma_weak=0
    fi
    rm -f conftest*
  fi
  if test "$has_pragma_weak" = 1 ; then
    HAVE_WEAK_SYMBOLS=1
    cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_WEAK 1
EOF

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

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

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:3727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  has_pragma_hp_secondary=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    if test "$has_pragma_hp_secondary" = 1 ; then 
        echo "$ac_t""pragma _HP_SECONDARY_DEF" 1>&6
        HAVE_WEAK_SYMBOLS=1
        cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_HP_SEC_DEF 1
EOF

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

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

int main() {
return PFoo(1);
; return 0; }
EOF
if { (eval echo configure:3755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  has_pragma_cri_duplicate=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
        if test "$has_pragma_cri_duplicate" = 1 ; then
	    echo "$ac_t""pragma _CRI duplicate x as y" 1>&6
	    HAVE_WEAK_SYMBOLS=1
	    cat >> confdefs.h <<\EOF
#define HAVE_PRAGMA_CRI_DUP 1
EOF

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

fi

#
# if FILE_SYSTEM is not set above, use ufs and nfs as default
#
if test -z "$FILE_SYSTEM" ; then
    file_system_ufs=1
    file_system_nfs=1
    FILE_SYSTEM="ufs nfs"
    echo "$ac_t""configuring for file systems ufs and nfs" 1>&6
fi
#
# Check whether the MPI Offset type is compatible with struct flock
echo $ac_n "checking whether struct flock compatible with MPI_Offset""... $ac_c" 1>&6
echo "configure:3795: checking whether struct flock compatible with MPI_Offset" >&5
cat > conftest.$ac_ext <<EOF
#line 3797 "configure"
#include "confdefs.h"
#include <fcntl.h>
int main() {
struct flock l;
 $MPI_OFFSET_TYPE a=1;
 l.l_start = a; 
 l.l_len   = a;

; return 0; }
EOF
if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_struct_flock_and_mpi_offset=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_struct_flock_and_mpi_offset=no
fi
rm -f conftest*
echo "$ac_t""$pac_cv_struct_flock_and_mpi_offset" 1>&6
# FIXME: We should look for struct flock64 and the F_SETLK64/F_GETLK64
# ADIOI_Set_lock could use these instead.
if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then
    echo $ac_n "checking whether struct flock compatible with int""... $ac_c" 1>&6
echo "configure:3823: checking whether struct flock compatible with int" >&5
    cat > conftest.$ac_ext <<EOF
#line 3825 "configure"
#include "confdefs.h"
#include <fcntl.h>
int main() {
struct flock l;
 int a=1;
 l.l_start = a; 
 l.l_len   = a;

; return 0; }
EOF
if { (eval echo configure:3836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  pac_cv_struct_flock_and_int=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  pac_cv_struct_flock_and_int=no
fi
rm -f conftest*
    echo "$ac_t""$pac_cv_struct_flock_and_int" 1>&6
    if test "$pac_cv_struct_flock_and_int" = yes ; then
        cat >> confdefs.h <<\EOF
#define NEEDS_INT_CAST_WITH_FLOCK 1
EOF

    fi
    # FIXME.  Solaris header files define off_t as a UNION if 64bit file
    # sizes are selected.  Gah!
fi

if test -n "$file_system_nfs" ; then
   # Check for problems with locks
   # We no longer do this within the configure test.  Instead,
   # we suggest tha the user run maint/nfslock.c
   echo "configure: warning: File locks may not work with NFS.  See the Installation and
users manual for instructions on testing and if necessary fixing this" 1>&2
fi
if test -n "$file_system_nfs"; then
    cat >> confdefs.h <<\EOF
#define NFS 1
EOF

fi
if test -n "$file_system_ufs"; then
    cat >> confdefs.h <<\EOF
#define UFS 1
EOF

fi
if test -n "$file_system_hfs"; then
    cat >> confdefs.h <<\EOF
#define HFS 1
EOF

fi
if test -n "$file_system_sfs"; then
    cat >> confdefs.h <<\EOF
#define SFS 1
EOF

fi
if test -n "$file_system_xfs"; then
    cat >> confdefs.h <<\EOF
#define XFS 1
EOF

    # Check for memalign value (this was P A C_GET_XFS_MEMALIGN,
    # switched to autoconf 2)
    echo $ac_n "checking for memory alignment needed for direct I/O""... $ac_c" 1>&6
echo "configure:3896: checking for memory alignment needed for direct I/O" >&5
if eval "test \"`echo '$''{'pac_cv_memalignval'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
/bin/rm -f confmemalignval
/bin/rm -f /tmp/romio_tmp.bin
if test "$cross_compiling" = yes; then
  pac_cv_memalignval="unknown"
else
  cat > conftest.$ac_ext <<EOF
#line 3907 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
main() { 
  struct dioattr st;
  int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
  FILE *f=fopen("confmemalignval","w");
  if (fd == -1) exit(1);
  if (!f) exit(1);
  fcntl(fd, F_DIOINFO, &st);
  fprintf( f, "%u\n", st.d_mem);
  exit(0);
}
EOF
if { (eval echo configure:3924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  pac_cv_memalignval=`cat confmemalignval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  pac_cv_memalignval="unknown"
fi
rm -fr conftest*
fi

    /bin/rm -f confmemalignval
    /bin/rm -f /tmp/romio_tmp.bin

fi

echo "$ac_t""$pac_cv_memalignval" 1>&6
    if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \
    "$pac_cv_memalignval" != "unknown" ; then
        CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval"
    else
        echo "$ac_t""assuming 128 for memory alignment" 1>&6
        CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
    fi
fi

if test -n "$file_system_pvfs"; then
   # Use ROMIO_PVFS instead of PVFS because FREEBSD defines PVFS.
    cat >> confdefs.h <<\EOF
#define ROMIO_PVFS 1
EOF

fi
if test -n "$file_system_pvfs2"; then
    cat >> confdefs.h <<\EOF
#define ROMIO_PVFS2 1
EOF

fi
if test -n "$file_system_pfs"; then
    cat >> confdefs.h <<\EOF
#define PFS 1
EOF

fi
if test -n "$file_system_testfs"; then
    cat >> confdefs.h <<\EOF
#define ROMIO_TESTFS 1
EOF

fi
if test -n "$file_system_piofs"; then
    cat >> confdefs.h <<\EOF
#define PIOFS 1
EOF

    USER_CFLAGS="$USER_CFLAGS -bI:/usr/include/piofs/piofs.exp"
    ROMIO_LFLAGS="$USER_FFLAGS -bI:/usr/include/piofs/piofs.exp"
    USER_FFLAGS="$USER_FFLAGS -bI:/usr/include/piofs/piofs.exp"
fi
if test -n "$mpi_mpich"; then
   if test "$FROM_MPICH2" = no; then
      cat >> confdefs.h <<\EOF
#define NEEDS_MPI_TEST 1
EOF

      cat >> confdefs.h <<\EOF
#define MPICH 1
EOF

      if test -z "$arch_SX4" ; then
         MPIOF_H_INCLUDED=1
      fi
   fi
fi
if test -n "$mpi_sgi"; then
   cat >> confdefs.h <<\EOF
#define MPISGI 1
EOF

fi
if test -n "$mpi_lam"; then
   cat >> confdefs.h <<\EOF
#define MPILAM 1
EOF

fi
if test -n "$mpi_hp"; then
   cat >> confdefs.h <<\EOF
#define MPIHP 1
EOF

   if test "$NOF77" = 0; then
      
  echo $ac_n "checking if mpiof.h is included in mpif.h""... $ac_c" 1>&6
echo "configure:4020: checking if mpiof.h is included in mpif.h" >&5
  rm -f mpitest.f
  cat > mpitest.f <<EOF
      program main
      implicit none
      include 'mpif.h'
      integer i
      i = MPI_MODE_RDWR
      stop
      end
EOF
  rm -f conftest
  $F77 $FFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.f $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
      echo "$ac_t""yes" 1>&6
      MPIOF_H_INCLUDED=1
  else
      echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.f

   fi
fi
#

  echo $ac_n "checking for strerror()""... $ac_c" 1>&6
echo "configure:4046: checking for strerror()" >&5
  rm -f conftest.c
  cat > conftest.c <<EOF
#include <string.h>
     main()
     {
        char *s = strerror(5);
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -o conftest conftest.c >> config.log 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
#define HAVE_STRERROR 
EOF

  else
     echo "$ac_t""no" 1>&6
     echo $ac_n "checking for sys_errlist""... $ac_c" 1>&6
echo "configure:4066: checking for sys_errlist" >&5
     rm -f conftest.c

     cat > conftest.c <<EOF
#include <stdio.h>
        main()
        {
           extern char *sys_errlist[];
	   printf("%s\n", sys_errlist[34]);
        }
EOF

     rm -f conftest
     $CC $USER_CFLAGS -o conftest conftest.c > config.log 2>&1
     if test -x conftest ; then
        echo "$ac_t""yes" 1>&6
        cat >> confdefs.h <<\EOF
#define HAVE_SYSERRLIST 
EOF

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

if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi

# The master_top_srcdir is the location of the source for the building
# package.  This is used only as part of the MPICH2 build, including 
# the documentation targets mandoc, htmldoc, and latexdoc
if test -z "$master_top_srcdir" ; then
    if test "$FROM_MPICH2" = yes ; then
        echo "configure: warning: Could not determine master_top_srcdir" 1>&2
    fi
fi

#
# Get the master builddir (which may be imported from above)
if test -z "$master_top_builddir" ; then
    master_top_builddir=`pwd`
fi
export master_top_builddir


# The following definitions are needed within adio/common/status_setb.c
if test "$FROM_MPICH" = yes ; then
   cat >> confdefs.h <<\EOF
#define MPICH 1
EOF

elif test "$FROM_MPICH2" = yes ; then 
   cat >> confdefs.h <<\EOF
#define MPICH2 1
EOF

elif test "$FROM_MPILAM" = yes ; then
   cat >> confdefs.h <<\EOF
#define MPILAM 1
EOF

fi

if test "$FROM_MPICH2" = no -a "$FROM_MPICH" = no ; then 
    if test -z "$LIBNAME"; then
        LIBNAME="$ROMIO_HOME/lib/$ARCH/libmpio.a"
    fi
    #
    if test ! -d $ROMIO_HOME/lib ; then 
        mkdir $ROMIO_HOME/lib
    fi
    if test ! -d $ROMIO_HOME/lib/$ARCH ; then 
        mkdir $ROMIO_HOME/lib/$ARCH
    fi
else
    MPILIBNAME=${MPILIBNAME:-mpich}
    if test -z "$LIBNAME" ; then
        if test -n "$top_build_dir" -a -d "$top_build_dir/lib" ; then
            LIBNAME=$top_build_dir/lib/lib${MPILIBNAME}.a
        else
            LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a"
	fi
    fi
fi
if test "$FROM_MPICH2" != no ; then
    # use the error handlers from MPICH2
    MPIO_EXTRA_OBJECTS=
    MPIO_EXTRA_TMP_POBJECTS=
    MPIO_EXTRA_REAL_POBJECTS=
    # Use generalized request to get the multiple-completion routines
    MPIO_REQOBJECTS=
    MPIO_REQ_TMP_POBJECTS=
    MPIO_REQ_REAL_POBJECTS=
fi






#
if test $NOF77 = 1 ; then
   F77=":"
else
   FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test" 
fi
#
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   
  echo $ac_n "checking if a simple MPI program compiles and links""... $ac_c" 1>&6
echo "configure:4176: checking if a simple MPI program compiles and links" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
         MPI_Init(&argc,&argv);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test ! -x conftest ; then
      rm -f conftest mpitest.c
      { echo "configure: error: Unable to compile a simple MPI program.
Use environment variables to provide the location of MPI libraries and
include directories" 1>&2; exit 1; }
  else
      rm -f conftest mpitest.c
  fi
echo "$ac_t""yes" 1>&6

   
  echo $ac_n "checking if MPI_Fint is defined in the MPI implementation""... $ac_c" 1>&6
echo "configure:4200: checking if MPI_Fint is defined in the MPI implementation" >&5
  cat > mpitest1.c <<EOF
#include "mpi.h"
     main()
     {
         MPI_Fint i;
         i = 0;
     }
EOF
  rm -f mpitest1.o
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -c mpitest1.c > /dev/null 2>&1
  if test ! -s mpitest1.o ; then
      NEEDS_MPI_FINT="#define NEEDS_MPI_FINT"
      CFLAGS="$CFLAGS -DNEEDS_MPI_FINT"
      echo "$ac_t""no" 1>&6
      rm -f mpitest1.o mpitest1.c
  else
      NEEDS_MPI_FINT=""
      echo "$ac_t""yes" 1>&6
      rm -f mpitest1.o mpitest1.c
  fi

else
   NEEDS_MPI_FINT=""
fi
#
if test "$MPI_INCLUDE_DIR" = "." ; then
   ROMIO_INCLUDE="-I../include"
else 
   ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR"
fi
#
TEST_LIBNAME=$LIBNAME
MPIRUN=mpirun
#
# if MPICH, use mpicc in test programs
#
if test "$FROM_MPICH" = yes ; then
   MPICH_HOME=`dirname $ROMIO_HOME`
   if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
   TEST_CC=$MPI_BIN_DIR/mpicc
   MPI_LIB=""
   ROMIO_INCLUDE=""
   USER_CFLAGS=""
   USER_FFLAGS=""
   TEST_LIBNAME=""
   MPIRUN=$MPI_BIN_DIR/mpirun
   if test -n "$arch_SX4" || test -n "$arch_hpux" ; then
      TEST_F77=$MPI_BIN_DIR/mpif90
   else
      TEST_F77=$MPI_BIN_DIR/mpif77
   fi
   CC=$MPI_BIN_DIR/mpicc
#   if test $FROM_MPICH2 != yes ; then
#       BUILD_MPI_ARRAY=1
#       BUILD_MPI_INFO=1
#   fi
   # A later test will insert the mpi2-other/info and array directories based
   # on the value of BUILD_MPI_xxxx.  This lets MPICH2 turn these off,
   # since MPICH2 provides these routines elsewhere
   EXTRA_DIRS="mpi-io/fortran"
   # Some older implementations of the ADI do not include the 
   # MPID_Status_set_bytes routine.   This uses either the 
   # environment variable ADI3_WITHOUT_SET_BYTES or the
   # with arg --without-setbytes
   if test "$ADI2_WITHOUT_SET_BYTES" != yes -a \
           "$with_setbytes" != no ; then
       cat >> confdefs.h <<\EOF
#define HAVE_STATUS_SET_BYTES 1
EOF

   fi
elif test $FROM_LAM = yes ; then
   # LAM does have the status set bytes functionality
   cat >> confdefs.h <<\EOF
#define HAVE_STATUS_SET_BYTES 1
EOF

        
   # Used in the tests/ subdirectory for after ROMIO is built
   TEST_CC=mpicc
   TEST_F77=mpif77
   MPIRUN=mpirun 
   MPI_LIB=
   ROMIO_INCLUDE=
   USER_CFLAGS=
   USER_FFLAGS=
   TEST_LIBNAME=
   EXTRA_DIRS="mpi-io/fortran mpi2-other/info mpi2-other/info/fortran mpi2-other/array mpi2-other/array/fortran"
elif test $FROM_MPICH2 = yes ; then
   # For now, separate the mpich2 from mpich cases
   MPICH_HOME=`dirname $ROMIO_HOME`
   MPICH_HOME=`dirname $MPICH_HOME`
   MPICH_HOME=`dirname $MPICH_HOME`
   if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
   # No special compiler script.
   # BUT we need the include paths
   CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include"
   TEST_CC="$CC"
   MPI_LIB="$LIBNAME"
   ROMIO_INCLUDE=""
   USER_CFLAGS=""
   USER_FFLAGS=""
   TEST_LIBNAME=""
   MPIRUN=$MPI_BIN_DIR/mpiexec
   #
   # Turn off the building of the Fortran interface and the Info routines
   EXTRA_DIRS=""
   cat >> confdefs.h <<\EOF
#define HAVE_STATUS_SET_BYTES 1
EOF

   DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST"
fi
#
#
# feature tests:  we can't test features if building as part of MPICH because
# we don't yet have an implementation against which we can test
#
if test $WITHIN_KNOWN_MPI_IMPL = no ; then
   
  echo $ac_n "checking if MPIR_Status_set_bytes is defined""... $ac_c" 1>&6
echo "configure:4322: checking if MPIR_Status_set_bytes is defined" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
     main(int argc, char **argv)
     {
     	 MPI_Status status;
         MPI_Datatype type;
	 int err;

         MPI_Init(&argc,&argv);
         MPIR_Status_set_bytes(status,type,err);
         MPI_Finalize(); 
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
#define HAVE_STATUS_SET_BYTES 
EOF

  else
     echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.c

   
  echo $ac_n "checking support for generalized requests""... $ac_c" 1>&6
echo "configure:4352: checking support for generalized requests" >&5
  rm -f mpitest.c
  cat > mpitest.c <<EOF
#include "mpi.h"
#include "stdio.h"
    main(int argc, char **argv)
    {
       MPI_Request request;
       MPI_Init(&argc, &argv);
       MPI_Grequest_start(NULL, NULL, NULL, NULL, &request);
       MPI_Finalize();
     }
EOF
  rm -f conftest
  $CC $USER_CFLAGS -I$MPI_INCLUDE_DIR -o conftest mpitest.c $MPI_LIB > /dev/null 2>&1
  if test -x conftest ; then
     echo "$ac_t""yes" 1>&6
     cat >> confdefs.h <<\EOF
#define HAVE_MPI_GREQUEST 
EOF

  else
     echo "$ac_t""no" 1>&6
  fi
  rm -f conftest mpitest.c

   cat >> confdefs.h <<\EOF
#define PRINT_ERR_MSG 1
EOF

fi
#
if test -z "$TEST_CC" ; then
   TEST_CC="$CC"
fi
if test -z "$TEST_F77" ; then
   TEST_F77="$F77"
fi
#
# Create the directory lists for the Makefile
FILE_SYS_DIRS=""
for dir in $FILE_SYSTEM ; do
    FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$dir"
done
EXTRA_SRC_DIRS=""
if test "$BUILD_MPI_INFO" = 1 ; then
    EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info"
    if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
        EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info/fortran"
    fi
fi
if test "$BUILD_MPI_ARRAY" = 1 ; then
    EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array"
    if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
        EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array/fortran"
    fi
fi
if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
   EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran"
fi



#
CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
#

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:4423: 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 4428 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4433: \"$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 defines""... $ac_c" 1>&6
echo "configure:4454: checking for large file defines" >&5
        cat > conftest.$ac_ext <<EOF
#line 4456 "configure"
#include "confdefs.h"

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

                #ifndef _LFS64_LARGEFILE
                #error no largefile defines
                #endif
                
; return 0; }
EOF
if { (eval echo configure:4469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
                echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""none" 1>&6 
fi
rm -f conftest*
        
else
  echo "$ac_t""no" 1>&6
fi
done


echo "setting CC to $CC"
echo "setting F77 to $F77"
echo "setting TEST_CC to $TEST_CC"
echo "setting TEST_F77 to $TEST_F77"
echo "setting CFLAGS to $CFLAGS"
echo "setting USER_CFLAGS to $USER_CFLAGS"
echo "setting USER_FFLAGS to $USER_FFLAGS"
#
VPATH='VPATH = .:${srcdir}'
































































if test -z "$ENABLE_SHLIB" ; then
   ENABLE_SHLIB=none
fi



# Remove the .a from the library file name (so that we can use .so or
# other appropriate suffix)
SHLIBNAME=`echo $LIBNAME | sed 's/\.a//'`

if test ! -d adio ; then mkdir adio ; fi
if test ! -d adio/include ; then mkdir adio/include ; fi
if test ! -d mpi2-other ; then mkdir mpi2-other ; fi
# 
# Make sure we remove any configuration file incase there is out-of-date data.
# We remove the version in include in case this is a vpath build
rm -f adio/include/romioconf.h ${use_top_srcdir}/src/mpi/romio/adio/include/romioconf.h ${use_top_srcdir}/adio/include/romioconf.h
#
# Create makefiles for all of the adio devices.  Only the ones that 
# are active will be called by the top level ROMIO make

trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

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 localdefs mpi-io/Makefile mpi2-other/info/Makefile \
		   mpi2-other/array/Makefile adio/common/Makefile \
		   test/Makefile test/misc.c test/large_file.c \
		   test/runtests util/romioinstall include/mpio.h \
		   include/mpiof.h \
		   adio/ad_nfs/Makefile adio/ad_ufs/Makefile \
		   adio/ad_xfs/Makefile adio/ad_hfs/Makefile \
		   adio/ad_sfs/Makefile adio/ad_pfs/Makefile \
		   adio/ad_testfs/Makefile adio/ad_pvfs/Makefile \
		   adio/ad_pvfs2/Makefile adio/ad_piofs/Makefile \
                   mpi-io/fortran/Makefile mpi2-other/info/fortran/Makefile \
                   mpi2-other/array/fortran/Makefile test/fmisc.f \
                   test/fcoll_test.f test/pfcoll_test.f test/fperf.f  adio/include/romioconf.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%@docdir@%$docdir%g
s%@htmldir@%$htmldir%g
s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@F77@%$F77%g
s%@CPP@%$CPP%g
s%@HAVE_WEAK_SYMBOLS@%$HAVE_WEAK_SYMBOLS%g
s%@srcdir@%$srcdir%g
s%@master_top_srcdir@%$master_top_srcdir%g
s%@master_top_builddir@%$master_top_builddir%g
s%@MPIO_EXTRA_OBJECTS@%$MPIO_EXTRA_OBJECTS%g
s%@MPIO_EXTRA_TMP_POBJECTS@%$MPIO_EXTRA_TMP_POBJECTS%g
s%@MPIO_EXTRA_REAL_POBJECTS@%$MPIO_EXTRA_REAL_POBJECTS%g
s%@MPIO_REQOBJECTS@%$MPIO_REQOBJECTS%g
s%@MPIO_REQ_TMP_POBJECTS@%$MPIO_REQ_TMP_POBJECTS%g
s%@MPIO_REQ_REAL_POBJECTS@%$MPIO_REQ_REAL_POBJECTS%g
s%@EXTRA_SRC_DIRS@%$EXTRA_SRC_DIRS%g
s%@FILE_SYS_DIRS@%$FILE_SYS_DIRS%g
s%@VPATH@%$VPATH%g
s%@ARCH@%$ARCH%g
s%@FILE_SYSTEM@%$FILE_SYSTEM%g
s%@USER_CFLAGS@%$USER_CFLAGS%g
s%@USER_FFLAGS@%$USER_FFLAGS%g
s%@MIPS@%$MIPS%g
s%@BITS@%$BITS%g
s%@MPI@%$MPI%g
s%@AR@%$AR%g
s%@MPI_INCLUDE_DIR@%$MPI_INCLUDE_DIR%g
s%@MPI_LIB@%$MPI_LIB%g
s%@NOF77@%$NOF77%g
s%@NOPROFILE@%$NOPROFILE%g
s%@MAKE@%$MAKE%g
s%@arch_IRIX@%$arch_IRIX%g
s%@ROMIO_HOME@%$ROMIO_HOME%g
s%@LIBNAME@%$LIBNAME%g
s%@TEST_LIBNAME@%$TEST_LIBNAME%g
s%@LL@%$LL%g
s%@F77GETARG@%$F77GETARG%g
s%@F77IARGC@%$F77IARGC%g
s%@FTESTDEFINE@%$FTESTDEFINE%g
s%@FORTRAN_MPI_OFFSET@%$FORTRAN_MPI_OFFSET%g
s%@FROM_MPICH@%$FROM_MPICH%g
s%@FROM_MPICH2@%$FROM_MPICH2%g
s%@FROM_LAM@%$FROM_LAM%g
s%@WITHIN_KNOWN_MPI_IMPL@%$WITHIN_KNOWN_MPI_IMPL%g
s%@NEEDS_MPI_FINT@%$NEEDS_MPI_FINT%g
s%@HAVE_MPI_INFO@%$HAVE_MPI_INFO%g
s%@BUILD_MPI_INFO@%$BUILD_MPI_INFO%g
s%@HAVE_MPI_DARRAY_SUBARRAY@%$HAVE_MPI_DARRAY_SUBARRAY%g
s%@BUILD_MPI_ARRAY@%$BUILD_MPI_ARRAY%g
s%@DEFINE_MPI_OFFSET@%$DEFINE_MPI_OFFSET%g
s%@DEFINE_HAVE_MPI_GREQUEST@%$DEFINE_HAVE_MPI_GREQUEST%g
s%@MPI_OFFSET_TYPE@%$MPI_OFFSET_TYPE%g
s%@MPI_FINFO1@%$MPI_FINFO1%g
s%@MPI_FINFO2@%$MPI_FINFO2%g
s%@MPI_FINFO3@%$MPI_FINFO3%g
s%@MPI_FINFO4@%$MPI_FINFO4%g
s%@MPI_FARRAY1@%$MPI_FARRAY1%g
s%@MPI_FARRAY2@%$MPI_FARRAY2%g
s%@MPI_FARRAY3@%$MPI_FARRAY3%g
s%@MPI_FARRAY4@%$MPI_FARRAY4%g
s%@MPI_FARRAY5@%$MPI_FARRAY5%g
s%@MPI_FARRAY6@%$MPI_FARRAY6%g
s%@MPI_FARRAY7@%$MPI_FARRAY7%g
s%@MPI_OFFSET_KIND1@%$MPI_OFFSET_KIND1%g
s%@MPI_OFFSET_KIND2@%$MPI_OFFSET_KIND2%g
s%@TEST_CC@%$TEST_CC%g
s%@TEST_F77@%$TEST_F77%g
s%@ROMIO_INCLUDE@%$ROMIO_INCLUDE%g
s%@ROMIO_LFLAGS@%$ROMIO_LFLAGS%g
s%@ROMIO_LIBLIST@%$ROMIO_LIBLIST%g
s%@ROMIO_TCFLAGS@%$ROMIO_TCFLAGS%g
s%@ROMIO_TCPPFLAGS@%$ROMIO_TCPPFLAGS%g
s%@ROMIO_TFFLAGS@%$ROMIO_TFFLAGS%g
s%@MPIRUN@%$MPIRUN%g
s%@FORTRAN_TEST@%$FORTRAN_TEST%g
s%@MAKE_DEPEND_C@%$MAKE_DEPEND_C%g
s%@ENABLE_SHLIB@%$ENABLE_SHLIB%g
s%@CC_SHL@%$CC_SHL%g
s%@LIBTOOL@%$LIBTOOL%g
s%@SHLIBNAME@%$SHLIBNAME%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 localdefs mpi-io/Makefile mpi2-other/info/Makefile \
		   mpi2-other/array/Makefile adio/common/Makefile \
		   test/Makefile test/misc.c test/large_file.c \
		   test/runtests util/romioinstall include/mpio.h \
		   include/mpiof.h \
		   adio/ad_nfs/Makefile adio/ad_ufs/Makefile \
		   adio/ad_xfs/Makefile adio/ad_hfs/Makefile \
		   adio/ad_sfs/Makefile adio/ad_pfs/Makefile \
		   adio/ad_testfs/Makefile adio/ad_pvfs/Makefile \
		   adio/ad_pvfs2/Makefile adio/ad_piofs/Makefile \
                   mpi-io/fortran/Makefile mpi2-other/info/fortran/Makefile \
                   mpi2-other/array/fortran/Makefile test/fmisc.f \
                   test/fcoll_test.f test/pfcoll_test.f test/fperf.f "}
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="adio/include/romioconf.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
chmod 755 util/romioinstall test/runtests

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

#
rm -f *.o
if test "$ROMIO_NO_BANNER" != "yes" -a "$FROM_MPICH" = no -a \
         $FROM_MPICH2 = no ; then
cat <<EOF

Please register your copy of ROMIO with us by sending email
to majordomo@mcs.anl.gov with the message
subscribe romio-users
This will enable us to notify you of new releases of ROMIO
as well as bug fixes.

EOF
fi
if test $FROM_MPICH2 = yes -a "$NOF77" = 0 ; then
      sed 5d test/fcoll_test.f > test/tmp
      mv test/tmp test/fcoll_test.f
      sed 5d test/pfcoll_test.f > test/tmp
      mv test/tmp test/fcoll_test.f
      sed 5d test/fperf.f > test/tmp
      mv test/tmp test/fperf.f
      sed 5d test/fmisc.f > test/tmp
      mv test/tmp test/fmisc.f
fi
if test $FROM_MPICH = no -a $FROM_MPICH2 = no ; then
   echo "$ac_t""Configure done. Now type make" 1>&6
fi
exit 0
