#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13.19990117 
# 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_default_prefix=/usr/local

# 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
cat <<EOF
--enable and --with options recognized:
  --install-prefix        prefixes actual install location (default: /)
  --with-ispell           (default: from system path)
  --with-metamail         (default: from system path)
  --with-sum              (default: from system path)
  --with-editor=PROG      specify editor (default: vi) (default: empty)
  --with-mailer=PROG      specify default mailer-program (default: empty)
  --with-mailbox=DIR      directory for incoming mailboxes (default: empty)
  --disable-pgp           disable PGP Support
  --disable-nntp          disable reading via NNTP
  --enable-nntp-only      enable reading via NNTP only
  --enable-debug          turn on debug/profiling/traces
  --disable-echo          display "compiling" commands
  --enable-prototypes     check for optional prototypes
EOF
cat <<EOF
  --enable-warnings       turn on GCC compiler warnings
  --with-libdir=PATH      news-library (default: /usr/lib/news)
  --with-spooldir=PATH    news spool-directory (default: /var/spool/news)
  --with-nov-dir=PATH     news overview-directory (default: $SPOOLDIR)
  --with-nov-fname        specify names of overview files (default: .overview)
  --with-inews-dir=PATH   directory containing "inews" (default: $INEWSPATH)
  --with-inn-nntplib=PATH specify INN-NNTP library (default: empty)
  --with-socks[=path]     link with socks library if available
  --with-socks5[=path]    link with socks5 library if available
  --with-ncurses          link with ncurses if available
  --enable-curses         use curses interface
  --with-dbmalloc         use Conor Cahill's dbmalloc library
EOF
cat <<EOF
  --with-dmalloc          use Gray Watson's dmalloc library
  --with-trace            use debugging/traces
  --with-domain-name      sets \$DOMAIN_NAME (default: empty)
  --with-nntp-default-server
                          (sets \$NNTP_DEFAULT_SERVER)
                          (default: news\$DOMAIN_NAME) (default: empty)
  --enable-mh-mail-handling
                          use MH style mail handling
  --disable-8bit-keys     disable 8-bit keycode support
  --disable-color         disable ANSI-color support
  --disable-etiquette     disable printing of posting-etiquette
  --enable-break-long-lines
                          break long mime-encoded lines
  --disable-mime-strict-charset
                          force MM_CHARSET obeyance
  --with-mime-default-charset
                          fallback for \$MM_CHARSET (default: US-ASCII)
  --with-iso-to-ascii     ISO -> ASCII conversion (default: -1)
EOF
cat <<EOF
  --with-local-charset=CHARSET
                          set local charset to convert from/to (default: empty)
  --disable-locale        disable locale support
  --disable-posting       disable posting
  --disable-shell-escape  disable shell escape
  --enable-fascist-newsadmin
                          have fascist newsadmin
  --disable-inverse-video disable inverse video and highlighting
  --enable-mmdf-mailer    have MMDF type mailer as default
  --disable-piping        disable piping support
  --disable-printing      disable printer support
  --disable-append-pid    disable appending .pid to tmp-files
  --disable-xhdr-xref     disable XHDR XREF fallback
  --enable-broken-listgroup-fix
                          send extra GROUP command before LISTGROUP
                         
EOF
cat <<EOF
  --with-defaults-dir=PATH
                          directory containing tin.defaults file
                          (default: /etc/tin)
  --with-coffee           coffee support
EOF
    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.19990117"
    exit 0 ;;

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

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

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

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

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

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

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

  esac
done

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

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

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

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

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

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

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

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

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

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

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

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

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





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


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

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

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

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

	system_name="$host_os"
else
	system_name="`(uname -s -r) 2>/dev/null`"
	if test -z "$system_name" ; then
		system_name="`(hostname) 2>/dev/null`"
	fi
fi
test -n "$system_name" && cat >> confdefs.h <<EOF
#define SYSTEM_NAME "$system_name"
EOF

if eval "test \"`echo '$''{'cf_cv_system_name'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cf_cv_system_name="$system_name"
fi


test -z "$system_name" && system_name="$cf_cv_system_name"
test -n "$cf_cv_system_name" && echo "$ac_t"""Configuring for $cf_cv_system_name"" 1>&6

if test ".$system_name" != ".$cf_cv_system_name" ; then
	echo "$ac_t""Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" 1>&6
	{ echo "configure: error: "Please remove config.cache and try again."" 1>&2; exit 1; }
fi



# Check whether --with-install-prefix or --without-install-prefix was given.
if test "${with_install_prefix+set}" = set; then
  withval="$with_install_prefix"
  :
else
  withval="${INSTALL_PREFIX-/}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval INSTALL_PREFIX="$withval"

case ".$INSTALL_PREFIX" in # (vi
./)	INSTALL_PREFIX=
	;; # (vi
./*/)	;; # (vi
./*)	INSTALL_PREFIX="$INSTALL_PREFIX/"
	;;
esac

###	Compiler/options that autoconf doesn't get right
case "$host_os" in
	aix*)	#(vi
		if test "$CC" = ""; then
			# Extract the first word of "xlc", so it can be a program name with args.
set dummy xlc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:720: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XLC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$XLC" in
  /*)
  ac_cv_path_XLC="$XLC" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_XLC="$XLC" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_XLC="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
XLC="$ac_cv_path_XLC"
if test -n "$XLC"; then
  echo "$ac_t""$XLC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

			if test "$ac_cv_path_XLC" != ""; then
				CC="$ac_cv_path_XLC"
			fi
		fi
		;;
	hpux*)	#(vi
		test "$CC" != "cc" && test -z "$CFLAGS" && CFLAGS="-O"
		;;
esac

###	Checks for programs.
save_CFLAGS="$CFLAGS"
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:767: 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:797: 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:848: 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:880: 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 891 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:896: \"$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:922: 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:927: 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:936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

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

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

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

fi

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

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:987: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 1002 "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:1008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 1019 "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:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 1036 "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:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

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


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

  fi
fi

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

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

# 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
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# 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:1152: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_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.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall 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.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
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}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

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



if eval "test \"`echo '$''{'cf_cv_prog_YACC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test -n "$YACC" ; then
  cf_cv_prog_YACC="$YACC" # Let the user override the test.
else
cat >conftest.y <<EOF
%{
void yyerror(s) char *s; { }
%}
%token	NUMBER
%%
time	: NUMBER ':' NUMBER
	;
%%
int yylex() { return NUMBER; }
int main() { return yyparse(); }
EOF
  for cf_prog in 'bison -y' byacc yacc
  do
    rm -f y.tab.ch
    echo $ac_n "checking for $cf_prog""... $ac_c" 1>&6
echo "configure:1259: checking for $cf_prog" >&5
    cf_command="$cf_prog conftest.y"
    cf_result=no
    if { (eval echo configure:1262: \"$cf_command\") 1>&5; (eval $cf_command) 2>&5; } && test -s y.tab.c ; then
      mv y.tab.c conftest.c
      rm -f y.tab.h
      if test "$cf_prog" = 'bison -y' ; then
        if { (eval echo configure:1266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest ; then
          cf_result=yes
        fi
      else
        cf_result=yes
      fi
    fi
    echo "$ac_t""$cf_result" 1>&6
    if test $cf_result = yes ; then
      cf_cv_prog_YACC="$cf_prog"
      break
    fi
  done
fi

fi

YACC="$cf_cv_prog_YACC"

for ac_prog in lint alint lclint tdlint
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1290: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LINT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LINT"; then
  ac_cv_prog_LINT="$LINT" # 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_LINT="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LINT="$ac_cv_prog_LINT"
if test -n "$LINT"; then
  echo "$ac_t""$LINT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LINT" && break
done


echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
echo "configure:1321: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'cf_cv_ansi_cc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_ansi_cc=no
cf_save_CFLAGS="$CFLAGS"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX			-qlanglvl=ansi
# Ultrix and OSF/1	-std1
# HP-UX			-Aa -D_HPUX_SOURCE
# SVR4			-Xc
# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
for cf_arg in "-DCC_HAS_PROTOS" \
	"" \
	-qlanglvl=ansi \
	-std1 \
	-Ae \
	"-Aa -D_HPUX_SOURCE" \
	-Xc
do
	CFLAGS="$cf_save_CFLAGS $cf_arg"
	cat > conftest.$ac_ext <<EOF
#line 1345 "configure"
#include "confdefs.h"

#ifndef CC_HAS_PROTOS
#if !defined(__STDC__) || (__STDC__ != 1)
choke me
#endif
#endif

int main() {

	int test (int i, double x);
	struct s1 {int (*f) (int a);};
	struct s2 {int (*f) (double a);};
; return 0; }
EOF
if { (eval echo configure:1361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ansi_cc="$cf_arg"; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
CFLAGS="$cf_save_CFLAGS"

fi

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

if test "$cf_cv_ansi_cc" != "no"; then
if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
	CFLAGS="$CFLAGS $cf_cv_ansi_cc"
else
	cat >> confdefs.h <<\EOF
#define CC_HAS_PROTOS 1
EOF

fi
fi


if test "$cf_cv_ansi_cc" = "no"; then
	{ echo "configure: error: Your compiler does not appear to recognize prototypes.
You have the following choices:
	a. adjust your compiler options
	b. get an up-to-date compiler
	c. use a wrapper such as unproto" 1>&2; exit 1; }
fi



PROG_EXT=
case $cf_cv_system_name in
os2*)
    # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
    CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
    CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
    LDFLAGS=`echo "$LDFLAGS -Zmt -Zcrtdll" | sed "s/-Zexe//g"`
    PROG_EXT=".exe"
    ;;
cygwin*)
    PROG_EXT=".exe"
    ;;
esac



	case $cf_cv_system_name in
	os2)	LIB_PREFIX=''     ;;
	*)	LIB_PREFIX='lib'  ;;
	esac
	LIB_PREFIX=$LIB_PREFIX
	



# Check whether --with-ispell or --without-ispell was given.
if test "${with_ispell+set}" = set; then
  withval="$with_ispell"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-ispell" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-ispell=path"
   echo $ac_n "checking for ispell""... $ac_c" 1>&6
echo "configure:1435: checking for ispell" >&5
   ac_cv_path_PATH_ISPELL="$withval"
   cat >> confdefs.h <<\EOF
#define HAVE_ISPELL 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-ispell"; do automatic check
  # Extract the first word of "ispell", so it can be a program name with args.
set dummy ispell; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1449: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_ISPELL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_ISPELL" in
  /*)
  ac_cv_path_PATH_ISPELL="$PATH_ISPELL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_ISPELL="$PATH_ISPELL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PATH_ISPELL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_ISPELL="$ac_cv_path_PATH_ISPELL"
if test -n "$PATH_ISPELL"; then
  echo "$ac_t""$PATH_ISPELL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi



# Check whether --with-metamail or --without-metamail was given.
if test "${with_metamail+set}" = set; then
  withval="$with_metamail"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-metamail" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-metamail=path"
   echo $ac_n "checking for metamail""... $ac_c" 1>&6
echo "configure:1506: checking for metamail" >&5
   ac_cv_path_PATH_METAMAIL="$withval"
   cat >> confdefs.h <<\EOF
#define HAVE_METAMAIL 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-metamail"; do automatic check
  # Extract the first word of "metamail", so it can be a program name with args.
set dummy metamail; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1520: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_METAMAIL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_METAMAIL" in
  /*)
  ac_cv_path_PATH_METAMAIL="$PATH_METAMAIL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_METAMAIL="$PATH_METAMAIL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PATH_METAMAIL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_METAMAIL="$ac_cv_path_PATH_METAMAIL"
if test -n "$PATH_METAMAIL"; then
  echo "$ac_t""$PATH_METAMAIL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi



# Check whether --with-sum or --without-sum was given.
if test "${with_sum+set}" = set; then
  withval="$with_sum"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-sum" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-sum=path"
   echo $ac_n "checking for sum""... $ac_c" 1>&6
echo "configure:1577: checking for sum" >&5
   ac_cv_path_PATH_SUM="$withval"
   cat >> confdefs.h <<\EOF
#define HAVE_SUM 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-sum"; do automatic check
  # Extract the first word of "sum", so it can be a program name with args.
set dummy sum; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1591: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_SUM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_SUM" in
  /*)
  ac_cv_path_PATH_SUM="$PATH_SUM" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_SUM="$PATH_SUM" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_PATH_SUM="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_SUM="$ac_cv_path_PATH_SUM"
if test -n "$PATH_SUM"; then
  echo "$ac_t""$PATH_SUM" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi


if test $ac_cv_path_PATH_SUM
then
echo $ac_n "checking if $ac_cv_path_PATH_SUM takes -r""... $ac_c" 1>&6
echo "configure:1638: checking if $ac_cv_path_PATH_SUM takes -r" >&5
if eval "test \"`echo '$''{'ac_cv_prog_sum_r'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if { ac_try='$ac_cv_path_PATH_SUM -r config.log 1>&5'; { (eval echo configure:1643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
	ac_cv_prog_sum_r=yes
else
	ac_cv_prog_sum_r=no
fi

fi

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

	cat >> confdefs.h <<EOF
#define PATH_SUM_R "$ac_cv_path_PATH_SUM -r"
EOF

else
	cat >> confdefs.h <<EOF
#define PATH_SUM_R "$ac_cv_path_PATH_SUM"
EOF

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



echo $ac_n "checking for default editor""... $ac_c" 1>&6
echo "configure:1673: checking for default editor" >&5

# Check whether --with-editor or --without-editor was given.
if test "${with_editor+set}" = set; then
  withval="$with_editor"
  :
else
  withval="${DEFAULT_EDITOR}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-editor" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
DEFAULT_EDITOR="$withval"

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

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



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


# Check whether --with-mailer or --without-mailer was given.
if test "${with_mailer+set}" = set; then
  withval="$with_mailer"
  :
else
  withval="${DEFAULT_MAILER}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-mailer" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
DEFAULT_MAILER="$withval"

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

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

fi
echo $ac_n "checking for default mailer""... $ac_c" 1>&6
echo "configure:1871: checking for default mailer" >&5
if test -n "$DEFAULT_MAILER" ; then
	cat >> confdefs.h <<EOF
#define DEFAULT_MAILER "$DEFAULT_MAILER"
EOF

else
	DEFAULT_MAILER=none
fi
echo "$ac_t""$DEFAULT_MAILER" 1>&6


echo $ac_n "checking for incoming-mail directory""... $ac_c" 1>&6
echo "configure:1884: checking for incoming-mail directory" >&5

# Check whether --with-mailbox or --without-mailbox was given.
if test "${with_mailbox+set}" = set; then
  withval="$with_mailbox"
  :
else
  withval="${DEFAULT_MAILBOX}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-mailbox" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
DEFAULT_MAILBOX="$withval"

if test -z "$DEFAULT_MAILBOX" ; then
for cf_dir in \
	/var/spool/mail \
	/usr/spool/mail \
	/var/mail \
	/usr/mail \
	/mail
    do
    	if test -d $cf_dir ; then
	    DEFAULT_MAILBOX=$cf_dir
	    break
	fi
    done
fi
if test -n "$DEFAULT_MAILBOX" ; then
	cat >> confdefs.h <<EOF
#define DEFAULT_MAILBOX "$DEFAULT_MAILBOX"
EOF

else
	DEFAULT_MAILBOX=none
fi
echo "$ac_t""$DEFAULT_MAILBOX" 1>&6


## PGP Support
echo $ac_n "checking if you want PGP-Support""... $ac_c" 1>&6
echo "configure:1930: checking if you want PGP-Support" >&5

# Check whether --enable-pgp or --disable-pgp was given.
if test "${enable_pgp+set}" = set; then
  enableval="$enable_pgp"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    USE_PGP=no 
  else
    USE_PGP=yes
  fi
else
  enableval=yes 
  USE_PGP=yes
  
fi

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

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

if test $PGPK != no ; then
	cat >> confdefs.h <<\EOF
#define HAVE_PGP 1
EOF

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

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

	if test $PGP != no; then
		cat >> confdefs.h <<\EOF
#define HAVE_PGP 1
EOF

	fi
fi
fi

### check for this early, since it'll override several options
echo $ac_n "checking if NNTP-support will be used""... $ac_c" 1>&6
echo "configure:2043: checking if NNTP-support will be used" >&5

# Check whether --enable-nntp or --disable-nntp was given.
if test "${enable_nntp+set}" = set; then
  enableval="$enable_nntp"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    USE_NNTP=no 
  else
    USE_NNTP=yes
  fi
else
  enableval=yes 
  USE_NNTP=yes
  
fi

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

USE_SPOOLDIR=yes
if test "$USE_NNTP" = "yes" ; then
echo $ac_n "checking whether to be NNTP_ONLY""... $ac_c" 1>&6
echo "configure:2065: checking whether to be NNTP_ONLY" >&5

# Check whether --enable-nntp-only or --disable-nntp-only was given.
if test "${enable_nntp_only+set}" = set; then
  enableval="$enable_nntp_only"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define NNTP_ONLY 1
EOF

	 USE_SPOOLDIR=no 
  else
    cat >> confdefs.h <<\EOF
#define NNTP_ABLE 1
EOF

  fi
else
  enableval=no 
  cat >> confdefs.h <<\EOF
#define NNTP_ABLE 1
EOF

  
fi

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

###	use option --enable-debug to compile-in test/development code
echo $ac_n "checking if you want to compile-in debug support""... $ac_c" 1>&6
echo "configure:2097: checking if you want to compile-in debug support" >&5

# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    ENABLE_DEBUG=''
	CFLAGS="-g $CFLAGS"
	LDFLAGS="-g $LDFLAGS" 
  else
    ENABLE_DEBUG='#'
	test -z "$save_CFLAGS" && CFLAGS=`echo $CFLAGS|sed -e 's/-g //' -e 's/-g$//'`
  fi
else
  enableval=no 
  ENABLE_DEBUG='#'
	test -z "$save_CFLAGS" && CFLAGS=`echo $CFLAGS|sed -e 's/-g //' -e 's/-g$//'`
  
fi

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


###	use option --disable-echo to suppress full display compiling commands

echo $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>&6
echo "configure:2124: checking if you want to see long compiling messages" >&5

# Check whether --enable-echo or --disable-echo was given.
if test "${enable_echo+set}" = set; then
  enableval="$enable_echo"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    
    ECHO_LD='@echo linking $@;'
    RULE_CC='	@echo compiling $<'
    SHOW_CC='	@echo compiling $@'
    ECHO_CC='@'
 
  else
    
    ECHO_LD=''
    RULE_CC='# compiling'
    SHOW_CC='# compiling'
    ECHO_CC=''

  fi
else
  enableval=yes 
  
    ECHO_LD=''
    RULE_CC='# compiling'
    SHOW_CC='# compiling'
    ECHO_CC=''

  
fi

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






### use option --enable-prototypes to turn on optional prototypes
echo $ac_n "checking if you want to compile with fallback prototypes""... $ac_c" 1>&6
echo "configure:2165: checking if you want to compile with fallback prototypes" >&5

# Check whether --enable-prototypes or --disable-prototypes was given.
if test "${enable_prototypes+set}" = set; then
  enableval="$enable_prototypes"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    with_decl_check=yes 
  else
    with_decl_check=no
  fi
else
  enableval=no 
  with_decl_check=no
  
fi

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

###	use option --enable-warnings to turn on all gcc warnings
EXTRA_CFLAGS=""
if test -n "$GCC"
then
echo $ac_n "checking if you want to turn on gcc warnings""... $ac_c" 1>&6
echo "configure:2189: checking if you want to turn on gcc warnings" >&5

# Check whether --enable-warnings or --disable-warnings was given.
if test "${enable_warnings+set}" = set; then
  enableval="$enable_warnings"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    with_warnings=yes 
  else
    with_warnings=no
  fi
else
  enableval=no 
  with_warnings=no
  
fi

echo "$ac_t""$with_warnings" 1>&6
if test "$with_warnings" = "yes"
then
	with_ext_const=yes
	
if test -n "$GCC"
then
		cat > conftest.$ac_ext <<EOF
#line 2214 "configure"
int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
EOF
		echo "checking for $CC warning options" 1>&6
echo "configure:2218: checking for $CC warning options" >&5
	cf_save_CFLAGS="$CFLAGS"
	EXTRA_CFLAGS="-W -Wall"
	cf_warn_CONST=""
	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
	for cf_opt in \
		Wbad-function-cast \
		Wcast-align \
		Wcast-qual \
		Winline \
		Wmissing-declarations \
		Wmissing-prototypes \
		Wnested-externs \
		Wpointer-arith \
		Wshadow \
		Wstrict-prototypes $cf_warn_CONST
	do
		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
		if { (eval echo configure:2236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
			test "$cf_opt" = Wcast-qual && EXTRA_CFLAGS="$EXTRA_CFLAGS -DXTSTRINGDEFINES"
		fi
	done
	rm -f conftest*
	CFLAGS="$cf_save_CFLAGS"
fi


fi
fi

## !NNTP_ONLY
if test "$USE_SPOOLDIR" = "yes"; then
	## options for directories
	echo $ac_n "checking for news-library path""... $ac_c" 1>&6
echo "configure:2254: checking for news-library path" >&5
	
# Check whether --with-libdir or --without-libdir was given.
if test "${with_libdir+set}" = set; then
  withval="$with_libdir"
  :
else
  withval="${NEWSLIBDIR-/usr/lib/news}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval NEWSLIBDIR="$withval"

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

	echo $ac_n "checking for news spool-directory path""... $ac_c" 1>&6
echo "configure:2288: checking for news spool-directory path" >&5
	
# Check whether --with-spooldir or --without-spooldir was given.
if test "${with_spooldir+set}" = set; then
  withval="$with_spooldir"
  :
else
  withval="${SPOOLDIR-/var/spool/news}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval SPOOLDIR="$withval"

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

	echo $ac_n "checking for news overview-directory path""... $ac_c" 1>&6
echo "configure:2322: checking for news overview-directory path" >&5
	
# Check whether --with-nov-dir or --without-nov-dir was given.
if test "${with_nov_dir+set}" = set; then
  withval="$with_nov_dir"
  :
else
  withval="${NOVROOTDIR-$SPOOLDIR}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval NOVROOTDIR="$withval"

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

	echo $ac_n "checking for overview filename""... $ac_c" 1>&6
echo "configure:2356: checking for overview filename" >&5
	
# Check whether --with-nov-fname or --without-nov-fname was given.
if test "${with_nov_fname+set}" = set; then
  withval="$with_nov_fname"
  :
else
  withval="${OVERVIEW_FILE-.overview}"
fi
test -z "$withval" && withval=no
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-nov-fname" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
OVERVIEW_FILE="$withval"

 cat >> confdefs.h <<EOF
#define OVERVIEW_FILE "$withval"
EOF

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

	INEWSPATH="$NEWSLIBDIR"
else
	NEWSLIBDIR=""
	SPOOLDIR=""
	NOVROOTDIR=""
	INEWSPATH="/usr/lib/news"
fi

echo $ac_n "checking for directory containing \"inews\"""... $ac_c" 1>&6
echo "configure:2390: checking for directory containing \"inews\"" >&5

# Check whether --with-inews-dir or --without-inews-dir was given.
if test "${with_inews_dir+set}" = set; then
  withval="$with_inews_dir"
  :
else
  withval="${INEWSDIR-$INEWSPATH}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval INEWSDIR="$withval"

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

## !NNTP_ONLY
if test "$USE_SPOOLDIR" = "yes"; then
	## options for libraries
	echo $ac_n "checking for optional INN-NNTP library""... $ac_c" 1>&6
echo "configure:2427: checking for optional INN-NNTP library" >&5
	
# Check whether --with-inn-nntplib or --without-inn-nntplib was given.
if test "${with_inn_nntplib+set}" = set; then
  withval="$with_inn_nntplib"
  :
else
  withval="${INN_NNTPLIB}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-inn-nntplib" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
INN_NNTPLIB="$withval"

 cat >> confdefs.h <<EOF
#define INN_NNTPLIB "$withval"
EOF

	echo "$ac_t""$INN_NNTPLIB" 1>&6
else
	INN_NNTPLIB=""
fi


### Look for network libraries first, since some functions (such as gethostname)
### are used in a lot of places.
echo $ac_n "checking if you want socks library""... $ac_c" 1>&6
echo "configure:2459: checking if you want socks library" >&5
if eval "test \"`echo '$''{'cf_cv_use_libsocks'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

# Check whether --with-socks or --without-socks was given.
if test "${with_socks+set}" = set; then
  withval="$with_socks"
  cf_cv_use_libsocks=$withval
else
  cf_cv_use_libsocks=no
fi


fi

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

echo $ac_n "checking if you want socks5 library""... $ac_c" 1>&6
echo "configure:2479: checking if you want socks5 library" >&5
if eval "test \"`echo '$''{'cf_cv_use_libsocks5'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

# Check whether --with-socks5 or --without-socks5 was given.
if test "${with_socks5+set}" = set; then
  withval="$with_socks5"
  cf_cv_use_libsocks5=$withval
else
  cf_cv_use_libsocks5=no
fi


fi

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

if test "x$cf_cv_use_libsocks" != xno ; then
	
case "$cf_cv_use_libsocks" in #(vi
no|yes) #(vi
  ;;
*)
  LIBS="$LIBS -L$cf_cv_use_libsocks"
  ;;
esac
LIBS="$LIBS -lsocks"
cat >> confdefs.h <<\EOF
#define SOCKS 1
EOF

cat >> confdefs.h <<\EOF
#define accept Raccept
EOF

cat >> confdefs.h <<\EOF
#define bind Rbind
EOF

cat >> confdefs.h <<\EOF
#define connect Rconnect
EOF

cat >> confdefs.h <<\EOF
#define getpeername Rgetpeername
EOF

cat >> confdefs.h <<\EOF
#define getsockname Rgetsockname
EOF

cat >> confdefs.h <<\EOF
#define listen Rlisten
EOF

cat >> confdefs.h <<\EOF
#define recvfrom Rrecvfrom
EOF

cat >> confdefs.h <<\EOF
#define select Rselect
EOF

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

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

	accept((char *)0)
; return 0; }
EOF
if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: Cannot link with socks library" 1>&2; exit 1; }
fi
rm -f conftest*

else
	
cf_test_netlibs=no
echo $ac_n "checking for network libraries""... $ac_c" 1>&6
echo "configure:2568: checking for network libraries" >&5
if eval "test \"`echo '$''{'cf_cv_netlibs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
echo "$ac_t""working..." 1>&6
cf_cv_netlibs=""
cf_test_netlibs=yes
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2579: 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 2584 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

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

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

echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6
echo "configure:2630: checking for gethostname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostname | 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="-lnsl $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2638 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostname();

int main() {
gethostname()
; return 0; }
EOF
if { (eval echo configure:2649: \"$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
  
	
cf_tr_func=`echo gethostname | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_gethostname=yes
	cf_cv_netlibs="-lnsl $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_gethostname=unknown
	unset ac_cv_func_gethostname 2>/dev/null
	
		
echo $ac_n "checking for gethostname in -lsocket""... $ac_c" 1>&6
echo "configure:2682: checking for gethostname in -lsocket" >&5
ac_lib_var=`echo socket'_'gethostname | 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 $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2690 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostname();

int main() {
gethostname()
; return 0; }
EOF
if { (eval echo configure:2701: \"$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
  
	
cf_tr_func=`echo gethostname | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_gethostname=yes
	cf_cv_netlibs="-lsocket $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_gethostname=unknown
	unset ac_cv_func_gethostname 2>/dev/null
	
fi


fi


fi
done

#
# FIXME:  sequent needs this library (i.e., -lsocket -linet -lnsl), but
# I don't know the entrypoints - 97/7/22 TD
echo $ac_n "checking for -linet""... $ac_c" 1>&6
echo "configure:2745: checking for -linet" >&5
if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-linet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2752 "configure"
#include "confdefs.h"

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

fi
echo "$ac_t""$ac_cv_lib_inet" 1>&6
if test "$ac_cv_lib_inet" = yes; then
  cf_cv_netlibs="-linet $cf_cv_netlibs"
fi

#
if test "$ac_cv_func_lsocket" != no ; then
for ac_func in socket
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2782: 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 2787 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

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

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

echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:2833: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'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 $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2841 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:2852: \"$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
  
	
cf_tr_func=`echo socket | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_socket=yes
	cf_cv_netlibs="-lsocket $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_socket=unknown
	unset ac_cv_func_socket 2>/dev/null
	
		
echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
echo "configure:2885: checking for socket in -lbsd" >&5
ac_lib_var=`echo bsd'_'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="-lbsd $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2893 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:2904: \"$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
  
	
cf_tr_func=`echo socket | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_socket=yes
	cf_cv_netlibs="-lbsd $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_socket=unknown
	unset ac_cv_func_socket 2>/dev/null
	
fi


fi


fi
done

fi
#
for ac_func in gethostbyname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2949: 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 2954 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

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

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

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

int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:3019: \"$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
  
	
cf_tr_func=`echo gethostbyname | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_gethostbyname=yes
	cf_cv_netlibs="-lnsl $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_gethostbyname=unknown
	unset ac_cv_func_gethostbyname 2>/dev/null
	
fi


fi
done

#
for ac_func in strcasecmp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3060: 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 3065 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

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

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

echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6
echo "configure:3111: checking for strcasecmp in -lresolv" >&5
ac_lib_var=`echo resolv'_'strcasecmp | 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="-lresolv $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3119 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char strcasecmp();

int main() {
strcasecmp()
; return 0; }
EOF
if { (eval echo configure:3130: \"$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
  
	
cf_tr_func=`echo strcasecmp | tr 'a-z' 'A-Z'`

	cat >> confdefs.h <<EOF
#define HAVE_$cf_tr_func 1
EOF

	ac_cv_func_strcasecmp=yes
	cf_cv_netlibs="-lresolv $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6

	ac_cv_func_strcasecmp=unknown
	unset ac_cv_func_strcasecmp 2>/dev/null
	
fi


fi
done


fi

LIBS="$LIBS $cf_cv_netlibs"
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&6

	if test "x$cf_cv_use_libsocks5" != xno ; then
	
case "$cf_cv_use_libsocks5" in #(vi
no|yes) #(vi
  ;;
*)
  LIBS="$LIBS -L$cf_cv_use_libsocks5"
  CFLAGS="$CFLAGS -I$cf_cv_use_libsocks5/../include"
  ;;
esac
LIBS="$LIBS -lsocks5"
cat >> confdefs.h <<\EOF
#define USE_SOCKS5 1
EOF

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

echo $ac_n "checking if the socks library uses socks4 prefix""... $ac_c" 1>&6
echo "configure:3193: checking if the socks library uses socks4 prefix" >&5
cat > conftest.$ac_ext <<EOF
#line 3195 "configure"
#include "confdefs.h"

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

	Rinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define USE_SOCKS4_PREFIX 1
EOF

	 cf_use_socks4=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 3216 "configure"
#include "confdefs.h"
#include <socks.h>
int main() {
SOCKSinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:3223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_use_socks4=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  { echo "configure: error: Cannot link with socks5 library" 1>&2; exit 1; }
fi
rm -f conftest*
fi
rm -f conftest*
echo "$ac_t""$cf_use_socks4" 1>&6
if test "$cf_use_socks4" = "yes" ; then
	cat >> confdefs.h <<\EOF
#define accept Raccept
EOF

	cat >> confdefs.h <<\EOF
#define bind Rbind
EOF

	cat >> confdefs.h <<\EOF
#define connect Rconnect
EOF

	cat >> confdefs.h <<\EOF
#define getpeername Rgetpeername
EOF

	cat >> confdefs.h <<\EOF
#define getsockname Rgetsockname
EOF

	cat >> confdefs.h <<\EOF
#define listen Rlisten
EOF

	cat >> confdefs.h <<\EOF
#define recvfrom Rrecvfrom
EOF

	cat >> confdefs.h <<\EOF
#define select Rselect
EOF

else
	cat >> confdefs.h <<\EOF
#define accept SOCKSaccept
EOF

	cat >> confdefs.h <<\EOF
#define getpeername SOCKSgetpeername
EOF

	cat >> confdefs.h <<\EOF
#define getsockname SOCKSgetsockname
EOF

	cat >> confdefs.h <<\EOF
#define recvfrom SOCKSrecvfrom
EOF

fi

	fi
fi

### Look for ncurses in the usual places, accommodating compilers that don't
### search /usr/local by default.
echo $ac_n "checking if you want ncurses library""... $ac_c" 1>&6
echo "configure:3294: checking if you want ncurses library" >&5
found_ncurses=no

# Check whether --with-ncurses or --without-ncurses was given.
if test "${with_ncurses+set}" = set; then
  withval="$with_ncurses"
  found_ncurses=$withval
else
  found_ncurses=no
fi

echo "$ac_t""$found_ncurses" 1>&6
if test $found_ncurses != no ; then
	 
echo $ac_n "checking for ncurses header file""... $ac_c" 1>&6
echo "configure:3309: checking for ncurses header file" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 3315 "configure"
#include "confdefs.h"
#include <curses.h>
int main() {

#ifdef NCURSES_VERSION
printf("%s\n", NCURSES_VERSION);
#else
#ifdef __NCURSES_H
printf("old\n");
#else
make an error
#endif
#endif
	
; return 0; }
EOF
if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_header=predefined
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cf_search=""
if test -d "$includedir"  ; then
test "$includedir" != NONE       && cf_search="$cf_search $includedir $includedir/ncurses"
fi
if test -d "$oldincludedir"  ; then
test "$oldincludedir" != NONE    && cf_search="$cf_search $oldincludedir $oldincludedir/ncurses"
fi
if test -d "$prefix"; then
test "$prefix" != NONE           && cf_search="$cf_search $prefix/include $prefix/include/ncurses"
fi
test "$prefix" != /usr/local     && cf_search="$cf_search /usr/local/include /usr/local/include/ncurses"
test "$prefix" != /usr           && cf_search="$cf_search /usr/include /usr/include/ncurses"
test "$prefix" != /opt           && cf_search="$cf_search /opt/include /opt/include/ncurses"

	test -n "$verbose" && echo
	for cf_incdir in $cf_search
	do
		for cf_header in \
			curses.h \
			ncurses.h
		do
			if egrep "NCURSES_[VH]" $cf_incdir/$cf_header 1>&5 2>&1; then
				cf_cv_ncurses_header=$cf_incdir/$cf_header
				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
				break
			fi
			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
		done
		test -n "$cf_cv_ncurses_header" && break
	done
	test -z "$cf_cv_ncurses_header" && { echo "configure: error: not found" 1>&2; exit 1; }
	
fi
rm -f conftest*
fi

echo "$ac_t""$cf_cv_ncurses_header" 1>&6
cat >> confdefs.h <<\EOF
#define NCURSES 1
EOF


cf_incdir=`echo $cf_cv_ncurses_header | sed -e 's:/[^/]*$::'`

case $cf_cv_ncurses_header in # (vi
*/ncurses.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSES_H 1
EOF

	;;
esac

case $cf_cv_ncurses_header in # (vi
predefined) # (vi
	cf_cv_ncurses_header=curses.h
	;;
*)
	
for cf_add_incdir in $cf_incdir
do
	while true
	do
		case $cf_add_incdir in
		/usr/include) # (vi
			;;
		*) # (vi
			CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			;;
		esac
		cf_top_incdir=`echo $cf_add_incdir | sed -e 's:/include/.*$:/include:'`
		test "$cf_top_incdir" = "$cf_add_incdir" && break
		cf_add_incdir="$cf_top_incdir"
	done
done

	;;
esac
echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:3419: checking for ncurses version" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_version'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_cv_ncurses_version=no
	cf_tempfile=out$$
	if test "$cross_compiling" = yes; then
  

	# This will not work if the preprocessor splits the line after the
	# Autoconf token.  The 'unproto' program does that.
	cat > conftest.$ac_ext <<EOF
#include <${cf_cv_ncurses_header-curses.h}>
#undef Autoconf
#ifdef NCURSES_VERSION
Autoconf NCURSES_VERSION
#else
#ifdef __NCURSES_H
Autoconf "old"
#endif
;
#endif
EOF
	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
	{ (eval echo configure:3444: \"$cf_try\") 1>&5; (eval $cf_try) 2>&5; }
	if test -f conftest.out ; then
		cf_out=`cat conftest.out | sed -e 's@^Autoconf @@' -e 's@^[^"]*"@@' -e 's@".*@@'`
		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
		rm -f conftest.out
	fi

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

#include <${cf_cv_ncurses_header-curses.h}>
int main()
{
	FILE *fp = fopen("$cf_tempfile", "w");
#ifdef NCURSES_VERSION
# ifdef NCURSES_VERSION_PATCH
	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
# else
	fprintf(fp, "%s\n", NCURSES_VERSION);
# endif
#else
# ifdef __NCURSES_H
	fprintf(fp, "old\n");
# else
	make an error
# endif
#endif
	exit(0);
}
EOF
if { (eval echo configure:3476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  
	cf_cv_ncurses_version=`cat $cf_tempfile`
	rm -f $cf_tempfile
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

fi

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


	 

	# This works, except for the special case where we find gpm, but
	# ncurses is in a nonstandard location via $LIBS, and we really want
	# to link gpm.
cf_ncurses_LIBS=""
cf_ncurses_SAVE="$LIBS"
echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
echo "configure:3501: checking for Gpm_Open in -lgpm" >&5
ac_lib_var=`echo gpm'_'Gpm_Open | 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="-lgpm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3509 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char Gpm_Open();

int main() {
Gpm_Open()
; return 0; }
EOF
if { (eval echo configure:3520: \"$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
  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>&6
echo "configure:3536: checking for initscr in -lgpm" >&5
ac_lib_var=`echo gpm'_'initscr | 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="-lgpm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3544 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

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

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


case $host_os in #(vi
freebsd*)
	# This is only necessary if you are linking against an obsolete
	# version of ncurses (but it should do no harm, since it's static).
	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:3586: checking for tgoto in -lmytinfo" >&5
ac_lib_var=`echo mytinfo'_'tgoto | 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="-lmytinfo  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3594 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgoto();

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

	;;
esac

LIBS="$cf_ncurses_LIBS $LIBS"

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

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_initscr) || defined (__stub___initscr)
choke me
#else
initscr();
#endif

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

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

		cf_save_LIBS="$LIBS"
		echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
echo "configure:3681: checking for initscr in -lncurses" >&5
		LIBS="-lncurses $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 3684 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:3691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 cf_cv_have_lib_ncurses=yes
			
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
			cf_search=""
if test -d "$libdir"  ; then
test "$libdir" != NONE           && cf_search="$cf_search $libdir $libdir/ncurses"
fi
if test -d "$exec_prefix"; then
test "$exec_prefix" != NONE      && cf_search="$cf_search $exec_prefix/lib $exec_prefix/lib/ncurses"
fi
if test -d "$prefix"; then
test "$prefix" != NONE           && \
test "$prefix" != "$exec_prefix" && cf_search="$cf_search $prefix/lib $prefix/lib/ncurses"
fi
test "$prefix" != /usr/local     && cf_search="$cf_search /usr/local/lib /usr/local/lib/ncurses"
test "$prefix" != /usr           && cf_search="$cf_search /usr/lib /usr/lib/ncurses"
test "$prefix" != /opt           && cf_search="$cf_search /opt/lib /opt/lib/ncurses"

			for cf_libdir in $cf_search
			do
				echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>&6
echo "configure:3719: checking for -lncurses in $cf_libdir" >&5
				LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
				cat > conftest.$ac_ext <<EOF
#line 3722 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:3729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 		 cf_cv_have_lib_ncurses=yes
					 break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
					 LIBS="$cf_save_LIBS"
fi
rm -f conftest*
			done
			
fi
rm -f conftest*
		
fi

if test $cf_cv_have_lib_ncurses = no ; then
	{ echo "configure: error: Cannot link ncurses library" 1>&2; exit 1; }
fi
case $host_os in #(vi
linux*) # Suse Linux does not follow /usr/lib convention
	LIBS="$LIBS -L/lib"
	;;
esac


if test -n "$cf_ncurses_LIBS" ; then
	echo $ac_n "checking if we can link ncurses without $cf_ncurses_LIBS""... $ac_c" 1>&6
echo "configure:3761: checking if we can link ncurses without $cf_ncurses_LIBS" >&5
	cf_ncurses_SAVE="$LIBS"
	for p in $cf_ncurses_LIBS ; do
		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
		if test "$q" != "$LIBS" ; then
			LIBS="$q"
		fi
	done
	cat > conftest.$ac_ext <<EOF
#line 3770 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
; return 0; }
EOF
if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
		 LIBS="$cf_ncurses_SAVE"
fi
rm -f conftest*
fi

fi

echo $ac_n "checking if you want curses""... $ac_c" 1>&6
echo "configure:3793: checking if you want curses" >&5

# Check whether --enable-curses or --disable-curses was given.
if test "${enable_curses+set}" = set; then
  enableval="$enable_curses"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define USE_CURSES 1
EOF
 
  fi
else
  enableval=no   
fi

echo "$ac_t""$enableval" 1>&6
use_curses=$enableval

## debugging libraries (do this after other libraries)
echo $ac_n "checking if you want dbmalloc library""... $ac_c" 1>&6
echo "configure:3814: checking if you want dbmalloc library" >&5
debug_malloc=none

# Check whether --with-dbmalloc or --without-dbmalloc was given.
if test "${with_dbmalloc+set}" = set; then
  withval="$with_dbmalloc"
  echo "$ac_t""yes" 1>&6
	 echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
echo "configure:3822: checking for debug_malloc in -ldbmalloc" >&5
ac_lib_var=`echo dbmalloc'_'debug_malloc | 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="-ldbmalloc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3830 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char debug_malloc();

int main() {
debug_malloc()
; return 0; }
EOF
if { (eval echo configure:3841: \"$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_safe=`echo "dbmalloc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dbmalloc.h""... $ac_c" 1>&6
echo "configure:3858: checking for dbmalloc.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 3863 "configure"
#include "confdefs.h"
#include <dbmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3868: \"$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
  debug_malloc=DBMALLOC
else
  echo "$ac_t""no" 1>&6
fi

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

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


echo $ac_n "checking if you want dmalloc library""... $ac_c" 1>&6
echo "configure:3899: checking if you want dmalloc library" >&5

# Check whether --with-dmalloc or --without-dmalloc was given.
if test "${with_dmalloc+set}" = set; then
  withval="$with_dmalloc"
  echo "$ac_t""yes" 1>&6
	 echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
echo "configure:3906: checking for dmalloc_debug in -ldmalloc" >&5
ac_lib_var=`echo dmalloc'_'dmalloc_debug | 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="-ldmalloc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3914 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dmalloc_debug();

int main() {
dmalloc_debug()
; return 0; }
EOF
if { (eval echo configure:3925: \"$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_safe=`echo "dmalloc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dmalloc.h""... $ac_c" 1>&6
echo "configure:3942: checking for dmalloc.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 3947 "configure"
#include "confdefs.h"
#include <dmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3952: \"$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
  debug_malloc=DMALLOC
else
  echo "$ac_t""no" 1>&6
fi

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

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


echo $ac_n "checking if you want debugging-trace""... $ac_c" 1>&6
echo "configure:3983: checking if you want debugging-trace" >&5

# Check whether --with-trace or --without-trace was given.
if test "${with_trace+set}" = set; then
  withval="$with_trace"
  echo "$ac_t""yes" 1>&6
	 cat >> confdefs.h <<\EOF
#define USE_TRACE 1
EOF

	 test $found_ncurses = no && EXTRAOBJS="$EXTRAOBJS trace.o"
else
  echo "$ac_t""no" 1>&6
fi



## options for miscellaneous definitions
echo $ac_n "checking for domain-name""... $ac_c" 1>&6
echo "configure:4002: checking for domain-name" >&5

# Check whether --with-domain-name or --without-domain-name was given.
if test "${with_domain_name+set}" = set; then
  withval="$with_domain_name"
  :
else
  withval="${DOMAIN_NAME}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-domain-name" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
DOMAIN_NAME="$withval"

if test "$DOMAIN_NAME" != ""; then
	cat >> confdefs.h <<EOF
#define DOMAIN_NAME "$DOMAIN_NAME"
EOF

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

if test "$USE_NNTP" = "yes" ; then
echo $ac_n "checking for NNTP default-server""... $ac_c" 1>&6
echo "configure:4031: checking for NNTP default-server" >&5

# Check whether --with-nntp-default-server or --without-nntp-default-server was given.
if test "${with_nntp_default_server+set}" = set; then
  withval="$with_nntp_default_server"
  :
else
  withval="${NNTP_DEFAULT_SERVER}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-nntp-default-server" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
NNTP_DEFAULT_SERVER="$withval"


    if test "$NNTP_DEFAULT_SERVER" = "" ; then
	if test "$DOMAIN_NAME" != "" ; then
		test -z "$NNTP_DEFAULT_SERVER" && case "$DOMAIN_NAME" in #(((
	 	/*)
			if test -r "$DOMAIN_NAME" ; then
				NNTP_DEFAULT_SERVER="news.`cat $DOMAIN_NAME`"
			else
				NNTP_DEFAULT_SERVER="news"
			fi
			;;
	 	*)
			NNTP_DEFAULT_SERVER="news.$DOMAIN_NAME"
			;;
	 	esac
	else
		NNTP_DEFAULT_SERVER="news"
	fi
    fi
echo "$ac_t""$NNTP_DEFAULT_SERVER" 1>&6
fi

## These options are interdependent, so we delay defining them til now:
test -n "$NNTP_DEFAULT_SERVER" \
	&& cat >> confdefs.h <<EOF
#define NNTP_DEFAULT_SERVER "$NNTP_DEFAULT_SERVER"
EOF

test ".$INEWSDIR" != ".$NEWSLIBDIR" && cat >> confdefs.h <<EOF
#define INEWSDIR "$INEWSDIR"
EOF

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

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

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


## optional features
echo $ac_n "checking whether to use MH style mail handling""... $ac_c" 1>&6
echo "configure:4097: checking whether to use MH style mail handling" >&5

# Check whether --enable-mh-mail-handling or --disable-mh-mail-handling was given.
if test "${enable_mh_mail_handling+set}" = set; then
  enableval="$enable_mh_mail_handling"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_MH_MAIL_HANDLING 1
EOF
 
  fi
else
  enableval=no   
fi

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

echo $ac_n "checking whether to enable 8-bit keycodes""... $ac_c" 1>&6
echo "configure:4116: checking whether to enable 8-bit keycodes" >&5

# Check whether --enable-8bit-keys or --disable-8bit-keys was given.
if test "${enable_8bit_keys+set}" = set; then
  enableval="$enable_8bit_keys"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    : 
  else
    cat >> confdefs.h <<\EOF
#define HAVE_KEY_PREFIX 1
EOF

  fi
else
  enableval=yes 
  cat >> confdefs.h <<\EOF
#define HAVE_KEY_PREFIX 1
EOF

  
fi

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

echo $ac_n "checking whether to enable ANSI-color""... $ac_c" 1>&6
echo "configure:4142: checking whether to enable ANSI-color" >&5

# Check whether --enable-color or --disable-color was given.
if test "${enable_color+set}" = set; then
  enableval="$enable_color"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    : 
  fi
else
  enableval=yes   
fi

use_color=$enableval
echo "$ac_t""$use_color" 1>&6

echo $ac_n "checking whether to enable posting-etiquette""... $ac_c" 1>&6
echo "configure:4159: checking whether to enable posting-etiquette" >&5

# Check whether --enable-etiquette or --disable-etiquette was given.
if test "${enable_etiquette+set}" = set; then
  enableval="$enable_etiquette"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define NO_ETIQUETTE 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to strictly observe RFC1522 and break long lines""... $ac_c" 1>&6
echo "configure:4178: checking whether to strictly observe RFC1522 and break long lines" >&5

# Check whether --enable-break-long-lines or --disable-break-long-lines was given.
if test "${enable_break_long_lines+set}" = set; then
  enableval="$enable_break_long_lines"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define MIME_BREAK_LONG_LINES 1
EOF
 
  fi
else
  enableval=no   
fi

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

echo $ac_n "checking whether to force MM_CHARSET obeyance when decoding mime""... $ac_c" 1>&6
echo "configure:4197: checking whether to force MM_CHARSET obeyance when decoding mime" >&5

# Check whether --enable-mime-strict-charset or --disable-mime-strict-charset was given.
if test "${enable_mime_strict_charset+set}" = set; then
  enableval="$enable_mime_strict_charset"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    : 
  else
    cat >> confdefs.h <<\EOF
#define MIME_STRICT_CHARSET 1
EOF

  fi
else
  enableval=yes 
  cat >> confdefs.h <<\EOF
#define MIME_STRICT_CHARSET 1
EOF

  
fi

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

echo $ac_n "checking for MIME character-set""... $ac_c" 1>&6
echo "configure:4223: checking for MIME character-set" >&5

# Check whether --with-mime-default-charset or --without-mime-default-charset was given.
if test "${with_mime_default_charset+set}" = set; then
  withval="$with_mime_default_charset"
  :
else
  withval="${MM_CHARSET-US-ASCII}"
fi
case "$withval" in #(vi
yes|no)
  { echo "configure: error: expected a value for --with-mime-default-charset" 1>&2; exit 1; }
  ;;
esac
MM_CHARSET="$withval"
cat >> confdefs.h <<EOF
#define MM_CHARSET "$MM_CHARSET"
EOF

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

echo $ac_n "checking for default ISO/ASCII table""... $ac_c" 1>&6
echo "configure:4245: checking for default ISO/ASCII table" >&5

# Check whether --with-iso-to-ascii or --without-iso-to-ascii was given.
if test "${with_iso_to_ascii+set}" = set; then
  withval="$with_iso_to_ascii"
  :
else
  withval="${DEFAULT_ISO2ASC--1}"
fi
case "$withval" in #(vi
yes|no)
  { echo "configure: error: expected a value for --with-iso-to-ascii" 1>&2; exit 1; }
  ;;
esac
DEFAULT_ISO2ASC="$withval"
cat >> confdefs.h <<EOF
#define DEFAULT_ISO2ASC "$DEFAULT_ISO2ASC"
EOF

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

echo $ac_n "checking whether to use character set conversion""... $ac_c" 1>&6
echo "configure:4267: checking whether to use character set conversion" >&5

# Check whether --with-local-charset or --without-local-charset was given.
if test "${with_local_charset+set}" = set; then
  withval="$with_local_charset"
  :
else
  withval="${LOCAL_CHARSET}"
fi
test -n "$withval" && \
case "$withval" in #(vi
yes)
  { echo "configure: error: expected a value for --with-local-charset" 1>&2; exit 1; }
  ;; #(vi
no) withval=""
  ;;
esac
LOCAL_CHARSET="$withval"

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

echo $ac_n "checking whether to enable locale support""... $ac_c" 1>&6
echo "configure:4289: checking whether to enable locale support" >&5

# Check whether --enable-locale or --disable-locale was given.
if test "${enable_locale+set}" = set; then
  enableval="$enable_locale"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define NO_LOCALE 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to enable posting""... $ac_c" 1>&6
echo "configure:4308: checking whether to enable posting" >&5

# Check whether --enable-posting or --disable-posting was given.
if test "${enable_posting+set}" = set; then
  enableval="$enable_posting"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define NO_POSTING 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to enable shell escape""... $ac_c" 1>&6
echo "configure:4327: checking whether to enable shell escape" >&5

# Check whether --enable-shell-escape or --disable-shell-escape was given.
if test "${enable_shell_escape+set}" = set; then
  enableval="$enable_shell_escape"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define NO_SHELL_ESCAPE 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to have fascist newsadmin""... $ac_c" 1>&6
echo "configure:4346: checking whether to have fascist newsadmin" >&5

# Check whether --enable-fascist-newsadmin or --disable-fascist-newsadmin was given.
if test "${enable_fascist_newsadmin+set}" = set; then
  enableval="$enable_fascist_newsadmin"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_FASCIST_NEWSADMIN 1
EOF
 
  fi
else
  enableval=no   
fi

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

echo $ac_n "checking whether to enable inverse video and highlighting""... $ac_c" 1>&6
echo "configure:4365: checking whether to enable inverse video and highlighting" >&5

# Check whether --enable-inverse-video or --disable-inverse-video was given.
if test "${enable_inverse_video+set}" = set; then
  enableval="$enable_inverse_video"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define USE_INVERSE_HACK 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to have MMDF type mailer as default""... $ac_c" 1>&6
echo "configure:4384: checking whether to have MMDF type mailer as default" >&5

# Check whether --enable-mmdf-mailer or --disable-mmdf-mailer was given.
if test "${enable_mmdf_mailer+set}" = set; then
  enableval="$enable_mmdf_mailer"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define HAVE_MMDF_MAILER 1
EOF
 
  fi
else
  enableval=no   
fi

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

echo $ac_n "checking whether to enable piping support""... $ac_c" 1>&6
echo "configure:4403: checking whether to enable piping support" >&5

# Check whether --enable-piping or --disable-piping was given.
if test "${enable_piping+set}" = set; then
  enableval="$enable_piping"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define DONT_HAVE_PIPING 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to enable printer support""... $ac_c" 1>&6
echo "configure:4422: checking whether to enable printer support" >&5

# Check whether --enable-printing or --disable-printing was given.
if test "${enable_printing+set}" = set; then
  enableval="$enable_printing"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    cat >> confdefs.h <<\EOF
#define DISABLE_PRINTING 1
EOF
 
  fi
else
  enableval=yes   
fi

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

echo $ac_n "checking whether to unique tmp-files by appending .pid""... $ac_c" 1>&6
echo "configure:4441: checking whether to unique tmp-files by appending .pid" >&5

# Check whether --enable-append-pid or --disable-append-pid was given.
if test "${enable_append_pid+set}" = set; then
  enableval="$enable_append_pid"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    : 
  else
    cat >> confdefs.h <<\EOF
#define APPEND_PID 1
EOF

  fi
else
  enableval=yes 
  cat >> confdefs.h <<\EOF
#define APPEND_PID 1
EOF

  
fi

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

echo $ac_n "checking whether to fallback to XHDR XREF if XOVER isn't supported""... $ac_c" 1>&6
echo "configure:4467: checking whether to fallback to XHDR XREF if XOVER isn't supported" >&5

# Check whether --enable-xhdr-xref or --disable-xhdr-xref was given.
if test "${enable_xhdr_xref+set}" = set; then
  enableval="$enable_xhdr_xref"
  test "$enableval" != no && enableval=yes
  if test "$enableval" != "yes" ; then
    : 
  else
    cat >> confdefs.h <<\EOF
#define XHDR_XREF 1
EOF

  fi
else
  enableval=yes 
  cat >> confdefs.h <<\EOF
#define XHDR_XREF 1
EOF

  
fi

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

### bypass a bug in old versions of leafnode & NNTPcache
echo $ac_n "checking whether to send a GROUP command before a LISTGROUP""... $ac_c" 1>&6
echo "configure:4494: checking whether to send a GROUP command before a LISTGROUP" >&5

# Check whether --enable-broken-listgroup-fix or --disable-broken-listgroup-fix was given.
if test "${enable_broken_listgroup_fix+set}" = set; then
  enableval="$enable_broken_listgroup_fix"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define BROKEN_LISTGROUP 1
EOF
 
  fi
else
  enableval=no   
fi

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

### checks for the location of the system-wide default setting file
echo $ac_n "checking for directory containing tin.defaults file""... $ac_c" 1>&6
echo "configure:4514: checking for directory containing tin.defaults file" >&5

# Check whether --with-defaults-dir or --without-defaults-dir was given.
if test "${with_defaults_dir+set}" = set; then
  withval="$with_defaults_dir"
  :
else
  withval="${TIN_DEFAULTS_DIR-/etc/tin}"
fi

case ".$withval" in #(vi
./*) #(vi
  ;;
.\${*prefix}*) #(vi
  eval withval="$withval"
  case ".$withval" in #(vi
  .NONE/*)
    withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
    ;;
  esac
  ;; #(vi
.NONE/*)
  withval=`echo $withval | sed -e s@NONE@$ac_default_prefix@`
  ;;
*)
  { echo "configure: error: expected a pathname" 1>&2; exit 1; }
  ;;
esac

eval TIN_DEFAULTS_DIR="$withval"

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


### checks for operator characteristics (should be the last option)
echo $ac_n "checking whether to make a coffee while compiling""... $ac_c" 1>&6
echo "configure:4553: checking whether to make a coffee while compiling" >&5

# Check whether --with-coffee or --without-coffee was given.
if test "${with_coffee+set}" = set; then
  withval="$with_coffee"
   case "$withval" in
	yes)
	echo "$ac_t""yes - with milk - please!" 1>&6
	cat >> confdefs.h <<\EOF
#define HAVE_COFFEE 1
EOF

	;;
	*)
	echo "$ac_t""no" 1>&6
	;;
	esac
else
  echo "$ac_t""no" 1>&6
fi


###	checks for compiler characteristics

echo $ac_n "checking for makeflags variable""... $ac_c" 1>&6
echo "configure:4578: checking for makeflags variable" >&5
if eval "test \"`echo '$''{'cf_cv_makeflags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_cv_makeflags=''
	for cf_option in '-$(MAKEFLAGS)' '$(MFLAGS)'
	do
		cat >cf_makeflags.tmp <<CF_EOF
all :
	@ echo '.$cf_option'
CF_EOF
		cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null`
		case "$cf_result" in
		.*k)
			cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
			case "$cf_result" in
			.*CC=*)	cf_cv_makeflags=
				;;
			*)	cf_cv_makeflags=$cf_option
				;;
			esac
			break
			;;
		*)	echo no match "$cf_result"
			;;
		esac
	done
	rm -f cf_makeflags.tmp
fi

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


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

int main() {

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

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

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

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

fi

echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:4695: 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 4702 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:4709: \"$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 ansi token expansion/substitution""... $ac_c" 1>&6
echo "configure:4736: checking for ansi token expansion/substitution" >&5
if eval "test \"`echo '$''{'cf_cv_cpp_expands'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 4742 "configure"
#include "confdefs.h"

#define string(n) #n
int main() {
char *s = string(token)
; return 0; }
EOF
if { (eval echo configure:4750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_cpp_expands=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_cpp_expands=no
fi
rm -f conftest*

fi

echo "$ac_t""$cf_cv_cpp_expands" 1>&6
test $cf_cv_cpp_expands = yes && cat >> confdefs.h <<\EOF
#define CPP_DOES_EXPAND 1
EOF



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

#define concat(a,b) a ## b
int main() {
char *firstlast = "y", *s = concat(first,last)
; return 0; }
EOF
if { (eval echo configure:4785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_cpp_concats=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_cpp_concats=no
fi
rm -f conftest*

fi

echo "$ac_t""$cf_cv_cpp_concats" 1>&6
test $cf_cv_cpp_concats = yes && cat >> confdefs.h <<\EOF
#define CPP_DOES_CONCAT 1
EOF



echo $ac_n "checking if nested parameters work""... $ac_c" 1>&6
echo "configure:4806: checking if nested parameters work" >&5
if eval "test \"`echo '$''{'cf_cv_nested_params'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 4812 "configure"
#include "confdefs.h"

int main() {
extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)
; return 0; }
EOF
if { (eval echo configure:4819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_nested_params=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_nested_params=no
fi
rm -f conftest*

fi

echo "$ac_t""$cf_cv_nested_params" 1>&6
test $cf_cv_nested_params = yes && cat >> confdefs.h <<\EOF
#define HAVE_NESTED_PARAMS 1
EOF



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

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

fi

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

#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef _MSC_VER
#  include <malloc.h>
#  define alloca _alloca
# else
#  if HAVE_ALLOCA_H
#   include <alloca.h>
#  else
#   ifdef _AIX
 #pragma alloca
#   else
#    ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
#    endif
#   endif
#  endif
# endif
#endif

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

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

fi

if test $ac_cv_func_alloca_works = no; 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 C_ALLOCA 1
EOF


echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
echo "configure:4943: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4948 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif

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

fi

echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4973: 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 4978 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

; return 0; }
EOF
if { (eval echo configure:5001: \"$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
  cat >> confdefs.h <<EOF
#define CRAY_STACKSEG_END $ac_func
EOF

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

done
fi

echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
echo "configure:5028: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_c_stack_direction=0
else
  cat > conftest.$ac_ext <<EOF
#line 5036 "configure"
#include "confdefs.h"
find_stack_direction ()
{
  static char *addr = 0;
  auto char dummy;
  if (addr == 0)
    {
      addr = &dummy;
      return find_stack_direction ();
    }
  else
    return (&dummy > addr) ? 1 : -1;
}
main ()
{
  exit (find_stack_direction() < 0);
}
EOF
if { (eval echo configure:5055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_c_stack_direction=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_c_stack_direction=-1
fi
rm -fr conftest*
fi

fi

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

fi

	;;
*)
	ALLOCA=""
	
	;;
esac

###	Checks for header files.
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:5085: 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 5090 "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:5098: \"$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 5115 "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 5133 "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 5154 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

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

fi
fi

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

fi

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:5193: 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 5198 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:5206: \"$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_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 ac_header_dirent=$ac_hdr; break
else
  echo "$ac_t""no" 1>&6
fi
done
# 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:5231: 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 5239 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

int main() {
opendir()
; return 0; }
EOF
if { (eval echo configure:5250: \"$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:5272: 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 5280 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char opendir();

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

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

fi

echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
echo "configure:5349: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5354 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
int main() {
int s;
wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
if { (eval echo configure:5370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_sys_wait_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi

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

fi

for ac_hdr in \
	arpa/inet.h \
	curses.h \
	errno.h \
	fcntl.h \
	getopt.h \
	ioctl.h \
	libc.h \
	locale.h \
	malloc.h \
	netdb.h \
	netinet/in.h \
	netlib.h \
	nomacros.h \
	poll.h \
	prototypes.h \
	pwd.h \
	sgtty.h \
	stddef.h \
	stdlib.h \
	string.h \
	strings.h \
	stropts.h \
	sys/bsdtypes.h \
	sys/ioctl.h \
	sys/param.h \
	sys/ptem.h \
	sys/pty.h \
	sys/select.h \
	sys/stream.h \
	sys/socket.h \
	sys/time.h \
	sys/timeb.h \
	sys/times.h \
	sys/utsname.h \
	term.h \
	termio.h \
	time.h \
	unistd.h \
	waitstatus.h \

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


###	Checks that depend on existence-checks for headers

echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
echo "configure:5474: checking declaration of size-change" >&5
if eval "test \"`echo '$''{'cf_cv_sizechange'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cf_cv_sizechange=unknown
    cf_save_CFLAGS="$CFLAGS"

for cf_opts in "" "NEED_PTEM_H"
do

    CFLAGS="$cf_save_CFLAGS"
    test -n "$cf_opts" && CFLAGS="$CFLAGS -D$cf_opts"
    cat > conftest.$ac_ext <<EOF
#line 5488 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if HAVE_TERMIOS_H
#include <termios.h>
#else
#if HAVE_TERMIO_H
#include <termio.h>
#endif
#endif
#if NEED_PTEM_H
/* This is a workaround for SCO:  they neglected to define struct winsize in
 * termios.h -- it's only in termio.h and ptem.h
 */
#include        <sys/stream.h>
#include        <sys/ptem.h>
#endif
#if !defined(sun) || !defined(HAVE_TERMIOS_H)
#include <sys/ioctl.h>
#endif

int main() {

#ifdef TIOCGSIZE
	struct ttysize win;	/* FIXME: what system is this? */
	int y = win.ts_lines;
	int x = win.ts_cols;
#else
#ifdef TIOCGWINSZ
	struct winsize win;
	int y = win.ws_row;
	int x = win.ws_col;
#else
	no TIOCGSIZE or TIOCGWINSZ
#endif /* TIOCGWINSZ */
#endif /* TIOCGSIZE */
	
; return 0; }
EOF
if { (eval echo configure:5527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_sizechange=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_sizechange=no
fi
rm -f conftest*

	CFLAGS="$cf_save_CFLAGS"
	if test "$cf_cv_sizechange" = yes ; then
		echo "size-change succeeded ($cf_opts)" >&5
		test -n "$cf_opts" && cat >> confdefs.h <<EOF
#define $cf_opts 1
EOF

		break
	fi
done
	
fi

echo "$ac_t""$cf_cv_sizechange" 1>&6
test $cf_cv_sizechange != no && cat >> confdefs.h <<\EOF
#define HAVE_SIZECHANGE 1
EOF



echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6
echo "configure:5559: checking if sys/time.h conflicts with sys/select.h" >&5
if eval "test \"`echo '$''{'cf_cv_sys_select_timeval'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
for cf_opts in no yes
do
cat > conftest.$ac_ext <<EOF
#line 5567 "configure"
#include "confdefs.h"

#define yes 1
#define no 0
#if $cf_opts
#define timeval fake_timeval
#endif
#include <sys/types.h>
#ifdef TIME_WITH_SYS_TIME
#	include <sys/time.h>
#	include <time.h>
#else
#	ifdef HAVE_SYS_TIME_H
#		include <sys/time.h>
#	else
#		include <time.h>
#	endif
#endif
#undef timeval
#ifdef HAVE_SYS_SELECT_H
#	include <sys/select.h>
#endif

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

fi

echo "$ac_t""$cf_cv_sys_select_timeval" 1>&6
test $cf_cv_sys_select_timeval = yes && cat >> confdefs.h <<\EOF
#define NEED_TIMEVAL_FIX 1
EOF



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

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

fi

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

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

fi

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

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

fi

echo $ac_n "checking for pid_t""... $ac_c" 1>&6
echo "configure:5718: 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 5723 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])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

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

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

fi

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

fi

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

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

fi

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

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

fi


###	Checks for libraries.
# libuu/uudeview
# only define HAVE_LIBUU and HAVE_UUDEVIEW_H if both are found
echo $ac_n "checking for UUInitialize in -luu""... $ac_c" 1>&6
echo "configure:5855: checking for UUInitialize in -luu" >&5
ac_lib_var=`echo uu'_'UUInitialize | 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="-luu  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5863 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char UUInitialize();

int main() {
UUInitialize()
; return 0; }
EOF
if { (eval echo configure:5874: \"$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_safe=`echo "uudeview.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for uudeview.h""... $ac_c" 1>&6
echo "configure:5891: checking for uudeview.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 5896 "configure"
#include "confdefs.h"
#include <uudeview.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5901: \"$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_LIBUU 1
EOF

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

		LIBS="$LIBS -luu"
	
else
  echo "$ac_t""no" 1>&6
fi


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


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

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_initscr) || defined (__stub___initscr)
choke me
#else
initscr();
#endif

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

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

case $host_os in #(vi
freebsd*) #(vi
	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:5990: checking for tgoto in -lmytinfo" >&5
ac_lib_var=`echo mytinfo'_'tgoto | 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="-lmytinfo  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 5998 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgoto();

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

	;;
hpux10.*)
	echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
echo "configure:6032: checking for initscr in -lcur_colr" >&5
ac_lib_var=`echo cur_colr'_'initscr | 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="-lcur_colr  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6040 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6051: \"$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="-lcur_colr $LIBS"
		CFLAGS="-I/usr/include/curses_colr $CFLAGS"
		ac_cv_func_initscr=yes
		
else
  echo "$ac_t""no" 1>&6

	echo $ac_n "checking for initscr in -lHcurses""... $ac_c" 1>&6
echo "configure:6075: checking for initscr in -lHcurses" >&5
ac_lib_var=`echo Hcurses'_'initscr | 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="-lHcurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6083 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6094: \"$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
  
		# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
		LIBS="-lHcurses $LIBS"
		CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
		ac_cv_func_initscr=yes
		
else
  echo "$ac_t""no" 1>&6
fi

fi

	;;
linux*) # Suse Linux does not follow /usr/lib convention
	LIBS="$LIBS -L/lib"
	;;
esac

if test ".$With5lib" != ".no" ; then
if test -d /usr/5lib ; then
	# SunOS 3.x or 4.x
	CPPFLAGS="$CPPFLAGS -I/usr/5include"
	LIBS="$LIBS -L/usr/5lib"
fi
fi

if test ".$ac_cv_func_initscr" != .yes ; then
	cf_save_LIBS="$LIBS"
	cf_term_lib=""
	cf_curs_lib=""

	# Check for library containing tgoto.  Do this before curses library
	# because it may be needed to link the test-case for initscr.
	echo $ac_n "checking for tgoto""... $ac_c" 1>&6
echo "configure:6143: checking for tgoto" >&5
if eval "test \"`echo '$''{'ac_cv_func_tgoto'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6148 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char tgoto(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgoto();

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_tgoto) || defined (__stub___tgoto)
choke me
#else
tgoto();
#endif

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

if eval "test \"`echo '$ac_cv_func_'tgoto`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cf_term_lib=predefined
else
  echo "$ac_t""no" 1>&6

		for cf_term_lib in termcap termlib unknown
		do
			echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
echo "configure:6192: checking for tgoto in -l$cf_term_lib" >&5
ac_lib_var=`echo $cf_term_lib'_'tgoto | 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="-l$cf_term_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6200 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgoto();

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

		done
	
fi


	# Check for library containing initscr
	test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
	for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
	do
		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
echo "configure:6241: checking for initscr in -l$cf_curs_lib" >&5
ac_lib_var=`echo $cf_curs_lib'_'initscr | 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="-l$cf_curs_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6249 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

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

	done
	test $cf_curs_lib = unknown && { echo "configure: error: no curses library found" 1>&2; exit 1; }

	LIBS="-l$cf_curs_lib $cf_save_LIBS"
	if test "$cf_term_lib" = unknown ; then
		echo $ac_n "checking if we can link with $cf_curs_lib library""... $ac_c" 1>&6
echo "configure:6286: checking if we can link with $cf_curs_lib library" >&5
		cat > conftest.$ac_ext <<EOF
#line 6288 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_result=no
fi
rm -f conftest*
		echo "$ac_t""$cf_result" 1>&6
		test $cf_result = no && { echo "configure: error: Cannot link curses library" 1>&2; exit 1; }
	elif test "$cf_term_lib" != predefined ; then
		echo $ac_n "checking if we need both $cf_curs_lib and $cf_term_lib libraries""... $ac_c" 1>&6
echo "configure:6309: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
		cat > conftest.$ac_ext <<EOF
#line 6311 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr(); tgoto((char *)0, 0, 0);
; return 0; }
EOF
if { (eval echo configure:6318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_result=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
			cat > conftest.$ac_ext <<EOF
#line 6328 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_result=error
fi
rm -f conftest*
			
fi
rm -f conftest*
		echo "$ac_t""$cf_result" 1>&6
	fi
fi


fi

	fi
	cf_cv_termlib=curses
else
	
if eval "test \"`echo '$''{'cf_cv_termlib'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_termlib=none
cat > conftest.$ac_ext <<EOF
#line 6365 "configure"
#include "confdefs.h"

int main() {
char *x=(char*)tgoto("",0,0)
; return 0; }
EOF
if { (eval echo configure:6372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 6375 "configure"
#include "confdefs.h"

int main() {
int x=tigetstr("")
; 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*
  cf_cv_termlib=terminfo
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_termlib=termcap
fi
rm -f conftest*
	test -n "$verbose" && echo "	using functions in predefined $cf_cv_termlib LIBS" 1>&6


else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  

if test "$cf_cv_termlib" = none; then
	# FreeBSD's linker gives bogus results for AC_CHECK_LIB, saying that
	# tgetstr lives in -lcurses when it is only an unsatisfied extern.
	cf_save_LIBS="$LIBS"
	for cf_lib in curses ncurses termlib termcap
	do
	LIBS="-l$cf_lib $cf_save_LIBS"
	for cf_func in tigetstr tgetstr
	do
		echo $ac_n "checking for $cf_func in -l$cf_lib""... $ac_c" 1>&6
echo "configure:6411: checking for $cf_func in -l$cf_lib" >&5
		cat > conftest.$ac_ext <<EOF
#line 6413 "configure"
#include "confdefs.h"

int main() {
int x=$cf_func("")
; return 0; }
EOF
if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_result=no
fi
rm -f conftest*
		echo "$ac_t""$cf_result" 1>&6
		if test "$cf_result" = yes ; then
			if test "$cf_func" = tigetstr ; then
				cf_cv_termlib=terminfo
			else
				cf_cv_termlib=termcap
			fi
			break
		fi
	done
		test "$cf_result" = yes && break
	done
	test "$cf_result" = no && LIBS="$cf_save_LIBS"
fi
if test "$cf_cv_termlib" = none; then
	# allow curses library for broken AIX system.
	echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
echo "configure:6447: checking for initscr in -lcurses" >&5
ac_lib_var=`echo curses'_'initscr | 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="-lcurses  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6455 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char initscr();

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

	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
echo "configure:6487: checking for tgoto in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgoto | 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 6495 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char tgoto();

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

fi

fi
rm -f conftest*
if test "$cf_cv_termlib" = none; then
	{ echo "configure: error: Can't find -ltermlib, -lcurses, or -ltermcap" 1>&2; exit 1; }
fi

fi

	# terminfo-based termcap interfaces may be prototyped in <curses.h>,
	# which may/may not be compatible with <termcap.h>
	echo $ac_n "checking if we should include termcap.h""... $ac_c" 1>&6
echo "configure:6539: checking if we should include termcap.h" >&5
	cf_save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -I$srcdir/include"
	cat > conftest.$ac_ext <<EOF
#line 6543 "configure"
#include "confdefs.h"

#define HAVE_TERMCAP_H 1
#include <tcurses.h>
int main() {

#ifdef NCURSES_VERSION
make an error
#endif

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

fi

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

#include <curses.h>
#include <term.h>
int main() {
WINDOW *x
; return 0; }
EOF
if { (eval echo configure:6590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_have_term_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_have_term_h=no
fi
rm -f conftest*
	
fi

echo "$ac_t""$cf_cv_have_term_h" 1>&6
test $cf_cv_have_term_h = yes && cat >> confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF




echo $ac_n "checking if we should include curses.h or termcap.h""... $ac_c" 1>&6
echo "configure:6612: checking if we should include curses.h or termcap.h" >&5
if eval "test \"`echo '$''{'cf_cv_need_curses_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_save_CFLAGS="$CFLAGS"
cf_cv_need_curses_h=no

for cf_t_opts in "" "NEED_TERMCAP_H"
do
for cf_c_opts in "" "NEED_CURSES_H"
do

    CFLAGS="$cf_save_CFLAGS $CHECK_DECL_FLAG"
    test -n "$cf_c_opts" && CFLAGS="$CFLAGS -D$cf_c_opts"
    test -n "$cf_t_opts" && CFLAGS="$CFLAGS -D$cf_t_opts"

    cat > conftest.$ac_ext <<EOF
#line 6630 "configure"
#include "confdefs.h"
/* $cf_c_opts $cf_t_opts */
$CHECK_DECL_HDRS
int main() {
char *x = (char *)tgoto("")
; return 0; }
EOF
if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  test "$cf_cv_need_curses_h" = no && {
	     cf_cv_need_curses_h=maybe
	     cf_ok_c_opts=$cf_c_opts
	     cf_ok_t_opts=$cf_t_opts
	}
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&5
	cat > conftest.$ac_ext <<EOF
#line 6651 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS
int main() {
char *x = (char *)tgoto("",0,0)
; return 0; }
EOF
if { (eval echo configure:6659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_need_curses_h=yes
	 cf_ok_c_opts=$cf_c_opts
	 cf_ok_t_opts=$cf_t_opts
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
fi
rm -f conftest*

	CFLAGS="$cf_save_CFLAGS"
	test "$cf_cv_need_curses_h" = yes && break
done
	test "$cf_cv_need_curses_h" = yes && break
done

if test "$cf_cv_need_curses_h" != no ; then
	echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T:$cf_ok_t_opts)" >&5
	if test -n "$cf_ok_c_opts" ; then
		if test -n "$cf_ok_t_opts" ; then
			cf_cv_need_curses_h=both
		else
			cf_cv_need_curses_h=curses.h
		fi
	elif test -n "$cf_ok_t_opts" ; then
		cf_cv_need_curses_h=termcap.h
	elif test "$cf_cv_have_term_h" = yes ; then
		cf_cv_need_curses_h=term.h
	else
		cf_cv_need_curses_h=no
	fi
fi

fi

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

case $cf_cv_need_curses_h in
both) #(vi
	cat >> confdefs.h <<EOF
#define NEED_CURSES_H 1
EOF

	cat >> confdefs.h <<EOF
#define NEED_TERMCAP_H 1
EOF

	;;
curses.h) #(vi
	cat >> confdefs.h <<EOF
#define NEED_CURSES_H 1
EOF

	;;
termcap.h) #(vi
	cat >> confdefs.h <<EOF
#define NEED_TERMCAP_H 1
EOF

	;;
esac





echo $ac_n "checking declaration of tputs 3rd param""... $ac_c" 1>&6
echo "configure:6729: checking declaration of tputs 3rd param" >&5
if eval "test \"`echo '$''{'cf_cv_type_outchar'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

cf_cv_type_outchar="int OutChar(int)"
cf_cv_found=no
cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"

for P in int void; do
for Q in int void; do
for R in int char; do
for S in "" const; do

	cat > conftest.$ac_ext <<EOF
#line 6746 "configure"
#include "confdefs.h"
$CHECK_DECL_HDRS
int main() {
extern $Q OutChar($R);
	extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
	tputs("", 1, OutChar)
; return 0; }
EOF
if { (eval echo configure:6755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_type_outchar="$Q OutChar($R)"
	 cf_cv_found=yes
	 break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
	test $cf_cv_found = yes && break
done
	test $cf_cv_found = yes && break
done
	test $cf_cv_found = yes && break
done
	
fi

echo "$ac_t""$cf_cv_type_outchar" 1>&6
case $cf_cv_type_outchar in
int*)
	cat >> confdefs.h <<\EOF
#define OUTC_RETURN 1
EOF

	;;
esac
case $cf_cv_type_outchar in
*char*)
	cat >> confdefs.h <<\EOF
#define OUTC_ARGS char c
EOF

	;;
esac

CFLAGS="$cf_save_CFLAGS"


cf_tc_externs="tgoto tgetstr tputs tgetent tgetflag"
if test ".$cf_cv_termlib" = .terminfo ; then
	cat >> confdefs.h <<\EOF
#define USE_TERMINFO 1
EOF

	cf_tc_externs="$cf_tc_externs tigetnum"
elif test ".$cf_cv_termlib" = .termcap ; then
	cf_tc_externs="$cf_tc_externs tgetnum"
else
	cf_tc_externs=""
fi

###	Checks for external-data


echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6
echo "configure:6813: checking if external errno is declared" >&5
if eval "test \"`echo '$''{'cf_cv_dcl_errno'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 6819 "configure"
#include "confdefs.h"

#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> 
int main() {
long x = (long) errno
; return 0; }
EOF
if { (eval echo configure:6832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval 'cf_cv_dcl_'errno'=yes'
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_dcl_'errno'=no'
fi
rm -f conftest*

fi


eval 'cf_result=$cf_cv_dcl_'errno
echo "$ac_t""$cf_result" 1>&6

if test "$cf_result" = no ; then
    eval 'cf_result=DECL_'errno
    
cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`

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

fi

# It's possible (for near-UNIX clones) that the data doesn't exist

echo $ac_n "checking if external errno exists""... $ac_c" 1>&6
echo "configure:6863: checking if external errno exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_errno'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 6869 "configure"
#include "confdefs.h"

#undef errno
extern int errno;

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


eval 'cf_result=$cf_cv_have_'errno
echo "$ac_t""$cf_result" 1>&6

if test "$cf_result" = yes ; then
    eval 'cf_result=HAVE_'errno
    
cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`

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

fi





for cf_name in sys_nerr sys_errlist
do
    
echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6
echo "configure:6914: checking if external $cf_name is declared" >&5
if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 6920 "configure"
#include "confdefs.h"

#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> 
int main() {
long x = (long) $cf_name
; return 0; }
EOF
if { (eval echo configure:6933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  eval 'cf_cv_dcl_'$cf_name'=yes'
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_dcl_'$cf_name'=no'
fi
rm -f conftest*

fi


eval 'cf_result=$cf_cv_dcl_'$cf_name
echo "$ac_t""$cf_result" 1>&6

if test "$cf_result" = no ; then
    eval 'cf_result=DECL_'$cf_name
    
cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`

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

fi

# It's possible (for near-UNIX clones) that the data doesn't exist

echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6
echo "configure:6964: checking if external $cf_name exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 6970 "configure"
#include "confdefs.h"

#undef $cf_name
extern int $cf_name;

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


eval 'cf_result=$cf_cv_have_'$cf_name
echo "$ac_t""$cf_result" 1>&6

if test "$cf_result" = yes ; then
    eval 'cf_result=HAVE_'$cf_name
    
cf_result=`echo $cf_result | tr '[a-z]' '[A-Z]'`

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

fi



done


###	Checks for library functions.
for ac_func in \
	atoi \
	atol \
	bcopy \
	ftime \
	fdopen \
	ftime \
	getcwd \
	inet_aton \
	is_xterm \
	isascii \
	link \
	memcmp \
	memcpy \
	memmove \
	memset \
	mkdir \
	mktemp \
	mkstemp \
	poll \
	putenv \
	rewinddir \
	resizeterm \
	select \
	setegid \
	seteuid \
	setgid \
	setlocale \
	setpgrp \
	setregid \
	setreuid \
	setuid \
	sigaction \
	strchr \
	strcasecmp \
	strerror \
	strftime \
	strpbrk \
	strstr \
	strtol \
	tempnam \
	tmpnam \
	tzset \
	uname \
	unlink \
	use_default_colors \
	usleep \

do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7063: 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 7068 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

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

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

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



echo $ac_n "checking declaration of signal arguments""... $ac_c" 1>&6
echo "configure:7159: checking declaration of signal arguments" >&5
if eval "test \"`echo '$''{'cf_cv_sig_args'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_sig_args=
for cf_test in "int sig" "int sig, ..."
do
	cat > conftest.$ac_ext <<EOF
#line 7168 "configure"
#include "confdefs.h"

#include <signal.h>
int main() {
extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)
; return 0; }
EOF
if { (eval echo configure:7176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_sig_args="$cf_test";break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done

fi

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







if test "$ac_cv_func_sigaction" = yes; then

echo $ac_n "checking whether sigaction needs _POSIX_SOURCE""... $ac_c" 1>&6
echo "configure:7202: checking whether sigaction needs _POSIX_SOURCE" >&5
if eval "test \"`echo '$''{'cf_cv_sigact_bad'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 7208 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <signal.h>
int main() {
struct sigaction act
; return 0; }
EOF
if { (eval echo configure:7217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_sigact_bad=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_sigact_bad=yes cat >> confdefs.h <<\EOF
#define SVR4_ACTION 1
EOF

fi
rm -f conftest*

fi

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

test "$cf_cv_sigact_bad" = yes && cat >> confdefs.h <<\EOF
#define SVR4_ACTION 1
EOF


echo $ac_n "checking if we have sigaction/related functions""... $ac_c" 1>&6
echo "configure:7241: checking if we have sigaction/related functions" >&5
if eval "test \"`echo '$''{'cf_cv_sigaction_funcs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 7247 "configure"
#include "confdefs.h"

#ifdef SVR4_ACTION
#define _POSIX_SOURCE
#endif
#include <sys/types.h>
#include <signal.h>
int main() {

    RETSIGTYPE (*func)(SIG_ARGS) = SIG_IGN;
    struct sigaction sa, osa;
    sa.sa_handler = func;
    sa.sa_flags = 0;
    sigemptyset (&sa.sa_mask);
    sigaction (SIGBUS,&sa,&osa);
; return 0; }
EOF
if { (eval echo configure:7265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_sigaction_funcs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_sigaction_funcs=no
fi
rm -f conftest*
fi

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

test "$cf_cv_sigaction_funcs" = yes && cat >> confdefs.h <<\EOF
#define HAVE_POSIX_JC 1
EOF


fi

echo $ac_n "checking for fork""... $ac_c" 1>&6
echo "configure:7287: checking for fork" >&5
if eval "test \"`echo '$''{'cf_cv_func_fork'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test "$cross_compiling" = yes; then
  cf_cv_func_fork=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 7296 "configure"
#include "confdefs.h"

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


fi
echo "$ac_t""$cf_cv_func_fork" 1>&6
test $cf_cv_func_fork = yes && cat >> confdefs.h <<\EOF
#define HAVE_FORK 1
EOF



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

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_memmove) || defined (__stub___memmove)
choke me
#else
memmove();
#endif

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

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

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

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_bcopy) || defined (__stub___bcopy)
choke me
#else
bcopy();
#endif

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

if eval "test \"`echo '$ac_cv_func_'bcopy`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
	echo $ac_n "checking if bcopy does overlapping moves""... $ac_c" 1>&6
echo "configure:7419: checking if bcopy does overlapping moves" >&5
if eval "test \"`echo '$''{'cf_cv_good_bcopy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
		if test "$cross_compiling" = yes; then
  cf_cv_good_bcopy=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 7428 "configure"
#include "confdefs.h"

int main() {
	static char data[] = "abcdefghijklmnopqrstuwwxyz";
	char temp[40];
	bcopy(data, temp, sizeof(data));
	bcopy(temp+10, temp, 15);
	bcopy(temp+5, temp+15, 10);
	exit (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
}
		
EOF
if { (eval echo configure:7441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_good_bcopy=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_cv_good_bcopy=no
fi
rm -fr conftest*
fi

		
fi

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

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

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

	fi

fi


echo $ac_n "checking if select expects int * arguments""... $ac_c" 1>&6
echo "configure:7479: checking if select expects int * arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 7481 "configure"
#include "confdefs.h"
#include <time.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "select\(.*, *int *\*," >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_SELECT_INTP 1
EOF
 echo "$ac_t""yes" 1>&6
else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*


echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
echo "configure:7500: checking whether closedir returns void" >&5
if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_closedir_void=yes
else
  cat > conftest.$ac_ext <<EOF
#line 7508 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
if { (eval echo configure:7514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_closedir_void=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_closedir_void=yes
fi
rm -fr conftest*
fi

fi

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

fi

echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
echo "configure:7537: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 7545 "configure"
#include "confdefs.h"

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

/*
 * If this system has a BSD-style setpgrp, which takes arguments, exit
 * successfully.
 */
main()
{
    if (setpgrp(1,1) == -1)
	exit(0);
    else
	exit(1);
}

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


fi

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

fi

echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
echo "configure:7589: checking whether setvbuf arguments are reversed" >&5
if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 7597 "configure"
#include "confdefs.h"
#include <stdio.h>
/* If setvbuf has the reversed format, exit 0. */
main () {
  /* This call has the arguments reversed.
     A reversed system may check and see that the address of main
     is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
  if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
    exit(1);
  putc('\r', stdout);
  exit(0);			/* Non-reversed systems segv here.  */
}
EOF
if { (eval echo configure:7611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_setvbuf_reversed=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_setvbuf_reversed=no
fi
rm -fr conftest*
fi

rm -f core core.* *.core
fi

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

fi


###	Checks for network library functions.
for ac_func in \
	gai_strerror \
	getaddrinfo \
	gethostbyname \
	getservbyname \
	inet_addr \
	inet_ntoa \
	strncasecmp \

do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7647: 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 7652 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

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

; return 0; }
EOF
if { (eval echo configure:7675: \"$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 setuid-like functions""... $ac_c" 1>&6
echo "configure:7702: checking for setuid-like functions" >&5
if eval "test \"`echo '$''{'cf_cv_setuid_funcs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
if test -n "${ac_cv_func_setuid}${ac_cv_func_seteuid}${ac_cv_func_setreuid}"; then
	cf_cv_setuid_funcs=yes
else
	cf_cv_setuid_funcs=no
fi

fi

echo "$ac_t""$cf_cv_setuid_funcs" 1>&6
test $cf_cv_setuid_funcs = yes && cat >> confdefs.h <<\EOF
#define HAVE_SET_GID_UID 1
EOF



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

#include <signal.h>
int main() {
sigaction_t x
; return 0; }
EOF
if { (eval echo configure:7737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_type_sigaction=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_type_sigaction=no
fi
rm -f conftest*
fi

echo "$ac_t""$cf_cv_type_sigaction" 1>&6
test $cf_cv_type_sigaction = yes && cat >> confdefs.h <<\EOF
#define HAVE_TYPE_SIGACTION 1
EOF



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

#ifdef HAVE_IOCTL_H
#	include <ioctl.h>
#else
#	ifdef HAVE_SYS_IOCTL_H
#		include <sys/ioctl.h>
#	endif
#endif

#if !defined(sun) || !defined(NL0)
#include <termios.h>
#endif

int main() {

	struct termios save_tty;
	(void) tcsetattr (0, TCSANOW, &save_tty);
	(void) tcgetattr (0, &save_tty)
; return 0; }
EOF
if { (eval echo configure:7785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_use_termios_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_use_termios_h=no
fi
rm -f conftest*

fi

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

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

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

fi


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

#ifdef TIME_WITH_SYS_TIME
#	include <sys/time.h>
#	include <time.h>
#else
#	ifdef HAVE_SYS_TIME_H
#		include <sys/time.h>
#	else
#		include <time.h>
#	endif
#endif

int main() {

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

echo "$ac_t""$cf_cv_tm_gmtoff" 1>&6
test $cf_cv_tm_gmtoff = no && cat >> confdefs.h <<\EOF
#define DONT_HAVE_TM_GMTOFF 1
EOF



echo $ac_n "checking for long file names""... $ac_c" 1>&6
echo "configure:7862: checking for long file names" >&5
if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_cv_sys_long_file_names=yes
# Test for long file names in all the places we know might matter:
#      .		the current directory, where building will happen
#      $prefix/lib	where we will be installing things
#      $exec_prefix/lib	likewise
# eval it to expand exec_prefix.
#      $TMPDIR		if set, where it might want to write temporary files
# if $TMPDIR is not set:
#      /tmp		where it might want to write temporary files
#      /var/tmp		likewise
#      /usr/tmp		likewise
if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
  ac_tmpdirs="$TMPDIR"
else
  ac_tmpdirs='/tmp /var/tmp /usr/tmp'
fi
for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
  test -d $ac_dir || continue
  test -w $ac_dir || continue # It is less confusing to not echo anything here.
  (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
  (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
  val=`cat $ac_dir/conftest9012345 2>/dev/null`
  if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
    ac_cv_sys_long_file_names=no
    rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
    break
  fi
  rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
done
fi

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

fi


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

cf_wait_headers="#include <sys/types.h>
"
if test $ac_cv_header_sys_wait_h = yes; then
cf_wait_headers="$cf_wait_headers
#include <sys/wait.h>
"
else
for ac_hdr in wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7957: 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 7962 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7967: \"$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 waitstatus.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7997: 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 8002 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8007: \"$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_wait_h = yes; then
cf_wait_headers="$cf_wait_headers
#include <wait.h>
"
fi
if test $ac_cv_header_waitstatus_h = yes; then
cf_wait_headers="$cf_wait_headers
#include <waitstatus.h>
"
fi
fi



echo $ac_n "checking for union wait""... $ac_c" 1>&6
echo "configure:8048: checking for union wait" >&5
if eval "test \"`echo '$''{'cf_cv_type_unionwait'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 8054 "configure"
#include "confdefs.h"
$cf_wait_headers
int main() {
int x;
	 int y = WEXITSTATUS(x);
	 int z = WTERMSIG(x);
	 wait(&x);
	
; return 0; }
EOF
if { (eval echo configure:8065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_type_unionwait=no
	 echo compiles ok w/o union wait 1>&5
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cat > conftest.$ac_ext <<EOF
#line 8076 "configure"
#include "confdefs.h"
$cf_wait_headers
int main() {
union wait x;
#ifdef WEXITSTATUS
	 int y = WEXITSTATUS(x);
#endif
#ifdef WTERMSIG
	 int z = WTERMSIG(x);
#endif
	 wait(&x);
	
; return 0; }
EOF
if { (eval echo configure:8091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_type_unionwait=yes
	 echo compiles ok with union wait and possibly macros too 1>&5
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_type_unionwait=no
fi
rm -f conftest*
fi
rm -f conftest*
fi

echo "$ac_t""$cf_cv_type_unionwait" 1>&6
test $cf_cv_type_unionwait = yes && cat >> confdefs.h <<\EOF
#define HAVE_TYPE_UNIONWAIT 1
EOF




echo $ac_n "checking if the system function returns usable child-status""... $ac_c" 1>&6
echo "configure:8116: checking if the system function returns usable child-status" >&5
if eval "test \"`echo '$''{'cf_cv_system_status'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	if test "$cross_compiling" = yes; then
  cf_cv_system_status=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 8125 "configure"
#include "confdefs.h"

#include <stdio.h>
#include <signal.h>
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif

RETSIGTYPE signal_handler (int sig)
{
#if HAVE_TYPE_UNIONWAIT
	union wait wait_status;
#else
	int wait_status = 1;
#endif
	int system_status;
	wait (&wait_status);
	system_status = WEXITSTATUS(wait_status); /* should be nonzero */
	exit(system_status != 23);
}

int main()
{
	/* this looks weird, but apparently the SIGCHLD gets there first on
	 * machines where 'system()' doesn't return a usable code, so ...
	 */
	signal (SIGCHLD, signal_handler);
	system("exit 23");
	exit(1);
}

EOF
if { (eval echo configure:8158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_system_status=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  if test "$cross_compiling" = yes; then
  cf_cv_system_status=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 8169 "configure"
#include "confdefs.h"
int main() { exit(system("exit 23") != (23 << 8)); }
EOF
if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_system_status=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_cv_system_status=unknown
fi
rm -fr conftest*
fi

fi
rm -fr conftest*
fi


fi

echo "$ac_t""$cf_cv_system_status" 1>&6
test $cf_cv_system_status = no && cat >> confdefs.h <<\EOF
#define USE_SYSTEM_STATUS 1
EOF



# Check if we are trying to use curses+color, but cannot
if test $use_color = yes ; then
	if test $use_curses = yes ; then
	 	

if test "$cf_cv_ncurses_version" != no ; then
echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
echo "configure:8206: checking for obsolete/broken version of ncurses" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_broken'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8212 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>
int main() {

#if defined(NCURSES_VERSION) && defined(wgetbkgd)
	make an error
#else
	int x = 1
#endif

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

fi

echo "$ac_t""$cf_cv_ncurses_broken" 1>&6
if test "$cf_cv_ncurses_broken" = yes ; then
	echo "configure: warning: hmm... you should get an up-to-date version of ncurses" 1>&2
	cat >> confdefs.h <<\EOF
#define NCURSES_BROKEN 1
EOF

fi
fi

		
echo $ac_n "checking if curses supports color attributes""... $ac_c" 1>&6
echo "configure:8251: checking if curses supports color attributes" >&5
if eval "test \"`echo '$''{'cf_cv_color_curses'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 8257 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>

int main() {
chtype x = COLOR_BLUE;
	 has_colors();
	 start_color();
#ifndef NCURSES_BROKEN
	 wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
#endif
	
; return 0; }
EOF
if { (eval echo configure:8272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_color_curses=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_color_curses=no
fi
rm -f conftest*
	
fi

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

	test ".$cf_cv_ncurses_broken" != .yes && cat >> confdefs.h <<\EOF
#define HAVE_GETBKGD 1
EOF

fi

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

		else
			echo "configure: warning: This curses library does not support color" 1>&2
		fi
	else
		cat >> confdefs.h <<\EOF
#define HAVE_COLOR 1
EOF

	fi
fi

# GCC and Apollo compilers are quite noisy about signal constants (quiet them).
if test -n "$GCC"; then
	check_sig_const=yes
elif test -f /sys/dm/dm ; then
	check_sig_const=yes
elif test -f /sys/dm/spm ; then
	check_sig_const=yes
else
	check_sig_const=no
fi

if test $check_sig_const = yes ; then
	

echo $ac_n "checking for redefinable signal constants""... $ac_c" 1>&6
echo "configure:8328: checking for redefinable signal constants" >&5
if eval "test \"`echo '$''{'cf_cv_sig_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_sig_const=no
if test -n "$cf_cv_sig_args"; then
	cf_test=`echo $cf_cv_sig_args|sed -e s/sig//`
	if test "$cross_compiling" = yes; then
  cf_cv_sig_const=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 8340 "configure"
#include "confdefs.h"

#define NEW_DFL	((RETSIGTYPE (*)($cf_test))0)
#define NEW_IGN	((RETSIGTYPE (*)($cf_test))1)
#define NEW_ERR	((RETSIGTYPE (*)($cf_test))-1)

#include <signal.h>

int main()
{
	if (NEW_DFL != SIG_DFL
	 || NEW_IGN != SIG_IGN
	 || NEW_ERR != SIG_ERR
	 /* at least one system won't let me redefine these! */
#undef SIG_DFL
#undef SIG_IGN
#undef SIG_ERR
#define SIG_DFL NEW_DFL
#define SIG_IGN NEW_IGN
#define SIG_ERR NEW_ERR
	 || NEW_DFL != SIG_DFL)
	 	exit(1);
	signal(SIGINT, SIG_DFL);
	exit(0);
}
EOF
if { (eval echo configure:8367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_sig_const=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_cv_sig_const=no
fi
rm -fr conftest*
fi

fi

fi

echo "$ac_t""$cf_cv_sig_const" 1>&6
test "$cf_cv_sig_const" = yes && cat >> confdefs.h <<\EOF
#define DECL_SIG_CONST 1
EOF


fi


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

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
int main() {
extern int compare(const void *, const void *);
	 char *foo = "string";
	 qsort(foo, sizeof(foo)/sizeof(*foo), sizeof(*foo), compare)
; return 0; }
EOF
if { (eval echo configure:8411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_comptype=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_comptype=no
fi
rm -f conftest*

fi

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

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

fi


echo $ac_n "checking if application can dump core""... $ac_c" 1>&6
echo "configure:8439: checking if application can dump core" >&5
if eval "test \"`echo '$''{'cf_cv_corefile'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	if test "$cross_compiling" = yes; then
  cf_cv_corefile=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 8448 "configure"
#include "confdefs.h"

#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
int found()
{
	struct stat sb;
	return ((stat("core", &sb) == 0			/* UNIX */
	   ||    stat("conftest.core", &sb) == 0	/* FreeBSD */
		)
		&& ((sb.st_mode & S_IFMT) == S_IFREG));
}
int main()
{
#ifdef __amiga__
/* Nicholas d'Alterio (nagd@ic.ac.uk) reports that the check for ability to
 * core dump causes the machine to crash - reason unknown (gcc 2.7.2)
 */
	exit(1);
#else
	int	pid, status;
	if (found())
		unlink("core");
	if (found())
		exit(1);
	if ((pid = fork()) != 0) {
		while (wait(&status) <= 0)
			;
	} else {
		abort();	/* this will dump core, if anything will */
	}
	if (found()) {
		unlink("core");
		exit(0);
	}
	exit(1);
#endif
}
EOF
if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_corefile=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_cv_corefile=no
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$cf_cv_corefile" 1>&6
test $cf_cv_corefile = yes && cat >> confdefs.h <<\EOF
#define HAVE_COREFILE 1
EOF



### test this last, since it uses a partly-built autoconf.h
# Setup includes for test-program to verify declarations
CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
CHECK_DECL_HDRS='
#define M_UNIX
#define __CPROTO__
#define HAVE_CONFDEFS_H
#include <tin.h>'
TIN_DECL_HDRS="$CHECK_DECL_HDRS"

for ac_func in \
	errno \
	getenv \
	getlogin \
	getpwnam \
	popen \
	strchr \

do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:8534: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 8540) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 8545 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:8559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done


CHECK_DECL_HDRS="$TIN_DECL_HDRS
#include <tnntp.h>"
for ac_func in \
	gethostbyname \
	getservbyname \
	inet_ntoa \
	socket \

do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:8625: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 8631) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 8636 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:8650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done


if test $use_curses = no ; then
CHECK_DECL_HDRS="$TIN_DECL_HDRS
#include <tcurses.h>"
for ac_func in \
	tgetstr \
	tgoto \

do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:8715: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 8721) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 8726 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:8740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done

fi

if test $with_decl_check = yes; then
CHECK_DECL_HDRS="$TIN_DECL_HDRS"
for ac_func in \
	_flsbuf \
	atoi \
	atol \
	bcopy \
	bzero \
	calloc \
	fclose \
	fdopen \
	fflush \
	fgetc \
	fileno \
	fprintf \
	fputc \
	fputs \
	fread \
	free \
	fseek \
	fwrite \
	getcwd \
	gethostname \
	getopt \
	getpass \
	ioctl \
	isascii \
	malloc \
	memset \
	mkstemp \
	mktemp \
	pclose \
	perror \
	printf \
	putenv \
	qsort \
	realloc \
	rename \
	rewind \
	select \
	setegid \
	setenv \
	seteuid \
	setpgrp \
	setregid \
	setreuid \
	sscanf \
	strcasecmp \
	strftime \
	strncasecmp \
	strtol \
	system \
	tempnam \
	time \
	tolower \
	toupper \
	ungetc \
	usleep \
	vsprintf \

do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:8859: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 8865) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 8870 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:8884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done


if test $use_curses = no ; then
CHECK_DECL_HDRS="$TIN_DECL_HDRS
#include <tcurses.h>"
for ac_func in $cf_tc_externs
do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:8946: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 8952) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 8957 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done

fi

CHECK_DECL_HDRS="$TIN_DECL_HDRS
#include <tnntp.h>"
for ac_func in \
	connect \

do

ac_tr_func=`echo $ac_func | tr '[a-z]' '[A-Z]'`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:9035: checking for missing "${ac_func}" extern" >&5
if eval "test \"`echo '$''{'cf_cv_func_${ac_func}'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

echo "(line 9041) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 9046 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS

#undef ${ac_func}
struct zowie { int a; double b; struct zowie *c; char d; };
extern struct zowie *${ac_func}();

int main() {


; return 0; }
EOF
if { (eval echo configure:9060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  if test -n "$CHECK_DECL_HDRS" ; then
# try to workaround system headers which are infested with non-standard syntax

cf_1_up=`echo ${ac_func} | tr '[a-z]' '[A-Z]'`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -f conftest*
CFLAGS="$cf_save_CFLAGS"

fi

eval 'cf_result=$cf_cv_func_'${ac_func}
echo "$ac_t""$cf_result" 1>&6
test $cf_result = yes && cat >> confdefs.h <<EOF
#define DECL_${ac_tr_func} 1
EOF

done


fi


echo $ac_n "checking for working TIOCGWINSZ""... $ac_c" 1>&6
echo "configure:9116: checking for working TIOCGWINSZ" >&5
if eval "test \"`echo '$''{'cf_cv_use_tiocgwinsz'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -D__CPROTO__ $CHECK_DECL_FLAG"
	if test "$cross_compiling" = yes; then
  cf_cv_use_tiocgwinsz=unknown
else
  cat > conftest.$ac_ext <<EOF
#line 9127 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS
int main()
{
	int fd;
	for (fd = 0; fd <= 2; fd++) {	/* try in/out/err in case redirected */
#ifdef TIOCGSIZE
		struct ttysize size;
		if (ioctl (0, TIOCGSIZE, &size) == 0
		 && size.ts_lines > 0
		 && size.ts_cols > 0)
			exit(0);
#else
		struct winsize size;
		if (ioctl(0, TIOCGWINSZ, &size) == 0
		 && size.ws_row > 0
		 && size.ws_col > 0)
			exit(0);
#endif
	}
	exit(0);	/* we cannot guarantee this is run interactively */
}
EOF
if { (eval echo configure:9152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_cv_use_tiocgwinsz=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_cv_use_tiocgwinsz=no
fi
rm -fr conftest*
fi

		rm -f autoconf.h
		CFLAGS="$cf_save_CFLAGS"
fi

echo "$ac_t""$cf_cv_use_tiocgwinsz" 1>&6
test $cf_cv_use_tiocgwinsz != yes && cat >> confdefs.h <<\EOF
#define DONT_HAVE_SIGWINCH 1
EOF



### append special libraries that get in the way of testing
case $debug_malloc in
DBMALLOC)
	cat >> confdefs.h <<\EOF
#define USE_DBMALLOC 1
EOF

	LIBS="$LIBS -ldbmalloc"
	;;
DMALLOC)
	cat >> confdefs.h <<\EOF
#define USE_DMALLOC 1
EOF

	LIBS="$LIBS -ldmalloc"
	;;
esac

### The 'pcre' library uses non-standard #define's
test ".$ac_cv_func_strerror" != ".yes" && \
test ".$cf_cv_have_sys_errlist" = ".yes" && \
	PCRE_DEFINES="$PCRE_DEFINES -DSTRERROR_FROM_ERRLIST"
test ".$ac_cv_func_memmove" != ".yes" && \
test ".$cf_cv_good_bcopy" = ".yes" && \
	PCRE_DEFINES="$PCRE_DEFINES -DUSE_BCOPY"


### sum up warnings
if test "$cf_cv_termlib" = none ; then
	if test "$found_ncurses" != yes; then
        	echo "Warning: no term-lib found, you might run into trouble later."
	fi
fi
if test "$YACC" = "" ; then
	echo "Warning: no yacc-parser found, you might run into trouble later."
fi
if test "$RANLIB" = "" ; then
        echo "Warning: no librarie archive builder found, you might run into trouble later."
fi

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

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

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

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

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

DEFS=-DHAVE_CONFIG_H

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

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

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13.19990117"
    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
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "makefile pcre/Makefile src/Makefile include/autoconf.h:include/autoconf.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@INSTALL_PREFIX@%$INSTALL_PREFIX%g
s%@XLC@%$XLC%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@SET_MAKE@%$SET_MAKE%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
s%@YACC@%$YACC%g
s%@LINT@%$LINT%g
s%@PROG_EXT@%$PROG_EXT%g
s%@LIB_PREFIX@%$LIB_PREFIX%g
s%@PATH_ISPELL@%$PATH_ISPELL%g
s%@PATH_METAMAIL@%$PATH_METAMAIL%g
s%@PATH_SUM@%$PATH_SUM%g
s%@DEFAULT_EDITOR@%$DEFAULT_EDITOR%g
s%@DEFAULT_MAILER@%$DEFAULT_MAILER%g
s%@PGPK@%$PGPK%g
s%@PGP@%$PGP%g
s%@ENABLE_DEBUG@%$ENABLE_DEBUG%g
s%@ECHO_LD@%$ECHO_LD%g
s%@RULE_CC@%$RULE_CC%g
s%@SHOW_CC@%$SHOW_CC%g
s%@ECHO_CC@%$ECHO_CC%g
s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
s%@NEWSLIBDIR@%$NEWSLIBDIR%g
s%@SPOOLDIR@%$SPOOLDIR%g
s%@NOVROOTDIR@%$NOVROOTDIR%g
s%@INEWSDIR@%$INEWSDIR%g
s%@INN_NNTPLIB@%$INN_NNTPLIB%g
s%@EXTRAOBJS@%$EXTRAOBJS%g
s%@TIN_DEFAULTS_DIR@%$TIN_DEFAULTS_DIR%g
s%@cf_cv_makeflags@%$cf_cv_makeflags%g
s%@ALLOCA@%$ALLOCA%g
s%@PCRE_DEFINES@%$PCRE_DEFINES%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

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

cat >> $CONFIG_STATUS <<EOF

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

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

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

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

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  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
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

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

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

  echo creating $ac_file

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

EOF


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

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

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

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


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

EOF
cat >> $CONFIG_STATUS <<EOF
# Extra initialization commands, if any

EOF
cat >> $CONFIG_STATUS <<\EOF
# Extra commands, if any

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

