#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13.20030927 
# 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:
  --with-install-prefix   prefixes actual install location (default: /)
  --with-build-cc=XXX     the build C compiler ($BUILD_CC)
  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
  --with-build-libs=XXX   the build libraries ($(BUILD_LIBS)
  --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)
  --with-mailer=PROG      specify default mailer-program (default: mailx)
  --with-mailbox=DIR      directory for incoming mailboxes (default: empty)
EOF
cat <<\EOF
  --disable-pgp-gpg       disable PGP/GPG Support
  --with-pgp              (default: from system path)
  --with-pgpk             (default: from system path)
  --with-gpg              (default: from system path)
  --with-shell=PROG       default $SHELL program (default: sh)
  --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
  --enable-warnings       turn on GCC compiler warnings
  --with-libdir=PATH      news-library (default: /usr/lib/news)
EOF
cat <<\EOF
  --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
  --disable-fcntl         disable fcntl() locking
  --enable-lockf          enable lockf() locking
  --enable-flock          enable flock() locking
  --with-screen=xxx       specify screen type, which must be one of:
                          termcap, terminfo, curses, ncurses, ncursesw, or
                          pdcurses (replaces options --enable-curses and
                          --with-ncurses)
  --with-curses-dir=DIR   directory in which (n)curses is installed
EOF
cat <<\EOF
  --with-ncurses          link with ncurses if available (depriciated)
  --enable-curses         use curses interface (depriciated)
  --with-pcre=PATH        use installed pcre versus bundled
  --with-dbmalloc         use Conor Cahill's dbmalloc library
  --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)
  --enable-mh-mail-handling
                          use MH style mail handling for mailgroups
  --disable-8bit-keys     disable 8-bit keycode support
  --disable-color         disable ANSI-color support
  --disable-etiquette     disable printing of posting-etiquette
EOF
cat <<\EOF
  --enable-break-long-lines
                          break long mime-encoded lines
  --disable-mime-strict-charset
                          force MM_CHARSET obeyance
  --with-mime-default-charset=CHARSET
                          fallback for $MM_CHARSET (default: US-ASCII)
  --with-iso-to-ascii     ISO -> ASCII conversion (default: -1)
  --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
  --disable-piping        disable piping support
  --disable-printing      disable printer support
  --disable-append-pid    disable appending .pid to tmp-files
EOF
cat <<\EOF
  --disable-xhdr-xref     disable XHDR XREF fallback
  --enable-broken-listgroup-fix
                          send extra GROUP command before LISTGROUP
  --enable-broken-system-fix
                          ignore system()s return value
  --with-defaults-dir=PATH
                          directory containing tin.defaults file
                          (default: /etc/tin)
  --enable-ipv6           enable IPv6 (with IPv4) support (default: disabled)
  --with-coffee           coffee support
  --with-libiconv-prefix=DIR
                          search for libiconv in DIR/include and DIR/lib
  --disable-nls           do not use Native Language Support
  --with-included-gettext use the GNU gettext library included here
  --disable-included-msgs use included messages, for i18n support
  --with-x                use the X Window System
  --with-Xaw3d            link with Xaw 3d library
EOF
cat <<\EOF
  --with-neXtaw           link with neXT Athena library
  --with-XawPlus          link with Athena-Plus library
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.20030927"
    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

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


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

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

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

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

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

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

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

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

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

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





PACKAGE=tin
VERSION=1.8.3
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF

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




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 || test -f $ac_aux_dir/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:907: 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="${DESTDIR-/}"
fi

case ".$withval" in #(vi
.\$\(*\)*|.\'*\'*) #(vi
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 1>&2; exit 1; }
  ;;
esac

eval DESTDIR="$withval"

case ".$DESTDIR" in # (vi
./)	DESTDIR=
	;; # (vi
./*/)	;; # (vi
./*)	DESTDIR="$DESTDIR/"
	;;
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:1003: 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

### Native Language Support
ALL_LINGUAS="de en_GB et fr ru rw sv tr"

### 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:1053: 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:1083: 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:1134: 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:1166: 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 1177 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1182: \"$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:1208: 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:1213: 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:1222: \"$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:1241: 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:1273: 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 1288 "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:1294: \"$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 1305 "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:1311: \"$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 1322 "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:1328: \"$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:1354: 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 1360 "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 1378 "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:1400: 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:1438: 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'



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:1515: checking for $cf_prog" >&5
    cf_command="$cf_prog conftest.y"
    cf_result=no
    if { (eval echo configure:1518: \"$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:1522: \"$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 splint
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:1546: 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
test -n "$LINT" || LINT=":"

echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:1577: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 1579 "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
#define _ALL_SOURCE 1
EOF

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



echo $ac_n "checking if $CC -U and -D options work together""... $ac_c" 1>&6
echo "configure:1602: checking if $CC -U and -D options work together" >&5
if eval "test \"`echo '$''{'cf_cv_cc_u_d_options'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_save_CPPFLAGS="$CPPFLAGS"
	CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
	cat > conftest.$ac_ext <<EOF
#line 1610 "configure"
#include "confdefs.h"

int main() {

#ifndef U_D_OPTIONS
make an undefined-error
#endif
#ifdef  D_U_OPTIONS
make a defined-error
#endif
	
; return 0; }
EOF
if { (eval echo configure:1624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
	cf_cv_cc_u_d_options=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cf_cv_cc_u_d_options=no
fi
rm -f conftest*
	CPPFLAGS="$cf_save_CPPFLAGS"

fi

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





cf_XOPEN_SOURCE=500
cf_POSIX_C_SOURCE=199506L

case $host_os in #(vi
aix[45]*) #(vi
	CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
	;;
freebsd*) #(vi
	# 5.x headers associate
	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
	cf_POSIX_C_SOURCE=200112L
	cf_XOPEN_SOURCE=600
	CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
	;;
hpux*) #(vi
	CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
	;;
irix[56].*) #(vi
	CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
	;;
linux*|gnu*) #(vi
	
echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
echo "configure:1670: checking if we must define _GNU_SOURCE" >&5
if eval "test \"`echo '$''{'cf_cv_gnu_source'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 1676 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_gnu_source=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_save="$CPPFLAGS"
	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
	 cat > conftest.$ac_ext <<EOF
#line 1696 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_gnu_source=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_gnu_source=yes
fi
rm -f conftest*
	CPPFLAGS="$cf_save"
	
fi
rm -f conftest*

fi

echo "$ac_t""$cf_cv_gnu_source" 1>&6
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"

	;;
mirbsd*) #(vi
	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
	;;
netbsd*) #(vi
	# setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
	;;
openbsd*) #(vi
	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
	;;
osf[45]*) #(vi
	CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
	;;
nto-qnx*) #(vi
	CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
	;;
sco*) #(vi
	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
	;;
solaris*) #(vi
	CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
	;;
*)
	echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
echo "configure:1750: checking if we should define _XOPEN_SOURCE" >&5
if eval "test \"`echo '$''{'cf_cv_xopen_source'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 1756 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_xopen_source=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_save="$CPPFLAGS"
	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
	 cat > conftest.$ac_ext <<EOF
#line 1776 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_xopen_source=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_xopen_source=$cf_XOPEN_SOURCE
fi
rm -f conftest*
	CPPFLAGS="$cf_save"
	
fi
rm -f conftest*

fi

echo "$ac_t""$cf_cv_xopen_source" 1>&6
	if test "$cf_cv_xopen_source" != no ; then
		
# remove _XOPEN_SOURCE symbol from $CFLAGS
CFLAGS=`echo "$CFLAGS" | \
	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`

		
# remove _XOPEN_SOURCE symbol from $CPPFLAGS
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]_XOPEN_SOURCE\(=[^ 	]*\)\?$//g'`

		test "$cf_cv_cc_u_d_options" = yes && \
			CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
		CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
	fi
	
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE

cf_save_CFLAGS="$CFLAGS"
cf_save_CPPFLAGS="$CPPFLAGS"


# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`


# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
	sed	-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]_POSIX_C_SOURCE\(=[^ 	]*\)\?$//g'`


echo $ac_n "checking if we should define _POSIX_C_SOURCE""... $ac_c" 1>&6
echo "configure:1841: checking if we should define _POSIX_C_SOURCE" >&5
if eval "test \"`echo '$''{'cf_cv_posix_c_source'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	
echo "(line 1847) testing if the symbol is already defined go no further ..." 1>&5

	cat > conftest.$ac_ext <<EOF
#line 1850 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifndef _POSIX_C_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_posix_c_source=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_want_posix_source=no
	 case .$cf_POSIX_C_SOURCE in #(vi
	 .[12]??*) #(vi
		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
		;;
	 .2) #(vi
		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
		cf_want_posix_source=yes
		;;
	 .*)
		cf_want_posix_source=yes
		;;
	 esac
	 if test "$cf_want_posix_source" = yes ; then
		cat > conftest.$ac_ext <<EOF
#line 1882 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _POSIX_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
fi
rm -f conftest*
	 fi
	 
echo "(line 1903) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5

	 CFLAGS="$cf_trim_CFLAGS"
	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
	 
echo "(line 1908) testing if the second compile does not leave our definition intact error ..." 1>&5

	 cat > conftest.$ac_ext <<EOF
#line 1911 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifndef _POSIX_C_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_posix_c_source=no
fi
rm -f conftest*
	 CFLAGS="$cf_save_CFLAGS"
	 CPPFLAGS="$cf_save_CPPFLAGS"
	
fi
rm -f conftest*

fi

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

if test "$cf_cv_posix_c_source" != no ; then
	CFLAGS="$cf_trim_CFLAGS"
	CPPFLAGS="$cf_trim_CPPFLAGS"
	if test "$cf_cv_cc_u_d_options" = yes ; then
		cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
				sed -e 's/-D/-U/g' -e 's/=[^ 	]*//g'`
		CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
	fi
	CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
fi


	;;
esac


        echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
echo "configure:1957: checking for strerror in -lcposix" >&5
ac_lib_var=`echo cposix'_'strerror | 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="-lcposix  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1965 "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 strerror();

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

  


echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
echo "configure:2000: 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"
cf_save_CPPFLAGS="$CPPFLAGS"
# 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
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

for cf_add_cflags in $cf_arg
do
case $cf_fix_cppflags in
no)
	case $cf_add_cflags in #(vi
	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
		case $cf_add_cflags in
		-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
			&& test -z "${cf_tst_cflags}" \
			&& cf_fix_cppflags=yes

			if test $cf_fix_cppflags = yes ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			elif test "${cf_tst_cflags}" = "\"'" ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			fi
			;;
		esac
		case "$CPPFLAGS" in
		*$cf_add_cflags) #(vi
			;;
		*) #(vi
			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
			;;
		esac
		;;
	*)
		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
		;;
	esac
	;;
yes)
	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"

	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`

	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
	&& test -z "${cf_tst_cflags}" \
	&& cf_fix_cppflags=no
	;;
esac
done

if test -n "$cf_new_cflags" ; then
	
	CFLAGS="$CFLAGS $cf_new_cflags"
fi

if test -n "$cf_new_cppflags" ; then
	
	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
fi

if test -n "$cf_new_extra_cppflags" ; then
	
	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




	cat > conftest.$ac_ext <<EOF
#line 2096 "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:2112: \"$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"
CPPFLAGS="$cf_save_CPPFLAGS"

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
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

for cf_add_cflags in $cf_cv_ansi_cc
do
case $cf_fix_cppflags in
no)
	case $cf_add_cflags in #(vi
	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
		case $cf_add_cflags in
		-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
			&& test -z "${cf_tst_cflags}" \
			&& cf_fix_cppflags=yes

			if test $cf_fix_cppflags = yes ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			elif test "${cf_tst_cflags}" = "\"'" ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			fi
			;;
		esac
		case "$CPPFLAGS" in
		*$cf_add_cflags) #(vi
			;;
		*) #(vi
			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
			;;
		esac
		;;
	*)
		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
		;;
	esac
	;;
yes)
	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"

	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`

	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
	&& test -z "${cf_tst_cflags}" \
	&& cf_fix_cppflags=no
	;;
esac
done

if test -n "$cf_new_cflags" ; then
	
	CFLAGS="$CFLAGS $cf_new_cflags"
fi

if test -n "$cf_new_cppflags" ; then
	
	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
fi

if test -n "$cf_new_extra_cppflags" ; then
	
	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




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

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

int main() {

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

echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
echo "configure:2253: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 2258 "configure"
#include "confdefs.h"

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

echo "$ac_t""$ac_cv_mingw32" 1>&6
MINGW32=
test "$ac_cv_mingw32" = yes && MINGW32=yes


case $cf_cv_system_name in
os2*)
    CFLAGS="$CFLAGS -Zmt"
    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
    CXXFLAGS="$CXXFLAGS -Zmt"
    # autoconf's macro sets -Zexe and suffix both, which conflict:w
    LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
    ac_cv_exeext=.exe
    ;;
esac



echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
echo "configure:2297: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  ac_cv_exeext=.exe
else
  rm -f conftest*
  echo 'int main () { return 0; }' > conftest.$ac_ext
  ac_cv_exeext=
  if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    for file in conftest.*; do
      case $file in
      *.c | *.o | *.obj) ;;
      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
      esac
    done
  else
    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
  fi
  rm -f conftest*
  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
fi
fi

EXEEXT=""
test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
echo "$ac_t""${ac_cv_exeext}" 1>&6
ac_exeext=$EXEEXT

echo $ac_n "checking for object suffix""... $ac_c" 1>&6
echo "configure:2328: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
if { (eval echo configure:2334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  for ac_file in conftest.*; do
    case $ac_file in
    *.c) ;;
    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
    esac
  done
else
  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_objext" 1>&6
OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext


PROG_EXT="$EXEEXT"

test -n "$PROG_EXT" && cat >> confdefs.h <<EOF
#define PROG_EXT "$PROG_EXT"
EOF



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

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




if test "$cross_compiling" = yes ; then

	# defaults that we might want to override
	: ${BUILD_CFLAGS:=''}
	: ${BUILD_CPPFLAGS:='-I$(INCDIR)'}
	: ${BUILD_LDFLAGS:=''}
	: ${BUILD_LIBS:=''}
	: ${BUILD_EXEEXT:='$x'}
	: ${BUILD_OBJEXT:='o'}

	
# Check whether --with-build-cc or --without-build-cc was given.
if test "${with_build_cc+set}" = set; then
  withval="$with_build_cc"
  BUILD_CC="$withval"
else
  for ac_prog in gcc cc cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2413: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$BUILD_CC"; then
  ac_cv_prog_BUILD_CC="$BUILD_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_BUILD_CC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
BUILD_CC="$ac_cv_prog_BUILD_CC"
if test -n "$BUILD_CC"; then
  echo "$ac_t""$BUILD_CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$BUILD_CC" && break
done

fi

	echo $ac_n "checking for native build C compiler""... $ac_c" 1>&6
echo "configure:2445: checking for native build C compiler" >&5
	echo "$ac_t""$BUILD_CC" 1>&6

	echo $ac_n "checking for native build C preprocessor""... $ac_c" 1>&6
echo "configure:2449: checking for native build C preprocessor" >&5
	
# Check whether --with-build-cpp or --without-build-cpp was given.
if test "${with_build_cpp+set}" = set; then
  withval="$with_build_cpp"
  BUILD_CPP="$withval"
else
  BUILD_CPP='$(BUILD_CC) -E'
fi

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

	echo $ac_n "checking for native build C flags""... $ac_c" 1>&6
echo "configure:2462: checking for native build C flags" >&5
	
# Check whether --with-build-cflags or --without-build-cflags was given.
if test "${with_build_cflags+set}" = set; then
  withval="$with_build_cflags"
  BUILD_CFLAGS="$withval"
fi

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

	echo $ac_n "checking for native build C preprocessor-flags""... $ac_c" 1>&6
echo "configure:2473: checking for native build C preprocessor-flags" >&5
	
# Check whether --with-build-cppflags or --without-build-cppflags was given.
if test "${with_build_cppflags+set}" = set; then
  withval="$with_build_cppflags"
  BUILD_CPPFLAGS="$withval"
fi

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

	echo $ac_n "checking for native build linker-flags""... $ac_c" 1>&6
echo "configure:2484: checking for native build linker-flags" >&5
	
# Check whether --with-build-ldflags or --without-build-ldflags was given.
if test "${with_build_ldflags+set}" = set; then
  withval="$with_build_ldflags"
  BUILD_LDFLAGS="$withval"
fi

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

	echo $ac_n "checking for native build linker-libraries""... $ac_c" 1>&6
echo "configure:2495: checking for native build linker-libraries" >&5
	
# Check whether --with-build-libs or --without-build-libs was given.
if test "${with_build_libs+set}" = set; then
  withval="$with_build_libs"
  BUILD_LIBS="$withval"
fi

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

	# this assumes we're on Unix.
	BUILD_EXEEXT=
	BUILD_OBJEXT=o

	: ${BUILD_CC:='$(CC)'}

	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '$(CC)' ) ; then
		{ echo "configure: error: Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler." 1>&2; exit 1; }
	fi

else
	: ${BUILD_CC:='$(CC)'}
	: ${BUILD_CPP:='$(CPP)'}
	: ${BUILD_CFLAGS:='$(CFLAGS)'}
	: ${BUILD_CPPFLAGS:='$(CPPFLAGS)'}
	: ${BUILD_LDFLAGS:='$(LDFLAGS)'}
	: ${BUILD_LIBS:='$(LIBS)'}
	: ${BUILD_EXEEXT:='$x'}
	: ${BUILD_OBJEXT:='o'}
fi











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

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

if test $host != $build; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi

# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2564: 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="${ac_tool_prefix}ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_RANLIB"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2596: 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

else
  RANLIB="':'"
fi
fi

# Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
set dummy ${ac_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2631: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # 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_LD="${ac_tool_prefix}ld"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


if test -z "$ac_cv_prog_LD"; then
if test -n "$ac_tool_prefix"; then
  # Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2663: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LD"; then
  ac_cv_prog_LD="$LD" # 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_LD="ld"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LD" && ac_cv_prog_LD="ld"
fi
fi
LD="$ac_cv_prog_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

else
  LD="ld"
fi
fi

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


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

else
  AR="ar"
fi
fi

if eval "test \"`echo '$''{'cf_cv_subst_AR_OPTS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
echo $ac_n "checking for archiver options (symbol AR_OPTS)""... $ac_c" 1>&6
echo "configure:2767: checking for archiver options (symbol AR_OPTS)" >&5
test -z "$AR_OPTS" && AR_OPTS=rv
echo "$ac_t""$AR_OPTS" 1>&6

cf_cv_subst_AR_OPTS=$AR_OPTS
fi

AR_OPTS=${cf_cv_subst_AR_OPTS}


case "$host_cpu:$host_vendor:$host_os" in
	# check for MacOS X, exclude Darwin on ix86
	powerpc:apple:darwin*)  #
		cat >> confdefs.h <<\EOF
#define MAC_OS_X 1
EOF

		;;
	# check for cygwin enviroment
	# -DSTATIC is needed for pcre
	*:*:*cygwin*)	#(vi
		PCRE_DEFINES="$PCRE_DEFINES -DSTATIC"
		;;
	# SEIUX doesn't have any usefull preprocessor symbol
	mips:sei:seiux*)
		cat >> confdefs.h <<\EOF
#define SEIUX 1
EOF

		;;
esac



# 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:2813: checking for ispell" >&5
   ac_cv_path_PATH_ISPELL="$withval"
   cat >> confdefs.h <<EOF
#define PATH_ISPELL "$withval"
EOF
   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:2830: 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:2887: checking for metamail" >&5
   ac_cv_path_PATH_METAMAIL="$withval"
   cat >> confdefs.h <<EOF
#define PATH_METAMAIL "$withval"
EOF
   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:2904: 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:2961: checking for sum" >&5
   ac_cv_path_PATH_SUM="$withval"
   cat >> confdefs.h <<EOF
#define PATH_SUM "$withval"
EOF
   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:2978: 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:3025: 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:3030: \"$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:3060: 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:3088: 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:3133: 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:3187: 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:3224: 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:3258: checking for default mailer" >&5
if test -n "$DEFAULT_MAILER" ; then
	
case $cf_cv_system_name in #(vi
os2*|cygwin*)
	ac_cv_path_DEFAULT_MAILER=`echo "$ac_cv_path_DEFAULT_MAILER" | sed -e 's%\\\\%/%g'`
	;;
esac

	
case $cf_cv_system_name in #(vi
os2*|cygwin*)
	DEFAULT_MAILER=`echo "$DEFAULT_MAILER" | sed -e 's%\\\\%/%g'`
	;;
esac

	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:3285: 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/GPG-Support""... $ac_c" 1>&6
echo "configure:3331: checking if you want PGP/GPG-Support" >&5

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

echo "$ac_t""$enableval" 1>&6
if test "$USE_PGP_GPG" = "yes" ; then
	
# Check whether --with-pgp or --without-pgp was given.
if test "${with_pgp+set}" = set; then
  withval="$with_pgp"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-pgp" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-pgp=path"
   echo $ac_n "checking for pgp""... $ac_c" 1>&6
echo "configure:3363: checking for pgp" >&5
   ac_cv_path_PATH_PGP="$withval"
   cat >> confdefs.h <<EOF
#define PATH_PGP "$withval"
EOF
   cat >> confdefs.h <<\EOF
#define HAVE_PGP 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-pgp"; do automatic check
  # 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:3380: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_PGP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_PGP" in
  /*)
  ac_cv_path_PATH_PGP="$PATH_PGP" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_PGP="$PATH_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_PATH_PGP="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_PGP="$ac_cv_path_PATH_PGP"
if test -n "$PATH_PGP"; then
  echo "$ac_t""$PATH_PGP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi

	# FIXME: check if pgp is pgp2 or pgp6

	
# Check whether --with-pgpk or --without-pgpk was given.
if test "${with_pgpk+set}" = set; then
  withval="$with_pgpk"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-pgpk" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-pgpk=path"
   echo $ac_n "checking for pgpk""... $ac_c" 1>&6
echo "configure:3438: checking for pgpk" >&5
   ac_cv_path_PATH_PGPK="$withval"
   cat >> confdefs.h <<EOF
#define PATH_PGPK "$withval"
EOF
   cat >> confdefs.h <<\EOF
#define HAVE_PGPK 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-pgpk"; do automatic check
  # 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:3455: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_PGPK'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_PGPK" in
  /*)
  ac_cv_path_PATH_PGPK="$PATH_PGPK" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_PGPK="$PATH_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_PATH_PGPK="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_PGPK="$ac_cv_path_PATH_PGPK"
if test -n "$PATH_PGPK"; then
  echo "$ac_t""$PATH_PGPK" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi

	# FIXME: remove tailing k

	
# Check whether --with-gpg or --without-gpg was given.
if test "${with_gpg+set}" = set; then
  withval="$with_gpg"
  case "$withval" in #(vi
  yes)
   { echo "configure: error: expected a value for --with-gpg" 1>&2; exit 1; }
   ;; #(vi
  no)
   ;; #(vi
  *)
   # user supplied option-value for "--with-gpg=path"
   echo $ac_n "checking for gpg""... $ac_c" 1>&6
echo "configure:3513: checking for gpg" >&5
   ac_cv_path_PATH_GPG="$withval"
   cat >> confdefs.h <<EOF
#define PATH_GPG "$withval"
EOF
   cat >> confdefs.h <<\EOF
#define HAVE_GPG 1
EOF
   echo "$ac_t""$withval" 1>&6
   ;;
 esac
else
  
  # user did not specify "--with-gpg"; do automatic check
  # Extract the first word of "gpg", so it can be a program name with args.
set dummy gpg; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:3530: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PATH_GPG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$PATH_GPG" in
  /*)
  ac_cv_path_PATH_GPG="$PATH_GPG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_PATH_GPG="$PATH_GPG" # 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_GPG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
PATH_GPG="$ac_cv_path_PATH_GPG"
if test -n "$PATH_GPG"; then
  echo "$ac_t""$PATH_GPG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

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

fi

fi

## Default shell

# Check whether --with-shell or --without-shell was given.
if test "${with_shell+set}" = set; then
  withval="$with_shell"
  cf_cv_default_shell=$withval
else
  cf_cv_default_shell=
fi


echo $ac_n "checking for the default shell program""... $ac_c" 1>&6
echo "configure:3587: checking for the default shell program" >&5
cf_shell_progs="$cf_cv_default_shell"
if test -z "$cf_shell_progs" ; then
	cf_shell_progs="sh ksh bash zsh pdksh mksh jsh keysh ash dash"
	# TIN preferred default shell for BSD systems is csh. Others are sh.
	cat > conftest.$ac_ext <<EOF
#line 3593 "configure"
#include "confdefs.h"

#include <sys/params.h>
int main() {

#if (defined(BSD) && (BSD >= 199103))
#else
make an error
#endif

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

echo "(line 3616) testing paths of shell programs: $cf_shell_progs ..." 1>&5

if test -s /etc/shells && test `egrep -c -v '^(#| |    |$)' /etc/shells` -gt 0; then
	
echo "(line 3620) testing /etc/shells ..." 1>&5

	for cf_prog in $cf_shell_progs
	do
		case $cf_prog in
			/*)
				cf_pattern="^"$cf_prog"$"
				;;
			*/*)
				{ echo "configure: error: Program name must be absolute or filename: $cf_prog" 1>&2; exit 1; }
				;;
			*)
				cf_pattern="/"$cf_prog"$"
				;;
		esac
		cf_path=`egrep $cf_pattern /etc/shells 2>/dev/null`
		if test -n "$cf_path"
		then
			for cf_shell in $cf_path
			do
				if test -f "$cf_shell"
				then
					DEFAULT_SHELL="$cf_shell"
					break
				fi
			done
		fi
		if test -n "$DEFAULT_SHELL"
		then
			break
		fi
	done
	echo "$ac_t""$DEFAULT_SHELL" 1>&6
else
	
echo "(line 3655) testing $PATH ..." 1>&5

for ac_prog in $cf_shell_progs
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:3662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DEFAULT_SHELL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$DEFAULT_SHELL" in
  /*)
  ac_cv_path_DEFAULT_SHELL="$DEFAULT_SHELL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_DEFAULT_SHELL="$DEFAULT_SHELL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH:/bin:/usr/bin:/usr/xpg4/bin:/bin/posix:/usr/bin/posix:/usr/old/bin:/usr/local/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_SHELL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
DEFAULT_SHELL="$ac_cv_path_DEFAULT_SHELL"
if test -n "$DEFAULT_SHELL"; then
  echo "$ac_t""$DEFAULT_SHELL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$DEFAULT_SHELL" && break
done

fi
if test -z "$DEFAULT_SHELL" ; then
	echo "configure: warning: Cannot find the default shell you specified: $cf_shell_progs" 1>&2
	if test -f /bin/false ; then
		echo "configure: warning: Using /bin/false instead" 1>&2
		DEFAULT_SHELL=/bin/false
	else
		{ echo "configure: error: Cannot use /bin/false because it does not exist" 1>&2; exit 1; }
	fi
fi
cat >> confdefs.h <<EOF
#define DEFAULT_SHELL "$DEFAULT_SHELL"
EOF



### 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:3715: 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:3737: 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:3769: 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:3796: 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_LT='--silent'
    ECHO_LD='@echo linking $@;'
    RULE_CC='	@echo compiling $<'
    SHOW_CC='	@echo compiling $@'
    ECHO_CC='@'
 
  else
    
    ECHO_LT=''
    ECHO_LD=''
    RULE_CC='# compiling'
    SHOW_CC='# compiling'
    ECHO_CC=''

  fi
else
  enableval=yes 
  
    ECHO_LT=''
    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:3841: 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:3865: 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
	

GCC_VERSION=none
if test "$GCC" = yes ; then
	echo $ac_n "checking version of $CC""... $ac_c" 1>&6
echo "configure:3891: checking version of $CC" >&5
	GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
	test -z "$GCC_VERSION" && GCC_VERSION=unknown
	echo "$ac_t""$GCC_VERSION" 1>&6
fi




INTEL_COMPILER=no

if test "$GCC" = yes ; then
	case $host_os in
	linux*|gnu*)
		echo $ac_n "checking if this is really Intel C compiler""... $ac_c" 1>&6
echo "configure:3906: checking if this is really Intel C compiler" >&5
		cf_save_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS -no-gcc"
		cat > conftest.$ac_ext <<EOF
#line 3910 "configure"
#include "confdefs.h"

int main() {

#ifdef __INTEL_COMPILER
#else
make an error
#endif

; return 0; }
EOF
if { (eval echo configure:3922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  INTEL_COMPILER=yes
cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
		CFLAGS="$cf_save_CFLAGS"
		echo "$ac_t""$INTEL_COMPILER" 1>&6
		;;
	esac
fi


cat > conftest.$ac_ext <<EOF
#line 3940 "configure"
int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
EOF

if test "$INTEL_COMPILER" = yes
then
# The "-wdXXX" options suppress warnings:
# remark #1419: external declaration in primary source file
# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
# remark #193: zero used for undefined preprocessing identifier
# remark #593: variable "curs_sb_left_arrow" was set but never used
# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
# remark #869: parameter "tw" was never referenced
# remark #981: operands are evaluated in unspecified order
# warning #269: invalid format string conversion

	echo "checking for $CC warning options" 1>&6
echo "configure:3959: checking for $CC warning options" >&5
	cf_save_CFLAGS="$CFLAGS"
	EXTRA_CFLAGS="-Wall"
	for cf_opt in  \
		wd1419 \
		wd1682 \
		wd1683 \
		wd1684 \
		wd193 \
		wd279 \
		wd593 \
		wd810 \
		wd869 \
		wd981
	do
		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
		if { (eval echo configure:3975: \"$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"
		fi
	done
	CFLAGS="$cf_save_CFLAGS"

elif test "$GCC" = yes
then
	echo "checking for $CC warning options" 1>&6
echo "configure:3985: 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 \
		Wundef $cf_warn_CONST 
	do
		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
		if { (eval echo configure:4004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
			case $cf_opt in #(vi
			Wcast-qual) #(vi
				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
				;;
			Winline) #(vi
				case $GCC_VERSION in
				3.3*)
					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6

					continue;;
				esac
				;;
			esac
			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
		fi
	done
	CFLAGS="$cf_save_CFLAGS"
fi
rm -f conftest*



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:4035: 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
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 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:4073: 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
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 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:4111: 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
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 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:4149: 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

## TODO: kick the --with-inews-dir= stuff, the check below should be enough
## (requires some code rework in tin)
echo $ac_n "checking for directory containing \"inews\"""... $ac_c" 1>&6
echo "configure:4185: 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
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 1>&2; exit 1; }
  ;;
esac

eval INEWSDIR="$withval"

INEWSDIR=`echo $INEWSDIR |sed -e 's,/$,,'`
echo "$ac_t""$INEWSDIR" 1>&6

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

if test "$ac_cv_path_INEWS" != ""; then
	if test "$ac_cv_path_INEWS" = "--internal"; then
		
cf_define=`echo "$INEWS"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define PATH_INEWS "$cf_define"
EOF


	else
		
cf_define=`echo "$INEWS -h"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define PATH_INEWS "$cf_define"
EOF


	fi
fi

## !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:4283: 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:4315: 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:4335: 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
  ;;
*)
  if test -d $cf_cv_use_libsocks ; then
    if test -d $cf_cv_use_libsocks/include ; then
      CPPFLAGS="$CPPFLAGS -I$cf_cv_use_libsocks/include"
      LIBS="$LIBS -L$cf_cv_use_libsocks/lib"
    else
      LIBS="$LIBS -L$cf_cv_use_libsocks"
      test -d $cf_cv_use_libsocks/../include && CPPFLAGS="$CPPFLAGS -I$cf_cv_use_libsocks/../include"
    fi
  else
    echo "configure: warning: expected a directory: $cf_cv_use_libsocks" 1>&2
  fi
  ;;
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 4411 "configure"
#include "confdefs.h"

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

	accept((char *)0)
; return 0; }
EOF
if { (eval echo configure:4420: \"$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:4434: 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:4445: 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 4450 "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:4473: \"$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:4496: 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 4504 "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:4515: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_gethostname=yes
	if test "$cf_used_lib_nsl" != yes ; then cf_used_lib_nsl=yes; cf_cv_netlibs="-lnsl $cf_cv_netlibs"; fi
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:4548: 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 4556 "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:4567: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_gethostname=yes
	if test "$cf_used_lib_socket" != yes ; then cf_used_lib_socket=yes; cf_cv_netlibs="-lsocket $cf_cv_netlibs"; fi
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
# AC_HAVE_LIBRARY(inet,cf_cv_netlibs="-linet $cf_cv_netlibs")
echo $ac_n "checking for main in -linet""... $ac_c" 1>&6
echo "configure:4612: checking for main in -linet" >&5
ac_lib_var=`echo inet'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-linet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4620 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:4627: \"$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_cv_netlibs="-linet $cf_cv_netlibs"
else
  echo "$ac_t""no" 1>&6
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:4652: 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 4657 "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:4680: \"$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:4703: 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 4711 "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:4722: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_socket=yes
	if test "$cf_used_lib_socket" != yes ; then cf_used_lib_socket=yes; cf_cv_netlibs="-lsocket $cf_cv_netlibs"; fi
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:4755: 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 4763 "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:4774: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_socket=yes
	if test "$cf_used_lib_bsd" != yes ; then cf_used_lib_bsd=yes; cf_cv_netlibs="-lbsd $cf_cv_netlibs"; fi
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:4819: 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 4824 "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:4847: \"$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:4870: 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 4878 "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:4889: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_gethostbyname=yes
	if test "$cf_used_lib_nsl" != yes ; then cf_used_lib_nsl=yes; cf_cv_netlibs="-lnsl $cf_cv_netlibs"; fi
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:4930: 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 4935 "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:4958: \"$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:4981: 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 4989 "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:5000: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_strcasecmp=yes
	if test "$cf_used_lib_resolv" != yes ; then cf_used_lib_resolv=yes; cf_cv_netlibs="-lresolv $cf_cv_netlibs"; fi
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
  ;;
*)
  if test -d $cf_cv_use_libsocks5 ; then
    if test -d $cf_cv_use_libsocks5/include ; then
      CPPFLAGS="$CPPFLAGS -I$cf_cv_use_libsocks5/include"
      LIBS="$LIBS -L$cf_cv_use_libsocks5/lib"
    else
      LIBS="$LIBS -L$cf_cv_use_libsocks5"
      test -d $cf_cv_use_libsocks5/../include && CPPFLAGS="$CPPFLAGS -I$cf_cv_use_libsocks5/../include"
    fi
  else
    echo "configure: warning: expected a directory: $cf_cv_use_libsocks5" 1>&2
  fi
  ;;
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:5072: checking if the socks library uses socks4 prefix" >&5
cf_use_socks4=error
cat > conftest.$ac_ext <<EOF
#line 5075 "configure"
#include "confdefs.h"

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

	Rinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:5084: \"$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 5096 "configure"
#include "confdefs.h"
#include <socks.h>
int main() {
SOCKSinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:5103: \"$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
echo $ac_n "checking if socks5p.h is available""... $ac_c" 1>&6
echo "configure:5168: checking if socks5p.h is available" >&5
cat > conftest.$ac_ext <<EOF
#line 5170 "configure"
#include "confdefs.h"

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

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


	fi
fi

### which locking method should be used for mailbox locking
### first look for all available locking methods

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

echo $ac_n "checking for fcntl""... $ac_c" 1>&6
echo "configure:5243: checking for fcntl" >&5
if eval "test \"`echo '$''{'ac_cv_func_fcntl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5248 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char fcntl(); 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 fcntl();

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_fcntl) || defined (__stub___fcntl)
choke me
#else
fcntl();
#endif

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

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

echo $ac_n "checking for lockf""... $ac_c" 1>&6
echo "configure:5291: checking for lockf" >&5
if eval "test \"`echo '$''{'ac_cv_func_lockf'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5296 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char lockf(); 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 lockf();

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_lockf) || defined (__stub___lockf)
choke me
#else
lockf();
#endif

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

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

echo $ac_n "checking for flock""... $ac_c" 1>&6
echo "configure:5339: checking for flock" >&5
if eval "test \"`echo '$''{'ac_cv_func_flock'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5344 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char flock(); 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 flock();

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_flock) || defined (__stub___flock)
choke me
#else
flock();
#endif

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

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


echo $ac_n "checking for file-locking functions""... $ac_c" 1>&6
echo "configure:5388: checking for file-locking functions" >&5
if eval "test \"`echo '$''{'cf_cv_lockfile'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_lockfile=
for cf_lock in fcntl lockf flock
do
if eval 'test ${ac_cv_func_'$cf_lock'+set} = set'; then
	case $cf_lock in #(vi
	fcntl) #(vi
		cat > conftest.$ac_ext <<EOF
#line 5400 "configure"
#include "confdefs.h"

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

int main() {

	struct flock flk;
	int block = 1;
	int fd = 0;
	int rc;

	flk.l_type = F_WRLCK;
	flk.l_whence = SEEK_SET;
	flk.l_start = 0;
	flk.l_len = 0;
	rc = fcntl(fd, block ? F_SETLKW : F_SETLK, &flk)
	&& fcntl(fd, F_GETLK, &flk)
	&& fcntl(fd, F_SETLK, &flk);
	
; return 0; }
EOF
if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
		;;
	lockf) #(vi
		cat > conftest.$ac_ext <<EOF
#line 5440 "configure"
#include "confdefs.h"

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

int main() {

	int block = 1, fd = 0;
	int ret = lockf(fd, block ? F_LOCK : F_TLOCK, 0L)
	 && lockf(fd, F_TEST, 0L)
	 && lockf(fd, F_ULOCK, 0L);
	
; return 0; }
EOF
if { (eval echo configure:5460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
		;;
	flock)
		cat > conftest.$ac_ext <<EOF
#line 5472 "configure"
#include "confdefs.h"

#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif

int main() {

	int block = 1, fd = 0;
	int ret = flock(fd, (LOCK_EX|LOCK_NB))
	 && flock(fd, LOCK_UN)
	 && flock(fd, block ? LOCK_EX : (LOCK_EX | LOCK_NB));
	
; return 0; }
EOF
if { (eval echo configure:5495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  continue
fi
rm -f conftest*
		;;
	esac
	cf_cv_lockfile="$cf_cv_lockfile $cf_lock"
fi
done

fi

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


echo $ac_n "checking which locking method should be used""... $ac_c" 1>&6
echo "configure:5516: checking which locking method should be used" >&5
### fcntl() is preferred, if the user just disables fcntl()
### without specifying an alternative lockf() is preferred

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


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


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

### now check the users wishes against available locking methods
if test -n "$cf_cv_lockfile"; then
	for lock in $cf_cv_lockfile; do
		if test "$lock" = "$requested_lock"; then
			used_locking=$lock
			break
		fi
	done
### if none of them matched use the one with the higest priority
	if test "x$used_locking" = "x"; then
		used_locking=`echo $cf_cv_lockfile|sed -e 's/^\([^ ]\+\).*/\1/g'`
	fi
	echo "$ac_t""$used_locking" 1>&6
	
used_locking=`echo "$used_locking" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

	cat >> confdefs.h <<EOF
#define USE_$used_locking 1
EOF

else
	echo "configure: warning: None of fcntl()" 1>&2
fi


echo $ac_n "checking for screen type""... $ac_c" 1>&6
echo "configure:5585: checking for screen type" >&5

# Check whether --with-screen or --without-screen was given.
if test "${with_screen+set}" = set; then
  withval="$with_screen"
  cf_with_screen=$withval
else
  cf_with_screen=none
fi

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

use_curses=no
use_ncurses=no

echo $ac_n "checking if you specified curses install-directory""... $ac_c" 1>&6
echo "configure:5601: checking if you specified curses install-directory" >&5


# Check whether --with-curses-dir or --without-curses-dir was given.
if test "${with_curses_dir+set}" = set; then
  withval="$with_curses_dir"
  
case ".$withval" in #(vi
.\$\(*\)*|.\'*\'*) #(vi
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 1>&2; exit 1; }
  ;;
esac

	 cf_cv_curses_dir=$withval
else
  cf_cv_curses_dir=no
fi


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

case $cf_with_screen in #(vi
termcap|terminfo) #(we will determine which it really is
	;;
curses) #(vi
	use_curses=yes
	;;
ncurses) #(vi
	use_curses=yes
	use_ncurses=yes
	;;
ncursesw) #(vi
	use_curses=yes
	use_ncurses=yes
	;;
pdcurses) #(vi
	use_curses=yes
	;;
none)
	echo $ac_n "checking if you want to use ncurses library""... $ac_c" 1>&6
echo "configure:5658: checking if you want to use ncurses library" >&5
	
# Check whether --with-ncurses or --without-ncurses was given.
if test "${with_ncurses+set}" = set; then
  withval="$with_ncurses"
  use_ncurses=$withval
else
  use_ncurses=no
fi

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

	echo $ac_n "checking if you want curses rather than termcap interface""... $ac_c" 1>&6
echo "configure:5671: checking if you want curses rather than termcap interface" >&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
    cf_with_screen=curses;  use_curses=$withval 
  else
    cf_with_screen=termcap; use_curses=no
  fi
else
  enableval=no 
  cf_with_screen=termcap; use_curses=no
  
fi

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

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

	case $cf_with_screen in #(vi
	ncurses) #(vi
		

cf_ncuhdr_root=ncurses

test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && \
CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"

echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
echo "configure:5708: checking for $cf_ncuhdr_root header in include-path" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
	for cf_header in $cf_header_list
	do
		
	cat > conftest.$ac_ext <<EOF
#line 5719 "configure"
#include "confdefs.h"


#include <$cf_header>
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:5740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_h=$cf_header
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_ncurses_h=no
fi
rm -f conftest*

		test "$cf_cv_ncurses_h" != no && break
	done

fi

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

if test "$cf_cv_ncurses_h" != no ; then
	cf_cv_ncurses_header=$cf_cv_ncurses_h
else
echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
echo "configure:5763: checking for $cf_ncuhdr_root include-path" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	test -n "$verbose" && echo
	cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME"
	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
test -d $HOME/$cf_ncuhdr_root && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME/$cf_ncuhdr_root"
	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing include-directories under /usr/local"
	test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
	test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
	test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
	test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing include-directories under /opt"
	test -d /opt/include &&             cf_search="$cf_search /opt/include"
	test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
	test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
	test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing include-directories under /usr"
	test -d /usr/include &&             cf_search="$cf_search /usr/include"
	test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
	test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
	test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
}

test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
test -d "$includedir" && {
	test -d $includedir &&    cf_search="$cf_search $includedir"
	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
}

test "$oldincludedir" != NONE && \
test "$oldincludedir" != "/usr/include" && \
test -d "$oldincludedir" && {
	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
}


	test -n "$verbose" && echo search path $cf_search
	cf_save2_CPPFLAGS="$CPPFLAGS"
	for cf_incdir in $cf_search
	do
		
for cf_add_incdir in $cf_incdir
do
	while true
	do
		case $cf_add_incdir in
		/usr/include) # (vi
			;;
		/usr/local/include) # (vi
			if test "$GCC" = yes
			then
				cf_save_CPPFLAGS="$CPPFLAGS"
				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
				cat > conftest.$ac_ext <<EOF
#line 5858 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:5865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest*
			fi
			;;
		*) # (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

		for cf_header in \
			ncurses.h \
			curses.h
		do
			
	cat > conftest.$ac_ext <<EOF
#line 5892 "configure"
#include "confdefs.h"


#include <$cf_header>
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:5913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_h2=$cf_header
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_ncurses_h2=no
fi
rm -f conftest*

			if test "$cf_cv_ncurses_h2" != no ; then
				cf_cv_ncurses_h2=$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
		CPPFLAGS="$cf_save2_CPPFLAGS"
		test "$cf_cv_ncurses_h2" != no && break
	done
	test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
	
fi

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

	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
	fi
	
for cf_add_incdir in $cf_1st_incdir
do
	while true
	do
		case $cf_add_incdir in
		/usr/include) # (vi
			;;
		/usr/local/include) # (vi
			if test "$GCC" = yes
			then
				cf_save_CPPFLAGS="$CPPFLAGS"
				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
				cat > conftest.$ac_ext <<EOF
#line 5960 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:5967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest*
			fi
			;;
		*) # (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


fi

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


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
ncurses/curses.h|ncurses/ncurses.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF

	;;
ncursesw/curses.h|ncursesw/ncurses.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
EOF

	;;
esac


echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:6022: 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$$
	rm -f $cf_tempfile
	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:6048: \"$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 6057 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>
#include <stdio.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:6081: \"$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`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

	rm -f $cf_tempfile

fi

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



		

cf_nculib_root=ncurses
	# 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:6112: 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 6120 "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:6131: \"$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:6147: 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 6155 "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:6166: \"$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).
	if test "$cf_nculib_root" = ncurses ; then
		echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:6198: 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 6206 "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:6217: \"$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

	fi
	;;
esac

LIBS="$cf_ncurses_LIBS $LIBS"

if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
	LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
else
	
	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
	cf_libdir=""
	echo $ac_n "checking for initscr""... $ac_c" 1>&6
echo "configure:6251: 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 6256 "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:6279: \"$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
  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
  echo "$ac_t""no" 1>&6

		cf_save_LIBS="$LIBS"
		echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
echo "configure:6299: checking for initscr in -l$cf_nculib_root" >&5
		LIBS="-l$cf_nculib_root $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 6302 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
			
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
			cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME"
	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
test -d $HOME/$cf_nculib_root && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME/$cf_nculib_root"
	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr/local"
	test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
	test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
	test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
	test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing lib-directories under /opt"
	test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
	test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
	test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
	test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr"
	test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
	test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
	test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
	test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
}

			for cf_libdir in $cf_search
			do
				echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
echo "configure:6378: checking for -l$cf_nculib_root in $cf_libdir" >&5
				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
				cat > conftest.$ac_ext <<EOF
#line 6381 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:6388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=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

eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root

if test $cf_found_library = no ; then
	{ echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
fi


fi

if test -n "$cf_ncurses_LIBS" ; then
	echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
echo "configure:6419: checking if we can link $cf_nculib_root 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 6428 "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:6435: \"$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


cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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


		;;
	ncursesw) #(vi
		
for cf_hdr in stdlib.h wchar.h wctype.h
do
	echo $ac_n "checking for $cf_hdr""... $ac_c" 1>&6
echo "configure:6462: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 6464 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <$cf_hdr>

EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6472: \"$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*
  cf_found=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_found=no
fi
rm -f conftest*
echo "$ac_t""$cf_found" 1>&6
if test $cf_found = yes ; then
	
cf_tr_hdr=`echo "$cf_hdr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

	cat >> confdefs.h <<EOF
#define HAVE_${cf_tr_hdr} 1
EOF

fi
done

		
  echo $ac_n "checking for wide char and multibyte support""... $ac_c" 1>&6
echo "configure:6499: checking for wide char and multibyte support" >&5
if eval "test \"`echo '$''{'am_cv_multibyte_able'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 6504 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#	include <stdlib.h>
#endif /* HAVE_STDLIB_H */
#ifdef HAVE_WCHAR_H
#	include <wchar.h>
#endif /* HAVE_WCHAR_H */
#ifdef HAVE_WCTYPE_H
#	include <wctype.h>
#endif /* HAVE_WCTYPE_H */

int main() {
char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
      char ocb[5];
      wchar_t wcb[5];
      wchar_t wcb2[5];
      wchar_t format[3];

      putwc(0, 0);
      fputwc(0, 0);
      fwide(0, 0);
      mbtowc(wcb, icb, MB_CUR_MAX);
      mbstowcs(wcb, icb, 5);
      iswprint((wint_t) wcb[0]);
      wcslen(wcb);
      /* wcsnlen(wcb, 4); */
      wcwidth((wint_t) wcb[0]);
      wcswidth(wcb, 5);
      wcstombs(ocb, wcb, 5);
      mbstowcs(format, "%s", 2);
      swprintf(wcb, 5, format, "test");
      wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:6540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_multibyte_able=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_save_LIBS="$LIBS"
      LIBS="-lutf8 $LIBS"
      cat > conftest.$ac_ext <<EOF
#line 6550 "configure"
#include "confdefs.h"
#include <libutf8.h>
int main() {
char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
        char ocb[5];
        wchar_t wcb[5];
        wchar_t wcb2[5];
        wchar_t format[3];

        putwc(0, 0);
        fputwc(0, 0);
        fwide(0, 0);
        mbtowc(wcb, icb, MB_CUR_MAX);
        mbstowcs(wcb, icb, 5);
        iswprint((wint_t) wcb[0]);
        wcslen(wcb);
        /* wcsnlen(wcb, 4); */
        wcwidth((wint_t) wcb[0]);
        wcswidth(wcb, 5);
        wcstombs(ocb, wcb, 5);
        mbstowcs(format, "%s", 2);
        swprintf(wcb, 5, format, "test");
        wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:6576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_multibyte_able=libutf8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_multibyte_able=no
fi
rm -f conftest*
      LIBS="$cf_save_LIBS"
   
fi
rm -f conftest*
  
fi

echo "$ac_t""$am_cv_multibyte_able" 1>&6
  if test "$am_cv_multibyte_able" != no; then
    if test "$am_cv_multibyte_able" = libutf8; then
      cat >> confdefs.h <<\EOF
#define HAVE_LIBUTF8_H 1
EOF

      LIBS="-lutf8 $LIBS"
    fi
    cat >> confdefs.h <<\EOF
#define MULTIBYTE_ABLE 1
EOF

  fi

		

cf_ncuhdr_root=ncursesw

test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && \
CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"

echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
echo "configure:6617: checking for $cf_ncuhdr_root header in include-path" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
	for cf_header in $cf_header_list
	do
		
	cat > conftest.$ac_ext <<EOF
#line 6628 "configure"
#include "confdefs.h"


#define _XOPEN_SOURCE_EXTENDED
#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */

#include <$cf_header>
int main() {

#ifdef NCURSES_VERSION

#ifndef WACS_BSSB
	make an error
#endif

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:6657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_h=$cf_header
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_ncurses_h=no
fi
rm -f conftest*

		test "$cf_cv_ncurses_h" != no && break
	done

fi

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

if test "$cf_cv_ncurses_h" != no ; then
	cf_cv_ncurses_header=$cf_cv_ncurses_h
else
echo $ac_n "checking for $cf_ncuhdr_root include-path""... $ac_c" 1>&6
echo "configure:6680: checking for $cf_ncuhdr_root include-path" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_h2'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	test -n "$verbose" && echo
	cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME"
	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
test -d $HOME/$cf_ncuhdr_root && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME/$cf_ncuhdr_root"
	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing include-directories under /usr/local"
	test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
	test -d /usr/local/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
	test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
	test -d /usr/local/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing include-directories under /opt"
	test -d /opt/include &&             cf_search="$cf_search /opt/include"
	test -d /opt/include/$cf_ncuhdr_root &&          cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
	test -d /opt/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
	test -d /opt/$cf_ncuhdr_root/include &&          cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing include-directories under /usr"
	test -d /usr/include &&             cf_search="$cf_search /usr/include"
	test -d /usr/include/$cf_ncuhdr_root &&          cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
	test -d /usr/include/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
	test -d /usr/$cf_ncuhdr_root/include &&          cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
}

test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
test -d "$includedir" && {
	test -d $includedir &&    cf_search="$cf_search $includedir"
	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
}

test "$oldincludedir" != NONE && \
test "$oldincludedir" != "/usr/include" && \
test -d "$oldincludedir" && {
	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
}


	test -n "$verbose" && echo search path $cf_search
	cf_save2_CPPFLAGS="$CPPFLAGS"
	for cf_incdir in $cf_search
	do
		
for cf_add_incdir in $cf_incdir
do
	while true
	do
		case $cf_add_incdir in
		/usr/include) # (vi
			;;
		/usr/local/include) # (vi
			if test "$GCC" = yes
			then
				cf_save_CPPFLAGS="$CPPFLAGS"
				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
				cat > conftest.$ac_ext <<EOF
#line 6775 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:6782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest*
			fi
			;;
		*) # (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

		for cf_header in \
			ncurses.h \
			curses.h
		do
			
	cat > conftest.$ac_ext <<EOF
#line 6809 "configure"
#include "confdefs.h"


#define _XOPEN_SOURCE_EXTENDED
#undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
#define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */

#include <$cf_header>
int main() {

#ifdef NCURSES_VERSION

#ifndef WACS_BSSB
	make an error
#endif

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:6838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_h2=$cf_header
	
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_ncurses_h2=no
fi
rm -f conftest*

			if test "$cf_cv_ncurses_h2" != no ; then
				cf_cv_ncurses_h2=$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
		CPPFLAGS="$cf_save2_CPPFLAGS"
		test "$cf_cv_ncurses_h2" != no && break
	done
	test "$cf_cv_ncurses_h2" = no && { echo "configure: error: not found" 1>&2; exit 1; }
	
fi

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

	cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
	fi
	
for cf_add_incdir in $cf_1st_incdir
do
	while true
	do
		case $cf_add_incdir in
		/usr/include) # (vi
			;;
		/usr/local/include) # (vi
			if test "$GCC" = yes
			then
				cf_save_CPPFLAGS="$CPPFLAGS"
				CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
				cat > conftest.$ac_ext <<EOF
#line 6885 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:6892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPPFLAGS="$cf_save_CPPFLAGS"
fi
rm -f conftest*
			fi
			;;
		*) # (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


fi

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


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
ncurses/curses.h|ncurses/ncurses.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSES_NCURSES_H 1
EOF

	;;
ncursesw/curses.h|ncursesw/ncurses.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSESW_NCURSES_H 1
EOF

	;;
esac


echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:6947: 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$$
	rm -f $cf_tempfile
	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:6973: \"$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 6982 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>
#include <stdio.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:7006: \"$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`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

	rm -f $cf_tempfile

fi

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



		

cf_nculib_root=ncursesw
	# 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:7037: 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 7045 "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:7056: \"$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:7072: 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 7080 "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:7091: \"$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).
	if test "$cf_nculib_root" = ncurses ; then
		echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:7123: 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 7131 "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:7142: \"$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

	fi
	;;
esac

LIBS="$cf_ncurses_LIBS $LIBS"

if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
	LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
else
	
	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
	cf_libdir=""
	echo $ac_n "checking for initscr""... $ac_c" 1>&6
echo "configure:7176: 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 7181 "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:7204: \"$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
  eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
else
  echo "$ac_t""no" 1>&6

		cf_save_LIBS="$LIBS"
		echo $ac_n "checking for initscr in -l$cf_nculib_root""... $ac_c" 1>&6
echo "configure:7224: checking for initscr in -l$cf_nculib_root" >&5
		LIBS="-l$cf_nculib_root $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 7227 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:7234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
			
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
			cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME"
	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
test -d $HOME/$cf_nculib_root && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME/$cf_nculib_root"
	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr/local"
	test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
	test -d /usr/local/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
	test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
	test -d /usr/local/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing lib-directories under /opt"
	test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
	test -d /opt/lib/$cf_nculib_root &&          cf_search="$cf_search /opt/lib/$cf_nculib_root"
	test -d /opt/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
	test -d /opt/$cf_nculib_root/lib &&          cf_search="$cf_search /opt/$cf_nculib_root/lib"
	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr"
	test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
	test -d /usr/lib/$cf_nculib_root &&          cf_search="$cf_search /usr/lib/$cf_nculib_root"
	test -d /usr/lib/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
	test -d /usr/$cf_nculib_root/lib &&          cf_search="$cf_search /usr/$cf_nculib_root/lib"
}

			for cf_libdir in $cf_search
			do
				echo $ac_n "checking for -l$cf_nculib_root in $cf_libdir""... $ac_c" 1>&6
echo "configure:7303: checking for -l$cf_nculib_root in $cf_libdir" >&5
				LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
				cat > conftest.$ac_ext <<EOF
#line 7306 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:7313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 		 eval 'cf_cv_have_lib_'$cf_nculib_root'=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

eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root

if test $cf_found_library = no ; then
	{ echo "configure: error: Cannot link $cf_nculib_root library" 1>&2; exit 1; }
fi


fi

if test -n "$cf_ncurses_LIBS" ; then
	echo $ac_n "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS""... $ac_c" 1>&6
echo "configure:7344: checking if we can link $cf_nculib_root 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 7353 "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:7360: \"$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


cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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


		
echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:7383: 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$$
	rm -f $cf_tempfile
	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:7409: \"$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 7418 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>
#include <stdio.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:7442: \"$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`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

	rm -f $cf_tempfile

fi

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


		
echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
echo "configure:7465: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 7471 "configure"
#include "confdefs.h"

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

	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:7483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_need_xopen_extension=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 7491 "configure"
#include "confdefs.h"

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

	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:7504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_need_xopen_extension=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_need_xopen_extension=unknown
fi
rm -f conftest*
fi
rm -f conftest*
fi

echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"

		test "$cf_cv_need_xopen_extension" = unknown && { echo "configure: error: X/Open curses not found" 1>&2; exit 1; }
		;;
	curses) #(vi
		

echo $ac_n "checking for extra include directories""... $ac_c" 1>&6
echo "configure:7527: checking for extra include directories" >&5
if eval "test \"`echo '$''{'cf_cv_curses_incdir'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_curses_incdir=no
case $host_os in #(vi
hpux10.*|hpux11.*) #(vi
	test -d /usr/include/curses_colr && \
	cf_cv_curses_incdir="-I/usr/include/curses_colr"
	;;
sunos3*|sunos4*)
	test -d /usr/5lib && \
	test -d /usr/5include && \
	cf_cv_curses_incdir="-I/usr/5include"
	;;
esac

fi

echo "$ac_t""$cf_cv_curses_incdir" 1>&6
test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"

echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
echo "configure:7551: checking if we have identified curses headers" >&5
if eval "test \"`echo '$''{'cf_cv_ncurses_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_ncurses_header=none
for cf_header in \
	curses.h \
	ncurses.h \
	ncurses/curses.h \
	ncurses/ncurses.h
do
cat > conftest.$ac_ext <<EOF
#line 7564 "configure"
#include "confdefs.h"
#include <${cf_header}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:7571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_ncurses_header=$cf_header; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done

fi

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

if test "$cf_cv_ncurses_header" = none ; then
	{ echo "configure: error: No curses header-files found" 1>&2; exit 1; }
fi

# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
for ac_hdr in $cf_cv_ncurses_header
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7594: 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 7599 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done



		

echo $ac_n "checking if we have identified curses libraries""... $ac_c" 1>&6
echo "configure:7635: checking if we have identified curses libraries" >&5
cat > conftest.$ac_ext <<EOF
#line 7637 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:7644: \"$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" = no ; then
case $host_os in #(vi
freebsd*) #(vi
	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:7660: 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 7668 "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:7679: \"$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.*|hpux11.*) #(vi
	echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
echo "configure:7702: 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 7710 "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:7721: \"$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"
		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:7744: 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 7752 "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:7763: \"$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"
		CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
		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"
	;;
sunos3*|sunos4*)
	test -d /usr/5lib && \
	LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
	ac_cv_func_initscr=yes
	;;
esac

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

	if test ".${cf_cv_ncurses_version-no}" != .no
	then
		cf_check_list="ncurses curses cursesX"
	else
		cf_check_list="cursesX curses ncurses"
	fi

	# 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:7816: 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 7821 "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:7844: \"$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 $cf_check_list termcap termlib unknown
		do
			echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
echo "configure:7865: 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 7873 "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:7884: \"$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 $cf_check_list xcurses jcurses unknown
	do
		echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
echo "configure:7914: 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 7922 "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:7933: \"$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:7959: checking if we can link with $cf_curs_lib library" >&5
		cat > conftest.$ac_ext <<EOF
#line 7961 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:7968: \"$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_curs_lib" = "$cf_term_lib" ; then
		:
	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:7984: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
		cat > conftest.$ac_ext <<EOF
#line 7986 "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:7993: \"$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 8003 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:8010: \"$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


		
echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:8031: 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$$
	rm -f $cf_tempfile
	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:8057: \"$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 8066 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header-curses.h}>
#include <stdio.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:8090: \"$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`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -fr conftest*
fi

	rm -f $cf_tempfile

fi

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


		
echo $ac_n "checking if we must define _XOPEN_SOURCE_EXTENDED""... $ac_c" 1>&6
echo "configure:8113: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8119 "configure"
#include "confdefs.h"

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

	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:8131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_need_xopen_extension=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 8139 "configure"
#include "confdefs.h"

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

	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:8152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cf_cv_need_xopen_extension=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_need_xopen_extension=unknown
fi
rm -f conftest*
fi
rm -f conftest*
fi

echo "$ac_t""$cf_cv_need_xopen_extension" 1>&6
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"

		;;
	esac
fi

## substitute externally-installed PCRE library for our bundled version
echo $ac_n "checking if you want to use installed version of pcre""... $ac_c" 1>&6
echo "configure:8175: checking if you want to use installed version of pcre" >&5

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

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

cf_pcre_home=$PCRE_HOME
PCREDIR_MAKE=
PCREDIR_LIBS=
PCREDIR_CPPFLAGS=
case .$cf_pcre_home in #(vi
.no) #(vi
	# setup to compile the bundled PCRE:
	. $srcdir/pcre/version.sh
	
	
	
	
	;;
.yes) #(vi
	PCREDIR_MAKE='#'
	PCREDIR_LIBS="-lpcre"
	;;
.*)
	
case ".$cf_pcre_home" in #(vi
.\$\(*\)*|.\'*\'*) #(vi
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*prefix}*) #(vi
  eval cf_pcre_home="$cf_pcre_home"
  case ".$cf_pcre_home" in #(vi
  .NONE/*)
    cf_pcre_home=`echo $cf_pcre_home | sed -e s%NONE%$ac_default_prefix%`
    ;;
  esac
  ;; #(vi
.NONE/*)
  cf_pcre_home=`echo $cf_pcre_home | sed -e s%NONE%$ac_default_prefix%`
  ;;
*)
  { echo "configure: error: expected a pathname, not \"$cf_pcre_home\"" 1>&2; exit 1; }
  ;;
esac

	PCREDIR_MAKE='#'
	PCREDIR_LIBS="-L${cf_pcre_home}/lib -lpcre"
	PCREDIR_CPPFLAGS="-I${cf_pcre_home}/include"
	;;
esac





PCRE_MAKEFILE=
if test "$PCRE_HOME" = "no" ; then
	PCRE_MAKEFILE="$PCRE_MAKEFILE pcre/Makefile pcre/RunTest pcre/pcre.h"
fi

## debugging libraries (do this after other libraries)
debug_malloc=none

echo $ac_n "checking if you want to link with dbmalloc for testing""... $ac_c" 1>&6
echo "configure:8248: checking if you want to link with dbmalloc for testing" >&5

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

echo "$ac_t""$with_dbmalloc" 1>&6
if test "$with_dbmalloc" = yes ; then
	ac_safe=`echo "dbmalloc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dbmalloc.h""... $ac_c" 1>&6
echo "configure:8262: 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 8267 "configure"
#include "confdefs.h"
#include <dbmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8272: \"$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
  echo $ac_n "checking for debug_malloc in -ldbmalloc""... $ac_c" 1>&6
echo "configure:8289: 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 8297 "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:8308: \"$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
  debug_malloc=DBMALLOC
else
  echo "$ac_t""no" 1>&6
fi

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

fi


echo $ac_n "checking if you want to link with dmalloc for testing""... $ac_c" 1>&6
echo "configure:8336: checking if you want to link with dmalloc for testing" >&5

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

echo "$ac_t""$with_dmalloc" 1>&6
if test "$with_dmalloc" = yes ; then
	ac_safe=`echo "dmalloc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dmalloc.h""... $ac_c" 1>&6
echo "configure:8350: 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 8355 "configure"
#include "confdefs.h"
#include <dmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8360: \"$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
  echo $ac_n "checking for dmalloc_debug in -ldmalloc""... $ac_c" 1>&6
echo "configure:8377: 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 8385 "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:8396: \"$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
  debug_malloc=DMALLOC
else
  echo "$ac_t""no" 1>&6
fi

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

fi


echo $ac_n "checking if you want debugging-trace""... $ac_c" 1>&6
echo "configure:8424: 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"
  use_trace=yes
else
  use_trace=no
fi

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

	EXTRAOBJS="$EXTRAOBJS trace.o"
	echo $ac_n "checking for _tracef""... $ac_c" 1>&6
echo "configure:8442: checking for _tracef" >&5
if eval "test \"`echo '$''{'ac_cv_func__tracef'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8447 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char _tracef(); 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 _tracef();

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__tracef) || defined (__stub____tracef)
choke me
#else
_tracef();
#endif

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

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

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

	echo $ac_n "checking for _tracef in -l${cf_with_screen}_g""... $ac_c" 1>&6
echo "configure:8492: checking for _tracef in -l${cf_with_screen}_g" >&5
ac_lib_var=`echo ${cf_with_screen}_g'_'_tracef | 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_with_screen}_g  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8500 "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 _tracef();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE__TRACEF 1
EOF

		 LIBS=`echo "$LIBS" | sed -e s/-l${cf_with_screen}// -e s/-lcurses//`
		 LIBS="-l${cf_with_screen}_g $LIBS"
else
  echo "$ac_t""no" 1>&6
fi

fi

fi


## options for miscellaneous definitions
echo $ac_n "checking for domain-name""... $ac_c" 1>&6
echo "configure:8543: 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:8572: 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-news.$DOMAIN_NAME}"
fi
test -z "$withval" && withval=no
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 for mailgroups""... $ac_c" 1>&6
echo "configure:8638: checking whether to use MH style mail handling for mailgroups" >&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:8657: 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:8683: 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:8700: 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 RFC2047 and break long lines""... $ac_c" 1>&6
echo "configure:8719: checking whether to strictly observe RFC2047 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:8738: 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:8764: 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:8786: 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 enable locale support""... $ac_c" 1>&6
echo "configure:8808: 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:8827: 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:8846: 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:8865: 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:8884: 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 enable piping support""... $ac_c" 1>&6
echo "configure:8903: 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:8922: 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:8941: 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:8967: 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:8994: 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

### on some old systems the WIFEXITED()/WEXITSTATUS() macros do not work
echo $ac_n "checking whether to ignore system()s return value""... $ac_c" 1>&6
echo "configure:9014: checking whether to ignore system()s return value" >&5

# Check whether --enable-broken-system-fix or --disable-broken-system-fix was given.
if test "${enable_broken_system_fix+set}" = set; then
  enableval="$enable_broken_system_fix"
  test "$enableval" != yes && enableval=no
  if test "$enableval" != "no" ; then
    cat >> confdefs.h <<\EOF
#define IGNORE_SYSTEM_STATUS 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:9034: 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
  ;;
..|./*|.\\*) #(vi
  ;;
.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
  ;;
.\${*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, not \"$withval\"" 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


### check for ipv6 support
echo $ac_n "checking whether to enable IPv6""... $ac_c" 1>&6
echo "configure:9077: checking whether to enable IPv6" >&5

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

echo "$ac_t""$enableval" 1>&6
if test "$enableval" = "yes"; then
	

echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6
echo "configure:9098: checking ipv6 stack type" >&5
if eval "test \"`echo '$''{'cf_cv_ipv6type'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_ipv6type=unknown
for i in solaris inria kame linux-glibc linux-libinet6 toshiba v6d zeta
do
	case $i in #(vi
	solaris) #(vi
		if test "SunOS" = "`uname -s`"
		then
		  if test -f /usr/include/netinet/ip6.h
		  then
			cf_cv_ipv6type=$i
		  fi
		fi
		;;
	inria) #(vi
				cat > conftest.$ac_ext <<EOF
#line 9118 "configure"
#include "confdefs.h"

#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	kame) #(vi
				cat > conftest.$ac_ext <<EOF
#line 9136 "configure"
#include "confdefs.h"

#include <netinet/in.h>
#ifdef __KAME__
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	linux-glibc) #(vi
				cat > conftest.$ac_ext <<EOF
#line 9154 "configure"
#include "confdefs.h"

#include <features.h>
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	linux-libinet6) #(vi
				if test -d /usr/inet6
		then
			cf_cv_ipv6type=$i
		elif test -f /usr/include/netinet/ip6.h
		then
			cf_cv_ipv6type=$i
		fi
		;;
	toshiba) #(vi
		cat > conftest.$ac_ext <<EOF
#line 9181 "configure"
#include "confdefs.h"

#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	v6d) #(vi
		cat > conftest.$ac_ext <<EOF
#line 9199 "configure"
#include "confdefs.h"

#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	zeta)
		cat > conftest.$ac_ext <<EOF
#line 9217 "configure"
#include "confdefs.h"

#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cf_cv_ipv6type=$i
fi
rm -f conftest*

		;;
	esac
	if test "$cf_cv_ipv6type" != "unknown"; then
		break
	fi
done

fi

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




cf_ipv6lib=none
cf_ipv6dir=none

echo $ac_n "checking for IPv6 library if required""... $ac_c" 1>&6
echo "configure:9250: checking for IPv6 library if required" >&5
case $cf_cv_ipv6type in #(vi
solaris) #(vi
	;;
inria) #(vi
	;;
kame) #(vi
		cf_ipv6lib=inet6
	cf_ipv6dir=v6
	;;
linux-glibc) #(vi
	;;
linux-libinet6) #(vi
		cf_ipv6lib=inet6
	cf_ipv6dir=inet6
	;;
toshiba) #(vi
	cf_ipv6lib=inet6
	cf_ipv6dir=v6
	;;
v6d) #(vi
	cf_ipv6lib=v6
	cf_ipv6dir=v6
	;;
zeta)
	cf_ipv6lib=inet6
	cf_ipv6dir=v6
	;;
esac
echo "$ac_t""$cf_ipv6lib" 1>&6

if test "$cf_ipv6lib" != "none"; then

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

#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
int main() {
getaddrinfo(0, 0, 0, 0)
; return 0; }
EOF
if { (eval echo configure:9295: \"$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*
  
	cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME"
	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
	test -d $HOME/include/$cf_ipv6dir &&       cf_search="$cf_search $HOME/include/$cf_ipv6dir"
	test -d $HOME/include/$cf_ipv6dir/include &&    cf_search="$cf_search $HOME/include/$cf_ipv6dir/include"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_ipv6dir to the actual package location:
test -d $HOME/$cf_ipv6dir && {
	test -n "$verbose" && echo "	... testing include-directories under $HOME/$cf_ipv6dir"
	test -d $HOME/$cf_ipv6dir/include &&       cf_search="$cf_search $HOME/$cf_ipv6dir/include"
	test -d $HOME/$cf_ipv6dir/include/$cf_ipv6dir &&    cf_search="$cf_search $HOME/$cf_ipv6dir/include/$cf_ipv6dir"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing include-directories under /usr/local"
	test -d /usr/local/include &&       cf_search="$cf_search /usr/local/include"
	test -d /usr/local/include/$cf_ipv6dir &&    cf_search="$cf_search /usr/local/include/$cf_ipv6dir"
	test -d /usr/local/include/$cf_ipv6dir/include && cf_search="$cf_search /usr/local/include/$cf_ipv6dir/include"
	test -d /usr/local/$cf_ipv6dir/include &&    cf_search="$cf_search /usr/local/$cf_ipv6dir/include"
	test -d /usr/local/$cf_ipv6dir/include/$cf_ipv6dir && cf_search="$cf_search /usr/local/$cf_ipv6dir/include/$cf_ipv6dir"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/$cf_ipv6dir &&       cf_search="$cf_search $prefix/include/$cf_ipv6dir"
	test -d $prefix/include/$cf_ipv6dir/include &&    cf_search="$cf_search $prefix/include/$cf_ipv6dir/include"
	test -d $prefix/$cf_ipv6dir/include &&       cf_search="$cf_search $prefix/$cf_ipv6dir/include"
	test -d $prefix/$cf_ipv6dir/include/$cf_ipv6dir &&    cf_search="$cf_search $prefix/$cf_ipv6dir/include/$cf_ipv6dir"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing include-directories under /opt"
	test -d /opt/include &&             cf_search="$cf_search /opt/include"
	test -d /opt/include/$cf_ipv6dir &&          cf_search="$cf_search /opt/include/$cf_ipv6dir"
	test -d /opt/include/$cf_ipv6dir/include &&       cf_search="$cf_search /opt/include/$cf_ipv6dir/include"
	test -d /opt/$cf_ipv6dir/include &&          cf_search="$cf_search /opt/$cf_ipv6dir/include"
	test -d /opt/$cf_ipv6dir/include/$cf_ipv6dir &&       cf_search="$cf_search /opt/$cf_ipv6dir/include/$cf_ipv6dir"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing include-directories under /usr"
	test -d /usr/include &&             cf_search="$cf_search /usr/include"
	test -d /usr/include/$cf_ipv6dir &&          cf_search="$cf_search /usr/include/$cf_ipv6dir"
	test -d /usr/include/$cf_ipv6dir/include &&       cf_search="$cf_search /usr/include/$cf_ipv6dir/include"
	test -d /usr/$cf_ipv6dir/include &&          cf_search="$cf_search /usr/$cf_ipv6dir/include"
}

test "$includedir" != NONE && \
test "$includedir" != "/usr/include" && \
test -d "$includedir" && {
	test -d $includedir &&    cf_search="$cf_search $includedir"
	test -d $includedir/$cf_ipv6dir && cf_search="$cf_search $includedir/$cf_ipv6dir"
}

test "$oldincludedir" != NONE && \
test "$oldincludedir" != "/usr/include" && \
test -d "$oldincludedir" && {
	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
	test -d $oldincludedir/$cf_ipv6dir && cf_search="$cf_search $oldincludedir/$cf_ipv6dir"
}


	for cf_incdir in $cf_search
	do
		cf_header=$cf_incdir/netinet/ip6.h
		if test -f $cf_header
		then
			CPPFLAGS="$CPPFLAGS -I$cf_incdir"
			test -n "$verbose" && echo "	... found $cf_header" 1>&6
			break
		fi
		test -n "$verbose" && echo "	... tested $cf_header" 1>&6
	done
	
fi
rm -f conftest*

	
	eval 'cf_cv_have_lib_'$cf_ipv6lib'=no'
	cf_libdir=""
	echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
echo "configure:9392: checking for getaddrinfo" >&5
if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9397 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char getaddrinfo(); 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 getaddrinfo();

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_getaddrinfo) || defined (__stub___getaddrinfo)
choke me
#else
getaddrinfo();
#endif

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

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

		cf_save_LIBS="$LIBS"
		echo $ac_n "checking for getaddrinfo in -l$cf_ipv6lib""... $ac_c" 1>&6
echo "configure:9440: checking for getaddrinfo in -l$cf_ipv6lib" >&5
		LIBS="-l$cf_ipv6lib $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 9443 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
int main() {
getaddrinfo(0, 0, 0, 0)
; return 0; }
EOF
if { (eval echo configure:9454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 eval 'cf_cv_have_lib_'$cf_ipv6lib'=yes'
			
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
			cf_search=""

test -d $HOME && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME"
	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
	test -d $HOME/lib/$cf_ipv6dir &&       cf_search="$cf_search $HOME/lib/$cf_ipv6dir"
	test -d $HOME/lib/$cf_ipv6dir/lib &&    cf_search="$cf_search $HOME/lib/$cf_ipv6dir/lib"
}

# For other stuff under the home directory, it should be sufficient to put
# a symbolic link for $HOME/$cf_ipv6dir to the actual package location:
test -d $HOME/$cf_ipv6dir && {
	test -n "$verbose" && echo "	... testing lib-directories under $HOME/$cf_ipv6dir"
	test -d $HOME/$cf_ipv6dir/lib &&       cf_search="$cf_search $HOME/$cf_ipv6dir/lib"
	test -d $HOME/$cf_ipv6dir/lib/$cf_ipv6dir &&    cf_search="$cf_search $HOME/$cf_ipv6dir/lib/$cf_ipv6dir"
}

test "$prefix" != /usr/local && \
test -d /usr/local && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr/local"
	test -d /usr/local/lib &&       cf_search="$cf_search /usr/local/lib"
	test -d /usr/local/lib/$cf_ipv6dir &&    cf_search="$cf_search /usr/local/lib/$cf_ipv6dir"
	test -d /usr/local/lib/$cf_ipv6dir/lib && cf_search="$cf_search /usr/local/lib/$cf_ipv6dir/lib"
	test -d /usr/local/$cf_ipv6dir/lib &&    cf_search="$cf_search /usr/local/$cf_ipv6dir/lib"
	test -d /usr/local/$cf_ipv6dir/lib/$cf_ipv6dir && cf_search="$cf_search /usr/local/$cf_ipv6dir/lib/$cf_ipv6dir"
}

test "$prefix" != NONE && \
test -d $prefix && {
	test -n "$verbose" && echo "	... testing lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/$cf_ipv6dir &&       cf_search="$cf_search $prefix/lib/$cf_ipv6dir"
	test -d $prefix/lib/$cf_ipv6dir/lib &&    cf_search="$cf_search $prefix/lib/$cf_ipv6dir/lib"
	test -d $prefix/$cf_ipv6dir/lib &&       cf_search="$cf_search $prefix/$cf_ipv6dir/lib"
	test -d $prefix/$cf_ipv6dir/lib/$cf_ipv6dir &&    cf_search="$cf_search $prefix/$cf_ipv6dir/lib/$cf_ipv6dir"
}

test "$prefix" != /opt && \
test -d /opt && {
	test -n "$verbose" && echo "	... testing lib-directories under /opt"
	test -d /opt/lib &&             cf_search="$cf_search /opt/lib"
	test -d /opt/lib/$cf_ipv6dir &&          cf_search="$cf_search /opt/lib/$cf_ipv6dir"
	test -d /opt/lib/$cf_ipv6dir/lib &&       cf_search="$cf_search /opt/lib/$cf_ipv6dir/lib"
	test -d /opt/$cf_ipv6dir/lib &&          cf_search="$cf_search /opt/$cf_ipv6dir/lib"
	test -d /opt/$cf_ipv6dir/lib/$cf_ipv6dir &&       cf_search="$cf_search /opt/$cf_ipv6dir/lib/$cf_ipv6dir"
}

test "$prefix" != /usr && \
test -d /usr && {
	test -n "$verbose" && echo "	... testing lib-directories under /usr"
	test -d /usr/lib &&             cf_search="$cf_search /usr/lib"
	test -d /usr/lib/$cf_ipv6dir &&          cf_search="$cf_search /usr/lib/$cf_ipv6dir"
	test -d /usr/lib/$cf_ipv6dir/lib &&       cf_search="$cf_search /usr/lib/$cf_ipv6dir/lib"
	test -d /usr/$cf_ipv6dir/lib &&          cf_search="$cf_search /usr/$cf_ipv6dir/lib"
}

			for cf_libdir in $cf_search
			do
				echo $ac_n "checking for -l$cf_ipv6lib in $cf_libdir""... $ac_c" 1>&6
echo "configure:9523: checking for -l$cf_ipv6lib in $cf_libdir" >&5
				LIBS="-L$cf_libdir -l$cf_ipv6lib $cf_save_LIBS"
				cat > conftest.$ac_ext <<EOF
#line 9526 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
int main() {
getaddrinfo(0, 0, 0, 0)
; return 0; }
EOF
if { (eval echo configure:9537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
			 		 eval 'cf_cv_have_lib_'$cf_ipv6lib'=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

eval 'cf_found_library=$cf_cv_have_lib_'$cf_ipv6lib


	if test $cf_found_library = no ; then
		{ echo "configure: error: No $cf_ipv6lib library found, cannot continue.  You must fetch lib$cf_ipv6lib.a
from an appropriate IPv6 kit and compile beforehand." 1>&2; exit 1; }
	fi
fi




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

#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>

#define expect(a,b) if (strcmp(a,b) != 0) goto bad

int main()
{
   int passive, gaierr, inet4 = 0, inet6 = 0;
   struct addrinfo hints, *ai, *aitop;
   char straddr[INET6_ADDRSTRLEN], strport[16];

   for (passive = 0; passive <= 1; passive++) {
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = AF_UNSPEC;
     hints.ai_flags = passive ? AI_PASSIVE : 0;
     hints.ai_socktype = SOCK_STREAM;
     if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
       (void)gai_strerror(gaierr);
       goto bad;
     }
     for (ai = aitop; ai; ai = ai->ai_next) {
       if (ai->ai_addr == NULL ||
           ai->ai_addrlen == 0 ||
           getnameinfo(ai->ai_addr, ai->ai_addrlen,
                       straddr, sizeof(straddr), strport, sizeof(strport),
                       NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
         goto bad;
       }
       switch (ai->ai_family) {
       case AF_INET:
         expect(strport, "54321");
         if (passive) {
           expect(straddr, "0.0.0.0");
         } else {
           expect(straddr, "127.0.0.1");
         }
         inet4++;
         break;
       case AF_INET6:
         expect(strport, "54321");
         if (passive) {
           expect(straddr, "::");
         } else {
           expect(straddr, "::1");
         }
         inet6++;
         break;
       case AF_UNSPEC:
         goto bad;
         break;
       default:
         /* another family support? */
         break;
       }
     }
   }

   if (!(inet4 == 0 || inet4 == 2))
     goto bad;
   if (!(inet6 == 0 || inet6 == 2))
     goto bad;

   if (aitop)
     freeaddrinfo(aitop);
   exit(0);

  bad:
   if (aitop)
     freeaddrinfo(aitop);
   exit(1);
}

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


fi

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

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

fi


if test "$cf_cv_getaddrinfo" != "yes"; then
	if test "$cf_cv_ipv6type" != "linux"; then
		echo "configure: warning: You must get working getaddrinfo() function,
or you can specify "--disable-ipv6"" 1>&2
	else
		echo "configure: warning: The getaddrinfo() implementation on your system seems be buggy.
You should upgrade your system library to the newest version
of GNU C library (aka glibc)." 1>&2
	fi
fi


fi
for ac_func in getaddrinfo getnameinfo
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9702: 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 9707 "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:9730: \"$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
LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
fi
done



### 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:9759: 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:9784: 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
SHELL = /bin/sh
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:9829: 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 9834 "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:9883: \"$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:9904: 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 9911 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:9918: \"$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:9945: 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 9951 "configure"
#include "confdefs.h"

#define string(n) #n
int main() {
char *s = string(token)
; return 0; }
EOF
if { (eval echo configure:9959: \"$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:9980: 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 9986 "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:9994: \"$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:10015: 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 10021 "configure"
#include "confdefs.h"

int main() {
extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)
; return 0; }
EOF
if { (eval echo configure:10028: \"$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




###	Checks for header files.
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:10051: 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 10056 "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:10064: \"$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 10081 "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 10099 "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 10120 "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:10131: \"$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:10159: 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 10164 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:10172: \"$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:10197: 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 10205 "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:10216: \"$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:10238: 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 10246 "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:10257: \"$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:10280: 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 10285 "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:10294: \"$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:10315: 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 10320 "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:10336: \"$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 cf_hdr in \
	argz.h \
	arpa/inet.h \
	curses.h \
	errno.h \
	fcntl.h \
	getopt.h \
	ioctl.h \
	langinfo.h \
	libc.h \
	locale.h \
	malloc.h \
	net/socket.h \
	netdb.h \
	netinet/in.h \
	netlib.h \
	nl_types.h \
	nomacros.h \
	paths.h	\
	poll.h \
	prototypes.h \
	pwd.h \
	sgtty.h \
	socket.h \
	stdarg.h \
	stdbool.h \
	stddef.h \
	stdlib.h \
	string.h \
	strings.h \
	stropts.h \
	sys/bsdtypes.h \
	sys/errno.h \
	sys/file.h \
	sys/ioctl.h \
	sys/param.h \
	sys/poll.h \
	sys/ptem.h \
	sys/pty.h \
	sys/select.h \
	sys/stat.h \
	sys/stream.h \
	sys/socket.h \
	sys/time.h \
	sys/timeb.h \
	sys/times.h \
	sys/types.h \
	sys/utsname.h \
	term.h \
	termio.h \
	time.h \
	unistd.h \
	varargs.h \
	wchar.h \
	wctype.h \

do
	echo $ac_n "checking for $cf_hdr""... $ac_c" 1>&6
echo "configure:10415: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 10417 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <$cf_hdr>

EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:10425: \"$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*
  cf_found=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_found=no
fi
rm -f conftest*
echo "$ac_t""$cf_found" 1>&6
if test $cf_found = yes ; then
	
cf_tr_hdr=`echo "$cf_hdr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

	cat >> confdefs.h <<EOF
#define HAVE_${cf_tr_hdr} 1
EOF

fi
done


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

for ac_hdr in \
termio.h \
termios.h \
unistd.h \

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

fi
if test "$ac_cv_header_termios_h" = yes ; then
	case "$CFLAGS $CPPFLAGS" in
	*-D_POSIX_SOURCE*)
		termios_bad=dunno ;;
	*)	termios_bad=maybe ;;
	esac
	if test "$termios_bad" = maybe ; then
	echo $ac_n "checking whether termios.h needs _POSIX_SOURCE""... $ac_c" 1>&6
echo "configure:10547: checking whether termios.h needs _POSIX_SOURCE" >&5
	cat > conftest.$ac_ext <<EOF
#line 10549 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
struct termios foo; int x = foo.c_iflag
; return 0; }
EOF
if { (eval echo configure:10556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  termios_bad=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
		cat > conftest.$ac_ext <<EOF
#line 10565 "configure"
#include "confdefs.h"

#define _POSIX_SOURCE
#include <termios.h>
int main() {
struct termios foo; int x = foo.c_iflag
; return 0; }
EOF
if { (eval echo configure:10574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  termios_bad=unknown
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  termios_bad=yes cat >> confdefs.h <<\EOF
#define SVR4_TERMIO 1
EOF

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



echo $ac_n "checking declaration of size-change""... $ac_c" 1>&6
echo "configure:10597: 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_CPPFLAGS="$CPPFLAGS"

for cf_opts in "" "NEED_PTEM_H"
do

    CPPFLAGS="$cf_save_CPPFLAGS"
    test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts"
    cat > conftest.$ac_ext <<EOF
#line 10611 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#else
#ifdef HAVE_TERMIO_H
#include <termio.h>
#endif
#endif
#ifdef 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:10650: \"$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*

	CPPFLAGS="$cf_save_CPPFLAGS"
	if test "$cf_cv_sizechange" = yes ; then
		echo "size-change succeeded ($cf_opts)" >&5
		test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
		break
	fi
done

fi

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

	case $cf_cv_sizechange in #(vi
	NEED*)
		cat >> confdefs.h <<EOF
#define $cf_cv_sizechange  1
EOF

		;;
	esac
fi


echo $ac_n "checking if sys/time.h conflicts with sys/select.h""... $ac_c" 1>&6
echo "configure:10689: 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 10697 "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:10725: \"$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:10749: 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 10754 "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:10782: 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 10787 "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:10815: 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 10820 "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:10848: 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 10853 "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:10881: 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 10886 "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 ssize_t""... $ac_c" 1>&6
echo "configure:10914: checking for ssize_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 10919 "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])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_ssize_t=yes
else
  rm -rf conftest*
  ac_cv_type_ssize_t=no
fi
rm -f conftest*

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

fi

echo $ac_n "checking for time_t""... $ac_c" 1>&6
echo "configure:10947: 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 10952 "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

cat > conftest.$ac_ext <<EOF
#line 10980 "configure"
#include "confdefs.h"
#include <netinet/in.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "in_addr_t" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
	cat > conftest.$ac_ext <<EOF
#line 10991 "configure"
#include "confdefs.h"
#include <sys/endian.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "in_addr_t" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
		echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
echo "configure:11002: checking for in_addr_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_in_addr_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 11007 "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])in_addr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_in_addr_t=yes
else
  rm -rf conftest*
  ac_cv_type_in_addr_t=no
fi
rm -f conftest*

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

fi

	
fi
rm -f conftest*


fi
rm -f conftest*

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:11043: 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 11048 "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 quad_t""... $ac_c" 1>&6
echo "configure:11078: checking for quad_t" >&5
cat > conftest.$ac_ext <<EOF
#line 11080 "configure"
#include "confdefs.h"

#include <sys/types.h>
#if 0
#include <stdlib.h>
#include <stddef.h>
#endif /* 0 */

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

fi

echo $ac_n "checking for long long""... $ac_c" 1>&6
echo "configure:11112: checking for long long" >&5
cat > conftest.$ac_ext <<EOF
#line 11114 "configure"
#include "confdefs.h"

#include <sys/types.h>

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

fi

echo $ac_n "checking for nl_item""... $ac_c" 1>&6
echo "configure:11142: checking for nl_item" >&5
cat > conftest.$ac_ext <<EOF
#line 11144 "configure"
#include "confdefs.h"

#ifdef HAVE_LANGINFO_H
#include <langinfo.h>
#else
#ifdef HAVE_NL_TYPES_H
#include <nl_types.h>
#endif
#endif

int main() {
nl_item x; x = 0
; return 0; }
EOF
if { (eval echo configure:11159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_nl_item=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_nl_item=no
fi
rm -f conftest*
echo "$ac_t""$ac_cv_nl_item" 1>&6
if test $ac_cv_nl_item = yes; then
        cat >> confdefs.h <<\EOF
#define HAVE_NL_ITEM 1
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:11181: 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 11189 "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:11200: \"$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:11217: 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 11222 "configure"
#include "confdefs.h"
#include <uudeview.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11227: \"$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


# libidn - Internationalized Domain Names
echo $ac_n "checking for stringprep_check_version in -lidn""... $ac_c" 1>&6
echo "configure:11265: checking for stringprep_check_version in -lidn" >&5
ac_lib_var=`echo idn'_'stringprep_check_version | 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="-lidn  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11273 "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 stringprep_check_version();

int main() {
stringprep_check_version()
; return 0; }
EOF
if { (eval echo configure:11284: \"$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 "stringprep.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for stringprep.h""... $ac_c" 1>&6
echo "configure:11301: checking for stringprep.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 11306 "configure"
#include "confdefs.h"
#include <stringprep.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11311: \"$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_STRINGPREP_H 1
EOF

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

			echo $ac_n "checking for idna_to_unicode_lzlz in -lidn""... $ac_c" 1>&6
echo "configure:11366: checking for idna_to_unicode_lzlz in -lidn" >&5
ac_lib_var=`echo idn'_'idna_to_unicode_lzlz | 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="-lidn  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 11374 "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 idna_to_unicode_lzlz();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  
				cat >> confdefs.h <<\EOF
#define HAVE_IDNA_TO_UNICODE_LZLZ 1
EOF

				echo $ac_n "checking for IDNA_USE_STD3_ASCII_RULES""... $ac_c" 1>&6
echo "configure:11406: checking for IDNA_USE_STD3_ASCII_RULES" >&5
				cat > conftest.$ac_ext <<EOF
#line 11408 "configure"
#include "confdefs.h"
#include <idna.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "IDNA_USE_STD3_ASCII_RULES" >/dev/null 2>&1; then
  rm -rf conftest*
  
					cat >> confdefs.h <<\EOF
#define HAVE_IDNA_USE_STD3_ASCII_RULES 1
EOF

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

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

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

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

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


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


# ICU - International Components for Unicode
ac_safe=`echo "unicode/unorm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unicode/unorm.h""... $ac_c" 1>&6
echo "configure:11457: checking for unicode/unorm.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 11462 "configure"
#include "confdefs.h"
#include <unicode/unorm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11467: \"$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_safe=`echo "unicode/ustring.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unicode/ustring.h""... $ac_c" 1>&6
echo "configure:11486: checking for unicode/ustring.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 11491 "configure"
#include "confdefs.h"
#include <unicode/ustring.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11496: \"$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_UNICODE_UNORM_H 1
EOF

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

		echo $ac_n "checking for unorm_normalize in libicuuc""... $ac_c" 1>&6
echo "configure:11522: checking for unorm_normalize in libicuuc" >&5
		cf_save_LIBS="$LIBS"
		cf_try_icuuc="no"
		LIBS="$LIBS -licuuc"
		cat > conftest.$ac_ext <<EOF
#line 11527 "configure"
#include "confdefs.h"
#include <unicode/unorm.h>
int main() {

			int32_t needed, ustr = NULL;
 			UErrorCode status;
			needed = unorm_normalize(ustr, -1, UNORM_DEFAULT, 0, NULL, 0, &status);
; return 0; }
EOF
if { (eval echo configure:11537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  
			cat >> confdefs.h <<\EOF
#define HAVE_LIBICUUC 1
EOF

			cf_try_icuuc="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$cf_save_LIBS
		
fi
rm -f conftest*
		echo "$ac_t""$cf_try_icuuc" 1>&6
		ac_safe=`echo "unicode/ubidi.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unicode/ubidi.h""... $ac_c" 1>&6
echo "configure:11556: checking for unicode/ubidi.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 11561 "configure"
#include "confdefs.h"
#include <unicode/ubidi.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11566: \"$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_UNICODE_UBIDI_H 1
EOF

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

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


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


if test $use_curses != no ; then
	cf_cv_termlib=$cf_with_screen
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 11613 "configure"
#include "confdefs.h"

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

int main() {
int x=tigetstr("")
; return 0; }
EOF
if { (eval echo configure:11630: \"$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:11659: checking for $cf_func in -l$cf_lib" >&5
		cat > conftest.$ac_ext <<EOF
#line 11661 "configure"
#include "confdefs.h"

int main() {
int x=$cf_func("")
; return 0; }
EOF
if { (eval echo configure:11668: \"$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:11695: 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 11703 "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:11714: \"$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:11735: 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 11743 "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:11754: \"$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: warning: Cannot find -ltermlib, -lcurses, or -ltermcap" 1>&2
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:11787: checking if we should include termcap.h" >&5
	cf_save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -I$srcdir/include"
	cat > conftest.$ac_ext <<EOF
#line 11791 "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:11804: \"$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

	
echo $ac_n "checking for term.h""... $ac_c" 1>&6
echo "configure:11822: checking for term.h" >&5
if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
# for <term.h> if we do not find the variant.
for cf_header in \
	`echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
	term.h
do
	cat > conftest.$ac_ext <<EOF
#line 11835 "configure"
#include "confdefs.h"

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

fi

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

case $cf_cv_term_header in #(vi
term.h) #(vi
	cat >> confdefs.h <<\EOF
#define HAVE_TERM_H 1
EOF

	;;
ncurses/term.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSES_TERM_H 1
EOF

	;;
ncursesw/term.h)
	cat >> confdefs.h <<\EOF
#define HAVE_NCURSESW_TERM_H 1
EOF

	;;
esac



echo $ac_n "checking if we should include curses.h or termcap.h""... $ac_c" 1>&6
echo "configure:11885: 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_CPPFLAGS="$CPPFLAGS"
cf_cv_need_curses_h=no

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

    CPPFLAGS="$cf_save_CPPFLAGS $CHECK_DECL_FLAG"
    test -n "$cf_c_opts" && CPPFLAGS="$CPPFLAGS -D$cf_c_opts"
    test -n "$cf_t_opts" && CPPFLAGS="$CPPFLAGS -D$cf_t_opts"

    cat > conftest.$ac_ext <<EOF
#line 11903 "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:11911: \"$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 11924 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS
int main() {
char *x = (char *)tgoto("",0,0)
; return 0; }
EOF
if { (eval echo configure:11932: \"$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*

	CPPFLAGS="$cf_save_CPPFLAGS"
	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_term_header" != no ; 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

	;;
term.h) #(vi
	cat >> confdefs.h <<EOF
#define NEED_TERM_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:12008: 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_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $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
	
echo "(line 12024) testing loop variables P:$P, Q:$Q, R:$R, S:$S ..." 1>&5

	cat > conftest.$ac_ext <<EOF
#line 12027 "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:12036: \"$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

CPPFLAGS="$cf_save_CPPFLAGS"

fi

cf_tc_funcs=
cf_tc_externs=
if test ".$cf_cv_termlib" = .terminfo ; then
	cat >> confdefs.h <<\EOF
#define USE_TERMINFO 1
EOF

	cf_tc_funcs="tigetint tigetnum tparam tparm"
	cf_tc_externs="$cf_tc_funcs tgoto tigetstr tputs tigetflag"
elif test ".$cf_cv_termlib" = .termcap ; then
	# BSD 'tputs()' may need 'PC' to be set.
	cat > conftest.$ac_ext <<EOF
#line 12091 "configure"
#include "confdefs.h"

int main() {
extern char PC; PC = 0
; return 0; }
EOF
if { (eval echo configure:12098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_EXTERN_TCAP_PC 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
	cf_tc_funcs="tgetint tgetnum tparam tparm"
	cf_tc_externs="$cf_tc_funcs tgoto tgetstr tputs tgetent tgetflag"
fi

###	Checks for external-data


echo $ac_n "checking if external errno is declared""... $ac_c" 1>&6
echo "configure:12117: 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 12123 "configure"
#include "confdefs.h"

#ifdef 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:12136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_dcl_errno=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_cv_dcl_errno=no
fi
rm -f conftest*

fi

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

if test "$cf_cv_dcl_errno" = no ; then
    
cf_result=`echo "decl_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

    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:12164: 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 12170 "configure"
#include "confdefs.h"

#undef errno
extern int errno;

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

fi

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

if test "$cf_cv_have_errno" = yes ; then
    
cf_result=`echo "have_errno" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

fi





for ac_func in strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:12212: 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 12217 "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:12240: \"$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
 cat >> confdefs.h <<\EOF
#define HAVE_STRERROR 1
EOF

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

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

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

fi

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

if test "$cf_cv_dcl_sys_nerr" = no ; then
    
cf_result=`echo "decl_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

    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 sys_nerr exists""... $ac_c" 1>&6
echo "configure:12314: checking if external sys_nerr exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_sys_nerr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 12320 "configure"
#include "confdefs.h"

#undef sys_nerr
extern int sys_nerr;

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

fi

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

if test "$cf_cv_have_sys_nerr" = yes ; then
    
cf_result=`echo "have_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

fi



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

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

fi

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

if test "$cf_cv_dcl_sys_errlist" = no ; then
    
cf_result=`echo "decl_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

    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 sys_errlist exists""... $ac_c" 1>&6
echo "configure:12406: checking if external sys_errlist exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    cat > conftest.$ac_ext <<EOF
#line 12412 "configure"
#include "confdefs.h"

#undef sys_errlist
extern int sys_errlist;

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

fi

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

if test "$cf_cv_have_sys_errlist" = yes ; then
    
cf_result=`echo "have_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

fi




fi
done



###	Checks for library functions.
for ac_func in \
	atoi \
	atol \
	bcopy \
	chmod \
	closesocket \
	execlp \
	fcntl \
	fdopen \
	fork \
	ftime \
	ftruncate \
	getcwd \
	gettimeofday \
	getwd \
	inet_aton \
	is_xterm \
	isascii \
	link \
	lockf \
	memcmp \
	memcpy \
	memmove \
	memset \
	mkdir \
	mkfifo \
	mktemp \
	mkstemp \
	nl_langinfo \
	poll \
	putenv \
	rewinddir \
	resizeterm \
	select \
	setenv \
	setlocale \
	settz \
	sigaction \
	snprintf \
	stpcpy \
	strchr \
	strcasecmp \
	strcasestr \
	strdup \
	strftime \
	strpbrk \
	strrstr \
	strsep \
	strstr \
	strtol \
	tmpfile \
	tzset \
	uname \
	unlink \
	use_default_colors \
	usleep \
	vasprintf \
	vsnprintf \
	waitpid \
$cf_tc_funcs 
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:12518: 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 12523 "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:12546: \"$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 flock""... $ac_c" 1>&6
echo "configure:12572: checking for flock" >&5
if eval "test \"`echo '$''{'ac_cv_func_flock'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12577 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char flock(); 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 flock();

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_flock) || defined (__stub___flock)
choke me
#else
flock();
#endif

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

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

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

	echo $ac_n "checking for flock in -lbsd""... $ac_c" 1>&6
echo "configure:12622: checking for flock in -lbsd" >&5
ac_lib_var=`echo bsd'_'flock | 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  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12630 "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 flock();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_FLOCK 1
EOF

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

fi



  echo $ac_n "checking for wide char and multibyte support""... $ac_c" 1>&6
echo "configure:12670: checking for wide char and multibyte support" >&5
if eval "test \"`echo '$''{'am_cv_multibyte_able'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 12675 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#	include <stdlib.h>
#endif /* HAVE_STDLIB_H */
#ifdef HAVE_WCHAR_H
#	include <wchar.h>
#endif /* HAVE_WCHAR_H */
#ifdef HAVE_WCTYPE_H
#	include <wctype.h>
#endif /* HAVE_WCTYPE_H */

int main() {
char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
      char ocb[5];
      wchar_t wcb[5];
      wchar_t wcb2[5];
      wchar_t format[3];

      putwc(0, 0);
      fputwc(0, 0);
      fwide(0, 0);
      mbtowc(wcb, icb, MB_CUR_MAX);
      mbstowcs(wcb, icb, 5);
      iswprint((wint_t) wcb[0]);
      wcslen(wcb);
      /* wcsnlen(wcb, 4); */
      wcwidth((wint_t) wcb[0]);
      wcswidth(wcb, 5);
      wcstombs(ocb, wcb, 5);
      mbstowcs(format, "%s", 2);
      swprintf(wcb, 5, format, "test");
      wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:12711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_multibyte_able=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_save_LIBS="$LIBS"
      LIBS="-lutf8 $LIBS"
      cat > conftest.$ac_ext <<EOF
#line 12721 "configure"
#include "confdefs.h"
#include <libutf8.h>
int main() {
char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
        char ocb[5];
        wchar_t wcb[5];
        wchar_t wcb2[5];
        wchar_t format[3];

        putwc(0, 0);
        fputwc(0, 0);
        fwide(0, 0);
        mbtowc(wcb, icb, MB_CUR_MAX);
        mbstowcs(wcb, icb, 5);
        iswprint((wint_t) wcb[0]);
        wcslen(wcb);
        /* wcsnlen(wcb, 4); */
        wcwidth((wint_t) wcb[0]);
        wcswidth(wcb, 5);
        wcstombs(ocb, wcb, 5);
        mbstowcs(format, "%s", 2);
        swprintf(wcb, 5, format, "test");
        wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:12747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_multibyte_able=libutf8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_multibyte_able=no
fi
rm -f conftest*
      LIBS="$cf_save_LIBS"
   
fi
rm -f conftest*
  
fi

echo "$ac_t""$am_cv_multibyte_able" 1>&6
  if test "$am_cv_multibyte_able" != no; then
    if test "$am_cv_multibyte_able" = libutf8; then
      cat >> confdefs.h <<\EOF
#define HAVE_LIBUTF8_H 1
EOF

      LIBS="-lutf8 $LIBS"
    fi
    cat >> confdefs.h <<\EOF
#define MULTIBYTE_ABLE 1
EOF

  fi


echo $ac_n "checking if gettimeofday takes two arguments""... $ac_c" 1>&6
echo "configure:12781: checking if gettimeofday takes two arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 12783 "configure"
#include "confdefs.h"

#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
int main() {
struct timeval *tv;
struct timezone *tz;
gettimeofday(tv, tz);
; return 0; }
EOF
if { (eval echo configure:12795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_func_gettimeofday_2args=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_func_gettimeofday_2args=no
fi
rm -f conftest*
echo "$ac_t""$ac_cv_func_gettimeofday_2args" 1>&6
if test $ac_cv_func_gettimeofday_2args = yes; then
	cat >> confdefs.h <<\EOF
#define GETTIMEOFDAY_2ARGS 1
EOF

fi

echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:12814: 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 12819 "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:12836: \"$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:12856: 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 12865 "configure"
#include "confdefs.h"

#include <signal.h>
int main() {
extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)
; return 0; }
EOF
if { (eval echo configure:12873: \"$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:12899: 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 12905 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <signal.h>
int main() {
struct sigaction act
; return 0; }
EOF
if { (eval echo configure:12914: \"$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
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:12935: 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 12941 "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:12959: \"$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:12981: 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 12990 "configure"
#include "confdefs.h"

int main()
{
	if (fork() < 0)
		exit(1);
	exit(0);
}
EOF
if { (eval echo configure:13000: \"$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:13022: 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 13027 "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:13050: \"$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:13069: 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 13074 "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:13097: \"$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:13113: 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 13122 "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:13135: \"$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:13173: checking if select expects int * arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 13175 "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:13195: 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 13203 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
if { (eval echo configure:13209: \"$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


# autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
if test "$cross_compiling" != yes ; then
	echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
echo "configure:13235: 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 13243 "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:13257: \"$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

fi

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

do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:13295: 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 13300 "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:13323: \"$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 type sigaction_t""... $ac_c" 1>&6
echo "configure:13350: 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 13356 "configure"
#include "confdefs.h"

#include <signal.h>
int main() {
sigaction_t x
; return 0; }
EOF
if { (eval echo configure:13364: \"$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:13384: 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 13390 "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:13412: \"$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 passwd.pw_gecos""... $ac_c" 1>&6
echo "configure:13443: checking for passwd.pw_gecos" >&5
if eval "test \"`echo '$''{'cf_cv_pw_gecos'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 13449 "configure"
#include "confdefs.h"

#include <pwd.h>

int main() {

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

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



echo $ac_n "checking for tm.tm_gmtoff""... $ac_c" 1>&6
echo "configure:13480: 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 13486 "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:13506: \"$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:13526: 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:13574: 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 13579 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13584: \"$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:13621: 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 13626 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13631: \"$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:13661: 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 13666 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:13671: \"$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:13712: 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 13718 "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:13729: \"$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 13740 "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:13755: \"$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:13780: 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 13789 "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:13822: \"$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 13833 "configure"
#include "confdefs.h"
int main() { exit(system("exit 23") != (23 << 8)); }
EOF
if { (eval echo configure:13837: \"$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 = no ; then
		cat >> confdefs.h <<\EOF
#define HAVE_COLOR 1
EOF

	elif test $cf_with_screen = pdcurses ; then
		cat >> confdefs.h <<\EOF
#define HAVE_COLOR 1
EOF

	else
	 	

if test "$cf_cv_ncurses_version" != no ; then
echo $ac_n "checking for obsolete/broken version of ncurses""... $ac_c" 1>&6
echo "configure:13880: 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 13886 "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:13900: \"$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:13925: 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 13931 "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:13946: \"$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
	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:13997: 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 14009 "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:14036: \"$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:14062: 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 14068 "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:14080: \"$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:14108: 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 14117 "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:14158: \"$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 \
	strcasestr \
	strsep \

do

ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14205: 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 14211) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14216 "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:14230: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14248: \"$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_aton \
	inet_ntoa \
	socket \

do

ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14297: 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 14303) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14308 "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:14322: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14340: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14387: 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 14393) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14398 "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:14412: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14430: \"$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 \
	fchmod \
	fclose \
	fdopen \
	fflush \
	fgetc \
	fileno \
	fprintf \
	fputc \
	fputs \
	fread \
	free \
	fseek \
	fwrite \
	getcwd \
	getopt \
	getpass \
	getwd \
	ioctl \
	isascii \
	kill \
	malloc \
	memset \
	mkstemp \
	mktemp \
	pclose \
	perror \
	printf \
	putenv \
	qsort \
	realloc \
	rename \
	rewind \
	select \
	setenv \
	snprintf \
	sscanf \
	strcasecmp \
	strftime \
	strncasecmp \
	strtol \
	system \
	time \
	tolower \
	toupper \
	ungetc \
	usleep \
	vsprintf \
	vsnprintf \

do

ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14529: 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 14535) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14540 "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:14554: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14572: \"$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" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14616: 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 14622) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14627 "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:14641: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14659: \"$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 \
	gethostname \

do

ac_tr_func=`echo "$ac_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`


echo $ac_n "checking for missing "${ac_func}" extern""... $ac_c" 1>&6
echo "configure:14706: 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 14712) testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 14717 "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:14731: \"$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 work around system headers which are infested with non-standard syntax

cf_1_up=`echo "${ac_func}" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

int main() {
long x = 0
; return 0; }
EOF
if { (eval echo configure:14749: \"$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:14787: 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 14798 "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:14823: \"$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

### Use gettext
### this also calls AM_LANGINFO_CODESET and AM_ICONV
### so we don't need to do the tests ourselves.
# 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:14870: 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

# 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:14900: 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 14905 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:14912: \"$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:14933: 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 14938 "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:14966: \"$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:14998: 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 15003 "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:15028: 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 15033 "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:15056: \"$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:15083: 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 15091 "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:15110: \"$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

for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:15135: 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 15140 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15145: \"$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_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:15174: 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 15179 "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:15202: \"$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 working mmap""... $ac_c" 1>&6
echo "configure:15227: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_mmap_fixed_mapped=no
else
  cat > conftest.$ac_ext <<EOF
#line 15235 "configure"
#include "confdefs.h"

/* Thanks to Mike Haertel and Jim Avera for this test.
   Here is a matrix of mmap possibilities:
	mmap private not fixed
	mmap private fixed at somewhere currently unmapped
	mmap private fixed at somewhere already mapped
	mmap shared not fixed
	mmap shared fixed at somewhere currently unmapped
	mmap shared fixed at somewhere already mapped
   For private mappings, we should verify that changes cannot be read()
   back from the file, nor mmap's back from the file at a different
   address.  (There have been systems where private was not correctly
   implemented like the infamous i386 svr4.0, and systems where the
   VM page cache was not coherent with the filesystem buffer cache
   like early versions of FreeBSD and possibly contemporary NetBSD.)
   For shared mappings, we should conversely verify that changes get
   propogated back to all the places they're supposed to be.

   Grep wants private fixed already mapped.
   The main things grep needs to know about mmap are:
   * does it exist and is it safe to write into the mmap'd area
   * how to use it (BSD variants)  */
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>

/* This mess was copied from the GNU getpagesize.h.  */
#ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
#  include <unistd.h>
# endif

/* Assume that all systems that can run configure have sys/param.h.  */
# ifndef HAVE_SYS_PARAM_H
#  define HAVE_SYS_PARAM_H 1
# endif

# ifdef _SC_PAGESIZE
#  define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
#  ifdef HAVE_SYS_PARAM_H
#   include <sys/param.h>
#   ifdef EXEC_PAGESIZE
#    define getpagesize() EXEC_PAGESIZE
#   else /* no EXEC_PAGESIZE */
#    ifdef NBPG
#     define getpagesize() NBPG * CLSIZE
#     ifndef CLSIZE
#      define CLSIZE 1
#     endif /* no CLSIZE */
#    else /* no NBPG */
#     ifdef NBPC
#      define getpagesize() NBPC
#     else /* no NBPC */
#      ifdef PAGESIZE
#       define getpagesize() PAGESIZE
#      endif /* PAGESIZE */
#     endif /* no NBPC */
#    endif /* no NBPG */
#   endif /* no EXEC_PAGESIZE */
#  else /* no HAVE_SYS_PARAM_H */
#   define getpagesize() 8192	/* punt totally */
#  endif /* no HAVE_SYS_PARAM_H */
# endif /* no _SC_PAGESIZE */

#endif /* no HAVE_GETPAGESIZE */

#ifdef __cplusplus
extern "C" { void *malloc(unsigned); }
#else
char *malloc();
#endif

int
main()
{
	char *data, *data2, *data3;
	int i, pagesize;
	int fd;

	pagesize = getpagesize();

	/*
	 * First, make a file with some known garbage in it.
	 */
	data = malloc(pagesize);
	if (!data)
		exit(1);
	for (i = 0; i < pagesize; ++i)
		*(data + i) = rand();
	umask(0);
	fd = creat("conftestmmap", 0600);
	if (fd < 0)
		exit(1);
	if (write(fd, data, pagesize) != pagesize)
		exit(1);
	close(fd);

	/*
	 * Next, try to mmap the file at a fixed address which
	 * already has something else allocated at it.  If we can,
	 * also make sure that we see the same garbage.
	 */
	fd = open("conftestmmap", O_RDWR);
	if (fd < 0)
		exit(1);
	data2 = malloc(2 * pagesize);
	if (!data2)
		exit(1);
	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
		exit(1);
	for (i = 0; i < pagesize; ++i)
		if (*(data + i) != *(data2 + i))
			exit(1);

	/*
	 * Finally, make sure that changes to the mapped area
	 * do not percolate back to the file as seen by read().
	 * (This is a bug on some variants of i386 svr4.0.)
	 */
	for (i = 0; i < pagesize; ++i)
		*(data2 + i) = *(data2 + i) + 1;
	data3 = malloc(pagesize);
	if (!data3)
		exit(1);
	if (read(fd, data3, pagesize) != pagesize)
		exit(1);
	for (i = 0; i < pagesize; ++i)
		if (*(data + i) != *(data3 + i))
			exit(1);
	close(fd);
	unlink("conftestmmap");
	exit(0);
}

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

fi

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

fi


    echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
echo "configure:15399: checking whether we are using the GNU C Library 2.1 or newer" >&5
if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 15404 "configure"
#include "confdefs.h"

#include <features.h>
#ifdef __GNU_LIBRARY__
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
  Lucky GNU user
 #endif
#endif
	
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "Lucky GNU user" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_gnu_library_2_1=yes
else
  rm -rf conftest*
  ac_cv_gnu_library_2_1=no
fi
rm -f conftest*

      
    
fi

echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6
    
    GLIBC21="$ac_cv_gnu_library_2_1"
  


	case $cf_cv_system_name in
	os2*)	PATHSEP=';'  ;;
	*)	PATHSEP=':'  ;;
	esac

	


cf_makefile=Makefile

test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`

# Allow override of "config.h" definition:
: ${CONFIG_H=config.h}


if test -z "$VERSION" ; then
if test -f $srcdir/VERSION ; then
	VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
else
	VERSION=unknown
fi
fi


                                    
   for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:15466: 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 15471 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15476: \"$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_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:15507: 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 15512 "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:15535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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


   
    
  
# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
if test "${with_libiconv_prefix+set}" = set; then
  withval="$with_libiconv_prefix"
  
    for dir in `echo "$withval" | tr : ' '`; do
      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
    done
   
fi


  echo $ac_n "checking for iconv""... $ac_c" 1>&6
echo "configure:15576: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    am_cv_func_iconv="no, consider installing GNU libiconv"
    am_cv_lib_iconv=no
    cat > conftest.$ac_ext <<EOF
#line 15584 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
int main() {
iconv_t cd = iconv_open("","");
       iconv(cd,NULL,NULL,NULL,NULL);
       iconv_close(cd);
; return 0; }
EOF
if { (eval echo configure:15594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_func_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
    if test "$am_cv_func_iconv" != yes; then
      am_save_LIBS="$LIBS"
      LIBS="$LIBS -liconv"
      cat > conftest.$ac_ext <<EOF
#line 15606 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
int main() {
iconv_t cd = iconv_open("","");
         iconv(cd,NULL,NULL,NULL,NULL);
         iconv_close(cd);
; return 0; }
EOF
if { (eval echo configure:15616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_lib_iconv=yes
        am_cv_func_iconv=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      LIBS="$am_save_LIBS"
    fi
  
fi

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

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

#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif

int main() {

; return 0; }
EOF
if { (eval echo configure:15662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  am_cv_proto_iconv_arg1=""
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_proto_iconv_arg1="const"
fi
rm -f conftest*
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
fi

    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
    echo "$ac_t""${ac_t:-
         }$am_cv_proto_iconv" 1>&6
    cat >> confdefs.h <<EOF
#define ICONV_CONST $am_cv_proto_iconv_arg1
EOF

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

   
  echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
echo "configure:15691: checking for nl_langinfo and CODESET" >&5
if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 15696 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
if { (eval echo configure:15703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  am_cv_langinfo_codeset=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_langinfo_codeset=no
fi
rm -f conftest*
    
fi

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

  fi

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

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

    fi
  fi
   echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
echo "configure:15759: checking whether NLS is requested" >&5
        
    
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
  enableval="$enable_nls"
  USE_NLS=$enableval
else
  USE_NLS=yes
fi

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

    BUILD_INCLUDED_LIBINTL=no
    USE_INCLUDED_LIBINTL=no
    INTLLIBS=

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

      echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
echo "configure:15783: checking whether included gettext is requested" >&5
      
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
  withval="$with_included_gettext"
  nls_cv_force_use_gnu_gettext=$withval
else
  nls_cv_force_use_gnu_gettext=no
fi

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

      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
                        	CATOBJEXT=NONE

                
        

	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
echo "configure:15804: checking for libintl.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 15809 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15814: \"$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
  echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
echo "configure:15831: checking for GNU gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 15836 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
int main() {
bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
if { (eval echo configure:15845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  gt_cv_func_gnugettext1_libc=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  gt_cv_func_gnugettext1_libc=no
fi
rm -f conftest*
fi

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

	   if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
	     echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
echo "configure:15861: checking for GNU gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  gt_save_LIBS="$LIBS"
		LIBS="$LIBS -lintl $LIBICONV"
		cat > conftest.$ac_ext <<EOF
#line 15868 "configure"
#include "confdefs.h"
#include <libintl.h>
extern int _nl_msg_cat_cntr;
int main() {
bindtextdomain ("", "");
return (int) gettext ("") + _nl_msg_cat_cntr
; return 0; }
EOF
if { (eval echo configure:15877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  gt_cv_func_gnugettext1_libintl=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  gt_cv_func_gnugettext1_libintl=no
fi
rm -f conftest*
		LIBS="$gt_save_LIBS"
fi

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

	   	   	   	   	   if test "$gt_cv_func_gnugettext1_libc" = "yes" \
	      || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
		   && test "$PACKAGE" != gettext; }; then
	     cat >> confdefs.h <<\EOF
#define HAVE_GETTEXT 1
EOF


	     if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
	       	       	       	       INTLLIBS="-lintl $LIBICONV"
	     fi

	     gt_save_LIBS="$LIBS"
	     LIBS="$LIBS $INTLLIBS"
	     for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:15910: 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 15915 "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:15938: \"$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

	     LIBS="$gt_save_LIBS"

	     	     # Extract the first word of "msgfmt", so it can be a program name with args.

set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:15968: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MSGFMT" in
  /*)
  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
	break
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
  ;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test "$MSGFMT" != ":"; then
  echo "$ac_t""$MSGFMT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	     # Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16002: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$GMSGFMT" in
  /*)
  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GMSGFMT="$GMSGFMT" # 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_GMSGFMT="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
  ;;
esac
fi
GMSGFMT="$ac_cv_path_GMSGFMT"
if test -n "$GMSGFMT"; then
  echo "$ac_t""$GMSGFMT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


	     	     # Extract the first word of "xgettext", so it can be a program name with args.

set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16040: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$XGETTEXT" in
  /*)
  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
	break
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
  ;;
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test "$XGETTEXT" != ":"; then
  echo "$ac_t""$XGETTEXT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


	     CATOBJEXT=.gmo
	   fi
	
else
  echo "$ac_t""no" 1>&6
fi


        if test "$CATOBJEXT" = "NONE"; then
	  	  	  nls_cv_use_gnu_gettext=yes
        fi
      fi

      if test "$nls_cv_use_gnu_gettext" = "yes"; then
        if test ! -d $srcdir/intl ; then
	  { echo "configure: error: no NLS library is packaged with this application" 1>&2; exit 1; }
	fi
                INTLOBJS="\$(GETTOBJS)"
        # Extract the first word of "msgfmt", so it can be a program name with args.

set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16094: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$MSGFMT" in
  /*)
  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
	break
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
  ;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test "$MSGFMT" != ":"; then
  echo "$ac_t""$MSGFMT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        # Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16128: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$GMSGFMT" in
  /*)
  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_GMSGFMT="$GMSGFMT" # 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_GMSGFMT="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
  ;;
esac
fi
GMSGFMT="$ac_cv_path_GMSGFMT"
if test -n "$GMSGFMT"; then
  echo "$ac_t""$GMSGFMT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        # Extract the first word of "xgettext", so it can be a program name with args.

set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:16165: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$XGETTEXT" in
  /*)
  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
	break
      fi
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
  ;;
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test "$XGETTEXT" != ":"; then
  echo "$ac_t""$XGETTEXT" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

        
	BUILD_INCLUDED_LIBINTL=yes
	USE_INCLUDED_LIBINTL=yes
        CATOBJEXT=.gmo
	INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV"
	LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
      fi

                  if test "$GMSGFMT" != ":"; then
			if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
	  : ;
	else
	  echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6
	  GMSGFMT=":"
	fi
      fi

                  if test "$XGETTEXT" != ":"; then
			if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
	  : ;
	else
	  echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
	  XGETTEXT=":"
	fi
      fi

            POSUB=po
    fi

    


            if test "$PACKAGE" = gettext; then
      BUILD_INCLUDED_LIBINTL=yes
    fi

                                            if test "$nls_cv_use_gnu_gettext" = "yes"; then
    for ac_prog in bison
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:16238: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$INTLBISON"; then
  ac_cv_prog_INTLBISON="$INTLBISON" # 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_INTLBISON="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
INTLBISON="$ac_cv_prog_INTLBISON"
if test -n "$INTLBISON"; then
  echo "$ac_t""$INTLBISON" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$INTLBISON" && break
done

    if test -z "$INTLBISON"; then
      ac_verc_fail=yes
    else
            echo $ac_n "checking version of bison""... $ac_c" 1>&6
echo "configure:16271: checking version of bison" >&5
      ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
      case $ac_prog_version in
        '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
        1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
           ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
        *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
      esac
      echo "$ac_t""$ac_prog_version" 1>&6
    fi
    if test $ac_verc_fail = yes; then
      INTLBISON=:
    fi
    fi

                for lang in $ALL_LINGUAS; do
      GMOFILES="$GMOFILES $lang.gmo"
      POFILES="$POFILES $lang.po"
    done

        
    
    
    
    
    
    
    
    

        nls_cv_header_intl=
    nls_cv_header_libgt=

        DATADIRNAME=share
    

        INSTOBJEXT=.mo
    

        GENCAT=gencat
    
  

   if test "x$CATOBJEXT" != "x"; then
     if test "x$ALL_LINGUAS" = "x"; then
       LINGUAS=
     else
       echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
echo "configure:16319: checking for catalogs to be installed" >&5
       NEW_LINGUAS=
       for presentlang in $ALL_LINGUAS; do
         useit=no
         for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
           # Use the presentlang catalog if desiredlang is
           #   a. equal to presentlang, or
           #   b. a variant of presentlang (because in this case,
           #      presentlang can be used as a fallback for messages
           #      which are not translated in the desiredlang catalog).
           case "$desiredlang" in
             "$presentlang"*) useit=yes;;
           esac
         done
         if test $useit = yes; then
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
         fi
       done
       LINGUAS=$NEW_LINGUAS
       echo "$ac_t""$LINGUAS" 1>&6
     fi

          if test -n "$LINGUAS"; then
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
     fi
   fi

                  MKINSTALLDIRS=
   if test -n "$ac_aux_dir"; then
     MKINSTALLDIRS="$ac_aux_dir/mkdirs.sh"
   fi
   if test -z "$MKINSTALLDIRS"; then
     MKINSTALLDIRS="\$(top_srcdir)/mkdirs.sh"
   fi
   if test -n "$GNUSYSTEM_AUX_DIR" ; then
     if test -e "${GNUSYSTEM_AUX_DIR}/mkinstalldirs"; then
       MKINSTALLDIRS="${GNUSYSTEM_AUX_DIR}/mkinstalldirs"
     fi
   fi
   

      INTL_LIBTOOL_SUFFIX_PREFIX=
   


INTLDIR_MAKE=
MSG_DIR_MAKE=
SUB_MAKEFILE=


cf_makefile=Makefile

use_our_messages=no
if test "$USE_NLS" = yes ; then
if test -d $srcdir/po ; then
echo $ac_n "checking if we should use included message-library""... $ac_c" 1>&6
echo "configure:16375: checking if we should use included message-library" >&5
	
# Check whether --enable-included-msgs or --disable-included-msgs was given.
if test "${enable_included_msgs+set}" = set; then
  enableval="$enable_included_msgs"
  use_our_messages=$enableval
else
  use_our_messages=yes
fi

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

MSG_DIR_MAKE="#"
if test "$use_our_messages" = yes
then
	SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
	MSG_DIR_MAKE=
fi





if test "$USE_INCLUDED_LIBINTL" = yes ; then
        if test "$nls_cv_force_use_gnu_gettext" = yes ; then
		:
	elif test "$nls_cv_use_gnu_gettext" = yes ; then
		:
	else
		INTLDIR_MAKE="#"
	fi
	if test -z "$INTLDIR_MAKE"; then
		cat >> confdefs.h <<\EOF
#define HAVE_LIBGETTEXT_H 1
EOF

		for cf_makefile in \
			$srcdir/intl/Makefile.in \
			$srcdir/intl/makefile.in
		do
			if test -f "$cf_makefile" ; then
				SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}"
				break
			fi
		done
	fi
else
	INTLDIR_MAKE="#"
	if test "$USE_NLS" = yes ; then
		for ac_hdr in libintl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:16430: 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 16435 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

	fi
fi

if test -z "$INTLDIR_MAKE" ; then
	CPPFLAGS="-I../intl $CPPFLAGS"
fi

if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
	GT_YES="#"
	GT_NO=
else
	GT_YES=
	GT_NO="#"
fi







if test "$USE_INCLUDED_LIBINTL" = yes ; then
	if test "$nls_cv_force_use_gnu_gettext" = yes ; then
		cat >> confdefs.h <<\EOF
#define HAVE_GETTEXT 1
EOF

	elif test "$nls_cv_use_gnu_gettext" = yes ; then
		cat >> confdefs.h <<\EOF
#define HAVE_GETTEXT 1
EOF

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

	fi
fi

LIBS="$LIBS $LIBICONV"

### check for alloca (required for bison and/or intl/*)
case "$YACC" in
bison*)
	use_alloca=yes
	;;
*)
	use_alloca=$USE_INCLUDED_LIBINTL
	;;
esac

if test ".$use_alloca" = .yes ; then
	
# 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:16524: 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 16529 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:16536: \"$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:16557: 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 16562 "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:16590: \"$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:16622: 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 16627 "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:16652: 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 16657 "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:16680: \"$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:16707: 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 16715 "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:16734: \"$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


case $host_os in
linux*|gnu*)
	# workaround for bison 1.875c (compound breakage in Linux stdlib.h
	# and bison's output make bison try to use alloca()).
	if test -z "$GCC" ; then
		CPPFLAGS="-DYYSTACK_USE_ALLOCA=0 $CPPFLAGS"
		ALLOCA=""
	elif test "$INTEL_COMPILER" = yes ; then
		CPPFLAGS="-DYYSTACK_USE_ALLOCA=0 $CPPFLAGS"
		ALLOCA=""
	fi
	;;
esac

else
	ALLOCA=""
	
fi


for cf_hdr in iconv.h
do
	echo $ac_n "checking for $cf_hdr""... $ac_c" 1>&6
echo "configure:16779: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 16781 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <$cf_hdr>

EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16789: \"$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*
  cf_found=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_found=no
fi
rm -f conftest*
echo "$ac_t""$cf_found" 1>&6
if test $cf_found = yes ; then
	
cf_tr_hdr=`echo "$cf_hdr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

	cat >> confdefs.h <<EOF
#define HAVE_${cf_tr_hdr} 1
EOF

fi
done

echo $ac_n "checking for iconv_open() //TRANSLIT extension""... $ac_c" 1>&6
echo "configure:16815: checking for iconv_open() //TRANSLIT extension" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""unknown" 1>&6

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

#ifdef HAVE_ICONV_H
#	include <iconv.h>
#endif /* HAVE_ICONV_H */
#ifdef HAVE_STDLIB_H
#	include <stdlib.h>
#endif /* HAVE_STDLIB_H */
int main() {
	iconv_t cd;

	if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
		exit(1);
	exit(0);
}
EOF
if { (eval echo configure:16838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cat >> confdefs.h <<\EOF
#define HAVE_ICONV_OPEN_TRANSLIT 1
EOF
 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi



# tin has mkdirs.sh instead of mkinstalldirs, overwrite the result of test
# in gettext.m4
MKINSTALLDIRS="\$(top_srcdir)/mkdirs.sh"


if test "$cf_cv_termlib" = pdcurses ; then
	if test "$no_x" = yes; then
  # Not all programs may use this symbol, but it does not hurt to define it.
  cat >> confdefs.h <<\EOF
#define X_DISPLAY_MISSING 1
EOF

  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
  if test -n "$x_includes"; then
    X_CFLAGS="$X_CFLAGS -I$x_includes"
  fi

  # It would also be nice to do this for all -L options, not just this one.
  if test -n "$x_libraries"; then
    X_LIBS="$X_LIBS -L$x_libraries"
    # For Solaris; some versions of Sun CC require a space after -R and
    # others require no space.  Words are not sufficient . . . .
    case "`(uname -sr) 2>/dev/null`" in
    "SunOS 5"*)
      echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:16881: checking whether -R must be followed by a space" >&5
      ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
      cat > conftest.$ac_ext <<EOF
#line 16884 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:16891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_nospace=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_nospace=no
fi
rm -f conftest*
      if test $ac_R_nospace = yes; then
	echo "$ac_t""no" 1>&6
	X_LIBS="$X_LIBS -R$x_libraries"
      else
	LIBS="$ac_xsave_LIBS -R $x_libraries"
	cat > conftest.$ac_ext <<EOF
#line 16907 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:16914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_R_space=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_R_space=no
fi
rm -f conftest*
	if test $ac_R_space = yes; then
	  echo "$ac_t""yes" 1>&6
	  X_LIBS="$X_LIBS -R $x_libraries"
	else
	  echo "$ac_t""neither works" 1>&6
	fi
      fi
      LIBS="$ac_xsave_LIBS"
    esac
  fi

  # Check for system-dependent libraries X programs must link with.
  # Do this before checking for the system-independent R6 libraries
  # (-lICE), since we may need -lsocket or whatever for X linking.

  if test "$ISC" = yes; then
    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
  else
    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
    # libraries were built with DECnet support.  And karl@cs.umb.edu says
    # the Alpha needs dnet_stub (dnet does not exist).
    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:16946: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | 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="-ldnet  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 16954 "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 dnet_ntoa();

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

    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:16987: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | 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="-ldnet_stub  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 16995 "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 dnet_ntoa();

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

    fi

    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
    # to get the SysV transport functions.
    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
    # needs -lnsl.
    # The nsl library prevents programs from opening the X display
    # on Irix 5.2, according to dickey@clark.net.
    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:17035: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17040 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyname(); 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 gethostbyname();

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_gethostbyname) || defined (__stub___gethostbyname)
choke me
#else
gethostbyname();
#endif

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

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

    if test $ac_cv_func_gethostbyname = no; then
      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:17084: 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  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17092 "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:17103: \"$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
  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
else
  echo "$ac_t""no" 1>&6
fi

    fi

    # lieder@skyler.mavd.honeywell.com says without -lsocket,
    # socket/setsockopt and other routines are undefined under SCO ODT
    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
    # on later versions), says simon@lia.di.epfl.ch: it contains
    # gethostby* variants that don't use the nameserver (or something).
    # -lsocket must be given before -lnsl if both are needed.
    # We assume that if connect needs -lnsl, so does gethostbyname.
    echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:17133: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17138 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char connect(); 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 connect();

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_connect) || defined (__stub___connect)
choke me
#else
connect();
#endif

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

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

    if test $ac_cv_func_connect = no; then
      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:17182: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | 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 $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17190 "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 connect();

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

    fi

    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
    echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:17225: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17230 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char remove(); 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 remove();

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_remove) || defined (__stub___remove)
choke me
#else
remove();
#endif

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

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

    if test $ac_cv_func_remove = no; then
      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:17274: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | 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="-lposix  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17282 "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 remove();

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

    fi

    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
    echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:17317: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17322 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char shmat(); 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 shmat();

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_shmat) || defined (__stub___shmat)
choke me
#else
shmat();
#endif

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

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

    if test $ac_cv_func_shmat = no; then
      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:17366: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | 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="-lipc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17374 "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 shmat();

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

    fi
  fi

  # Check for libraries that X11R6 Xt/Xaw programs need.
  ac_save_LDFLAGS="$LDFLAGS"
  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  # check for ICE first), but we must link in the order -lSM -lICE or
  # we get undefined symbols.  So assume we have SM if we have ICE.
  # These have to be linked with before -lX11, unlike the other
  # libraries we check for below, so use a different variable.
  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:17418: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | 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="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17426 "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 IceConnectionNumber();

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

  LDFLAGS="$ac_save_LDFLAGS"

fi





# SYSTEM_NAME=`echo "$cf_cv_system_name"|tr ' ' -`

cf_have_X_LIBS=no

LDFLAGS="$X_LIBS $LDFLAGS"

test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6

cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"

cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

for cf_add_cflags in $X_CFLAGS
do
case $cf_fix_cppflags in
no)
	case $cf_add_cflags in #(vi
	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
		case $cf_add_cflags in
		-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
			&& test -z "${cf_tst_cflags}" \
			&& cf_fix_cppflags=yes

			if test $cf_fix_cppflags = yes ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			elif test "${cf_tst_cflags}" = "\"'" ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			fi
			;;
		esac
		case "$CPPFLAGS" in
		*$cf_add_cflags) #(vi
			;;
		*) #(vi
			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
			;;
		esac
		;;
	*)
		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
		;;
	esac
	;;
yes)
	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"

	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`

	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
	&& test -z "${cf_tst_cflags}" \
	&& cf_fix_cppflags=no
	;;
esac
done

if test -n "$cf_new_cflags" ; then
	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6

	CFLAGS="$CFLAGS $cf_new_cflags"
fi

if test -n "$cf_new_cppflags" ; then
	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6

	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
fi

if test -n "$cf_new_extra_cppflags" ; then
	test -n "$verbose" && echo "	add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6

	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




if test "$cf_check_cflags" != "$CFLAGS" ; then
cat > conftest.$ac_ext <<EOF
#line 17552 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello world");
; return 0; }
EOF
if { (eval echo configure:17559: \"$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*
  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6

	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6

	 fi
	 CFLAGS="$cf_check_flags"
fi
rm -f conftest*
fi


echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
echo "configure:17578: checking for XOpenDisplay" >&5
if eval "test \"`echo '$''{'ac_cv_func_XOpenDisplay'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17583 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char XOpenDisplay(); 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 XOpenDisplay();

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_XOpenDisplay) || defined (__stub___XOpenDisplay)
choke me
#else
XOpenDisplay();
#endif

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

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

echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
echo "configure:17625: checking for XOpenDisplay in -lX11" >&5
ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17633 "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 XOpenDisplay();

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

fi


echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
echo "configure:17668: checking for XtAppInitialize" >&5
if eval "test \"`echo '$''{'ac_cv_func_XtAppInitialize'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 17673 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char XtAppInitialize(); 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 XtAppInitialize();

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_XtAppInitialize) || defined (__stub___XtAppInitialize)
choke me
#else
XtAppInitialize();
#endif

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

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

echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>&6
echo "configure:17715: checking for XtAppInitialize in -lXt" >&5
ac_lib_var=`echo Xt'_'XtAppInitialize | 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="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17723 "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 XtAppInitialize();

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

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_LIBXT 1
EOF

	 cf_have_X_LIBS=Xt
	 LIBS="-lXt $X_PRE_LIBS $LIBS"
else
  echo "$ac_t""no" 1>&6
fi

fi


if test $cf_have_X_LIBS = no ; then
	echo "configure: warning: Unable to successfully link X Toolkit library (-lXt) with
test program.  You will have to check and add the proper libraries by hand
to makefile." 1>&2
fi


cf_x_athena=${cf_x_athena-Xaw}

echo $ac_n "checking if you want to link with Xaw 3d library""... $ac_c" 1>&6
echo "configure:17772: checking if you want to link with Xaw 3d library" >&5
withval=

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

if test "$withval" = yes ; then
	cf_x_athena=Xaw3d
	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking if you want to link with neXT Athena library""... $ac_c" 1>&6
echo "configure:17789: checking if you want to link with neXT Athena library" >&5
withval=

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

if test "$withval" = yes ; then
	cf_x_athena=neXtaw
	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking if you want to link with Athena-Plus library""... $ac_c" 1>&6
echo "configure:17806: checking if you want to link with Athena-Plus library" >&5
withval=

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

if test "$withval" = yes ; then
	cf_x_athena=XawPlus
	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""no" 1>&6
fi

echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
echo "configure:17823: checking for XextCreateExtension in -lXext" >&5
ac_lib_var=`echo Xext'_'XextCreateExtension | 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="-lXext  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17831 "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 XextCreateExtension();

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


cf_x_athena_lib=""


cf_x_athena_root=$cf_x_athena
cf_x_athena_include=""

for cf_path in default \
	/usr/contrib/X11R6 \
	/usr/contrib/X11R5 \
	/usr/lib/X11R5 \
	/usr/local
do
	if test -z "$cf_x_athena_include" ; then
		cf_save="$CPPFLAGS"
		cf_test=X11/$cf_x_athena_root/SimpleMenu.h
		if test $cf_path != default ; then
			CPPFLAGS="-I$cf_path/include $cf_save"
			echo $ac_n "checking for $cf_test in $cf_path""... $ac_c" 1>&6
echo "configure:17881: checking for $cf_test in $cf_path" >&5
		else
			echo $ac_n "checking for $cf_test""... $ac_c" 1>&6
echo "configure:17884: checking for $cf_test" >&5
		fi
		cat > conftest.$ac_ext <<EOF
#line 17887 "configure"
#include "confdefs.h"

#include <X11/Intrinsic.h>
#include <$cf_test>
int main() {

; return 0; }
EOF
if { (eval echo configure:17896: \"$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
		if test "$cf_result" = yes ; then
			cf_x_athena_include=$cf_path
			break
		else
			CPPFLAGS="$cf_save"
		fi
	fi
done

if test -z "$cf_x_athena_include" ; then
	echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
elif test "$cf_x_athena_include" != default ; then
	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_include"
fi


cf_x_athena_root=$cf_x_athena
cf_x_athena_lib=""

for cf_path in default \
	/usr/contrib/X11R6 \
	/usr/contrib/X11R5 \
	/usr/lib/X11R5 \
	/usr/local
do
	for cf_lib in \
		"-l$cf_x_athena_root -lXmu" \
		"-l$cf_x_athena_root -lXpm -lXmu" \
		"-l${cf_x_athena_root}_s -lXmu_s"
	do
		if test -z "$cf_x_athena_lib" ; then
			cf_save="$LIBS"
			cf_test=XawSimpleMenuAddGlobalActions
			if test $cf_path != default ; then
				LIBS="-L$cf_path/lib $cf_lib $LIBS"
				echo $ac_n "checking for $cf_lib in $cf_path""... $ac_c" 1>&6
echo "configure:17943: checking for $cf_lib in $cf_path" >&5
			else
				LIBS="$cf_lib $LIBS"
				echo $ac_n "checking for $cf_test in $cf_lib""... $ac_c" 1>&6
echo "configure:17947: checking for $cf_test in $cf_lib" >&5
			fi
			cf_SAVE="$LIBS"
			LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
			cat > conftest.$ac_ext <<EOF
#line 17952 "configure"
#include "confdefs.h"

int main() {
$cf_test()
; return 0; }
EOF
if { (eval echo configure:17959: \"$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
				cf_x_athena_lib="$cf_lib"
				LIBS="$cf_SAVE"
				break
			else
				LIBS="$cf_save"
			fi
		fi
	done
done

if test -z "$cf_x_athena_lib" ; then
	{ echo "configure: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" 1>&2; exit 1; }
fi


cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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





LDFLAGS="$LDFLAGS $X_LIBS"

test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6

cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"

cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

for cf_add_cflags in $X_CFLAGS
do
case $cf_fix_cppflags in
no)
	case $cf_add_cflags in #(vi
	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
		case $cf_add_cflags in
		-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
			&& test -z "${cf_tst_cflags}" \
			&& cf_fix_cppflags=yes

			if test $cf_fix_cppflags = yes ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			elif test "${cf_tst_cflags}" = "\"'" ; then
				cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
				continue
			fi
			;;
		esac
		case "$CPPFLAGS" in
		*$cf_add_cflags) #(vi
			;;
		*) #(vi
			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
			;;
		esac
		;;
	*)
		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
		;;
	esac
	;;
yes)
	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"

	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`

	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
	&& test -z "${cf_tst_cflags}" \
	&& cf_fix_cppflags=no
	;;
esac
done

if test -n "$cf_new_cflags" ; then
	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6

	CFLAGS="$CFLAGS $cf_new_cflags"
fi

if test -n "$cf_new_cppflags" ; then
	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6

	CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
fi

if test -n "$cf_new_extra_cppflags" ; then
	test -n "$verbose" && echo "	add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6

	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




if test "$cf_check_cflags" != "$CFLAGS" ; then
cat > conftest.$ac_ext <<EOF
#line 18079 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello world");
; return 0; }
EOF
if { (eval echo configure:18086: \"$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*
  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6

	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6

	 fi
	 CFLAGS="$cf_check_flags"
fi
rm -f conftest*
fi

echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
echo "configure:18104: checking for XOpenDisplay in -lX11" >&5
ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 18112 "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 XOpenDisplay();

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

echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
echo "configure:18144: checking for XCurses library" >&5
if eval "test \"`echo '$''{'cf_cv_lib_XCurses'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
LIBS="-lXCurses $LIBS"
cat > conftest.$ac_ext <<EOF
#line 18151 "configure"
#include "confdefs.h"

#include <xcurses.h>
char *XCursesProgramName = "test";

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

fi

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

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

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

else
	{ echo "configure: error: Cannot link with XCurses" 1>&2; exit 1; }
fi

fi

### sum up warnings
if test "$cf_cv_termlib" = none ; then
	echo "configure: warning: no term-lib found" 1>&2
fi
if test "$YACC" = "" ; then
	echo "configure: warning: no yacc-parser found" 1>&2
fi
if test "$RANLIB" = "" ; then
        echo "configure: warning: no library archive builder found" 1>&2
fi

### Finally, build autoconf.h and the makefiles
CFLAGS="$CFLAGS $EXTRA_CFLAGS"


cf_define=`echo "$CC"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_CC "$cf_define"
EOF



cf_define=`echo "$CFLAGS"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_CFLAGS "$cf_define"
EOF



cf_define=`echo "$CPP"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_CPP "$cf_define"
EOF



cf_define=`echo "$CPPFLAGS"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_CPPFLAGS "$cf_define"
EOF



cf_define=`echo "$CC"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_LD "$cf_define"
EOF



cf_define=`echo "$LDFLAGS"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_LDFLAGS "$cf_define"
EOF



cf_define=`echo "$LIBS"|sed -e 's/\\\\/\\\\134/g' -e 's/^[ 	]\\+//' -e 's/[ 	]\\+$//' -e 's/"/\\\\042/g'`
cat >> confdefs.h <<EOF
#define TIN_LIBS "$cf_define"
EOF



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.20030927"
    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 "$PCRE_MAKEFILE
	$SUB_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%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@DESTDIR@%$DESTDIR%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%@YACC@%$YACC%g
s%@LINT@%$LINT%g
s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%g
s%@EXEEXT@%$EXEEXT%g
s%@OBJEXT@%$OBJEXT%g
s%@PROG_EXT@%$PROG_EXT%g
s%@LIB_PREFIX@%$LIB_PREFIX%g
s%@LN_S@%$LN_S%g
s%@BUILD_CC@%$BUILD_CC%g
s%@BUILD_CPP@%$BUILD_CPP%g
s%@BUILD_CFLAGS@%$BUILD_CFLAGS%g
s%@BUILD_CPPFLAGS@%$BUILD_CPPFLAGS%g
s%@BUILD_LDFLAGS@%$BUILD_LDFLAGS%g
s%@BUILD_LIBS@%$BUILD_LIBS%g
s%@BUILD_EXEEXT@%$BUILD_EXEEXT%g
s%@BUILD_OBJEXT@%$BUILD_OBJEXT%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@RANLIB@%$RANLIB%g
s%@LD@%$LD%g
s%@AR@%$AR%g
s%@AR_OPTS@%$AR_OPTS%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%@PATH_PGP@%$PATH_PGP%g
s%@PATH_PGPK@%$PATH_PGPK%g
s%@PATH_GPG@%$PATH_GPG%g
s%@DEFAULT_SHELL@%$DEFAULT_SHELL%g
s%@ENABLE_DEBUG@%$ENABLE_DEBUG%g
s%@ECHO_LT@%$ECHO_LT%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%@INEWS@%$INEWS%g
s%@INN_NNTPLIB@%$INN_NNTPLIB%g
s%@PCRE_MAJOR@%$PCRE_MAJOR%g
s%@PCRE_MINOR@%$PCRE_MINOR%g
s%@PCRE_DATE@%$PCRE_DATE%g
s%@PCRE_DEFINES@%$PCRE_DEFINES%g
s%@PCREDIR_MAKE@%$PCREDIR_MAKE%g
s%@PCREDIR_LIBS@%$PCREDIR_LIBS%g
s%@PCREDIR_CPPFLAGS@%$PCREDIR_CPPFLAGS%g
s%@EXTRAOBJS@%$EXTRAOBJS%g
s%@TIN_DEFAULTS_DIR@%$TIN_DEFAULTS_DIR%g
s%@LIBOBJS@%$LIBOBJS%g
s%@cf_cv_makeflags@%$cf_cv_makeflags%g
s%@CONFIG_H@%$CONFIG_H%g
s%@ALLOCA@%$ALLOCA%g
s%@GLIBC21@%$GLIBC21%g
s%@LIBICONV@%$LIBICONV%g
s%@USE_NLS@%$USE_NLS%g
s%@PATHSEP@%$PATHSEP%g
s%@MSGFMT@%$MSGFMT%g
s%@GMSGFMT@%$GMSGFMT%g
s%@XGETTEXT@%$XGETTEXT%g
s%@INTLBISON@%$INTLBISON%g
s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g
s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
s%@CATALOGS@%$CATALOGS%g
s%@CATOBJEXT@%$CATOBJEXT%g
s%@GMOFILES@%$GMOFILES%g
s%@INTLLIBS@%$INTLLIBS%g
s%@INTLOBJS@%$INTLOBJS%g
s%@POFILES@%$POFILES%g
s%@POSUB@%$POSUB%g
s%@DATADIRNAME@%$DATADIRNAME%g
s%@INSTOBJEXT@%$INSTOBJEXT%g
s%@GENCAT@%$GENCAT%g
s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
s%@MSG_DIR_MAKE@%$MSG_DIR_MAKE%g
s%@SUB_MAKEFILE@%$SUB_MAKEFILE%g
s%@INTLDIR_MAKE@%$INTLDIR_MAKE%g
s%@GT_YES@%$GT_YES%g
s%@GT_NO@%$GT_NO%g
s%@X_CFLAGS@%$X_CFLAGS%g
s%@X_PRE_LIBS@%$X_PRE_LIBS%g
s%@X_LIBS@%$X_LIBS%g
s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%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-"$PCRE_MAKEFILE
	$SUB_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
for ac_file in $CONFIG_FILES; do
        # Support "outfile[:infile[:infile...]]"
        case "$ac_file" in
          *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
        esac
        # PO directories have a Makefile.in generated from Makefile.inn.
        case "$ac_file" in */[Mm]akefile.in)
          # Adjust a relative srcdir.
          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
          ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
          ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
	  ac_base=`basename $ac_file .in`
          # In autoconf-2.13 it is called $ac_given_srcdir.
          # In autoconf-2.50 it is called $srcdir.
          test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
          case "$ac_given_srcdir" in
            .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
            /*) top_srcdir="$ac_given_srcdir" ;;
            *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
          esac
          if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
            rm -f "$ac_dir/POTFILES"
            test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
            sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
            test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
          fi
          ;;
        esac
      done
# 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

