#! /bin/sh

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

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --enable-echo           echo configure script commands"
ac_help="$ac_help
  --with-cc=CC            use C compiler CC"
ac_help="$ac_help
  --with-cflags=CFLAGS    use C compiler flags CFLAGS"
ac_help="$ac_help
  --with-romio            build LAM with ROMIO support (not --with-shared)"
ac_help="$ac_help
  --without-mpi2cpp       build LAM without MPI 2 C++ bindings support"
ac_help="$ac_help
  --with-cpp=CXX          use C++ compiler CXX"
ac_help="$ac_help
  --with-cppflags=CXXFLAGS use C++ compiler flags CXXFLAGS"
ac_help="$ac_help
  --with-impi             compile with IMPI support (6.4 only)"
ac_help="$ac_help
--with-exflags          Specify flags necessary to enable C++ exceptions"
ac_help="$ac_help
  --with-ldflags=LDFLAGS  use LD linker flags LDFLAGS"
ac_help="$ac_help
  --with-cppldflags=CPPLDFLAGS  use C++ LD linker flags CPPLDFLAGS"
ac_help="$ac_help
  --with-fc=FC            use Fortran compiler FC,
                          specify no to disable Fortran support"
ac_help="$ac_help
  --with-fflags=FFLAGS    use Fortran compiler flags FFLAGS"
ac_help="$ac_help
  --with-shared           build shared libraries (not --with-romio)"
ac_help="$ac_help
  --with-rpi=RPI          build with RPI comm layer RPI
                          (where RPI=tcp|sysv|usysv -- default is tcp)"
ac_help="$ac_help
  --without-shortcircuit  do not short circuit send/receives"
ac_help="$ac_help
  --with-select-yield     use select to yield"
ac_help="$ac_help
  --with-signal=SIGNAL    use internal signal SIGNAL"
ac_help="$ac_help
  --with-pthread-lock     use pthread mutex lock for shared memory pool"
ac_help="$ac_help
  --with-rsh=RSH          use RSH for the remote shell command"
ac_help="$ac_help
  --with-purify           ensure to zero memory before using (see docs)"
ac_help="$ac_help
  --with-tcp-short=BYTES  use BYTES as the size of the longest TCP short 
                          message"
ac_help="$ac_help
  --with-shm-short=BYTES  use BYTES as the size of the longest shared 
                          memory short message"
ac_help="$ac_help
  --with-shm-poolsize=BYTES  make the shared memory pool BYTES in size"
ac_help="$ac_help
  --with-shm-maxalloc=BYTES  make BYTES the maximum allocation from the 
                             shared pool"

# 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.14.1"
    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=./lib/otb/t/kreq/clientio.c

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

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


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

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


ac_aux_dir=
for ac_dir in ./config $srcdir/./config; 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 ./config $srcdir/./config" 1>&2; exit 1; }
fi
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.




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


lam_echo () {
    echo $ac_n $1"... $ac_c" 1>&6
}

PFILE=share/h/patchlevel.h
LAM_VERSION=`cat $PFILE | grep LAM_VERSION | cut -d\" -f2`

echo "Configuring LAM version $LAM_VERSION"


echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:613: checking host system type" >&5
if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then

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

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

  ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
  ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
else
  echo $ac_n "(cached) $ac_c" 1>&6
fi

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

host=$ac_cv_host
host_alias=$ac_cv_host_alias
host_cpu=$ac_cv_host_cpu
host_vendor=$ac_cv_host_vendor
host_os=$ac_cv_host_os




cat >> confdefs.h <<EOF
#define LAM_ARCH "$host"
EOF


case "$prefix" in
  /*) echo installing to directory \"$prefix\" ;;
  NONE) prefix=/usr/local/lam-$LAM_VERSION
	echo installing to default location \"$prefix\" ;;
  *) { echo "configure: error: prefix \"$prefix\" must be an absolute directory path" 1>&2; exit 1; } ;;
esac

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


if test -n "$with_cc"; then
    if test $with_cc = yes; then
	{ echo "configure: error: the --with-cc option requires the compiler name" 1>&2; exit 1; }
    fi
    CC=$with_cc;
fi

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


if test -n "$with_cflags"; then
    CFLAGS=$with_cflags;
fi
lam_cflags_save="$CFLAGS"

echo $ac_n "checking if want ROMIO support""... $ac_c" 1>&6
echo "configure:691: checking if want ROMIO support" >&5
ROMIO_INSTALL=
ROMIO_CLEAN=
ROMIO_EXAMPLES=
ROMIO_EXAMPLE=
WANT_ROMIO=no
# Check whether --with-romio or --without-romio was given.
if test "${with_romio+set}" = set; then
  withval="$with_romio"
  WANT_ROMIO=$withval
fi

echo "$ac_t""$WANT_ROMIO" 1>&6
if test "$WANT_ROMIO" = "yes"; then
    ROMIO_INSTALL=romio-install
    ROMIO_CLEAN=romio-clean
    ROMIO_EXAMPLES=romio-examples
    ROMIO_EXAMPLE=romio
    cat >> confdefs.h <<\EOF
#define LAM_WANT_ROMIO 1
EOF

    echo $ac_n "checking for main in -laio""... $ac_c" 1>&6
echo "configure:714: checking for main in -laio" >&5
ac_lib_var=`echo aio'_'main | sed 'y%./+-%__p_%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-laio  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 722 "configure"
#include "confdefs.h"

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo aio | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-laio $LIBS"

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

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

    cat >> confdefs.h <<\EOF
#define HAVE_LIBAIO 0
EOF

fi





echo $ac_n "checking if want MPI 2 C++ support""... $ac_c" 1>&6
echo "configure:772: checking if want MPI 2 C++ support" >&5
MPI2CPP_INSTALL=
MPI2CPP_CLEAN=
MPI2CPP_EXAMPLES=
MPI2CPP_EXAMPLE=
WANT_MPI2CPP=yes
# Check whether --with-mpi2cpp or --without-mpi2cpp was given.
if test "${with_mpi2cpp+set}" = set; then
  withval="$with_mpi2cpp"
  WANT_MPI2CPP=$withval
fi

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

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

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


if test "$with_mpi2cpp" = "" -o "$with_mpi2cpp" = "yes"; then
    cat >> confdefs.h <<\EOF
#define LAM_WANT_MPI2CPP 1
EOF

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

fi

# Check if we want IMPI support

echo $ac_n "checking if want IMPI support""... $ac_c" 1>&6
echo "configure:814: checking if want IMPI support" >&5
basever="`echo $LAM_VERSION | cut -c1-3`";
if test "$basever" = "6.3"; then
    WANT_IMPI=no
else
    WANT_IMPI=yes
fi
# Check whether --with-impi or --without-impi was given.
if test "${with_impi+set}" = set; then
  withval="$with_impi"
  WANT_IMPI=$withval
fi

if test "$WANT_IMPI" = "yes"; then
    # If this is a 6.3 LAM, bail immediately

    if test ! -d share/impi; then
	echo "$ac_t""yes" 1>&6
	echo "configure: warning: *** LAM/IMPI is in DEVELOPMENT stages only!!" 1>&2
	echo "configure: warning: *** Users who invoke --with-impi will find that" 1>&2
	echo "configure: warning: *** LAM will not compile.  It is for developers only." 1>&2
	{ echo "configure: error: *** Cannot continue; you must configure without --with-impi." 1>&2; exit 1; }
    fi

    IMPI_LIB="-limpi"
    IMPI_DIR="impi"
    IMPID_DIR="impid"
    IMPI_TARGET="impi"
    IMPI_LIB_FILE="\$(OLDIR)/libimpi.\$(LIBDEPSFX)"
    cat >> confdefs.h <<\EOF
#define LAM_WANT_IMPI 1
EOF

else
    IMPI_LIB=""
    IMPI_DIR=""
    IMPID_DIR=""
    IMPI_TARGET="no-impi"
    IMPI_LIB_FILE=""
    cat >> confdefs.h <<\EOF
#define LAM_WANT_IMPI 0
EOF

fi





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


if test "$WANT_MPI2CPP" = "yes" -o "$WANT_IMPI" = "yes"; then
    if test -n "$with_cpp"; then
	if test $with_cpp = yes; then
	    { echo "configure: error: the --with-cpp option requires the compiler name" 1>&2; exit 1; }
	fi
	CXX=$with_cpp;
    fi

    if test -n "$with_cppflags"; then
	CXXFLAGS=$with_cppflags;
    fi
else
    CXX=/bin/false
    CXXFLAGS=
fi
lam_cxxflags_save="$CXXFLAGS"


lam_cflags_save=$CFLAGS
# 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:888: checking for $ac_word" >&5
if eval "test \"\${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:918: checking for $ac_word" >&5
if eval "test \"\${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* | *CYGWIN*)
      # 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:969: checking for $ac_word" >&5
if eval "test \"\${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 $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1001: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $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 1012 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1017: \"$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 $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1043: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $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:1048: checking whether we are using GNU C" >&5
if eval "test \"\${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:1057: \"$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:1076: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"\${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

CFLAGS=$lam_cflags_save
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1109: 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 \"\${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 1124 "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:1130: \"$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 1141 "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:1147: \"$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 1158 "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:1164: \"$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 $ac_cv_prog_gcc = yes; then
    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:1190: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"\${ac_cv_prog_gcc_traditional+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    ac_pattern="Autoconf.*'x'"
  cat > conftest.$ac_ext <<EOF
#line 1196 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
else
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


  if test $ac_cv_prog_gcc_traditional = no; then
    cat > conftest.$ac_ext <<EOF
#line 1214 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
fi
rm -f conftest*

  fi
fi

echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi


if test "$WANT_MPI2CPP" = "yes" -o "$WANT_IMPI" = "yes"; then
    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
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:1242: checking for $ac_word" >&5
if eval "test \"\${ac_cv_prog_CXX+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # 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_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1274: checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

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

int main(){return(0);}
EOF
if { (eval echo configure:1290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_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_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_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_cxx_works" 1>&6
if test $ac_cv_prog_cxx_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 ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1316: checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

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

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

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:1349: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"\${ac_cv_prog_cxx_g+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

    if test "$CXX" = "no"; then
	{ echo "configure: error: Cannot install MPI 2 C++ bindings without a C++ compiler" 1>&2; exit 1; }
    else
	if test "$WANT_MPI2CPP" = "yes"; then
	    MPI2CPP_INSTALL=mpi2c++-install
	    MPI2CPP_CLEAN=mpi2c++-clean
	    MPI2CPP_EXAMPLES=mpi2c++-examples
	    MPI2CPP_EXAMPLE=mpi2c++
	fi
    fi
    if test "$WANT_IMPI" = "yes"; then
	
#
# Check to see if the C++ compiler has std::nothrow support for new
# and new[]
#
# Defines LAM_NOTHROW_NEW to be either "(std::nothrow)" or ""
# Defines LAM_HAVE_NOTHROW_NEW to be either 1 or 0
# Sets LAM_NOTHROW_NEW to be 1 or 0
#

if test "$?CXXFLAGS" = 0; then
    CXXFLAGS=""
fi
echo $ac_n "checking whether $CXX has new(std::nothrow)""... $ac_c" 1>&6
echo "configure:1405: checking whether $CXX has new(std::nothrow)" >&5
rm -f conftest.cc conftest.o
cat > conftest.cc <<EOF
#include <new>

int main(int argc, char* argv) {
  int *baz;
  unsigned int foo = 3;
  baz = new(std::nothrow) int;
  baz = new(std::nothrow) int[foo - 1];
}
EOF
echo configure:1417: $CXX $CXXFLAGS conftest.cc -o conftest >&5 
$CXX $CXXFLAGS conftest.cc -o conftest >&5 2>&5
if test -f conftest; then
    LAM_HAVE_NOTHROW_NEW=1
    cat >> confdefs.h <<\EOF
#define LAM_NOTHROW_NEW (std::nothrow)
EOF

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

    echo "$ac_t""yes" 1>&6
else
    echo configure:1431: here is the program that failed: >&5
    cat conftest.cc >&5
    LAM_HAVE_NOTHROW_NEW=0
    cat >> confdefs.h <<\EOF
#define LAM_NOTHROW_NEW 
EOF

    cat >> confdefs.h <<\EOF
#define LAM_HAVE_NOTHROW_NEW 0
EOF

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

	if test "$LAM_HAVE_NOTHROW_NEW" = "0"; then
	    
#
# Check to see if the C++ compiler can handle exceptions 
#
# Sets LAM_CXX_HAS_EXCEPTIONS to 1 if compiler has exceptions, 0 if not
#

echo $ac_n "checking for throw/catch""... $ac_c" 1>&6
echo "configure:1455: checking for throw/catch" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

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

int main() {
int i=1; throw(i);
; return 0; }
EOF
if { (eval echo configure:1472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  have_excep=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  have_excep=no
fi
rm -f conftest*
if test "$have_excep" = "yes"; then
    LAM_CXX_HAS_EXCEPTIONS=1
    echo "$ac_t""yes" 1>&6
else
    LAM_CXX_HAS_EXCEPTIONS=0
    echo "$ac_t""no" 1>&6
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

	    if test "$LAM_CXX_HAS_EXCEPTIONS" = "1"; then
		
#
# Get the exception handling flags for the C++ compiler
#
# Sets LAM_EXCEPTION_CXXFLAGS and LAM_EXCEPTION_LDFLAGS as appropriate
# Calls AC_SUBST on both
#

# Check whether --with-exflags or --without-exflags was given.
if test "${with_exflags+set}" = set; then
  withval="$with_exflags"
  FORCE_EXFLAGS=$withval
fi


CXXFLAGS_SAVE=$CXXFLAGS
echo $ac_n "checking for $CXX exception flags""... $ac_c" 1>&6
echo "configure:1514: checking for $CXX exception flags" >&5
if test "$FORCE_EXFLAGS" != ""; then
    EXFLAGS=$FORCE_EXFLAGS
elif test "$GXX" = "yes"; then
    CXXFLAGS="$CXXFLAGS -fexceptions"

    
    ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

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

int main() {
try { int i = 0; } catch(...) { int j = 2; }
; return 0; }
EOF
if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  HAPPY=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  HAPPY=0
fi
rm -f conftest*

    if test "$HAPPY" = "1"; then
	EXFLAGS="-fexceptions";
    else
	CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions"
	cat > conftest.$ac_ext <<EOF
#line 1552 "configure"
#include "confdefs.h"

int main() {
try { int i = 0; } catch(...) { int j = 2; }
; return 0; }
EOF
if { (eval echo configure:1559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  HAPPY=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  HAPPY=0
fi
rm -f conftest*
	if test "$HAPPY" = "1"; then
	    EXFLAGS="-fhandle-exceptions";
	fi
    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

elif test "$CXX" = "KCC" -o "$LAMHCP" = "KCC"; then
    EXFLAGS="-x"
fi
CXXFLAGS=$CXXFLAGS_SAVE

LAM_EXCEPTION_CXXFLAGS=$EXFLAGS
LAM_EXCEPTION_LDFLAGS="$EXFLAGS"
if test "$EXFLAGS" = ""; then
    echo "$ac_t""none necessary" 1>&6
else
    echo "$ac_t""$EXFLAGS" 1>&6
fi


	    fi
	fi
    fi
    echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:1598: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"\${ac_cv_prog_CXXCPP+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 1611 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1616: \"$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*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
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

fi
CXXCPP="$ac_cv_prog_CXXCPP"
fi
echo "$ac_t""$CXXCPP" 1>&6

    if test "$WANT_IMPI" = "yes"; then
	
#
# See if the compiler has STL
#
# Set LAM_CXX_STL to 1 if so, 0 if not
# AC_DEFINE LAM_CXX_STL to 1 if so, 0 if not
#


ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

ac_safe=`echo "map" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for map""... $ac_c" 1>&6
echo "configure:1660: checking for map" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1665 "configure"
#include "confdefs.h"
#include <map>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1670: \"$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
  LAM_CXX_STL=1
else
  echo "$ac_t""no" 1>&6
LAM_CXX_STL=0
fi

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

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

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

	if test "$LAM_CXX_STL" = "0"; then
	    echo "configure: warning: *** Your C++ compiler does not seem to support the STL." 1>&2
	    echo "configure: warning: *** STL support is necessary to compile the IMPI extensions" 1>&2
	    echo "configure: warning: *** to LAM/MPI.  Either choose a C++ compiler that supports" 1>&2
	    echo "configure: warning: *** STL, or configure --without-impi." 1>&2
	    { echo "configure: error: cannot continue" 1>&2; exit 1; }
	fi
	
#
# See if the compiler makes template repository directories
# Warning: this is a really screwy example! -JMS
#
# Sets TEMPLATE_REP to the directory name, or blank
# Does AC_SUBST on TEMPLATE_REP
#

echo $ac_n "checking for template repository directory""... $ac_c" 1>&6
echo "configure:1727: checking for template repository directory" >&5
mkdir conf_tmp_$$
cd conf_tmp_$$
cat > conftest.h <<EOF
template <class T>
class foo {
public:
  foo(T yow) : data(yow) { yow.member(3); };
  void member(int i);
private:
  T data;
};

class bar {
public:
  bar(int i) { data = i; };
  void member(int j) { data = data * j; };

private:
  int data;
};
EOF

cat > conftest2.C <<EOF
#include "conftest.h"

void
some_other_function(void)
{
  foo<bar> var1(6);
  foo< foo<bar> > var2(var1);
}
EOF

cat > conftest1.C <<EOF
#include "conftest.h"

void some_other_function(void);

template <class T>
void
foo<T>::member(int i)
{
  i += 2;
}

int
main(int argc, char *argv)
{
  foo<bar> var1(6);
  foo< foo<bar> > var2(var1);

  some_other_function();
  return 0;
}
EOF

echo configure:1784: $CXX -c conftest1.C >&5
$CXX -c conftest1.C >/dev/null 2>/dev/null
if test ! -f conftest1.o ; then
    echo "$ac_t""templates not supported?" 1>&6
    echo configure:1788: here is the program that failed: >&5
    cat conftest1.C >&5
    echo configure:1790: here is conftest.h: >&5
    cat conftest.h >&5
else
    echo configure:1793: $CXX -c conftest2.C >&5
    $CXX -c conftest2.C >/dev/null 2>/dev/null
    if test ! -f conftest2.o ; then
	echo "$ac_t""unknown error" 1>&6
	echo configure:1797: here is the program that failed: >&5
	cat conftest2.C >&5
	echo configure:1799: here is conftest.h: >&5
	cat conftest.h >&5
    else
	rm -rf conftest*

	for file in `ls`
	do
	    if test "$file" != "." -a "$file" != ".."; then
		# Is it a directory?
		if test -d "$file"; then
		    TEMPLATE_DIR="$file $TEMPLATE_DIR"
		    
		# Or is it a file?
		else
		    name="`echo $file | cut -d. -f1`"
		    
		    temp_mask=
		    if test "$name" = "main" -o "$name" = "other"; then
			temp_mask="`echo $file | cut -d. -f2`"
			if test "$TEMPLATE_FILEMASK" = ""; then
			TEMPLATE_FILEMASK="$temp_mask";
			elif test "`echo $TEMPLATE_FILEMASK | grep $temp_mask`" = ""; then
			TEMPLATE_FILEMASK="$TEMPLATE_FILEMASK $temp_mask"
			fi
		    fi
		fi
	    fi
	done
	if test "$TEMPLATE_FILEMASK" != ""; then
	    temp_mask=
	    for mask in $TEMPLATE_FILEMASK
	    do
		temp_mask="*.$mask $temp_mask"
	    done
	    TEMPLATE_FILEMASK=$temp_mask
	fi
    fi
fi
TEMPLATE_REP="$TEMPLATE_DIR $TEMPLATE_FILEMASK"

if test "$TEMPLATE_REP" != "" -a "$TEMPLATE_REP" != " "; then
    echo "$ac_t""$TEMPLATE_REP" 1>&6
else
    echo "$ac_t""not used" 1>&6
fi
cd ..
rm -rf conf_tmp_$$

	
#
# Check to see if the C++ compiler has the bool type.  <sigh>
#
# Defines LAM_HAVE_BOOL to be 1 or 0
#

if test "$?CXXFLAGS" = 0; then
    CXXFLAGS=""
fi
echo $ac_n "checking for type bool""... $ac_c" 1>&6
echo "configure:1858: checking for type bool" >&5
rm -f conftest.cc conftest.o
cat > conftest.cc <<EOF
#include <stdio.h>
#include <sys/types.h>

int main(int argc, char* argv) {
  bool foo = (bool) 0;
  printf("so foo is used and the compiler wont complain: %d", (int) foo);
  return 0;
}
EOF
echo configure:1870: $CXX $CXXFLAGS conftest.cc -o conftest >&5 
$CXX $CXXFLAGS conftest.cc -o conftest >&5 2>&5
if test -f conftest; then
    cat >> confdefs.h <<\EOF
#define LAM_HAVE_BOOL 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo configure:1879: here is the program that failed: >&5
    cat conftest.cc >&5
    cat >> confdefs.h <<\EOF
#define LAM_HAVE_BOOL 0
EOF

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

	
#
# Check to see if the C++ compiler has "true" and "false" defined.  <sigh>
#
# Defines LAM_HAVE_TRUE_FALSE to be 1 or 0
#

if test "$?CXXFLAGS" = 0; then
    CXXFLAGS=""
fi
echo $ac_n "checking for true/false""... $ac_c" 1>&6
echo "configure:1900: checking for true/false" >&5
rm -f conftest.cc conftest.o
cat > conftest.cc <<EOF
#include <stdio.h>
#include <sys/types.h>

int main(int argc, char* argv) {
  int foo;
  foo = (int) true;
  foo = (int) false;
  printf("so foo is used and the compiler wont complain: %d", (int) foo);
  return 0;
}
EOF
echo configure:1914: $CXX $CXXFLAGS conftest.cc -o conftest >&5 
$CXX $CXXFLAGS conftest.cc -o conftest >&5 2>&5
if test -f conftest; then
    cat >> confdefs.h <<\EOF
#define LAM_HAVE_TRUE_FALSE 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo configure:1923: here is the program that failed: >&5
    cat conftest.cc >&5
    cat >> confdefs.h <<\EOF
#define LAM_HAVE_TRUE_FALSE 0
EOF

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

    fi

    case "$host" in
    *hpux*)
	if test "$CXX" = "CC"; then
	    echo "configure: warning: *** You will probably have problems compiling the MPI 2" 1>&2
	    echo "configure: warning: *** C++ bindings with the CC compiler.  You should probably" 1>&2
	    echo "configure: warning: *** be using the aCC compiler.  Set the CXX environment" 1>&2
	    echo "configure: warning: *** variable to "aCC" and run ./configure again." 1>&2
	fi
	;;
    esac
fi






cat >> confdefs.h <<EOF
#define LAM_CC "$CC"
EOF


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


if test -n "$with_ldflags"; then
    USER_LDFLAGS=$with_ldflags;
else
    USER_LDFLAGS=$CFLAGS
fi

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


if test -n "$with_cppldflags"; then
    USER_CXXLDFLAGS=$with_cppldflags;
else
    USER_CXXLDFLAGS=$CXXFLAGS
fi

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


if test -n "$with_fc"; then
    if test "$with_fc" != no; then
	FC=$with_fc
    fi
fi

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


if test -n "$with_fflags"; then
    FFLAGS=$with_fflags;
fi

for ac_prog in makedepend
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:2012: checking for $ac_word" >&5
if eval "test \"\${ac_cv_prog_MAKEDEPEND+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MAKEDEPEND"; then
  ac_cv_prog_MAKEDEPEND="$MAKEDEPEND" # 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_MAKEDEPEND="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MAKEDEPEND="$ac_cv_prog_MAKEDEPEND"
if test -n "$MAKEDEPEND"; then
  echo "$ac_t""$MAKEDEPEND" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKEDEPEND" && break
done
test -n "$MAKEDEPEND" || MAKEDEPEND="no"

MAXDEPFILES=1024
if test "$MAKEDEPEND" = "no"; then
    DEPENDRULE=depend-mkdep
else
    DEPENDRULE=depend-makedepend
    if test "`echo $host | grep solaris2`" != ""; then
      # Solaris makedepend can't handle all the files in share/mpi for 
      # some reason, so we have to use the slower, manual method
      MAXDEPFILES=64
    fi
fi
DEPENDRULE=depend-mkdep



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


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


if test "$with_shared" = yes; then
  LIBDEPSFX=so
  case $host in
    *linux*)
      LIB='$(LIBNAME).so.$(MAJOR).$(MINOR)'
      MAKELIB='$(CC) -shared -Wl,-soname,$(LIBNAME).so.$(MAJOR) -o $(LIB) $(OBJ)'
      RANSYMLIB='cd $(OLDIR); $(RM) $(LIBNAME).so $(LIBNAME).so.$(MAJOR); ln -s $(LIB) $(LIBNAME).so.$(MAJOR); ln -s $(LIBNAME).so.$(MAJOR) $(LIBNAME).so'
      LIBBIND='$(USER_LDFLAGS) -Wl,-rpath,$(OLDIR)'
      HBIND='-Wl,-rpath,$(OLDIR)'
      SYSLIBS=
      LIBSUFFIX='so.$(MAJOR).$(MINOR)'
	;;
    *solaris*)
      LIB='$(LIBNAME).so.$(MAJOR)'
      MAKELIB='$(CC) $(USER_LDFLAGS) -G -h $(LIB) $(OBJ) -o $(LIB)'
      RANSYMLIB='cd $(OLDIR); $(RM) $(LIBNAME).so; ln -s $(LIB) $(LIBNAME).so'
      LIBBIND='$(USER_LDFLAGS) -R$(OLDIR)'
      HBIND='-R$(OLDIR)'
      SYSLIBS='-lsocket -lnsl -lgen'
      LIBSUFFIX='so.$(MAJOR)'
	;;
    *) { echo "configure: error: LAM shared libs not supported for architecture $host" 1>&2; exit 1; }
	;;
  esac
else
  LIB='$(LIBNAME).a'
  MAKELIB='$(RM) $(LIB); $(AR) $(AFLAGS) $(LIB) $(OBJ); $(RANLIB) $(LIB)'
  RANSYMLIB='$(RANLIB) $(OLDIR)/$(LIB)'
  LIBBIND='$(USER_LDFLAGS)'
  HBIND=
  LIBSUFFIX=a
  LIBDEPSFX=a
  SYSLIBS=

  case $host in
    *solaris*) SYSLIBS='-lsocket -lnsl -lgen' 
		;;
    *irix*) if test "$ac_cv_prog_gcc" = no; then
		LIBBIND='$(USER_LDFLAGS) -Wl,-woff,84'
		HBIND='$(USER_LDFLAGS) -Wl,-woff,84'
	    fi	;;
  esac
fi










echo $ac_n "checking which RPI to use""... $ac_c" 1>&6
echo "configure:2125: checking which RPI to use" >&5
if test -z "$with_rpi"; then
  echo "$ac_t""tcp (default)" 1>&6
  rpi=tcp
else
  if test "$with_rpi" = yes; then
    echo "$ac_t""tcp (default)" 1>&6
    rpi=tcp
  else
    rpi=$with_rpi
    if test "$rpi" = "sysv" -o "$rpi" = "usysv" -o "$rpi" = "tcp"; then
      echo "$ac_t""$rpi" 1>&6
    else
      echo "$ac_t""RPI $rpi does not exist." 1>&6
      { echo "configure: error: See the INSTALL and RELEASE_NOTES files for details." 1>&2; exit 1; }
    fi
  fi
fi

RPISRC=
RPIOBJ=
case $rpi in
  tcp)	RPISRC='rpi.tcp.c tcp.low.c'
	RPIOBJ='rpi.tcp.o tcp.low.o'
	cat >> confdefs.h <<\EOF
#define LAM_RPI_TCP 1
EOF

    ;;
  sysv) RPISRC='rpi.shm.c tcp.low.c shm.common.c shm.low.c shm.sysv.c'
	RPIOBJ='rpi.shm.o tcp.low.o shm.common.o shm.low.o shm.sysv.o'
	cat >> confdefs.h <<\EOF
#define LAM_RPI_SHM_SYSV 1
EOF

    ;;
  usysv) RPISRC='rpi.ushm.c tcp.low.c shm.common.c shm.ulow.c shm.usysv.c'
	RPIOBJ='rpi.ushm.o tcp.low.o shm.common.o shm.ulow.o shm.usysv.o'
	cat >> confdefs.h <<\EOF
#define LAM_RPI_SHM_USYSV 1
EOF

    ;;
  *) { echo "configure: error: unknown RPI \"$rpi\"" 1>&2; exit 1; }
esac

cat >> confdefs.h <<EOF
#define LAM_RPI "$rpi"
EOF


RPIFLAGS=
# Check whether --with-shortcircuit or --without-shortcircuit was given.
if test "${with_shortcircuit+set}" = set; then
  withval="$with_shortcircuit"
  :
else
  
case "$rpi" in
    tcp|sysv|usysv) RPIFLAGS="-DSHORTCIRCUIT" 
    ;;
esac
fi






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

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

fi

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

if test -n "$with_signal"; then
    case "$with_signal" in
	SIG*) cat >> confdefs.h <<EOF
#define LAM_SIGUSR $with_signal
EOF
;;
	yes) ;;
	*) { echo "configure: error: invalid signal $with_signal" 1>&2; exit 1; };;
    esac
fi

check_opt() {
    arg="$1"
    bad=0
    for word in $arg; do
	case $word in
	-g)    bad=1 ;;
	+K0)   bad=1 ;;
	+K1)   bad=1 ;;
	+K2)   bad=1 ;;
	+K3)   bad=1 ;;
	+K4)   bad=1 ;;
	+K5)   bad=1 ;;
	-O)    bad=1 ;;
	-O0)   bad=1 ;;
	-O1)   bad=1 ;;
	-O2)   bad=1 ;;
	-O3)   bad=1 ;;
	-O4)   bad=1 ;;
	-O5)   bad=1 ;; 
	-O6)   bad=1 ;;
	-O7)   bad=1 ;;
	-O8)   bad=1 ;;
	-O9)   bad=1 ;;
	-xO)   bad=1 ;;
	-xO0)  bad=1 ;;
	-xO1)  bad=1 ;;
	-xO2)  bad=1 ;;
	-xO3)  bad=1 ;;
	-xO4)  bad=1 ;;
	-xO5)  bad=1 ;; 
	-xO6)  bad=1 ;;
	-xO7)  bad=1 ;;
	-xO8)  bad=1 ;;
	-xO9)  bad=1 ;;
	-fast) bad=1 ;;
	esac
    done
    if test "$bad" = "0"; then
	result="$OPTFLAGS $arg"
    else
	result="$arg"
    fi
}

OPTFLAGS="-O"
check_opt "$lam_cflags_save"
CFLAGS=$result
check_opt "$lam_cxxflags_save"
CXXFLAGS=$result
check_opt "$FFLAGS"
FFLAGS=$result
# Since we're not doing -fast for Solaris anymore, we don't need to
# add -O to the LDFLAGS (checked the man pages on a couple of
# architectures, and this seems to be true).  So we'll just leave
# those alone.
#check_opt "$USER_LDFLAGS"
#USER_LDFLAGS=$result
#check_opt "$USER_CXXLDFLAGS"
#USER_CXXLDFLAGS=$result

ROMIO_FLAGS=
if test "$ac_cv_prog_gcc" = no; then
    us=`(uname -s) 2>/dev/null` || us=unknown
    case "$us" in
        HP-UX)	CPPFLAGS="$CPPFLAGS -Ae"
		ROMIO_FLAGS="+U77"
		if test "$lam_cflags_save" = set; then
			CFLAGS="-Ae"
		else
			CFLAGS="$CFLAGS -Ae"
		fi ;;
	*)	;;
    esac
fi








# Determine if compiler and options accepts ANSI prototypes.
echo $ac_n "checking whether the C compiler ($CC $CFLAGS) accepts ANSI prototypes""... $ac_c" 1>&6
echo "configure:2308: checking whether the C compiler ($CC $CFLAGS) accepts ANSI prototypes" >&5
cat > conftest.c <<EOF
static double foo(double bar) { return(2.0*bar); }
int main(int argc, char **argv)
{ double x; x = foo(2.0); return(0); }
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_ansi_protos=yes
else
    lam_ac_ansi_protos=no
fi
echo "$ac_t""$lam_ac_ansi_protos" 1>&6
/bin/rm -f conftest*
if test "$lam_ac_ansi_protos" = no; then
    { echo "configure: error: LAM requires a compiler which understands ANSI C prototypes" 1>&2; exit 1; }
fi

us=`(uname -s) 2>/dev/null` || us=unknown
case "$us" in
    HP-UX) FLIBPATH="-Wl,-L" ;;
	*) FLIBPATH="-L" ;;
esac


FCOMPILER=
ROMIO_NOF77=
WAVE1D_EXAMPLE=
TRIVIALF_EXAMPLE=
ROMIO_FAKE_F77=
echo $ac_n "checking if want FORTRAN support""... $ac_c" 1>&6
echo "configure:2339: checking if want FORTRAN support" >&5
if test "$with_fc" = no; then
  FCOMPILER=false
  LAM_F77="false"
  ROMIO_NOF77="-nof77"
  ROMIO_FAKE_F77="romio-fake-f77"
  echo "$ac_t""no" 1>&6
else
  echo "$ac_t""yes" 1>&6
  if test -n "$FC"; then
    unset ac_cv_prog_FCOMPILER
    ISABS=`echo $FC | cut -c1`
    set $FC; FC0=$1
    if test "$ISABS" = "/" -a -x "$FC0"; then
      FCOMPILER="$FC"
      echo $ac_n "checking for FORTRAN compiler $FC0""... $ac_c" 1>&6
echo "configure:2355: checking for FORTRAN compiler $FC0" >&5
      echo "$ac_t""found" 1>&6
    else
      for ac_prog in $FC0
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:2363: checking for $ac_word" >&5
if eval "test \"\${ac_cv_prog_FCOMPILER+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$FCOMPILER"; then
  ac_cv_prog_FCOMPILER="$FCOMPILER" # 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_FCOMPILER="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
FCOMPILER="$ac_cv_prog_FCOMPILER"
if test -n "$FCOMPILER"; then
  echo "$ac_t""$FCOMPILER" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$FCOMPILER" && break
done

    fi
    if test -z "$FCOMPILER"; then
      { echo "configure: error: could not find FORTRAN compiler $FC0" 1>&2; exit 1; }
    fi
  else
    for ac_prog in f77 fort77 g77 f90
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:2402: checking for $ac_word" >&5
if eval "test \"\${ac_cv_prog_FCOMPILER+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$FCOMPILER"; then
  ac_cv_prog_FCOMPILER="$FCOMPILER" # 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_FCOMPILER="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
FCOMPILER="$ac_cv_prog_FCOMPILER"
if test -n "$FCOMPILER"; then
  echo "$ac_t""$FCOMPILER" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$FCOMPILER" && break
done
test -n "$FCOMPILER" || FCOMPILER="no"

    if test -z "$FCOMPILER" -o "$FCOMPILER" = "no"; then
      echo "configure: warning: *** Could not find FORTRAN compiler.  Either use" 1>&2
      echo "configure: warning: *** --with-fc to specify the FORTRAN compiler, or" 1>&2
      echo "configure: warning: *** --without-fc to specify no FORTRAN support" 1>&2
      { echo "configure: error: cannot continue current configuration without FORTRAN compiler" 1>&2; exit 1; }
    fi
  fi
  LAM_F77="$FCOMPILER"
  WAVE1D_EXAMPLE=wave1d
  TRIVIALF_EXAMPLE=trivialf
fi
cat >> confdefs.h <<EOF
#define LAM_F77 "$LAM_F77"
EOF






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

if test "$with_pthread_lock" = yes; then
    case "$rpi" in
	usysv) 
echo $ac_n "checking for process shared pthread mutex""... $ac_c" 1>&6
echo "configure:2463: checking for process shared pthread mutex" >&5
if test "$cross_compiling" = yes; then
  lam_ac_mutex_pshared=no
else
  cat > conftest.$ac_ext <<EOF
#line 2468 "configure"
#include "confdefs.h"
#include <pthread.h>
int main(int argc, char* argv[]) {
  pthread_mutex_t m; pthread_mutexattr_t mattr;
  if (pthread_mutexattr_init(&mattr)) return(1);
  if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) return(1);
  if (pthread_mutex_init(&m, &mattr)) return(-1);
  return(0);
}
EOF
if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  lam_ac_mutex_pshared=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  lam_ac_mutex_pshared=no
fi
rm -fr conftest*
fi

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

	       if test "$lam_ac_mutex_pshared" = no; then
		    echo 'ignoring --with-pthread-lock'
		else
		    RPIFLAGS="$RPIFLAGS -DPTHREAD_FREELOCK"
		    RPISYSLIBS="$RPISYSLIBS -lpthread"
		fi ;;
	*) echo "configure: warning: use of pthread mutex lock not supported in RPI $rpi" 1>&2 ;;
     esac
fi




echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2507: 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 \"\${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 2522 "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:2528: \"$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 2539 "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:2545: \"$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 2556 "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:2562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

if test "$CPP" = ""; then
    { echo "configure: error: Could not find C preprocessor.  Cannot continue." 1>&2; exit 1; }
fi

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:2591: checking whether ln -s works" >&5
if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$LN_S" = ""; then
    { echo "configure: error: Could not find command for symbolic links (ln).  Cannot continue." 1>&2; exit 1; }
fi

# 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:2618: checking for $ac_word" >&5
if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test "$RANLIB" = ""; then
    { echo "configure: error: Could not find ranlib.  Cannot continue." 1>&2; exit 1; }
fi

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

if test "$AR" = ""; then
    { echo "configure: error: Could not find ar.  Cannot continue." 1>&2; exit 1; }
fi

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

if test "$CP" = ""; then
    { echo "configure: error: Could not find cp.  Cannot continue." 1>&2; exit 1; }
fi

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

if test "$RM" = ""; then
    { echo "configure: error: Could not find rm.  Cannot continue." 1>&2; exit 1; }
fi

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

if test "$SED" = ""; then
    { echo "configure: error: Could not find sed.  Cannot continue." 1>&2; exit 1; }
fi

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

if test "$SHELL_CMD" = ""; then
    { echo "configure: error: Could not find Bourne shell.  Cannot continue." 1>&2; exit 1; }
fi

RSH0=
RSH=
# Check whether --with-rsh or --without-rsh was given.
if test "${with_rsh+set}" = set; then
  withval="$with_rsh"
  
case "$withval" in
    /*) RSH0=$withval
	;;
    *)  RSH0=`echo $withval | awk '{ print $1 }'`
	RSH="`echo $withval | cut -d\  -f2-`"
        # Extract the first word of "$withval", so it can be a program name with args.
set dummy $withval; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2858: checking for $ac_word" >&5
if eval "test \"\${ac_cv_path_RSH0+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$RSH0" in
  /*)
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_RSH0="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
RSH0="$ac_cv_path_RSH0"
if test -n "$RSH0"; then
  echo "$ac_t""$RSH0" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	;;
esac
else
  
us=`(uname -s) 2>/dev/null` || us=unknown
case "$us" in
    HP-UX) # Extract the first word of "remsh", so it can be a program name with args.
set dummy remsh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2899: checking for $ac_word" >&5
if eval "test \"\${ac_cv_path_RSH0+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$RSH0" in
  /*)
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_RSH0="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
RSH0="$ac_cv_path_RSH0"
if test -n "$RSH0"; then
  echo "$ac_t""$RSH0" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 
	;;
    *) # Extract the first word of "rsh", so it can be a program name with args.
set dummy rsh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2935: checking for $ac_word" >&5
if eval "test \"\${ac_cv_path_RSH0+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$RSH0" in
  /*)
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_RSH0="$RSH0" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_RSH0="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
RSH0="$ac_cv_path_RSH0"
if test -n "$RSH0"; then
  echo "$ac_t""$RSH0" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 
	;;
esac
fi


echo $ac_n "checking for remote shell command""... $ac_c" 1>&6
echo "configure:2973: checking for remote shell command" >&5
if test -z "$RSH0"; then
    { echo "configure: error: could not find remote shell command" 1>&2; exit 1; }
fi
echo "$ac_t""$RSH0 $RSH" 1>&6
RSH="\"$RSH0 $RSH\""


if test -z "$SOFLAGS"; then
  if test "$with_shared" = yes; then
    if test "$GCC" = yes; then
      SOFLAGS=-fPIC
    else
      SOFLAGS=-Kpic
    fi
  else
    SOFLAGS=
  fi
fi



if test "`echo $host | grep solaris2`" != "" -a "$CC" = "cc"; then
    cat >> confdefs.h <<\EOF
#define LAM_CONFIG_FORCE_PROTOS 1
EOF

elif test "$CC" = "gcc"; then
    cat >> confdefs.h <<\EOF
#define LAM_CONFIG_FORCE_PROTOS 1
EOF

else
    # At least some compilers don't want to be forced -- e.g., HP-UX 10.20
    # which is not ANSI by default
    cat >> confdefs.h <<\EOF
#define LAM_CONFIG_FORCE_PROTOS 0
EOF

    
# Check to see if compiler sets __STDC__ to 1 or not
echo $ac_n "checking for __STDC__""... $ac_c" 1>&6
echo "configure:3015: checking for __STDC__" >&5
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
#ifndef __STDC__
#define __STDC__ -1
#endif
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, "%d\n", __STDC__);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_stdc=`cat conftestval`
    echo "$ac_t""$lam_ac_stdc" 1>&6
    if test "$lam_ac_stdc" = "0"; then
	echo "configure: warning: *** Compiler did not set __STDC__ to 1!" 1>&2
	echo "configure: warning: *** Be warned -- this will cause user MPI programs to" 1>&2
	echo "configure: warning: *** not get proper prototypes of MPI functions!" 1>&2
    elif test "$lam_ac_stdc" = "-1"; then
	echo "configure: warning: *** Compiler did not set __STDC__!" 1>&2
	echo "configure: warning: *** Be warned -- this will cause user MPI programs to" 1>&2
	echo "configure: warning: *** not get proper prototypes of MPI functions!" 1>&2
    fi
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo $ac_n "checking if want purify clean""... $ac_c" 1>&6
echo "configure:3053: checking if want purify clean" >&5
WANT_PURIFY=no
# Check whether --with-purify or --without-purify was given.
if test "${with_purify+set}" = set; then
  withval="$with_purify"
  WANT_PURIFY=$withval
fi

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

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

fi
echo "$ac_t""$WANT_PURIFY" 1>&6

TCPSHORT=65536
SHMSHORT=8192
SHMPOOL=0
SHMALLOC=0

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

if test -n "$with_tcp_short"; then
    TCPSHORT=$with_tcp_short
fi
echo $ac_n "checking for TCP short message length""... $ac_c" 1>&6
echo "configure:3089: checking for TCP short message length" >&5
echo "$ac_t""$TCPSHORT bytes" 1>&6

case "$rpi" in 
  *sysv)
    # Check whether --with-shmshort or --without-shmshort was given.
if test "${with_shmshort+set}" = set; then
  withval="$with_shmshort"
  :
fi

    if test -n "$with_shm_short"; then
	SHMSHORT=$with_shm_short
    fi

    echo using shared memory short message length of $SHMSHORT bytes

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

    if test -n "$with_shm_poolsize"; then
	SHMPOOL=$with_shm_poolsize
        echo using shared memory pool of $SHMPOOL bytes
    fi

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

    if test -n "$with_shm_maxalloc"; then
	SHMALLOC=$with_shm_maxalloc
        echo using maximum shared memory allocation of $SHMALLOC bytes
    fi

    if test -z "$with_shm_poolsize"; then
	if test -z "$with_shm_maxalloc"; then
	    lam_echo "determining shared memory poolsize"
	    
# Determine maximum shared segment size.
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define LAM_SHMSHORT $SHMSHORT
#define LAM_SHMPOOL $SHMPOOL
#define MB (1024*1024)
int
test_alloc(int size)
{
    char		*base;
    int			shmid;
    shmid = shmget(IPC_PRIVATE, size, 0600 | IPC_CREAT);
    if (shmid < 0) return(0);
    base = (char *) shmat(shmid, (char *) 0, 0);
    if (base == (char *) -1) {
	shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
	return(0);
    }
    shmdt(base);
    shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
    return(1);
}
int
main(int argc, char* argv)
{
    int	poolsize, maxalloc;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    if (LAM_SHMPOOL > 0) {
	if (LAM_SHMPOOL >= 2 * MB) maxalloc = MB;
	else maxalloc = LAM_SHMPOOL;
        fprintf(f, "%d\t%d\t%d\n", 0, LAM_SHMPOOL, maxalloc);
	fclose(f);
	return(0);    
    }
    if (test_alloc(32*MB)) { poolsize = 16*MB; maxalloc = MB; }
    else if (test_alloc(16*MB)) { poolsize = 14*MB; maxalloc = MB; }
    else if (test_alloc(8*MB)) { poolsize = 6*MB; maxalloc = MB; }
    else if (test_alloc(4*MB)) { poolsize = 2*MB; maxalloc = MB; }
    else if (test_alloc(2*MB)) { poolsize = MB; maxalloc = MB/2; }
    else if (test_alloc(MB)) { 
	poolsize = MB - (8*7 * (LAM_SHMSHORT+128)) - 256; 
	if (poolsize < 0) poolsize =  MB - (4*3 * (LAM_SHMSHORT+128)) - 256;
	if (poolsize < 0) poolsize = 0; 
        maxalloc = poolsize; }
    else { poolsize = 0; maxalloc = 0; }
    fprintf(f, "%d\t%d\n", poolsize, maxalloc);
    fclose(f);
    return(0);
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    if test $SHMPOOL -eq 0; then
	SHMPOOL=`cat conftestval | cut -f1`
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=`cat conftestval | cut -f2`
    fi
else
    echo
    echo "configure: warning: error compiling/running conftest" 1>&2
    lam_echo "using default of"
    if test $SHMPOOL -eq 0; then
	SHMPOOL=524288
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=524288
    fi
fi
/bin/rm -f conftest*
	    echo $SHMPOOL bytes
	    lam_echo "determining shared memory maxalloc"
	    echo $SHMALLOC bytes
	else
	    lam_echo "determining shared memory poolsize"
	    
# Determine maximum shared segment size.
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define LAM_SHMSHORT $SHMSHORT
#define LAM_SHMPOOL $SHMPOOL
#define MB (1024*1024)
int
test_alloc(int size)
{
    char		*base;
    int			shmid;
    shmid = shmget(IPC_PRIVATE, size, 0600 | IPC_CREAT);
    if (shmid < 0) return(0);
    base = (char *) shmat(shmid, (char *) 0, 0);
    if (base == (char *) -1) {
	shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
	return(0);
    }
    shmdt(base);
    shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
    return(1);
}
int
main(int argc, char* argv)
{
    int	poolsize, maxalloc;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    if (LAM_SHMPOOL > 0) {
	if (LAM_SHMPOOL >= 2 * MB) maxalloc = MB;
	else maxalloc = LAM_SHMPOOL;
        fprintf(f, "%d\t%d\t%d\n", 0, LAM_SHMPOOL, maxalloc);
	fclose(f);
	return(0);    
    }
    if (test_alloc(32*MB)) { poolsize = 16*MB; maxalloc = MB; }
    else if (test_alloc(16*MB)) { poolsize = 14*MB; maxalloc = MB; }
    else if (test_alloc(8*MB)) { poolsize = 6*MB; maxalloc = MB; }
    else if (test_alloc(4*MB)) { poolsize = 2*MB; maxalloc = MB; }
    else if (test_alloc(2*MB)) { poolsize = MB; maxalloc = MB/2; }
    else if (test_alloc(MB)) { 
	poolsize = MB - (8*7 * (LAM_SHMSHORT+128)) - 256; 
	if (poolsize < 0) poolsize =  MB - (4*3 * (LAM_SHMSHORT+128)) - 256;
	if (poolsize < 0) poolsize = 0; 
        maxalloc = poolsize; }
    else { poolsize = 0; maxalloc = 0; }
    fprintf(f, "%d\t%d\n", poolsize, maxalloc);
    fclose(f);
    return(0);
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    if test $SHMPOOL -eq 0; then
	SHMPOOL=`cat conftestval | cut -f1`
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=`cat conftestval | cut -f2`
    fi
else
    echo
    echo "configure: warning: error compiling/running conftest" 1>&2
    lam_echo "using default of"
    if test $SHMPOOL -eq 0; then
	SHMPOOL=524288
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=524288
    fi
fi
/bin/rm -f conftest*
	    echo $SHMPOOL bytes
	fi
    else
	if test -z "$with_shm_maxalloc"; then
	    lam_echo "determining shared memory maxalloc"
	    
# Determine maximum shared segment size.
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define LAM_SHMSHORT $SHMSHORT
#define LAM_SHMPOOL $SHMPOOL
#define MB (1024*1024)
int
test_alloc(int size)
{
    char		*base;
    int			shmid;
    shmid = shmget(IPC_PRIVATE, size, 0600 | IPC_CREAT);
    if (shmid < 0) return(0);
    base = (char *) shmat(shmid, (char *) 0, 0);
    if (base == (char *) -1) {
	shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
	return(0);
    }
    shmdt(base);
    shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0);
    return(1);
}
int
main(int argc, char* argv)
{
    int	poolsize, maxalloc;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    if (LAM_SHMPOOL > 0) {
	if (LAM_SHMPOOL >= 2 * MB) maxalloc = MB;
	else maxalloc = LAM_SHMPOOL;
        fprintf(f, "%d\t%d\t%d\n", 0, LAM_SHMPOOL, maxalloc);
	fclose(f);
	return(0);    
    }
    if (test_alloc(32*MB)) { poolsize = 16*MB; maxalloc = MB; }
    else if (test_alloc(16*MB)) { poolsize = 14*MB; maxalloc = MB; }
    else if (test_alloc(8*MB)) { poolsize = 6*MB; maxalloc = MB; }
    else if (test_alloc(4*MB)) { poolsize = 2*MB; maxalloc = MB; }
    else if (test_alloc(2*MB)) { poolsize = MB; maxalloc = MB/2; }
    else if (test_alloc(MB)) { 
	poolsize = MB - (8*7 * (LAM_SHMSHORT+128)) - 256; 
	if (poolsize < 0) poolsize =  MB - (4*3 * (LAM_SHMSHORT+128)) - 256;
	if (poolsize < 0) poolsize = 0; 
        maxalloc = poolsize; }
    else { poolsize = 0; maxalloc = 0; }
    fprintf(f, "%d\t%d\n", poolsize, maxalloc);
    fclose(f);
    return(0);
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    if test $SHMPOOL -eq 0; then
	SHMPOOL=`cat conftestval | cut -f1`
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=`cat conftestval | cut -f2`
    fi
else
    echo
    echo "configure: warning: error compiling/running conftest" 1>&2
    lam_echo "using default of"
    if test $SHMPOOL -eq 0; then
	SHMPOOL=524288
    fi
    if test $SHMALLOC -eq 0; then
	SHMALLOC=524288
    fi
fi
/bin/rm -f conftest*
	    echo $SHMALLOC bytes
	fi
    fi

    if test \( $SHMPOOL -eq 0 \) -o \( $SHMALLOC -eq 0 \); then
	{ echo "configure: error: determining shared memory parameters
Please check that your system supports SYSV shared 
memory segments of 1MB or more.
You can also try explicitly setting both the poolsize and 
maxalloc parameters." 1>&2; exit 1; }
    fi ;;
esac






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

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

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

fi
fi

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

fi


for ac_func in atexit getcwd yield snprintf atoll strtoll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3478: checking for $ac_func" >&5
if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3483 "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();
char (*f)();

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
f = $ac_func;
#endif

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

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



echo $ac_n "checking for prototype of snprintf""... $ac_c" 1>&6
echo "configure:3534: checking for prototype of snprintf" >&5
func=snprintf
rm -f conftest.c
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <netdb.h>
#include <unistd.h>

int main(int argc, char **argv)
{ return 0; }
EOF
echo configure:3549: $CPP $CFLAGS conftest.c >&5
$CPP $CFLAGS conftest.c > conftest.out 2>&5
e1="egrep '[^A-Za-z0-9_]$func[	 ]*\(' conftest.out"
e2="egrep '^$func[	 ]*\(' conftest.out"
if test "`eval $e1`" != "" -o "`eval $e2`" != ""; then
    cat >> confdefs.h <<EOF
#define LAM_HAVE_${func}_PROTO 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo configure:3560: here is the program that failed: >&5
    cat conftest.c >&5
    cat >> confdefs.h <<EOF
#define LAM_HAVE_${func}_PROTO 0
EOF

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


echo $ac_n "checking for prototype of gethostname""... $ac_c" 1>&6
echo "configure:3572: checking for prototype of gethostname" >&5
func=gethostname
rm -f conftest.c
cat > conftest.c <<EOF
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <strings.h>
#include <netdb.h>
#include <unistd.h>

int main(int argc, char **argv)
{ return 0; }
EOF
echo configure:3587: $CPP $CFLAGS conftest.c >&5
$CPP $CFLAGS conftest.c > conftest.out 2>&5
e1="egrep '[^A-Za-z0-9_]$func[	 ]*\(' conftest.out"
e2="egrep '^$func[	 ]*\(' conftest.out"
if test "`eval $e1`" != "" -o "`eval $e2`" != ""; then
    cat >> confdefs.h <<EOF
#define LAM_HAVE_${func}_PROTO 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo configure:3598: here is the program that failed: >&5
    cat conftest.c >&5
    cat >> confdefs.h <<EOF
#define LAM_HAVE_${func}_PROTO 0
EOF

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


case $host in
    *solaris*) 
# Determine if function taking void args is available. 
# First arg is function, 2nd arg is config var to define, 3rd arg is options
# to add to link line.
echo $ac_n "checking for sched_yield""... $ac_c" 1>&6
echo "configure:3615: checking for sched_yield" >&5
/bin/rm -f conftest*
cat > conftest.c <<EOF
int main(int argc, char* argv) { sched_yield(); return(0); }
EOF
$CC $CFLAGS -o conftest conftest.c -lposix4 1>&5 2>&1
if test -s conftest && ./conftest 2>/dev/null; then
    cat >> confdefs.h <<\EOF
#define HAVE_SCHED_YIELD 1
EOF

    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
fi
/bin/rm -f conftest*
	;;
    *) for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3635: checking for $ac_func" >&5
if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3640 "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();
char (*f)();

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
f = $ac_func;
#endif

; 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*
  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

	;;
esac

# #$%^#$%^$#%^ IRIX 7.3 MIPSpro compilers...
have_sys_types=1
if test "`grep sys/types.h confdefs.h`" = ""; then
    echo "#include <sys/types.h>" >> confdefs.h
    have_sys_types=0
fi
for ac_hdr in stropts.h grp.h netinet/tcp.h rpc/types.h rpc/xdr.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3701: checking for $ac_hdr" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3706 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3711: \"$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

if test "$have_sys_types" = "0"; then
    rm -f confdefs.h.new
    grep -v sys/types.h confdefs.h > confdefs.h.new
    mv confdefs.h.new confdefs.h
fi
echo $ac_n "checking if SA_RESTART defined in signal.h""... $ac_c" 1>&6
echo "configure:3743: checking if SA_RESTART defined in signal.h" >&5
if eval "test \"\${lam_cv_def_sa_restart+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3748 "configure"
#include "confdefs.h"

#include <signal.h>
#ifdef SA_RESTART
    yes
#endif 
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  lam_cv_def_sa_restart=yes
else
  rm -rf conftest*
  lam_cv_def_sa_restart=no
fi
rm -f conftest*


fi

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

fi

echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
echo "configure:3778: checking for sa_len in struct sockaddr" >&5
if eval "test \"\${lam_cv_struct_sa_len+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3783 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
struct sockaddr s; s.sa_len;
; return 0; }
EOF
if { (eval echo configure:3791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_struct_sa_len=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_struct_sa_len=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for union semun in sys/sem.h""... $ac_c" 1>&6
echo "configure:3812: checking for union semun in sys/sem.h" >&5
if eval "test \"\${lam_cv_union_semun+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3817 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/sem.h>
int main() {
union semun s; s.val;
; return 0; }
EOF
if { (eval echo configure:3825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_union_semun=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_union_semun=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking if need to include sys/select.h""... $ac_c" 1>&6
echo "configure:3846: checking if need to include sys/select.h" >&5
if eval "test \"\${lam_cv_need_sys_select_h+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3851 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
fd_set s; FD_ZERO(&s);
; return 0; }
EOF
if { (eval echo configure:3859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_need_sys_select_h=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_need_sys_select_h=yes
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for BSD43 style file descriptor passing""... $ac_c" 1>&6
echo "configure:3880: checking for BSD43 style file descriptor passing" >&5
if eval "test \"\${lam_cv_have_bsd43_fd_passing+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3885 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
int main() {
struct msghdr m; m.msg_accrights = 0;
; return 0; }
EOF
if { (eval echo configure:3893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_have_bsd43_fd_passing=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_have_bsd43_fd_passing=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for BSD44 style file descriptor passing""... $ac_c" 1>&6
echo "configure:3914: checking for BSD44 style file descriptor passing" >&5
if eval "test \"\${lam_cv_have_bsd44_fd_passing+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3919 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
int main() {
struct cmsghdr c; c.cmsg_type = 0;
; return 0; }
EOF
if { (eval echo configure:3928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_have_bsd44_fd_passing=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_have_bsd44_fd_passing=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for SYSV style file descriptor passing""... $ac_c" 1>&6
echo "configure:3949: checking for SYSV style file descriptor passing" >&5
if eval "test \"\${lam_cv_have_sysv_fd_passing+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3954 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stropts.h>
int main() {
struct strrecvfd c; c.fd = 0;
; return 0; }
EOF
if { (eval echo configure:3963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  lam_cv_have_sysv_fd_passing=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  lam_cv_have_sysv_fd_passing=no
fi
rm -f conftest*
fi

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

fi

echo $ac_n "checking for BSD ptys""... $ac_c" 1>&6
echo "configure:3984: checking for BSD ptys" >&5
if eval "test \"\${lam_cv_have_bsd_ptys+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -r /dev/ptyp0 -a -w /dev/ptyp0; then
lam_cv_have_bsd_ptys=yes
else
lam_cv_have_bsd_ptys=no
fi
fi

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

fi

echo $ac_n "checking for SYSV ptys""... $ac_c" 1>&6
echo "configure:4004: checking for SYSV ptys" >&5
if eval "test \"\${lam_cv_have_sysv_ptys+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -r /dev/ptmx -a -w /dev/ptmx; then
lam_cv_have_sysv_ptys=yes
else
lam_cv_have_sysv_ptys=no
fi
fi

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

fi

if test $lam_cv_have_sysv_ptys = no -a $lam_cv_have_bsd_ptys = no; then
   echo "configure: warning: neither BSD or SYSV ptys are available" 1>&2
fi

for ac_hdr in sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:4031: checking for $ac_hdr" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4036 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4041: \"$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



# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type int2""... $ac_c" 1>&6
echo "configure:4072: checking for type int2" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "int2[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int2 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int2 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type uint2""... $ac_c" 1>&6
echo "configure:4107: checking for type uint2" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "uint2[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint2 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint2 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type int4""... $ac_c" 1>&6
echo "configure:4142: checking for type int4" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "int4[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int4 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int4 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type uint4""... $ac_c" 1>&6
echo "configure:4177: checking for type uint4" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "uint4[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint4 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint4 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type int8""... $ac_c" 1>&6
echo "configure:4212: checking for type int8" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "int8[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int8 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_int8 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type uint8""... $ac_c" 1>&6
echo "configure:4247: checking for type uint8" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "uint8[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint8 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_uint8 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type float4""... $ac_c" 1>&6
echo "configure:4282: checking for type float4" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "float4[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_float4 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_float4 0
EOF

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


# Autoconfs AC_CHECK_TYPE is not sufficient
# This, too, is not foolproof, but will have to do...
echo $ac_n "checking for type float8""... $ac_c" 1>&6
echo "configure:4317: checking for type float8" >&5
cat > conftest.$ac_ext <<EOF
#line 3411 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
touch conftest.out >&5 2>&5
rm -f conftest.out >&5 2>&5
eval "$ac_cpp conftest.$ac_ext" 2>&5 > conftest.out
egrep "float8[^a-zA-Z_0-9]" conftest.out > conftest.out2 2>&5
cat conftest.out2 >&5
out="`cat conftest.out2`"
if test "$out" != ""; then
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_float8 1
EOF

  echo "$ac_t""yes" 1>&6
else
  cat >> confdefs.h <<\EOF
#define LAM_HAVE_float8 0
EOF

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



# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:4353: checking size of short" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(short));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_SHORT"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_SHORT $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of wchar_t""... $ac_c" 1>&6
echo "configure:4383: checking size of wchar_t" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(wchar_t));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_WCHAR"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_WCHAR $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:4413: checking size of int" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(int));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_INT"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_INT $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:4443: checking size of long" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(long));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_LONG"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_LONG $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of long long""... $ac_c" 1>&6
echo "configure:4473: checking size of long long" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(long long));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_LONG_LONG"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_LONG_LONG $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of float""... $ac_c" 1>&6
echo "configure:4503: checking size of float" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(float));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_FLOAT"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FLOAT $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of double""... $ac_c" 1>&6
echo "configure:4533: checking size of double" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(double));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_DOUBLE"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_DOUBLE $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of long double""... $ac_c" 1>&6
echo "configure:4563: checking size of long double" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(long double));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_LONG_DOUBLE"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_LONG_DOUBLE $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine datatype size. 
# First arg is type, 2nd (optional) arg is config var to define.
echo $ac_n "checking size of void *""... $ac_c" 1>&6
echo "configure:4593: checking size of void *" >&5
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
int main(int argc, char* argv)
{
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    fprintf(f, "%d\n", sizeof(void *));
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_ac_size=`cat conftestval`
else
    lam_ac_size=0
fi
echo "$ac_t""$lam_ac_size" 1>&6
if test -n "LAM_SIZEOF_VOID_P"; then
    cat >> confdefs.h <<EOF
#define LAM_SIZEOF_VOID_P $lam_ac_size
EOF

fi
/bin/rm -f conftest*

# Determine size of members of struct stat
echo $ac_n "checking size of struct stat members""... $ac_c" 1>&6
echo "configure:4622: checking size of struct stat members" >&5
cat > conftest.c <<EOF
#include <sys/stat.h>
#include <stdio.h>
main()
{
    struct stat foo;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, "%d\n", sizeof(foo.st_dev));
    exit(0);
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_stat_size=`cat conftestval`
else
    lam_stat_size=0
fi
echo "$ac_t""$lam_stat_size" 1>&6
if test "$lam_stat_size" = "4"; then
    cat >> confdefs.h <<\EOF
#define LAM_STAT_MEMBERS_INT4 1
EOF

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

fi
/bin/rm -f conftest*

# Determine type of optlen parameter of getsockopt()
echo $ac_n "checking type of getsockopt optlen parameter""... $ac_c" 1>&6
echo "configure:4657: checking type of getsockopt optlen parameter" >&5

try_getsockopt_optlen() {
    cat > conftest.c <<EOF
#include <sys/types.h>  
#include <sys/socket.h> 
int foobar(void *optval)
{
    $type optlen=0;
    return getsockopt(0, SOL_SOCKET, SO_SNDBUF, optval, &optlen);
}
EOF
    cat conftest.c >&5
    $CC $CFLAGS -c conftest.c 1> conftest.out 2>&1
    cat conftest.out >&5
    foo="wc conftest.out | awk '{ print $"
    foo="${foo}1 }'"
    ret=`eval $foo`
    rm -f conftest.*
}

types="socklen_t int size_t unsigned-int long unsigned-long"
for type in $types; do
    type=`echo $type | sed 's/-/ /g'`
    try_getsockopt_optlen
    if test "$ret" = "0"; then
        break
    fi
done
cat >> confdefs.h <<EOF
#define LAM_SOCK_OPTLEN_T $type
EOF

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

# Determine type of optlen parameter of getsockopt()
echo $ac_n "checking type of recvfrom length parameter""... $ac_c" 1>&6
echo "configure:4694: checking type of recvfrom length parameter" >&5

try_getsockopt_optlen() {
    cat > conftest.c <<EOF
#include <sys/types.h>  
#include <sys/socket.h> 
int foobar(void *buffer)
{
    $type optlen=0;
    return recvfrom(0, buffer, 0, 0, (struct sockaddr*) 0, &optlen);
}
EOF
    cat conftest.c >&5
    $CC $CFLAGS -c conftest.c 1> conftest.out 2>&1
    cat conftest.out >&5
    foo="wc conftest.out | awk '{ print $"
    foo="${foo}1 }'"
    ret=`eval $foo`
    rm -f conftest.*
}

types="socklen_t int size_t unsigned-int long unsigned-long"
for type in $types; do
    type=`echo $type | sed 's/-/ /g'`
    try_getsockopt_optlen
    if test "$ret" = "0"; then
        break
    fi
done
cat >> confdefs.h <<EOF
#define LAM_RECVFROM_LEN_T $type
EOF

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


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of short""... $ac_c" 1>&6
echo "configure:4733: checking alignment of short" >&5
if eval "test \"\${lam_cv_align_short+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; short x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_short=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_short" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_SHORT $lam_cv_align_short
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of wchar_t""... $ac_c" 1>&6
echo "configure:4772: checking alignment of wchar_t" >&5
if eval "test \"\${lam_cv_align_wchar+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; wchar_t x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_wchar=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_wchar" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_WCHAR $lam_cv_align_wchar
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of int""... $ac_c" 1>&6
echo "configure:4811: checking alignment of int" >&5
if eval "test \"\${lam_cv_align_int+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; int x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_int=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_int" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_INT $lam_cv_align_int
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of long""... $ac_c" 1>&6
echo "configure:4850: checking alignment of long" >&5
if eval "test \"\${lam_cv_align_long+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; long x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_long=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_long" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_LONG $lam_cv_align_long
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of long long""... $ac_c" 1>&6
echo "configure:4889: checking alignment of long long" >&5
if eval "test \"\${lam_cv_align_longlong+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; long long x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_longlong=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_longlong" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_LONG_LONG $lam_cv_align_longlong
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of float""... $ac_c" 1>&6
echo "configure:4928: checking alignment of float" >&5
if eval "test \"\${lam_cv_align_float+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; float x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_float=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_float" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FLOAT $lam_cv_align_float
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of double""... $ac_c" 1>&6
echo "configure:4967: checking alignment of double" >&5
if eval "test \"\${lam_cv_align_double+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; double x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_double=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_double" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_DOUBLE $lam_cv_align_double
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of long double""... $ac_c" 1>&6
echo "configure:5006: checking alignment of long double" >&5
if eval "test \"\${lam_cv_align_longdbl+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; long double x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_longdbl=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_longdbl" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_LONG_DOUBLE $lam_cv_align_longdbl
EOF


# Determine datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of void *""... $ac_c" 1>&6
echo "configure:5045: checking alignment of void *" >&5
if eval "test \"\${lam_cv_align_voidp+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
struct foo { char c; void * x; };
int main(int argc, char* argv)
{
    struct foo *p = (struct foo *) malloc(sizeof(struct foo));
    int diff;
    FILE *f=fopen("conftestval", "w");
    if (!f) return 1;
    diff = ((char *)&p->x) - ((char *)&p->c);
    fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
    return 0;
}
EOF
$CC $CFLAGS -o conftest conftest.c 1>&5 2>&1
if test -s conftest && (./conftest; exit) 2>/dev/null; then
    lam_cv_align_voidp=`cat conftestval`
else
    echo "configure: warning: error compiling/running conftest" 1>&2
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_voidp" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_VOID_P $lam_cv_align_voidp
EOF


if test "$with_fc" != no; then
    
# Determine underscore generation for external names.
# arg is FORTRAN compiler name
echo $ac_n "checking $FCOMPILER external naming convention""... $ac_c" 1>&6
echo "configure:5086: checking $FCOMPILER external naming convention" >&5
cat > conftestf.f <<EOF
       subroutine foo_bar(a)
       integer a
       a = 1
       return
       end
EOF
$FCOMPILER $FFLAGS -c conftestf.f 1>&5 2>&1
if test ! -s conftestf.o; then
    echo "configure: warning: unable to produce an object file testing FORTRAN compiler" 1>&2
else
    nm conftestf.o | grep foo_bar__ > /dev/null 2>&1
    if test $? = "0"; then 
	echo "$ac_t""FORTRANDOUBLEUNDERSCORE" 1>&6
	cat >> confdefs.h <<\EOF
#define LAM_FORTRANDOUBLEUNDERSCORE 1
EOF

	lam_ac_doubleunder=y
    else
	nm conftestf.o | grep foo_bar_ > /dev/null 2>&1
	if test $? = "0"; then 
	    echo "$ac_t""FORTRANUNDERSCORE" 1>&6
	    cat >> confdefs.h <<\EOF
#define LAM_FORTRANUNDERSCORE 1
EOF

	    lam_ac_singleunder=y
	else
	    nm conftestf.o | grep foo_bar > /dev/null 2>&1
	    if test $? = "0"; then 
		echo "$ac_t""FORTRANNOUNDERSCORE" 1>&6
		cat >> confdefs.h <<\EOF
#define LAM_FORTRANNOUNDERSCORE 1
EOF

		lam_ac_nounder=y
	    else
		nm conftestf.o | grep FOO_BAR > /dev/null 2>&1
		if test $? = "0"; then 
		    echo "$ac_t""FORTRANCAPS" 1>&6
		    cat >> confdefs.h <<\EOF
#define LAM_FORTRANCAPS 1
EOF

		    lam_ac_caps=y
		else
		    echo "configure: warning: couldn't find name of subroutine foo_bar" 1>&2
		fi
	    fi
	fi
    fi
fi
/bin/rm -f conftestf.f conftestf.o

    
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking size of FORTRAN INTEGER""... $ac_c" 1>&6
echo "configure:5146: checking size of FORTRAN INTEGER" >&5
if eval "test \"\${lam_cv_size_fint+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_size_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_size_fn=size_
else
    if test "x$lam_ac_nounder" = xy; then
	lam_ac_size_fn=size
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_size_fn=SIZE
	else 
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_size_fn"; then
cat > conftestf.f <<EOF
       program fsize
       external size
       INTEGER x(2)
       call size(x(1),x(2))
       end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void $lam_ac_size_fn(char *a, char *b)
{
    int diff = (int) (b - a);
    FILE *f=fopen("conftestval", "w");
    if (!f) return;
    fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_size_fint=`cat conftestval`
    else
	echo "configure: warning: Error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_size_fint" 1>&6
cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FORTRAN_INT $lam_cv_size_fint
EOF

    
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking size of FORTRAN REAL""... $ac_c" 1>&6
echo "configure:5213: checking size of FORTRAN REAL" >&5
if eval "test \"\${lam_cv_size_freal+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_size_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_size_fn=size_
else
    if test "x$lam_ac_nounder" = xy; then
	lam_ac_size_fn=size
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_size_fn=SIZE
	else 
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_size_fn"; then
cat > conftestf.f <<EOF
       program fsize
       external size
       REAL x(2)
       call size(x(1),x(2))
       end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void $lam_ac_size_fn(char *a, char *b)
{
    int diff = (int) (b - a);
    FILE *f=fopen("conftestval", "w");
    if (!f) return;
    fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_size_freal=`cat conftestval`
    else
	echo "configure: warning: Error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_size_freal" 1>&6
cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FORTRAN_REAL $lam_cv_size_freal
EOF

    
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking size of FORTRAN DOUBLE PRECISION""... $ac_c" 1>&6
echo "configure:5280: checking size of FORTRAN DOUBLE PRECISION" >&5
if eval "test \"\${lam_cv_size_fdprec+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_size_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_size_fn=size_
else
    if test "x$lam_ac_nounder" = xy; then
	lam_ac_size_fn=size
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_size_fn=SIZE
	else 
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_size_fn"; then
cat > conftestf.f <<EOF
       program fsize
       external size
       DOUBLE PRECISION x(2)
       call size(x(1),x(2))
       end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void $lam_ac_size_fn(char *a, char *b)
{
    int diff = (int) (b - a);
    FILE *f=fopen("conftestval", "w");
    if (!f) return;
    fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_size_fdprec=`cat conftestval`
    else
	echo "configure: warning: Error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_size_fdprec" 1>&6
cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FORTRAN_DBLPREC $lam_cv_size_fdprec
EOF

    
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking size of FORTRAN COMPLEX""... $ac_c" 1>&6
echo "configure:5347: checking size of FORTRAN COMPLEX" >&5
if eval "test \"\${lam_cv_size_fcomplex+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_size_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_size_fn=size_
else
    if test "x$lam_ac_nounder" = xy; then
	lam_ac_size_fn=size
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_size_fn=SIZE
	else 
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_size_fn"; then
cat > conftestf.f <<EOF
       program fsize
       external size
       COMPLEX x(2)
       call size(x(1),x(2))
       end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void $lam_ac_size_fn(char *a, char *b)
{
    int diff = (int) (b - a);
    FILE *f=fopen("conftestval", "w");
    if (!f) return;
    fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_size_fcomplex=`cat conftestval`
    else
	echo "configure: warning: Error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_size_fcomplex" 1>&6
cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FORTRAN_COMPLEX $lam_cv_size_fcomplex
EOF

    
# Determine FORTRAN datatype size.
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking size of FORTRAN DOUBLE COMPLEX""... $ac_c" 1>&6
echo "configure:5414: checking size of FORTRAN DOUBLE COMPLEX" >&5
if eval "test \"\${lam_cv_size_fdcomplex+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_size_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_size_fn=size_
else
    if test "x$lam_ac_nounder" = xy; then
	lam_ac_size_fn=size
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_size_fn=SIZE
	else 
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_size_fn"; then
cat > conftestf.f <<EOF
       program fsize
       external size
       DOUBLE COMPLEX x(2)
       call size(x(1),x(2))
       end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void $lam_ac_size_fn(char *a, char *b)
{
    int diff = (int) (b - a);
    FILE *f=fopen("conftestval", "w");
    if (!f) return;
    fprintf(f, "%d\n", diff);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_size_fdcomplex=`cat conftestval`
    else
	echo "configure: warning: Error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_size_fdcomplex" 1>&6
cat >> confdefs.h <<EOF
#define LAM_SIZEOF_FORTRAN_DBLCOMPLEX $lam_cv_size_fdcomplex
EOF


    
# Determine FORTRAN datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of FORTRAN INTEGER""... $ac_c" 1>&6
echo "configure:5482: checking alignment of FORTRAN INTEGER" >&5
if eval "test \"\${lam_cv_align_fint+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_align_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_align_fn=align_
else
    if test "x$lam_ac_nounder" = xy; then
	    lam_ac_align_fn=align
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_align_fn=ALIGN
	else
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_align_fn"; then
cat > conftestf.f <<EOF
      program falign
      external align
      INTEGER  w,x,y,z
      CHARACTER a,b,c
      common /foo/a,w,b,x,y,c,z
      call align(w,x,y,z)
      end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
{   unsigned long aw, ax, ay, az;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    aw = (unsigned long) w;
    ax = (unsigned long) x;
    ay = (unsigned long) y;
    az = (unsigned long) z;
    if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
    else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
    else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
    else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
    else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
    else fprintf(f, "%d\n", 1); 
    fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_align_fint=`cat conftestval`
    else
	echo "configure: warning: error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_fint" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FORTRAN_INT $lam_cv_align_fint
EOF

    
# Determine FORTRAN datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of FORTRAN REAL""... $ac_c" 1>&6
echo "configure:5561: checking alignment of FORTRAN REAL" >&5
if eval "test \"\${lam_cv_align_freal+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_align_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_align_fn=align_
else
    if test "x$lam_ac_nounder" = xy; then
	    lam_ac_align_fn=align
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_align_fn=ALIGN
	else
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_align_fn"; then
cat > conftestf.f <<EOF
      program falign
      external align
      REAL  w,x,y,z
      CHARACTER a,b,c
      common /foo/a,w,b,x,y,c,z
      call align(w,x,y,z)
      end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
{   unsigned long aw, ax, ay, az;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    aw = (unsigned long) w;
    ax = (unsigned long) x;
    ay = (unsigned long) y;
    az = (unsigned long) z;
    if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
    else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
    else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
    else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
    else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
    else fprintf(f, "%d\n", 1); 
    fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_align_freal=`cat conftestval`
    else
	echo "configure: warning: error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_freal" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FORTRAN_REAL $lam_cv_align_freal
EOF

    
# Determine FORTRAN datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of FORTRAN DOUBLE PRECISION""... $ac_c" 1>&6
echo "configure:5640: checking alignment of FORTRAN DOUBLE PRECISION" >&5
if eval "test \"\${lam_cv_align_fdprec+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_align_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_align_fn=align_
else
    if test "x$lam_ac_nounder" = xy; then
	    lam_ac_align_fn=align
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_align_fn=ALIGN
	else
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_align_fn"; then
cat > conftestf.f <<EOF
      program falign
      external align
      DOUBLE PRECISION  w,x,y,z
      CHARACTER a,b,c
      common /foo/a,w,b,x,y,c,z
      call align(w,x,y,z)
      end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
{   unsigned long aw, ax, ay, az;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    aw = (unsigned long) w;
    ax = (unsigned long) x;
    ay = (unsigned long) y;
    az = (unsigned long) z;
    if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
    else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
    else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
    else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
    else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
    else fprintf(f, "%d\n", 1); 
    fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_align_fdprec=`cat conftestval`
    else
	echo "configure: warning: error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_fdprec" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FORTRAN_COMPLEX $lam_cv_align_fdprec
EOF

    
# Determine FORTRAN datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of FORTRAN COMPLEX""... $ac_c" 1>&6
echo "configure:5719: checking alignment of FORTRAN COMPLEX" >&5
if eval "test \"\${lam_cv_align_fcomplex+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_align_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_align_fn=align_
else
    if test "x$lam_ac_nounder" = xy; then
	    lam_ac_align_fn=align
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_align_fn=ALIGN
	else
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_align_fn"; then
cat > conftestf.f <<EOF
      program falign
      external align
      COMPLEX  w,x,y,z
      CHARACTER a,b,c
      common /foo/a,w,b,x,y,c,z
      call align(w,x,y,z)
      end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
{   unsigned long aw, ax, ay, az;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    aw = (unsigned long) w;
    ax = (unsigned long) x;
    ay = (unsigned long) y;
    az = (unsigned long) z;
    if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
    else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
    else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
    else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
    else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
    else fprintf(f, "%d\n", 1); 
    fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_align_fcomplex=`cat conftestval`
    else
	echo "configure: warning: error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_fcomplex" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FORTRAN_DBLPREC $lam_cv_align_fcomplex
EOF

    
# Determine FORTRAN datatype alignment. 
# First arg is type, 2nd arg is cache var, 3rd arg is config var to define.
echo $ac_n "checking alignment of FORTRAN DOUBLE COMPLEX""... $ac_c" 1>&6
echo "configure:5798: checking alignment of FORTRAN DOUBLE COMPLEX" >&5
if eval "test \"\${lam_cv_align_fdcomplex+set}\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
lam_ac_align_fn=
if test "x$lam_ac_doubleunder" = xy || test "x$lam_ac_singleunder" = xy; then
    lam_ac_align_fn=align_
else
    if test "x$lam_ac_nounder" = xy; then
	    lam_ac_align_fn=align
    else
	if test "x$lam_ac_caps" = xy; then
	    lam_ac_align_fn=ALIGN
	else
	    { echo "configure: error: FORTRAN external naming convention undefined" 1>&2; exit 1; }
	fi
    fi
fi
if test -n "$lam_ac_align_fn"; then
cat > conftestf.f <<EOF
      program falign
      external align
      DOUBLE COMPLEX  w,x,y,z
      CHARACTER a,b,c
      common /foo/a,w,b,x,y,c,z
      call align(w,x,y,z)
      end
EOF
cat > conftest.c <<EOF
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
void exit(int);
#endif
void $lam_ac_align_fn(char *w, char *x, char *y, char *z)
{   unsigned long aw, ax, ay, az;
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    aw = (unsigned long) w;
    ax = (unsigned long) x;
    ay = (unsigned long) y;
    az = (unsigned long) z;
    if (! ((aw%16)||(ax%16)||(ay%16)||(az%16))) fprintf(f, "%d\n", 16);
    else if (! ((aw%12)||(ax%12)||(ay%12)||(az%12))) fprintf(f, "%d\n", 12);
    else if (! ((aw%8)||(ax%8)||(ay%8)||(az%8))) fprintf(f, "%d\n", 8);
    else if (! ((aw%4)||(ax%4)||(ay%4)||(az%4))) fprintf(f, "%d\n", 4);
    else if (! ((aw%2)||(ax%2)||(ay%2)||(az%2))) fprintf(f, "%d\n", 2);
    else fprintf(f, "%d\n", 1); 
    fclose(f);
}
#ifdef __cplusplus
}
#endif
EOF
$CC $CFLAGS -c conftest.c 1>&5 2>&1
if test ! -s conftest.o; then
    echo "configure: warning: error compiling/running conftest" 1>&2
else
    $FCOMPILER $FFLAGS conftestf.f conftest.o -o conftest  1>&5 2>&1
    if test -s conftest && (./conftest; exit) 2>/dev/null; then
	lam_cv_align_fdcomplex=`cat conftestval`
    else
	echo "configure: warning: error compiling/running conftest" 1>&2
    fi
fi
fi
/bin/rm -f conftest*
fi

echo "$ac_t""$lam_cv_align_fdcomplex" 1>&6
cat >> confdefs.h <<EOF
#define LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX $lam_cv_align_fdcomplex
EOF


    if test "$lam_cv_size_fdprec" = "$ac_cv_sizeof_double"; then
       if test "$lam_cv_align_fdprec" != "$lam_cv_align_double"; then
	  echo "configure: warning: alignment of Fortran double precsion and C double
    are not the same" 1>&2
       fi
    elif test "$lam_cv_size_fdprec" = "$ac_cv_sizeof_long_double"; then
       if test "$lam_cv_align_fdprec" != "$lam_cv_align_longdbl"; then
	  echo "configure: warning: alignment of Fortran double precsion and C long double
    are not the same" 1>&2
       fi
    fi
fi

INSTALL_HOME=`pwd`


trap '' 1 2 15

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

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

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

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

DEFS=-DHAVE_CONFIG_H

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

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.14.1"
    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 "./config.mk:config/config.mk.in 
    ./config/depend
    ./share/h/rpi.shm.h 
    ./share/h/rpi.tcp.h 
    ./tools/hcc/hcp
    ./examples/Makefile
    ./examples/config-defs
    ./examples/fault/myapp
    ./examples/mandelbrot/myapp
    ./examples/trivial/myapp
    ./examples/trivial/Makefile
    ./examples/wave1d/myapp
    ./Makefile
 ./share/h/lam_config.h:./config/lam_config.h.in" | 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%@LAM_VERSION@%$LAM_VERSION%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@ROMIO_INSTALL@%$ROMIO_INSTALL%g
s%@ROMIO_CLEAN@%$ROMIO_CLEAN%g
s%@ROMIO_EXAMPLES@%$ROMIO_EXAMPLES%g
s%@ROMIO_EXAMPLE@%$ROMIO_EXAMPLE%g
s%@IMPI_LIB@%$IMPI_LIB%g
s%@IMPI_DIR@%$IMPI_DIR%g
s%@IMPID_DIR@%$IMPID_DIR%g
s%@IMPI_TARGET@%$IMPI_TARGET%g
s%@IMPI_LIB_FILE@%$IMPI_LIB_FILE%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@CXX@%$CXX%g
s%@LAM_EXCEPTION_CXXFLAGS@%$LAM_EXCEPTION_CXXFLAGS%g
s%@LAM_EXCEPTION_LDFLAGS@%$LAM_EXCEPTION_LDFLAGS%g
s%@CXXCPP@%$CXXCPP%g
s%@TEMPLATE_REP@%$TEMPLATE_REP%g
s%@MPI2CPP_INSTALL@%$MPI2CPP_INSTALL%g
s%@MPI2CPP_CLEAN@%$MPI2CPP_CLEAN%g
s%@MPI2CPP_EXAMPLES@%$MPI2CPP_EXAMPLES%g
s%@MPI2CPP_EXAMPLE@%$MPI2CPP_EXAMPLE%g
s%@MAKEDEPEND@%$MAKEDEPEND%g
s%@DEPENDRULE@%$DEPENDRULE%g
s%@MAXDEPFILES@%$MAXDEPFILES%g
s%@LIB@%$LIB%g
s%@MAKELIB@%$MAKELIB%g
s%@RANSYMLIB@%$RANSYMLIB%g
s%@LIBBIND@%$LIBBIND%g
s%@HBIND@%$HBIND%g
s%@SYSLIBS@%$SYSLIBS%g
s%@LIBSUFFIX@%$LIBSUFFIX%g
s%@LIBDEPSFX@%$LIBDEPSFX%g
s%@RPI@%$RPI%g
s%@RPISRC@%$RPISRC%g
s%@RPIOBJ@%$RPIOBJ%g
s%@RPIFLAGS@%$RPIFLAGS%g
s%@ROMIO_FLAGS@%$ROMIO_FLAGS%g
s%@USER_LDFLAGS@%$USER_LDFLAGS%g
s%@USER_CXXLDFLAGS@%$USER_CXXLDFLAGS%g
s%@FLIBPATH@%$FLIBPATH%g
s%@FCOMPILER@%$FCOMPILER%g
s%@ROMIO_NOF77@%$ROMIO_NOF77%g
s%@ROMIO_FAKE_F77@%$ROMIO_FAKE_F77%g
s%@WAVE1D_EXAMPLE@%$WAVE1D_EXAMPLE%g
s%@TRIVIALF_EXAMPLE@%$TRIVIALF_EXAMPLE%g
s%@RPISYSLIBS@%$RPISYSLIBS%g
s%@LN_S@%$LN_S%g
s%@RANLIB@%$RANLIB%g
s%@AR@%$AR%g
s%@CP@%$CP%g
s%@RM@%$RM%g
s%@SED@%$SED%g
s%@SHELL_CMD@%$SHELL_CMD%g
s%@RSH0@%$RSH0%g
s%@RSH@%$RSH%g
s%@SOFLAGS@%$SOFLAGS%g
s%@TCPSHORT@%$TCPSHORT%g
s%@SHMSHORT@%$SHMSHORT%g
s%@SHMPOOL@%$SHMPOOL%g
s%@SHMALLOC@%$SHMALLOC%g
s%@INSTALL_HOME@%$INSTALL_HOME%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-"./config.mk:config/config.mk.in 
    ./config/depend
    ./share/h/rpi.shm.h 
    ./share/h/rpi.tcp.h 
    ./tools/hcc/hcp
    ./examples/Makefile
    ./examples/config-defs
    ./examples/fault/myapp
    ./examples/mandelbrot/myapp
    ./examples/trivial/myapp
    ./examples/trivial/Makefile
    ./examples/wave1d/myapp
    ./Makefile
"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

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

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

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


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

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

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="./share/h/lam_config.h:./config/lam_config.h.in"
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

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1


chmod a+x tools/hcc/hcp
