#! /bin/sh

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

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

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

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

ac_prev=
for ac_option
do

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

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

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

  case "$ac_option" in

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  esac
done

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

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

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

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

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

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

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

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=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} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	' 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>&6
echo "configure:533: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:563: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:614: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

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

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

cat > conftest.$ac_ext << EOF

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

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

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

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

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
else
  if test "$GCC" = yes; then
    # Add "-O" to both the CC and CPP commands, to eliminate possible confusion
    # that results from __OPTIMIZE__ being defined for CC but not CPP.
    if echo "$CC " | grep ' -O[1-9 ]' > /dev/null 2>&1; then
      : # already optimizing
    else
      CC="$CC -O"
      ac_cv_prog_CC="$CC"
    fi
  else
    CFLAGS=
  fi
fi

                      echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:737: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  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 757 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_have_cpp=1
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
  if test -z "$ac_have_cpp"; then
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
#line 777 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_have_cpp=1
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    if test -n "$ac_have_cpp"; then
      CC="${CC-cc} -traditional-cpp"
    else
      CPP="${CC-cc} -nologo -E"
      cat > conftest.$ac_ext <<EOF
#line 799 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_have_cpp=1
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      if test -n "$ac_have_cpp"; then
        CC="${CC-cc} -nologo"
      else
        CPP=/lib/cpp
      fi
    fi
  fi
  ac_cv_prog_CC="$CC"
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

                      echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:833: checking for AIX" >&5
if eval "test \"`echo '$''{'ac_cv_sys_aix'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 839 "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>&6
if test $ac_cv_sys_aix = yes; then
  cat >> confdefs.h <<\EOF
#define _ALL_SOURCE 1
EOF

fi

                      
echo $ac_n "checking whether using GNU C""... $ac_c" 1>&6
echo "configure:868: checking whether using GNU C" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 874 "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>&6
if test $cl_cv_prog_cc_gcc = yes; then
  CC_GCC=true
  GCC_X_NONE='-x none'
else
  CC_GCC=false
  GCC_X_NONE=''
fi

                      
echo $ac_n "checking whether using C++""... $ac_c" 1>&6
echo "configure:904: checking whether using C++" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_cplusplus'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 910 "configure"
#include "confdefs.h"
#ifdef __cplusplus
  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_cplusplus=yes
else
  rm -rf conftest*
  cl_cv_prog_cc_cplusplus=no
fi
rm -f conftest*


fi
echo "$ac_t""$cl_cv_prog_cc_cplusplus" 1>&6
if test $cl_cv_prog_cc_cplusplus = yes; then
  CC_CPLUSPLUS=true
else
  CC_CPLUSPLUS=false
fi

                      
echo $ac_n "checking whether using ANSI C""... $ac_c" 1>&6
echo "configure:938: checking whether using ANSI C" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_ansi'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 944 "configure"
#include "confdefs.h"
#if defined(__STDC__) || defined(__cplusplus)
  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>&6
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>&6
echo "configure:972: checking whether CPP likes indented directives" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_indented'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 978 "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>&6
if test $cl_cv_prog_cc_indented = yes; then
  CC_NEED_CCPAUX=false
else
  CC_NEED_CCPAUX=true
fi

                      
echo $ac_n "checking whether CPP likes empty macro arguments""... $ac_c" 1>&6
echo "configure:1003: checking whether CPP likes empty macro arguments" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_ema'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1009 "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
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  cl_cv_prog_cc_ema=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_prog_cc_ema=no
fi
rm -f conftest*

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

                      
echo $ac_n "checking for underscore in external names""... $ac_c" 1>&6
echo "configure:1039: checking for underscore in external names" >&5
if eval "test \"`echo '$''{'cl_cv_prog_as_underscore'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.c <<EOF
int foo() { return 0; }
EOF
# look for the assembly language name in the .s file
{ ac_try='${CC-cc} -S conftest.c'; { (eval echo configure:1048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/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
rm -f conftest*

fi
echo "$ac_t""$cl_cv_prog_as_underscore" 1>&6
if test $cl_cv_prog_as_underscore = yes; then
  AS_UNDERSCORE=true
  cat >> confdefs.h <<\EOF
#define ASM_UNDERSCORE 1
EOF

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

                      # 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>&6
echo "configure:1109: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'cl_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    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
	    if test $ac_prog = installbsd &&
	      grep src/bos $ac_dir/$ac_prog >/dev/null 2>&1; then
	      # AIX installbsd doesn't work without option "-g".
	      :
	    else
	      cl_cv_path_install="$ac_dir/$ac_prog -c"
	      break 2
	    fi
	  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>&6
# 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>&6
echo "configure:1162: checking how to copy files" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cp'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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>&6
CP="$cl_cv_prog_cp"

                      echo $ac_n "checking how to make hard links""... $ac_c" 1>&6
echo "configure:1181: checking how to make hard links" >&5
if eval "test \"`echo '$''{'cl_cv_prog_LN'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
rm -f conftestdata conftestfile
echo data > conftestfile
if ln conftestfile conftestdata 2>/dev/null; then
  cl_cv_prog_LN=ln
else
  cl_cv_prog_LN="$cl_cv_prog_cp"
fi
rm -f conftestdata conftestfile

fi
echo "$ac_t""$cl_cv_prog_LN" 1>&6
LN="$cl_cv_prog_LN"

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1200: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'cl_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null; then
  cl_cv_prog_LN_S="ln -s"
else
  cl_cv_prog_LN_S="$cl_cv_prog_LN"
fi
rm -f conftestdata

fi
if test "$cl_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
LN_S="$cl_cv_prog_LN_S"

                      echo $ac_n "checking how to make hard links to symlinks""... $ac_c" 1>&6
echo "configure:1222: checking how to make hard links to symlinks" >&5
if eval "test \"`echo '$''{'cl_cv_prog_hln'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_prog_hln="ln"
if test "$cl_cv_prog_LN_S" = "ln -s"; then
echo "blabla" > conftest.x
ln -s conftest.x conftest.y
ln conftest.y conftest.z 2>&5
rm -f conftest.x
if cat conftest.z > /dev/null 2>&1 ; then
  # ln is usable.
  cl_cv_prog_hln="ln"
else
  # conftest.z is a symbolic link to the non-existent conftest.x
  cl_cv_prog_hln="hln"
fi
else
# If there are no symbolic links, the problem cannot occur.
cl_cv_prog_hln="ln"
fi
rm -f conftest*

fi
echo "$ac_t""$cl_cv_prog_hln" 1>&6
HLN="$cl_cv_prog_hln"

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

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

int main() {

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

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

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

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

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

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

  LIBS="-lsun $LIBS"

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

fi

                      echo $ac_n "checking for DYNIX/ptx libseq or libsocket""... $ac_c" 1>&6
echo "configure:1384: checking for DYNIX/ptx libseq or libsocket" >&5
if eval "test \"`echo '$''{'cl_cv_lib_sequent'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1390 "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>&6
if test $cl_cv_lib_sequent = yes; then
echo $ac_n "checking for -lseq""... $ac_c" 1>&6
echo "configure:1412: checking for -lseq" >&5
ac_lib_var=`echo seq | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lseq  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1420 "configure"
#include "confdefs.h"

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

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

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

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

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

fi

                      echo $ac_n "checking whether gethostent requires -lnsl""... $ac_c" 1>&6
echo "configure:1486: checking whether gethostent requires -lnsl" >&5
if eval "test \"`echo '$''{'cl_cv_lib_nsl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_lib_nsl=no
cat > conftest.$ac_ext <<EOF
#line 1493 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char gethostent();
int main() {
gethostent();
; return 0; }
EOF
if { (eval echo configure:1504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  have_gethostent=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test -z "$have_gethostent"; then
cl_save_LIBS="$LIBS"
LIBS="$LIBS -lnsl"
cat > conftest.$ac_ext <<EOF
#line 1516 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char gethostent();
int main() {
gethostent();
; return 0; }
EOF
if { (eval echo configure:1527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_lib_nsl=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
LIBS="$cl_save_LIBS"
fi

fi
echo "$ac_t""$cl_cv_lib_nsl" 1>&6
if test $cl_cv_lib_nsl = yes; then
  LIBS="$LIBS -lnsl"
fi
echo $ac_n "checking whether setsockopt requires -lsocket""... $ac_c" 1>&6
echo "configure:1544: checking whether setsockopt requires -lsocket" >&5
if eval "test \"`echo '$''{'cl_cv_lib_socket'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_lib_socket=no
cat > conftest.$ac_ext <<EOF
#line 1551 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char setsockopt();
int main() {
setsockopt();
; return 0; }
EOF
if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  have_setsockopt=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test -z "$have_setsockopt"; then
cl_save_LIBS="$LIBS"
LIBS="$LIBS -lsocket"
cat > conftest.$ac_ext <<EOF
#line 1574 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char setsockopt();
int main() {
setsockopt();
; return 0; }
EOF
if { (eval echo configure:1585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_lib_socket=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
LIBS="$cl_save_LIBS"
fi

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

                      echo $ac_n "checking whether CC works at all""... $ac_c" 1>&6
echo "configure:1603: checking whether CC works at all" >&5
if eval "test \"`echo '$''{'cl_cv_prog_cc_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

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

if test "$cross_compiling" = yes; then
  cat > conftest.$ac_ext <<EOF
#line 1618 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_prog_cc_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_prog_cc_works=no
fi
rm -f conftest*
else
  cat > conftest.$ac_ext <<EOF
#line 1637 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
int main() { exit(0); }
EOF
if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_prog_cc_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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


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

                       ac_aux_dir=${srcdir}/autoconf
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:1684: checking host system type" >&5
if eval "test \"`echo '$''{'cl_cv_host'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)         host_alias=`export CC; ${CONFIG_SHELL-/bin/sh} $ac_config_guess` ;;
  *)    host_alias=$nonopt ;;
  esac ;;
esac
# Don't fail just because the system is not listed in GNU's database.
if test -n "$host_alias"; then
  host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
else
  host_alias=unknown
  host=unknown-unknown-unknown
fi
cl_cv_host_alias="$host_alias"
cl_cv_host="$host"

fi
echo "$ac_t""$cl_cv_host" 1>&6
host_alias="$cl_cv_host_alias"
host="$cl_cv_host"
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`


case "$host_cpu" in
  i[4567]86 )
    host_cpu=i386
    ;;
  alphaev[4-7] | alphaev56 | alphapca5[67] )
    host_cpu=alpha
    ;;
  hppa1.0 | hppa1.1 | hppa2.0 )
    host_cpu=hppa
    ;;
  powerpc )
    host_cpu=rs6000
    ;;
  c1 | c2 | c32 | c34 | c38 | c4 )
    host_cpu=convex
    ;;
  mips )
    echo $ac_n "checking for 64-bit MIPS""... $ac_c" 1>&6
echo "configure:1738: checking for 64-bit MIPS" >&5
if eval "test \"`echo '$''{'cl_cv_host_mips64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1744 "configure"
#include "confdefs.h"
#if defined(_MIPS_SZLONG)
#if (_MIPS_SZLONG == 64)
/* We should also check for (_MIPS_SZPTR == 64), but gcc keeps this at 32. */
  yes
#endif
#endif

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


fi
echo "$ac_t""$cl_cv_host_mips64" 1>&6
if test $cl_cv_host_mips64 = yes; then
  host_cpu=mips64
fi
    ;;
  sparc | sparc64 )
    echo $ac_n "checking for 64-bit SPARC""... $ac_c" 1>&6
echo "configure:1773: checking for 64-bit SPARC" >&5
if eval "test \"`echo '$''{'cl_cv_host_sparc64'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1779 "configure"
#include "confdefs.h"
#if defined(__sparcv9) || defined(__arch64__)
  yes
#endif

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


fi
echo "$ac_t""$cl_cv_host_sparc64" 1>&6
if test $cl_cv_host_sparc64 = yes; then
  host_cpu=sparc64
else
  host_cpu=sparc
fi
    ;;
esac
cat >> confdefs.h <<EOF
#ifndef __${host_cpu}__
#define __${host_cpu}__ 1
#endif
EOF

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

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

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

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

int main() {
void f();
typedef void x; x g();
typedef void* y; y a;

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

fi

echo "$ac_t""$cl_cv_c_void" 1>&6
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>&6
echo "configure:1892: checking for working \"return void\"" >&5
if eval "test \"`echo '$''{'cl_cv_c_return_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1898 "configure"
#include "confdefs.h"
void f() {} typedef void x; x g() { return f(); }
int main() {

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

fi

echo "$ac_t""$cl_cv_c_return_void" 1>&6
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>&6
echo "configure:1928: checking for long long type" >&5
if eval "test \"`echo '$''{'cl_cv_c_longlong'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_c_longlong="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 1937 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
int main()
{
/* long longs don't work right with gcc-2.7.2 on m68k */
/* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
   miscompiled. */
#ifdef __GNUC__
#if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
#if (__GNUC__ == 2)
#if (__GNUC_MINOR__ <= 7)
  exit(1);
#endif
#endif
#endif
#endif
  { long x = 944938507; long y = 737962842; long z = 162359677;
    exit(!(((long long) x)*((long long) y)>>32 == z));
  }
}
EOF
if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_c_longlong=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


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

fi

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

fi


                      echo $ac_n "checking for offsetof in stddef.h""... $ac_c" 1>&6
echo "configure:2035: checking for offsetof in stddef.h" >&5
if eval "test \"`echo '$''{'cl_cv_offsetof'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2041 "configure"
#include "confdefs.h"
#include <stddef.h>
int main() {
#ifndef offsetof
error no offsetof
#endif

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

fi

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

fi


                      echo $ac_n "checking for stdbool.h""... $ac_c" 1>&6
echo "configure:2074: checking for stdbool.h" >&5
if eval "test \"`echo '$''{'cl_cv_header_stdbool_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2080 "configure"
#include "confdefs.h"
#include <stdbool.h>
#if false
int A[-1];
#endif
#define b -1
#if true
#undef b
#define b 1
#endif
int B[b];

int main() {

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

fi

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

STDBOOL_H=''
else
  STDBOOL_H='stdbool.h'
fi



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


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


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

if test $ac_cv_header_sys_file_h = yes; then
accessflags_decl='
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
'
accessflags_prog='int x = R_OK | W_OK | X_OK;'
echo $ac_n "checking for R_OK in unistd.h""... $ac_c" 1>&6
echo "configure:2255: checking for R_OK in unistd.h" >&5
if eval "test \"`echo '$''{'cl_cv_decl_R_OK_unistd_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2261 "configure"
#include "confdefs.h"
$accessflags_decl
int main() {
$accessflags_prog
; return 0; }
EOF
if { (eval echo configure:2268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_decl_R_OK_unistd_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_decl_R_OK_unistd_h=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_decl_R_OK_unistd_h" 1>&6
if test $cl_cv_decl_R_OK_unistd_h = yes; then
  accessflags_ok=1
fi
if test -z "$accessflags_ok"; then
cat >> confdefs.h <<\EOF
#define ACCESS_NEEDS_SYS_FILE_H 1
EOF

fi
fi

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

if test $ac_cv_header_sys_file_h = yes; then
openflags_decl='
#include <stdlib.h>
#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>&6
echo "configure:2345: checking for O_RDWR in fcntl.h" >&5
if eval "test \"`echo '$''{'cl_cv_decl_O_RDWR_fcntl_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2351 "configure"
#include "confdefs.h"
$openflags_decl
int main() {
$openflags_prog
; return 0; }
EOF
if { (eval echo configure:2358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_decl_O_RDWR_fcntl_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
if test $cl_cv_decl_O_RDWR_fcntl_h = yes; then
  openflags_ok=1
fi
if test -z "$openflags_ok"; then
cat >> confdefs.h <<\EOF
#define OPEN_NEEDS_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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
echo "configure:2387: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2392 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:2400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval "ac_cv_header_dirent_$ac_safe=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
  ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
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 opendir in -ldir""... $ac_c" 1>&6
echo "configure:2440: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir_opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldir  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2448 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char opendir();

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

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

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

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

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

fi

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

fi

echo "$ac_t""$cl_cv_struct_utsname" 1>&6
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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2568: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2573 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


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

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

fi

                      
for ac_hdr in termios.h termio.h sys/termio.h sgtty.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2693: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2698 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_termios_h = yes; then
echo $ac_n "checking for tcgetattr""... $ac_c" 1>&6
echo "configure:2730: checking for tcgetattr" >&5
if eval "test \"`echo '$''{'cl_cv_func_tcgetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2736 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
struct termios t; tcgetattr(0,&t);
; return 0; }
EOF
if { (eval echo configure:2743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_tcgetattr=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_tcgetattr=no
fi
rm -f conftest*

fi

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

fi
if test $cl_cv_func_tcgetattr = yes; then
echo $ac_n "checking for tcsetattr declaration""... $ac_c" 1>&6
echo "configure:2765: checking for tcsetattr declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_tcsetattr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2771 "configure"
#include "confdefs.h"

#include <termios.h>
#ifndef tcsetattr
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int tcsetattr (int, int, struct termios *);
#else
int tcsetattr ();
#endif
#endif

int main() {

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

cl_cv_proto_tcsetattr="extern int tcsetattr (int, int, $cl_cv_proto_tcsetattr_arg3 struct termios *);"
fi

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


cat >> confdefs.h <<EOF
#define TCSETATTR_CONST $cl_cv_proto_tcsetattr_arg3
EOF

fi
echo $ac_n "checking for TCSAFLUSH in termios.h""... $ac_c" 1>&6
echo "configure:2816: checking for TCSAFLUSH in termios.h" >&5
if eval "test \"`echo '$''{'cl_cv_decl_TCSAFLUSH'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2822 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
int x = TCSAFLUSH;
; return 0; }
EOF
if { (eval echo configure:2829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_decl_TCSAFLUSH=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_decl_TCSAFLUSH=no
fi
rm -f conftest*

fi

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

fi
echo $ac_n "checking for struct winsize in termios.h""... $ac_c" 1>&6
echo "configure:2850: checking for struct winsize in termios.h" >&5
if eval "test \"`echo '$''{'cl_cv_struct_winsize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2856 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
struct winsize w;
; return 0; }
EOF
if { (eval echo configure:2863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_winsize=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_struct_winsize=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_struct_winsize" 1>&6
if test $cl_cv_struct_winsize = yes; then
  :
fi
if test $cl_cv_struct_winsize = no; then
echo $ac_n "checking for struct winsize in sys/ioctl.h""... $ac_c" 1>&6
echo "configure:2882: checking for struct winsize in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'cl_cv_struct_winsize_ioctl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2888 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ioctl.h>
int main() {
struct winsize w;
; return 0; }
EOF
if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_winsize_ioctl=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_struct_winsize_ioctl=no
fi
rm -f conftest*

fi

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

fi
if test $cl_cv_struct_winsize_ioctl = no; then
echo $ac_n "checking for struct winsize in sys/ptem.h""... $ac_c" 1>&6
echo "configure:2918: checking for struct winsize in sys/ptem.h" >&5
if eval "test \"`echo '$''{'cl_cv_struct_winsize_ptem'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 2924 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/ptem.h>
int main() {
struct winsize w;
; return 0; }
EOF
if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_winsize_ptem=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_struct_winsize_ptem=no
fi
rm -f conftest*

fi

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

fi
fi
fi
fi

                      echo "checking for X11" 1>&6
echo "configure:2958: checking for X11" >&5
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>&6
echo "configure:2964: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_HAVE_XMKMF'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_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>&6
else
  echo "$ac_t""no" 1>&6
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>&6
echo "configure:3001: checking for X" >&5

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

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

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

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

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

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

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

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

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

if test "$have_x" != yes; then
  echo "$ac_t""$have_x" 1>&6
  no_x=yes
else
  # If each of the values was on the command line, it overrides each guess.
  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  # Update the cache value to reflect the command line values.
  ac_cv_have_x="have_x=yes \
		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
fi
  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>&6
echo "configure:3240: checking for X11 header files" >&5
  cat > conftest.$ac_ext <<EOF
#line 3242 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  have_x_includes=1
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&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>&6
  echo $ac_n "checking for X11 library""... $ac_c" 1>&6
echo "configure:3273: checking for X11 library" >&5
  
  :
ac_lib_var=`echo X11 | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lX11  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3283 "configure"
#include "confdefs.h"

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  :
  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
    :
ac_lib_var=`echo Xwindow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lXwindow  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3333 "configure"
#include "confdefs.h"

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  :
  X_LIBS='-lXwindow' have_x_libraries=1
else
  :
fi
  fi
  
  echo "$ac_t""$X_LIBS" 1>&6
    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 caddr_t in sys/types.h""... $ac_c" 1>&6
echo "configure:3375: checking for caddr_t in sys/types.h" >&5
if eval "test \"`echo '$''{'cl_cv_type_caddr_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3381 "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>&6
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 socklen_t in sys/socket.h""... $ac_c" 1>&6
echo "configure:3412: checking for socklen_t in sys/socket.h" >&5
if eval "test \"`echo '$''{'cl_cv_type_socklen_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3418 "configure"
#include "confdefs.h"
#include <sys/socket.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "socklen_t" >/dev/null 2>&1; then
  rm -rf conftest*
  cl_cv_type_socklen_t=yes
else
  rm -rf conftest*
  cl_cv_type_socklen_t=no
fi
rm -f conftest*


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

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

fi


                      echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&6
echo "configure:3449: checking for d_namlen in struct dirent" >&5
if eval "test \"`echo '$''{'cl_cv_struct_dirent_d_namlen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3455 "configure"
#include "confdefs.h"
#include <dirent.h>
int main() {
struct dirent d; d.d_namlen;
; return 0; }
EOF
if { (eval echo configure:3462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_dirent_d_namlen=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
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>&6
echo "configure:3487: checking for struct tm in sys/time.h" >&5
if eval "test \"`echo '$''{'cl_cv_struct_tm_sys_time_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3493 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
if { (eval echo configure:3501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_tm_sys_time_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
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 3531 "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>&6
echo "configure:3552: checking for strlen declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_strlen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3558 "configure"
#include "confdefs.h"
#define strlen foo
#include <string.h>

extern
#ifdef __cplusplus
"C"
#endif
int strlen();

int main() {

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$cl_cv_proto_strlen_ret strlen (char* s);
#else
$cl_cv_proto_strlen_ret strlen();
#endif

int main() {

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


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

                      echo $ac_n "checking for memset declaration""... $ac_c" 1>&6
echo "configure:3635: checking for memset declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_memset'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for y in 'int' 'size_t'; do
for x in 'char*' 'void*'; do
if test -z "$have_memset"; then
cat > conftest.$ac_ext <<EOF
#line 3644 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#undef memset
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$x memset ($x s, int c, $y n);
#else
$x memset();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_memset_ret="$x"
cl_cv_proto_memset_arg1="$x"
cl_cv_proto_memset_arg3="$y"
have_memset=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
done
done

cl_cv_proto_memset="extern $cl_cv_proto_memset_ret memset ($cl_cv_proto_memset_arg1, int, $cl_cv_proto_memset_arg3);"
fi

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


cat >> confdefs.h <<EOF
#define RETMEMSETTYPE $cl_cv_proto_memset_ret
EOF


                      echo $ac_n "checking for broken HP/UX malloc""... $ac_c" 1>&6
echo "configure:3696: checking for broken HP/UX malloc" >&5
if eval "test \"`echo '$''{'cl_cv_func_malloc_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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.
case "$host_os" in
  hpux*) cl_cv_func_malloc_broken=yes ;;
  *) cl_cv_func_malloc_broken=no ;;
esac
else
cl_cv_func_malloc_broken="guessing no"
fi

fi
echo "$ac_t""$cl_cv_func_malloc_broken" 1>&6
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>&6
echo "configure:3723: checking for malloc declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3729 "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 3741 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif
void* malloc();
int main() {

; return 0; }
EOF
if { (eval echo configure:3757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  malloc_void=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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 3772 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$cl_cv_proto_malloc_ret malloc (unsigned int size);
#else
$cl_cv_proto_malloc_ret malloc();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:3795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_malloc_arg1="unsigned int"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6


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>&6
echo "configure:3824: checking for free declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_free'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3830 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif
int free();

int main() {

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


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>&6
echo "configure:3874: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'cl_cv_header_alloca_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3880 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = (char *) alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:3887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_header_alloca_h=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_header_alloca_h" 1>&6
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 _MSC_VER
#include <malloc.h>
#define alloca _alloca
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
 #pragma alloca
#else
#ifndef alloca
char *alloca ();
#endif
#endif
#endif
#endif
#endif
"
echo $ac_n "checking for alloca""... $ac_c" 1>&6
echo "configure:3929: checking for alloca" >&5
if eval "test \"`echo '$''{'cl_cv_func_alloca'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 3935 "configure"
#include "confdefs.h"
$decl
int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
if { (eval echo configure:3942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_alloca=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_alloca=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_func_alloca" 1>&6
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.${ac_objext}
  cat >> confdefs.h <<\EOF
#define NO_ALLOCA 1
EOF

fi

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

int main() {

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

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

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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'_longjmp`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
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 4084 "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>&6
echo "configure:4102: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'cl_cv_type_signal'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4107 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern
#ifdef __cplusplus
"C" void (*signal (int, void (*)(int)))(int);
#else
void (*signal ()) ();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:4125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_type_signal=void
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
cat > conftest.$ac_ext <<EOF
#line 4134 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern
#ifdef __cplusplus
"C" void (*signal (...))(...);
#else
void (*signal ()) ();
#endif

int main() {

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

echo $ac_n "checking whether the signal handler function type needs dots""... $ac_c" 1>&6
echo "configure:4171: checking whether the signal handler function type needs dots" >&5
if eval "test \"`echo '$''{'cl_cv_proto_signal_dots'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4176 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern
#ifdef __cplusplus
"C" $cl_cv_type_signal (*signal (int, $cl_cv_type_signal (*)(int)))(int);
#else
$cl_cv_type_signal (*signal ()) ();
#endif

int main() {

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

fi

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

int main() {

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

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

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

signalblocks="$signalblocks SystemV"
else
  echo "$ac_t""no" 1>&6
fi
cat > conftest.$ac_ext <<EOF
#line 4269 "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>&6
echo "configure:4283: checking for sigprocmask" >&5
if eval "test \"`echo '$''{'ac_cv_func_sigprocmask'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4288 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char sigprocmask(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char sigprocmask();

int main() {

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

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

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

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

int main() {

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

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

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

signalblocks="$signalblocks BSD"
else
  echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for signal blocking interfaces""... $ac_c" 1>&6
echo "configure:4392: checking for signal blocking interfaces" >&5
if eval "test \"`echo '$''{'cl_cv_func_signalblocks'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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>&6

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int sigprocmask (int how, sigset_t* set, sigset_t* oset);
#else
int sigprocmask();
#endif

int main() {

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


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

  ;;
  *) ;;
esac

                      echo $ac_n "checking whether signal handlers need to be reinstalled""... $ac_c" 1>&6
echo "configure:4467: checking whether signal handlers need to be reinstalled" >&5
if eval "test \"`echo '$''{'cl_cv_func_signal_reinstall'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_signal_reinstall="guessing yes"
else
  cat > conftest.$ac_ext <<EOF
#line 4476 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#ifdef __CYGWIN32__
/* On Cygwin32 version 18, this test would hang (SIGALRM not being signalled).
 * Let it fail instead. */
#error "better fail than hang"
#endif
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
volatile int gotsig=0;
RETSIGTYPE sigalrm_handler() { gotsig=1; }
int got_sig () { return gotsig; }
#ifdef __cplusplus
#ifdef SIGTYPE_DOTS
typedef RETSIGTYPE (*signal_handler) (...);
#else
typedef RETSIGTYPE (*signal_handler) (int);
#endif
#else
typedef RETSIGTYPE (*signal_handler) ();
#endif
int 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
if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_signal_reinstall=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


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

                      case "$signalblocks" in
  *POSIX* | *BSD*)
echo $ac_n "checking whether signals are blocked when signal handlers are entered""... $ac_c" 1>&6
echo "configure:4549: checking whether signals are blocked when signal handlers are entered" >&5
if eval "test \"`echo '$''{'cl_cv_func_signal_blocked'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_signal_blocked="guessing yes"
else
  cat > conftest.$ac_ext <<EOF
#line 4558 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#ifdef __CYGWIN32__
/* On Cygwin32 version 18, this test would hang (SIGALRM not being signalled).
 * Let it fail instead. */
#error "better fail than hang"
#endif
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
volatile int gotsig=0;
volatile int wasblocked=0;
#ifdef __cplusplus
#ifdef SIGTYPE_DOTS
typedef RETSIGTYPE (*signal_handler) (...);
#else
typedef RETSIGTYPE (*signal_handler) (int);
#endif
#else
typedef RETSIGTYPE (*signal_handler) ();
#endif
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; }
int main() { /* returns 0 if they need not to be unblocked */
  signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(wasblocked);
}
EOF
if { (eval echo configure:4608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_signal_blocked=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


fi
echo "$ac_t""$cl_cv_func_signal_blocked" 1>&6
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* | *BSD*)
echo $ac_n "checking whether other signals are blocked when signal handlers are entered""... $ac_c" 1>&6
echo "configure:4646: checking whether other signals are blocked when signal handlers are entered" >&5
if eval "test \"`echo '$''{'cl_cv_func_signal_blocked_others'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_signal_blocked_others="guessing yes"
else
  cat > conftest.$ac_ext <<EOF
#line 4655 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#ifdef __CYGWIN32__
/* On Cygwin32 version 18, this test would hang (SIGALRM not being signalled).
 * Let it fail instead. */
#error "better fail than hang"
#endif
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
volatile int gotsig=0;
volatile int somewereblocked=0;
#ifdef __cplusplus
#ifdef SIGTYPE_DOTS
typedef RETSIGTYPE (*signal_handler) (...);
#else
typedef RETSIGTYPE (*signal_handler) (int);
#endif
#else
typedef RETSIGTYPE (*signal_handler) ();
#endif
RETSIGTYPE sigalrm_handler()
{ gotsig=1;
#ifdef SIGNAL_NEED_REINSTALL
  signal(SIGALRM,(signal_handler)sigalrm_handler);
#endif
#ifdef SIGNALBLOCK_POSIX
  { sigset_t blocked;
    int i;
    sigprocmask(SIG_BLOCK, (sigset_t *) 0, &blocked);
    for (i=1; i<32; i++)
      if (i!=SIGALRM && sigismember(&blocked,i))
        somewereblocked = 1;
  }
#else
  somewereblocked = ((sigblock(0) & ~sigmask(SIGALRM)) != 0);
#endif
}
int got_sig () { return gotsig; }
int main() { /* returns 0 if they need not to be unblocked */
  signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(somewereblocked);
}
EOF
if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_signal_blocked_others=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cl_cv_func_signal_blocked_others=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
rm -fr conftest*
fi


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

                      

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

int main() {

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

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

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

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

                      if test -n "$have_sigaction"; then
echo $ac_n "checking whether sigaction handlers need to be reinstalled""... $ac_c" 1>&6
echo "configure:4802: checking whether sigaction handlers need to be reinstalled" >&5
if eval "test \"`echo '$''{'cl_cv_func_sigaction_reinstall'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_sigaction_reinstall="guessing yes"
else
  cat > conftest.$ac_ext <<EOF
#line 4811 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#ifdef __CYGWIN32__
/* On Cygwin32 version 18, this test would hang (SIGALRM not being signalled).
 * Let it fail instead. */
#error "better fail than hang"
#endif
#ifdef __cplusplus
#ifdef SIGTYPE_DOTS
typedef RETSIGTYPE (*signal_handler) (...);
#else
typedef RETSIGTYPE (*signal_handler) (int);
#endif
#else
typedef RETSIGTYPE (*signal_handler) ();
#endif
#if defined(__STDC__) || defined(__cplusplus)
signal_handler mysignal (int sig, signal_handler handler)
#else
signal_handler mysignal (sig, handler)
     int sig;
     signal_handler handler;
#endif
{ struct sigaction old_sa;
  struct sigaction new_sa;
  memset(&new_sa,0,sizeof(new_sa));
  new_sa.sa_handler = handler;
  if (sigaction(sig,&new_sa,&old_sa)<0) { return (signal_handler)SIG_IGN; }
  return (signal_handler)old_sa.sa_handler;
}
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
volatile int gotsig=0;
RETSIGTYPE sigalrm_handler() { gotsig=1; }
int got_sig () { return gotsig; }
int main() { /* returns 0 if they need not to be reinstalled */
  mysignal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(!( mysignal(SIGALRM,(signal_handler)sigalrm_handler)
          == (signal_handler)sigalrm_handler
      ) );
}
EOF
if { (eval echo configure:4863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_sigaction_reinstall=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cl_cv_func_sigaction_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
rm -fr conftest*
fi


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

                      if test -n "$have_sigaction"; then
case "$signalblocks" in
  *POSIX* | *BSD*)
echo $ac_n "checking whether signals are blocked when sigaction handlers are entered""... $ac_c" 1>&6
echo "configure:4900: checking whether signals are blocked when sigaction handlers are entered" >&5
if eval "test \"`echo '$''{'cl_cv_func_sigaction_blocked'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_sigaction_blocked="guessing yes"
else
  cat > conftest.$ac_ext <<EOF
#line 4909 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#ifdef __CYGWIN32__
/* On Cygwin32 version 18, this test would hang (SIGALRM not being signalled).
 * Let it fail instead. */
#error "better fail than hang"
#endif
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
#ifdef __cplusplus
#ifdef SIGTYPE_DOTS
typedef RETSIGTYPE (*signal_handler) (...);
#else
typedef RETSIGTYPE (*signal_handler) (int);
#endif
#else
typedef RETSIGTYPE (*signal_handler) ();
#endif
#if defined(__STDC__) || defined(__cplusplus)
signal_handler mysignal (int sig, signal_handler handler)
#else
signal_handler mysignal (sig, handler)
     int sig;
     signal_handler handler;
#endif
{ struct sigaction old_sa;
  struct sigaction new_sa;
  memset(&new_sa,0,sizeof(new_sa));
  new_sa.sa_handler = handler;
  if (sigaction(sig,&new_sa,&old_sa)<0) { return (signal_handler)SIG_IGN; }
  return (signal_handler)old_sa.sa_handler;
}
volatile int gotsig=0;
volatile int wasblocked=0;
RETSIGTYPE sigalrm_handler()
{ gotsig=1;
#ifdef SIGNAL_NEED_REINSTALL
  mysignal(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; }
int main() { /* returns 0 if they need not to be unblocked */
  mysignal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  exit(wasblocked);
}
EOF
if { (eval echo configure:4973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_sigaction_blocked=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cl_cv_func_sigaction_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
rm -fr conftest*
fi


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

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

int main() {

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

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

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

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

int main() {

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

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

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

                      echo $ac_n "checking for fpu_control_t""... $ac_c" 1>&6
echo "configure:5124: checking for fpu_control_t" >&5
if eval "test \"`echo '$''{'cl_cv_type_fpu_control_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5130 "configure"
#include "confdefs.h"
#include <fpu_control.h>
int main() {
fpu_control_t x;
; return 0; }
EOF
if { (eval echo configure:5137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_type_fpu_control_t=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_type_fpu_control_t=no
fi
rm -f conftest*

fi

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

fi

echo $ac_n "checking for __setfpucw""... $ac_c" 1>&6
echo "configure:5159: checking for __setfpucw" >&5
if eval "test \"`echo '$''{'cl_cv_func_setfpucw'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5165 "configure"
#include "confdefs.h"
#include <fpu_control.h>
int main() {
__setfpucw(_FPU_IEEE);
; return 0; }
EOF
if { (eval echo configure:5172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_func_setfpucw=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_setfpucw=no
fi
rm -f conftest*

fi

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

fi


                      echo $ac_n "checking for raise""... $ac_c" 1>&6
echo "configure:5195: checking for raise" >&5
if eval "test \"`echo '$''{'cl_cv_func_raise'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5201 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int main() {
raise(6);
; return 0; }
EOF
if { (eval echo configure:5209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_raise=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_raise=no
fi
rm -f conftest*

fi

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

fi

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

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

extern
#ifdef __cplusplus
"C"
#endif
int abort();

int main() {

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

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

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

extern
#ifdef __cplusplus
"C"
#endif
$cl_cv_proto_abort_ret abort();

int main() {

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


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


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

/* Some systems declare perror() in <errno.h>, some in <stdio.h>, some don't
   declare it at all. */
#include <stdio.h>
#include <errno.h>
extern
#ifdef __cplusplus
"C"
#endif
double perror ();
int main() {

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

fi

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

fi

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

int main() {

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

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

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

                      brackets='[]'
echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&6
echo "configure:5417: checking for sys_errlist declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_sys_errlist'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5423 "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; }
EOF
if { (eval echo configure:5435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_sys_errlist_const=""
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6


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>&6
echo "configure:5459: checking for getenv declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getenv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5465 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
char* getenv (char* name);
#else
char* getenv();
#endif

int main() {

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


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


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_putenv = yes; then
echo $ac_n "checking for putenv declaration""... $ac_c" 1>&6
echo "configure:5572: checking for putenv declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_putenv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5578 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int putenv (char* name);
#else
int putenv();
#endif

int main() {

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



cl_cv_proto_putenv="extern int putenv ($cl_cv_proto_putenv_arg1 char*);"
fi

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


cat >> confdefs.h <<EOF
#define PUTENV_CONST $cl_cv_proto_putenv_arg1
EOF

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

int main() {

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

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

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

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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
char* setlocale (int category, char* locale);
#else
char* setlocale();
#endif

int main() {

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



cl_cv_proto_setlocale="extern char* setlocale (int, $cl_cv_proto_setlocale_arg1 char*);"
fi

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


cat >> confdefs.h <<EOF
#define SETLOCALE_CONST $cl_cv_proto_setlocale_arg1
EOF


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_setrlimit = yes; then
echo $ac_n "checking for getrlimit declaration""... $ac_c" 1>&6
echo "configure:5802: checking for getrlimit declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getrlimit'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 5808 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int getrlimit (int resource, struct rlimit * rlim);
#else
int getrlimit();
#endif

int main() {

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


cl_cv_proto_getrlimit="extern int getrlimit ($cl_cv_proto_getrlimit_arg1, struct rlimit *);"
fi

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


cat >> confdefs.h <<EOF
#define RLIMIT_RESOURCE_T $cl_cv_proto_getrlimit_arg1
EOF

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int setrlimit (RLIMIT_RESOURCE_T resource, struct rlimit * rlim);
#else
int setrlimit();
#endif

int main() {

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



cl_cv_proto_setrlimit="extern int setrlimit ($cl_cv_proto_getrlimit_arg1, $cl_cv_proto_setrlimit_arg2 struct rlimit *);"
fi

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


cat >> confdefs.h <<EOF
#define SETRLIMIT_CONST $cl_cv_proto_setrlimit_arg2
EOF

fi

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

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

fi

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

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

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

fi

echo $ac_n "checking for pid_t""... $ac_c" 1>&6
echo "configure:6032: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6037 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if defined(STDC_HEADERS) || defined(HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STDDEF_H)
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/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>&6
if test $ac_cv_type_pid_t = no; then
  cat >> confdefs.h <<\EOF
#define pid_t int
EOF

fi

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

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

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

int main() {

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

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

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

ac_cv_func_vfork_works=$ac_cv_func_vfork
else
  cat > conftest.$ac_ext <<EOF
#line 6162 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
/* Thanks to Paul Eggert for this test.  */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
/* On some 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 int
#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");
      _exit(2);
    }
    if (!child) {
      arg = getpid();
      write(-1, "", 0);
      _exit (arg);
    }
  }
}
int main() {
  pid_t parent = getpid ();
  pid_t child;

  ((int (*)()) sparc_address_test) ();

  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 Solaris 4.1.3 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. 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 file descriptor bug occur?  */
	 || fstat(fileno(stdout), &st) != 0
	 );
  }
}
EOF
if { (eval echo configure:6260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_vfork_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_vfork_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
rm -fr conftest*
fi

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

fi

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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
pid_t vfork (void);
#else
pid_t vfork();
#endif

int main() {

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


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

int main() {

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

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

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

                      brackets='[]'
echo $ac_n "checking for execv declaration""... $ac_c" 1>&6
echo "configure:6408: checking for execv declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_execv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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 6418 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int execv ($x char* path, $y char* $z argv$brackets);
#else
int execv();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:6440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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>&6


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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int execl (EXECV_CONST char* path, $x char* arg, ...);
#else
int execl();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:6507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
done
for x in '' 'const'; do
if test -z "$have_execl"; then
cat > conftest.$ac_ext <<EOF
#line 6524 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
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; }
EOF
if { (eval echo configure:6546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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>&6


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

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
pid_t waitpid (pid_t pid, int* statusp, int options);
#else
pid_t waitpid();
#endif

int main() {

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


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


                      for ac_hdr in sys/resource.h sys/times.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6638: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6643 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_sys_resource_h = yes; then
    echo $ac_n "checking for getrusage""... $ac_c" 1>&6
echo "configure:6675: checking for getrusage" >&5
if eval "test \"`echo '$''{'cl_cv_func_getrusage'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 6681 "configure"
#include "confdefs.h"
#include <sys/types.h> /* NetBSD 1.0 needs this */
#include <sys/time.h>
#include <sys/resource.h>
int main() {
struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;
; return 0; }
EOF
if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_getrusage=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_getrusage=no
fi
rm -f conftest*

fi

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

fi
  if test $cl_cv_func_getrusage = yes; then
    echo $ac_n "checking for getrusage declaration""... $ac_c" 1>&6
echo "configure:6712: checking for getrusage declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getrusage'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 6718 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h> /* NetBSD 1.0 needs this */
#include <sys/time.h>
#include <sys/resource.h>

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int getrusage (int who, struct rusage * rusage);
#else
int getrusage();
#endif

int main() {

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


cl_cv_proto_getrusage="extern int getrusage ($cl_cv_proto_getrusage_arg1, struct rusage *);"
fi

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


    cat >> confdefs.h <<EOF
#define RUSAGE_WHO_T $cl_cv_proto_getrusage_arg1
EOF

  fi
fi

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

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

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

fi

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

fi

if test $cl_cv_func_getcwd = yes; then
echo $ac_n "checking for getcwd declaration""... $ac_c" 1>&6
echo "configure:6812: checking for getcwd declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getcwd'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 6818 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
char* getcwd (char* buf, int bufsize);
#else
char* getcwd();
#endif

int main() {

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


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>&6
echo "configure:6867: checking for chdir declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_chdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 6873 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int chdir (char* path);
#else
int chdir();
#endif

int main() {

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


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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int mkdir (char* path, mode_t mode);
#else
int mkdir();
#endif

int main() {

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


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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int rmdir (char* path);
#else
int rmdir();
#endif

int main() {

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


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>&6
echo "configure:7034: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 7039 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>

#if defined(S_ISBLK) && defined(S_IFDIR)
# if S_ISBLK (S_IFDIR)
You lose.
# endif
#endif

#if defined(S_ISBLK) && defined(S_IFCHR)
# if S_ISBLK (S_IFCHR)
You lose.
# endif
#endif

#if defined(S_ISLNK) && defined(S_IFREG)
# if S_ISLNK (S_IFREG)
You lose.
# endif
#endif

#if defined(S_ISSOCK) && defined(S_IFREG)
# 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>&6
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 fstat declaration""... $ac_c" 1>&6
echo "configure:7089: checking for fstat declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_fstat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 7095 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int fstat (int fd, struct stat * buf);
#else
int fstat();
#endif

int main() {
return fstat(0,(struct stat *)0);
; return 0; }
EOF
if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_proto_fstat_inline=no
have_fstat_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test -z "$have_fstat_decl"; then
  # This happens on Linux with g++ and libc-5.0.9.
  cl_cv_proto_fstat_inline=yes
fi

cl_cv_proto_fstat="extern int fstat (int, struct stat *);"
fi

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


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

fi

                      echo $ac_n "checking for stat declaration""... $ac_c" 1>&6
echo "configure:7149: checking for stat declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_stat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_proto_stat_inline=$cl_cv_proto_fstat_inline
if test $cl_cv_proto_stat_inline = yes; then
  cat >> confdefs.h <<\EOF
#define STAT_INLINE 1
EOF

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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__cplusplus) && defined(STAT_INLINE)
extern
#else

extern
#ifdef __cplusplus
"C"
#endif

#endif
#if defined(__STDC__) || defined(__cplusplus)
int stat (char* path, struct stat * buf);
#else
int stat();
#endif

int main() {
return stat((char*)"",(struct stat *)0);
; return 0; }
EOF
if { (eval echo configure:7191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_proto_stat_arg1=""
have_stat_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test -z "$have_stat_decl"; then
cat > conftest.$ac_ext <<EOF
#line 7202 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__cplusplus) && defined(STAT_INLINE)
extern
#else

extern
#ifdef __cplusplus
"C"
#endif

#endif
#if defined(__STDC__) || defined(__cplusplus)
int stat (const char* path, struct stat * buf);
#else
int stat();
#endif

int main() {
return stat((const char*)"",(struct stat *)0);
; return 0; }
EOF
if { (eval echo configure:7231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_proto_stat_arg1="const"
have_stat_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi

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>&6


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


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

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

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

fi

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

fi
if test $cl_cv_func_lstat = yes; then
echo $ac_n "checking for lstat declaration""... $ac_c" 1>&6
echo "configure:7293: checking for lstat declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_lstat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_proto_lstat_inline=$cl_cv_proto_fstat_inline
if test $cl_cv_proto_lstat_inline = yes; then
  cat >> confdefs.h <<\EOF
#define LSTAT_INLINE 1
EOF

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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__cplusplus) && defined(LSTAT_INLINE)
extern
#else

extern
#ifdef __cplusplus
"C"
#endif

#endif
#if defined(__STDC__) || defined(__cplusplus)
int lstat (char* path, struct stat * buf);
#else
int lstat();
#endif

int main() {
return lstat((char*)"",(struct stat *)0);
; return 0; }
EOF
if { (eval echo configure:7335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_proto_lstat_arg1=""
have_lstat_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test -z "$have_lstat_decl"; then
cat > conftest.$ac_ext <<EOF
#line 7346 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__cplusplus) && defined(STAT_INLINE)
extern
#else

extern
#ifdef __cplusplus
"C"
#endif

#endif
#if defined(__STDC__) || defined(__cplusplus)
int lstat (const char* path, struct stat * buf);
#else
int lstat();
#endif

int main() {
return lstat((const char*)"",(struct stat *)0);
; return 0; }
EOF
if { (eval echo configure:7375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_proto_lstat_arg1="const"
have_lstat_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi

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>&6


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_readlink = yes; then
echo $ac_n "checking for readlink declaration""... $ac_c" 1>&6
echo "configure:7458: checking for readlink declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_readlink'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for r in 'int' 'ssize_t'; do
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 7469 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$r readlink ($x char* path, $y buf, $z bufsiz);
#else
$r readlink();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:7491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_readlink_ret="$r"
cl_cv_proto_readlink_arg1="$x"
cl_cv_proto_readlink_arg2="$y"
cl_cv_proto_readlink_arg3="$z"
have_readlink=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
done
done
done
done

cl_cv_proto_readlink="extern $cl_cv_proto_readlink_ret 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>&6


cat >> confdefs.h <<EOF
#define RETREADLINKTYPE $cl_cv_proto_readlink_ret
EOF

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>&6
echo "configure:7535: checking for ELOOP" >&5
if eval "test \"`echo '$''{'cl_cv_decl_eloop'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
#include <stdio.h>
#ifdef ELOOP
int main () { printf("ELOOP\n"); exit(0); }
#else
extern int errno;
#define foo "conflink"
#define foobar "conflink/somefile"
int 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 echo configure:7563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
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 7572 "configure"
#include "confdefs.h"

#include <stdlib.h>
#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>&6
cat >> confdefs.h <<EOF
#define ELOOP_VALUE $cl_cv_decl_ELOOP
EOF


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
DIR* opendir (char* dirname);
#else
DIR* opendir();
#endif

int main() {

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


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


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

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
#include <$ac_header_dirent>

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int closedir (DIR* dir);
#else
int closedir();
#endif


int main() {

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

cl_cv_proto_closedir="extern $cl_cv_proto_closedir_ret closedir (DIR*);"
fi

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


cat >> confdefs.h <<EOF
#define RETCLOSEDIRTYPE $cl_cv_proto_closedir_ret
EOF

if test $cl_cv_proto_closedir_ret = void; then
  cat >> confdefs.h <<\EOF
#define VOID_CLOSEDIR 1
EOF

else
  # The following test is necessary, because Cygwin32 declares closedir()
  # as returning int but the return value is unusable.
  echo $ac_n "checking for usable closedir return value""... $ac_c" 1>&6
echo "configure:7727: checking for usable closedir return value" >&5
if eval "test \"`echo '$''{'cl_cv_func_closedir_retval'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  # When cross-compiling, don't assume a return value.
cl_cv_func_closedir_retval="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 7737 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
/* Declare opendir(), closedir(). */
#include <$ac_header_dirent>
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
DIR* opendir (OPENDIR_CONST char* dirname);
#else
DIR* opendir();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
RETCLOSEDIRTYPE closedir (DIR* dirp);
#else
RETCLOSEDIRTYPE closedir();
#endif
int main() { exit(closedir(opendir(".")) != 0); }
EOF
if { (eval echo configure:7772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_closedir_retval=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cl_cv_func_closedir_retval=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
rm -fr conftest*
fi

fi
echo "$ac_t""$cl_cv_func_closedir_retval" 1>&6
case "$cl_cv_func_closedir_retval" in
  *no) cat >> confdefs.h <<\EOF
#define VOID_CLOSEDIR 1
EOF
 ;;
esac
fi

                      echo $ac_n "checking for open declaration""... $ac_c" 1>&6
echo "configure:7804: checking for open declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_open'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
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 7813 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int open ($x char* path, int flags, $y);
#else
int open();
#endif

int main() {

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

fi
done
done
if test -z "$cl_cv_proto_open_dots"; then
  cl_cv_proto_open_arg1="const"
  cl_cv_proto_open_dots=yes
fi
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, 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>&6


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>&6
echo "configure:7885: checking for read declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_read'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for z in 'int' 'size_t' "unsigned $cl_cv_proto_retrwtype" 'off_t'; do
for y in 'char*' 'void*'; do
for x in 'int' 'long'; do
if test -z "$have_rw"; then
cat > conftest.$ac_ext <<EOF
#line 7895 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$x read (int fd, $y buf, $z count);
#else
$x read();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:7918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_retrwtype="$x"
cl_cv_proto_rw_buf_t="$y"
cl_cv_proto_rw_size_t="$z"
have_rw=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

fi
done
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>&6


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>&6
echo "configure:7957: checking for write declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_write'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 7963 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$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; }
EOF
if { (eval echo configure:7986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_write_arg2=""
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6


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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int rename (char* oldpath, char* newpath);
#else
int rename();
#endif

int main() {

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


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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int unlink (char* path);
#else
int unlink();
#endif

int main() {

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


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

int main() {

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

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

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


                      ioctl_decl1='
#include <stdlib.h>
#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
'
echo $ac_n "checking for ioctl declaration""... $ac_c" 1>&6
echo "configure:8208: checking for ioctl declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_ioctl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8214 "configure"
#include "confdefs.h"
$ioctl_decl1
extern
#ifdef __cplusplus
"C"
#endif
char* ioctl();
int main() {

; return 0; }
EOF
if { (eval echo configure:8226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  try_sys_ioctl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ioctl_decl="$ioctl_decl1"
fi
rm -f conftest*
if test -n "try_sys_ioctl"; then
ioctl_decl2='
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
#endif
#include <sys/ioctl.h>
'
cat > conftest.$ac_ext <<EOF
#line 8246 "configure"
#include "confdefs.h"
$ioctl_decl2
extern
#ifdef __cplusplus
"C"
#endif
char* ioctl();
int main() {

; return 0; }
EOF
if { (eval echo configure:8258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ioctl_decl="$ioctl_decl1"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ioctl_decl="$ioctl_decl2"
fi
rm -f conftest*
fi
for y in 'caddr_t arg' 'void* arg' '...'; do
for x in 'int' 'unsigned long' 'long'; do
if test -z "$have_ioctl"; then
cat > conftest.$ac_ext <<EOF
#line 8273 "configure"
#include "confdefs.h"
$ioctl_decl
#ifdef INCLUDE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int ioctl (int fd, $x request, $y);
#else
int ioctl();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:8295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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_arg3=`echo "$y" | sed -e 's, arg,,'`
cl_cv_proto_ioctl_args="int, $cl_cv_proto_ioctl_arg2, $cl_cv_proto_ioctl_arg3"
fi
have_ioctl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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>&6


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

else
cat >> confdefs.h <<EOF
#define IOCTL_ARGUMENT_T $cl_cv_proto_ioctl_arg3
EOF

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

fi

echo "$ac_t""$cl_cv_decl_FIONREAD_1" 1>&6
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>&6
echo "configure:8375: checking for FIONREAD in sys/filio.h" >&5
if eval "test \"`echo '$''{'cl_cv_decl_FIONREAD_1_sys_filio_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8381 "configure"
#include "confdefs.h"
$ioctl_decl#include <sys/filio.h>
int main() {
$ioctl_prog
; return 0; }
EOF
if { (eval echo configure:8388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_filio_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
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>&6
echo "configure:8412: checking for FIONREAD in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'cl_cv_decl_FIONREAD_1_sys_ioctl_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8418 "configure"
#include "confdefs.h"
$ioctl_decl#include <sys/ioctl.h>
int main() {
$ioctl_prog
; return 0; }
EOF
if { (eval echo configure:8425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_decl_FIONREAD_1_sys_ioctl_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
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

# Now check whether FIONREAD reliably checks for the EOF of a regular file.
# The number of available characters returned by ioctl(fd,FIONREAD,...) should
# be > 0 for a non-empty regular file at least. On Solaris 2, it is 0.
echo $ac_n "checking for reliable FIONREAD""... $ac_c" 1>&6
echo "configure:8456: checking for reliable FIONREAD" >&5
if eval "test \"`echo '$''{'cl_cv_decl_FIONREAD_reliable'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_decl_FIONREAD_reliable="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 8465 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

/* Declare ioctl(). */
$ioctl_decl
#ifdef NEED_SYS_FILIO_H
#include <sys/filio.h>
#endif
#ifdef NEED_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int ioctl ($cl_cv_proto_ioctl_args);
#else
int ioctl();
#endif
/* Declare open(). */
#include <fcntl.h>
#ifdef OPEN_NEEDS_SYS_FILE_H
#include <sys/file.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int open ($cl_cv_proto_open_args);
#else
int open();
#endif
int main ()
{ int fd = open("conftest.c",O_RDONLY,0644);
  long x;
  exit(!((fd >= 0) && (ioctl(fd,FIONREAD,&x) >= 0) && (x > 0)));
}
EOF
if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_decl_FIONREAD_reliable=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cl_cv_decl_FIONREAD_reliable=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
rm -fr conftest*
fi


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

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int fcntl (int fd, int cmd, $x);
#else
int fcntl();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:8575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
if test "$x" = "..."; then
cl_cv_fcntl_arg3="..."
else
cl_cv_fcntl_arg3="int"
fi
have_fcntl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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>&6


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_select = yes; then
echo $ac_n "checking for sys/select.h""... $ac_c" 1>&6
echo "configure:8666: checking for sys/select.h" >&5
if eval "test \"`echo '$''{'cl_cv_header_sys_select_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8672 "configure"
#include "confdefs.h"
#ifdef __BEOS__
#include <sys/socket.h>
#endif
#include <sys/time.h>
#include <sys/select.h>
int main() {

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

fi

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

fi
echo $ac_n "checking for select declaration""... $ac_c" 1>&6
echo "configure:8704: checking for select declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_select'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for z in '' 'const'; do
for y in 'fd_set' 'int' 'void' 'struct fd_set'; do
for x in 'int' 'size_t'; do
if test -z "$have_select"; then
cat > conftest.$ac_ext <<EOF
#line 8714 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int select ($x width, $y * readfds, $y * writefds, $y * exceptfds, $z struct timeval * timeout);
#else
int select();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:8745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; 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
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
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>&6


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

int main() {

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

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

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

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

int main() {

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

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

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


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_setitimer = yes; then
echo $ac_n "checking for setitimer declaration""... $ac_c" 1>&6
echo "configure:8960: checking for setitimer declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_setitimer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8966 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int setitimer (int which, struct itimerval * ivalue, struct itimerval * ovalue);
#else
int setitimer();
#endif

int main() {

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


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

int main() {

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

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

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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
struct tm * localtime (time_t* clock);
#else
struct tm * localtime();
#endif

int main() {

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


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_gettimeofday = yes; then
echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
echo "configure:9195: checking for gettimeofday declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_gettimeofday'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 9201 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int gettimeofday (struct timeval * tp, struct timezone * tzp);
#else
int gettimeofday();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:9222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_gettimeofday_dots=no
cl_cv_proto_gettimeofday_arg2="struct timezone *"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 9231 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int gettimeofday (struct timeval * tp, void * tzp);
#else
int gettimeofday();
#endif

int main() {

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

fi
rm -f conftest*


cl_cv_proto_gettimeofday="extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);"
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>&6


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

else
cat >> confdefs.h <<EOF
#define GETTIMEOFDAY_TZP_T $cl_cv_proto_gettimeofday_arg2
EOF

fi
fi

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

int main() {

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

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

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

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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'times`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
no_times=1
fi
if test -z "$no_times"; then
echo $ac_n "checking for times return value""... $ac_c" 1>&6
echo "configure:9402: checking for times return value" >&5
if eval "test \"`echo '$''{'cl_cv_func_times_return'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_times_return="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 9411 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#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>
int 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
if { (eval echo configure:9437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_times_return=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


fi
echo "$ac_t""$cl_cv_func_times_return" 1>&6
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>&6
echo "configure:9472: checking for getpwnam declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getpwnam'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 9478 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
struct passwd * getpwnam (char* name);
#else
struct passwd * getpwnam();
#endif

int main() {

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


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


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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
struct passwd * getpwuid (uid_t uid);
#else
struct passwd * getpwuid();
#endif

int main() {

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


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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_gethostname = yes; then
echo $ac_n "checking for gethostname declaration""... $ac_c" 1>&6
echo "configure:9642: checking for gethostname declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_gethostname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for x in 'int' 'size_t' 'unsigned int'; do
if test -z "$have_gethostname"; then
cat > conftest.$ac_ext <<EOF
#line 9650 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef __BEOS__
#include <sys/socket.h>
#include <netdb.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int gethostname (char* name, $x namelen);
#else
int gethostname();
#endif

int main() {

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

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>&6


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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sun/netdb.h""... $ac_c" 1>&6
echo "configure:9706: checking for sun/netdb.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9711 "configure"
#include "confdefs.h"
#include <sun/netdb.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  have_netdb=1
else
  echo "$ac_t""no" 1>&6
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>&6
echo "configure:9744: checking for gethostbyname declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_gethostbyname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 9750 "configure"
#include "confdefs.h"

#include <stdlib.h>
#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 __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
struct hostent * gethostbyname (char* name);
#else
struct hostent * gethostbyname();
#endif

int main() {

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


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

fi

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int connect (int fd, $x $y name, $z namelen);
#else
int connect();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:9841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_connect_arg2a="$x"
cl_cv_proto_connect_arg2b="$y"
cl_cv_proto_connect_arg3="$z"
have_connect_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

fi
done
done
done

cl_cv_proto_connect="extern int connect (int, $cl_cv_proto_connect_arg2a $cl_cv_proto_connect_arg2b, $cl_cv_proto_connect_arg3);"
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>&6


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

cat >> confdefs.h <<EOF
#define CONNECT_ADDRLEN_T $cl_cv_proto_connect_arg3
EOF


                      for ac_hdr in sys/un.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:9883: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9888 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_sys_un_h = yes; then
echo $ac_n "checking for sun_len in struct sockaddr_un""... $ac_c" 1>&6
echo "configure:9920: checking for sun_len in struct sockaddr_un" >&5
if eval "test \"`echo '$''{'cl_cv_struct_sockaddr_sun_len'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 9926 "configure"
#include "confdefs.h"
#include <sys/types.h> /* NetBSD 1.0 needs this */
#include <sys/un.h>
int main() {
struct sockaddr_un unaddr; unaddr.sun_len;
; return 0; }
EOF
if { (eval echo configure:9934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_struct_sockaddr_sun_len=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6
if test $cl_cv_struct_sockaddr_sun_len = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_SOCKADDR_UN_LEN 1
EOF

fi
fi

                      echo $ac_n "checking for IPv4 sockets""... $ac_c" 1>&6
echo "configure:9957: checking for IPv4 sockets" >&5
if eval "test \"`echo '$''{'cl_cv_socket_ipv4'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 9963 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main() {
int x = AF_INET; struct in_addr y; struct sockaddr_in z;
; return 0; }
EOF
if { (eval echo configure:9972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_socket_ipv4=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_socket_ipv4=no
fi
rm -f conftest*

fi

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

fi

echo $ac_n "checking for IPv6 sockets""... $ac_c" 1>&6
echo "configure:9994: checking for IPv6 sockets" >&5
if eval "test \"`echo '$''{'cl_cv_socket_ipv6'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 10000 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main() {
int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
; return 0; }
EOF
if { (eval echo configure:10009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_socket_ipv6=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_socket_ipv6=no
fi
rm -f conftest*

fi

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

fi

if test $cl_cv_socket_ipv6 = no; then
echo $ac_n "checking for IPv6 sockets in linux/in6.h""... $ac_c" 1>&6
echo "configure:10032: checking for IPv6 sockets in linux/in6.h" >&5
if eval "test \"`echo '$''{'cl_cv_socket_ipv6_linux'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 10038 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <linux/in6.h>
int main() {
int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
; return 0; }
EOF
if { (eval echo configure:10048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_socket_ipv6_linux=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_socket_ipv6_linux=no
fi
rm -f conftest*

fi

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

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

fi

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

int main() {

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

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

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

for ac_hdr in netinet/in.h arpa/inet.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10136: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10141 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
echo $ac_n "checking for inet_addr declaration""... $ac_c" 1>&6
echo "configure:10172: checking for inet_addr declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_inet_addr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for x in '' 'const'; do
for y in 'struct in_addr' 'unsigned long' 'unsigned int'; do
if test -z "$have_inet_addr"; then
cat > conftest.$ac_ext <<EOF
#line 10181 "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
#ifdef __BEOS__
#include <sys/socket.h>
#include <netdb.h>
#endif

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$y inet_addr ($x char *);
#else
$y inet_addr();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:10212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_inet_addr_ret="$y"
cl_cv_proto_inet_addr_arg1="$x"
have_inet_addr=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

fi
done
done

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>&6


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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:10258: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10263 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
echo $ac_n "checking for setsockopt declaration""... $ac_c" 1>&6
echo "configure:10294: checking for setsockopt declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_setsockopt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for z in 'int' 'unsigned int' 'size_t'; do
for y in 'char*' 'void*'; do
for x in '' 'const'; do
if test -z "$have_setsockopt_decl"; then
cat > conftest.$ac_ext <<EOF
#line 10304 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int setsockopt (int, int, int, $x $y, $z);
#else
int setsockopt ();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:10325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_setsockopt_const="$x"
cl_cv_proto_setsockopt_arg_t="$y"
cl_cv_proto_setsockopt_optlen_t="$z"
have_setsockopt_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

fi
done
done
done

cl_cv_proto_setsockopt="extern int setsockopt (int, int, int, $cl_cv_proto_setsockopt_const $cl_cv_proto_setsockopt_arg_t, $cl_cv_proto_setsockopt_optlen_t);"
fi

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


cat >> confdefs.h <<EOF
#define SETSOCKOPT_CONST $cl_cv_proto_setsockopt_const
EOF

cat >> confdefs.h <<EOF
#define SETSOCKOPT_ARG_T $cl_cv_proto_setsockopt_arg_t
EOF

cat >> confdefs.h <<EOF
#define SETSOCKOPT_OPTLEN_T $cl_cv_proto_setsockopt_optlen_t
EOF


                      address_range_prog='
#include <stdio.h>
#ifdef __cplusplus
extern "C" void exit(int);
#endif
#if defined(__STDC__) || defined(__cplusplus)
void printf_address (unsigned long addr)
#else
printf_address (addr)
  unsigned long addr;
#endif
{ if (sizeof(unsigned long) <= 4)
    printf ("0x%08X", (unsigned int)addr);
  else
    printf ("0x%08X%08X",(unsigned int)(addr>>32),(unsigned int)(addr&0xFFFFFFFF));
}
#define chop_address(addr) ((unsigned long)(char*)(addr) & ~0x00FFFFFFL)
'
if test $cl_cv_prog_cc_ansi = yes; then
  ul='UL'
else
  ul=''
fi
echo $ac_n "checking for the code address range""... $ac_c" 1>&6
echo "configure:10387: checking for the code address range" >&5
if eval "test \"`echo '$''{'cl_cv_address_code'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
$address_range_prog
int main() { printf_address(chop_address(&printf_address)); exit(0); }
EOF
{ (eval echo configure:10398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
cl_cv_address_code=`./conftest`
rm -f conftest*
else
cl_cv_address_code='guessing 0'
fi

fi
echo "$ac_t""$cl_cv_address_code" 1>&6
x=`echo $cl_cv_address_code | sed -e 's,^guessing ,,'`"$ul"
cat >> confdefs.h <<EOF
#define CODE_ADDRESS_RANGE $x
EOF

echo $ac_n "checking for the malloc address range""... $ac_c" 1>&6
echo "configure:10413: checking for the malloc address range" >&5
if eval "test \"`echo '$''{'cl_cv_address_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
/* declare malloc() */
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef malloc
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
RETMALLOCTYPE malloc (MALLOC_SIZE_T size);
#else
RETMALLOCTYPE malloc();
#endif
#endif
$address_range_prog
int main() { printf_address(chop_address(malloc(10000))); exit(0); }
EOF
{ (eval echo configure:10442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
cl_cv_address_malloc=`./conftest`
rm -f conftest*
else
cl_cv_address_malloc='guessing 0'
fi

fi
echo "$ac_t""$cl_cv_address_malloc" 1>&6
x=`echo $cl_cv_address_malloc | sed -e 's,^guessing ,,'`"$ul"
cat >> confdefs.h <<EOF
#define MALLOC_ADDRESS_RANGE $x
EOF

echo $ac_n "checking for the shared library address range""... $ac_c" 1>&6
echo "configure:10457: checking for the shared library address range" >&5
if eval "test \"`echo '$''{'cl_cv_address_shlib'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
$address_range_prog
/* Declare printf(). */
#if defined(sun) /* for SunOS 4, but not for IRIX 6 */
#ifdef __cplusplus
extern "C" int printf (const char *, ...);
#else
extern int printf ();
#endif
#endif
/* Declare tmpnam(). */
#ifdef __cplusplus
extern "C" char* tmpnam (char*);
#else
extern char* tmpnam ();
#endif
/* With normal simple DLLs, &printf is in the shared library. Fine.
   But with ELF, &printf is a trampoline function allocated near the
   program's code range. errno and other global variables - such as
   &stdout - are allocated near the program's code and bss as well.
   However, the return value of tmpnam(NULL) is a pointer to a static
   buffer in the shared library. (This buffer is unlikely to be named
   by a global symbol.) */
int main() {
  char* addr;
  addr = (char*) tmpnam((char*)0);
  if (!addr) addr = (char*) &printf;
  printf_address(chop_address(addr));
  exit(0);
}
EOF
{ (eval echo configure:10495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
cl_cv_address_shlib=`./conftest`
rm -f conftest*
else
cl_cv_address_shlib='guessing 0'
fi

fi
echo "$ac_t""$cl_cv_address_shlib" 1>&6
x=`echo $cl_cv_address_shlib | sed -e 's,^guessing ,,'`"$ul"
cat >> confdefs.h <<EOF
#define SHLIB_ADDRESS_RANGE $x
EOF

echo $ac_n "checking for the stack address range""... $ac_c" 1>&6
echo "configure:10510: checking for the stack address range" >&5
if eval "test \"`echo '$''{'cl_cv_address_stack'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
cat > conftest.c <<EOF
#include "confdefs.h"
$address_range_prog
int main() { int dummy; printf_address(chop_address(&dummy)); exit(0); }
EOF
{ (eval echo configure:10521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
cl_cv_address_stack=`./conftest`
rm -f conftest*
else
cl_cv_address_stack='guessing ~0'
fi

fi
echo "$ac_t""$cl_cv_address_stack" 1>&6
x=`echo "$cl_cv_address_stack" | sed -e 's,^guessing ,,'`"$ul"
cat >> confdefs.h <<EOF
#define STACK_ADDRESS_RANGE $x
EOF


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

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

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

fi

echo "$ac_t""$cl_cv_func_getpagesize" 1>&6
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>&6
echo "configure:10579: checking for getpagesize declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_getpagesize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 10585 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif
int getpagesize();

int main() {

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


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

fi

                      echo $ac_n "checking for vadvise""... $ac_c" 1>&6
echo "configure:10629: checking for vadvise" >&5
if eval "test \"`echo '$''{'cl_cv_func_vadvise'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 10635 "configure"
#include "confdefs.h"
#include <sys/vadvise.h>
int main() {
vadvise(0);
; return 0; }
EOF
if { (eval echo configure:10642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_vadvise=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_func_vadvise=no
fi
rm -f conftest*

fi

echo "$ac_t""$cl_cv_func_vadvise" 1>&6
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>&6
echo "configure:10664: checking for vm_allocate" >&5
if eval "test \"`echo '$''{'cl_cv_func_vm'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 10670 "configure"
#include "confdefs.h"

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

fi

echo "$ac_t""$cl_cv_func_vm" 1>&6
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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/mman.h""... $ac_c" 1>&6
echo "configure:10701: checking for sys/mman.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10706 "configure"
#include "confdefs.h"
#include <sys/mman.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
no_mmap=1
fi
if test -z "$no_mmap"; then
echo $ac_n "checking for mmap""... $ac_c" 1>&6
echo "configure:10734: checking for mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10739 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char mmap(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mmap();

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'mmap`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
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>&6
echo "configure:10790: checking for mmap declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_mmap'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for z in 'int' 'size_t'; do
for y in 'void*' 'caddr_t'; do
for x in 'void*' 'caddr_t'; do
if test -z "$have_mmap_decl"; then
cat > conftest.$ac_ext <<EOF
#line 10800 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$x mmap ($y addr, $z length, int prot, int flags, int fd, off_t off);
#else
$x mmap();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:10825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_mmap_ret="$x"
cl_cv_proto_mmap_arg1="$y"
cl_cv_proto_mmap_arg2="$z"
have_mmap_decl=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

fi
done
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>&6


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>&6
echo "configure:10863: checking for working mmap" >&5
if eval "test \"`echo '$''{'cl_cv_func_mmap_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
case "$host" in
  i345686-*-sysv4*)
    # UNIX_SYSV_UHC_1
    avoid=0x08000000 ;;
  mips-sgi-irix* | mips-dec-ultrix*)
    # UNIX_IRIX, UNIX_DEC_ULTRIX
    avoid=0x10000000 ;;
  rs6000-ibm-aix*)
    # UNIX_AIX
    avoid=0x20000000 ;;
  *)
    avoid=0 ;;
esac
mmap_prog_1='
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#ifdef OPEN_NEEDS_SYS_FILE_H
#include <sys/file.h>
#endif
#include <sys/types.h>
#include <sys/mman.h>
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
RETMMAPTYPE mmap (MMAP_ADDR_T addr, MMAP_SIZE_T length, int prot, int flags, int fd, off_t off);
#else
RETMMAPTYPE mmap();
#endif
int main () {
'
mmap_prog_2="#define bits_to_avoid $avoid"'
#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;
#define i_ok(i)  ((i) & (bits_to_avoid >> my_shift) == 0)
  for (i=my_low; i<=my_high; i++)
    if (i_ok(i))
      { caddr_t addr = (caddr_t)(i << my_shift);
/* Check for 8 MB, not 16 MB. This is more likely to work on Solaris 2. */
#if bits_to_avoid
        long size = i*my_size;
#else
        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++) if (i_ok(i)) { x(i) = y(i); }
  for (i=my_high; i>=my_low; i--) if (i_ok(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 10941 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$mmap_prog_1
  int flags = MAP_ANON | MAP_PRIVATE;
  int fd = -1;
$mmap_prog_2

EOF
if { (eval echo configure:10952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  have_mmap_anon=1
cl_cv_func_mmap_anon=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
  cat > conftest.$ac_ext <<EOF
#line 10979 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$mmap_prog_1
  int flags = MAP_ANONYMOUS | MAP_PRIVATE;
  int fd = -1;
$mmap_prog_2

EOF
if { (eval echo configure:10990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  have_mmap_anon=1
cl_cv_func_mmap_anonymous=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

if test "$cross_compiling" = yes; then
  : # When cross-compiling, don't assume anything.

else
  cat > conftest.$ac_ext <<EOF
#line 11017 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$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
if { (eval echo configure:11032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  have_mmap_devzero=1
cl_cv_func_mmap_devzero=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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 11061 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
#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
if { (eval echo configure:11077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  have_mmap_devzero=1
cl_cv_func_mmap_devzero_sun4_29=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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

int main() {

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

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

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

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

int main() {

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

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

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

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

int main() {

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

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

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_func_mprotect = yes; then
echo $ac_n "checking for mprotect declaration""... $ac_c" 1>&6
echo "configure:11314: checking for mprotect declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_mprotect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 11320 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int mprotect (MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
#else
int mprotect();
#endif

int main() {

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


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

echo $ac_n "checking for working mprotect""... $ac_c" 1>&6
echo "configure:11370: checking for working mprotect" >&5
if eval "test \"`echo '$''{'cl_cv_func_mprotect_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
mprotect_prog='
#include <sys/types.h>
/* declare malloc() */
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef malloc
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
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 __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
RETGETPAGESIZETYPE getpagesize (void);
#else
RETGETPAGESIZETYPE getpagesize();
#endif
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int mprotect (MPROTECT_CONST MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
#else
int mprotect();
#endif
char foo;
int 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 11431 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$mprotect_prog
  if ((pagesize-1) & pagesize) exit(1);
  exit(0); }
EOF
if { (eval echo configure:11440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

mprotect_prog="$mprotect_prog"'
  char* area = (char*) 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 11471 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$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
if { (eval echo configure:11481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  no_mprotect=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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 11509 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$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
if { (eval echo configure:11519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  no_mprotect=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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 11547 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$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
if { (eval echo configure:11557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  no_mprotect=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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 11585 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
$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
if { (eval echo configure:11596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

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>&6
if test $cl_cv_func_mprotect_works = yes; then
  cat >> confdefs.h <<\EOF
#define HAVE_WORKING_MPROTECT 1
EOF

fi
fi

                      if test "$ac_cv_header_sys_shm_h" = yes -a "$ac_cv_header_sys_ipc_h" = yes; then
echo $ac_n "checking for shmget declaration""... $ac_c" 1>&6
echo "configure:11637: checking for shmget declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_shmget'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 11643 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmget (key_t key, int size, int shmflg);
#else
int shmget();
#endif

int main() {

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


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

fi

                      if test "$ac_cv_header_sys_shm_h" = yes -a "$ac_cv_header_sys_ipc_h" = yes; then
echo $ac_n "checking for shmat declaration""... $ac_c" 1>&6
echo "configure:11696: checking for shmat declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_shmat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 11702 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif
void* shmat();

int main() {

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

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$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; }
EOF
if { (eval echo configure:11761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cl_cv_proto_shmat_arg2=""
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cl_cv_proto_shmat_arg2="const"
fi
rm -f conftest*



cl_cv_proto_shmat="extern $cl_cv_proto_shmat_ret 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>&6


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 "$ac_cv_header_sys_shm_h" = yes -a "$ac_cv_header_sys_ipc_h" = yes; then
echo $ac_n "checking for shmdt declaration""... $ac_c" 1>&6
echo "configure:11793: checking for shmdt declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_shmdt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for x in 'void*' 'char*' 'const void *' 'const char *'; do
if test -z "$have_shmdt_decl"; then
cat > conftest.$ac_ext <<EOF
#line 11801 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmdt($x addr);
#else
int shmdt();
#endif

int main() {

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

fi
done

cl_cv_proto_shmdt="extern int shmdt ($cl_cv_proto_shmdt_arg1);"
fi

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


cat >> confdefs.h <<EOF
#define SHMDT_ADDR_T $cl_cv_proto_shmdt_arg1
EOF

fi

                      if test "$ac_cv_header_sys_shm_h" = yes -a "$ac_cv_header_sys_ipc_h" = yes; then
echo $ac_n "checking for shmctl declaration""... $ac_c" 1>&6
echo "configure:11856: checking for shmctl declaration" >&5
if eval "test \"`echo '$''{'cl_cv_proto_shmctl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 11862 "configure"
#include "confdefs.h"

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmctl (int shmid, int cmd, struct shmid_ds * buf);
#else
int shmctl();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:11888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
cl_cv_proto_shmctl_dots=no
cl_cv_proto_shmctl_args="int, int, struct shmid_ds *"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  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>&6


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

fi
fi

                      if test "$ac_cv_header_sys_shm_h" = yes -a "$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>&6
echo "configure:11922: checking for working shared memory" >&5
if eval "test \"`echo '$''{'cl_cv_sys_shm_works'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_sys_shm_works="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 11931 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmget (key_t key, $cl_cv_proto_shmget_arg2 size, int shmflg);
#else
int shmget();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
$cl_cv_proto_shmat_ret shmat (int shmid, $cl_cv_proto_shmat_arg2 $cl_cv_proto_shmat_ret shmaddr, int shmflg);
#else
$cl_cv_proto_shmat_ret shmat();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmdt ($cl_cv_proto_shmdt_arg1 shmaddr);
#else
int shmdt();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int shmctl ($cl_cv_proto_shmctl_args);
#else
int shmctl();
#endif
/* try attaching a single segment to multiple addresses */
#define segsize 0x10000
#define attaches 128
#define base_addr 0x01000000
int 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
if { (eval echo configure:11994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_sys_shm_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


fi
echo "$ac_t""$cl_cv_sys_shm_works" 1>&6
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" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:12029: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12034 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

        ;;
  *) ;;
esac

                      if test -n "$have_shm"; then
echo $ac_n "checking for attachability of removed shared memory""... $ac_c" 1>&6
echo "configure:12071: checking for attachability of removed shared memory" >&5
if eval "test \"`echo '$''{'cl_cv_func_shmctl_attachable'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cl_cv_func_shmctl_attachable="guessing no"
else
  cat > conftest.$ac_ext <<EOF
#line 12080 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif

#include <stdlib.h>
#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
#if defined(__STDC__) || defined(__cplusplus)
extern
#ifdef __cplusplus
"C"
#endif
int shmget (key_t key, SHMGET_SIZE_T size, int shmflg);
extern
#ifdef __cplusplus
"C"
#endif
RETSHMATTYPE shmat (int shmid, SHMAT_CONST RETSHMATTYPE shmaddr, int shmflg);
extern
#ifdef __cplusplus
"C"
#endif

#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
int 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
if { (eval echo configure:12142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cl_cv_func_shmctl_attachable=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi


fi
echo "$ac_t""$cl_cv_func_shmctl_attachable" 1>&6
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 for dlopen""... $ac_c" 1>&6
echo "configure:12176: checking for dlopen" >&5
if eval "test \"`echo '$''{'cl_cv_func_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_func_dlopen=no
cl_cv_lib_dl=no
cat > conftest.$ac_ext <<EOF
#line 12184 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char dlopen();
int main() {
dlopen();
; return 0; }
EOF
if { (eval echo configure:12195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_dlopen=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test "$cl_cv_func_dlopen" = no; then
cl_save_LIBS="$LIBS"
LIBS="$LIBS -ldl"
cat > conftest.$ac_ext <<EOF
#line 12207 "configure"
#include "confdefs.h"
extern
#ifdef __cplusplus
"C"
#endif
char dlopen();
int main() {
dlopen();
; return 0; }
EOF
if { (eval echo configure:12218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_lib_dl=yes
cl_cv_func_dlopen=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
LIBS="$cl_save_LIBS"
fi

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

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
void* dlsym (void* handle, char* symbol);
#else
void* dlsym();
#endif

int main() {

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


cl_cv_proto_dlsym="extern void* dlsym (void* handle, $cl_cv_proto_dlsym_arg2 char* symbol);"
fi

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


  cat >> confdefs.h <<EOF
#define DLSYM_CONST $cl_cv_proto_dlsym_arg2
EOF

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
char * dlerror ();
#else
char * dlerror();
#endif

int main() {

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



cl_cv_proto_dlerror="extern $cl_cv_proto_dlerror_ret char * dlerror ();"
fi

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


  cat >> confdefs.h <<EOF
#define DLERROR_CONST $cl_cv_proto_dlerror_ret
EOF

fi
LIBDL=
if test "$cl_cv_lib_dl" = yes; then
  LIBDL="-ldl"
fi


                      echo $ac_n "checking for iconv""... $ac_c" 1>&6
echo "configure:12354: checking for iconv" >&5
if eval "test \"`echo '$''{'cl_cv_func_iconv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cl_cv_func_iconv=no
cl_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
#line 12362 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
int main() {
iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);
; return 0; }
EOF
if { (eval echo configure:12370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_func_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test "$cl_cv_func_iconv" = no; then
cl_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
#line 12382 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
int main() {
iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);
; return 0; }
EOF
if { (eval echo configure:12390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cl_cv_lib_iconv=yes
cl_cv_func_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
LIBS="$cl_save_LIBS"
fi

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

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

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

extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);
#else
size_t iconv();
#endif

int main() {

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


cl_cv_proto_iconv="extern size_t iconv (iconv_t cd, $cl_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"
fi

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


cat >> confdefs.h <<EOF
#define ICONV_CONST $cl_cv_proto_iconv_arg1
EOF

fi
LIBICONV=
if test "$cl_cv_lib_iconv" = yes; then
  LIBICONV="-liconv"
fi


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

int main() {

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

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

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

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

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

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

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

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

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

  fi
fi


                      echo $ac_n "checking for the valid characters in filenames""... $ac_c" 1>&6
echo "configure:12625: checking for the valid characters in filenames" >&5
if eval "test \"`echo '$''{'cl_cv_os_valid_filename_char'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $cross_compiling = no; then
mkdir conftestdir
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <stdio.h>
/* Declare chdir(). */
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int chdir (CHDIR_CONST char* path);
#else
int chdir();
#endif
/* Declare open(). */
#include <fcntl.h>
#ifdef OPEN_NEEDS_SYS_FILE_H
#include <sys/file.h>
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
int open ($cl_cv_proto_open_args);
#else
int open();
#endif
/* Declare opendir(), readdir(), closedir(). */
#include <$ac_header_dirent>
#ifdef DIRENT
#define SDIRENT struct dirent
#else
#define SDIRENT struct direct
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
DIR* opendir (OPENDIR_CONST char* dirname);
#else
DIR* opendir();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
SDIRENT* readdir (DIR* dirp);
#else
SDIRENT* readdir();
#endif
extern
#ifdef __cplusplus
"C"
#endif

#if defined(__STDC__) || defined(__cplusplus)
RETCLOSEDIRTYPE closedir (DIR* dirp);
#else
RETCLOSEDIRTYPE closedir();
#endif
/* A small program which checks for each character whether or not it is
 * valid in filenames. */
#define N 256
int main ()
{
#ifdef __CYGWIN32__
  /* The test below would cause a dialog box to pop up (ch == ':'),
     and create files which cause "rm -rf conftest*" to hang
     (ch == '"') || (ch == '<') || (ch == '>') || (ch == 197) || (ch == 206).
     Also, it would make appear that (ch >= 'A') && (ch <= 'Z') doesn't work,
     because it would create files in lower case. But we don't want to forbid
     upper case letters in file names. */
  printf("(ch >= 1) && (ch <= 127) && (ch != 34) && (ch != 42) && (ch != 47) && (ch != 58) && (ch != 60) && (ch != 62) && (ch != 63) && (ch != 92) || (ch == 131) || (ch >= 160) && (ch != 197) && (ch != 206)\n");
#else
  char legal[N];
  char filename[4];
  int i;
  if (chdir("conftestdir") < 0) exit(1);
  for (i = 0; i < N; i++) legal[i] = 0;
  strcpy(filename,"a_z");
  for (i = 0; i < N; i++)
    if (i != '\0')
      { filename[1] = i;
        /* Determine whether the filename is valid: create a file
         * and check that it is present afterwards, under the same name. */
        { int fd = open(filename, O_CREAT | O_RDWR, 0644);
          if (fd >=0)
            { DIR* dirp = opendir(".");
              if (dirp != (DIR*)0)
                { SDIRENT* d;
                  while ((d = readdir(dirp)))
                    { if (!strcmp(d->d_name,".")) continue;
                      if (!strcmp(d->d_name,"..")) continue;
                      if (!strcmp(d->d_name,filename)) legal[i] = 1;
                      /* Remove the file even if its name is something else. */
                      unlink(d->d_name);
                    }
                  closedir(dirp);
                }
              close(fd);
      } }   }
  /* Output a boolean expression equivalent to legal[ch] (0 <= ch < N). */
  { int need_or = 0;
    int z;
    for (z = 0; z < N; )
      { int x, y;
        if (! legal[z]) { z++; continue; }
        x = z;
        if (need_or) printf(" || ");
        z++;
        if ((z < N) && legal[z])
          { do { do { z++; } while ((z < N) && legal[z]);
                 y = z-1;
                 z++;
               } while ((z < N) && legal[z]);
            { int premises = 0;
              if (x > 0) premises++;
              if (y < N-1) premises++;
              for (i = x; i <= y; i++)
                if (! legal[i])
                  premises++;
              if (premises > 1) printf("(");
              { int need_and = 0;
                if (x > 0) { printf("(ch >= %d)",x); need_and = 1; }
                if (y < N-1)
                  { if (need_and) printf(" && ");
                    printf("(ch <= %d)",y);
                    need_and = 1;
                  }
                for (i = x; i <= y; i++)
                  if (! legal[i])
                    { if (need_and) printf(" && ");
                      printf("(ch != %d)",i);
                      need_and = 1;
                    }
                if (!need_and) printf("1");
              }
              if (premises > 1) printf(")");
            }
            z = y+1;
          }
          else
          { printf("(ch == %d)",x); z++; }
        need_or = 1;
      }
    printf("\n");
  }
#endif
  exit(0);
}
EOF
{ (eval echo configure:12795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
cl_cv_os_valid_filename_char=`./conftest`
fi
rm -rf conftest*

fi

if test -z "$cl_cv_os_valid_filename_char"; then
  cl_cv_os_valid_filename_charset="guessing 7-bit"
else
  if test "$cl_cv_os_valid_filename_char" = '((ch >= 1) && (ch != 47))'; then
    cl_cv_os_valid_filename_charset="8-bit"
  else
    cl_cv_os_valid_filename_charset="7-bit"
  fi
fi
echo "$ac_t""$cl_cv_os_valid_filename_charset" 1>&6
if test -n "$cl_cv_os_valid_filename_char"; then
  cat >> confdefs.h <<EOF
#define VALID_FILENAME_CHAR $cl_cv_os_valid_filename_char
EOF

fi

                      echo $ac_n "checking for inline __builtin_strlen""... $ac_c" 1>&6
echo "configure:12820: checking for inline __builtin_strlen" >&5
if eval "test \"`echo '$''{'cl_cv_builtin_strlen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#if defined(__STDC__) || defined(__cplusplus)
int foo (char* x)
#else
int foo (x) char* x;
#endif
{ return __builtin_strlen(x); }
EOF
if { ac_try='${CC-cc} -S $CFLAGS $CPPFLAGS conftest.$ac_ext'; { (eval echo configure:12833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/dev/null 2>&1 ; then
  if grep strlen conftest.s >/dev/null ; then
    cl_cv_builtin_strlen=no
  else
    cl_cv_builtin_strlen=yes
  fi
else
  cl_cv_builtin_strlen=no
fi
rm -f conftest*

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

fi

                      echo $ac_n "checking whether characters are unsigned""... $ac_c" 1>&6
echo "configure:12854: checking whether characters are unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test $ac_cv_prog_gcc = yes; then
  # GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
#line 12862 "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 12884 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
#endif
/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
#if !defined(__STDC__) || __STDC__ != 1
#define volatile
#endif
int main() {
  volatile char c = 255; exit(c < 0);
}
EOF
if { (eval echo configure:12897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_char_unsigned=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  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
rm -fr conftest*
fi

fi
fi
echo "$ac_t""$ac_cv_c_char_unsigned" 1>&6
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

                      cl_machine_file_c=${srcdir}/intparam.c
cl_machine_file_h=intparam.h
if test $cross_compiling = no; then
if test -z "$cl_cv_file_intparam_h"; then
echo "checking for integer types and behaviour" 1>&6
echo "configure:12937: checking for integer types and behaviour" >&5
cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
EOF
cat "$cl_machine_file_c" >> conftest.$ac_ext
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 echo configure:12948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
CC="$ORIGCC"
if test -s conftest; then
  echo "creating $cl_machine_file_h"
  ./conftest > conftest.h
  if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
    # The file exists and we would not be changing it
    rm -f conftest.h
  else
    rm -f "$cl_machine_file_h"
    mv conftest.h "$cl_machine_file_h"
  fi
  cl_cv_file_intparam_h=1
else
  echo "creation of $cl_machine_file_h failed"
fi
rm -f conftest*
fi
else
echo "cross-compiling - cannot create $cl_machine_file_h"
fi

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

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

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

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

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

DEFS=-DHAVE_CONFIG_H

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

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

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

ac_given_srcdir=$srcdir

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

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@CC_GCC@%$CC_GCC%g
s%@GCC_X_NONE@%$GCC_X_NONE%g
s%@CC_CPLUSPLUS@%$CC_CPLUSPLUS%g
s%@CC_ANSI@%$CC_ANSI%g
s%@CC_NEED_CCPAUX@%$CC_NEED_CCPAUX%g
s%@CC_NEED_DEEMA@%$CC_NEED_DEEMA%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@%$LN%g
s%@LN_S@%$LN_S%g
s%@HLN@%$HLN%g
s%@GROFF@%$GROFF%g
s%@host@%$host%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@STDBOOL_H@%$STDBOOL_H%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
s%@LIBDL@%$LIBDL%g
s%@LIBICONV@%$LIBICONV%g
s%@LIBTERMCAP@%$LIBTERMCAP%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

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

cat >> $CONFIG_STATUS <<EOF

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

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

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

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


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

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

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

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

  echo creating $ac_file

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

EOF

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

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

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

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF
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 || exit 1


