#! /bin/sh

# From configure.in Header: /cactusdevcvs/Cactus/lib/make/configure.in



























# CCTK_CHECK_FUNCS(FUNCTION..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------


# CCTK_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------



# CCTK_CHECK_LIB(LIBRARY, FUNCTION,
#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
#              [OTHER-LIBRARIES])
# ------------------------------------------------------



























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

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --with-x                use the X Window System"

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

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

ac_prev=
for ac_option
do

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

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

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

  case "$ac_option" in

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  esac
done

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

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

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

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

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

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

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

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=

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

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

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

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

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





#######################################################################
# determine WARN_MODE from the WARN option
# if this option isn't set WARN_MODE will default to 'no'

WARN_MODE='no'
if test -n "$WARN" ; then
  
  WARN=`echo $WARN | tr '[:upper:]' '[:lower:]'`
  
  if test "$WARN" != 'yes' -a "$WARN" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of WARN=\"$WARN\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
  WARN_MODE=$WARN
fi


#######################################################################
# determine DEBUG_MODE from the DEBUG option
# if this option isn't set DEBUG_MODE will default to 'no'
if test -n "$DEBUG" ; then
  
  DEBUG=`echo $DEBUG | tr '[:upper:]' '[:lower:]'`
  
fi

if test -n "$DEBUG" -a "$DEBUG" != 'no' ; then
  cat >> confdefs.h <<\EOF
#define CCTK_DEBUG 1
EOF

  case "$DEBUG" in
     memory)
       cat >> confdefs.h <<\EOF
#define CCTK_TRACEMEMORY 1
EOF

       ;;
     flags|yes)
       DEBUG_FLAGS='yes'
       ;;
     defines)
       cat >> confdefs.h <<\EOF
#define DEBUG 1
EOF

       ;;
     all)
      cat >> confdefs.h <<\EOF
#define CCTK_TRACEMEMORY 1
EOF

      DEBUG_FLAGS='yes'
      ;;
    *)
      { echo "configure: error: Didn't recognize setting of DEBUG=\"$DEBUG\"" 1>&2; exit 1; }
      ;;
   esac
fi


#######################################################################
# determine OPTIMISE_MODE from the OPTIMISE/OPTIMIZE option
# if this option isn't set OPTIMISE_MODE will default to 'yes'

OPTIMISE_MODE='yes'
if test -n "$OPTIMISE" ; then
  
  OPTIMISE=`echo $OPTIMISE | tr '[:upper:]' '[:lower:]'`
  OPTIMIZE=`echo $OPTIMIZE | tr '[:upper:]' '[:lower:]'`
  
  if test -n "$OPTIMIZE" -a "$OPTIMISE" != "$OPTIMIZE" ; then
    { echo "configure: error: OPTIMISE=\"$OPTIMISE\" is inconsistent with OPTIMIZE=\"$OPTIMIZE\"!" 1>&2; exit 1; }
  fi
  if test "$OPTIMISE" != 'yes' -a "$OPTIMISE" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of OPTIMISE=\"$OPTIMISE\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
  OPTIMISE_MODE=$OPTIMISE
elif test -n "$OPTIMIZE"; then
  
  OPTIMISE=`echo $OPTIMIZE | tr '[:upper:]' '[:lower:]'`
  
  if test "$OPTIMISE" != 'yes' -a "$OPTIMISE" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of OPTIMIZE=\"$OPTIMIZE\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
  OPTIMISE_MODE=$OPTIMISE
fi


#######################################################################
# determine PROFILE_MODE from the PROFILE option
# if this option isn't set PROFILE_MODE will default to 'no'

PROFILE_MODE='no'
if test -n "$PROFILE" ; then
  
  PROFILE=`echo $PROFILE | tr '[:upper:]' '[:lower:]'`
  
  if test "$PROFILE" != 'yes' -a "$PROFILE" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of PROFILE=\"$PROFILE\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
  PROFILE_MODE=$PROFILE
fi


#######################################################################
# determine OPENMP_MODE from the OPENMP option
# if this option isn't set OPENMP_MODE will default to 'no'

OPENMP_MODE='no'
if test -n "$OPENMP" ; then
  
  OPENMP=`echo $OPENMP | tr '[:upper:]' '[:lower:]'`
  
  if test "$OPENMP" != 'yes' -a "$OPENMP" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of OPENMP=\"$OPENMP\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
  OPENMP_MODE=$OPENMP
fi


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


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

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

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

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


# See if there are any preferred compilers for this system

CCTK_CONFIG_STAGE='preferred-compilers'

if test -r $srcdir/known-architectures/$host_os ; then
  . $srcdir/known-architectures/$host_os
else
  echo 'Warning: '
  echo '  Cactus has not been previously compiled for this architecture:'
  echo "    ($host_os)"
  echo '  The currently known architectures can be found in'
  echo "    $srcdir/known-architectures"
  echo '  The configuration will try to do its best to work things out.'
  echo '  If you create a known-architectures file for this architecture,'
  echo "  please send it to cactusmaint@cactuscode.org and we'll include"
  echo '  it in the next release.'
fi

# Save these for future use.
if test -n "$LIBS" ; then
  KNOWN_LIBS="$LIBS"
  unset LIBS
fi

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:790: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi


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

test -n "$CC" && break
done

fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:855: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

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

rm -fr conftest*
cat > conftest.$ac_ext << EOF

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

main(){return(0);} int PilotMain(){return(0);}
EOF
if { (eval echo configure:872: \"$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>&5; 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 (see configs/<configname>/config-data/config.log for details)." 1>&2; exit 1; }
fi

CROSS_COMPILE=`echo $CROSS_COMPILE | tr '[:upper:]' '[:lower:]'`

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:901: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
if test $ac_cv_prog_cc_cross = yes -a "x$CROSS_COMPILE" != xyes; then
  { echo "configure: error: Could not run executable generated by C compiler (see configs/<configname>/config-data/config.log for details). If this is a cross configuration please set CROSS_COMPILE=yes." 1>&2; exit 1; }
fi
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:909: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:918: \"$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 "x$CXX" != 'xnone' ; then
  if test -z "$CXX" ; then
    for ac_prog in c++ g++ gcc CC cxx cc++ cl xlC
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:934: checking for $ac_word" >&5
if eval "test \"`echo '$''{'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

  fi

  echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:966: checking whether the C++ compiler ($CXX $CXXFLAGS $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

rm -fr conftest*
cat > conftest.$ac_ext << EOF

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

int main(){return(0);} extern "C" int PilotMain(){return(0);}
EOF
if { (eval echo configure:983: \"$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>&5; 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 (see configs/<configname>/config-data/config.log for details)." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1009: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
if test $ac_cv_prog_cxx_cross = yes -a "x$CROSS_COMPILE" != xyes; then
  { echo "configure: error: Could not run executable generated by C++ compiler (see configs/<configname>/config-data/config.log for details). If this is a cross configuration please set CROSS_COMPILE=yes." 1>&2; exit 1; }
fi
cross_compiling=$ac_cv_prog_cxx_cross

  echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:1017: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'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:1026: \"$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
fi

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

fi


if test -z "$CPP" ; then
  for ac_prog in cpp
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:1076: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$CPP" in
  /*)
  ac_cv_path_CPP="$CPP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_CPP="$CPP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="/lib:/usr/lib:/usr/local/lib:$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_CPP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
CPP="$ac_cv_path_CPP"
if test -n "$CPP"; then
  echo "$ac_t""$CPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CPP" && break
done
test -n "$CPP" || CPP="echo"

fi



if test -z "$FPP" ; then
  for ac_prog in cpp
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:1122: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_FPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$FPP" in
  /*)
  ac_cv_path_FPP="$FPP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_FPP="$FPP" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="/lib:/usr/lib:/usr/local/lib:$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_FPP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
FPP="$ac_cv_path_FPP"
if test -n "$FPP"; then
  echo "$ac_t""$FPP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$FPP" && break
done
test -n "$FPP" || FPP="echo"

fi

if test -z "$PERL" ; then
  for ac_prog in perl
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:1166: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$PERL"; then
  ac_cv_prog_PERL="$PERL" # 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_PERL="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
PERL="$ac_cv_prog_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PERL" && break
done

fi

if test -z "$F90" ; then
  for ac_prog in f90 pgf90 xlf90 ifort gfortran
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:1203: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F90'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F90"; then
  ac_cv_prog_F90="$F90" # 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_F90="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F90="$ac_cv_prog_F90"
if test -n "$F90"; then
  echo "$ac_t""$F90" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F90" && break
done

fi

if test -z "$F77" ; then
  for ac_prog in f77 pgf77 g77 f90 pgf90 xlf90 ifort gfortran
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:1240: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$F77"; then
  ac_cv_prog_F77="$F77" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_F77="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
F77="$ac_cv_prog_F77"
if test -n "$F77"; then
  echo "$ac_t""$F77" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$F77" && break
done

fi

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

test -n "$AR" && break
done

fi

if test -z "$MKDIR" ; then
  for ac_prog in mkdir
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:1314: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MKDIR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MKDIR"; then
  ac_cv_prog_MKDIR="$MKDIR" # 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_MKDIR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MKDIR="$ac_cv_prog_MKDIR"
if test -n "$MKDIR"; then
  echo "$ac_t""$MKDIR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MKDIR" && break
done

fi

# autoconf sets $SHELL unconditionally; we can only overwrite it here.
# The user has to set $CONFIG_SHELL to override this.
if test -z "$CONFIG_SHELL" ; then
  for ac_prog in bash sh
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:1353: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SHELL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$SHELL"; then
  ac_cv_prog_SHELL="$SHELL" # 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_SHELL="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
SHELL="$ac_cv_prog_SHELL"
if test -n "$SHELL"; then
  echo "$ac_t""$SHELL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$SHELL" && break
done

fi



if test -z "$LD" ; then
  if test "x$CXX" != 'xnone' ; then
    LD=$CXX
  else
    LD=$CC
  fi
fi


# Restore the values we saved earlier
if test -n "$KNOWN_LIBS" ; then
  LIBS="$KNOWN_LIBS"
  unset KNOWN_LIBS
fi

# Include some CCTK auxiliary functions
. $srcdir/CCTK_Functions.sh

# Machine architecture for the build
cat >> confdefs.h <<EOF
#define CCTK_BUILD_OS "$host_os"
EOF

cat >> confdefs.h <<EOF
#define CCTK_BUILD_CPU "$host_cpu"
EOF

cat >> confdefs.h <<EOF
#define CCTK_BUILD_VENDOR "$host_vendor"
EOF


#########################################################################
# If this is a known architecture, setup any specific flags.
# This has to be done here as flags given to the compiler may
# change the things detected later.

# Create a file to put any #defines etc needed for this architecture
# known architecture stuff should use CCTK_WriteLine cctk_Archdefs "foo" to append to this file.
CCTK_CreateFile cctk_Archdefs.h '/* Stuff from known architectures */'
CCTK_WriteLine  cctk_Archdefs.h '#ifndef _CCTK_ARCHDEFS_H_'
CCTK_WriteLine  cctk_Archdefs.h '#define _CCTK_ARCHDEFS_H_'

CCTK_CreateFile make.arch.defn '# Stuff from known architectures '

CCTK_CONFIG_STAGE='misc'

if test -r $srcdir/known-architectures/$host_os ; then
. $srcdir/known-architectures/$host_os
fi

# Finish the architecture stuff
CCTK_WriteLine cctk_Archdefs.h '#endif /* _CCTK_ARCHDEFS_H_ */'



# Set the warn flags


# Set the warning flags if they've not been set by now
# (using GNU compiler warning flags as a reasonable default)

if test "$CC" = 'gcc' ; then
  : ${C_WARN_FLAGS='-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wsign-compare'}
else
  : ${C_WARN_FLAGS=''}
fi


if test "$CXX" = 'c++' -o "$CXX" = 'g++' ; then
  : ${CXX_WARN_FLAGS='-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Woverloaded-virtual'}
else
  : ${CXX_WARN_FLAGS=''}
fi


if test "$F77" = 'g77' ; then
  : ${F77_WARN_FLAGS='-Wall'}
else
  : ${F77_WARN_FLAGS=''}
fi


if test "$F90" = 'gfortran' ; then
  : ${F90_WARN_FLAGS='-Wall -Wshadow -Wsurprising'}
else
  : ${F90_WARN_FLAGS=''}
fi



DEBUG_MODE='no'
if test -n "$DEBUG_FLAGS"; then
  DEBUG_MODE=$DEBUG_FLAGS
fi

# Set the debug flags if they've not been set by now
# (using '-g' as a reasonable default)

: ${C_DEBUG_FLAGS='-g'}


: ${CXX_DEBUG_FLAGS='-g'}


: ${F77_DEBUG_FLAGS='-g'}


: ${F90_DEBUG_FLAGS='-g'}


# Set the optimization flags if they've not been set by now
# (using '-O2' as a reasonable default)



: ${C_OPTIMISE_FLAGS='-O2'}


: ${CXX_OPTIMISE_FLAGS='-O2'}


if test -z "$F77_OPTIMISE_FLAGS" -a "$F77" = 'g77' ; then
  F77_OPTIMISE_FLAGS='-O2'
else
  : ${F77_OPTIMISE_FLAGS=''}
fi


: ${F90_OPTIMISE_FLAGS=''}


# Set the profiling flags if they've not been set by now
# (using '-pg' as a reasonable default)



: ${C_PROFILE_FLAGS='-pg'}


: ${CXX_PROFILE_FLAGS='-pg'}


: ${F77_PROFILE_FLAGS='-pg'}


: ${F90_PROFILE_FLAGS='-pg'}


# Set the OpenMP flags if they've not been set by now







##########################################################################

# Deal with the Fortran compiler issues.
# If there's a Fortran 90 compiler use that for all the Fortran.
if test "x$F90" != "x" -a "x$F90" != "xnone" -a "x$F77" = "x" ; then
  F77=$F90
  F77FLAGS=$F90FLAGS
  F77_WARN_FLAGS=$F90_WARN_FLAGS
  F77_DEBUG_FLAGS=$F90_DEBUG_FLAGS
  F77_OPTIMISE_FLAGS=$F90_OPTIMISE_FLAGS
  F77_PROFILE_FLAGS=$F90_PROFILE_FLAGS
  F77_OPENMP_FLAGS=$F90_OPENMP_FLAGS
fi

# Set default Fortran compilers

if test -z "$F90" ; then
  F90='none'
fi


if test -z "$F77" ; then
  F77='none'
fi


# The known architecture stuff has probably set the LIBS variable
# So remember what it is and set it to blank to prevent any problems with the
# rest of the configure stuff.

#########################################################################

KNOWN_LIBS="$LIBS"
unset LIBS

KNOWN_LDFLAGS="$LDFLAGS"
unset LDFLAGS

: ${LIBDIR_PREFIX='-L'}
: ${LIBDIR_SUFFIX=''}

: ${LIBLINK_PREFIX='-l'}
: ${LIBLINK_SUFFIX=''}



echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1590: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 1605 "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:1611: \"$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 1622 "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:1628: \"$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 1639 "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:1645: \"$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

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

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

fi

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

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 1739 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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

fi
fi

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

fi



if test "x$cross_compiling" = 'xno' ; then
  echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:1777: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
#line 1784 "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:1795: \"$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 1799 "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:1810: \"$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 1830 "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:1843: \"$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

else
  if test -n "$ENDIAN" ; then
    if test "$ENDIAN" = 'big' ; then
      cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF

    fi
  else
    { echo "configure: error: Cross-compiling - no value set for endian-ness please set ENDIAN" 1>&2; exit 1; }
  fi
fi

# Check for sizes of integer types

if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_LONG_LONG" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(long long) please set SIZEOF_LONG_LONG" 1>&2; exit 1; }
fi

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

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



if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_LONG_INT" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(long int) please set SIZEOF_LONG_INT" 1>&2; exit 1; }
fi

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

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



if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_INT" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(int) please set SIZEOF_INT" 1>&2; exit 1; }
fi

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

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



if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_SHORT_INT" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(short int) please set SIZEOF_SHORT_INT" 1>&2; exit 1; }
fi

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

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



# Check for sizes of floating point types

if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_LONG_DOUBLE" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(long double) please set SIZEOF_LONG_DOUBLE" 1>&2; exit 1; }
fi

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

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



if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_DOUBLE" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(double) please set SIZEOF_DOUBLE" 1>&2; exit 1; }
fi

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

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




if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_FLOAT" ; then
  { echo "configure: error: Cross-compiling - no value set for sizeof(float) please set SIZEOF_FLOAT" 1>&2; exit 1; }
fi

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

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



# Check for sizes of pointers.

if test "x$cross_compiling" = 'xyes' -a -z "$SIZEOF_POINTER" ; then
   { echo "configure: error: Cross-compiling - no value set for sizeof(char *) please set SIZEOF_POINTER" 1>&2; exit 1; }
fi

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

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



# See if there's a null device, and what it's called

if test "x$cross_compiling" = 'xyes'; then
  if test -z "$NULL_DEVICE" ; then
     echo "configure: warning: Cross-compiling - no value set for location of null device please set NULL_DEVICE" 1>&2
     echo "configure: warning: Defaulting to /dev/null" 1>&2
     NULL_DEVICE='/dev/null'
  fi
  eval "cctk_cv_nulldevice=$NULL_DEVICE"
  cat >> confdefs.h <<EOF
#define NULL_DEVICE "$cctk_cv_nulldevice"
EOF

else
  echo $ac_n "checking for the null device""... $ac_c" 1>&6
echo "configure:2261: checking for the null device" >&5
if eval "test \"`echo '$''{'cctk_cv_nulldevice'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test -d /dev ; then
  eval "cctk_cv_nulldevice=/dev/null"
else
  cat > NUL <<EOF
test
EOF
  if eval "`cat NUL > /dev/null 2>/dev/null`" ; then
    eval "cctk_cv_nulldevice=NUL"
  fi
fi

fi

if eval "test -n \"$cctk_cv_nulldevice\"" ; then
  echo "$ac_t""$cctk_cv_nulldevice" 1>&6
  cat >> confdefs.h <<EOF
#define NULL_DEVICE "$cctk_cv_nulldevice"
EOF

else
  echo "$ac_t"""not found"" 1>&6
fi

fi

# Various flags


: ${ARFLAGS=rucs}

# Some architectures can't pass the 's' flag to ar so need to use ranlib
# to create an index in an archive file.

: ${USE_RANLIB=no}


: ${RANLIBFLAGS=-cs}




#: ${F90FLAGS="$CFLAGS"}
#: ${F77FLAGS="$CFLAGS"}









# Do we have gethostbyname(3) ?
# For Solaris we should search in libnsl.so
ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
for ac_func in gethostbyname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2324: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2329 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:2352: \"$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
echo $ac_n "checking for gethostbyname in library nsl""... $ac_c" 1>&6
echo "configure:2374: checking for gethostbyname in library nsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="nsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2383 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyname();

int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:2394: \"$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
  cat >> confdefs.h <<\EOF
#define HAVE_GETHOSTBYNAME 1
EOF

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


fi
done



# Check if we have mode_t available
echo $ac_n "checking whether mode_t is defined""... $ac_c" 1>&6
echo "configure:2425: checking whether mode_t is defined" >&5
if eval "test \"`echo '$''{'cctk_cv_have_mode_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2430 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
int main() {
mode_t foo; return 0
; return 0; }
EOF
if { (eval echo configure:2440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_have_mode_t=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_have_mode_t=no"
fi
rm -f conftest*

fi

if test "$cctk_cv_have_mode_t" = 'yes'; then
  cat >> confdefs.h <<\EOF
#define HAVE_MODE_T 1
EOF

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



echo $ac_n "checking for availability of gettimeofday timing""... $ac_c" 1>&6
echo "configure:2466: checking for availability of gettimeofday timing" >&5
if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2471 "configure"
#include "confdefs.h"

int main() {
gettimeofday(0, 0);
 return 0;
; return 0; }
EOF
if { (eval echo configure:2479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "cctk_cv_time_gettimeofday=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_time_gettimeofday=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_time_gettimeofday'`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define HAVE_TIME_GETTIMEOFDAY 1
EOF

else
  echo "$ac_t""no" 1>&6
fi
if eval "test \"`echo '$cctk_cv_time_gettimeofday'`\" = yes"; then
echo $ac_n "checking if gettimeofday needs timezone""... $ac_c" 1>&6
echo "configure:2501: checking if gettimeofday needs timezone" >&5
if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday_timezone'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2506 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
int main() {
struct timeval tp;
 struct timezone tzp;
 gettimeofday(&tp, &tzp);
 printf("%f\n", (double)(tp.tv_sec + (double)tp.tv_usec/1000000.0));
 return 0;
; return 0; }
EOF
if { (eval echo configure:2519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "cctk_cv_time_gettimeofday_timezone=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_time_gettimeofday_timezone=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_time_gettimeofday_timezone'`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define GETTIMEOFDAY_NEEDS_TIMEZONE 1
EOF

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

echo $ac_n "checking for availability of getrusage timing""... $ac_c" 1>&6
echo "configure:2542: checking for availability of getrusage timing" >&5
if eval "test \"`echo '$''{'cctk_cv_time_getrusage'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2547 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
int main() {
struct rusage ru;
 getrusage(RUSAGE_SELF, &ru);
 printf("%f\n",(double)(ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec/1000000.0));
 return 0;
; return 0; }
EOF
if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "cctk_cv_time_getrusage=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_time_getrusage=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_time_getrusage'`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define HAVE_TIME_GETRUSAGE 1
EOF

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

echo $ac_n "checking for availability of _ftime timing""... $ac_c" 1>&6
echo "configure:2582: checking for availability of _ftime timing" >&5
if eval "test \"`echo '$''{'cctk_cv_time_ftime'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2587 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <sys/timeb.h>
int main() {
  struct _timeb timebs;
  _ftime(&timebs);
  printf("%f\n",(double)(timebs.time + timebs.millitm/1000.0));
  return 0;
; return 0; }
EOF
if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "cctk_cv_time_ftime=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_time_ftime=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_time_ftime'`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define HAVE_TIME__FTIME 1
EOF

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



for cctk_hdr in time.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2627: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2632 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in sys/time.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2667: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2672 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in sys/types.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2707: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2712 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in unistd.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2747: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2752 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in string.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2787: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2792 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in assert.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2827: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2832 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in tgmath.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2867: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2872 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in sys/stat.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2907: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2912 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in getopt.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2947: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2952 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:2960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in dirent.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:2987: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2992 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in c_asm.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3027: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3032 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in intrinsics.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3067: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3072 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in mach/mach_time.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3107: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3112 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

echo $ac_n "checking for regex.h""... $ac_c" 1>&6
echo "configure:3144: checking for regex.h" >&5
if eval "test \"`echo '$''{'cctk_cv_header_regex_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3149 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <regex.h>
int main() {
return 0;
; return 0; }
EOF
if { (eval echo configure:3157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_regex_h=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_regex_h=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_regex_h'`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<EOF
#define HAVE_REGEX_H 1
EOF

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

for cctk_hdr in sys/filio.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3182: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3187 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in sys/ioctl.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3224: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3229 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in sys/socket.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3266: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3271 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in netinet/in.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3308: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3313 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in netdb.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3350: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3355 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in arpa/inet.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3392: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3397 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in winsock2.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3434: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3439 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in crypt.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3474: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3479 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in signal.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3516: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3521 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for cctk_hdr in malloc.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:3556: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3561 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:3569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3594: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3599 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:3608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_time=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_time=no
fi
rm -f conftest*
fi

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

fi


#Check type of socklen

# Check if we have socklen_t available
echo $ac_n "checking whether socklen_t is defined""... $ac_c" 1>&6
echo "configure:3633: checking whether socklen_t is defined" >&5
if eval "test \"`echo '$''{'cctk_cv_have_socklen_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3638 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
int main() {
socklen_t foo; return 0
; return 0; }
EOF
if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_have_socklen_t=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_have_socklen_t=no"
fi
rm -f conftest*

fi

if test "$cctk_cv_have_socklen_t" = 'yes'; then
  cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
EOF

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

# Check if someone has defined SOCKET
echo $ac_n "checking whether SOCKET is defined""... $ac_c" 1>&6
echo "configure:3683: checking whether SOCKET is defined" >&5
if eval "test \"`echo '$''{'cctk_cv_have_SOCKET'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3688 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
int main() {
SOCKET foo; return 0
; return 0; }
EOF
if { (eval echo configure:3708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_have_SOCKET=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_have_SOCKET=no"
fi
rm -f conftest*

fi

if test "$cctk_cv_have_SOCKET" = 'yes'; then
  cat >> confdefs.h <<\EOF
#define HAVE_SOCKET_TYPE 1
EOF

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

# Check for timing functions

echo $ac_n "checking for hrtime_t""... $ac_c" 1>&6
echo "configure:3734: checking for hrtime_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_hrtime_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3739 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])hrtime_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_hrtime_t=yes
else
  rm -rf conftest*
  ac_cv_type_hrtime_t=no
fi
rm -f conftest*

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

fi


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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:3798: \"$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 _rtc intrinsic""... $ac_c" 1>&6
echo "configure:3824: checking for _rtc intrinsic" >&5
rtc_ok=yes
cat > conftest.$ac_ext <<EOF
#line 3827 "configure"
#include "confdefs.h"
#ifdef HAVE_INTRINSICS_H
#include <intrinsics.h>
#endif
int main() {
_rtc()
; return 0; }
EOF
if { (eval echo configure:3836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE__RTC 1
EOF

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

# Check for memory allocation functions

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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:3885: \"$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


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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:3942: \"$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



# Check if M_MMAP_THRESHOLD is defined
echo $ac_n "checking whether M_MMAP_THRESHOLD is defined""... $ac_c" 1>&6
echo "configure:3970: checking whether M_MMAP_THRESHOLD is defined" >&5
if eval "test \"`echo '$''{'cctk_cv_have_M_MMAP_THRESHOLD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3975 "configure"
#include "confdefs.h"
#include <stdlib.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
int main() {
int x=M_MMAP_THRESHOLD; return 0
; return 0; }
EOF
if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_have_M_MMAP_THRESHOLD=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_have_M_MMAP_THRESHOLD=no"
fi
rm -f conftest*

fi

if test "$cctk_cv_have_M_MMAP_THRESHOLD" = 'yes'; then
  cat >> confdefs.h <<\EOF
#define HAVE_M_MMAP_THRESHOLD_VALUE 1
EOF

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


# Check if we have __int64
echo $ac_n "checking if __int64 is defined""... $ac_c" 1>&6
echo "configure:4011: checking if __int64 is defined" >&5
if eval "test \"`echo '$''{'cctk_cv_have___int64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4016 "configure"
#include "confdefs.h"

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

fi

if test "$cctk_cv_have___int64" = 'yes'; then
  CCTK_INT8='__int64'
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

# C++ STL stuff

if test "x$CXX" != 'xnone' ; then
  
  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

  for cctk_hdr in vector vector.h
do
cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6
echo "configure:4058: checking for $cctk_hdr" >&5
if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4063 "configure"
#include "confdefs.h"
 
#include <$cctk_hdr>
int main() {
 
; return 0; }
EOF
if { (eval echo configure:4071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_header_$cctk_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$cctk_cv_header_'$cctk_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    cctk_tr_hdr=HAVE_`echo $cctk_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
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

fi



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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4138: \"$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





if test "x$cctk_cv_header_getopt_h" = 'xyes' -a "x$ac_cv_func_getopt_long_only" = 'xyes'; then
  BUILD_GETOPT=no
else
  BUILD_GETOPT=yes
fi



if test "x$cctk_cv_header_regex_h" = 'xyes' ; then
  BUILD_REGEX=no
else
  BUILD_REGEX=yes
fi

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

int main() {

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

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

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

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

fi

#AC_C_INLINE
echo $ac_n "checking for C inline""... $ac_c" 1>&6
echo "configure:4257: checking for C inline" >&5
if eval "test \"`echo '$''{'cctk_cv_c_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_c_inline=no
for ac_kw in inline __inline__ __inline '__inline__ __attribute__((__gnu_inline__))'; do
  cat > conftest.$ac_ext <<EOF
#line 4264 "configure"
#include "confdefs.h"

int main() {
foo();
; return 0; }
EOF
cat > conftest2.$ac_ext <<EOF
#line 4272 "configure"
#include "confdefs.h"

int main2() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:4279: \"$ac_link conftest2.$ac_ext\") 1>&5; (eval $ac_link conftest2.$ac_ext) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cctk_cv_c_inline=$ac_kw; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done

fi

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

      cat >> confdefs.h <<\EOF
#define HAVE_CCTK_C_INLINE 1
EOF
 ;;
esac


echo $ac_n "checking for C restrict""... $ac_c" 1>&6
echo "configure:4310: checking for C restrict" >&5
if eval "test \"`echo '$''{'cctk_cv_c_restrict'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_c_restrict=no
for ac_kw in restrict __restrict__ __restrict; do
  cat > conftest.$ac_ext <<EOF
#line 4317 "configure"
#include "confdefs.h"

int main() {

double * $ac_kw foo;
void bar (void * $ac_kw arr[]);
struct tux { char * $ac_kw arr[3]; };

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

fi

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

echo $ac_n "checking for C++ restrict""... $ac_c" 1>&6
echo "configure:4354: checking for C++ restrict" >&5
if eval "test \"`echo '$''{'cctk_cv_cxx_restrict'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_cxx_restrict=no

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

for ac_kw in restrict __restrict__ __restrict; do
  cat > conftest.$ac_ext <<EOF
#line 4369 "configure"
#include "confdefs.h"

int main() {

double * $ac_kw foo;
void bar (void * $ac_kw arr[]);
struct tux { char * $ac_kw arr[3]; };

; return 0; }
EOF
if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_cxx_restrict=$ac_kw; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
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


fi

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


echo $ac_n "checking for C bool""... $ac_c" 1>&6
echo "configure:4414: checking for C bool" >&5
if eval "test \"`echo '$''{'cctk_cv_have_c_bool'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_c_bool=no
cat > conftest.$ac_ext <<EOF
#line 4420 "configure"
#include "confdefs.h"

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

fi

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

fi

echo $ac_n "checking for CXX bool""... $ac_c" 1>&6
echo "configure:4449: checking for CXX bool" >&5
if eval "test \"`echo '$''{'cctk_cv_have_cxx_bool'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_cxx_bool=no

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 4463 "configure"
#include "confdefs.h"

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


fi

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

fi


echo $ac_n "checking for Fortran REAL*4""... $ac_c" 1>&6
echo "configure:4500: checking for Fortran REAL*4" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_real4'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_real4=no

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

cat > conftest.$ac_ext <<EOF
      program main
      REAL*4 a
      end
EOF
if { (eval echo configure:4516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_real4=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_real4=no
fi
rm -f 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


fi

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

fi

echo $ac_n "checking for Fortran REAL*8""... $ac_c" 1>&6
echo "configure:4545: checking for Fortran REAL*8" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_real8'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_real8=no

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

cat > conftest.$ac_ext <<EOF
      program main
      REAL*8 a
      end
EOF
if { (eval echo configure:4561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_real8=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_real8=no
fi
rm -f 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


fi

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

fi

echo $ac_n "checking for Fortran REAL*16""... $ac_c" 1>&6
echo "configure:4590: checking for Fortran REAL*16" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_real16'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_real16=no

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

cat > conftest.$ac_ext <<EOF
      program main
      REAL*16 a
      end
EOF
if { (eval echo configure:4606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_real16=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_real16=no
fi
rm -f 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


fi

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

fi


echo $ac_n "checking for Fortran COMPLEX*8""... $ac_c" 1>&6
echo "configure:4636: checking for Fortran COMPLEX*8" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_complex8'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_complex8=no

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

cat > conftest.$ac_ext <<EOF
      program main
      COMPLEX*8 a
      end
EOF
if { (eval echo configure:4652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_complex8=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_complex8=no
fi
rm -f 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


fi

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

fi

echo $ac_n "checking for Fortran COMPLEX*16""... $ac_c" 1>&6
echo "configure:4681: checking for Fortran COMPLEX*16" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_complex16'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_complex16=no

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

cat > conftest.$ac_ext <<EOF
      program main
      COMPLEX*16 a
      end
EOF
if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_complex16=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_complex16=no
fi
rm -f 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


fi

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

fi

echo $ac_n "checking for Fortran COMPLEX*32""... $ac_c" 1>&6
echo "configure:4726: checking for Fortran COMPLEX*32" >&5
if eval "test \"`echo '$''{'cctk_cv_have_fortran_complex32'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cctk_cv_have_fortran_complex32=no

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

cat > conftest.$ac_ext <<EOF
      program main
      COMPLEX*32 a
      end
EOF
if { (eval echo configure:4742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cctk_cv_have_fortran_complex32=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cctk_cv_have_fortran_complex32=no
fi
rm -f 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


fi

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

fi


ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
echo $ac_n "checking for crypt""... $ac_c" 1>&6
echo "configure:4773: checking for crypt" >&5
if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4778 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char crypt(); 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 crypt();

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_crypt) || defined (__stub___crypt)
choke me
#else
crypt();
#endif

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

if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for crypt in library crypt""... $ac_c" 1>&6
echo "configure:4819: checking for crypt in library crypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="crypt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4828 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char crypt();

int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:4839: \"$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
    cctk_tr_lib=HAVE_LIB`echo crypt | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cctk_tr_func=HAVE_`echo crypt | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_lib 1
EOF

  cat >> confdefs.h <<EOF
#define $cctk_tr_func 1
EOF

  LIBS="crypt $LIBS"

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

fi



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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4908: \"$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
echo $ac_n "checking for finite in library m""... $ac_c" 1>&6
echo "configure:4930: checking for finite in library m" >&5
ac_lib_var=`echo m'_'finite | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="m  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4939 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char finite();

int main() {
finite()
; return 0; }
EOF
if { (eval echo configure:4950: \"$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
    cctk_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cctk_tr_func=HAVE_`echo finite | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_lib 1
EOF

  cat >> confdefs.h <<EOF
#define $cctk_tr_func 1
EOF

  LIBS="m $LIBS"

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

fi
done



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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5020: \"$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
echo $ac_n "checking for isnan in library m""... $ac_c" 1>&6
echo "configure:5042: checking for isnan in library m" >&5
ac_lib_var=`echo m'_'isnan | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="m  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5051 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char isnan();

int main() {
isnan()
; return 0; }
EOF
if { (eval echo configure:5062: \"$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
    cctk_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cctk_tr_func=HAVE_`echo isnan | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_lib 1
EOF

  cat >> confdefs.h <<EOF
#define $cctk_tr_func 1
EOF

  LIBS="m $LIBS"

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

fi
done



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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5132: \"$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
echo $ac_n "checking for isinf in library m""... $ac_c" 1>&6
echo "configure:5154: checking for isinf in library m" >&5
ac_lib_var=`echo m'_'isinf | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="m  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5163 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char isinf();

int main() {
isinf()
; return 0; }
EOF
if { (eval echo configure:5174: \"$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
    cctk_tr_lib=HAVE_LIB`echo m | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cctk_tr_func=HAVE_`echo isinf | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_lib 1
EOF

  cat >> confdefs.h <<EOF
#define $cctk_tr_func 1
EOF

  LIBS="m $LIBS"

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

fi
done



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

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:5244: \"$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
echo $ac_n "checking for mkstemp in library c""... $ac_c" 1>&6
echo "configure:5266: checking for mkstemp in library c" >&5
ac_lib_var=`echo c'_'mkstemp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="c  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5275 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mkstemp();

int main() {
mkstemp()
; return 0; }
EOF
if { (eval echo configure:5286: \"$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
    cctk_tr_lib=HAVE_LIB`echo c | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cctk_tr_func=HAVE_`echo mkstemp | sed -e 's/^a-zA-Z0-9_/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $cctk_tr_lib 1
EOF

  cat >> confdefs.h <<EOF
#define $cctk_tr_func 1
EOF

  LIBS="c $LIBS"

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

fi
done



echo $ac_n "checking for va_copy""... $ac_c" 1>&6
echo "configure:5325: checking for va_copy" >&5
if eval "test \"`echo '$''{'cctk_cv_have_va_copy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5330 "configure"
#include "confdefs.h"
#include <stdarg.h>
int main() {
va_list src, dest; va_copy(dest, src); return 0
; return 0; }
EOF
if { (eval echo configure:5337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "cctk_cv_have_va_copy=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "cctk_cv_have_va_copy=no"
fi
rm -f conftest*

fi

if test "$cctk_cv_have_va_copy" = 'yes'; then
  cat >> confdefs.h <<\EOF
#define HAVE_VA_COPY 1
EOF

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


if test "X$PTHREADS" = 'Xyes'; then
  PTHREAD_LIBS=
  echo $ac_n "checking for main in library c_r""... $ac_c" 1>&6
echo "configure:5364: checking for main in library c_r" >&5
ac_lib_var=`echo c_r'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="c_r  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5373 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5380: \"$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
  PTHREAD_LIBS="c_r" LIBS="$LIBS c_r"
else
  echo "$ac_t""no" 1>&6
fi

  echo $ac_n "checking for main in library pthread""... $ac_c" 1>&6
echo "configure:5401: checking for main in library pthread" >&5
ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="pthread  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5410 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5417: \"$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
  PTHREAD_LIBS="pthread $PTHREAD_LIBS"
else
  echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in library pthreads""... $ac_c" 1>&6
echo "configure:5436: checking for main in library pthreads" >&5
ac_lib_var=`echo pthreads'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5'
ac_save_LIBS="$LIBS"
LIBS="pthreads  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5445 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5452: \"$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
  PTHREAD_LIBS="pthreads $PTHREAD_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

                 
fi

fi










: ${PACKAGE_DIR=arrangements}
: ${BUILD_DIR=build}
: ${CCTK_LIBDIR=lib}
: ${EXEDIR='$(CCTK_HOME)/exe'}
: ${EXE=cactus-unknown}

# Integer types

case "x$ac_cv_sizeof_long_long" in
    'x8')
      CCTK_INT8='long long' ;;
    'x4')
      CCTK_INT4='long long' ;;
    'x2')
      CCTK_INT2='long long' ;;
esac

case "x$ac_cv_sizeof_long_int" in
    'x8')
      CCTK_INT8='long int' ;;
    'x4')
      CCTK_INT4='long int' ;;
    'x2')
      CCTK_INT2='long int' ;;
esac

case "x$ac_cv_sizeof_int" in
    'x8')
      CCTK_INT8='int' ;;
    'x4')
      CCTK_INT4='int' ;;
    'x2')
      CCTK_INT2='int' ;;
esac

case "x$ac_cv_sizeof_short_int" in
    'x8')
      CCTK_INT8='short int' ;;
    'x4')
      CCTK_INT4='short int' ;;
    'x2')
      CCTK_INT2='short int' ;;
esac

CCTK_INT1='signed char'

if test -n "$CCTK_INT8" ; then
  cat >> confdefs.h <<EOF
#define CCTK_INT8 $CCTK_INT8
EOF

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

fi

if test -n "$CCTK_INT4" ; then
  cat >> confdefs.h <<EOF
#define CCTK_INT4 $CCTK_INT4
EOF

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

fi

if test -n "$CCTK_INT2" ; then
  cat >> confdefs.h <<EOF
#define CCTK_INT2 $CCTK_INT2
EOF

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

fi

if test -n "$CCTK_INT1" ; then
  cat >> confdefs.h <<EOF
#define CCTK_INT1 $CCTK_INT1
EOF

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

fi

# Float types
case "x$ac_cv_sizeof_long_double" in
    'x16')
      CCTK_REAL16='long double' ;;
    'x8')
      CCTK_REAL8='long double' ;;
    'x4')
      CCTK_REAL4='long double' ;;
esac

case "x$ac_cv_sizeof_double" in
    'x16')
      CCTK_REAL16='double' ;;
    'x8')
      CCTK_REAL8='double' ;;
    'x4')
      CCTK_REAL4='double' ;;
esac

case "x$ac_cv_sizeof_float" in
    'x16')
      CCTK_REAL16='float' ;;
    'x8')
      CCTK_REAL8='float' ;;
    'x4')
      CCTK_REAL4='float' ;;
esac

if test "x$DISABLE_REAL16" != 'xyes' -a "x$DISABLE_REAL16" != 'xno' -a "x$DISABLE_REAL16" != 'x'; then
    { echo "configure: error: Didn't recognise setting of DISABLE_REAL16=\"$DISABLE_REAL16\"; should be either \"yes\" or \"no\" or \"\" (empty)" 1>&2; exit 1; }
fi

if test -n "$CCTK_REAL16" -a \( "x$F77" = 'xnone' -o \( "x$cctk_cv_have_fortran_real16" = 'xyes' -a "x$cctk_cv_have_fortran_complex32" = 'xyes' \) \) -a "x$DISABLE_REAL16" != 'xyes' ; then
  cat >> confdefs.h <<EOF
#define CCTK_REAL16 $CCTK_REAL16
EOF

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

fi

if test -n "$CCTK_REAL8" -a \( "x$F77" = 'xnone' -o \( "x$cctk_cv_have_fortran_real8" -a "x$cctk_cv_have_fortran_complex16" = 'xyes' \) \); then
  cat >> confdefs.h <<EOF
#define CCTK_REAL8 $CCTK_REAL8
EOF

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

fi

if test -n "$CCTK_REAL4" -a \( "x$F77" = 'xnone' -o \( "x$cctk_cv_have_fortran_real4" = 'xyes' -a "x$cctk_cv_have_fortran_complex8" = 'xyes' \) \); then
  cat >> confdefs.h <<EOF
#define CCTK_REAL4 $CCTK_REAL4
EOF

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

fi


# Define the default floating point and integer precisions
case "x$REAL_PRECISION" in
  'x16')
    cat >> confdefs.h <<\EOF
#define CCTK_REAL_PRECISION_16 1
EOF
 ;;
  'x8')
    cat >> confdefs.h <<\EOF
#define CCTK_REAL_PRECISION_8 1
EOF
 ;;
  'x4')
    cat >> confdefs.h <<\EOF
#define CCTK_REAL_PRECISION_4 1
EOF
 ;;
  *)
    cat >> confdefs.h <<\EOF
#define CCTK_REAL_PRECISION_8 1
EOF
 ;;
esac

case "x$INTEGER_PRECISION" in
  'x8')
    cat >> confdefs.h <<\EOF
#define CCTK_INTEGER_PRECISION_8 1
EOF
 ;;
  'x4')
    cat >> confdefs.h <<\EOF
#define CCTK_INTEGER_PRECISION_4 1
EOF
 ;;
  'x2')
    cat >> confdefs.h <<\EOF
#define CCTK_INTEGER_PRECISION_2 1
EOF
 ;;
  *)
    cat >> confdefs.h <<\EOF
#define CCTK_INTEGER_PRECISION_4 1
EOF
 ;;
esac

# Define any code needed before the definition of a Fortran subroutine
# This is empty on most architectures.
: ${CCTK_FCALL=''}
cat >> confdefs.h <<EOF
#define CCTK_FCALL $CCTK_FCALL
EOF



# Decide whether the preprocessed C and Fortran files should contain
# C preprocessor line directives to point to the original source file

# Test for valid setting of option C_LINE_DIRECTIVES/F_LINE_DIRECTIVES
if test -n "$C_LINE_DIRECTIVES" ; then
  
  C_LINE_DIRECTIVES=`echo $C_LINE_DIRECTIVES | tr '[:upper:]' '[:lower:]'`
  
  if test "$C_LINE_DIRECTIVES" != 'yes' -a "$C_LINE_DIRECTIVES" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of C_LINE_DIRECTIVES=\"$C_LINE_DIRECTIVES\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
else
  C_LINE_DIRECTIVES='no'
fi
if test -n "$F_LINE_DIRECTIVES"; then
  
  F_LINE_DIRECTIVES=`echo $F_LINE_DIRECTIVES | tr '[:upper:]' '[:lower:]'`
  
  if test "$F_LINE_DIRECTIVES" != 'yes' -a "$F_LINE_DIRECTIVES" != 'no' ; then
    { echo "configure: error: Didn't recognize setting of F_LINE_DIRECTIVES=\"$F_LINE_DIRECTIVES\" (should be either \"yes\" or \"no\")" 1>&2; exit 1; }
  fi
else
  F_LINE_DIRECTIVES='no'
fi

cat >> confdefs.h <<EOF
#define C_LINE_DIRECTIVES "$C_LINE_DIRECTIVES"
EOF

cat >> confdefs.h <<EOF
#define F_LINE_DIRECTIVES "$F_LINE_DIRECTIVES"
EOF





# Define how to make a directory in the config.h file
cat >> confdefs.h <<EOF
#define MKDIR "$MKDIR"
EOF


: ${MKDIRFLAGS='-p'}
cat >> confdefs.h <<EOF
#define MKDIRFLAGS " $MKDIRFLAGS "
EOF



# The perl scripts run by the make system need to have their names
# changed if under cygwin - e.g. //d/foo needs to be d:/foo
PERL_CONFIGURE_SCRIPT="$srcdir/configure.pl"
if test "$host_os" = 'cygwin' ; then
  PERL_CONFIGURE_SCRIPT=`echo $PERL_CONFIGURE_SCRIPT | sed 's,^/cygdrive/\(.\)/,\1:/,' | sed 's,^//\(.\)/,\1:/,'`
fi



BUILD_ACTIVETHORNS='$(CCTK_HOME)/lib/sbin/BuildActiveThorns.pl'


CST='$(CCTK_HOME)/lib/sbin/CST'


F_FILE_PROCESSOR='$(CCTK_HOME)/lib/sbin/f_file_processor.pl'

C_FILE_PROCESSOR='$(CCTK_HOME)/lib/sbin/c_file_processor.pl'

# Put the libraries from the known-architectures onto the LIB variable.
LIBS="$LIBS $KNOWN_LIBS"
LDFLAGS="$LDFLAGS $KNOWN_LDFLAGS"

#Set the compileonly flags if they've not been set by now


: ${CCOMPILEONLY='-c -o'}
: ${FCOMPILEONLY='-c -o'}


# Set the createexe flag if it's not been set by now

: ${CREATEEXE='-o'}

# Set the directory seperator for this architecture

: ${DIRSEP='/'}

# Set the option seperator for this architecture.  Hopefully it is the same for all compilers.

: ${OPTIONSEP='$(EMPTY_VAR) # a single space'}

# How to name libraries for this system

: ${LIBNAME_PREFIX='lib'}

: ${LIBNAME_SUFFIX='.a'}

# How to link the cactus libraries

: ${CACTUSLIBLINKLINE='-L$(CCTK_LIBDIR) $(addprefix -l, $(ALLCACTUSLIBS))'}

# How to generate dependency info

: ${C_DEPEND='$(CC) -E -M $(CPPFLAGS)'}

: ${C_DEPEND_OUT=' > $@'}


: ${CXX_DEPEND='$(CXX) -E -M $(CPPFLAGS)'}

: ${CXX_DEPEND_OUT=' > $@'}


: ${F77_DEPEND='$(FPP) -M $(FPPFLAGS)'}

: ${F77_DEPEND_OUT=' > $@'}


: ${F_DEPEND='$(FPP) -M $(FPPFLAGS)'}

: ${F_DEPEND_OUT=' > $@'}

# How to generate F90 dependency info for modules

: ${F_DEPEND_MODULES='$(CCTK_HOME)/lib/sbin/f_depend_modules.pl'}

: ${F_DEPEND_MODULES_OUT=' >> $@'}

# Postprocessing of object files.  Most architectures don't need to do this at all.

: ${C_POSTPROCESSING=''}

: ${CXX_POSTPROCESSING=''}

: ${F77_POSTPROCESSING=''}

: ${F_POSTPROCESSING=''}

: ${F90_POSTPROCESSING=''}

# How to generate an intermediate C++ name (some compilers are very picky).

: ${CXX_WORKING_NAME='$(notdir $<)'}

# What is the suffix for freeformat f90 names (some compilers are very picky).

: ${F90_SUFFIX='f90'}

# How to get the current working directory when in the shell

: ${GET_WD='pwd'}

# Way for Make to transofrm things like include directories
# into a form suitable for the compiler.

: ${TRANSFORM_DIRS='$(1)'}

# Any additional system include directories.

: ${SYS_INC_DIRS=' '}

# How to link in the non-Cactus libraries:
# Add -L and -l prefixes, but only for file names;
# allow arbitrary options in between

: ${GENERAL_LIBRARIES='$(patsubst -L-%,-%,$(LIBDIRS:%=-L%)) $(patsubst -l-%,-%,$(LIBS:%=-l%))'}


# Do we need to make sure Perl makes a backup when editting in place ?

: ${PERL_BACKUP_NECESSARY=''}

# Cache stuff - this will probably change
: ${CACHELINE_BYTES='0'}
: ${CACHE_SIZE='0'}
cat >> confdefs.h <<EOF
#define CCTK_CACHELINE_BYTES $CACHELINE_BYTES
EOF

cat >> confdefs.h <<EOF
#define CCTK_CACHE_SIZE $CACHE_SIZE
EOF



#########################################################################
#Check for extra stuff
#########################################################################
CCTK_CreateFile cctk_Extradefs.h '/* Stuff from extra packages */'
CCTK_WriteLine  cctk_Extradefs.h '#ifndef _CCTK_EXTRADEFS_H_'
CCTK_WriteLine  cctk_Extradefs.h '#define _CCTK_EXTRADEFS_H_'

CCTK_CreateFile make.extra.defn '# Stuff from extra packages '

for extra in `ls $srcdir/extras`
do
  if test -d $srcdir/extras/$extra ; then
    if test -x $srcdir/extras/$extra/setup.sh ; then
        # Put some comment lines in the files.
        CCTK_WriteLine cctk_Extradefs.h ''
        CCTK_WriteLine cctk_Extradefs.h '/* $extra definitions */'
        CCTK_WriteLine make.extra.defn ''
        CCTK_WriteLine make.extra.defn "# $extra definitions"
        # Call the setup script
        . $srcdir/extras/$extra/setup.sh
    fi
  fi
done

# Find the X libraries in case people need them
# Commented out as should now be able able to use configure.ccl scripts
# to do this on an individual basis.

if test "x$CCTK_NEED_X" = 'xyes' ; then 
# If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:5918: checking for X" >&5

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

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

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

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

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

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

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

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

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

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

fi



X_LIB_DIR="$x_libraries"
X_INC_DIR="$x_includes"

# Finish the cctk_Extradefs.h file
CCTK_WriteLine cctk_Extradefs.h ''
CCTK_WriteLine cctk_Extradefs.h '#endif /*_CCTK_EXTRADEFS_H*/'




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

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

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

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

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

DEFS=-DHAVE_CONFIG_H

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

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

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

ac_given_srcdir=$srcdir

trap 'rm -fr `echo "make.config.defn make.config.deps make.config.rules cctk_Config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@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%@SET_MAKE@%$SET_MAKE%g
s%@CC@%$CC%g
s%@CXX@%$CXX%g
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@FPPFLAGS@%$FPPFLAGS%g
s%@FPP@%$FPP%g
s%@PERL@%$PERL%g
s%@F90@%$F90%g
s%@F77@%$F77%g
s%@AR@%$AR%g
s%@MKDIR@%$MKDIR%g
s%@LD@%$LD%g
s%@WARN_MODE@%$WARN_MODE%g
s%@C_WARN_FLAGS@%$C_WARN_FLAGS%g
s%@CXX_WARN_FLAGS@%$CXX_WARN_FLAGS%g
s%@F77_WARN_FLAGS@%$F77_WARN_FLAGS%g
s%@F90_WARN_FLAGS@%$F90_WARN_FLAGS%g
s%@DEBUG_MODE@%$DEBUG_MODE%g
s%@C_DEBUG_FLAGS@%$C_DEBUG_FLAGS%g
s%@CXX_DEBUG_FLAGS@%$CXX_DEBUG_FLAGS%g
s%@F77_DEBUG_FLAGS@%$F77_DEBUG_FLAGS%g
s%@F90_DEBUG_FLAGS@%$F90_DEBUG_FLAGS%g
s%@OPTIMISE_MODE@%$OPTIMISE_MODE%g
s%@C_OPTIMISE_FLAGS@%$C_OPTIMISE_FLAGS%g
s%@CXX_OPTIMISE_FLAGS@%$CXX_OPTIMISE_FLAGS%g
s%@F77_OPTIMISE_FLAGS@%$F77_OPTIMISE_FLAGS%g
s%@F90_OPTIMISE_FLAGS@%$F90_OPTIMISE_FLAGS%g
s%@PROFILE_MODE@%$PROFILE_MODE%g
s%@C_PROFILE_FLAGS@%$C_PROFILE_FLAGS%g
s%@CXX_PROFILE_FLAGS@%$CXX_PROFILE_FLAGS%g
s%@F77_PROFILE_FLAGS@%$F77_PROFILE_FLAGS%g
s%@F90_PROFILE_FLAGS@%$F90_PROFILE_FLAGS%g
s%@OPENMP_MODE@%$OPENMP_MODE%g
s%@C_OPENMP_FLAGS@%$C_OPENMP_FLAGS%g
s%@CXX_OPENMP_FLAGS@%$CXX_OPENMP_FLAGS%g
s%@F77_OPENMP_FLAGS@%$F77_OPENMP_FLAGS%g
s%@F90_OPENMP_FLAGS@%$F90_OPENMP_FLAGS%g
s%@ARFLAGS@%$ARFLAGS%g
s%@USE_RANLIB@%$USE_RANLIB%g
s%@RANLIBFLAGS@%$RANLIBFLAGS%g
s%@F90FLAGS@%$F90FLAGS%g
s%@F77FLAGS@%$F77FLAGS%g
s%@CPP_VERSION@%$CPP_VERSION%g
s%@CC_VERSION@%$CC_VERSION%g
s%@CXX_VERSION@%$CXX_VERSION%g
s%@FPP_VERSION@%$FPP_VERSION%g
s%@F77_VERSION@%$F77_VERSION%g
s%@F90_VERSION@%$F90_VERSION%g
s%@BUILD_GETOPT@%$BUILD_GETOPT%g
s%@BUILD_REGEX@%$BUILD_REGEX%g
s%@LIBDIRS@%$LIBDIRS%g
s%@PACKAGE_DIR@%$PACKAGE_DIR%g
s%@BUILD_DIR@%$BUILD_DIR%g
s%@CCTK_LIBDIR@%$CCTK_LIBDIR%g
s%@EXEDIR@%$EXEDIR%g
s%@EXE@%$EXE%g
s%@C_LINE_DIRECTIVES@%$C_LINE_DIRECTIVES%g
s%@F_LINE_DIRECTIVES@%$F_LINE_DIRECTIVES%g
s%@MKDIRFLAGS@%$MKDIRFLAGS%g
s%@BUILD_ACTIVETHORNS@%$BUILD_ACTIVETHORNS%g
s%@CST@%$CST%g
s%@F_FILE_PROCESSOR@%$F_FILE_PROCESSOR%g
s%@C_FILE_PROCESSOR@%$C_FILE_PROCESSOR%g
s%@CCOMPILEONLY@%$CCOMPILEONLY%g
s%@FCOMPILEONLY@%$FCOMPILEONLY%g
s%@CREATEEXE@%$CREATEEXE%g
s%@DIRSEP@%$DIRSEP%g
s%@OPTIONSEP@%$OPTIONSEP%g
s%@LIBNAME_PREFIX@%$LIBNAME_PREFIX%g
s%@LIBNAME_SUFFIX@%$LIBNAME_SUFFIX%g
s%@CACTUSLIBLINKLINE@%$CACTUSLIBLINKLINE%g
s%@C_DEPEND@%$C_DEPEND%g
s%@C_DEPEND_OUT@%$C_DEPEND_OUT%g
s%@CXX_DEPEND@%$CXX_DEPEND%g
s%@CXX_DEPEND_OUT@%$CXX_DEPEND_OUT%g
s%@F77_DEPEND@%$F77_DEPEND%g
s%@F77_DEPEND_OUT@%$F77_DEPEND_OUT%g
s%@F_DEPEND@%$F_DEPEND%g
s%@F_DEPEND_OUT@%$F_DEPEND_OUT%g
s%@F_DEPEND_MODULES@%$F_DEPEND_MODULES%g
s%@F_DEPEND_MODULES_OUT@%$F_DEPEND_MODULES_OUT%g
s%@C_POSTPROCESSING@%$C_POSTPROCESSING%g
s%@CXX_POSTPROCESSING@%$CXX_POSTPROCESSING%g
s%@F77_POSTPROCESSING@%$F77_POSTPROCESSING%g
s%@F_POSTPROCESSING@%$F_POSTPROCESSING%g
s%@F90_POSTPROCESSING@%$F90_POSTPROCESSING%g
s%@CXX_WORKING_NAME@%$CXX_WORKING_NAME%g
s%@F90_SUFFIX@%$F90_SUFFIX%g
s%@GET_WD@%$GET_WD%g
s%@TRANSFORM_DIRS@%$TRANSFORM_DIRS%g
s%@SYS_INC_DIRS@%$SYS_INC_DIRS%g
s%@GENERAL_LIBRARIES@%$GENERAL_LIBRARIES%g
s%@PERL_BACKUP_NECESSARY@%$PERL_BACKUP_NECESSARY%g
s%@X_LIB_DIR@%$X_LIB_DIR%g
s%@X_INC_DIR@%$X_INC_DIR%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-"make.config.defn make.config.deps make.config.rules"}
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="cctk_Config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

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

EOF

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

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

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

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

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

EOF
cat >> $CONFIG_STATUS <<EOF
$PERL -s $PERL_CONFIGURE_SCRIPT -compiler_f77="$F77" -opts_f77="$F77FLAGS" -compiler_f90="$F90" -opts_f90="$F90FLAGS" .

EOF
cat >> $CONFIG_STATUS <<\EOF


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

