#!/bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.1 
# Copyright (C) 1992, 1993, 1994 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

# Initialize some other variables.
subdirs=

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

  -build | --build | --buil | --bui | --bu | --b)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
    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" ;;

  -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=PREFIX    install architecture-dependent files in PREFIX
                          [same as prefix]
  --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
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
--enable and --with options recognized:$ac_help
EOF
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$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 ;;

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

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

  -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.1"
    exit 0 ;;

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

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

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

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

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

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

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

  esac
done

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

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

# File descriptor usage:
# 0 unused; standard input
# 1 file creation
# 2 errors and warnings
# 3 unused; some systems may open it to /dev/tty
# 4 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 4>/dev/null
else
  exec 4>&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 LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi

# 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=lispbibl.d

# 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} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'

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='	' ac_tt=
  else
    ac_n=-n ac_c= ac_t= ac_tt='
         '
  fi
else
  ac_n= ac_c='\c' ac_t= ac_tt='
         '
fi



# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
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="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&4
else
  echo "$ac_t""no" 1>&4
fi


echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
  # Add "-O" to both the CC and CPP commands, to eliminate possible confusion
  # that results from __OPTIMIZE__ being defined for CC but not CPP.
  CC="$CC -O"
else
  ac_cv_prog_gcc=no
fi

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

                      echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
# 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>&4
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"
  if test -n "$GCC"; then
    # Suppress warning messages.
    CPP="$CPP -w"
  fi
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp. On NeXTstep 3.1 the same holds for /lib/cpp; use
  # "cc -E -traditional-cpp" instead.
  cat > conftest.$ac_ext <<EOF
#line 481 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_have_cpp=1
else
  echo "$ac_err" >&5
fi
rm -f conftest*
  if test -z "$ac_have_cpp"; then
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
#line 498 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  CC="${CC-cc} -traditional-cpp"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
  fi
  ac_cv_prog_CC="$CC"
  ac_cv_prog_CPP="$CPP"
fi
fi
CPP="$ac_cv_prog_CPP"
echo "$ac_t""$CPP" 1>&4

                      if test $ac_cv_prog_gcc = yes; then
  echo $ac_n "checking whether -traditional is needed for ${CC-cc} on this system""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
    ac_pattern="Autoconf.*'x'"
  cat > conftest.$ac_ext <<EOF
#line 529 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "$ac_pattern" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=yes
else
  rm -rf conftest*
  ac_cv_prog_gcc_traditional=no
fi
rm -f conftest*


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

  fi
  if test $ac_cv_prog_gcc_traditional = no; then
    # On some USL SVR4 systems, gcc's fixinc.svr4 modifies <signal.h> and
    # <sys/signal.h> in such a way that "#include <signal.h>" results in a
    # syntax error because of `sigset_t' if gcc is called with __STDC__=1
    # but __STRICT_ANSI__ undefined. Remedy: use -traditional.
    ac_prog='
#include <sys/types.h>
#include <signal.h>
int main() { exit(0); }'
    echo "$ac_prog" > conftest.c
    if eval $ac_link; then
      :
    else
      ac_prog='
#undef __STDC__
#include <sys/types.h>
#include <signal.h>
int main() { exit(0); }'
      echo "$ac_prog" > conftest.c
      if eval $ac_link; then
        ac_cv_prog_gcc_traditional=yes
      fi
    fi
    rm -f conftest*
  fi
fi
  echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&4
  if test $ac_cv_prog_gcc_traditional = yes; then
    CC="$CC -traditional"
  fi
fi

                      echo $ac_n "checking for AIX""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_sys_aix'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 598 "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_sys_aix=yes
else
  rm -rf conftest*
  ac_cv_sys_aix=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_sys_aix" 1>&4
if test $ac_cv_sys_aix = yes; then
  cat >> confdefs.h <<\EOF
#define _ALL_SOURCE 1
EOF

fi

                      echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_sys_isc_posix'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test -d /etc/conf/kconfig.d &&
  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
  ac_cv_sys_isc_posix=yes
else
  ac_cv_sys_isc_posix=no
fi

fi

echo "$ac_t""$ac_cv_sys_isc_posix" 1>&4
if test $ac_cv_sys_isc_posix = yes; then
  ISC=yes # If later tests want to check for ISC.
  cat >> confdefs.h <<\EOF
#define _POSIX_SOURCE 1
EOF

  if test "$GCC" = yes; then
    CC="$CC -posix"
  else
    CC="$CC -Xp"
  fi
else
  ISC=
fi

                      ac_safe=`echo "minix/config.h" | tr './\055' '___'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 662 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  MINIX=yes
else
  echo "$ac_t""no" 1>&4
MINIX=
fi

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

  cat >> confdefs.h <<\EOF
#define _POSIX_1_SOURCE 2
EOF

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

fi

                      
echo $ac_n "checking whether using GNU C""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 708 "configure"
#include "confdefs.h"
#ifdef __GNUC__
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_prog_cc_gcc=yes
else
  rm -rf conftest*
  cl_cv_prog_cc_gcc=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_prog_cc_gcc" 1>&4
if test $cl_cv_prog_cc_gcc = yes; then
  CC_GCC=true
else
  CC_GCC=false
fi

                      
echo $ac_n "checking whether using ANSI C""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_ansi'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 742 "configure"
#include "confdefs.h"
#ifdef __STDC__
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_prog_cc_ansi=yes
else
  rm -rf conftest*
  cl_cv_prog_cc_ansi=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_prog_cc_ansi" 1>&4
if test $cl_cv_prog_cc_ansi = yes; then
  CC_ANSI=true
else
  CC_ANSI=false
fi

                      
echo $ac_n "checking whether CPP likes indented directives""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_indented'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 776 "configure"
#include "confdefs.h"
 #define foo
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "#.*foo" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_prog_cc_indented=no
else
  rm -rf conftest*
  cl_cv_prog_cc_indented=yes
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_prog_cc_indented" 1>&4
if test $cl_cv_prog_cc_indented = yes; then
  CC_NEED_CCPAUX=false
else
  CC_NEED_CCPAUX=true
fi

                      
sharp='#elif'
echo $ac_n "checking whether CPP understands $sharp""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_elif'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 808 "configure"
#include "confdefs.h"
#if 0
#elif 1
#else
#endif
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  cl_cv_prog_cc_elif=yes
else
  echo "$ac_err" >&5
  rm -rf conftest*
  cl_cv_prog_cc_elif=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_cc_elif" 1>&4
if test $cl_cv_prog_cc_elif = yes; then
  CC_NEED_DEELIF=false
else
  CC_NEED_DEELIF=true
fi

                      
sharp='#error'
echo $ac_n "checking whether CPP understands $sharp""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_error'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 844 "configure"
#include "confdefs.h"
#if 0
#error "bla"
#endif
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  cl_cv_prog_cc_error=yes
else
  echo "$ac_err" >&5
  rm -rf conftest*
  cl_cv_prog_cc_error=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_cc_error" 1>&4
if test $cl_cv_prog_cc_error = yes; then
  CC_NEED_DEERROR=false
else
  CC_NEED_DEERROR=true
fi

                      
echo $ac_n "checking whether CPP likes empty macro arguments""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_ema'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 878 "configure"
#include "confdefs.h"
#define divide(x,y,q_zuw,r_zuw) (r_zuw(x)-(q_zuw(x)/(y))*(y))
foo(x,y) int x,y; { int q; divide(x,y,q=,); return q; }
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  cl_cv_prog_cc_ema=yes
else
  echo "$ac_err" >&5
  rm -rf conftest*
  cl_cv_prog_cc_ema=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_cc_ema" 1>&4
if test $cl_cv_prog_cc_ema = yes; then
  CC_NEED_DEEMA=false
else
  CC_NEED_DEEMA=true
fi

                      
echo $ac_n "checking whether CC merges adjacent strings""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_mergestrings'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 911 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
char* foo = "abc" "def";
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_prog_cc_mergestrings=yes
else
  rm -rf conftest*
  cl_cv_prog_cc_mergestrings=no
fi
rm -f conftest*

rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_cc_mergestrings" 1>&4
if test $cl_cv_prog_cc_mergestrings = yes; then
  CC_NEED_MERGESTRINGS=false
else
  CC_NEED_MERGESTRINGS=true
fi

                      echo $ac_n "checking for underscore in external names""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_as_underscore'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.c <<EOF
int foo() { return 0; }
EOF
${CC-cc} -c conftest.c >/dev/null 2>&1
# check whether nm exists
if (nm conftest.o) >/dev/null 2>&1 ; then
  # use nm to see the assembly language name
  if nm conftest.o | grep _foo >/dev/null 2>&1 ; then
    cl_cv_prog_as_underscore=yes
  else
    cl_cv_prog_as_underscore=no
  fi
else
  # look for the assembly language name in the .s file
  ${CC-cc} -S conftest.c >/dev/null 2>&1
  if grep _foo conftest.s >/dev/null ; then
    cl_cv_prog_as_underscore=yes
  else
    cl_cv_prog_as_underscore=no
  fi
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_as_underscore" 1>&4
if test $cl_cv_prog_as_underscore = yes; then
  AS_UNDERSCORE=true
else
  AS_UNDERSCORE=false
fi

                      # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
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="${IFS}:"
  for ac_dir in $PATH; 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="true"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&4
else
  echo "$ac_t""no" 1>&4
fi

                      # Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
if test -z "$INSTALL"; then
if eval "test \"`echo '${'cl_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    case "$ac_dir" in
    ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      for ac_prog in ginstall installbsd scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    # OSF/1 installbsd also uses dspmsg, but is usable.
	    :
	  else
	    cl_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_ifs"
  # As a last resort, use cp.
  test -z "$cl_cv_path_install" && cl_cv_path_install="cp"

fi
  INSTALL="$cl_cv_path_install"
fi
echo "$ac_t""$INSTALL" 1>&4
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
if test -z "$INSTALL_DATA"; then
  case "$INSTALL" in
    cp | */cp ) INSTALL_DATA='$(INSTALL)' ;;
    * )         INSTALL_DATA='$(INSTALL) -m 644' ;;
  esac
fi

                      echo $ac_n "checking how to copy files""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
echo "blabla" > conftest.x
err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1"`
if test -z "$err"; then
  cl_cv_prog_cp='cp -p'
else
  cl_cv_prog_cp='cp'
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_cp" 1>&4
CP="$cl_cv_prog_cp"

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

                      echo $ac_n "checking for getpwnam""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_getpwnam'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 1103 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_getpwnam) || defined (__stub___getpwnam)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_getpwnam=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 1121 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char getpwnam(); 

int main() { return 0; }
int t() {

getpwnam();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_getpwnam=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_getpwnam=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'getpwnam`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  have_getpwnam=1
else
  echo "$ac_t""no" 1>&4
fi

if test -z "$have_getpwnam"; then
  echo $ac_n "checking for -lsun""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_lib_sun'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lsun "
cat > conftest.$ac_ext <<EOF
#line 1161 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
getpwnam()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_sun=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_sun=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'sun`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_lib=HAVE_LIB`echo sun | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="$LIBS -lsun"

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

fi

                      echo $ac_n "checking for DYNIX/ptx libseq or libsocket""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_lib_sequent'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 1201 "configure"
#include "confdefs.h"
#if defined(_SEQUENT_)
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_lib_sequent=yes
else
  rm -rf conftest*
  cl_cv_lib_sequent=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_lib_sequent" 1>&4
if test $cl_cv_lib_sequent = yes; then
echo $ac_n "checking for -lseq""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_lib_seq'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lseq "
cat > conftest.$ac_ext <<EOF
#line 1230 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
main()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_seq=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_seq=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'seq`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  LIBS="$LIBS -lseq"
else
  echo "$ac_t""no" 1>&4
fi

echo $ac_n "checking for -lsocket""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_lib_socket'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lsocket "
cat > conftest.$ac_ext <<EOF
#line 1263 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
main()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_socket=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_socket=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'socket`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  LIBS="$LIBS -lsocket"
else
  echo "$ac_t""no" 1>&4
fi

fi

                      echo $ac_n "checking whether gethostbyname requires -lsocket""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_lib_socket'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cl_cv_lib_socket=no
cat > conftest.$ac_ext <<EOF
#line 1298 "configure"
#include "confdefs.h"
extern char gethostbyname();
int main() { return 0; }
int t() {
gethostbyname();
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  have_gethostbyname=1
fi
rm -f conftest*

if test -z "$have_gethostbyname"; then
cl_save_LIBS="$LIBS"
LIBS="$LIBS -lsocket"
cat > conftest.$ac_ext <<EOF
#line 1316 "configure"
#include "confdefs.h"
extern char gethostbyname();
int main() { return 0; }
int t() {
gethostbyname();
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_lib_socket=yes
fi
rm -f conftest*

LIBS="$cl_save_LIBS"
fi

fi

echo "$ac_t""$cl_cv_lib_socket" 1>&4
if test $cl_cv_lib_socket = yes; then
  LIBS="$LIBS -lsocket"
fi

                      # If we cannot run a trivial program, we must be cross compiling.
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  if test "$cross_compiling" = yes; then
  ac_cv_cross=yes
else
cat > conftest.$ac_ext <<EOF
#line 1349 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_c_cross=no
else
  ac_cv_c_cross=yes
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
cross_compiling=$ac_cv_c_cross
echo "$ac_t""$ac_cv_c_cross" 1>&4

echo $ac_n "checking whether CC works at all""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_cc_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_prog_cc_works="guessing yes"
else
cat > conftest.$ac_ext <<EOF
#line 1383 "configure"
#include "confdefs.h"
main() { exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_prog_cc_works=yes
else
  cl_cv_prog_cc_works=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_prog_cc_works" 1>&4
case "$cl_cv_prog_cc_works" in
  *no) echo "Installation or configuration problem: C compiler cannot create executables."; exit 1;;
  *yes) ;;
esac

                      echo $ac_n "checking for broken HP/UX, A/UX, OSF/1 and NeXTstep shell""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_prog_sh_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test $cross_compiling = no; then
# A program that outputs its argument count:
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdio.h>
#ifdef __STDC__
main (int argc, char** argv)
#else
main (argc,argv) int argc; char** argv;
#endif
{ printf("%d\n",argc); exit(0); }
EOF
eval $ac_link
# How can a shell script forward its arguments to another program?
#                                    $ * "$ *" "$ @"
# conftest.sh                         1    2     1 (*)
# conftest.sh foo                     2    2     2
# conftest.sh foo bar                 3    2     3
# conftest.sh "foo bar"               3    2     2
# (*): 2 with HP-UX /bin/sh. We must use /bin/ksh instead.
#      2 as well with NeXTstep /bin/sh. No /bin/ksh. Examine 0 first.
psubs='"$''@"'
cat > conftest.sh <<EOF
#!/bin/sh
exec ./conftest $psubs
EOF
chmod a+x conftest.sh
if test `./conftest.sh` = "1"; then
  cl_cv_prog_sh_broken=no
  cl_cv_prog_sh_good='/bin/sh'
else
  cl_cv_prog_sh_broken=yes
  if test -x /bin/ksh; then
    cl_cv_prog_sh_good='/bin/ksh'
  else
    cl_cv_prog_sh_good=''
  fi
fi
else
cl_cv_prog_sh_broken="guessing no"
cl_cv_prog_sh_good='/bin/sh'
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_prog_sh_broken" 1>&4
GOOD_SH="$cl_cv_prog_sh_good"
if test "$GOOD_SH" = '/bin/ksh'; then
  cat >> confdefs.h <<\EOF
#define UNIX_USE_KSH 1
EOF

fi
if test "$GOOD_SH" = ''; then
  cat >> confdefs.h <<\EOF
#define UNIX_BROKEN_SH 1
EOF

fi

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

int main() { return 0; }
int t() {

/* 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;
/* 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 $ac_compile; then
  rm -rf conftest*
  ac_cv_c_const=yes
else
  rm -rf conftest*
  ac_cv_c_const=no
fi
rm -f conftest*

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

fi

                      echo $ac_n "checking for inline""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_c_inline'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  if test "$GCC" = yes; then
cat > conftest.$ac_ext <<EOF
#line 1558 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
} inline foo() {
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  ac_cv_c_inline=yes
else
  rm -rf conftest*
  ac_cv_c_inline=__inline
fi
rm -f conftest*

else
  ac_cv_c_inline=no
fi
fi
echo "$ac_t""$ac_cv_c_inline" 1>&4
if test $ac_cv_c_inline != yes -a $ac_cv_c_inline != no; then
  cat >> confdefs.h <<EOF
#define inline $ac_cv_c_inline
EOF

fi

                      
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking for __nowarn__""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_c_nowarn'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 1595 "configure"
#include "confdefs.h"
int x;
int main() { return 0; }
int t() {
__nowarn__ x;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_c_nowarn=yes
else
  rm -rf conftest*
  cl_cv_c_nowarn=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_c_nowarn" 1>&4
if test $cl_cv_c_nowarn = yes; then
  have_nowarn=1
fi

fi
if test -z "$have_nowarn"; then
cat >> confdefs.h <<\EOF
#define __nowarn__ 
EOF

fi

                      echo $ac_n "checking for working void""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_c_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 1634 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
void f();
typedef void x; x g();
typedef void* y; y a;

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_c_void=yes
else
  rm -rf conftest*
  cl_cv_c_void=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_c_void" 1>&4
if test $cl_cv_c_void = yes; then
  have_void=1
else
  cat >> confdefs.h <<\EOF
#define void char
EOF

fi
if test -n "$have_void"; then
echo $ac_n "checking for working \"return void\"""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_c_return_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 1673 "configure"
#include "confdefs.h"
void f() {} typedef void x; x g() { return f(); }
int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_c_return_void=yes
else
  rm -rf conftest*
  cl_cv_c_return_void=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_c_return_void" 1>&4
if test $cl_cv_c_return_void = yes; then
  cat >> confdefs.h <<\EOF
#define return_void return
EOF

fi
fi

                      echo $ac_n "checking for long long type""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_c_longlong'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_c_longlong="guessing no"
else
cat > conftest.$ac_ext <<EOF
#line 1711 "configure"
#include "confdefs.h"
main()
{ long x = 944938507; long y = 737962842; long z = 162359677;
  exit(!(((long long) x)*((long long) y)>>32 == z)); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_c_longlong=yes
else
  cl_cv_c_longlong=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_c_longlong" 1>&4
case "$cl_cv_c_longlong" in
  *yes) cat >> confdefs.h <<\EOF
#define HAVE_LONGLONG 1
EOF
 ;;
  *no) ;;
esac

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

fi

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

fi


                      for ac_hdr in stdlib.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 1791 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 1828 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      
for ac_hdr in sys/file.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 1866 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

if test $ac_cv_header_sys_file_h = yes; then
openflags_decl='#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
#include <fcntl.h>
'
openflags_prog='int x = O_RDWR | O_RDONLY | O_WRONLY | O_CREAT | O_TRUNC;'
echo $ac_n "checking for O_RDWR in fcntl.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_O_RDWR_fcntl_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 1911 "configure"
#include "confdefs.h"
$openflags_decl
int main() { return 0; }
int t() {
$openflags_prog
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_decl_O_RDWR_fcntl_h=yes
else
  rm -rf conftest*
  cl_cv_decl_O_RDWR_fcntl_h=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_decl_O_RDWR_fcntl_h" 1>&4
if test $cl_cv_decl_O_RDWR_fcntl_h = yes; then
  openflags_ok=1
fi
if test -z "$openflags_ok"; then
$openflags_decl#include <sys/file.h>, $openflags_prog,
cat >> confdefs.h <<\EOF
#define NEED_SYS_FILE_H 1
EOF

fi
fi

                      ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 1952 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() { return 0; }
int t() {
DIR *dirp = 0;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=no"
fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&4
fi

done
case "$ac_header_dirent" in
dirent.h) cat >> confdefs.h <<\EOF
#define DIRENT 1
EOF
 ;;
sys/ndir.h) cat >> confdefs.h <<\EOF
#define SYSNDIR 1
EOF
 ;;
sys/dir.h) cat >> confdefs.h <<\EOF
#define SYSDIR 1
EOF
 ;;
ndir.h) cat >> confdefs.h <<\EOF
#define NDIR 1
EOF
 ;;
esac
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for -ldir""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_lib_dir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -ldir "
cat > conftest.$ac_ext <<EOF
#line 2006 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
opendir()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_dir=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_dir=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'dir`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  LIBS="$LIBS -ldir"
else
  echo "$ac_t""no" 1>&4
fi

else
echo $ac_n "checking for -lx""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_lib_x'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lx "
cat > conftest.$ac_ext <<EOF
#line 2040 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
opendir()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_x=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_x=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'x`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  LIBS="$LIBS -lx"
else
  echo "$ac_t""no" 1>&4
fi

fi
echo $ac_n "checking for closedir return value""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_closedir_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  # When cross-compiling, don't assume a return value.
ac_cv_func_closedir_void=yes
echo $ac_n "guessing $ac_c" 1>&4
else
cat > conftest.$ac_ext <<EOF
#line 2078 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_func_closedir_void=no
else
  ac_cv_func_closedir_void=yes
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test $ac_cv_func_closedir_void = yes; then
  echo "$ac_t""void" 1>&4
  cat >> confdefs.h <<\EOF
#define VOID_CLOSEDIR 1
EOF

else
  echo "$ac_t""int" 1>&4
fi

                      echo $ac_n "checking for sys/utsname.h and struct utsname""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_struct_utsname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 2118 "configure"
#include "confdefs.h"
#include <sys/utsname.h>
int main() { return 0; }
int t() {
struct utsname u;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_struct_utsname=yes
else
  rm -rf conftest*
  cl_cv_struct_utsname=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_struct_utsname" 1>&4
if test $cl_cv_struct_utsname = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_SYS_UTSNAME_H 1
EOF

fi

                      
for ac_hdr in netdb.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2155 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      for ac_hdr in sys/shm.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2192 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

if test $ac_cv_header_sys_shm_h = yes; then
for ac_hdr in sys/ipc.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2229 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

if test $ac_cv_header_sys_ipc_h = yes; then
# This test is from Marcus Daniels
echo $ac_n "checking for working shared memory""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_sys_shm_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_sys_shm_works="guessing no"
else
cat > conftest.$ac_ext <<EOF
#line 2268 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
/* try attaching a single segment to multiple addresses */
#define segsize 0x10000
#define attaches 128
#define base_addr 0x01000000
main ()
{ int shmid, i; char* addr; char* result;
  if ((shmid = shmget(IPC_PRIVATE,segsize,0400)) < 0) exit(1);
  for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
    { if ((result = shmat(shmid,addr,SHM_RDONLY)) == (char*)(-1)) break; }
  for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
    shmdt(addr);
  shmctl(shmid,IPC_RMID,0);
  exit(result == (char*)(-1));
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_sys_shm_works=yes
else
  cl_cv_sys_shm_works=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_sys_shm_works" 1>&4
fi
fi
case "$cl_cv_sys_shm_works" in
  *yes) have_shm=1
        cat >> confdefs.h <<\EOF
#define HAVE_SHM 1
EOF

        for ac_hdr in sys/sysmacros.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2325 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

        ;;
  *) ;;
esac

                      
for ac_hdr in termios.h termio.h sys/termio.h sgtty.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2366 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_header_termios_h = yes; then
echo $ac_n "checking for tcgetattr""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_tcgetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 2400 "configure"
#include "confdefs.h"
#include <termios.h>
int main() { return 0; }
int t() {
struct termios t; tcgetattr(0,&t);
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_tcgetattr=yes
else
  rm -rf conftest*
  cl_cv_func_tcgetattr=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_tcgetattr" 1>&4
if test $cl_cv_func_tcgetattr = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_TCGETATTR 1
EOF

fi
echo $ac_n "checking for TCSAFLUSH in termios.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_TCSAFLUSH'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 2433 "configure"
#include "confdefs.h"
#include <termios.h>
int main() { return 0; }
int t() {
int x = TCSAFLUSH;
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_decl_TCSAFLUSH=yes
else
  rm -rf conftest*
  cl_cv_decl_TCSAFLUSH=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_decl_TCSAFLUSH" 1>&4
if test $cl_cv_decl_TCSAFLUSH = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_TCSAFLUSH 1
EOF

fi
fi

                      echo checking for X11
X_INCLUDES=''
X_LIBS=''
# Extract the first word of "xmkmf", so it can be a program name with args.
set dummy xmkmf; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_prog_HAVE_XMKMF'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  if test -n "$HAVE_XMKMF"; then
  ac_cv_prog_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_HAVE_XMKMF="yes"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
HAVE_XMKMF="$ac_cv_prog_HAVE_XMKMF"
if test -n "$HAVE_XMKMF"; then
  echo "$ac_t""$HAVE_XMKMF" 1>&4
else
  echo "$ac_t""no" 1>&4
fi
if test "$HAVE_XMKMF" = yes; then
  have_x11=1
  cat >> confdefs.h <<\EOF
#define HAVE_X11 1
EOF

  X_LIBS='-lX11'
  # 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>&4

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

if test "x$with_x" = xno; then
  no_x=yes
else
  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
    no_x=
  else
if eval "test \"`echo '${'ac_cv_path_x'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  # One or both of the vars are not set, and there is no cached value.
no_x=yes
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
    no_x=
    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
    eval `make acfindx 2>/dev/null | grep -v make`
    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
    if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
    then
      ac_im_usrlibdir=$ac_im_libdir
    fi
    case "$ac_im_incroot" in
	/usr/include) ;;
	*) ac_x_includes="$ac_im_incroot" ;;
    esac
    case "$ac_im_usrlibdir" in
	/usr/lib | /lib) ;;
	*) ac_x_libraries="$ac_im_usrlibdir" ;;
    esac
  fi
  cd ..
  rm -fr conftestdir
fi

if test "$no_x" = yes; then
test -z "$x_direct_test_library" && x_direct_test_library=Xt
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
cat > conftest.$ac_ext <<EOF
#line 2556 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  no_x= ac_x_includes=
else
  echo "$ac_err" >&5
  rm -rf conftest*
    for ac_dir in               \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X11/include          \
    /usr/include/X11          \
    /usr/local/X11/include    \
    /usr/local/include/X11    \
                              \
    /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
      no_x= ac_x_includes=$ac_dir
      break
    fi
  done
fi
rm -f conftest*

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

int main() { return 0; }
int t() {
${x_direct_test_function}()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  LIBS="$ac_save_LIBS" no_x= ac_x_libraries=
else
  rm -rf conftest*
  LIBS="$ac_save_LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X11/lib          \
    /usr/lib/X11          \
    /usr/local/X11/lib    \
    /usr/local/lib/X11    \
                          \
    /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  \
                          \
    /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
      no_x= ac_x_libraries=$ac_dir
      break 2
    fi
  done
done
fi
rm -f conftest*

fi
if test "$no_x" = yes; then
  ac_cv_path_x="no_x=yes"
else
  ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
fi
fi
  fi
  eval "$ac_cv_path_x"
fi # $with_x != no

if test "$no_x" = yes; then
  echo "$ac_t""no" 1>&4
else
  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&4
fi
  if test -n "$x_includes" -a "$x_includes" != NONE; then
    # Adding -I/usr/include may override gcc's private include hierarchy.
    if test "$x_includes" != "/usr/include"; then
      X_INCLUDES="-I$x_includes"
    fi
  fi
  if test -n "$x_libraries" -a "$x_libraries" != NONE; then
    X_LIBS="-L$x_libraries "$X_LIBS
  fi
else
      echo $ac_n "checking for X11 header files""... $ac_c" 1>&4
  cat > conftest.$ac_ext <<EOF
#line 2712 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  have_x_includes=1
else
  echo "$ac_err" >&5
fi
rm -f conftest*
  if test -z "$have_x_includes"; then
    for dir in /usr/X11/include /usr/openwin/include /usr/include/X11R5 /usr/X11R5/include /usr/include/X11R4 /usr/X386/include /usr/x386/include /usr/local/include /usr/unsupported/include; do
      if test -z "$have_x_includes"; then
        if test -r $dir/X11/Intrinsic.h; then
          x_includes="$dir"
          have_x_includes=1
        fi
      fi
    done
  fi
  if test -n "$x_includes" -a "$x_includes" != NONE; then
    X_INCLUDES="-I$x_includes"
  fi
  echo "$ac_t""$X_INCLUDES" 1>&4
  echo $ac_n "checking for X11 library""... $ac_c" 1>&4
  
  :
if eval "test \"`echo '${'ac_cv_lib_X11'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lX11 "
cat > conftest.$ac_ext <<EOF
#line 2748 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
main()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_X11=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_X11=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'X11`\" = yes"; then
  :
  have_x_libraries=1
else
  :
fi
  if test -z "$have_x_libraries"; then
    for dir in /usr/X11/lib /usr/openwin/lib /usr/lib/X11R5 /usr/X11R5/lib /usr/lib/X11R4 /usr/X386/lib /usr/x386/lib /usr/local/lib /usr/unsupported/lib; do
      if test -z "$have_x_libraries"; then
        if test -r $dir/libX11.a; then
          x_libraries="$dir"
          have_x_libraries=1
        fi
      fi
    done
  fi
  if test -n "$have_x_libraries"; then
    X_LIBS='-lX11'
    if test -n "$x_libraries" -a "$x_libraries" != NONE; then
      X_LIBS="-L$x_libraries "$X_LIBS
    fi
  else
    :
if eval "test \"`echo '${'ac_cv_lib_Xwindow'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ac_save_LIBS="$LIBS"
LIBS="$LIBS -lXwindow "
cat > conftest.$ac_ext <<EOF
#line 2796 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
main()
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_lib_Xwindow=yes"
else
  rm -rf conftest*
  eval "ac_cv_lib_Xwindow=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'Xwindow`\" = yes"; then
  :
  X_LIBS='-lXwindow' have_x_libraries=1
else
  :
fi
  fi
  
  echo "$ac_t""$X_LIBS" 1>&4
    if test -n "$have_x_includes" -a -n "$have_x_libraries"; then
    have_x11=1
    cat >> confdefs.h <<\EOF
#define HAVE_X11 1
EOF

  else
    X_INCLUDES=''
    X_LIBS=''
  fi
fi

                      echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2841 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&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 2863 "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 2881 "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
  ac_cv_header_stdc=no
else
cat > conftest.$ac_ext <<EOF
#line 2902 "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
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  ac_cv_header_stdc=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_header_stdc" 1>&4
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

echo $ac_n "checking for size_t""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_type_size_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2945 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "size_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_size_t=yes
else
  rm -rf conftest*
  ac_cv_type_size_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_size_t" 1>&4
if test $ac_cv_type_size_t = no; then
  cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF

fi

                      echo $ac_n "checking for pid_t""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_type_pid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 2976 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "pid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_pid_t=yes
else
  rm -rf conftest*
  ac_cv_type_pid_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_pid_t" 1>&4
if test $ac_cv_type_pid_t = no; then
  cat >> confdefs.h <<\EOF
#define pid_t int
EOF

fi

                      echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_type_uid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3007 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "uid_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_uid_t=yes
else
  rm -rf conftest*
  ac_cv_type_uid_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_uid_t" 1>&4
if test $ac_cv_type_uid_t = no; then
  cat >> confdefs.h <<\EOF
#define uid_t int
EOF

  cat >> confdefs.h <<\EOF
#define gid_t int
EOF

fi

                      echo $ac_n "checking for off_t""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_type_off_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3039 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "off_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_off_t=yes
else
  rm -rf conftest*
  ac_cv_type_off_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_off_t" 1>&4
if test $ac_cv_type_off_t = no; then
  cat >> confdefs.h <<\EOF
#define off_t long
EOF

fi

                      echo $ac_n "checking for caddr_t in sys/types.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_type_caddr_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3071 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "caddr_t" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_type_caddr_t=yes
else
  rm -rf conftest*
  cl_cv_type_caddr_t=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_type_caddr_t" 1>&4
if test $cl_cv_type_caddr_t = yes; then
  cat >> confdefs.h <<\EOF
#define CADDR_T caddr_t
EOF

else
  cat >> confdefs.h <<\EOF
#define CADDR_T void*
EOF

fi


                      echo $ac_n "checking for clock_t in sys/types.h etc.""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_type_clock_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3108 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "clock_t" >/dev/null 2>&1; then
  rm -rf conftest*
  have_clock=1
fi
rm -f conftest*
if test -z "$have_clock"; then
cat > conftest.$ac_ext <<EOF
#line 3120 "configure"
#include "confdefs.h"
#include <sys/times.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "clock_t" >/dev/null 2>&1; then
  rm -rf conftest*
  have_clock=1
fi
rm -f conftest*
fi
if test -z "$have_clock"; then
cat > conftest.$ac_ext <<EOF
#line 3133 "configure"
#include "confdefs.h"
#include <time.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "clock_t" >/dev/null 2>&1; then
  rm -rf conftest*
  have_clock=1
fi
rm -f conftest*
fi
if test -z "$have_clock"; then
  cl_cv_type_clock_t=no
else
  cl_cv_type_clock_t=yes
fi

fi

echo "$ac_t""$cl_cv_type_clock_t" 1>&4
if test $cl_cv_type_clock_t = yes; then
  cat >> confdefs.h <<\EOF
#define CLOCK_T clock_t
EOF

else
  cat >> confdefs.h <<\EOF
#define CLOCK_T int
EOF

fi

                      echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_struct_dirent_d_namlen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3171 "configure"
#include "confdefs.h"
#include <dirent.h>
int main() { return 0; }
int t() {
struct dirent d; d.d_namlen;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_struct_dirent_d_namlen=yes
else
  rm -rf conftest*
  cl_cv_struct_dirent_d_namlen=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_struct_dirent_d_namlen" 1>&4
if test $cl_cv_struct_dirent_d_namlen = yes; then
  :
else
  cat >> confdefs.h <<\EOF
#define DIRENT_WITHOUT_NAMLEN 1
EOF

fi


                      echo $ac_n "checking for struct tm in sys/time.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_struct_tm_sys_time_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3208 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
int main() { return 0; }
int t() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_struct_tm_sys_time_h=yes
else
  rm -rf conftest*
  cl_cv_struct_tm_sys_time_h=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_struct_tm_sys_time_h" 1>&4
if test $cl_cv_struct_tm_sys_time_h = yes; then
  cat >> confdefs.h <<\EOF
#define TM_IN_SYS_TIME 1
EOF

fi

                      
# This is a bit tricky since strlen is a gcc2 built-in function, and
# gcc's criterion when to reject a prototype for it is extremely mysterious.
#   extern int strlen (char * s); extern unsigned int strlen (char * s);
# produces an error, while
#   extern unsigned int strlen (char * s); extern int strlen (char * s);
# compiles well.
if test -z "$cl_cv_proto_strlen_macro"; then
cat > conftest.$ac_ext <<EOF
#line 3246 "configure"
#include "confdefs.h"
#include <string.h>
#ifdef strlen
is a macro
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "is a macro" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_proto_strlen_macro=yes
else
  rm -rf conftest*
  cl_cv_proto_strlen_macro=no
fi
rm -f conftest*

fi
if test $cl_cv_proto_strlen_macro = no; then
echo $ac_n "checking for strlen declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_strlen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3271 "configure"
#include "confdefs.h"
#define strlen foo
#include <string.h>

extern int strlen();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_strlen_ret="int"
else
  rm -rf conftest*
  cl_cv_proto_strlen_ret="size_t"
fi
rm -f conftest*


cat > conftest.$ac_ext <<EOF
#line 3294 "configure"
#include "confdefs.h"
#define strlen foo
#include <string.h>

extern 
#ifdef __STDC__
$cl_cv_proto_strlen_ret strlen (char* s);
#else
$cl_cv_proto_strlen_ret strlen();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_strlen_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_strlen_arg1="const"
fi
rm -f conftest*



cl_cv_proto_strlen="extern $cl_cv_proto_strlen_ret strlen ($cl_cv_proto_strlen_arg1 char*);"
fi

cl_cv_proto_strlen=`echo "$cl_cv_proto_strlen" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_strlen" 1>&4


cat >> confdefs.h <<EOF
#define RETSTRLENTYPE $cl_cv_proto_strlen_ret
EOF

cat >> confdefs.h <<EOF
#define STRLEN_CONST $cl_cv_proto_strlen_arg1
EOF

fi

                      for ac_func in memset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3346 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3364 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

                      echo $ac_n "checking for broken HP/UX and SunOS malloc""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_malloc_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test $cross_compiling = no; then
# Note that HP-UX has two different malloc() implementations.
# Both are broken. When used with CLISP, the one in the default libc.a
# leads to a SIGSEGV, the one in libmalloc.a leads to a SIGBUS.
# The SunOS 4.1.1 malloc() breaks when used by CLISP's generational GC.
os_name=`(uname -s) 2> /dev/null`
if test "$os_name" = HP-UX -o "$os_name" = SunOS ; then
cl_cv_func_malloc_broken=yes
else
cl_cv_func_malloc_broken=no
fi
else
cl_cv_func_malloc_broken="guessing no"
fi

fi

echo "$ac_t""$cl_cv_func_malloc_broken" 1>&4
case "$cl_cv_func_malloc_broken" in
  *yes) # Remedy: Use GNU malloc.
        GMALLOC=gmalloc ;;
  *no)  GMALLOC='' ;;
esac


                      echo $ac_n "checking for malloc declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3436 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "void.*\*.*malloc" >/dev/null 2>&1; then
  rm -rf conftest*
  malloc_void=1
fi
rm -f conftest*
if test -z "$malloc_void"; then
cat > conftest.$ac_ext <<EOF
#line 3448 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern void* malloc();
int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  malloc_void=1
fi
rm -f conftest*

fi
if test -n "$malloc_void"; then
cl_cv_proto_malloc_ret="void*"
else
cl_cv_proto_malloc_ret="char*"
fi
cat > conftest.$ac_ext <<EOF
#line 3476 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
$cl_cv_proto_malloc_ret malloc (unsigned int size);
#else
$cl_cv_proto_malloc_ret malloc();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_malloc_arg1="unsigned int"
else
  rm -rf conftest*
  cl_cv_proto_malloc_arg1="size_t"
fi
rm -f conftest*



cl_cv_proto_malloc="extern $cl_cv_proto_malloc_ret malloc ($cl_cv_proto_malloc_arg1);"
fi

cl_cv_proto_malloc=`echo "$cl_cv_proto_malloc" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_malloc" 1>&4


cat >> confdefs.h <<EOF
#define RETMALLOCTYPE $cl_cv_proto_malloc_ret
EOF

cat >> confdefs.h <<EOF
#define MALLOC_SIZE_T $cl_cv_proto_malloc_arg1
EOF


                      echo $ac_n "checking for free declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_free'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3530 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern int free();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_free_ret="int"
else
  rm -rf conftest*
  cl_cv_proto_free_ret="void"
fi
rm -f conftest*


cl_cv_proto_free="extern $cl_cv_proto_free_ret free ($cl_cv_proto_malloc_ret);"
fi

cl_cv_proto_free=`echo "$cl_cv_proto_free" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_free" 1>&4


cat >> confdefs.h <<EOF
#define RETFREETYPE $cl_cv_proto_free_ret
EOF


                      # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments.  Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3577 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() { return 0; }
int t() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_header_alloca_h=yes
else
  rm -rf conftest*
  cl_cv_header_alloca_h=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_header_alloca_h" 1>&4
if test $cl_cv_header_alloca_h = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_ALLOCA_H 1
EOF

fi
decl="#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
 #pragma alloca
#else
char *alloca ();
#endif
#endif
#endif
"
echo $ac_n "checking for alloca""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_alloca'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 3624 "configure"
#include "confdefs.h"
$decl
int main() { return 0; }
int t() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_alloca=yes
else
  rm -rf conftest*
  cl_cv_func_alloca=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_alloca" 1>&4
if test $cl_cv_func_alloca = yes; then
  :
else
  alloca_missing=1
fi
if test -n "$alloca_missing"; then
  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  # that cause trouble.  Some versions do not even contain alloca or
  # contain a buggy version.  If you still want to use their alloca,
  # use ar to extract alloca.o from them instead of compiling alloca.c.
  ALLOCA=alloca.o
  cat >> confdefs.h <<\EOF
#define NO_ALLOCA 1
EOF

fi

                      echo $ac_n "checking for _setjmp""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func__setjmp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3667 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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__setjmp) || defined (__stub____setjmp)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func__setjmp=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3685 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char _setjmp(); 

int main() { return 0; }
int t() {

_setjmp();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func__setjmp=yes"
else
  rm -rf conftest*
  eval "ac_cv_func__setjmp=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'_setjmp`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  :
else
  echo "$ac_t""no" 1>&4
no__jmp=1
fi
if test -z "$no__jmp"; then
echo $ac_n "checking for _longjmp""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func__longjmp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3723 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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__longjmp) || defined (__stub____longjmp)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func__longjmp=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3741 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char _longjmp(); 

int main() { return 0; }
int t() {

_longjmp();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func__longjmp=yes"
else
  rm -rf conftest*
  eval "ac_cv_func__longjmp=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'_longjmp`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  :
else
  echo "$ac_t""no" 1>&4
no__jmp=1
fi
fi
if test -z "$no__jmp"; then
cat >> confdefs.h <<\EOF
#define HAVE__JMP 1
EOF

fi
cat > conftest.$ac_ext <<EOF
#line 3781 "configure"
#include "confdefs.h"
#include <setjmp.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "void.* longjmp" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define LONGJMP_RETURNS 1
EOF

fi
rm -f conftest*


                      echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3803 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();
int main() { return 0; }
int t() {
int i;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  ac_cv_type_signal=void
else
  rm -rf conftest*
  ac_cv_type_signal=int
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_signal" 1>&4
cat >> confdefs.h <<EOF
#define RETSIGTYPE $ac_cv_type_signal
EOF


                      echo $ac_n "checking whether signal handlers need to be reinstalled""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_signal_reinstall'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_signal_reinstall="guessing yes"
else
cat > conftest.$ac_ext <<EOF
#line 3841 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
/* volatile */ int gotsig=0;
RETSIGTYPE sigalrm_handler() { gotsig=1; }
int got_sig () { return gotsig; }
typedef RETSIGTYPE (*signal_handler) ();
main() { /* returns 0 if they need not to be reinstalled */
  signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(!( (signal_handler)signal(SIGALRM,(signal_handler)sigalrm_handler)
          == (signal_handler)sigalrm_handler
      ) );
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_func_signal_reinstall=no
else
  cl_cv_func_signal_reinstall=yes
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_func_signal_reinstall" 1>&4
case "$cl_cv_func_signal_reinstall" in
  *yes) cat >> confdefs.h <<\EOF
#define SIGNAL_NEED_REINSTALL 1
EOF
 ;;
  *no) ;;
esac

                      signalblocks=""
echo $ac_n "checking for sighold""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_sighold'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3897 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_sighold) || defined (__stub___sighold)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_sighold=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3915 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char sighold(); 

int main() { return 0; }
int t() {

sighold();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_sighold=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_sighold=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'sighold`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define SIGNALBLOCK_SYSV 1
EOF

signalblocks="$signalblocks SystemV"
else
  echo "$ac_t""no" 1>&4
fi
cat > conftest.$ac_ext <<EOF
#line 3951 "configure"
#include "confdefs.h"
#include <signal.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "sigset_t" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  signals_not_posix=1
fi
rm -f conftest*
if test -z "$signals_not_posix"; then
echo $ac_n "checking for sigprocmask""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_sigprocmask'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 3969 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_sigprocmask) || defined (__stub___sigprocmask)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_sigprocmask=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3987 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char sigprocmask(); 

int main() { return 0; }
int t() {

sigprocmask();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_sigprocmask=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_sigprocmask=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'sigprocmask`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define SIGNALBLOCK_POSIX 1
EOF

signalblocks="$signalblocks POSIX"
else
  echo "$ac_t""no" 1>&4
fi
fi
echo $ac_n "checking for sigblock""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_sigblock'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4028 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_sigblock) || defined (__stub___sigblock)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_sigblock=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 4046 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char sigblock(); 

int main() { return 0; }
int t() {

sigblock();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_sigblock=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_sigblock=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'sigblock`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define SIGNALBLOCK_BSD 1
EOF

signalblocks="$signalblocks BSD"
else
  echo "$ac_t""no" 1>&4
fi
echo $ac_n "checking for signal blocking interfaces""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_signalblocks'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test -z "$signalblocks"; then
  cl_cv_func_signalblocks="none"
else
  cl_cv_func_signalblocks=`echo $signalblocks`
fi

fi

echo "$ac_t""$cl_cv_func_signalblocks" 1>&4

                      case "$signalblocks" in
  *BSD*)
echo $ac_n "checking whether signals are blocked when signal handlers are entered""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_signal_blocked'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_signal_blocked="guessing yes"
else
cat > conftest.$ac_ext <<EOF
#line 4107 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
int gotsig=0;
int wasblocked=0;
typedef RETSIGTYPE (*signal_handler) ();
RETSIGTYPE sigalrm_handler()
{ gotsig=1;
#ifdef SIGNAL_NEED_REINSTALL
  signal(SIGALRM,(signal_handler)sigalrm_handler);
#endif
#ifdef SIGNALBLOCK_POSIX
  { sigset_t blocked;
    sigprocmask(SIG_BLOCK, (sigset_t *) 0, &blocked);
    wasblocked = sigismember(&blocked,SIGALRM) ? 1 : 0;
  }
#else
  wasblocked = ((sigblock(0) & sigmask(SIGALRM)) != 0);
#endif
}
int got_sig () { return gotsig; }
main() { /* returns 0 if they need not to be unblocked */
  signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(wasblocked);
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_func_signal_blocked=no
else
  cl_cv_func_signal_blocked=yes
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_func_signal_blocked" 1>&4
case "$cl_cv_func_signal_blocked" in
  *yes) cat >> confdefs.h <<\EOF
#define SIGNAL_NEED_UNBLOCK 1
EOF
 ;;
  *no) ;;
esac
  ;;
  *) ;;
esac

                      case "$signalblocks" in
  *POSIX*)
echo $ac_n "checking for sigprocmask declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_sigprocmask'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4179 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>

extern 
#ifdef __STDC__
int sigprocmask (int how, sigset_t* set, sigset_t* oset);
#else
int sigprocmask();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_sigprocmask_arg2=""
else
  rm -rf conftest*
  cl_cv_proto_sigprocmask_arg2="const"
fi
rm -f conftest*



cl_cv_proto_sigprocmask="extern int sigprocmask (int, $cl_cv_proto_sigprocmask_arg2 sigset_t*, sigset_t*);"
fi

cl_cv_proto_sigprocmask=`echo "$cl_cv_proto_sigprocmask" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_sigprocmask" 1>&4


cat >> confdefs.h <<EOF
#define SIGPROCMASK_CONST $cl_cv_proto_sigprocmask_arg2
EOF

  ;;
  *) ;;
esac

                      
echo $ac_n "checking for sigaction""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_sigaction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4234 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_sigaction) || defined (__stub___sigaction)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_sigaction=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 4252 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char sigaction(); 

int main() { return 0; }
int t() {

sigaction();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_sigaction=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_sigaction=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'sigaction`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define HAVE_SIGACTION 1
EOF

have_sigaction=1
else
  echo "$ac_t""no" 1>&4
fi

                      echo $ac_n "checking for siginterrupt""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_siginterrupt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4293 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_siginterrupt) || defined (__stub___siginterrupt)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_siginterrupt=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 4311 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char siginterrupt(); 

int main() { return 0; }
int t() {

siginterrupt();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_siginterrupt=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_siginterrupt=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'siginterrupt`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define HAVE_SIGINTERRUPT 1
EOF

have_siginterrupt=1
else
  echo "$ac_t""no" 1>&4
fi
if test -z "$have_siginterrupt" -a -z "$have_sigaction"; then
for ac_func in sigvec
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4354 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 4372 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
fi

                      echo $ac_n "checking for abort declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_abort'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4415 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern int abort();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_abort_ret="int"
else
  rm -rf conftest*
  cl_cv_proto_abort_ret="void"
fi
rm -f conftest*


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

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern $cl_cv_proto_abort_ret abort();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_abort_vol=""
else
  rm -rf conftest*
  cl_cv_proto_abort_vol="__volatile__"
fi
rm -f conftest*



cl_cv_proto_abort="extern $cl_cv_proto_abort_vol $cl_cv_proto_abort_ret abort (void);"
fi

cl_cv_proto_abort=`echo "$cl_cv_proto_abort" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_abort" 1>&4


cat >> confdefs.h <<EOF
#define RETABORTTYPE $cl_cv_proto_abort_ret
EOF

cat >> confdefs.h <<EOF
#define ABORT_VOLATILE $cl_cv_proto_abort_vol
EOF


                      brackets='[]'
echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_sys_errlist'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4493 "configure"
#include "confdefs.h"

/* Most systems declare sys_errlist in <errno.h>, NetBSD 1.0 in <stdio.h>. */
#include <stdio.h>
#include <errno.h>
extern char* sys_errlist $brackets ;

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_sys_errlist_const=""
else
  rm -rf conftest*
  cl_cv_proto_sys_errlist_const="const"
fi
rm -f conftest*


cl_cv_proto_sys_errlist="extern $cl_cv_proto_sys_errlist_const char* $cl_cv_proto_sys_errlist_const sys_errlist$brackets;"
fi

cl_cv_proto_sys_errlist=`echo "$cl_cv_proto_sys_errlist" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_sys_errlist" 1>&4


cat >> confdefs.h <<EOF
#define SYS_ERRLIST_CONST $cl_cv_proto_sys_errlist_const
EOF


                      echo $ac_n "checking for getenv declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_getenv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4533 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
char* getenv (char* name);
#else
char* getenv();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_getenv_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_getenv_arg1="const"
fi
rm -f conftest*




cl_cv_proto_getenv="extern char* getenv ($cl_cv_proto_getenv_arg1 char*);"
fi

cl_cv_proto_getenv=`echo "$cl_cv_proto_getenv" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_getenv" 1>&4


cat >> confdefs.h <<EOF
#define GETENV_CONST $cl_cv_proto_getenv_arg1
EOF


                      ac_safe=`echo "vfork.h" | tr './\055' '___'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4585 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  cat >> confdefs.h <<\EOF
#define HAVE_VFORK_H 1
EOF

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

echo $ac_n "checking for working vfork""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_vfork'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  ac_cv_func_vfork=no
else
cat > conftest.$ac_ext <<EOF
#line 4620 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test.  */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
/* On sparc systems, changes by the child to local and incoming
   argument registers are propagated back to the parent.
   The compiler is told about this with #include <vfork.h>,
   but some compilers (e.g. gcc -O) don't grok <vfork.h>.
   Test for this by using a static variable whose address
   is put into a register that is clobbered by the vfork.  */
static
#ifdef __cplusplus
sparc_address_test (int arg)
#else
sparc_address_test (arg) int arg;
#endif
{
  static pid_t child;
  if (!child) {
    child = vfork ();
    if (child < 0)
      perror ("vfork");
    if (!child) {
      arg = getpid();
      write(-1, "", 0);
      _exit (arg);
    }
  }
}
static int signalled;
static RETSIGTYPE catch (s) int s; { signalled = 1; }
main() {
  pid_t parent = getpid ();
  pid_t child;

  sparc_address_test ();

  signal (SIGINT, catch);

  child = vfork ();

  if (child == 0) {
    /* Here is another test for sparc vfork register problems.
       This test uses lots of local variables, at least
       as many local variables as main has allocated so far
       including compiler temporaries.  4 locals are enough for
       gcc 1.40.3 on a sparc, but we use 8 to be safe.
       A buggy compiler should reuse the register of parent
       for one of the local variables, since it will think that
       parent can't possibly be used any more in this routine.
       Assigning to the local variable will thus munge parent
       in the parent process.  */
    pid_t
      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
    /* Convince the compiler that p..p7 are live; otherwise, it might
       use the same hardware register for all 8 local variables.  */
    if (p != p1 || p != p2 || p != p3 || p != p4
	|| p != p5 || p != p6 || p != p7)
      _exit(1);

    /* On some systems (e.g. SunOS 5.2), if the parent is catching
       a signal, the child ignores the signal before execing,
       and the parent later receives that signal, the parent dumps core.
       Test for this by ignoring SIGINT in the child.  */
    signal (SIGINT, SIG_IGN);

    /* On some systems (e.g. IRIX 3.3),
       vfork doesn't separate parent from child file descriptors.
       If the child closes a descriptor before it execs or exits,
       this munges the parent's descriptor as well.
       Test for this by closing stdout in the child.  */
    _exit(close(fileno(stdout)) != 0);
  } else {
    int status;
    struct stat st;

    while (wait(&status) != child)
      ;
    exit(
	 /* Was there some problem with vforking?  */
	 child < 0

	 /* Did the child fail?  (This shouldn't happen.)  */
	 || status

	 /* Did the vfork/compiler bug occur?  */
	 || parent != getpid()

	 /* Did the signal handling bug occur?  */
	 || kill(parent, SIGINT) != 0
	 || signalled != 1

	 /* Did the file descriptor bug occur?  */
	 || fstat(fileno(stdout), &st) != 0
	 );
  }
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_func_vfork=yes
else
  ac_cv_func_vfork=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
echo "$ac_t""$ac_cv_func_vfork" 1>&4
if test $ac_cv_func_vfork = no; then
  cat >> confdefs.h <<\EOF
#define vfork fork
EOF

fi

                      echo $ac_n "checking for vfork declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_vfork'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4759 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif

extern 
#ifdef __STDC__
pid_t vfork (void);
#else
pid_t vfork();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_vfork_ret="pid_t"
else
  rm -rf conftest*
  cl_cv_proto_vfork_ret="int"
fi
rm -f conftest*



cl_cv_proto_vfork="extern $cl_cv_proto_vfork_ret vfork (void);"
fi

cl_cv_proto_vfork=`echo "$cl_cv_proto_vfork" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_vfork" 1>&4


cat >> confdefs.h <<EOF
#define RETVFORKTYPE $cl_cv_proto_vfork_ret
EOF


                      for ac_func in setsid setpgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 4814 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 4832 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

                      brackets='[]'
echo $ac_n "checking for execv declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_execv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for z in '' 'const'; do
for y in '' 'const'; do
for x in '' 'const'; do
if test -z "$have_execv"; then
cat > conftest.$ac_ext <<EOF
#line 4879 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern 
#ifdef __STDC__
int execv ($x char* path, $y char* $z argv$brackets);
#else
int execv();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_execv_arg1="$x"
cl_cv_proto_execv_arg2a="$y"
cl_cv_proto_execv_arg2b="$z"
have_execv=1
fi
rm -f conftest*

fi
done
done
done

cl_cv_proto_execv="extern int execv ($cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execv_arg2a char* $cl_cv_proto_execv_arg2b$brackets);"
fi

cl_cv_proto_execv=`echo "$cl_cv_proto_execv" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_execv" 1>&4


cat >> confdefs.h <<EOF
#define EXECV_CONST $cl_cv_proto_execv_arg1
EOF

cat >> confdefs.h <<EOF
#define EXECV1_CONST $cl_cv_proto_execv_arg2a
EOF

cat >> confdefs.h <<EOF
#define EXECV2_CONST $cl_cv_proto_execv_arg2b
EOF


                      echo $ac_n "checking for execl declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_execl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for x in '' 'const'; do
if test -z "$have_execl"; then
cat > conftest.$ac_ext <<EOF
#line 4941 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern 
#ifdef __STDC__
int execl (EXECV_CONST char* path, $x char* arg, ...);
#else
int execl();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
   cl_cv_proto_execl_arg2="$x"
cl_cv_proto_execl_dots=yes
cl_cv_proto_execl_args="$cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execl_arg2 char*, ..."
have_execl=1
fi
rm -f conftest*

fi
done
for x in '' 'const'; do
if test -z "$have_execl"; then
cat > conftest.$ac_ext <<EOF
#line 4976 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern 
#ifdef __STDC__
int execl (EXECV_CONST char* path, $x char* arg0, $x char* arg1, $x char* arg2, $x char* arg3);
#else
int execl();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
   cl_cv_proto_execl_arg2="$x"
cl_cv_proto_execl_dots=no
cl_cv_proto_execl_args="$cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*"
have_execl=1
fi
rm -f conftest*

fi
done

cl_cv_proto_execl="extern int execl ($cl_cv_proto_execl_args);"
fi

cl_cv_proto_execl=`echo "$cl_cv_proto_execl" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_execl" 1>&4


cat >> confdefs.h <<EOF
#define EXECL_CONST $cl_cv_proto_execl_arg2
EOF

if test $cl_cv_proto_execl_dots = yes; then
  cat >> confdefs.h <<\EOF
#define EXECL_DOTS 1
EOF

fi

                      for ac_func in waitpid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5034 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 5052 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

if test $ac_cv_func_waitpid = yes; then
echo $ac_n "checking for waitpid declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_waitpid'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5095 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
pid_t waitpid (pid_t pid, int* statusp, int options);
#else
pid_t waitpid();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_waitpid_arg1="pid_t"
else
  rm -rf conftest*
  cl_cv_proto_waitpid_arg1="int"
fi
rm -f conftest*



cl_cv_proto_waitpid="extern pid_t waitpid ($cl_cv_proto_waitpid_arg1, int*, int);"
fi

cl_cv_proto_waitpid=`echo "$cl_cv_proto_waitpid" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_waitpid" 1>&4


cat >> confdefs.h <<EOF
#define PID_T $cl_cv_proto_waitpid_arg1
EOF

else
for ac_hdr in sys/wait.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5148 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
fi

                      for ac_hdr in sys/resource.h sys/times.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5185 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_header_sys_resource_h = yes; then
    echo $ac_n "checking for getrusage""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_getrusage'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 5219 "configure"
#include "confdefs.h"
#include <sys/types.h> /* NetBSD 1.0 needs this */
#include <sys/time.h>
#include <sys/resource.h>
int main() { return 0; }
int t() {
struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_func_getrusage=yes
else
  rm -rf conftest*
  cl_cv_func_getrusage=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_getrusage" 1>&4
if test $cl_cv_func_getrusage = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_GETRUSAGE 1
EOF

fi
fi

                      
echo $ac_n "checking for getwd""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_getwd'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 5257 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
getwd();
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_getwd=yes
else
  rm -rf conftest*
  cl_cv_func_getwd=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_getwd" 1>&4
if test $cl_cv_func_getwd = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_GETWD 1
EOF

fi


                      if test $cl_cv_func_getwd = no; then
echo $ac_n "checking for getcwd declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_getcwd'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5292 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
char* getcwd (char* buf, int bufsize);
#else
char* getcwd();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_getcwd_arg2="int"
else
  rm -rf conftest*
  cl_cv_proto_getcwd_arg2="size_t"
fi
rm -f conftest*



cl_cv_proto_getcwd="extern char* getcwd (char*, $cl_cv_proto_getcwd_arg2);"
fi

cl_cv_proto_getcwd=`echo "$cl_cv_proto_getcwd" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_getcwd" 1>&4


cat >> confdefs.h <<EOF
#define GETCWD_SIZE_T $cl_cv_proto_getcwd_arg2
EOF

fi

                      echo $ac_n "checking for chdir declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_chdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5343 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
int chdir (char* path);
#else
int chdir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_chdir_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_chdir_arg1="const"
fi
rm -f conftest*




cl_cv_proto_chdir="extern int chdir ($cl_cv_proto_chdir_arg1 char*);"
fi

cl_cv_proto_chdir=`echo "$cl_cv_proto_chdir" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_chdir" 1>&4


cat >> confdefs.h <<EOF
#define CHDIR_CONST $cl_cv_proto_chdir_arg1
EOF


                      echo $ac_n "checking for mkdir declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_mkdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5394 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "mode_t" >/dev/null 2>&1; then
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 5402 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

extern 
#ifdef __STDC__
int mkdir (char* path, mode_t mode);
#else
int mkdir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  mode_t_unneeded=1
fi
rm -f conftest*


if test -z "$mode_t_unneeded"; then
cat > conftest.$ac_ext <<EOF
#line 5435 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

extern 
#ifdef __STDC__
int mkdir (const char* path, mode_t mode);
#else
int mkdir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  mode_t_unneeded=1
fi
rm -f conftest*


fi
fi
rm -f conftest*
if test -n "$mode_t_unneeded"; then
cl_cv_type_mode_t="mode_t"
else
cl_cv_type_mode_t="int"
fi
cat > conftest.$ac_ext <<EOF
#line 5475 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

extern 
#ifdef __STDC__
int mkdir (char* path, $cl_cv_type_mode_t mode);
#else
int mkdir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_mkdir_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_mkdir_arg1="const"
fi
rm -f conftest*




cl_cv_proto_mkdir="extern int mkdir ($cl_cv_proto_mkdir_arg1 char*, $cl_cv_type_mode_t);"
fi

cl_cv_proto_mkdir=`echo "$cl_cv_proto_mkdir" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_mkdir" 1>&4


cat >> confdefs.h <<EOF
#define MODE_T $cl_cv_type_mode_t
EOF

cat >> confdefs.h <<EOF
#define MKDIR_CONST $cl_cv_proto_mkdir_arg1
EOF


                      echo $ac_n "checking for rmdir declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_rmdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5532 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
int rmdir (char* path);
#else
int rmdir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_rmdir_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_rmdir_arg1="const"
fi
rm -f conftest*




cl_cv_proto_rmdir="extern int rmdir ($cl_cv_proto_rmdir_arg1 char*);"
fi

cl_cv_proto_rmdir=`echo "$cl_cv_proto_rmdir" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_rmdir" 1>&4


cat >> confdefs.h <<EOF
#define RMDIR_CONST $cl_cv_proto_rmdir_arg1
EOF


                      echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_stat_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5583 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifdef S_ISBLK
# if S_ISBLK (S_IFDIR)
You lose.
# endif
# ifdef S_IFCHR
#  if S_ISBLK (S_IFCHR)
You lose.
#  endif
# endif
#endif

#ifdef S_ISLNK
# if S_ISLNK (S_IFREG)
You lose.
# endif
#endif

#ifdef S_ISSOCK
# if S_ISSOCK (S_IFREG)
You lose.
# endif
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "You lose" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_header_stat_broken=yes
else
  rm -rf conftest*
  ac_cv_header_stat_broken=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_header_stat_broken" 1>&4
if test $ac_cv_header_stat_broken = yes; then
  cat >> confdefs.h <<\EOF
#define STAT_MACROS_BROKEN 1
EOF

fi

                      echo $ac_n "checking for stat declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_stat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5635 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

extern 
#ifdef __STDC__
int stat (char* path, struct stat * buf);
#else
int stat();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_stat_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_stat_arg1="const"
fi
rm -f conftest*




cl_cv_proto_stat="extern int stat ($cl_cv_proto_stat_arg1 char*, struct stat *);"
fi

cl_cv_proto_stat=`echo "$cl_cv_proto_stat" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_stat" 1>&4


cat >> confdefs.h <<EOF
#define STAT_CONST $cl_cv_proto_stat_arg1
EOF


                      for ac_func in lstat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5690 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 5708 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_lstat = yes; then
echo $ac_n "checking for lstat declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_lstat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5750 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>

extern 
#ifdef __STDC__
int lstat (char* path, struct stat * buf);
#else
int lstat();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_lstat_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_lstat_arg1="const"
fi
rm -f conftest*




cl_cv_proto_lstat="extern int lstat ($cl_cv_proto_lstat_arg1 char*, struct stat *);"
fi

cl_cv_proto_lstat=`echo "$cl_cv_proto_lstat" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_lstat" 1>&4


cat >> confdefs.h <<EOF
#define LSTAT_CONST $cl_cv_proto_lstat_arg1
EOF

fi

                      for ac_func in readlink
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 5806 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 5824 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_readlink = yes; then
echo $ac_n "checking for readlink declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_readlink'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for z in 'int' 'size_t'; do
for y in 'char*' 'void*'; do
for x in '' 'const'; do
if test -z "$have_readlink"; then
cat > conftest.$ac_ext <<EOF
#line 5870 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern 
#ifdef __STDC__
int readlink ($x char* path, $y buf, $z bufsiz);
#else
int readlink();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_readlink_arg1="$x"
cl_cv_proto_readlink_arg2="$y"
cl_cv_proto_readlink_arg3="$z"
have_readlink=1
fi
rm -f conftest*

fi
done
done
done

cl_cv_proto_readlink="extern int readlink ($cl_cv_proto_readlink_arg1 char*, $cl_cv_proto_readlink_arg2, $cl_cv_proto_readlink_arg3);"
fi

cl_cv_proto_readlink=`echo "$cl_cv_proto_readlink" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_readlink" 1>&4


cat >> confdefs.h <<EOF
#define READLINK_CONST $cl_cv_proto_readlink_arg1
EOF

cat >> confdefs.h <<EOF
#define READLINK_BUF_T $cl_cv_proto_readlink_arg2
EOF

cat >> confdefs.h <<EOF
#define READLINK_SIZE_T $cl_cv_proto_readlink_arg3
EOF

fi

                      echo $ac_n "checking for ELOOP""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_eloop'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
#include <stdio.h>
#ifdef ELOOP
main () { printf("ELOOP\n"); exit(0); }
#else
extern int errno;
#define foo "conflink"
#define foobar "conflink/somefile"
main()
{ /* If a system goes into an endless loop on this, it must be really broken. */
  if (symlink(foo,foo)<0) exit(1);
  if (unlink(foobar)>=0) { unlink(foo); exit(1); }
  printf("%d\n",errno); unlink(foo); exit(0);
}
#endif
EOF
eval $ac_link
cl_cv_decl_ELOOP=`./conftest`
if test "$cl_cv_decl_ELOOP" = "ELOOP"; then
  cl_cv_decl_eloop=yes
else
  cl_cv_decl_eloop="$cl_cv_decl_ELOOP"
fi
else
cat > conftest.$ac_ext <<EOF
#line 5965 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
#include <stdio.h>
#ifdef ELOOP
yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_decl_eloop=yes
else
  rm -rf conftest*
  cl_cv_decl_eloop=no
fi
rm -f conftest*

cl_cv_decl_ELOOP="ELOOP"
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_decl_eloop" 1>&4
cat >> confdefs.h <<EOF
#define ELOOP_VALUE $cl_cv_decl_ELOOP
EOF


                      echo $ac_n "checking for opendir declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_opendir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6008 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <$ac_header_dirent>

extern 
#ifdef __STDC__
DIR* opendir (char* dirname);
#else
DIR* opendir();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_opendir_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_opendir_arg1="const"
fi
rm -f conftest*




cl_cv_proto_opendir="extern DIR* opendir ($cl_cv_proto_opendir_arg1 char*);"
fi

cl_cv_proto_opendir=`echo "$cl_cv_proto_opendir" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_opendir" 1>&4


cat >> confdefs.h <<EOF
#define OPENDIR_CONST $cl_cv_proto_opendir_arg1
EOF


                      echo $ac_n "checking for open declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_open'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for y in 'MODE_T mode' '...'; do
for x in '' 'const'; do
if test -z "$have_open"; then
cat > conftest.$ac_ext <<EOF
#line 6063 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>

extern 
#ifdef __STDC__
int open ($x char* path, int flags, $y);
#else
int open();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_open_arg1="$x"
if test "$y" = "..."; then
cl_cv_proto_open_dots=yes
else
cl_cv_proto_open_dots=no
fi
have_open=1
fi
rm -f conftest*


fi
done
done
 if test $cl_cv_proto_open_dots = yes; then
cl_cv_proto_open_args="$cl_cv_proto_open_arg1 char*, int, ..."
else
cl_cv_proto_open_args="$cl_cv_proto_open_arg1 char*, int, $cl_cv_type_mode_t"
fi

cl_cv_proto_open="extern int open ($cl_cv_proto_open_args);"
fi

cl_cv_proto_open=`echo "$cl_cv_proto_open" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_open" 1>&4


cat >> confdefs.h <<EOF
#define OPEN_CONST $cl_cv_proto_open_arg1
EOF

if test $cl_cv_proto_open_dots = yes; then
cat >> confdefs.h <<\EOF
#define OPEN_DOTS 1
EOF

fi

                      echo $ac_n "checking for read declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_read'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6131 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern int read();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_retrwtype="int"
else
  rm -rf conftest*
  cl_cv_proto_retrwtype="long"
fi
rm -f conftest*


for y in 'int' 'size_t' "unsigned $cl_cv_proto_retrwtype" 'off_t'; do
for x in 'char*' 'void*'; do
if test -z "$have_rw"; then
cat > conftest.$ac_ext <<EOF
#line 6162 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
$cl_cv_proto_retrwtype read (int fd, $x buf, $y count);
#else
$cl_cv_proto_retrwtype read();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_rw_buf_t="$x"
cl_cv_proto_rw_size_t="$y"
have_rw=1
fi
rm -f conftest*


fi
done
done

cl_cv_proto_read="extern $cl_cv_proto_retrwtype read (int, $cl_cv_proto_rw_buf_t, $cl_cv_proto_rw_size_t);"
fi

cl_cv_proto_read=`echo "$cl_cv_proto_read" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_read" 1>&4


cat >> confdefs.h <<EOF
#define RETRWTYPE $cl_cv_proto_retrwtype
EOF

cat >> confdefs.h <<EOF
#define RW_BUF_T $cl_cv_proto_rw_buf_t
EOF

cat >> confdefs.h <<EOF
#define RW_SIZE_T $cl_cv_proto_rw_size_t
EOF


                      echo $ac_n "checking for write declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_write'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6222 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
$cl_cv_proto_retrwtype write (int fd, $cl_cv_proto_rw_buf_t buf, $cl_cv_proto_rw_size_t count);
#else
$cl_cv_proto_retrwtype write();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_write_arg2=""
else
  rm -rf conftest*
  cl_cv_proto_write_arg2="const"
fi
rm -f conftest*




cl_cv_proto_write="extern $cl_cv_proto_retrwtype write (int, $cl_cv_proto_write_arg2 $cl_cv_proto_rw_buf_t, $cl_cv_proto_rw_size_t);"
fi

cl_cv_proto_write=`echo "$cl_cv_proto_write" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_write" 1>&4


cat >> confdefs.h <<EOF
#define WRITE_CONST $cl_cv_proto_write_arg2
EOF


                      for ac_func in rename
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6275 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 6293 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_rename = yes; then
echo $ac_n "checking for rename declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_rename'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6335 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>

extern 
#ifdef __STDC__
int rename (char* oldpath, char* newpath);
#else
int rename();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_rename_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_rename_arg1="const"
fi
rm -f conftest*




cl_cv_proto_rename="extern int rename ($cl_cv_proto_rename_arg1 char*, $cl_cv_proto_rename_arg1 char*);"
fi

cl_cv_proto_rename=`echo "$cl_cv_proto_rename" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_rename" 1>&4


cat >> confdefs.h <<EOF
#define RENAME_CONST $cl_cv_proto_rename_arg1
EOF

fi

                      echo $ac_n "checking for unlink declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_unlink'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6388 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
int unlink (char* path);
#else
int unlink();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_unlink_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_unlink_arg1="const"
fi
rm -f conftest*




cl_cv_proto_unlink="extern int unlink ($cl_cv_proto_unlink_arg1 char*);"
fi

cl_cv_proto_unlink=`echo "$cl_cv_proto_unlink" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_unlink" 1>&4


cat >> confdefs.h <<EOF
#define UNLINK_CONST $cl_cv_proto_unlink_arg1
EOF


                      for ac_func in fsync
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6441 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 6459 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      echo $ac_n "checking for ioctl declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_ioctl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  ioctl_decl1='#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
#ifndef HAVE_TCSAFLUSH
#undef HAVE_TERMIOS_H
#endif
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#else
#ifdef HAVE_SYS_TERMIO_H
#include <sys/termio.h>
#else
#ifdef HAVE_TERMIO_H
#include <termio.h>
#else
#ifdef HAVE_SGTTY_H
#include <sgtty.h>
#include <sys/ioctl.h>
#endif
#endif
#endif
#endif
'
cat > conftest.$ac_ext <<EOF
#line 6529 "configure"
#include "confdefs.h"
$ioctl_decl1
extern char* ioctl();
int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  try_sys_ioctl=1
else
  rm -rf conftest*
  ioctl_decl="$ioctl_decl1"
fi
rm -f conftest*

if test -n "try_sys_ioctl"; then
ioctl_decl2='#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
#include <sys/ioctl.h>
'
cat > conftest.$ac_ext <<EOF
#line 6558 "configure"
#include "confdefs.h"
$ioctl_decl2
extern char* ioctl();
int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  ioctl_decl="$ioctl_decl1"
else
  rm -rf conftest*
  ioctl_decl="$ioctl_decl2"
fi
rm -f conftest*

fi
for y in 'caddr_t arg' '...'; do
for x in 'int' 'unsigned long' 'long'; do
if test -z "$have_ioctl"; then
cat > conftest.$ac_ext <<EOF
#line 6581 "configure"
#include "confdefs.h"
$ioctl_decl
#ifdef INCLUDE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif

extern 
#ifdef __STDC__
int ioctl (int fd, $x request, $y);
#else
int ioctl();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
   cl_cv_proto_ioctl_arg2="$x"
if test "$y" = "..."; then
cl_cv_proto_ioctl_dots=yes
cl_cv_proto_ioctl_args="int, $cl_cv_proto_ioctl_arg2, ..."
else
cl_cv_proto_ioctl_dots=no
cl_cv_proto_ioctl_args="int, $cl_cv_proto_ioctl_arg2, caddr_t"
fi
have_ioctl=1
fi
rm -f conftest*


fi
done
done

cl_cv_proto_ioctl="extern int ioctl ($cl_cv_proto_ioctl_args);"
fi

cl_cv_proto_ioctl=`echo "$cl_cv_proto_ioctl" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_ioctl" 1>&4


cat >> confdefs.h <<EOF
#define IOCTL_REQUEST_T $cl_cv_proto_ioctl_arg2
EOF

if test $cl_cv_proto_ioctl_dots = yes; then
cat >> confdefs.h <<\EOF
#define IOCTL_DOTS 1
EOF

fi
ioctl_decl="$ioctl_decl1"
ioctl_prog='int x = FIONREAD;'
echo $ac_n "checking for FIONREAD""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 6644 "configure"
#include "confdefs.h"
$ioctl_decl
int main() { return 0; }
int t() {
$ioctl_prog
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1=yes
else
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_decl_FIONREAD_1" 1>&4
if test $cl_cv_decl_FIONREAD_1 = yes; then
  ioctl_ok=1
fi
if test -z "$ioctl_ok"; then
echo $ac_n "checking for FIONREAD in sys/filio.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1_sys_filio_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 6675 "configure"
#include "confdefs.h"
$ioctl_decl#include <sys/filio.h>
int main() { return 0; }
int t() {
$ioctl_prog
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_filio_h=yes
else
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_filio_h=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_decl_FIONREAD_1_sys_filio_h" 1>&4
if test $cl_cv_decl_FIONREAD_1_sys_filio_h = yes; then
  cat >> confdefs.h <<\EOF
#define NEED_SYS_FILIO_H 1
EOF

ioctl_ok=1
fi
fi
if test -z "$ioctl_ok"; then
echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1_sys_ioctl_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 6711 "configure"
#include "confdefs.h"
$ioctl_decl#include <sys/ioctl.h>
int main() { return 0; }
int t() {
$ioctl_prog
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_ioctl_h=yes
else
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_ioctl_h=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_decl_FIONREAD_1_sys_ioctl_h" 1>&4
if test $cl_cv_decl_FIONREAD_1_sys_ioctl_h = yes; then
  cat >> confdefs.h <<\EOF
#define NEED_SYS_IOCTL_H 1
EOF

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

fi

                      echo $ac_n "checking for fcntl declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_fcntl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for x in 'int arg' '...'; do
if test -z "$have_fcntl"; then
cat > conftest.$ac_ext <<EOF
#line 6754 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>

extern 
#ifdef __STDC__
int fcntl (int fd, int cmd, $x);
#else
int fcntl();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  if test "$x" = "..."; then
cl_cv_fcntl_arg3="..."
else
cl_cv_fcntl_arg3="int"
fi
have_fcntl=1
fi
rm -f conftest*


fi
done

cl_cv_proto_fcntl="extern int fcntl (int, int, $cl_cv_fcntl_arg3);"
fi

cl_cv_proto_fcntl=`echo "$cl_cv_proto_fcntl" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_fcntl" 1>&4


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

fi

                      for ac_func in select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6810 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 6828 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_select = yes; then
for ac_hdr in sys/select.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6873 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
echo $ac_n "checking for select declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_select'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for z in '' 'const'; do
for y in 'fd_set' 'int' 'void'; do
for x in 'int' 'size_t'; do
if test -z "$have_select"; then
cat > conftest.$ac_ext <<EOF
#line 6909 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/time.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif

extern 
#ifdef __STDC__
int select ($x width, $y * readfds, $y * writefds, $y * exceptfds, $z struct timeval * timeout);
#else
int select();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_select_arg1="$x"
cl_cv_proto_select_arg2="$y"
cl_cv_proto_select_arg5="$z"
have_select=1
fi
rm -f conftest*


fi
done
done
done

cl_cv_proto_select="extern int select ($cl_cv_proto_select_arg1, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg5 struct timeval *);"
fi

cl_cv_proto_select=`echo "$cl_cv_proto_select" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_select" 1>&4


cat >> confdefs.h <<EOF
#define SELECT_WIDTH_T $cl_cv_proto_select_arg1
EOF

cat >> confdefs.h <<EOF
#define SELECT_SET_T $cl_cv_proto_select_arg2
EOF

cat >> confdefs.h <<EOF
#define SELECT_CONST $cl_cv_proto_select_arg5
EOF

else
for ac_func in poll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 6978 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 6996 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
fi

                      for ac_func in ualarm
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7041 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7059 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      for ac_func in setitimer
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7104 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7122 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_setitimer = yes; then
echo $ac_n "checking for setitimer declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_setitimer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7164 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/time.h>

extern 
#ifdef __STDC__
int setitimer (int which, struct itimerval * ivalue, struct itimerval * ovalue);
#else
int setitimer();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_setitimer_arg2=""
else
  rm -rf conftest*
  cl_cv_proto_setitimer_arg2="const"
fi
rm -f conftest*




cl_cv_proto_setitimer="extern int setitimer (int, $cl_cv_proto_setitimer_arg2 struct itimerval *, struct itimerval *);"
fi

cl_cv_proto_setitimer=`echo "$cl_cv_proto_setitimer" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_setitimer" 1>&4


cat >> confdefs.h <<EOF
#define SETITIMER_CONST $cl_cv_proto_setitimer_arg2
EOF

fi

                      for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7219 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7237 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done


                      echo $ac_n "checking for localtime declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_localtime'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7280 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif

extern 
#ifdef __STDC__
struct tm * localtime (time_t* clock);
#else
struct tm * localtime();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_localtime_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_localtime_arg1="const"
fi
rm -f conftest*




cl_cv_proto_localtime="extern struct tm * localtime ($cl_cv_proto_localtime_arg1 time_t*);"
fi

cl_cv_proto_localtime=`echo "$cl_cv_proto_localtime" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_localtime" 1>&4


cat >> confdefs.h <<EOF
#define LOCALTIME_CONST $cl_cv_proto_localtime_arg1
EOF


                      
for ac_func in gettimeofday
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7339 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7357 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_gettimeofday = yes; then
echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_gettimeofday'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7399 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/time.h>

extern 
#ifdef __STDC__
int gettimeofday (struct timeval * tp, struct timezone * tzp);
#else
int gettimeofday();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
   cl_cv_proto_gettimeofday_dots=no
cl_cv_proto_gettimeofday_args="struct timeval *, struct timezone *"
else
  rm -rf conftest*
   cl_cv_proto_gettimeofday_dots=yes
cl_cv_proto_gettimeofday_args="struct timeval *, ..."
fi
rm -f conftest*



cl_cv_proto_gettimeofday="extern int gettimeofday ($cl_cv_proto_gettimeofday_args);"
fi

cl_cv_proto_gettimeofday=`echo "$cl_cv_proto_gettimeofday" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_gettimeofday" 1>&4


if test $cl_cv_proto_gettimeofday_dots = yes; then
cat >> confdefs.h <<\EOF
#define GETTIMEOFDAY_DOTS 1
EOF

fi
fi

                      
for ac_func in ftime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7453 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7471 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

                      if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then
echo $ac_n "checking for times""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_times'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7514 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_times) || defined (__stub___times)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_times=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7532 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char times(); 

int main() { return 0; }
int t() {

times();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_times=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_times=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'times`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  :
else
  echo "$ac_t""no" 1>&4
no_times=1
fi
if test -z "$no_times"; then
echo $ac_n "checking for times return value""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_times_return'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_times_return="guessing no"
else
cat > conftest.$ac_ext <<EOF
#line 7574 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <time.h> /* needed for CLK_TCK */
#ifndef CLK_TCK
#include <sys/time.h> /* needed for CLK_TCK on SYSV PTX */
#endif
#include <sys/times.h>
main ()
{ struct tms buffer;
  clock_t result1;
  clock_t result2;
  int ticks;
  result1 = times(&buffer);
  if ((result1 == (clock_t)0) || (result1 == (clock_t)(-1))) exit(1);
  sleep(1);
  result2 = times(&buffer);
  if ((result2 == (clock_t)0) || (result2 == (clock_t)(-1))) exit(1);
  ticks = result2 - result1;
  exit(!((ticks >= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2)));
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_func_times_return=yes
else
  cl_cv_func_times_return=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

case "$cl_cv_func_times_return" in
  *yes) cat >> confdefs.h <<\EOF
#define HAVE_TIMES_CLOCK 1
EOF
 ;;
  *no)  ;;
esac
fi
fi

                      echo $ac_n "checking for getpwnam declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_getpwnam'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7632 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <pwd.h>

extern 
#ifdef __STDC__
struct passwd * getpwnam (char* name);
#else
struct passwd * getpwnam();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_getpwnam_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_getpwnam_arg1="const"
fi
rm -f conftest*




cl_cv_proto_getpwnam="extern struct passwd * getpwnam ($cl_cv_proto_getpwnam_arg1 char*);"
fi

cl_cv_proto_getpwnam=`echo "$cl_cv_proto_getpwnam" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_getpwnam" 1>&4


cat >> confdefs.h <<EOF
#define GETPWNAM_CONST $cl_cv_proto_getpwnam_arg1
EOF


                      echo $ac_n "checking for getpwuid declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_getpwuid'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7684 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <pwd.h>

extern 
#ifdef __STDC__
struct passwd * getpwuid (uid_t uid);
#else
struct passwd * getpwuid();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_getpwuid_arg1="uid_t"
else
  rm -rf conftest*
  cl_cv_proto_getpwuid_arg1="int"
fi
rm -f conftest*



cl_cv_proto_getpwuid="extern struct passwd * getpwuid ($cl_cv_proto_getpwuid_arg1);"
fi

cl_cv_proto_getpwuid=`echo "$cl_cv_proto_getpwuid" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_getpwuid" 1>&4


cat >> confdefs.h <<EOF
#define GETPWUID_UID_T $cl_cv_proto_getpwuid_arg1
EOF


                      for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7737 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7755 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_gethostname = yes; then
echo $ac_n "checking for gethostname declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_gethostname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7797 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern 
#ifdef __STDC__
int gethostname (char* name, int namelen);
#else
int gethostname();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_gethostname_arg2="int"
else
  rm -rf conftest*
  cl_cv_proto_gethostname_arg2="size_t"
fi
rm -f conftest*



cl_cv_proto_gethostname="extern int gethostname (char*, $cl_cv_proto_gethostname_arg2);"
fi

cl_cv_proto_gethostname=`echo "$cl_cv_proto_gethostname" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_gethostname" 1>&4


cat >> confdefs.h <<EOF
#define GETHOSTNAME_SIZE_T $cl_cv_proto_gethostname_arg2
EOF

fi

                      if test $ac_cv_header_netdb_h = yes; then
  have_netdb=1
else
  ac_safe=`echo "sun/netdb.h" | tr './\055' '___'`
echo $ac_n "checking for sun/netdb.h""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7852 "configure"
#include "confdefs.h"
#include <sun/netdb.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  have_netdb=1
else
  echo "$ac_t""no" 1>&4
fi

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

echo $ac_n "checking for gethostbyname declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_gethostbyname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 7886 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_NETDB_H
#include <sys/socket.h>
#include <netdb.h>
#else
#include <sun/netdb.h>
#endif

extern 
#ifdef __STDC__
struct hostent * gethostbyname (char* name);
#else
struct hostent * gethostbyname();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_gethostbyname_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_gethostbyname_arg1="const"
fi
rm -f conftest*




cl_cv_proto_gethostbyname="extern struct hostent * gethostbyname ($cl_cv_proto_gethostbyname_arg1 char*);"
fi

cl_cv_proto_gethostbyname=`echo "$cl_cv_proto_gethostbyname" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_gethostbyname" 1>&4


cat >> confdefs.h <<EOF
#define GETHOSTBYNAME_CONST $cl_cv_proto_gethostbyname_arg1
EOF

fi

                      echo $ac_n "checking for connect declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_connect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  for x in '' 'const'; do
for y in 'struct sockaddr *' 'void*'; do
if test -z "$have_connect"; then
cat > conftest.$ac_ext <<EOF
#line 7948 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>

extern 
#ifdef __STDC__
int connect (int fd, $x $y name, int namelen);
#else
int connect();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_connect_arg2a="$x"
cl_cv_proto_connect_arg2b="$y"
have_connect=1
fi
rm -f conftest*


fi
done
done

cl_cv_proto_connect="extern int connect (int, $cl_cv_proto_connect_arg2a $cl_cv_proto_connect_arg2b, int);"
fi

cl_cv_proto_connect=`echo "$cl_cv_proto_connect" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_connect" 1>&4


cat >> confdefs.h <<EOF
#define CONNECT_CONST $cl_cv_proto_connect_arg2a
EOF

cat >> confdefs.h <<EOF
#define CONNECT_NAME_T $cl_cv_proto_connect_arg2b
EOF


                      for ac_hdr in sys/un.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8006 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_header_sys_un_h = yes; then
echo $ac_n "checking for sun_len in struct sockaddr_un""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_struct_sockaddr_sun_len'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 8040 "configure"
#include "confdefs.h"
#include <sys/types.h> /* NetBSD 1.0 needs this */
#include <sys/un.h>
int main() { return 0; }
int t() {
struct sockaddr_un unaddr; unaddr.sun_len;
; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_struct_sockaddr_sun_len=yes
else
  rm -rf conftest*
  cl_cv_struct_sockaddr_sun_len=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_struct_sockaddr_sun_len" 1>&4
if test $cl_cv_struct_sockaddr_sun_len = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_SOCKADDR_UN_LEN 1
EOF

fi
fi

                      for ac_hdr in netinet/in.h arpa/inet.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8078 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
echo $ac_n "checking for inet_addr declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_inet_addr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8110 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

extern 
#ifdef __STDC__
struct in_addr inet_addr();
#else
struct in_addr inet_addr();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_inet_addr_ret="struct in_addr"
have_inet_addr=1
fi
rm -f conftest*


if test -z "$have_inet_addr"; then
cat > conftest.$ac_ext <<EOF
#line 8144 "configure"
#include "confdefs.h"

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

extern 
#ifdef __STDC__
unsigned long inet_addr();
#else
unsigned long inet_addr();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_inet_addr_ret="unsigned long"
else
  rm -rf conftest*
  cl_cv_proto_inet_addr_ret="unsigned int"
fi
rm -f conftest*


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

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <netinet/in.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

extern 
#ifdef __STDC__
$cl_cv_proto_inet_addr_ret inet_addr (char* cp);
#else
$cl_cv_proto_inet_addr_ret inet_addr();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_inet_addr_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_inet_addr_arg1="const"
fi
rm -f conftest*




cl_cv_proto_inet_addr="extern $cl_cv_proto_inet_addr_ret inet_addr ($cl_cv_proto_inet_addr_arg1 char*);"
fi

cl_cv_proto_inet_addr=`echo "$cl_cv_proto_inet_addr" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_inet_addr" 1>&4


cat >> confdefs.h <<EOF
#define RET_INET_ADDR_TYPE $cl_cv_proto_inet_addr_ret
EOF

cat >> confdefs.h <<EOF
#define INET_ADDR_CONST $cl_cv_proto_inet_addr_arg1
EOF

if test "$cl_cv_proto_inet_addr_ret" = "struct in_addr"; then
cat >> confdefs.h <<\EOF
#define INET_ADDR_SUFFIX .s_addr
EOF

else
cat >> confdefs.h <<\EOF
#define INET_ADDR_SUFFIX 
EOF

fi
for ac_hdr in netinet/tcp.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8250 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done

                      
echo $ac_n "checking for getpagesize""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_getpagesize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 8285 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
getpagesize();
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_getpagesize=yes
else
  rm -rf conftest*
  cl_cv_func_getpagesize=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_getpagesize" 1>&4
if test $cl_cv_func_getpagesize = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_GETPAGESIZE 1
EOF

have_getpagesize=1
fi
if test -n "$have_getpagesize"; then
echo $ac_n "checking for getpagesize declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_getpagesize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8319 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

extern int getpagesize();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_getpagesize_ret="int"
else
  rm -rf conftest*
  cl_cv_proto_getpagesize_ret="size_t"
fi
rm -f conftest*



cl_cv_proto_getpagesize="extern $cl_cv_proto_getpagesize_ret getpagesize (void);"
fi

cl_cv_proto_getpagesize=`echo "$cl_cv_proto_getpagesize" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_getpagesize" 1>&4


cat >> confdefs.h <<EOF
#define RETGETPAGESIZETYPE $cl_cv_proto_getpagesize_ret
EOF

fi

                      echo $ac_n "checking for vadvise""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_vadvise'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 8366 "configure"
#include "confdefs.h"
#include <sys/vadvise.h>
int main() { return 0; }
int t() {
vadvise(0);
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_vadvise=yes
else
  rm -rf conftest*
  cl_cv_func_vadvise=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_vadvise" 1>&4
if test $cl_cv_func_vadvise = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_VADVISE 1
EOF

fi

                      echo $ac_n "checking for vm_allocate""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_vm'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
cat > conftest.$ac_ext <<EOF
#line 8400 "configure"
#include "confdefs.h"

int main() { return 0; }
int t() {
vm_allocate(); task_self();
; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  cl_cv_func_vm=yes
else
  rm -rf conftest*
  cl_cv_func_vm=no
fi
rm -f conftest*


fi

echo "$ac_t""$cl_cv_func_vm" 1>&4
if test $cl_cv_func_vm = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_MACH_VM 1
EOF

fi

                      
ac_safe=`echo "sys/mman.h" | tr './\055' '___'`
echo $ac_n "checking for sys/mman.h""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8435 "configure"
#include "confdefs.h"
#include <sys/mman.h>
EOF
eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  :
else
  echo "$ac_t""no" 1>&4
no_mmap=1
fi
if test -z "$no_mmap"; then
echo $ac_n "checking for mmap""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_mmap'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8464 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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_mmap) || defined (__stub___mmap)
choke me
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_mmap=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 8482 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char mmap(); 

int main() { return 0; }
int t() {

mmap();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_mmap=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_mmap=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'mmap`\" = yes"; then
  echo "$ac_t""yes" 1>&4
  :
else
  echo "$ac_t""no" 1>&4
no_mmap=1
fi
if test -z "$no_mmap"; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP 1
EOF

echo $ac_n "checking for mmap declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_mmap'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  # Note: gcc2 does not consider
#   void* mmap (void*, size_t, int, int, int, off_t);
#   char* mmap();
# to be an error, if the first declaration comes from a system include file.
cat > conftest.$ac_ext <<EOF
#line 8528 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/mman.h>

extern void* mmap();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_mmap_ret="void*"
else
  rm -rf conftest*
  cl_cv_proto_mmap_ret="caddr_t"
fi
rm -f conftest*


for y in 'int' 'size_t'; do
for x in 'void*' 'caddr_t'; do
if test -z "$have_mmap_decl"; then
cat > conftest.$ac_ext <<EOF
#line 8561 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/mman.h>

extern 
#ifdef __STDC__
$cl_cv_proto_mmap_ret mmap ($x addr, $y length, int prot, int flags, int fd, off_t off);
#else
$cl_cv_proto_mmap_ret mmap();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_mmap_arg1="$x"
cl_cv_proto_mmap_arg2="$y"
have_mmap_decl=1
fi
rm -f conftest*


fi
done
done

cl_cv_proto_mmap="extern $cl_cv_proto_mmap_ret mmap ($cl_cv_proto_mmap_arg1, $cl_cv_proto_mmap_arg2, int, int, int, off_t);"
fi

cl_cv_proto_mmap=`echo "$cl_cv_proto_mmap" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_mmap" 1>&4


cat >> confdefs.h <<EOF
#define RETMMAPTYPE $cl_cv_proto_mmap_ret
EOF

cat >> confdefs.h <<EOF
#define MMAP_ADDR_T $cl_cv_proto_mmap_arg1
EOF

cat >> confdefs.h <<EOF
#define MMAP_SIZE_T $cl_cv_proto_mmap_arg2
EOF

echo $ac_n "checking for working mmap""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_mmap_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
mmap_prog_1='
#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#ifdef NEED_SYS_FILE_H
#include <sys/file.h>
#endif
#include <sys/types.h>
#include <sys/mman.h>
extern 
#ifdef __STDC__
RETMMAPTYPE mmap (MMAP_ADDR_T addr, MMAP_SIZE_T length, int prot, int flags, int fd, off_t off);
#else
RETMMAPTYPE mmap();
#endif
main () {
'
mmap_prog_2='
#define my_shift 24
#define my_low   1
#ifdef FOR_SUN4_29
#define my_high  31
#define my_size  32768 /* hope that 32768 is a multiple of the page size */
/* i*32 KB for i=1..31 gives a total of 15.5 MB, which is close to what we need */
#else
#define my_high  64
#define my_size  8192 /* hope that 8192 is a multiple of the page size */
/* i*8 KB for i=1..64 gives a total of 16.25 MB, which is close to what we need */
#endif
 {long i;
  for (i=my_low; i<=my_high; i++)
    { caddr_t addr = (caddr_t)(i << my_shift);
#if 0 /* Check for 16 MB. */
      long size = i*my_size;
#else /* Check for 8 MB. This is more likely to work on Solaris 2. */
      long size = ((i+1)/2)*my_size;
#endif
      if (mmap(addr,size,PROT_READ|PROT_WRITE,flags|MAP_FIXED,fd,0) == (RETMMAPTYPE)-1) exit(1);
    }
#define x(i)  *(unsigned char *) ((i<<my_shift) + (i*i))
#define y(i)  (unsigned char)((3*i-4)*(7*i+3))
  for (i=my_low; i<=my_high; i++) { x(i) = y(i); }
  for (i=my_high; i>=my_low; i--) { if (x(i) != y(i)) exit(1); }
  exit(0);
}}
'
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 8677 "configure"
#include "confdefs.h"
$mmap_prog_1
  int flags = MAP_ANON | MAP_PRIVATE;
  int fd = -1;
$mmap_prog_2

EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  have_mmap_anon=1
cl_cv_func_mmap_anon=yes
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 8708 "configure"
#include "confdefs.h"
$mmap_prog_1
  int flags = MAP_ANONYMOUS | MAP_PRIVATE;
  int fd = -1;
$mmap_prog_2

EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  have_mmap_anon=1
cl_cv_func_mmap_anonymous=yes
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 8739 "configure"
#include "confdefs.h"
$mmap_prog_1
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
  int flags = MAP_FILE | MAP_PRIVATE;
  int fd = open("/dev/zero",O_RDONLY,0666);
  if (fd<0) exit(1);
$mmap_prog_2

EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  have_mmap_devzero=1
cl_cv_func_mmap_devzero=yes
else
  rm -f core
retry_mmap=1
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
if test -n "$retry_mmap"; then
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 8776 "configure"
#include "confdefs.h"
#define FOR_SUN4_29
$mmap_prog_1
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
  int flags = MAP_FILE | MAP_PRIVATE;
  int fd = open("/dev/zero",O_RDONLY,0666);
  if (fd<0) exit(1);
$mmap_prog_2

EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  have_mmap_devzero=1
cl_cv_func_mmap_devzero_sun4_29=yes
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test -n "$have_mmap_anon" -o -n "$have_mmap_devzero"; then
cl_cv_func_mmap_works=yes
else
cl_cv_func_mmap_works=no
fi

fi

echo "$ac_t""$cl_cv_func_mmap_works" 1>&4
if test "$cl_cv_func_mmap_anon" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP_ANON 1
EOF

fi
if test "$cl_cv_func_mmap_anonymous" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP_ANONYMOUS 1
EOF

fi
if test "$cl_cv_func_mmap_devzero" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP_DEVZERO 1
EOF

fi
if test "$cl_cv_func_mmap_devzero_sun4_29" = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MMAP_DEVZERO_SUN4_29 1
EOF

fi
fi
fi

                      if test -z "$no_mmap"; then
for ac_func in munmap
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8852 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 8870 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
fi

                      for ac_func in mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8915 "configure"
#include "confdefs.h"
#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* 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
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "choke" >/dev/null 2>&1; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 8933 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
char $ac_func(); 

int main() { return 0; }
int t() {

$ac_func();

; return 0; }
EOF
if eval $ac_link; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*

fi
rm -f conftest*

fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&4
    ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&4
fi
done
if test $ac_cv_func_mprotect = yes; then
echo $ac_n "checking for mprotect declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_mprotect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 8975 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/mman.h>

extern 
#ifdef __STDC__
int mprotect (MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
#else
int mprotect();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_mprotect_arg1=""
else
  rm -rf conftest*
  cl_cv_proto_mprotect_arg1="const"
fi
rm -f conftest*




cl_cv_proto_mprotect="extern int mprotect ($cl_cv_proto_mprotect_arg1 $cl_cv_proto_mmap_arg1, $cl_cv_proto_mmap_arg2, int);"
fi

cl_cv_proto_mprotect=`echo "$cl_cv_proto_mprotect" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_mprotect" 1>&4


cat >> confdefs.h <<EOF
#define MPROTECT_CONST $cl_cv_proto_mprotect_arg1
EOF

echo $ac_n "checking for working mprotect""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_mprotect_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
mprotect_prog='
#include <sys/types.h>
/* declare malloc() */
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef malloc
extern 
#ifdef __STDC__
RETMALLOCTYPE malloc (MALLOC_SIZE_T size);
#else
RETMALLOCTYPE malloc();
#endif
#endif
/* declare getpagesize() and mprotect() */
#include <sys/mman.h>
#ifndef HAVE_GETPAGESIZE
#include <sys/param.h>
#define getpagesize() PAGESIZE
#else
extern 
#ifdef __STDC__
RETGETPAGESIZETYPE getpagesize (void);
#else
RETGETPAGESIZETYPE getpagesize();
#endif
#endif
extern 
#ifdef __STDC__
int mprotect (MPROTECT_CONST MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
#else
int mprotect();
#endif
char foo;
main () {
  unsigned long pagesize = getpagesize();
#define page_align(address)  (char*)((unsigned long)(address) & -pagesize)
'
if test "$cross_compiling" = yes; then
  # When cross-compiling, don't assume anything.
no_mprotect=1
else
cat > conftest.$ac_ext <<EOF
#line 9073 "configure"
#include "confdefs.h"
$mprotect_prog
  if ((pagesize-1) & pagesize) exit(1);
  exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  no_mprotect=1
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
mprotect_prog="$mprotect_prog"'
  char* area = malloc(6*pagesize);
  char* fault_address = area + pagesize*7/2;
'
if test -z "$no_mprotect"; then
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 9106 "configure"
#include "confdefs.h"
$mprotect_prog
  if (mprotect(page_align(fault_address),pagesize,PROT_NONE) < 0) exit(0);
  foo = *fault_address; /* this should cause a core dump */
  exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  no_mprotect=1
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test -z "$no_mprotect"; then
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 9137 "configure"
#include "confdefs.h"
$mprotect_prog
  if (mprotect(page_align(fault_address),pagesize,PROT_NONE) < 0) exit(0);
  *fault_address = 'z'; /* this should cause a core dump */
  exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  no_mprotect=1
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test -z "$no_mprotect"; then
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 9168 "configure"
#include "confdefs.h"
$mprotect_prog
  if (mprotect(page_align(fault_address),pagesize,PROT_READ) < 0) exit(0);
  *fault_address = 'z'; /* this should cause a core dump */
  exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  no_mprotect=1
else
  rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test -z "$no_mprotect"; then
if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
cat > conftest.$ac_ext <<EOF
#line 9199 "configure"
#include "confdefs.h"
$mprotect_prog
  if (mprotect(page_align(fault_address),pagesize,PROT_READ) < 0) exit(1);
  if (mprotect(page_align(fault_address),pagesize,PROT_READ|PROT_WRITE) < 0) exit(1);
  *fault_address = 'z'; /* this should not cause a core dump */
  exit(0); }
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  no_mprotect=1
rm -f core
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
if test -z "$no_mprotect"; then
  cl_cv_func_mprotect_works=yes
else
  cl_cv_func_mprotect_works=no
fi

fi

echo "$ac_t""$cl_cv_func_mprotect_works" 1>&4
if test $cl_cv_func_mprotect_works = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_WORKING_MPROTECT 1
EOF

fi
fi

                      if test -n "$have_shm"; then
echo $ac_n "checking for shmget declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_shmget'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 9249 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

extern 
#ifdef __STDC__
int shmget (key_t key, int size, int shmflg);
#else
int shmget();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_shmget_arg2="int"
else
  rm -rf conftest*
  cl_cv_proto_shmget_arg2="size_t"
fi
rm -f conftest*



cl_cv_proto_shmget="extern int shmget (key_t, $cl_cv_proto_shmget_arg2, int);"
fi

cl_cv_proto_shmget=`echo "$cl_cv_proto_shmget" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_shmget" 1>&4


cat >> confdefs.h <<EOF
#define SHMGET_SIZE_T $cl_cv_proto_shmget_arg2
EOF

fi

                      if test -n "$have_shm"; then
echo $ac_n "checking for shmat declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_shmat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 9304 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

extern void* shmat();

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_shmat_ret="void*"
else
  rm -rf conftest*
  cl_cv_proto_shmat_ret="char*"
fi
rm -f conftest*


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

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

extern 
#ifdef __STDC__
$cl_cv_proto_shmat_ret shmat (int shmid, $cl_cv_proto_shmat_ret shmaddr, int shmflg);
#else
$cl_cv_proto_shmat_ret shmat();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  cl_cv_proto_shmat_arg2=""
else
  rm -rf conftest*
  cl_cv_proto_shmat_arg2="const"
fi
rm -f conftest*




cl_cv_proto_shmat="extern $retshmattype shmat (int, $cl_cv_proto_shmat_arg2 $cl_cv_proto_shmat_ret, int);"
fi

cl_cv_proto_shmat=`echo "$cl_cv_proto_shmat" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_shmat" 1>&4


cat >> confdefs.h <<EOF
#define RETSHMATTYPE $cl_cv_proto_shmat_ret
EOF

cat >> confdefs.h <<EOF
#define SHMAT_CONST $cl_cv_proto_shmat_arg2
EOF

fi

                      if test -n "$have_shm"; then
echo $ac_n "checking for shmctl declaration""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_proto_shmctl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  cat > conftest.$ac_ext <<EOF
#line 9395 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

extern 
#ifdef __STDC__
int shmctl (int shmid, int cmd, struct shmid_ds * buf);
#else
int shmctl();
#endif

int main() { return 0; }
int t() {

; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
   cl_cv_proto_shmctl_dots=no
cl_cv_proto_shmctl_args="int, int, struct shmid_ds *"
else
  rm -rf conftest*
   cl_cv_proto_shmctl_dots=yes
cl_cv_proto_shmctl_args="int, int, ..."
fi
rm -f conftest*



cl_cv_proto_shmctl="extern int shmctl ($cl_cv_proto_shmctl_args);"
fi

cl_cv_proto_shmctl=`echo "$cl_cv_proto_shmctl" | tr -s ' ' | sed -e 's/( /(/'`
echo "$ac_t""${ac_tt}$cl_cv_proto_shmctl" 1>&4


if test $cl_cv_proto_shmctl_dots = yes; then
  cat >> confdefs.h <<\EOF
#define SHMCTL_DOTS 1
EOF

fi
fi

                      if test -n "$have_shm"; then
echo $ac_n "checking for attachability of removed shared memory""... $ac_c" 1>&4
if eval "test \"`echo '${'cl_cv_func_shmctl_attachable'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_shmctl_attachable="guessing no"
else
cat > conftest.$ac_ext <<EOF
#line 9458 "configure"
#include "confdefs.h"

#ifdef STDC_HEADERS
#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
#ifdef __STDC__
extern int shmget (key_t key, SHMGET_SIZE_T size, int shmflg);
extern RETSHMATTYPE shmat (int shmid, SHMAT_CONST RETSHMATTYPE shmaddr, int shmflg);
extern 
#ifdef SHMCTL_DOTS
int shmctl (int shmid, int cmd, ...);
#else
int shmctl (int shmid, int cmd, struct shmid_ds * buf);
#endif
#else
extern int shmget();
extern RETSHMATTYPE shmat();
extern int shmctl();
#endif
main ()
{ unsigned int pagesize = 8192; /* should be a multiple of SHMLBA */
  unsigned long addr = (unsigned long) malloc(2*pagesize);
  addr += pagesize-1; addr = (addr/pagesize)*pagesize;
 {unsigned long addr1 = addr + 0x10000;
  unsigned long addr2 = addr + 0x20000;
  int id = shmget(IPC_PRIVATE,pagesize,IPC_CREAT|0600);
  if (id<0)
    { exit(1); }
  if (shmat(id,(RETSHMATTYPE)addr1,0) == (RETSHMATTYPE)(-1))
    { shmctl(id,IPC_RMID,NULL); exit(1); }
  if (shmctl(id,IPC_RMID,NULL) < 0)
    { exit(1); }
  if (shmat(id,(RETSHMATTYPE)addr2,0) == (RETSHMATTYPE)(-1))
    { shmctl(id,IPC_RMID,NULL); exit(1); }
  shmctl(id,IPC_RMID,NULL);
  exit(0);
}}

EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  cl_cv_func_shmctl_attachable=yes
else
  cl_cv_func_shmctl_attachable=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*

fi

echo "$ac_t""$cl_cv_func_shmctl_attachable" 1>&4
case "$cl_cv_func_shmctl_attachable" in
  *yes) cat >> confdefs.h <<\EOF
#define SHM_RMID_VALID 1
EOF
 ;;
  *no)  ;;
esac
fi

                      echo $ac_n "checking whether characters are unsigned""... $ac_c" 1>&4
if eval "test \"`echo '${'ac_cv_c_char_unsigned'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&4
else
  
if test $ac_cv_prog_gcc = yes; then
  # GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
#line 9545 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_c_char_unsigned=yes
else
  rm -rf conftest*
  ac_cv_c_char_unsigned=no
fi
rm -f conftest*

else
if test "$cross_compiling" = yes; then
  ac_cv_c_char_unsigned="guessing no"
else
cat > conftest.$ac_ext <<EOF
#line 9567 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
main() {
  volatile char c = 255; exit(c < 0);
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  ac_cv_c_char_unsigned=yes
else
  ac_cv_c_char_unsigned=no
fi
if test -f core; then
  coredir=core`/bin/sh -c 'echo $$'`
  mkdir $coredir
  cp confdefs.h $coredir/confdefs.h
  mv conftest.c $coredir/conftest.c
  mv conftest $coredir/conftest
  mv core $coredir/core
  echo "warning: test program dumped core -- see subdirectory $coredir"
fi
fi
rm -fr conftest*
fi
fi
echo "$ac_t""$ac_cv_c_char_unsigned" 1>&4
if test $ac_cv_prog_gcc = no; then
  # GCC defines __CHAR_UNSIGNED__ by itself, no need to fix up.
  case "$ac_cv_c_char_unsigned" in
    *yes) cat >> confdefs.h <<\EOF
#define __CHAR_UNSIGNED__ 1
EOF
 ;;
    *no) ;;
  esac
fi

                      if test $cross_compiling = no; then
if test -z "$cl_cv_file_machine_h"; then
echo checking for integer types and behaviour
cat > conftest.c <<EOF
#include "confdefs.h"
EOF
cat ${srcdir}/machine.c >> conftest.c
ORIGCC="$CC"
if test $ac_cv_prog_gcc = yes; then
# gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
# target 80386. Strip "-O".
CC=`echo "$CC " | sed -e 's/-O //g'`
fi
eval $ac_link
CC="$ORIGCC"
if test -s conftest; then
  echo creating machine.h
  ./conftest > conftest.h
  if cmp -s machine.h conftest.h 2>/dev/null; then
    # The file exists and we would not be changing it
    rm -f conftest.h
  else
    rm -f machine.h
    mv conftest.h machine.h
  fi
  cl_cv_file_machine_h=1
else
  echo creation of machine.h failed
fi
rm -f conftest*
fi
else
echo cross-compiling - cannot create machine.h
fi

                      trap '' 1 2 15
if test -w $cache_file; then
echo "updating cache $cache_file"
cat > $cache_file <<\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
# Ultrix sh set writes to stderr and can't be redirected directly.
(set) 2>&1 |
  sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
  >> $cache_file
else
echo "not updating unwritable cache $cache_file"
fi

trap 'rm -fr conftest* confdefs* 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.1"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir

trap 'rm -fr makemake unixconf.h conftest*; exit 1' 1 2 15

# 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%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%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%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@CC_GCC@%$CC_GCC%g
s%@CC_ANSI@%$CC_ANSI%g
s%@CC_NEED_CCPAUX@%$CC_NEED_CCPAUX%g
s%@CC_NEED_DEELIF@%$CC_NEED_DEELIF%g
s%@CC_NEED_DEERROR@%$CC_NEED_DEERROR%g
s%@CC_NEED_DEEMA@%$CC_NEED_DEEMA%g
s%@CC_NEED_MERGESTRINGS@%$CC_NEED_MERGESTRINGS%g
s%@AS_UNDERSCORE@%$AS_UNDERSCORE%g
s%@RANLIB@%$RANLIB%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CP@%$CP%g
s%@LN_S@%$LN_S%g
s%@GOOD_SH@%$GOOD_SH%g
s%@HAVE_XMKMF@%$HAVE_XMKMF%g
s%@X_INCLUDES@%$X_INCLUDES%g
s%@X_LIBS@%$X_LIBS%g
s%@GMALLOC@%$GMALLOC%g
s%@ALLOCA@%$ALLOCA%g

CEOF
EOF
cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"makemake"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[: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 relative srcdir, etc. 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="/$ac_dir"
    # 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
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
fi; done
rm -f conftest.subs

# 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'
# ac_f turns "#define NAME" without trailing blanks into "#define NAME VALUE".
ac_fA='s%^\([ 	]*\)#\([ 	]*\)define\([ 	][ 	]*\)'
ac_fB='$%\1#\2define\3'
ac_fC=' '
ac_fD='%g'

CONFIG_HEADERS=${CONFIG_HEADERS-"unixconf.h"}
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[: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
  cp $ac_given_srcdir/$ac_file_in 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
s%ac_e%ac_f%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr


# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.
# Maximum number of lines to put in a single here document.
ac_max_here_lines=12

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
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done


echo '#!/bin/sh' > makemake.tmp
echo '# Generated automatically from makemake.in by configure.' >> makemake.tmp
cat makemake >> makemake.tmp
mv makemake.tmp makemake
chmod a+x makemake

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


