#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13.20110430 
# 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})
  --disable-heapsort      disable heapsort() as alternative to qsort
  --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)
EOF
cat <<\EOF
  --with-mailbox=DIR      directory for incoming mailboxes (default: empty)
  --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-slrnface         (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 support
  --disable-echo          do not display "compiling" commands
  --enable-prototypes     check for optional prototypes
EOF
cat <<\EOF
  --enable-warnings       turn on GCC compiler warnings
  --with-libdir=PATH      news-library (default: /usr/lib/news)
  --with-spooldir=PATH    news spool-directory (default: /var/spool/news)
  --with-nov-dir=PATH     news overview-directory (default: $SPOOLDIR)
  --with-nov-fname        specify names of overview files (default: .overview)
  --with-inews-dir=PATH   directory containing "inews" (default: $INEWSPATH)
  --with-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)
EOF
cat <<\EOF
  --with-curses-dir=DIR   directory in which (n)curses is installed
  --with-ncurses          link with ncurses if available (deprecated)
  --enable-curses         use curses interface (deprecated)
  --with-pkg-config{=path} enable/disable use of pkg-config
  --with-pcre=PATH        use installed pcre versus bundled
  --with-dbmalloc         test: use Conor Cahill's dbmalloc library
  --with-dmalloc          test: use Gray Watson's dmalloc library
  --with-trace            use debugging/traces for screen output
  --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
  --enable-cancel-locks   enable creation of Cancel-Locks
EOF
cat <<\EOF
  --disable-gsasl         don't use GNU SASL
  --disable-8bit-keys     disable 8-bit keycode support
  --disable-color         disable ANSI-color support
  --disable-etiquette     disable printing of posting-etiquette
  --disable-break-long-lines
                          don't 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
EOF
cat <<\EOF
  --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
  --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)
  --disable-ipv6          disable IPv6 support (default: enabled)
  --enable-long-article-numbers
                          enable long article numbers (default: disabled)
  --with-coffee           coffee support
  --with-libiconv-prefix=DIR
                          search for libiconv in DIR/include and DIR/lib
EOF
cat <<\EOF
  --disable-nls           do not use Native Language Support
  --with-included-gettext use the GNU gettext library included here
  --with-textdomain=PKG   NLS text-domain (default is package name)
  --disable-included-msgs use included messages, for i18n support
  --with-Xaw3d            link with Xaw 3d library
  --with-Xaw3dxft         link with Xaw 3d xft library
  --with-neXtaw           link with neXT Athena library
  --with-XawPlus          link with Athena-Plus library
  --with-x                use the X Window System
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.20110430"
    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





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

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




EXTRAO_DEP='#'

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:682: 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



	echo $ac_n "checking for PATH separator""... $ac_c" 1>&6
echo "configure:731: checking for PATH separator" >&5
	case $cf_cv_system_name in
	(os2*)	PATH_SEPARATOR=';'  ;;
	(*)	${PATH_SEPARATOR:=':'}  ;;
	esac

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


# 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
eval DESTDIR="$withval"

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

if test "$program_transform_name" = s,x,x,; then
  program_transform_name=
else
  # Double any \ or $.  echo might interpret backslashes.
  cat <<\EOF_SED > conftestsed
s,\\,\\\\,g; s,\$,$$,g
EOF_SED
  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
  rm -f conftestsed
fi
test "$program_prefix" != NONE &&
  program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
  program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"

# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"


###	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:817: 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="da de en_GB et fr ru sv tr zh_CN zh_TW"

### Checks for programs
save_CFLAGS="$CFLAGS"


# This should have been defined by AC_PROG_CC
: ${CC:=cc}

echo $ac_n "checking \$CC variable""... $ac_c" 1>&6
echo "configure:870: checking \$CC variable" >&5
case "$CC" in
(*[\ \	]-*)
	echo "$ac_t""broken" 1>&6
	echo "configure: warning: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" 1>&2
	# humor him...
	cf_flags=`echo "$CC" | sed -e 's/^[^ 	]*[ 	][ 	]*//'`
	CC=`echo "$CC " | sed -e 's/[ 	]-[IUD][^ 	][^ 	]*//g' -e 's/[ 	]*$//'`
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	test -n "$verbose" && echo "	resulting CC: '$CC'" 1>&6

echo "${as_me:-configure}:962: testing resulting CC: '$CC' ..." 1>&5


	test -n "$verbose" && echo "	resulting CFLAGS: '$CFLAGS'" 1>&6

echo "${as_me:-configure}:967: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5


	test -n "$verbose" && echo "	resulting CPPFLAGS: '$CPPFLAGS'" 1>&6

echo "${as_me:-configure}:972: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5


	;;
(*)
	echo "$ac_t""ok" 1>&6
	;;
esac


echo $ac_n "checking for ${CC:-cc} option to accept ANSI C""... $ac_c" 1>&6
echo "configure:983: 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
	(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
		case $cf_add_cflags in
		(-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_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 1089 "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:1105: \"$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
	(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
		case $cf_add_cflags in
		(-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_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


# 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:1217: 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:1247: 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:1298: 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:1330: 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 1341 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1346: \"$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:1372: 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:1377: 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:1386: \"$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:1405: 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



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


# This should have been defined by AC_PROG_CC
: ${CC:=cc}

echo $ac_n "checking \$CC variable""... $ac_c" 1>&6
echo "configure:1462: checking \$CC variable" >&5
case "$CC" in
(*[\ \	]-*)
	echo "$ac_t""broken" 1>&6
	echo "configure: warning: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" 1>&2
	# humor him...
	cf_flags=`echo "$CC" | sed -e 's/^[^ 	]*[ 	][ 	]*//'`
	CC=`echo "$CC " | sed -e 's/[ 	]-[IUD][^ 	][^ 	]*//g' -e 's/[ 	]*$//'`
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	test -n "$verbose" && echo "	resulting CC: '$CC'" 1>&6

echo "${as_me:-configure}:1554: testing resulting CC: '$CC' ..." 1>&5


	test -n "$verbose" && echo "	resulting CFLAGS: '$CFLAGS'" 1>&6

echo "${as_me:-configure}:1559: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5


	test -n "$verbose" && echo "	resulting CPPFLAGS: '$CPPFLAGS'" 1>&6

echo "${as_me:-configure}:1564: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5


	;;
(*)
	echo "$ac_t""ok" 1>&6
	;;
esac


echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1575: 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 1590 "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:1596: \"$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 1607 "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:1613: \"$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 1624 "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:1630: \"$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:1656: 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 1662 "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 1680 "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:1702: 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:1740: 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:1817: checking for $cf_prog" >&5
    cf_command="$cf_prog conftest.y"
    cf_result=no
    if { (eval echo configure:1820: \"$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:1824: \"$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:1848: 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=":"




cf_XOPEN_SOURCE=500
cf_POSIX_C_SOURCE=199506L
cf_xopen_source=

case $host_os in
(aix[4-7]*)
	cf_xopen_source="-D_ALL_SOURCE"
	;;
(msys)
	cf_XOPEN_SOURCE=600
	;;
(darwin[0-8].*)
	cf_xopen_source="-D_APPLE_C_SOURCE"
	;;
(darwin*)
	cf_xopen_source="-D_DARWIN_C_SOURCE"
	cf_XOPEN_SOURCE=
	;;
(freebsd*|dragonfly*)
	# 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
	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
	;;
(hpux11*)
	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
	;;
(hpux*)
	cf_xopen_source="-D_HPUX_SOURCE"
	;;
(irix[56].*)
	cf_xopen_source="-D_SGI_SOURCE"
	cf_XOPEN_SOURCE=
	;;
(linux*|gnu*|mint*|k*bsd*-gnu|cygwin)
	
echo $ac_n "checking if we must define _GNU_SOURCE""... $ac_c" 1>&6
echo "configure:1920: 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 1926 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1936: \"$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 1946 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:1956: \"$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

if test "$cf_cv_gnu_source" = yes
then
echo $ac_n "checking if we should also define _DEFAULT_SOURCE""... $ac_c" 1>&6
echo "configure:1978: checking if we should also define _DEFAULT_SOURCE" >&5
if eval "test \"`echo '$''{'cf_cv_default_source'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
	cat > conftest.$ac_ext <<EOF
#line 1985 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

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

echo "$ac_t""$cf_cv_default_source" 1>&6
test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
fi

	;;
(minix*)
	cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
	;;
(mirbsd*)
	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
	cf_XOPEN_SOURCE=
	
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE

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


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


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:2037: 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 "${as_me:-configure}:2043: testing if the symbol is already defined go no further ..." 1>&5

	cat > conftest.$ac_ext <<EOF
#line 2046 "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:2056: \"$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
	 (.[12]??*)
		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
		;;
	 (.2)
		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 2078 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _POSIX_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2088: \"$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 "${as_me:-configure}:2099: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5

	 CFLAGS="$cf_trim_CFLAGS"
	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
	 
echo "${as_me:-configure}:2104: testing if the second compile does not leave our definition intact error ..." 1>&5

	 cat > conftest.$ac_ext <<EOF
#line 2107 "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:2117: \"$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"
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




fi


	;;
(netbsd*)
	cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
	;;
(openbsd[4-9]*)
	# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
	cf_xopen_source="-D_BSD_SOURCE"
	cf_XOPEN_SOURCE=600
	;;
(openbsd*)
	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
	;;
(osf[45]*)
	cf_xopen_source="-D_OSF_SOURCE"
	;;
(nto-qnx*)
	cf_xopen_source="-D_QNX_SOURCE"
	;;
(sco*)
	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
	;;
(solaris2.*)
	cf_xopen_source="-D__EXTENSIONS__"
	cf_cv_xopen_source=broken
	;;
(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
	cf_XOPEN_SOURCE=
	cf_POSIX_C_SOURCE=
	;;
(*)
	
echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
echo "configure:2256: 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 2262 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2276: \"$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 2286 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

int main() {

#ifdef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2300: \"$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
	
CFLAGS=`echo "$CFLAGS" | \
	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`

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

	cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




fi

	
cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE

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


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


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:2433: 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 "${as_me:-configure}:2439: testing if the symbol is already defined go no further ..." 1>&5

	cat > conftest.$ac_ext <<EOF
#line 2442 "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:2452: \"$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
	 (.[12]??*)
		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
		;;
	 (.2)
		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 2474 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {

#ifdef _POSIX_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2484: \"$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 "${as_me:-configure}:2495: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5

	 CFLAGS="$cf_trim_CFLAGS"
	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
	 
echo "${as_me:-configure}:2500: testing if the second compile does not leave our definition intact error ..." 1>&5

	 cat > conftest.$ac_ext <<EOF
#line 2503 "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:2513: \"$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"
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




fi


	;;
esac

if test -n "$cf_xopen_source" ; then
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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

echo "${as_me:-configure}:2691: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5


	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

echo "${as_me:-configure}:2700: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5


	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi

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

echo "${as_me:-configure}:2709: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5


	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




fi

if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
	echo $ac_n "checking if _XOPEN_SOURCE really is set""... $ac_c" 1>&6
echo "configure:2722: checking if _XOPEN_SOURCE really is set" >&5
	cat > conftest.$ac_ext <<EOF
#line 2724 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_XOPEN_SOURCE_set=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_XOPEN_SOURCE_set=no
fi
rm -f conftest*
	echo "$ac_t""$cf_XOPEN_SOURCE_set" 1>&6
	if test $cf_XOPEN_SOURCE_set = yes
	then
		cat > conftest.$ac_ext <<EOF
#line 2748 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main() {

#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_XOPEN_SOURCE_set_ok=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cf_XOPEN_SOURCE_set_ok=no
fi
rm -f conftest*
		if test $cf_XOPEN_SOURCE_set_ok = no
		then
			echo "configure: warning: _XOPEN_SOURCE is lower than requested" 1>&2
		fi
	else
		
echo $ac_n "checking if we should define _XOPEN_SOURCE""... $ac_c" 1>&6
echo "configure:2775: 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 2781 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

int main() {

#ifndef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2795: \"$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 2805 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>

int main() {

#ifdef _XOPEN_SOURCE
make an error
#endif
; return 0; }
EOF
if { (eval echo configure:2819: \"$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
	
CFLAGS=`echo "$CFLAGS" | \
	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`

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

	cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




fi

	fi
fi


echo $ac_n "checking if SIGWINCH is defined""... $ac_c" 1>&6
echo "configure:2939: checking if SIGWINCH is defined" >&5
if eval "test \"`echo '$''{'cf_cv_define_sigwinch'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cat > conftest.$ac_ext <<EOF
#line 2945 "configure"
#include "confdefs.h"

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

int main() {
int x = SIGWINCH
; return 0; }
EOF
if { (eval echo configure:2955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_define_sigwinch=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 2963 "configure"
#include "confdefs.h"

#undef _XOPEN_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
#include <sys/types.h>
#include <sys/signal.h>

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

fi
rm -f conftest*

fi

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

if test "$cf_cv_define_sigwinch" = maybe ; then
echo $ac_n "checking for actual SIGWINCH definition""... $ac_c" 1>&6
echo "configure:2996: checking for actual SIGWINCH definition" >&5
if eval "test \"`echo '$''{'cf_cv_fixup_sigwinch'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_fixup_sigwinch=unknown
cf_sigwinch=32
while test $cf_sigwinch != 1
do
	cat > conftest.$ac_ext <<EOF
#line 3006 "configure"
#include "confdefs.h"

#undef _XOPEN_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
#include <sys/types.h>
#include <sys/signal.h>

int main() {

#if SIGWINCH != $cf_sigwinch
make an error
#endif
int x = SIGWINCH
; return 0; }
EOF
if { (eval echo configure:3023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cf_cv_fixup_sigwinch=$cf_sigwinch
	 break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*

cf_sigwinch=`expr $cf_sigwinch - 1`
done

fi

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

	if test "$cf_cv_fixup_sigwinch" != unknown ; then
		CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
	fi
fi

echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
echo "configure:3046: 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 3051 "configure"
#include "confdefs.h"

int main() {

#ifndef __CYGWIN__
#define __CYGWIN__ __CYGWIN32__
#endif
return __CYGWIN__;
; return 0; }
EOF
if { (eval echo configure:3062: \"$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:3079: 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 3084 "configure"
#include "confdefs.h"

int main() {
return __MINGW32__;
; return 0; }
EOF
if { (eval echo configure:3091: \"$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:3123: 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:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
    for file in conftest.*; do
      if test -f $file ; then
        case $file in
          *.c | *.o | *.obj) ;;
          *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
        esac
      fi
    done
  else
    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
  fi
  rm -rf conftest.dSYM
  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:3157: 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:3163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  for ac_file in conftest.*; do
    if test -f $ac_file ; then
      case $ac_file in
        *.c) ;;
        *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
      esac
    fi
  done
else
  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
fi
rm -rf conftest.dSYM
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*|os2*)
		if test "$DFT_LWR_MODEL" = libtool; then
			LIB_PREFIX='lib'
		else
			LIB_PREFIX=''
		fi
		;;
	(*)	LIB_PREFIX='lib'
		;;
	esac
LIB_PREFIX=$LIB_PREFIX
	

echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:3207: 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:3252: 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:3284: 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:3288: 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:3301: 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:3312: 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:3323: 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:3334: 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:3377: 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:3403: 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:3435: 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:3470: 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:3502: 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:3538: 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:3570: 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





echo $ac_n "checking for options to update archives""... $ac_c" 1>&6
echo "configure:3607: checking for options to update archives" >&5
if eval "test \"`echo '$''{'cf_cv_ar_flags'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
	cf_cv_ar_flags=unknown
	for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
	do

		# check if $ARFLAGS already contains this choice
		if test "x$ARFLAGS" != "x" ; then
			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
				cf_cv_ar_flags=
				break
			fi
		fi

		rm -f conftest.$ac_cv_objext
		rm -f conftest.a

		cat >conftest.$ac_ext <<EOF
#line 3629 "configure"
int	testdata[3] = { 123, 456, 789 };
EOF
		if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } ; then
			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
			if test -f conftest.a ; then
				cf_cv_ar_flags=$cf_ar_flags
				break
			fi
		else
			test -n "$verbose" && echo "	cannot compile test-program" 1>&6

echo "${as_me:-configure}:3642: testing cannot compile test-program ..." 1>&5


			break
		fi
	done
	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext

fi

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

if test -n "$ARFLAGS" ; then
	if test -n "$cf_cv_ar_flags" ; then
		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
	fi
else
	ARFLAGS=$cf_cv_ar_flags
fi




case "$host_cpu:$host_vendor:$host_os" in
	# check for MacOS X, exclude Darwin on ix86
#	powerpc:apple:darwin*)  #(vi
#		AC_DEFINE(MAC_OS_X)
#		;;
	# check for cygwin environment
	# -DSTATIC is needed for pcre
	*:*:*cygwin*)	#(vi
		PCRE_DEFINES="$PCRE_DEFINES -DSTATIC"
		;;
	# SEIUX doesn't have any useful preprocessor symbol
	mips:sei:seiux*)	#(vi
		cat >> confdefs.h <<\EOF
#define SEIUX 1
EOF

		;;
esac

echo $ac_n "checking if you would like to use heapsort""... $ac_c" 1>&6
echo "configure:3685: checking if you would like to use heapsort" >&5

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

fi

echo "$ac_t""$cf_use_heapsort" 1>&6
if test "x$cf_use_heapsort" = xyes; then
	for ac_func in heapsort
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3707: 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 3712 "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:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf conftest*
fi

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

	if test x"$ac_cv_func_heapsort" = xyes; then
		echo $ac_n "checking if its prototype is compatible with qsort""... $ac_c" 1>&6
echo "configure:3761: checking if its prototype is compatible with qsort" >&5
		cat > conftest.$ac_ext <<EOF
#line 3763 "configure"
#include "confdefs.h"

#include <stdlib.h>
#include <sys/types.h>
extern int my_compare(const void *, const void *);

int main() {

	char *base = 0;
	heapsort((void *)0, 1, 2, my_compare);

; return 0; }
EOF
if { (eval echo configure:3777: \"$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_use_heapsort=no
fi
rm -f conftest*;
		echo "$ac_t""$cf_use_heapsort" 1>&6
	else
		test -n "$verbose" && echo "	will use our own heapsort function" 1>&6

echo "${as_me:-configure}:3790: testing will use our own heapsort function ..." 1>&5


		EXTRAO_DEP=''
		EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/heapsort.o"
	fi
fi
if test "x$cf_use_heapsort" = xyes; then
	cat >> confdefs.h <<\EOF
#define USE_HEAPSORT 1
EOF

fi


# 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:3817: 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:3834: 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:3891: 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:3908: 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:3965: 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:3982: 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:4029: 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:4034: \"$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:4064: 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:4092: 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:4137: 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:4191: 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:4228: 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:4262: 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:4289: 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:4335: 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:4367: 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:4384: 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:4442: 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:4459: 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:4517: 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:4534: 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

## slrnface

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

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

fi

if test -n "$ac_cv_path_PATH_SLRNFACE"; then
	EXTRAO_DEP=""
	EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/xface.o"
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:4670: 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 4676 "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:4689: \"$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 "${as_me:-configure}:4699: 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 "${as_me:-configure}:4703: 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 "${as_me:-configure}:4738: 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:4745: 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:4798: 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:4820: 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:4852: 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:4879: 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=''
	SHOW_CC=''
	ECHO_CC=''

	fi
else
  enableval=yes 
	
	ECHO_LT=''
	ECHO_LD=''
	RULE_CC=''
	SHOW_CC=''
	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:4924: 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:4948: 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
	



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:4979: checking if this is really Intel C compiler" >&5
		cf_save_CFLAGS="$CFLAGS"
		CFLAGS="$CFLAGS -no-gcc"
		cat > conftest.$ac_ext <<EOF
#line 4983 "configure"
#include "confdefs.h"

int main() {

#ifdef __INTEL_COMPILER
#else
make an error
#endif

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

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


CLANG_COMPILER=no

if test "$GCC" = yes ; then
	echo $ac_n "checking if this is really Clang C compiler""... $ac_c" 1>&6
echo "configure:5016: checking if this is really Clang C compiler" >&5
	cf_save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -Qunused-arguments"
	cat > conftest.$ac_ext <<EOF
#line 5020 "configure"
#include "confdefs.h"

int main() {

#ifdef __clang__
#else
make an error
#endif

; return 0; }
EOF
if { (eval echo configure:5032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  CLANG_COMPILER=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"

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


cat > conftest.$ac_ext <<EOF
#line 5048 "${as_me:-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 #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 #279: controlling expression is constant

	echo "checking for $CC warning options" 1>&6
echo "configure:5066: checking for $CC warning options" >&5
	cf_save_CFLAGS="$CFLAGS"
	EXTRA_CFLAGS="-Wall"
	for cf_opt in \
		wd1419 \
		wd1683 \
		wd1684 \
		wd193 \
		wd593 \
		wd279 \
		wd810 \
		wd869 \
		wd981
	do
		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
		if { (eval echo configure:5081: \"$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:5091: checking for $CC warning options" >&5
	cf_save_CFLAGS="$CFLAGS"
	EXTRA_CFLAGS=
	cf_warn_CONST=""
	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
	cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
	test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
	for cf_opt in W Wall \
		Wbad-function-cast \
		Wcast-align \
		Wcast-qual \
		Wdeclaration-after-statement \
		Wextra \
		Winline \
		Wmissing-declarations \
		Wmissing-prototypes \
		Wnested-externs \
		Wpointer-arith \
		Wshadow \
		Wstrict-prototypes \
		Wundef $cf_gcc_warnings $cf_warn_CONST 
	do
		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
		if { (eval echo configure:5114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
			test -n "$verbose" && echo "$ac_t""... -$cf_opt" 1>&6
			case $cf_opt in
			(Wcast-qual)
				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
				;;
			(Winline)
				case $GCC_VERSION in
				([34].*)
					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6

echo "${as_me:-configure}:5125: testing feature is broken in gcc $GCC_VERSION ..." 1>&5


					continue;;
				esac
				;;
			(Wpointer-arith)
				case $GCC_VERSION in
				([12].*)
					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6

echo "${as_me:-configure}:5136: testing feature is broken in gcc $GCC_VERSION ..." 1>&5


					continue;;
				esac
				;;
			esac
			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
		fi
	done
	CFLAGS="$cf_save_CFLAGS"
fi
rm -rf 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:5159: 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
eval NEWSLIBDIR="$withval"

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

	echo $ac_n "checking for news spool-directory path""... $ac_c" 1>&6
echo "configure:5205: 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
eval SPOOLDIR="$withval"

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

	echo $ac_n "checking for news overview-directory path""... $ac_c" 1>&6
echo "configure:5251: 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
eval NOVROOTDIR="$withval"

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

	echo $ac_n "checking for overview filename""... $ac_c" 1>&6
echo "configure:5297: 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:5333: 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
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:5382: 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

### 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:5438: 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:5458: 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
(no)
	;;
(yes)
	;;
(*)
	

for cf_searchpath in `echo "$cf_cv_use_libsocks" | tr $PATH_SEPARATOR ' '`; do
	if test -d $cf_searchpath/include; then
		
if test -n "$cf_searchpath/include" ; then
  for cf_add_incdir in $cf_searchpath/include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 5515 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:5522: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:5539: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	elif test -d $cf_searchpath/../include ; then
		
if test -n "$cf_searchpath/../include" ; then
  for cf_add_incdir in $cf_searchpath/../include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 5583 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:5590: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:5607: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	else
{ echo "configure: error: cannot find socks library under $cf_cv_use_libsocks" 1>&2; exit 1; }
	fi
	if test -d $cf_searchpath/lib; then
		
if test -n "$cf_searchpath/lib" ; then
	for cf_add_libdir in $cf_searchpath/lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:5649: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	elif test -d $cf_searchpath ; then
		
if test -n "$cf_searchpath" ; then
	for cf_add_libdir in $cf_searchpath
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:5679: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	else
{ echo "configure: error: cannot find socks library under $cf_cv_use_libsocks" 1>&2; exit 1; }
	fi
done

	;;
esac

  

# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
# will be set on completion of the AC_TRY_LINK below.
cf_cv_header_path_socks=
cf_cv_library_path_socks=


echo "${as_me:-configure}:5704: testing Starting FIND_LINKAGE(socks,) ..." 1>&5


cf_save_LIBS="$LIBS"

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

#include <stdio.h>

int main() {

      Raccept((char *)0)

; return 0; }
EOF
if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_socks=yes
	cf_cv_header_path_socks=/usr/include
	cf_cv_library_path_socks=/usr/lib

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

  

LIBS="-lsocks  $cf_save_LIBS"

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

#include <stdio.h>

int main() {

      Raccept((char *)0)

; return 0; }
EOF
if { (eval echo configure:5748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_socks=yes
	cf_cv_header_path_socks=/usr/include
	cf_cv_library_path_socks=/usr/lib
	cf_cv_library_file_socks="-lsocks"

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

  
	cf_cv_find_linkage_socks=no
	LIBS="$cf_save_LIBS"

	test -n "$verbose" && echo "	find linkage for socks library" 1>&6

echo "${as_me:-configure}:5766: testing find linkage for socks library ..." 1>&5


	
echo "${as_me:-configure}:5770: testing Searching for headers in FIND_LINKAGE(socks,) ..." 1>&5


	cf_save_CPPFLAGS="$CPPFLAGS"
	cf_test_CPPFLAGS="$CPPFLAGS"

	
cf_search=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/socks &&       cf_search="$cf_search $cf_header_path/include/socks"
	test -d $cf_header_path/include/socks/include &&    cf_search="$cf_search $cf_header_path/include/socks/include"
	test -d $cf_header_path/socks/include &&       cf_search="$cf_search $cf_header_path/socks/include"
	test -d $cf_header_path/socks/include/socks &&    cf_search="$cf_search $cf_header_path/socks/include/socks"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/socks &&       cf_search="$cf_search $prefix/include/socks"
	test -d $prefix/include/socks/include &&    cf_search="$cf_search $prefix/include/socks/include"
	test -d $prefix/socks/include &&       cf_search="$cf_search $prefix/socks/include"
	test -d $prefix/socks/include/socks &&    cf_search="$cf_search $prefix/socks/include/socks"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/socks &&       cf_search="$cf_search $cf_subdir_prefix/include/socks"
	test -d $cf_subdir_prefix/include/socks/include &&    cf_search="$cf_search $cf_subdir_prefix/include/socks/include"
	test -d $cf_subdir_prefix/socks/include &&       cf_search="$cf_search $cf_subdir_prefix/socks/include"
	test -d $cf_subdir_prefix/socks/include/socks &&    cf_search="$cf_search $cf_subdir_prefix/socks/include/socks"
}

done


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

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

cf_search="$cf_search $cf_header_path_list"

	for cf_cv_header_path_socks in $cf_search
	do
		if test -d $cf_cv_header_path_socks ; then
			test -n "$verbose" && echo "	... testing $cf_cv_header_path_socks" 1>&6

echo "${as_me:-configure}:5866: testing ... testing $cf_cv_header_path_socks ..." 1>&5


			CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_socks"
			cat > conftest.$ac_ext <<EOF
#line 5871 "configure"
#include "confdefs.h"

#include <stdio.h>

int main() {

      Raccept((char *)0)

; return 0; }
EOF
if { (eval echo configure:5882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
				test -n "$verbose" && echo "	... found socks headers in $cf_cv_header_path_socks" 1>&6

echo "${as_me:-configure}:5887: testing ... found socks headers in $cf_cv_header_path_socks ..." 1>&5


				cf_cv_find_linkage_socks=maybe
				cf_test_CPPFLAGS="$CPPFLAGS"
				break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
				CPPFLAGS="$cf_save_CPPFLAGS"
				
fi
rm -f conftest*
		fi
	done

	if test "$cf_cv_find_linkage_socks" = maybe ; then

		
echo "${as_me:-configure}:5908: testing Searching for socks library in FIND_LINKAGE(socks,) ..." 1>&5


		cf_save_LIBS="$LIBS"
		cf_save_LDFLAGS="$LDFLAGS"

		

		if test "$cf_cv_find_linkage_socks" != yes ; then
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/socks &&       cf_search="$cf_search $cf_library_path/lib/socks"
	test -d $cf_library_path/lib/socks/lib &&    cf_search="$cf_search $cf_library_path/lib/socks/lib"
	test -d $cf_library_path/socks/lib &&       cf_search="$cf_search $cf_library_path/socks/lib"
	test -d $cf_library_path/socks/lib/socks &&    cf_search="$cf_search $cf_library_path/socks/lib/socks"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/socks &&       cf_search="$cf_search $prefix/lib/socks"
	test -d $prefix/lib/socks/lib &&    cf_search="$cf_search $prefix/lib/socks/lib"
	test -d $prefix/socks/lib &&       cf_search="$cf_search $prefix/socks/lib"
	test -d $prefix/socks/lib/socks &&    cf_search="$cf_search $prefix/socks/lib/socks"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/socks &&       cf_search="$cf_search $cf_subdir_prefix/lib/socks"
	test -d $cf_subdir_prefix/lib/socks/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/socks/lib"
	test -d $cf_subdir_prefix/socks/lib &&       cf_search="$cf_search $cf_subdir_prefix/socks/lib"
	test -d $cf_subdir_prefix/socks/lib/socks &&    cf_search="$cf_search $cf_subdir_prefix/socks/lib/socks"
}

done


cf_search="$cf_library_path_list $cf_search"

			for cf_cv_library_path_socks in $cf_search
			do
				if test -d $cf_cv_library_path_socks ; then
					test -n "$verbose" && echo "	... testing $cf_cv_library_path_socks" 1>&6

echo "${as_me:-configure}:5990: testing ... testing $cf_cv_library_path_socks ..." 1>&5


					CPPFLAGS="$cf_test_CPPFLAGS"
					LIBS="-lsocks  $cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_socks"
					cat > conftest.$ac_ext <<EOF
#line 5997 "configure"
#include "confdefs.h"

#include <stdio.h>

int main() {

      Raccept((char *)0)

; return 0; }
EOF
if { (eval echo configure:6008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
					test -n "$verbose" && echo "	... found socks library in $cf_cv_library_path_socks" 1>&6

echo "${as_me:-configure}:6013: testing ... found socks library in $cf_cv_library_path_socks ..." 1>&5


					cf_cv_find_linkage_socks=yes
					cf_cv_library_file_socks="-lsocks"
					break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
					CPPFLAGS="$cf_save_CPPFLAGS"
					LIBS="$cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS"
					
fi
rm -rf conftest*
				fi
			done
			CPPFLAGS="$cf_save_CPPFLAGS"
			LDFLAGS="$cf_save_LDFLAGS"
		fi

	else
		cf_cv_find_linkage_socks=no
	fi
	
fi
rm -rf conftest*

fi
rm -rf conftest*

LIBS="$cf_save_LIBS"

if test "$cf_cv_find_linkage_socks" = yes ; then

	
if test -n "$cf_cv_header_path_socks" ; then
  for cf_add_incdir in $cf_cv_header_path_socks
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 6075 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:6082: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:6099: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	
if test -n "$cf_cv_library_path_socks" ; then
	for cf_add_libdir in $cf_cv_library_path_socks
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:6137: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	
cf_add_libs="-lsocks"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


else
echo "configure: warning: Cannot find socks library" 1>&2
fi


  if test "x$cf_cv_find_linkage_socks" = "xyes" ; then
    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

  else
    { echo "configure: error: cannot link with socks library" 1>&2; exit 1; }
  fi

else
	
cf_test_netlibs=no

echo $ac_n "checking for network libraries""... $ac_c" 1>&6
echo "configure:6216: 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

case $host_os in
(mingw*)
	for ac_hdr in windows.h winsock.h winsock2.h 
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6233: 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 6238 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6243: \"$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_winsock2_h" = "yes" ; then
		cf_winsock_lib="-lws2_32"
	elif test "$ac_cv_header_winsock_h" = "yes" ; then
		cf_winsock_lib="-lwsock32"
	fi

	cf_save_LIBS="$LIBS"
	
cf_add_libs="$cf_winsock_lib"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


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

#ifdef HAVE_WINDOWS_H
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#endif

int main() {

	char buffer[1024];
	gethostname(buffer, sizeof(buffer));
; return 0; }
EOF
if { (eval echo configure:6318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_netlibs="$cf_winsock_lib $cf_cv_netlibs"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  { echo "configure: error: Cannot link against winsock library" 1>&2; exit 1; }
fi
rm -rf conftest*

	LIBS="$cf_save_LIBS"
	;;
(*)
	for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6335: 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 6340 "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:6363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:6386: 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 6394 "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:6405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:6438: 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 6446 "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:6457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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


	echo $ac_n "checking for main in -linet""... $ac_c" 1>&6
echo "configure:6499: 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 6507 "configure"
#include "confdefs.h"

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

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:6539: 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 6544 "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:6567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:6590: 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 6598 "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:6609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:6642: 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 6650 "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:6661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:6706: 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 6711 "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:6734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:6757: 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 6765 "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:6776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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 inet_ntoa
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6817: 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 6822 "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:6845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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 inet_ntoa in -lnsl""... $ac_c" 1>&6
echo "configure:6868: checking for inet_ntoa in -lnsl" >&5
ac_lib_var=`echo nsl'_'inet_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="-lnsl $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6876 "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 inet_ntoa();

int main() {
inet_ntoa()
; return 0; }
EOF
if { (eval echo configure:6887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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 "inet_ntoa" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`

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

	ac_cv_func_inet_ntoa=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_inet_ntoa=unknown
	unset ac_cv_func_inet_ntoa 2>/dev/null
	
fi


fi
done


	for ac_func in gethostbyname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6928: 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 6933 "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:6956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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 -lnetwork""... $ac_c" 1>&6
echo "configure:6979: checking for gethostbyname in -lnetwork" >&5
ac_lib_var=`echo network'_'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="-lnetwork $cf_cv_netlibs $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6987 "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:6998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_network" != yes ; then cf_used_lib_network=yes; cf_cv_netlibs="-lnetwork $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:7039: 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 7044 "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:7067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:7090: 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 7098 "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:7109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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

	;;
esac

fi


case $cf_cv_netlibs in
(*ws2_32*)
	cat >> confdefs.h <<\EOF
#define USE_WINSOCK2_H 1
EOF

	;;
esac


cf_add_libs="$cf_cv_netlibs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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
(no)
	;;
(yes)
	;;
(*)
	

for cf_searchpath in `echo "$cf_cv_use_libsocks5" | tr $PATH_SEPARATOR ' '`; do
	if test -d $cf_searchpath/include; then
		
if test -n "$cf_searchpath/include" ; then
  for cf_add_incdir in $cf_searchpath/include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 7218 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:7225: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:7242: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	elif test -d $cf_searchpath/../include ; then
		
if test -n "$cf_searchpath/../include" ; then
  for cf_add_incdir in $cf_searchpath/../include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 7286 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:7293: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:7310: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	else
{ echo "configure: error: cannot find socks5 library under $cf_cv_use_libsocks5" 1>&2; exit 1; }
	fi
	if test -d $cf_searchpath/lib; then
		
if test -n "$cf_searchpath/lib" ; then
	for cf_add_libdir in $cf_searchpath/lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:7352: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	elif test -d $cf_searchpath ; then
		
if test -n "$cf_searchpath" ; then
	for cf_add_libdir in $cf_searchpath
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:7382: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	else
{ echo "configure: error: cannot find socks5 library under $cf_cv_use_libsocks5" 1>&2; exit 1; }
	fi
done

	;;
esac



cf_add_libs="-lsocks5"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


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:7428: checking if the socks library uses socks4 prefix" >&5
cf_use_socks4=error
cat > conftest.$ac_ext <<EOF
#line 7431 "configure"
#include "confdefs.h"

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

	Rinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:7440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  cat > conftest.$ac_ext <<EOF
#line 7452 "configure"
#include "confdefs.h"
#include <socks.h>
int main() {
SOCKSinit((char *)0)
; return 0; }
EOF
if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_use_socks4=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  { echo "configure: error: Cannot link with socks5 library" 1>&2; exit 1; }
fi
rm -rf conftest*
fi
rm -rf 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:7526: checking if socks5p.h is available" >&5
cat > conftest.$ac_ext <<EOF
#line 7528 "configure"
#include "confdefs.h"

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

	init((char *)0)
; return 0; }
EOF
if { (eval echo configure:7538: \"$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:7565: 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 7570 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7575: \"$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:7602: 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 7607 "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:7630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_fcntl=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_fcntl=no"
fi
rm -rf 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:7650: 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 7655 "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:7678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_lockf=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_lockf=no"
fi
rm -rf 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:7698: 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 7703 "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:7726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_flock=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_flock=no"
fi
rm -rf 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:7747: 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 7759 "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:7787: \"$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 7799 "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:7819: \"$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 7831 "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:7854: \"$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 will be used""... $ac_c" 1>&6
echo "configure:7875: checking which locking method will 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 highest 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 "$ac_t""none" 1>&6;
	echo "configure: warning: None of fcntl(), lockf(), flock() available" 1>&2
fi

echo $ac_n "checking for screen type""... $ac_c" 1>&6
echo "configure:7944: 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 for specific curses-directory""... $ac_c" 1>&6
echo "configure:7962: checking for specific curses-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"
  cf_cv_curses_dir=$withval
else
  cf_cv_curses_dir=no
fi

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

if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
	
if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

	if test -d "$cf_cv_curses_dir"
	then
		
if test -n "$cf_cv_curses_dir/include" ; then
  for cf_add_incdir in $cf_cv_curses_dir/include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 8033 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:8040: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:8057: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

		
if test -n "$cf_cv_curses_dir/lib" ; then
	for cf_add_libdir in $cf_cv_curses_dir/lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:8095: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	fi
fi


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:8127: 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:8140: 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
		
echo $ac_n "checking if you want to use pkg-config""... $ac_c" 1>&6
echo "configure:8170: checking if you want to use pkg-config" >&5

# Check whether --with-pkg-config or --without-pkg-config was given.
if test "${with_pkg_config+set}" = set; then
  withval="$with_pkg_config"
  cf_pkg_config=$withval
else
  cf_pkg_config=yes
fi

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

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

	;;
(*)
	PKG_CONFIG=$withval
	;;
esac

test -z "$PKG_CONFIG" && PKG_CONFIG=none
if test "$PKG_CONFIG" != none ; then
	
if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$PKG_CONFIG" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval PKG_CONFIG="$PKG_CONFIG"
	case ".$PKG_CONFIG" in
	(.NONE/*)
		PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$PKG_CONFIG\"" 1>&2; exit 1; }
	;;
esac

elif test "x$cf_pkg_config" != xno ; then
	echo "configure: warning: pkg-config is not installed" 1>&2
fi





cf_ncuconfig_root=ncurses
cf_have_ncuconfig=no

if test "x${PKG_CONFIG:=none}" != xnone; then
	echo $ac_n "checking pkg-config for $cf_ncuconfig_root""... $ac_c" 1>&6
echo "configure:8275: checking pkg-config for $cf_ncuconfig_root" >&5
	if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
		echo "$ac_t""yes" 1>&6

		echo $ac_n "checking if the $cf_ncuconfig_root package files work""... $ac_c" 1>&6
echo "configure:8280: checking if the $cf_ncuconfig_root package files work" >&5
		cf_have_ncuconfig=unknown

		cf_save_CPPFLAGS="$CPPFLAGS"
		cf_save_LIBS="$LIBS"

		CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
		
cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


		cat > conftest.$ac_ext <<EOF
#line 8306 "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:8313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  if test "$cross_compiling" = yes; then
  cf_have_ncuconfig=maybe
else
  cat > conftest.$ac_ext <<EOF
#line 8319 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
				int main(void)
				{ char *xx = curses_version(); return (xx == 0); }
EOF
if { (eval echo configure:8325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_have_ncuconfig=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_have_ncuconfig=no
fi
rm -fr conftest*
fi

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

  cf_have_ncuconfig=no
fi
rm -rf conftest*
		echo "$ac_t""$cf_have_ncuconfig" 1>&6
		test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
		if test "$cf_have_ncuconfig" != "yes"
		then
			CPPFLAGS="$cf_save_CPPFLAGS"
			LIBS="$cf_save_LIBS"
			NCURSES_CONFIG_PKG=none
		else
			cat >> confdefs.h <<\EOF
#define NCURSES 1
EOF

			NCURSES_CONFIG_PKG=$cf_ncuconfig_root
		fi

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

if test "x$cf_have_ncuconfig" = "xno"; then
	echo "Looking for ${cf_ncuconfig_root}-config"

	
for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
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:8376: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NCURSES_CONFIG" in
  /*)
  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
if test -n "$NCURSES_CONFIG"; then
  echo "$ac_t""$NCURSES_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$NCURSES_CONFIG" && break
done
test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"


	if test "$NCURSES_CONFIG" != none ; then

		CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
		
cf_add_libs="`$NCURSES_CONFIG --libs`"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


		# even with config script, some packages use no-override for curses.h
		
echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
echo "configure:8437: 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 \
	ncurses.h ncurses/ncurses.h \
	curses.h ncurses/curses.h 
do
cat > conftest.$ac_ext <<EOF
#line 8448 "configure"
#include "confdefs.h"
#include <${cf_header}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:8455: \"$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:8478: 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 8483 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8488: \"$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



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


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

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


				cf_cv_ncurses_version=`$NCURSES_CONFIG --version`

	else

		

cf_ncuhdr_root=ncurses

test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && { \
  
if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 8564 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:8571: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:8588: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

}

echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
echo "configure:8609: 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 8620 "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:8641: \"$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:8667: 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=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
	test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
	test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
	test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

done


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

cf_search="$cf_search $cf_header_path_list"

	test -n "$verbose" && echo search path $cf_search
	cf_save2_CPPFLAGS="$CPPFLAGS"
	for cf_incdir in $cf_search
	do
		
if test -n "$cf_incdir" ; then
  for cf_add_incdir in $cf_incdir
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 8787 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:8794: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:8811: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

		for cf_header in \
			ncurses.h \
			curses.h
		do
			
	cat > conftest.$ac_ext <<EOF
#line 8835 "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:8856: \"$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
	
if test -n "$cf_1st_incdir" ; then
  for cf_add_incdir in $cf_1st_incdir
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 8914 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:8921: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:8938: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi


fi

# Set definitions to allow ifdef'ing for ncurses.h

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

	;;
esac

case $cf_cv_ncurses_header in
(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 terminfo header""... $ac_c" 1>&6
echo "configure:8988: checking for terminfo header" >&5
if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
case ${cf_cv_ncurses_header} in
(*/ncurses.h|*/ncursesw.h)
	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
	;;
(*)
	cf_term_header=term.h
	;;
esac

for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat > conftest.$ac_ext <<EOF
#line 9005 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>

int main() {
int x = auto_left_margin
; return 0; }
EOF
if { (eval echo configure:9015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
	cf_cv_term_header="$cf_test"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cf_cv_term_header=unknown
	
fi
rm -f conftest*
	test "$cf_cv_term_header" != unknown && break
done

fi

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

# Set definitions to allow ifdef'ing to accommodate subdirectories

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

	;;
esac

case $cf_cv_term_header in
(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


# some applications need this, but should check for NCURSES_VERSION
cat >> confdefs.h <<\EOF
#define NCURSES 1
EOF



echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:9070: 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:9096: \"$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 9105 "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
	${cf_cv_main_return:-return}(0);
}
EOF
if { (eval echo configure:9129: \"$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:9160: 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 9168 "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:9179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:9195: 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 9203 "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:9214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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
(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:9246: 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 9254 "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:9265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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


cf_add_libs="$cf_ncurses_LIBS"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
	
cf_add_libs="-l$cf_nculib_root"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_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:9331: 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 9336 "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:9359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_initscr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_initscr=no"
fi
rm -rf 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:9379: checking for initscr in -l$cf_nculib_root" >&5
		LIBS="-l$cf_nculib_root $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 9382 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:9389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
	test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
	test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
	test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
}

done


cf_search="$cf_library_path_list $cf_search"

			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:9470: 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 9473 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:9480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
					 LIBS="$cf_save_LIBS"
fi
rm -rf conftest*
			done
			
fi
rm -rf 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:9511: 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 9520 "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:9527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  echo "$ac_t""no" 1>&6
		 LIBS="$cf_ncurses_SAVE"
fi
rm -rf 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



	fi
else
	NCURSES_CONFIG=none
fi

		;;
	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:9560: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 9562 "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:9570: \"$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:9597: 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 9602 "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() {
const 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);
      (void) iswalnum((wint_t) wcb[0]);
      (void) iswcntrl((wint_t) wcb[0]);
      (void) iswdigit((wint_t) wcb[0]);
      (void) iswgraph((wint_t) wcb[0]);
      (void) iswprint((wint_t) wcb[0]);
      (void) iswspace((wint_t) wcb[0]);
      (void) towupper((wint_t) wcb[0]);
      /* (void) iswupper((wint_t) wcb[0]); */
      /* (void) towlower((wint_t) wcb[0]); */
      /* (void) iswlower((wint_t) wcb[0]); */
      (void) iswalpha((wint_t) wcb[0]);
      /* (void) iswblank((wint_t) wcb[0]); */
      /* (void) iswpunct((wint_t) wcb[0]); */
      /* (void) iswxdigit((wint_t) wcb[0]); */
      /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
      /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
      (void) wcslen(wcb);
      /* (void) wcsnlen(wcb, 4); */
      wcwidth((wint_t) wcb[0]);
      wcswidth(wcb, 5);
      wcstombs(ocb, wcb, 5);
      wctomb(ocb, wcb[0]);
      wcscat(wcb2, wcb);
      wcscpy(wcb2, wcb);
      mbstowcs(format, "%s", 2);
      swprintf(wcb, 5, format, "test");
      wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:9656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_multibyte_able=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_save_LIBS="$LIBS"
      LIBS="-lutf8 $LIBS"
      cat > conftest.$ac_ext <<EOF
#line 9666 "configure"
#include "confdefs.h"
#include <libutf8.h>
int main() {
const 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);
        (void) iswalnum((wint_t) wcb[0]);
        (void) iswcntrl((wint_t) wcb[0]);
        (void) iswdigit((wint_t) wcb[0]);
        (void) iswgraph((wint_t) wcb[0]);
        (void) iswprint((wint_t) wcb[0]);
        (void) iswspace((wint_t) wcb[0]);
        (void) towupper((wint_t) wcb[0]);
        /* (void) iswupper((wint_t) wcb[0]); */
        /* (void) towlower((wint_t) wcb[0]); */
        /* (void) iswlower((wint_t) wcb[0]); */
        (void) iswalpha((wint_t) wcb[0]);
        /* (void) iswblank((wint_t) wcb[0]); */
        /* (void) iswpunct((wint_t) wcb[0]); */
        /* (void) iswxdigit((wint_t) wcb[0]); */
        /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
        /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
        (void) wcslen(wcb);
        /* (void) wcsnlen(wcb, 4); */
        wcwidth((wint_t) wcb[0]);
        wcswidth(wcb, 5);
        wcstombs(ocb, wcb, 5);
        wctomb(ocb, wcb[0]);
        wcscat(wcb2, wcb);
        wcscpy(wcb2, wcb);
        mbstowcs(format, "%s", 2);
        swprintf(wcb, 5, format, "test");
        wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:9710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_multibyte_able=libutf8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  am_cv_multibyte_able=no
fi
rm -rf conftest*
      LIBS="$cf_save_LIBS"
   
fi
rm -rf 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_ncuconfig_root=ncursesw
cf_have_ncuconfig=no

if test "x${PKG_CONFIG:=none}" != xnone; then
	echo $ac_n "checking pkg-config for $cf_ncuconfig_root""... $ac_c" 1>&6
echo "configure:9749: checking pkg-config for $cf_ncuconfig_root" >&5
	if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
		echo "$ac_t""yes" 1>&6

		echo $ac_n "checking if the $cf_ncuconfig_root package files work""... $ac_c" 1>&6
echo "configure:9754: checking if the $cf_ncuconfig_root package files work" >&5
		cf_have_ncuconfig=unknown

		cf_save_CPPFLAGS="$CPPFLAGS"
		cf_save_LIBS="$LIBS"

		CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
		
cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


		cat > conftest.$ac_ext <<EOF
#line 9780 "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:9787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  if test "$cross_compiling" = yes; then
  cf_have_ncuconfig=maybe
else
  cat > conftest.$ac_ext <<EOF
#line 9793 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
				int main(void)
				{ char *xx = curses_version(); return (xx == 0); }
EOF
if { (eval echo configure:9799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  cf_have_ncuconfig=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cf_have_ncuconfig=no
fi
rm -fr conftest*
fi

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

  cf_have_ncuconfig=no
fi
rm -rf conftest*
		echo "$ac_t""$cf_have_ncuconfig" 1>&6
		test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
		if test "$cf_have_ncuconfig" != "yes"
		then
			CPPFLAGS="$cf_save_CPPFLAGS"
			LIBS="$cf_save_LIBS"
			NCURSES_CONFIG_PKG=none
		else
			cat >> confdefs.h <<\EOF
#define NCURSES 1
EOF

			NCURSES_CONFIG_PKG=$cf_ncuconfig_root
		fi

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

if test "x$cf_have_ncuconfig" = "xno"; then
	echo "Looking for ${cf_ncuconfig_root}-config"

	
for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
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:9850: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_NCURSES_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NCURSES_CONFIG" in
  /*)
  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
NCURSES_CONFIG="$ac_cv_path_NCURSES_CONFIG"
if test -n "$NCURSES_CONFIG"; then
  echo "$ac_t""$NCURSES_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$NCURSES_CONFIG" && break
done
test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"


	if test "$NCURSES_CONFIG" != none ; then

		CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
		
cf_add_libs="`$NCURSES_CONFIG --libs`"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


		# even with config script, some packages use no-override for curses.h
		
echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
echo "configure:9911: 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 \
	ncurses.h ncursesw/ncurses.h \
	curses.h ncursesw/curses.h 
do
cat > conftest.$ac_ext <<EOF
#line 9922 "configure"
#include "confdefs.h"
#include <${cf_header}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:9929: \"$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:9952: 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 9957 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9962: \"$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



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


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

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


				cf_cv_ncurses_version=`$NCURSES_CONFIG --version`

	else

		

cf_ncuhdr_root=ncursesw

test -n "$cf_cv_curses_dir" && \
test "$cf_cv_curses_dir" != "no" && { \
  
if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
  for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 10038 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:10045: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:10062: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

}

echo $ac_n "checking for $cf_ncuhdr_root header in include-path""... $ac_c" 1>&6
echo "configure:10083: 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 10094 "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:10123: \"$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:10149: 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=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
	test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
	test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
	test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
}

done


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

cf_search="$cf_search $cf_header_path_list"

	test -n "$verbose" && echo search path $cf_search
	cf_save2_CPPFLAGS="$CPPFLAGS"
	for cf_incdir in $cf_search
	do
		
if test -n "$cf_incdir" ; then
  for cf_add_incdir in $cf_incdir
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 10269 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:10276: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:10293: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

		for cf_header in \
			ncurses.h \
			curses.h
		do
			
	cat > conftest.$ac_ext <<EOF
#line 10317 "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:10338: \"$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
	
if test -n "$cf_1st_incdir" ; then
  for cf_add_incdir in $cf_1st_incdir
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 10396 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:10403: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:10420: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi


fi

# Set definitions to allow ifdef'ing for ncurses.h

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

	;;
esac

case $cf_cv_ncurses_header in
(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 terminfo header""... $ac_c" 1>&6
echo "configure:10470: checking for terminfo header" >&5
if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
case ${cf_cv_ncurses_header} in
(*/ncurses.h|*/ncursesw.h)
	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
	;;
(*)
	cf_term_header=term.h
	;;
esac

for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat > conftest.$ac_ext <<EOF
#line 10487 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>

int main() {
int x = auto_left_margin
; return 0; }
EOF
if { (eval echo configure:10497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
	cf_cv_term_header="$cf_test"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cf_cv_term_header=unknown
	
fi
rm -f conftest*
	test "$cf_cv_term_header" != unknown && break
done

fi

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

# Set definitions to allow ifdef'ing to accommodate subdirectories

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

	;;
esac

case $cf_cv_term_header in
(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


# some applications need this, but should check for NCURSES_VERSION
cat >> confdefs.h <<\EOF
#define NCURSES 1
EOF



echo $ac_n "checking for ncurses version""... $ac_c" 1>&6
echo "configure:10552: 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:10578: \"$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 10587 "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
	${cf_cv_main_return:-return}(0);
}
EOF
if { (eval echo configure:10611: \"$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:10642: 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 10650 "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:10661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:10677: 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 10685 "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:10696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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
(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:10728: 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 10736 "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:10747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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


cf_add_libs="$cf_ncurses_LIBS"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
then
	
cf_add_libs="-l$cf_nculib_root"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_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:10813: 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 10818 "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:10841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_initscr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_initscr=no"
fi
rm -rf 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:10861: checking for initscr in -l$cf_nculib_root" >&5
		LIBS="-l$cf_nculib_root $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 10864 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:10871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
	test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
	test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
	test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
}

done


cf_search="$cf_library_path_list $cf_search"

			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:10952: 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 10955 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:10962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
					 LIBS="$cf_save_LIBS"
fi
rm -rf conftest*
			done
			
fi
rm -rf 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:10993: 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 11002 "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:11009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  echo "$ac_t""no" 1>&6
		 LIBS="$cf_ncurses_SAVE"
fi
rm -rf 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



	fi
else
	NCURSES_CONFIG=none
fi

		
echo $ac_n "checking definition to turn on extended curses functions""... $ac_c" 1>&6
echo "configure:11038: checking definition to turn on extended curses functions" >&5
if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_need_xopen_extension=unknown
cat > conftest.$ac_ext <<EOF
#line 11045 "configure"
#include "confdefs.h"

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

#if defined(NCURSES_VERSION_PATCH)
#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
	make an error
#endif
#endif
#ifdef NCURSES_VERSION
	cchar_t check;
	int check2 = curs_set((int)sizeof(check));
#endif
	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:11066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_need_xopen_extension=none
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
	for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
	do
		cat > conftest.$ac_ext <<EOF
#line 11077 "configure"
#include "confdefs.h"

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

#ifdef NCURSES_VERSION
		cchar_t check;
		int check2 = curs_set((int)sizeof(check));
#endif
		long x = winnstr(stdscr, "", 0);
		int x1, y1;
		getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:11094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -rf conftest*
	done
	
fi
rm -rf conftest*

fi

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

case $cf_cv_need_xopen_extension in
(*_*)
	CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
	;;
esac


		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:11125: 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
(hpux10.*)
	if test "x$cf_cv_screen" = "xcurses_colr"
	then
		test -d /usr/include/curses_colr && \
		cf_cv_curses_incdir="-I/usr/include/curses_colr"
	fi
	;;
(sunos3*|sunos4*)
	if test "x$cf_cv_screen" = "xcurses_5lib"
	then
		test -d /usr/5lib && \
		test -d /usr/5include && \
		cf_cv_curses_incdir="-I/usr/5include"
	fi
	;;
esac

fi

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


echo $ac_n "checking if we have identified curses headers""... $ac_c" 1>&6
echo "configure:11156: 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 \
	ncurses.h  \
	curses.h  ncurses/ncurses.h ncurses/curses.h
do
cat > conftest.$ac_ext <<EOF
#line 11167 "configure"
#include "confdefs.h"
#include <${cf_header}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:11174: \"$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:11197: 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 11202 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:11207: \"$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 terminfo header""... $ac_c" 1>&6
echo "configure:11236: checking for terminfo header" >&5
if eval "test \"`echo '$''{'cf_cv_term_header'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
case ${cf_cv_ncurses_header} in
(*/ncurses.h|*/ncursesw.h)
	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
	;;
(*)
	cf_term_header=term.h
	;;
esac

for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
do
cat > conftest.$ac_ext <<EOF
#line 11253 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <${cf_cv_ncurses_header:-curses.h}>
#include <$cf_test>

int main() {
int x = auto_left_margin
; return 0; }
EOF
if { (eval echo configure:11263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
	cf_cv_term_header="$cf_test"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
	cf_cv_term_header=unknown
	
fi
rm -f conftest*
	test "$cf_cv_term_header" != unknown && break
done

fi

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

# Set definitions to allow ifdef'ing to accommodate subdirectories

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

	;;
esac

case $cf_cv_term_header in
(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 for ncurses version""... $ac_c" 1>&6
echo "configure:11312: 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:11338: \"$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 11347 "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
	${cf_cv_main_return:-return}(0);
}
EOF
if { (eval echo configure:11371: \"$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 have identified curses libraries""... $ac_c" 1>&6
echo "configure:11395: checking if we have identified curses libraries" >&5
cat > conftest.$ac_ext <<EOF
#line 11397 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr(); tgoto("?", 0,0)
; return 0; }
EOF
if { (eval echo configure:11404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_result=no
fi
rm -rf conftest*
echo "$ac_t""$cf_result" 1>&6

if test "$cf_result" = no ; then
case $host_os in
(freebsd*)
	echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>&6
echo "configure:11420: 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 11428 "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:11439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lmytinfo"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

	;;
(hpux10.*)
	# Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
	# next (1998), and xcurses "newer" (2000).  There is no header file for
	# Hcurses; the subdirectory curses_colr has the headers (curses.h and
	# term.h) for cur_colr
	if test "x$cf_cv_screen" = "xcurses_colr"
	then
		echo $ac_n "checking for initscr in -lcur_colr""... $ac_c" 1>&6
echo "configure:11484: 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 11492 "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:11503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lcur_colr"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_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:11542: 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 11550 "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:11561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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.
			
cf_add_libs="-lHcurses"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

			CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
			ac_cv_func_initscr=yes
			
else
  echo "$ac_t""no" 1>&6
fi

fi

	fi
	;;
(linux*)
	case `arch 2>/dev/null` in
	(x86_64)
		if test -d /lib64
		then
			
if test -n "/lib64" ; then
	for cf_add_libdir in /lib64
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:11631: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

		else
			
if test -n "/lib" ; then
	for cf_add_libdir in /lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:11661: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

		fi
		;;
	(*)
		
if test -n "/lib" ; then
	for cf_add_libdir in /lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:11693: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

		;;
	esac
	;;
(sunos3*|sunos4*)
	if test "x$cf_cv_screen" = "xcurses_5lib"
	then
		if test -d /usr/5lib ; then
			
if test -n "/usr/5lib" ; then
	for cf_add_libdir in /usr/5lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:11729: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

			
cf_add_libs="-lcurses -ltermcap"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

		fi
	fi
	ac_cv_func_initscr=yes
	;;
esac

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

	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.
	if test "x$cf_term_lib" = x
	then
		echo $ac_n "checking for tgoto""... $ac_c" 1>&6
echo "configure:11776: 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 11781 "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:11804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_tgoto=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_tgoto=no"
fi
rm -rf 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 otermcap termcap tinfo termlib unknown
			do
				echo $ac_n "checking for tgoto in -l$cf_term_lib""... $ac_c" 1>&6
echo "configure:11825: 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 11833 "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:11844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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

	fi

	# Check for library containing initscr
	test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
	if test "x$cf_curs_lib" = x
	then
		for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
		do
			echo $ac_n "checking for initscr in -l$cf_curs_lib""... $ac_c" 1>&6
echo "configure:11877: 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 11885 "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:11896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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
	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:11923: checking if we can link with $cf_curs_lib library" >&5
		cat > conftest.$ac_ext <<EOF
#line 11925 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:11932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_result=no
fi
rm -rf 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:11948: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
		cat > conftest.$ac_ext <<EOF
#line 11950 "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:11957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
			LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
			cat > conftest.$ac_ext <<EOF
#line 11967 "configure"
#include "confdefs.h"
#include <${cf_cv_ncurses_header:-curses.h}>
int main() {
initscr()
; return 0; }
EOF
if { (eval echo configure:11974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_result=error
fi
rm -rf conftest*
			
fi
rm -rf conftest*
		echo "$ac_t""$cf_result" 1>&6
	fi
fi
fi



		
echo $ac_n "checking definition to turn on extended curses functions""... $ac_c" 1>&6
echo "configure:11996: checking definition to turn on extended curses functions" >&5
if eval "test \"`echo '$''{'cf_cv_need_xopen_extension'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cf_cv_need_xopen_extension=unknown
cat > conftest.$ac_ext <<EOF
#line 12003 "configure"
#include "confdefs.h"

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

#if defined(NCURSES_VERSION_PATCH)
#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
	make an error
#endif
#endif
#ifdef NCURSES_VERSION
	cchar_t check;
	int check2 = curs_set((int)sizeof(check));
#endif
	long x = winnstr(stdscr, "", 0);
	int x1, y1;
	getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:12024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_need_xopen_extension=none
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
	for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
	do
		cat > conftest.$ac_ext <<EOF
#line 12035 "configure"
#include "confdefs.h"

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

#ifdef NCURSES_VERSION
		cchar_t check;
		int check2 = curs_set((int)sizeof(check));
#endif
		long x = winnstr(stdscr, "", 0);
		int x1, y1;
		getbegyx(stdscr, y1, x1)
; return 0; }
EOF
if { (eval echo configure:12052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -rf conftest*
	done
	
fi
rm -rf conftest*

fi

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

case $cf_cv_need_xopen_extension in
(*_*)
	CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
	;;
esac


		;;
	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:12082: 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"
	;;
.*)
	
if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$cf_pcre_home" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval cf_pcre_home="$cf_pcre_home"
	case ".$cf_pcre_home" in
	(.NONE/*)
		cf_pcre_home=`echo $cf_pcre_home | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	cf_pcre_home=`echo $cf_pcre_home | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ 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
	LINK_SIZE="-DLINK_SIZE=2"
	
	PCRE_MAKEFILE="$PCRE_MAKEFILE pcre/Makefile pcre/RunTest"
fi

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


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

# Check whether --with-dbmalloc or --without-dbmalloc was given.
if test "${with_dbmalloc+set}" = set; then
  withval="$with_dbmalloc"
  cat >> confdefs.h <<EOF
#define USE_DBMALLOC 1
EOF

	 

	: ${with_cflags:=-g}
	: ${with_no_leaks:=yes}
	 with_dbmalloc=yes
else
  with_dbmalloc=
fi

echo "$ac_t""${with_dbmalloc:-no}" 1>&6

case .$with_cflags in
(.*-g*)
	case .$CFLAGS in
	(.*-g*)
		;;
	(*)
		
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




		;;
	esac
	;;
esac


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:12281: 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 12286 "configure"
#include "confdefs.h"
#include <dbmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12291: \"$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:12308: 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 12316 "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:12327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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 use dmalloc for testing""... $ac_c" 1>&6
echo "configure:12356: checking if you want to use dmalloc for testing" >&5

# Check whether --with-dmalloc or --without-dmalloc was given.
if test "${with_dmalloc+set}" = set; then
  withval="$with_dmalloc"
  cat >> confdefs.h <<EOF
#define USE_DMALLOC 1
EOF

	 

	: ${with_cflags:=-g}
	: ${with_no_leaks:=yes}
	 with_dmalloc=yes
else
  with_dmalloc=
fi

echo "$ac_t""${with_dmalloc:-no}" 1>&6

case .$with_cflags in
(.*-g*)
	case .$CFLAGS in
	(.*-g*)
		;;
	(*)
		
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




		;;
	esac
	;;
esac


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:12473: 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 12478 "configure"
#include "confdefs.h"
#include <dmalloc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12483: \"$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:12500: 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 12508 "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:12519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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



# Check whether --with-trace or --without-trace was given.
if test "${with_trace+set}" = set; then
  withval="$with_trace"
  
	echo $ac_n "checking for _tracef""... $ac_c" 1>&6
echo "configure:12552: 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 12557 "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:12580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func__tracef=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func__tracef=no"
fi
rm -rf 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:12602: 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 12610 "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:12621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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"
		 use_trace=yes
		 cat >> confdefs.h <<\EOF
#define USE_TRACE 1
EOF

		 EXTRAO_DEP=''
		 EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/trace.o"
else
  echo "$ac_t""no" 1>&6
use_trace=no
fi

fi

else
  use_trace=no
fi

#AC_MSG_CHECKING(if you want debugging-trace)
#AC_MSG_RESULT($use_trace)



## options for miscellaneous definitions
echo $ac_n "checking for domain-name""... $ac_c" 1>&6
echo "configure:12667: 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:12696: 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:12762: 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

CAN_MAKEFILE=
CANDIR_MAKE=
echo $ac_n "checking whether to use Cancel-Locks""... $ac_c" 1>&6
echo "configure:12783: checking whether to use Cancel-Locks" >&5

# Check whether --enable-cancel-locks or --disable-cancel-locks was given.
if test "${enable_cancel_locks+set}" = set; then
  enableval="$enable_cancel_locks"
  test "$enableval" != yes && enableval=no
	if test "$enableval" != "no" ; then
    CANLIBS='-L../libcanlock -lcanlock'
	CAN_MAKEFILE="libcanlock/Makefile"
	cat >> confdefs.h <<\EOF
#define USE_CANLOCK 1
EOF
 
	else
		CANDIR_MAKE='#'
	CANLIBS=''
	fi
else
  enableval=no 
	CANDIR_MAKE='#'
	CANLIBS=''

fi

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



## gsasl - used for AUTH SASL PLAIN
gsasl=no
ac_safe=`echo "gsasl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for gsasl.h""... $ac_c" 1>&6
echo "configure:12815: checking for gsasl.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 12820 "configure"
#include "confdefs.h"
#include <gsasl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:12825: \"$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 gsasl_check_version in -lgsasl""... $ac_c" 1>&6
echo "configure:12842: checking for gsasl_check_version in -lgsasl" >&5
ac_lib_var=`echo gsasl'_'gsasl_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="-lgsasl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 12850 "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 gsasl_check_version();

int main() {
gsasl_check_version()
; return 0; }
EOF
if { (eval echo configure:12861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf conftest*
LIBS="$ac_save_LIBS"

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


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

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

		LIBS="$LIBS -lgsasl"
	fi
else
  enableval=yes 
	USE_SASL=yes
		cat >> confdefs.h <<\EOF
#define USE_SASL 1
EOF

		LIBS="$LIBS -lgsasl"

fi

fi

echo $ac_n "checking whether to enable 8-bit keycodes""... $ac_c" 1>&6
echo "configure:12916: 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:12942: 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:12959: 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:12978: 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" != no && enableval=yes
	if test "$enableval" != "yes" ; then
    : 
	else
		cat >> confdefs.h <<\EOF
#define MIME_BREAK_LONG_LINES 1
EOF

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


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:13004: 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:13030: 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:13052: 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:13074: 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:13093: 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:13112: 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:13131: 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:13150: 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:13169: 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:13188: 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:13207: 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:13233: 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:13260: 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:13280: 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:13300: 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
if true ; then

if test "x$prefix" != xNONE; then
	cf_path_syntax="$prefix"
else
	cf_path_syntax="$ac_default_prefix"
fi

case ".$withval" in
(.\$\(*\)*|.\'*\'*)
	;;
(..|./*|.\\*)
	;;
(.[a-zA-Z]:[\\/]*) # OS/2 EMX
	;;
(.\${*prefix}*|.\${*dir}*)
	eval withval="$withval"
	case ".$withval" in
	(.NONE/*)
		withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
		;;
	esac
	;;
(.no|.NONE/*)
	withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
	;;
(*)
	{ echo "configure: error: expected a pathname, not \"$withval\"" 1>&2; exit 1; }
	;;
esac

fi
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:13351: 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" != no && enableval=yes
	if test "$enableval" != "yes" ; then
    : 
	else
		cat >> confdefs.h <<\EOF
#define ENABLE_IPV6 1
EOF

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


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:13379: 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
	(solaris)
		if test "SunOS" = "`uname -s`"
		then
		  if test -f /usr/include/netinet/ip6.h
		  then
			cf_cv_ipv6type=$i
		  fi
		fi
		;;
	(inria)
				cat > conftest.$ac_ext <<EOF
#line 13399 "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)
				cat > conftest.$ac_ext <<EOF
#line 13417 "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)
				cat > conftest.$ac_ext <<EOF
#line 13435 "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)
				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)
		cat > conftest.$ac_ext <<EOF
#line 13462 "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)
		cat > conftest.$ac_ext <<EOF
#line 13480 "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 13498 "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:13531: checking for IPv6 library if required" >&5
case $cf_cv_ipv6type in
(solaris)
	;;
(inria)
	;;
(kame)
		cf_ipv6lib=inet6
	cf_ipv6dir=v6
	;;
(linux-glibc)
	;;
(linux-libinet6)
		cf_ipv6lib=inet6
	cf_ipv6dir=inet6
	;;
(toshiba)
	cf_ipv6lib=inet6
	cf_ipv6dir=v6
	;;
(v6d)
	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 13565 "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:13576: \"$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

  
	
cf_search=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/$cf_ipv6dir &&       cf_search="$cf_search $cf_header_path/include/$cf_ipv6dir"
	test -d $cf_header_path/include/$cf_ipv6dir/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ipv6dir/include"
	test -d $cf_header_path/$cf_ipv6dir/include &&       cf_search="$cf_search $cf_header_path/$cf_ipv6dir/include"
	test -d $cf_header_path/$cf_ipv6dir/include/$cf_ipv6dir &&    cf_search="$cf_search $cf_header_path/$cf_ipv6dir/include/$cf_ipv6dir"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/$cf_ipv6dir &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ipv6dir"
	test -d $cf_subdir_prefix/include/$cf_ipv6dir/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ipv6dir/include"
	test -d $cf_subdir_prefix/$cf_ipv6dir/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ipv6dir/include"
	test -d $cf_subdir_prefix/$cf_ipv6dir/include/$cf_ipv6dir &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ipv6dir/include/$cf_ipv6dir"
}

done


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

cf_search="$cf_search $cf_header_path_list"

	for cf_incdir in $cf_search
	do
		cf_header=$cf_incdir/netinet/ip6.h
		if test -f $cf_header
		then
			
if test -n "$cf_incdir" ; then
  for cf_add_incdir in $cf_incdir
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 13698 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:13705: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:13722: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

			test -n "$verbose" && echo "	... found $cf_header" 1>&6
			break
		fi
		test -n "$verbose" && echo "	... tested $cf_header" 1>&6
	done
	
fi
rm -rf conftest*

	
	eval 'cf_cv_have_lib_'$cf_ipv6lib'=no'
	cf_libdir=""
	echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6
echo "configure:13753: 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 13758 "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:13781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_getaddrinfo=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_getaddrinfo=no"
fi
rm -rf 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:13801: checking for getaddrinfo in -l$cf_ipv6lib" >&5
		LIBS="-l$cf_ipv6lib $LIBS"
		cat > conftest.$ac_ext <<EOF
#line 13804 "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:13815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/$cf_ipv6dir &&       cf_search="$cf_search $cf_library_path/lib/$cf_ipv6dir"
	test -d $cf_library_path/lib/$cf_ipv6dir/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_ipv6dir/lib"
	test -d $cf_library_path/$cf_ipv6dir/lib &&       cf_search="$cf_search $cf_library_path/$cf_ipv6dir/lib"
	test -d $cf_library_path/$cf_ipv6dir/lib/$cf_ipv6dir &&    cf_search="$cf_search $cf_library_path/$cf_ipv6dir/lib/$cf_ipv6dir"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for 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"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/$cf_ipv6dir &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_ipv6dir"
	test -d $cf_subdir_prefix/lib/$cf_ipv6dir/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_ipv6dir/lib"
	test -d $cf_subdir_prefix/$cf_ipv6dir/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ipv6dir/lib"
	test -d $cf_subdir_prefix/$cf_ipv6dir/lib/$cf_ipv6dir &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ipv6dir/lib/$cf_ipv6dir"
}

done


cf_search="$cf_library_path_list $cf_search"

			for cf_libdir in $cf_search
			do
				echo $ac_n "checking for -l$cf_ipv6lib in $cf_libdir""... $ac_c" 1>&6
echo "configure:13896: 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 13899 "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:13910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "$ac_t""no" 1>&6
					 LIBS="$cf_save_LIBS"
fi
rm -rf conftest*
			done
			
fi
rm -rf 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:13943: 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 13952 "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);
   ${cf_cv_main_return:-return}(0);

  bad:
   if (aitop)
     freeaddrinfo(aitop);
   ${cf_cv_main_return:-return}(1);
}

EOF
if { (eval echo configure:14031: \"$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:14075: 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 14080 "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:14103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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



### should we use 64 bit article numbers if possible?
echo $ac_n "checking whether to enable long article numbers""... $ac_c" 1>&6
echo "configure:14132: checking whether to enable long article numbers" >&5

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

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

### 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:14152: 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:14177: 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 = $SHELL
all :
	@ echo '.$cf_option'
CF_EOF
		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[ 	]*$,,'`
		case "$cf_result" in
		(.*k|.*kw)
			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 "given option \"$cf_option\", 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:14223: 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 14228 "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:14277: \"$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:14298: 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 14305 "configure"
#include "confdefs.h"

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

#define string(n) #n
int main() {
char *s = string(token)
; return 0; }
EOF
if { (eval echo configure:14353: \"$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:14374: 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 14380 "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:14388: \"$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:14409: 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 14415 "configure"
#include "confdefs.h"

int main() {
extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)
; return 0; }
EOF
if { (eval echo configure:14422: \"$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:14445: 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 14450 "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:14458: \"$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 14475 "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 14493 "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 14514 "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:14525: \"$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:14553: 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 14558 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
int main() {
DIR *dirp = 0;
; return 0; }
EOF
if { (eval echo configure:14566: \"$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:14591: 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 14599 "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:14610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:14632: 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 14640 "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:14651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:14674: 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 14679 "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:14688: \"$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:14709: 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 14714 "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:14730: \"$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 \
	inttypes.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 \
	stdint.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:14811: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 14813 "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:14821: \"$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:14859: 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 14864 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14869: \"$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:14901: 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 14906 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:14911: \"$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:14946: checking whether termios.h needs _POSIX_SOURCE" >&5
	cat > conftest.$ac_ext <<EOF
#line 14948 "configure"
#include "confdefs.h"
#include <termios.h>
int main() {
struct termios foo; int x = foo.c_iflag
; return 0; }
EOF
if { (eval echo configure:14955: \"$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 14964 "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:14973: \"$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 _POSIX_SOURCE 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:14996: 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 15010 "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:15049: \"$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
	(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:15088: 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 15096 "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:15124: \"$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:15148: 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 15153 "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:15181: 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 15186 "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:15214: 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 15219 "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:15247: 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 15252 "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:15280: 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 15285 "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:15313: 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 15318 "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:15346: 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 15351 "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 15379 "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 15390 "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:15401: 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 15406 "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:15442: 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 15447 "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:15477: checking for quad_t" >&5
cat > conftest.$ac_ext <<EOF
#line 15479 "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:15492: \"$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:15511: checking for long long" >&5
cat > conftest.$ac_ext <<EOF
#line 15513 "configure"
#include "confdefs.h"

#include <sys/types.h>

int main() {
long long x; x = 0
; return 0; }
EOF
if { (eval echo configure:15522: \"$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 int_least64_t""... $ac_c" 1>&6
echo "configure:15541: checking for int_least64_t" >&5
cat > conftest.$ac_ext <<EOF
#line 15543 "configure"
#include "confdefs.h"

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_HAVE_INTTYPES_H
#include <inttypes.h>
#endif

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


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

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_HAVE_INTTYPES_H
#include <inttypes.h>
#endif

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

	fi
fi


echo $ac_n "checking for nl_item""... $ac_c" 1>&6
echo "configure:15612: checking for nl_item" >&5
cat > conftest.$ac_ext <<EOF
#line 15614 "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:15629: \"$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:15651: 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 15659 "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:15670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:15687: 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 15692 "configure"
#include "confdefs.h"
#include <uudeview.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15697: \"$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



# ICU - International Components for Unicode
# TODO: do separate checks for
#  - unorm_normalize()
#  - uidna_IDNToUnicode()
#  - ubidi_open()
# and for IDNA2008
#  - uidna_openUTS46()
#  - uidna_nameToUnicode()
cf_try_icuuc="no"
ac_safe=`echo "unicode/unorm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unicode/unorm.h""... $ac_c" 1>&6
echo "configure:15745: 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 15750 "configure"
#include "confdefs.h"
#include <unicode/unorm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15755: \"$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:15774: 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 15779 "configure"
#include "confdefs.h"
#include <unicode/ustring.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15784: \"$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:15810: checking for unorm_normalize in libicuuc" >&5
		cf_save_LIBS="$LIBS"
		cf_try_icuuc="no"
		LIBS="$LIBS -licuuc"
		cat > conftest.$ac_ext <<EOF
#line 15815 "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:15825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
			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

  LIBS=$cf_save_LIBS
		
fi
rm -rf conftest*
		echo "$ac_t""$cf_try_icuuc" 1>&6
		ac_safe=`echo "unicode/uidna.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unicode/uidna.h""... $ac_c" 1>&6
echo "configure:15844: checking for unicode/uidna.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 15849 "configure"
#include "confdefs.h"
#include <unicode/uidna.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15854: \"$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_UIDNA_H 1
EOF

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

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


# without icuuc try GNU libunistring for normalization
if test $cf_try_icuuc = no ; then
	ac_safe=`echo "unitypes.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unitypes.h""... $ac_c" 1>&6
echo "configure:15933: checking for unitypes.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 15938 "configure"
#include "confdefs.h"
#include <unitypes.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15943: \"$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 "uninorm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for uninorm.h""... $ac_c" 1>&6
echo "configure:15962: checking for uninorm.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 15967 "configure"
#include "confdefs.h"
#include <uninorm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:15972: \"$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_UNITYPES_H 1
EOF

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

			echo $ac_n "checking for u8_normalize in libunistring""... $ac_c" 1>&6
echo "configure:15998: checking for u8_normalize in libunistring" >&5
			cf_save_LIBS="$LIBS"
			cf_try_unistring="no"
			LIBS="$LIBS -lunistring"
			cat > conftest.$ac_ext <<EOF
#line 16003 "configure"
#include "confdefs.h"
#include <unitypes.h>
				#include <uninorm.h>
int main() {

				size_t ol = 0;
				u8_normalize(UNINORM_NFC, (uint8_t *) "x", 2, NULL, &ol);
; return 0; }
EOF
if { (eval echo configure:16013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
				cat >> confdefs.h <<\EOF
#define HAVE_LIBUNISTRING 1
EOF

				cf_try_unistring="yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  LIBS=$cf_save_LIBS
			
fi
rm -rf conftest*
			echo "$ac_t""$cf_try_unistring" 1>&6
		
else
  echo "$ac_t""no" 1>&6
fi

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

fi

# without icuuc try libidn for Internationalized Domain Names / IDN 2003
# TODO: check for libidn2
if test $cf_try_icuuc = no ; then
	echo $ac_n "checking for stringprep_check_version in -lidn""... $ac_c" 1>&6
echo "configure:16046: 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 16054 "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:16065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:16082: 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 16087 "configure"
#include "confdefs.h"
#include <stringprep.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16092: \"$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:16115: 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 16120 "configure"
#include "confdefs.h"
#include <idna.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16125: \"$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:16147: 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 16155 "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:16166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:16187: checking for IDNA_USE_STD3_ASCII_RULES" >&5
					cat > conftest.$ac_ext <<EOF
#line 16189 "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

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

int main() {
idna_strerror()
; return 0; }
EOF
if { (eval echo configure:16234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_STRERROR 1
EOF

				
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

fi

# libidnkit - Internationalized Domain Names / IDN 2008
echo $ac_n "checking for idn_decodename in -lidnkit""... $ac_c" 1>&6
echo "configure:16283: checking for idn_decodename in -lidnkit" >&5
ac_lib_var=`echo idnkit'_'idn_decodename | 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="-lidnkit  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 16291 "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 idn_decodename();

int main() {
idn_decodename()
; return 0; }
EOF
if { (eval echo configure:16302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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 "idn/api.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for idn/api.h""... $ac_c" 1>&6
echo "configure:16320: checking for idn/api.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 16325 "configure"
#include "confdefs.h"
#include <idn/api.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:16330: \"$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 IDN_DECODE_LOOKUP""... $ac_c" 1>&6
echo "configure:16348: checking for IDN_DECODE_LOOKUP" >&5
		cf_save_LIBS="$LIBS"
		LIBS="$LIBS -lidnkit"
		cat > conftest.$ac_ext <<EOF
#line 16352 "configure"
#include "confdefs.h"
#include <idn/api.h>
			#include <string.h>
int main() {

			idn_result_t rs;
			char in[255], out[255];
			strcpy(in, "xn--brenfe-fta9a2q.de");
			rs = idn_decodename(IDN_DECODE_LOOKUP, &in, &out, 254);
			idn_result_tostring(rs);
; return 0; }
EOF
if { (eval echo configure:16365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
			cat >> confdefs.h <<\EOF
#define HAVE_LIBIDNKIT 1
EOF

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

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

			echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
			LIBS=$cf_save_LIBS
			echo "$ac_t""no" 1>&6
		
fi
rm -rf conftest*
	
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 16413 "configure"
#include "confdefs.h"

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

int main() {
int x=tigetstr("")
; return 0; }
EOF
if { (eval echo configure:16430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_termlib=terminfo
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_termlib=termcap
fi
rm -rf conftest*
	test -n "$verbose" && echo "	using functions in predefined $cf_cv_termlib LIBS" 1>&6

echo "${as_me:-configure}:16442: testing using functions in predefined $cf_cv_termlib LIBS ..." 1>&5



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

  

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 tinfo 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:16462: checking for $cf_func in -l$cf_lib" >&5
			cat > conftest.$ac_ext <<EOF
#line 16464 "configure"
#include "confdefs.h"

int main() {
int x=$cf_func("")
; return 0; }
EOF
if { (eval echo configure:16471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_result=no
fi
rm -rf 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:16498: 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 16506 "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:16517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lcurses"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

	echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>&6
echo "configure:16554: 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 16562 "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:16573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-ltermcap"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"
 cf_cv_termlib=termcap
else
  echo "$ac_t""no" 1>&6
fi

fi

fi
rm -rf 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:16622: checking if we should include termcap.h" >&5
	cf_save_CFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -I$srcdir/include"
	cat > conftest.$ac_ext <<EOF
#line 16626 "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:16639: \"$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:16658: 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.

cf_header_list="term.h ncurses/term.h ncursesw/term.h"

case ${cf_cv_ncurses_header:-curses.h} in
(*/*)
	cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
	cf_header_list="$cf_header_item $cf_header_list"
	;;
esac

for cf_header in $cf_header_list
do
	cat > conftest.$ac_ext <<EOF
#line 16679 "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:16688: \"$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

case $cf_cv_term_header in
(no)
	# If curses is ncurses, some packagers still mess it up by trying to make
	# us use GNU termcap.  This handles the most common case.
	for cf_header in ncurses/term.h ncursesw/term.h
	do
		cat > conftest.$ac_ext <<EOF
#line 16708 "configure"
#include "confdefs.h"

#include <${cf_cv_ncurses_header:-curses.h}>
#ifdef NCURSES_VERSION
#include <${cf_header}>
#else
make an error
#endif
int main() {
WINDOW *x
; return 0; }
EOF
if { (eval echo configure:16721: \"$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
	;;
esac

fi

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

case $cf_cv_term_header in
(term.h)
	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:16764: 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 16782 "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:16790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&5
	cat > conftest.$ac_ext <<EOF
#line 16803 "configure"
#include "confdefs.h"

$CHECK_DECL_HDRS
int main() {
char *x = (char *)tgoto("",0,0)
; return 0; }
EOF
if { (eval echo configure:16811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 -rf conftest*
fi
rm -rf 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)
	cat >> confdefs.h <<EOF
#define NEED_CURSES_H 1
EOF

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

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

	;;
(term.h)
	cat >> confdefs.h <<EOF
#define NEED_TERM_H 1
EOF

	;;
(termcap.h)
	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:16887: 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 "${as_me:-configure}:16903: testing loop variables P:$P, Q:$Q, R:$R, S:$S ..." 1>&5

	cat > conftest.$ac_ext <<EOF
#line 16906 "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:16915: \"$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 16970 "configure"
#include "confdefs.h"

int main() {
extern char PC; PC = 0
; return 0; }
EOF
if { (eval echo configure:16977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 -rf 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:16996: 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 17002 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> 
int main() {
int x = (int) errno
; return 0; }
EOF
if { (eval echo configure:17015: \"$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:17043: 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 17049 "configure"
#include "confdefs.h"

#undef errno
extern int errno;

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

  cf_cv_have_errno=no
fi
rm -rf 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:17091: 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 17096 "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:17119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:17146: 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 17152 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> 
int main() {
int x = (int) sys_nerr
; return 0; }
EOF
if { (eval echo configure:17165: \"$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:17193: 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 17199 "configure"
#include "confdefs.h"

#undef sys_nerr
extern int sys_nerr;

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

  cf_cv_have_sys_nerr=no
fi
rm -rf 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:17238: 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 17244 "configure"
#include "confdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h> 
int main() {
int x = (int) sys_errlist
; return 0; }
EOF
if { (eval echo configure:17257: \"$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:17285: 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 17291 "configure"
#include "confdefs.h"

#undef sys_errlist
extern int sys_errlist;

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

  cf_cv_have_sys_errlist=no
fi
rm -rf 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 \
	alarm \
	atoi \
	atol \
	atoll \
	atoq \
	bcopy \
	chmod \
	closesocket \
	execlp \
	fcntl \
	fdopen \
	fork \
	ftime \
	ftruncate \
	fsync \
	getcwd \
	gettimeofday \
	getwd \
	inet_aton \
	is_xterm \
	isascii \
	lockf \
	memcmp \
	memcpy \
	memmove \
	memset \
	mkdir \
	mkfifo \
	mktemp \
	mkstemp \
	nl_langinfo \
	poll \
	putenv \
	rewinddir \
	resizeterm \
	select \
	setenv \
	setlocale \
	settz \
	setvbuf \
	sigaction \
	snprintf \
	stpcpy \
	strchr \
	strcasecmp \
	strcasestr \
	strdup \
	strftime \
	strpbrk \
	strrchr \
	strrstr \
	strsep \
	strstr \
	strtol \
	strtoll \
	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:17403: 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 17408 "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:17431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:17457: 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 17462 "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:17485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_flock=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_flock=no"
fi
rm -rf 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:17507: 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 17515 "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:17526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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


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

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_clock_gettime) || defined (__stub___clock_gettime)
choke me
#else
clock_gettime();
#endif

; return 0; }
EOF
if { (eval echo configure:17583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_clock_gettime=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_clock_gettime=no"
fi
rm -rf conftest*
fi

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

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

		echo $ac_n "checking for clock_gettime in -lrt""... $ac_c" 1>&6
echo "configure:17605: checking for clock_gettime in -lrt" >&5
ac_lib_var=`echo rt'_'clock_gettime | 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="-lrt  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 17613 "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 clock_gettime();

int main() {
clock_gettime()
; return 0; }
EOF
if { (eval echo configure:17624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_CLOCK_GETTIME 1
EOF

			LIBS="$LIBS -lrt"
		
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:17656: 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 17661 "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() {
const 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);
      (void) iswalnum((wint_t) wcb[0]);
      (void) iswcntrl((wint_t) wcb[0]);
      (void) iswdigit((wint_t) wcb[0]);
      (void) iswgraph((wint_t) wcb[0]);
      (void) iswprint((wint_t) wcb[0]);
      (void) iswspace((wint_t) wcb[0]);
      (void) towupper((wint_t) wcb[0]);
      /* (void) iswupper((wint_t) wcb[0]); */
      /* (void) towlower((wint_t) wcb[0]); */
      /* (void) iswlower((wint_t) wcb[0]); */
      (void) iswalpha((wint_t) wcb[0]);
      /* (void) iswblank((wint_t) wcb[0]); */
      /* (void) iswpunct((wint_t) wcb[0]); */
      /* (void) iswxdigit((wint_t) wcb[0]); */
      /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
      /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
      (void) wcslen(wcb);
      /* (void) wcsnlen(wcb, 4); */
      wcwidth((wint_t) wcb[0]);
      wcswidth(wcb, 5);
      wcstombs(ocb, wcb, 5);
      wctomb(ocb, wcb[0]);
      wcscat(wcb2, wcb);
      wcscpy(wcb2, wcb);
      mbstowcs(format, "%s", 2);
      swprintf(wcb, 5, format, "test");
      wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:17715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_multibyte_able=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_save_LIBS="$LIBS"
      LIBS="-lutf8 $LIBS"
      cat > conftest.$ac_ext <<EOF
#line 17725 "configure"
#include "confdefs.h"
#include <libutf8.h>
int main() {
const 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);
        (void) iswalnum((wint_t) wcb[0]);
        (void) iswcntrl((wint_t) wcb[0]);
        (void) iswdigit((wint_t) wcb[0]);
        (void) iswgraph((wint_t) wcb[0]);
        (void) iswprint((wint_t) wcb[0]);
        (void) iswspace((wint_t) wcb[0]);
        (void) towupper((wint_t) wcb[0]);
        /* (void) iswupper((wint_t) wcb[0]); */
        /* (void) towlower((wint_t) wcb[0]); */
        /* (void) iswlower((wint_t) wcb[0]); */
        (void) iswalpha((wint_t) wcb[0]);
        /* (void) iswblank((wint_t) wcb[0]); */
        /* (void) iswpunct((wint_t) wcb[0]); */
        /* (void) iswxdigit((wint_t) wcb[0]); */
        /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
        /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
        (void) wcslen(wcb);
        /* (void) wcsnlen(wcb, 4); */
        wcwidth((wint_t) wcb[0]);
        wcswidth(wcb, 5);
        wcstombs(ocb, wcb, 5);
        wctomb(ocb, wcb[0]);
        wcscat(wcb2, wcb);
        wcscpy(wcb2, wcb);
        mbstowcs(format, "%s", 2);
        swprintf(wcb, 5, format, "test");
        wcsncat(wcb2, wcb, 5);
; return 0; }
EOF
if { (eval echo configure:17769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_multibyte_able=libutf8
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  am_cv_multibyte_able=no
fi
rm -rf conftest*
      LIBS="$cf_save_LIBS"
   
fi
rm -rf 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:17803: checking if gettimeofday takes two arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 17805 "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:17817: \"$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:17836: 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 17841 "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:17858: \"$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:17878: 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 17887 "configure"
#include "confdefs.h"

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

#include <sys/types.h>
#include <signal.h>
int main() {
struct sigaction act
; return 0; }
EOF
if { (eval echo configure:17936: \"$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:17957: 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 17963 "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:17981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_sigaction_funcs=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_sigaction_funcs=no
fi
rm -rf 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:18003: 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 18012 "configure"
#include "confdefs.h"

int main()
{
	if (fork() < 0)
		${cf_cv_main_return:-return}(1);
	${cf_cv_main_return:-return}(0);
}
EOF
if { (eval echo configure:18022: \"$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:18044: 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 18049 "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:18072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_memmove=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_memmove=no"
fi
rm -rf 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:18091: 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 18096 "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:18119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_bcopy=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_bcopy=no"
fi
rm -rf 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:18135: 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 18144 "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);
	${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
}
		
EOF
if { (eval echo configure:18157: \"$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:18195: checking if select expects int * arguments" >&5
cat > conftest.$ac_ext <<EOF
#line 18197 "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:18217: 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 18225 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_header_dirent>
int closedir(); main() { exit(closedir(opendir(".")) != 0); }
EOF
if { (eval echo configure:18231: \"$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:18257: 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 18265 "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:18279: \"$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:18317: 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 18322 "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:18345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:18372: 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 18378 "configure"
#include "confdefs.h"

#include <signal.h>
int main() {
sigaction_t x
; return 0; }
EOF
if { (eval echo configure:18386: \"$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:18406: 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 18412 "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:18434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_use_termios_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_use_termios_h=no
fi
rm -rf 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:18465: 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 18471 "configure"
#include "confdefs.h"

#include <pwd.h>

int main() {

	struct passwd foo;
	char bar = foo.pw_gecos
; return 0; }
EOF
if { (eval echo configure:18482: \"$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:18502: 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 18508 "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:18528: \"$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:18548: 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:18596: 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 18601 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:18606: \"$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:18643: 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 18648 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:18653: \"$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:18683: 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 18688 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:18693: \"$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:18734: 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 18740 "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:18751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  
	cat > conftest.$ac_ext <<EOF
#line 18762 "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:18777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  cf_cv_type_unionwait=no
fi
rm -rf conftest*
fi
rm -rf 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:18802: 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 18811 "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 */
	${cf_cv_main_return:-return}(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");
	${cf_cv_main_return:-return}(1);
}

EOF
if { (eval echo configure:18844: \"$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 18855 "configure"
#include "confdefs.h"
int main() { ${cf_cv_main_return:-return}(system("exit 23") != (23 << 8)); }
EOF
if { (eval echo configure:18859: \"$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:18902: 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 18908 "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:18922: \"$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:18947: 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 18953 "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:18968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_color_curses=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_color_curses=no
fi
rm -rf 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:19019: 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 19031 "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)
	 	${cf_cv_main_return:-return}(1);
	signal(SIGINT, SIG_DFL);
	${cf_cv_main_return:-return}(0);
}
EOF
if { (eval echo configure:19058: \"$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:19084: 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 19090 "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:19102: \"$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:19130: 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 19139 "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)
 */
	${cf_cv_main_return:-return}(1);
#else
	int	pid, status;
	if (found())
		unlink("core");
	if (found())
		${cf_cv_main_return:-return}(1);
	if ((pid = fork()) != 0) {
		while (wait(&status) <= 0)
			;
	} else {
		abort();	/* this will dump core, if anything will */
	}
	if (found()) {
		unlink("core");
		${cf_cv_main_return:-return}(0);
	}
	${cf_cv_main_return:-return}(1);
#endif
}
EOF
if { (eval echo configure:19180: \"$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 \
	tmpfile \

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:19228: 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 "${as_me:-configure}:19234: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19239 "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:19253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19261 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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:19320: 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 "${as_me:-configure}:19326: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19331 "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:19345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19353 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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:19410: 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 "${as_me:-configure}:19416: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19421 "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:19435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19443 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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 \
	alarm \
	atoi \
	atol \
	atoll \
	atoq \
	bcopy \
	bzero \
	calloc \
	fchmod \
	fclose \
	fdopen \
	fflush \
	fgetc \
	fileno \
	fprintf \
	fputc \
	fputs \
	fread \
	free \
	fseek \
	fwrite \
	getcwd \
	getopt \
	getwd \
	heapsort \
	ioctl \
	isascii \
	kill \
	malloc \
	memset \
	mkstemp \
	mktemp \
	pclose \
	perror \
	printf \
	putenv \
	qsort \
	realloc \
	rename \
	rewind \
	select \
	setenv \
	snprintf \
	sscanf \
	strcasecmp \
	strftime \
	strncasecmp \
	strtol \
	strtoll \
	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:19556: 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 "${as_me:-configure}:19562: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19567 "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:19581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19589 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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:19643: 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 "${as_me:-configure}:19649: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19654 "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:19668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19676 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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:19733: 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 "${as_me:-configure}:19739: testing for missing "${ac_func}" external ..." 1>&5

cf_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
cat > conftest.$ac_ext <<EOF
#line 19744 "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:19758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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 19766 "configure"
#include "confdefs.h"

#define DECL_${cf_1_up}
$CHECK_DECL_HDRS

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

  eval 'cf_cv_func_'${ac_func}'=no'
fi
rm -rf 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:19814: 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 19825 "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)
			${cf_cv_main_return:-return}(0);
#else
		struct winsize size;
		if (ioctl(0, TIOCGWINSZ, &size) == 0
		 && size.ws_row > 0
		 && size.ws_col > 0)
			${cf_cv_main_return:-return}(0);
#endif
	}
	${cf_cv_main_return:-return}(0);	/* we cannot guarantee this is run interactively */
}
EOF
if { (eval echo configure:19850: \"$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:19897: 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:19927: 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 19932 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:19939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_cv_header_alloca_h=no
fi
rm -rf 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:19960: 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 19965 "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:19993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_cv_func_alloca_works=no
fi
rm -rf 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:20025: 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 20030 "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:20055: 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 20060 "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:20083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:20110: 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 20118 "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:20137: \"$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:20162: 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 20167 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:20172: \"$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:20201: 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 20206 "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:20229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:20254: 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 20262 "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:20402: \"$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:20426: 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 20431 "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"


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 "$PACKAGE" ; then
	{ echo "configure: error: CF_BUNDLED_INTL used without setting PACKAGE variable" 1>&2; exit 1; }
fi

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:20486: 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 20491 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:20496: \"$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:20527: 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 20532 "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:20555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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"
  
    
case "$withval" in
(no)
	;;
(yes)
	;;
(*)
	

for cf_searchpath in `echo "$withval" | tr $PATH_SEPARATOR ' '`; do
	if test -d $cf_searchpath/include; then
		
if test -n "$cf_searchpath/include" ; then
  for cf_add_incdir in $cf_searchpath/include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 20623 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:20630: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:20647: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	elif test -d $cf_searchpath/../include ; then
		
if test -n "$cf_searchpath/../include" ; then
  for cf_add_incdir in $cf_searchpath/../include
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 20691 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:20698: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:20715: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

	else
{ echo "configure: error: cannot find libiconv under $withval" 1>&2; exit 1; }
	fi
	if test -d $cf_searchpath/lib; then
		
if test -n "$cf_searchpath/lib" ; then
	for cf_add_libdir in $cf_searchpath/lib
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:20757: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	elif test -d $cf_searchpath ; then
		
if test -n "$cf_searchpath" ; then
	for cf_add_libdir in $cf_searchpath
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:20787: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

	else
{ echo "configure: error: cannot find libiconv under $withval" 1>&2; exit 1; }
	fi
done

	;;
esac

   
fi


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

# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
# will be set on completion of the AC_TRY_LINK below.
cf_cv_header_path_iconv=
cf_cv_library_path_iconv=


echo "${as_me:-configure}:20822: testing Starting FIND_LINKAGE(iconv,) ..." 1>&5


cf_save_LIBS="$LIBS"

cat > conftest.$ac_ext <<EOF
#line 20828 "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:20842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_iconv=yes
	cf_cv_header_path_iconv=/usr/include
	cf_cv_library_path_iconv=/usr/lib

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

  

LIBS="-liconv  $cf_save_LIBS"

cat > conftest.$ac_ext <<EOF
#line 20858 "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:20872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_iconv=yes
	cf_cv_header_path_iconv=/usr/include
	cf_cv_library_path_iconv=/usr/lib
	cf_cv_library_file_iconv="-liconv"

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

  
	cf_cv_find_linkage_iconv=no
	LIBS="$cf_save_LIBS"

	test -n "$verbose" && echo "	find linkage for iconv library" 1>&6

echo "${as_me:-configure}:20890: testing find linkage for iconv library ..." 1>&5


	
echo "${as_me:-configure}:20894: testing Searching for headers in FIND_LINKAGE(iconv,) ..." 1>&5


	cf_save_CPPFLAGS="$CPPFLAGS"
	cf_test_CPPFLAGS="$CPPFLAGS"

	
cf_search=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/iconv &&       cf_search="$cf_search $cf_header_path/include/iconv"
	test -d $cf_header_path/include/iconv/include &&    cf_search="$cf_search $cf_header_path/include/iconv/include"
	test -d $cf_header_path/iconv/include &&       cf_search="$cf_search $cf_header_path/iconv/include"
	test -d $cf_header_path/iconv/include/iconv &&    cf_search="$cf_search $cf_header_path/iconv/include/iconv"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/iconv &&       cf_search="$cf_search $prefix/include/iconv"
	test -d $prefix/include/iconv/include &&    cf_search="$cf_search $prefix/include/iconv/include"
	test -d $prefix/iconv/include &&       cf_search="$cf_search $prefix/iconv/include"
	test -d $prefix/iconv/include/iconv &&    cf_search="$cf_search $prefix/iconv/include/iconv"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/iconv &&       cf_search="$cf_search $cf_subdir_prefix/include/iconv"
	test -d $cf_subdir_prefix/include/iconv/include &&    cf_search="$cf_search $cf_subdir_prefix/include/iconv/include"
	test -d $cf_subdir_prefix/iconv/include &&       cf_search="$cf_search $cf_subdir_prefix/iconv/include"
	test -d $cf_subdir_prefix/iconv/include/iconv &&    cf_search="$cf_search $cf_subdir_prefix/iconv/include/iconv"
}

done


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

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

cf_search="$cf_search $cf_header_path_list"

	for cf_cv_header_path_iconv in $cf_search
	do
		if test -d $cf_cv_header_path_iconv ; then
			test -n "$verbose" && echo "	... testing $cf_cv_header_path_iconv" 1>&6

echo "${as_me:-configure}:20990: testing ... testing $cf_cv_header_path_iconv ..." 1>&5


			CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_iconv"
			cat > conftest.$ac_ext <<EOF
#line 20995 "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:21009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
				test -n "$verbose" && echo "	... found iconv headers in $cf_cv_header_path_iconv" 1>&6

echo "${as_me:-configure}:21014: testing ... found iconv headers in $cf_cv_header_path_iconv ..." 1>&5


				cf_cv_find_linkage_iconv=maybe
				cf_test_CPPFLAGS="$CPPFLAGS"
				break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
				CPPFLAGS="$cf_save_CPPFLAGS"
				
fi
rm -f conftest*
		fi
	done

	if test "$cf_cv_find_linkage_iconv" = maybe ; then

		
echo "${as_me:-configure}:21035: testing Searching for iconv library in FIND_LINKAGE(iconv,) ..." 1>&5


		cf_save_LIBS="$LIBS"
		cf_save_LDFLAGS="$LDFLAGS"

		

		if test "$cf_cv_find_linkage_iconv" != yes ; then
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/iconv &&       cf_search="$cf_search $cf_library_path/lib/iconv"
	test -d $cf_library_path/lib/iconv/lib &&    cf_search="$cf_search $cf_library_path/lib/iconv/lib"
	test -d $cf_library_path/iconv/lib &&       cf_search="$cf_search $cf_library_path/iconv/lib"
	test -d $cf_library_path/iconv/lib/iconv &&    cf_search="$cf_search $cf_library_path/iconv/lib/iconv"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/iconv &&       cf_search="$cf_search $prefix/lib/iconv"
	test -d $prefix/lib/iconv/lib &&    cf_search="$cf_search $prefix/lib/iconv/lib"
	test -d $prefix/iconv/lib &&       cf_search="$cf_search $prefix/iconv/lib"
	test -d $prefix/iconv/lib/iconv &&    cf_search="$cf_search $prefix/iconv/lib/iconv"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/iconv &&       cf_search="$cf_search $cf_subdir_prefix/lib/iconv"
	test -d $cf_subdir_prefix/lib/iconv/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/iconv/lib"
	test -d $cf_subdir_prefix/iconv/lib &&       cf_search="$cf_search $cf_subdir_prefix/iconv/lib"
	test -d $cf_subdir_prefix/iconv/lib/iconv &&    cf_search="$cf_search $cf_subdir_prefix/iconv/lib/iconv"
}

done


cf_search="$cf_library_path_list $cf_search"

			for cf_cv_library_path_iconv in $cf_search
			do
				if test -d $cf_cv_library_path_iconv ; then
					test -n "$verbose" && echo "	... testing $cf_cv_library_path_iconv" 1>&6

echo "${as_me:-configure}:21117: testing ... testing $cf_cv_library_path_iconv ..." 1>&5


					CPPFLAGS="$cf_test_CPPFLAGS"
					LIBS="-liconv  $cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_iconv"
					cat > conftest.$ac_ext <<EOF
#line 21124 "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:21138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
					test -n "$verbose" && echo "	... found iconv library in $cf_cv_library_path_iconv" 1>&6

echo "${as_me:-configure}:21143: testing ... found iconv library in $cf_cv_library_path_iconv ..." 1>&5


					cf_cv_find_linkage_iconv=yes
					cf_cv_library_file_iconv="-liconv"
					break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
					CPPFLAGS="$cf_save_CPPFLAGS"
					LIBS="$cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS"
					
fi
rm -rf conftest*
				fi
			done
			CPPFLAGS="$cf_save_CPPFLAGS"
			LDFLAGS="$cf_save_LDFLAGS"
		fi

	else
		cf_cv_find_linkage_iconv=no
	fi
	
fi
rm -rf conftest*

fi
rm -rf conftest*

LIBS="$cf_save_LIBS"

if test "$cf_cv_find_linkage_iconv" = yes ; then
am_cv_func_iconv=yes
else
am_cv_func_iconv="no, consider installing GNU libiconv"
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 if the declaration of iconv() needs const.""... $ac_c" 1>&6
echo "configure:21195: checking if the declaration of iconv() needs const." >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv_const'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
      cat > conftest.$ac_ext <<EOF
#line 21201 "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:21221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  am_cv_proto_iconv_const=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  am_cv_proto_iconv_const=yes
fi
rm -f conftest*
fi

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

    if test "$am_cv_proto_iconv_const" = yes ; then
      am_cv_proto_iconv_arg1="const"
    else
      am_cv_proto_iconv_arg1=""
    fi

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

  fi

  LIBICONV=
  if test "$cf_cv_find_linkage_iconv" = yes; then
    
if test -n "$cf_cv_header_path_iconv" ; then
  for cf_add_incdir in $cf_cv_header_path_iconv
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 21274 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:21281: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:21298: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi

    if test -n "$cf_cv_library_file_iconv" ; then
      LIBICONV="-liconv"
      
if test -n "$cf_cv_library_path_iconv" ; then
	for cf_add_libdir in $cf_cv_library_path_iconv
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:21338: testing adding $cf_add_libdir to library-path ..." 1>&5


				LDFLAGS="-L$cf_add_libdir $LDFLAGS"
			fi
		fi
	done
fi

    fi
  fi

  

   
echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
echo "configure:21354: 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 21359 "configure"
#include "confdefs.h"
#include <langinfo.h>
int main() {
char* cs = nl_langinfo(CODESET);
; return 0; }
EOF
if { (eval echo configure:21366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_langinfo_codeset=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  am_cv_langinfo_codeset=no
fi
rm -rf 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:21389: 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 21394 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
if { (eval echo configure:21401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  am_cv_val_LC_MESSAGES=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  am_cv_val_LC_MESSAGES=no
fi
rm -rf 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:21422: 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:21446: 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

      cf_save_LIBS_1="$LIBS"
      
cf_add_libs="$LIBICONV"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
# will be set on completion of the AC_TRY_LINK below.
cf_cv_header_path_intl=
cf_cv_library_path_intl=


echo "${as_me:-configure}:21494: testing Starting FIND_LINKAGE(intl,) ..." 1>&5


cf_save_LIBS="$LIBS"

cat > conftest.$ac_ext <<EOF
#line 21500 "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:21515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_intl=yes
	cf_cv_header_path_intl=/usr/include
	cf_cv_library_path_intl=/usr/lib

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

  

LIBS="-lintl  $cf_save_LIBS"

cat > conftest.$ac_ext <<EOF
#line 21531 "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:21546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
	cf_cv_find_linkage_intl=yes
	cf_cv_header_path_intl=/usr/include
	cf_cv_library_path_intl=/usr/lib
	cf_cv_library_file_intl="-lintl"

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

  
	cf_cv_find_linkage_intl=no
	LIBS="$cf_save_LIBS"

	test -n "$verbose" && echo "	find linkage for intl library" 1>&6

echo "${as_me:-configure}:21564: testing find linkage for intl library ..." 1>&5


	
echo "${as_me:-configure}:21568: testing Searching for headers in FIND_LINKAGE(intl,) ..." 1>&5


	cf_save_CPPFLAGS="$CPPFLAGS"
	cf_test_CPPFLAGS="$CPPFLAGS"

	
cf_search=

# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
	for cf_header_path in $CPPFLAGS $CFLAGS
	do
		case $cf_header_path in
		(-I*)
			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
			
test "x$cf_header_path" != "xNONE" && \
test -d "$cf_header_path" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_header_path"
	test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
	test -d $cf_header_path/include/intl &&       cf_search="$cf_search $cf_header_path/include/intl"
	test -d $cf_header_path/include/intl/include &&    cf_search="$cf_search $cf_header_path/include/intl/include"
	test -d $cf_header_path/intl/include &&       cf_search="$cf_search $cf_header_path/intl/include"
	test -d $cf_header_path/intl/include/intl &&    cf_search="$cf_search $cf_header_path/intl/include/intl"
}

			cf_header_path_list="$cf_header_path_list $cf_search"
			;;
		esac
	done
fi

# add the variations for the package we are looking for

cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for include-directories under $prefix"
	test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
	test -d $prefix/include/intl &&       cf_search="$cf_search $prefix/include/intl"
	test -d $prefix/include/intl/include &&    cf_search="$cf_search $prefix/include/intl/include"
	test -d $prefix/intl/include &&       cf_search="$cf_search $prefix/intl/include"
	test -d $prefix/intl/include/intl &&    cf_search="$cf_search $prefix/intl/include/intl"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for include-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
	test -d $cf_subdir_prefix/include/intl &&       cf_search="$cf_search $cf_subdir_prefix/include/intl"
	test -d $cf_subdir_prefix/include/intl/include &&    cf_search="$cf_search $cf_subdir_prefix/include/intl/include"
	test -d $cf_subdir_prefix/intl/include &&       cf_search="$cf_search $cf_subdir_prefix/intl/include"
	test -d $cf_subdir_prefix/intl/include/intl &&    cf_search="$cf_search $cf_subdir_prefix/intl/include/intl"
}

done


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

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

cf_search="$cf_search $cf_header_path_list"

	for cf_cv_header_path_intl in $cf_search
	do
		if test -d $cf_cv_header_path_intl ; then
			test -n "$verbose" && echo "	... testing $cf_cv_header_path_intl" 1>&6

echo "${as_me:-configure}:21664: testing ... testing $cf_cv_header_path_intl ..." 1>&5


			CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_intl"
			cat > conftest.$ac_ext <<EOF
#line 21669 "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:21684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
				test -n "$verbose" && echo "	... found intl headers in $cf_cv_header_path_intl" 1>&6

echo "${as_me:-configure}:21689: testing ... found intl headers in $cf_cv_header_path_intl ..." 1>&5


				cf_cv_find_linkage_intl=maybe
				cf_test_CPPFLAGS="$CPPFLAGS"
				break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  
				CPPFLAGS="$cf_save_CPPFLAGS"
				
fi
rm -f conftest*
		fi
	done

	if test "$cf_cv_find_linkage_intl" = maybe ; then

		
echo "${as_me:-configure}:21710: testing Searching for intl library in FIND_LINKAGE(intl,) ..." 1>&5


		cf_save_LIBS="$LIBS"
		cf_save_LDFLAGS="$LDFLAGS"

		

		if test "$cf_cv_find_linkage_intl" != yes ; then
			
cf_search=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
	for cf_library_path in $LDFLAGS $LIBS
	do
		case $cf_library_path in
		(-L*)
			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
			
test "x$cf_library_path" != "xNONE" && \
test -d "$cf_library_path" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_library_path"
	test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
	test -d $cf_library_path/lib/intl &&       cf_search="$cf_search $cf_library_path/lib/intl"
	test -d $cf_library_path/lib/intl/lib &&    cf_search="$cf_search $cf_library_path/lib/intl/lib"
	test -d $cf_library_path/intl/lib &&       cf_search="$cf_search $cf_library_path/intl/lib"
	test -d $cf_library_path/intl/lib/intl &&    cf_search="$cf_search $cf_library_path/intl/lib/intl"
}

			cf_library_path_list="$cf_library_path_list $cf_search"
			;;
		esac
	done
fi


cf_search=


test "x$prefix" != "xNONE" && \
test -d "$prefix" && \
 {
	test -n "$verbose" && echo "	... testing for lib-directories under $prefix"
	test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
	test -d $prefix/lib/intl &&       cf_search="$cf_search $prefix/lib/intl"
	test -d $prefix/lib/intl/lib &&    cf_search="$cf_search $prefix/lib/intl/lib"
	test -d $prefix/intl/lib &&       cf_search="$cf_search $prefix/intl/lib"
	test -d $prefix/intl/lib/intl &&    cf_search="$cf_search $prefix/intl/lib/intl"
}


for cf_subdir_prefix in \
	/usr \
	/usr/local \
	/usr/pkg \
	/opt \
	/opt/local \
	$HOME
do
	
test "x$cf_subdir_prefix" != "x$prefix" && \
test -d "$cf_subdir_prefix" && \
(test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
	test -n "$verbose" && echo "	... testing for lib-directories under $cf_subdir_prefix"
	test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
	test -d $cf_subdir_prefix/lib/intl &&       cf_search="$cf_search $cf_subdir_prefix/lib/intl"
	test -d $cf_subdir_prefix/lib/intl/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/intl/lib"
	test -d $cf_subdir_prefix/intl/lib &&       cf_search="$cf_search $cf_subdir_prefix/intl/lib"
	test -d $cf_subdir_prefix/intl/lib/intl &&    cf_search="$cf_search $cf_subdir_prefix/intl/lib/intl"
}

done


cf_search="$cf_library_path_list $cf_search"

			for cf_cv_library_path_intl in $cf_search
			do
				if test -d $cf_cv_library_path_intl ; then
					test -n "$verbose" && echo "	... testing $cf_cv_library_path_intl" 1>&6

echo "${as_me:-configure}:21792: testing ... testing $cf_cv_library_path_intl ..." 1>&5


					CPPFLAGS="$cf_test_CPPFLAGS"
					LIBS="-lintl  $cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_intl"
					cat > conftest.$ac_ext <<EOF
#line 21799 "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:21814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  
					test -n "$verbose" && echo "	... found intl library in $cf_cv_library_path_intl" 1>&6

echo "${as_me:-configure}:21819: testing ... found intl library in $cf_cv_library_path_intl ..." 1>&5


					cf_cv_find_linkage_intl=yes
					cf_cv_library_file_intl="-lintl"
					break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  
					CPPFLAGS="$cf_save_CPPFLAGS"
					LIBS="$cf_save_LIBS"
					LDFLAGS="$cf_save_LDFLAGS"
					
fi
rm -rf conftest*
				fi
			done
			CPPFLAGS="$cf_save_CPPFLAGS"
			LDFLAGS="$cf_save_LDFLAGS"
		fi

	else
		cf_cv_find_linkage_intl=no
	fi
	
fi
rm -rf conftest*

fi
rm -rf conftest*

LIBS="$cf_save_LIBS"

if test "$cf_cv_find_linkage_intl" = yes ; then
cf_cv_func_gettext=yes
else
cf_cv_func_gettext=no
fi

      
fi

echo "$ac_t""$cf_cv_func_gettext" 1>&6
      LIBS="$cf_save_LIBS_1"

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


                                        if test "$PACKAGE" != gettext; then
          cat >> confdefs.h <<\EOF
#define HAVE_GETTEXT 1
EOF


          
if test -n "$cf_cv_header_path_intl" ; then
  for cf_add_incdir in $cf_cv_header_path_intl
  do
	while test $cf_add_incdir != /usr/include
	do
	  if test -d $cf_add_incdir
	  then
		cf_have_incdir=no
		if test -n "$CFLAGS$CPPFLAGS" ; then
		  # a loop is needed to ensure we can add subdirs of existing dirs
		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
			  cf_have_incdir=yes; break
			fi
		  done
		fi

		if test "$cf_have_incdir" = no ; then
		  if test "$cf_add_incdir" = /usr/local/include ; then
			if test "$GCC" = yes
			then
			  cf_save_CPPFLAGS=$CPPFLAGS
			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
			  cat > conftest.$ac_ext <<EOF
#line 21903 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello")
; return 0; }
EOF
if { (eval echo configure:21910: \"$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_have_incdir=yes
fi
rm -f conftest*
			  CPPFLAGS=$cf_save_CPPFLAGS
			fi
		  fi
		fi

		if test "$cf_have_incdir" = no ; then
		  test -n "$verbose" && echo "	adding $cf_add_incdir to include-path" 1>&6

echo "${as_me:-configure}:21927: testing adding $cf_add_incdir to include-path ..." 1>&5


		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"

		  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"
		else
		  break
		fi
	  else
		break
	  fi
	done
  done
fi


          if test -n "$cf_cv_library_file_intl" ; then
                                                INTLLIBS="$cf_cv_library_file_intl $LIBICONV"
            
if test -n "$cf_cv_library_path_intl" ; then
	for cf_add_libdir in $cf_cv_library_path_intl
	do
		if test $cf_add_libdir = /usr/lib ; then
			:
		elif test -d $cf_add_libdir
		then
			cf_have_libdir=no
			if test -n "$LDFLAGS$LIBS" ; then
				# a loop is needed to ensure we can add subdirs of existing dirs
				for cf_test_libdir in $LDFLAGS $LIBS ; do
					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
						cf_have_libdir=yes; break
					fi
				done
			fi
			if test "$cf_have_libdir" = no ; then
				test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6

echo "${as_me:-configure}:21968: testing adding $cf_add_libdir to library-path ..." 1>&5


				INTLLIBS="-L$cf_add_libdir $INTLLIBS"
			fi
		fi
	done
fi

          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:21984: 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 21989 "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:22012: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:22042: 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}${PATH_SEPARATOR}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word$ac_exeext; then
      if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
	ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exeext"
	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:22076: 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:22114: 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}${PATH_SEPARATOR}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word$ac_exeext; then
      if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
	ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exeext"
	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
      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:22164: 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}${PATH_SEPARATOR}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word$ac_exeext; then
      if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
	ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exeext"
	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:22198: 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:22235: 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}${PATH_SEPARATOR}"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word$ac_exeext; then
      if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
	ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exeext"
	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:22307: 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:22340: 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:22388: 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

      INTL_LIBTOOL_SUFFIX_PREFIX=
   


if test "$USE_NLS" = yes ; then
	
# Check whether --with-textdomain or --without-textdomain was given.
if test "${with_textdomain+set}" = set; then
  withval="$with_textdomain"
  NLS_TEXTDOMAIN=$withval
else
  NLS_TEXTDOMAIN=$PACKAGE
fi

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

	
fi

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:22447: 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:22502: 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 22507 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:22512: \"$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="$CPPFLAGS -I../intl"
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:22596: 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 22601 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
if { (eval echo configure:22608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_cv_header_alloca_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_cv_header_alloca_h=no
fi
rm -rf 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:22629: 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 22634 "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:22662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_cv_func_alloca_works=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_cv_func_alloca_works=no
fi
rm -rf 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:22694: 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 22699 "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:22724: 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 22729 "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:22752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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:22779: 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 22787 "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:22806: \"$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="$CPPFLAGS -DYYSTACK_USE_ALLOCA=0"
		ALLOCA=""
	elif test "$INTEL_COMPILER" = yes ; then
		CPPFLAGS="$CPPFLAGS -DYYSTACK_USE_ALLOCA=0"
		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:22851: checking for $cf_hdr" >&5
	cat > conftest.$ac_ext <<EOF
#line 22853 "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:22861: \"$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:22887: 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 22893 "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:22910: \"$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


# FIXME / TESTME
# locale is broken on cygwin < 1.7.0
# group/other bits don't work on cygwin < 1.7.0
# locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
case "$host_os" in
	*cygwin*)
		case `uname -r | sed 's,(.*,,'` in
			B*|1.0-6].*)
				# multiple defects
				cat >> confdefs.h <<\EOF
#define NO_LOCALE 1
EOF

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

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

				;;
			1.7.*)
				# link does not work
				cat >> confdefs.h <<\EOF
#define NO_LOCKING 1
EOF

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

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_link) || defined (__stub___link)
choke me
#else
link();
#endif

; return 0; }
EOF
if { (eval echo configure:22985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_link=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_link=no"
fi
rm -rf conftest*
fi

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

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

				;;
			esac
		;;
	*haiku*)
		# link does not work
		cat >> confdefs.h <<\EOF
#define NO_LOCKING 1
EOF

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

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_link) || defined (__stub___link)
choke me
#else
link();
#endif

; return 0; }
EOF
if { (eval echo configure:23047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_link=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_link=no"
fi
rm -rf conftest*
fi

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

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

esac

if test "$cf_cv_termlib" = pdcurses ; then
	# If we find X, set shell vars x_includes and x_libraries to the
# paths, otherwise set no_x=yes.
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:23077: 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 23140 "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:23145: \"$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 23214 "configure"
#include "confdefs.h"

int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:23221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  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

  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 -rf conftest*
fi # $ac_x_libraries = NO

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

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

if test "$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:23327: 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 23330 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:23337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_R_nospace=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_R_nospace=no
fi
rm -rf 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 23353 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:23360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  ac_R_space=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  ac_R_space=no
fi
rm -rf 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:23392: 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 23400 "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:23411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23433: 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 23441 "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:23452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23481: 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 23486 "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:23509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_gethostbyname=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_gethostbyname=no"
fi
rm -rf 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:23530: 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 23538 "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:23549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23579: 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 23584 "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:23607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_connect=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_connect=no"
fi
rm -rf 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:23628: 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 23636 "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:23647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23671: 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 23676 "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:23699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_remove=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_remove=no"
fi
rm -rf 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:23720: 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 23728 "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:23739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23763: 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 23768 "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:23791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_shmat=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_shmat=no"
fi
rm -rf 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:23812: 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 23820 "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:23831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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:23864: 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 23872 "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:23883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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


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:23911: 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 Xaw 3d xft library""... $ac_c" 1>&6
echo "configure:23928: checking if you want to link with Xaw 3d xft library" >&5
withval=

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

if test "$withval" = yes ; then
	cf_x_athena=Xaw3dxft
	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:23945: 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:23962: 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

cf_x_athena_lib=""

if test "$PKG_CONFIG" != none ; then
	cf_athena_list=
	test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
	for cf_athena_pkg in \
		$cf_athena_list \
		${cf_x_athena} \
		${cf_x_athena}-devel \
		lib${cf_x_athena} \
		lib${cf_x_athena}-devel
	do
		


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
	test -n "$verbose" && echo "	found package $cf_athena_pkg" 1>&6

echo "${as_me:-configure}:23996: testing found package $cf_athena_pkg ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
	test -n "$verbose" && echo "	package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24003: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24008: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	
			cf_x_athena_lib="$cf_pkgconfig_libs"
			
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


			
	for cf_trim_lib in Xmu Xt X11
	do
		case "$LIBS" in
		(*-l$cf_trim_lib\ *-l$cf_trim_lib*)
			LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
			test -n "$verbose" && echo "	..trimmed $LIBS" 1>&6

echo "${as_me:-configure}:24128: testing ..trimmed $LIBS ..." 1>&5


			;;
		esac
	done


echo $ac_n "checking for usable $cf_x_athena/Xmu package""... $ac_c" 1>&6
echo "configure:24137: checking for usable $cf_x_athena/Xmu package" >&5
if eval "test \"`echo '$''{'cf_cv_xaw_compat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 24143 "configure"
#include "confdefs.h"

#include <X11/Xmu/CharSet.h>

int main() {

int check = XmuCompareISOLatin1("big", "small")

; return 0; }
EOF
if { (eval echo configure:24154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_xaw_compat=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_xaw_compat=no
fi
rm -rf conftest*
fi

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

			if test "$cf_cv_xaw_compat" = no
			then
				# workaround for broken ".pc" files...
				case "$cf_x_athena_lib" in
				(*-lXmu*)
					;;
				(*)
					test -n "$verbose" && echo "	work around broken package" 1>&6

echo "${as_me:-configure}:24177: testing work around broken package ..." 1>&5


					cf_save_xmu="$LIBS"
					cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
					


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
	test -n "$verbose" && echo "	found package xmu" 1>&6

echo "${as_me:-configure}:24188: testing found package xmu ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
	test -n "$verbose" && echo "	package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24195: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package xmu LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24200: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	
							LIBS="$cf_save_xmu"
							
test -n "$verbose" && echo "	...before $LIBS" 1>&6

echo "${as_me:-configure}:24307: testing ...before $LIBS ..." 1>&5


LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
test -n "$verbose" && echo "	...after  $LIBS" 1>&6

echo "${as_me:-configure}:24313: testing ...after  $LIBS ..." 1>&5



						
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	
							
test -n "$verbose" && echo "	...before $LIBS" 1>&6

echo "${as_me:-configure}:24325: testing ...before $LIBS ..." 1>&5


LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
test -n "$verbose" && echo "	...after  $LIBS" 1>&6

echo "${as_me:-configure}:24331: testing ...after  $LIBS ..." 1>&5



						
fi

					
	for cf_trim_lib in Xmu Xt X11
	do
		case "$LIBS" in
		(*-l$cf_trim_lib\ *-l$cf_trim_lib*)
			LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
			test -n "$verbose" && echo "	..trimmed $LIBS" 1>&6

echo "${as_me:-configure}:24346: testing ..trimmed $LIBS ..." 1>&5


			;;
		esac
	done

					;;
				esac
			fi

			break
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	:
fi

	done
fi

if test -z "$cf_x_athena_lib" ; then
	



if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
	test -n "$verbose" && echo "	found package Xext" 1>&6

echo "${as_me:-configure}:24375: testing found package Xext ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
	test -n "$verbose" && echo "	package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24382: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package Xext LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24387: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	
	echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6
echo "configure:24495: 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 24503 "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:24514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lXext"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

fi


	



# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
# in some cases has installed dummy files in the former, other cases replaced
# it with a link to the new location).  This complicates the configure script.
# Check for that pitfall, and recover using pkg-config
#
# If none of these are set, the configuration is almost certainly broken.
if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
then
	


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
	test -n "$verbose" && echo "	found package x11" 1>&6

echo "${as_me:-configure}:24571: testing found package x11 ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
	test -n "$verbose" && echo "	package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24578: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package x11 LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24583: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	echo "configure: warning: unable to find X11 library" 1>&2
fi

	


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
	test -n "$verbose" && echo "	found package ice" 1>&6

echo "${as_me:-configure}:24698: testing found package ice ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
	test -n "$verbose" && echo "	package ice CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24705: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package ice LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24710: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	echo "configure: warning: unable to find ICE library" 1>&2
fi

	


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
	test -n "$verbose" && echo "	found package sm" 1>&6

echo "${as_me:-configure}:24825: testing found package sm ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
	test -n "$verbose" && echo "	package sm CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24832: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package sm LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24837: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	echo "configure: warning: unable to find SM library" 1>&2
fi

	


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
	test -n "$verbose" && echo "	found package xt" 1>&6

echo "${as_me:-configure}:24952: testing found package xt ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
	test -n "$verbose" && echo "	package xt CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:24959: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package xt LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:24964: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	echo "configure: warning: unable to find Xt library" 1>&2
fi

fi

cf_have_X_LIBS=no




if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
	test -n "$verbose" && echo "	found package xt" 1>&6

echo "${as_me:-configure}:25083: testing found package xt ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
	test -n "$verbose" && echo "	package xt CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:25090: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package xt LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:25095: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	

	case "x$LIBS" in
	(*-lX11*)
		;;
	(*)
# we have an "xt" package, but it may omit Xt's dependency on X11
echo $ac_n "checking for usable X dependency""... $ac_c" 1>&6
echo "configure:25205: checking for usable X dependency" >&5
if eval "test \"`echo '$''{'cf_cv_xt_x11_compat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 25211 "configure"
#include "confdefs.h"

#include <X11/Xlib.h>

int main() {

	int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
	int rc2 = XClearWindow((Display*) 0, (Window) 0);
	int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
	int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);

; return 0; }
EOF
if { (eval echo configure:25225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_xt_x11_compat=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_xt_x11_compat=no
fi
rm -rf conftest*
fi

echo "$ac_t""$cf_cv_xt_x11_compat" 1>&6
		if test "$cf_cv_xt_x11_compat" = no
		then
			test -n "$verbose" && echo "	work around broken X11 dependency" 1>&6

echo "${as_me:-configure}:25242: testing work around broken X11 dependency ..." 1>&5


			# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
			


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
	test -n "$verbose" && echo "	found package x11" 1>&6

echo "${as_me:-configure}:25252: testing found package x11 ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
	test -n "$verbose" && echo "	package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:25259: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package x11 LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:25264: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	
test -n "$verbose" && echo "	...before $LIBS" 1>&6

echo "${as_me:-configure}:25373: testing ...before $LIBS ..." 1>&5


LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
test -n "$verbose" && echo "	...after  $LIBS" 1>&6

echo "${as_me:-configure}:25379: testing ...after  $LIBS ..." 1>&5



fi

		fi
		;;
	esac

echo $ac_n "checking for usable X Toolkit package""... $ac_c" 1>&6
echo "configure:25390: checking for usable X Toolkit package" >&5
if eval "test \"`echo '$''{'cf_cv_xt_ice_compat'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 25396 "configure"
#include "confdefs.h"

#include <X11/Shell.h>

int main() {
int num = IceConnectionNumber(0)

; return 0; }
EOF
if { (eval echo configure:25406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_cv_xt_ice_compat=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_cv_xt_ice_compat=no
fi
rm -rf conftest*
fi

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

	if test "$cf_cv_xt_ice_compat" = no
	then
		# workaround for broken ".pc" files used for X Toolkit.
		case "x$X_PRE_LIBS" in
		(*-lICE*)
			case "x$LIBS" in
			(*-lICE*)
				;;
			(*)
				test -n "$verbose" && echo "	work around broken ICE dependency" 1>&6

echo "${as_me:-configure}:25431: testing work around broken ICE dependency ..." 1>&5


				


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
	test -n "$verbose" && echo "	found package ice" 1>&6

echo "${as_me:-configure}:25440: testing found package ice ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
	test -n "$verbose" && echo "	package ice CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:25447: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package ice LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:25452: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	


if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
	test -n "$verbose" && echo "	found package sm" 1>&6

echo "${as_me:-configure}:25560: testing found package sm ..." 1>&5


	cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
	cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
	test -n "$verbose" && echo "	package sm CFLAGS: $cf_pkgconfig_incs" 1>&6

echo "${as_me:-configure}:25567: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5


	test -n "$verbose" && echo "	package sm LIBS: $cf_pkgconfig_libs" 1>&6

echo "${as_me:-configure}:25572: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5


	
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=

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

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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="$CPPFLAGS $cf_new_cppflags"
fi

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




	
cf_add_libs="$cf_pkgconfig_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

	:
else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	:
fi

else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	
test -n "$verbose" && echo "	...before $LIBS" 1>&6

echo "${as_me:-configure}:25687: testing ...before $LIBS ..." 1>&5


LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
test -n "$verbose" && echo "	...after  $LIBS" 1>&6

echo "${as_me:-configure}:25693: testing ...after  $LIBS ..." 1>&5



fi

				;;
			esac
			;;
		esac
	fi

	cf_have_X_LIBS=yes

else
	cf_pkgconfig_incs=
	cf_pkgconfig_libs=
	

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

echo "${as_me:-configure}:25716: testing checking additions to CFLAGS ..." 1>&5


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
	(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
		case $cf_add_cflags in
		(-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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

echo "${as_me:-configure}:25788: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5


	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

echo "${as_me:-configure}:25797: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5


	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi

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

echo "${as_me:-configure}:25806: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5


	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat > conftest.$ac_ext <<EOF
#line 25817 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello world");
; return 0; }
EOF
if { (eval echo configure:25824: \"$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

  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6

echo "${as_me:-configure}:25832: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5


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

echo "${as_me:-configure}:25838: testing but keeping change to \$CPPFLAGS ..." 1>&5


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


	echo $ac_n "checking for XOpenDisplay""... $ac_c" 1>&6
echo "configure:25849: 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 25854 "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:25877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_XOpenDisplay=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_XOpenDisplay=no"
fi
rm -rf 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:25896: 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 25904 "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:25915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lX11"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

fi


	echo $ac_n "checking for XtAppInitialize""... $ac_c" 1>&6
echo "configure:25955: 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 25960 "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:25983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_XtAppInitialize=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_XtAppInitialize=no"
fi
rm -rf 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:26002: 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 26010 "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:26021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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 $X_EXTRA_LIBS"
else
  echo "$ac_t""no" 1>&6
fi

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_root=$cf_x_athena
cf_x_athena_inc=""

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

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

; return 0; }
EOF
if { (eval echo configure:26089: \"$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_inc=$cf_path
			break
		else
			CPPFLAGS="$cf_save"
		fi
	fi
done

if test -z "$cf_x_athena_inc" ; then
	echo "configure: warning: Unable to successfully find Athena header files with test program" 1>&2
elif test "$cf_x_athena_inc" != default ; then
	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
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 \
		${cf_x_athena_root} \
		${cf_x_athena_root}7 \
		${cf_x_athena_root}6
	do
	for cf_libs in \
		"-l$cf_lib -lXmu" \
		"-l$cf_lib -lXpm -lXmu" \
		"-l${cf_lib}_s -lXmu_s"
	do
		if test -z "$cf_x_athena_lib" ; then
			cf_save="$LIBS"
			cf_test=XawSimpleMenuAddGlobalActions
			if test $cf_path != default ; then
				
cf_add_libs="-L$cf_path/lib $cf_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

				echo $ac_n "checking for $cf_libs in $cf_path""... $ac_c" 1>&6
echo "configure:26157: checking for $cf_libs in $cf_path" >&5
			else
				
cf_add_libs="$cf_libs"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

				echo $ac_n "checking for $cf_test in $cf_libs""... $ac_c" 1>&6
echo "configure:26177: checking for $cf_test in $cf_libs" >&5
			fi
			cat > conftest.$ac_ext <<EOF
#line 26180 "configure"
#include "confdefs.h"

#include <X11/Intrinsic.h>
#include <X11/$cf_x_athena_root/SimpleMenu.h>

int main() {

$cf_test((XtAppContext) 0)
; return 0; }
EOF
if { (eval echo configure:26191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  cf_result=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  cf_result=no
fi
rm -rf conftest*
			echo "$ac_t""$cf_result" 1>&6
			if test "$cf_result" = yes ; then
				cf_x_athena_lib="$cf_libs"
				break
			fi
			LIBS="$cf_save"
		fi
	done # cf_libs
		test -n "$cf_x_athena_lib" && break
	done # cf_lib
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


fi





for ac_prog in xcurses-config
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:26236: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XCURSES_CONFIG'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$XCURSES_CONFIG" in
  /*)
  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # 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_XCURSES_CONFIG="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
XCURSES_CONFIG="$ac_cv_path_XCURSES_CONFIG"
if test -n "$XCURSES_CONFIG"; then
  echo "$ac_t""$XCURSES_CONFIG" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$XCURSES_CONFIG" && break
done
test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none"


if test "$XCURSES_CONFIG" != none ; then

CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"

cf_add_libs="`$XCURSES_CONFIG --libs`"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"


cf_cv_lib_XCurses=yes

else

LDFLAGS="$LDFLAGS $X_LIBS"

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

echo "${as_me:-configure}:26302: testing checking additions to CFLAGS ..." 1>&5


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
	(-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
		case $cf_add_cflags in
		(-D*)
			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`

			test "x${cf_add_cflags}" != "x${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)
			;;
		(*)
			case $cf_add_cflags in
			(-D*)
				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
				
CPPFLAGS=`echo "$CPPFLAGS" | \
	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?[ 	]/ /g' \
		-e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ 	]*\)\?$//g'`

				;;
			esac
			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 "x${cf_add_cflags}" != "x${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

echo "${as_me:-configure}:26374: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5


	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

echo "${as_me:-configure}:26383: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5


	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi

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

echo "${as_me:-configure}:26392: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5


	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi




if test "x$cf_check_cflags" != "x$CFLAGS" ; then
cat > conftest.$ac_ext <<EOF
#line 26403 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
printf("Hello world");
; return 0; }
EOF
if { (eval echo configure:26410: \"$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

  test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6

echo "${as_me:-configure}:26418: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5


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

echo "${as_me:-configure}:26424: testing but keeping change to \$CPPFLAGS ..." 1>&5


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

echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
echo "configure:26434: 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 26442 "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:26453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -rf 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_add_libs="-lX11"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

echo $ac_n "checking for XCurses library""... $ac_c" 1>&6
echo "configure:26490: 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
  

cf_add_libs="-lXCurses"
# Filter out duplicates - this happens with badly-designed ".pc" files...
for cf_add_1lib in $LIBS
do
	for cf_add_2lib in $cf_add_libs
	do
		if test "x$cf_add_1lib" = "x$cf_add_2lib"
		then
			cf_add_1lib=
			break
		fi
	done
	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
done
LIBS="$cf_add_libs"

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

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

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

  cf_cv_lib_XCurses=no
fi
rm -rf conftest*

fi

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

fi

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

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

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

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

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

fi
for ac_func in vwprintw
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:26593: 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 26598 "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:26621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5

  eval "ac_cv_func_$ac_func=no"
fi
rm -rf 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


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

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

LINTFLAGS=$LINTFLAGS



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.20110430"
    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
	$CAN_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%@PATH_SEPARATOR@%$PATH_SEPARATOR%g
s%@DESTDIR@%$DESTDIR%g
s%@XLC@%$XLC%g
s%@CC@%$CC%g
s%@EXTRA_CPPFLAGS@%$EXTRA_CPPFLAGS%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%@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%@ARFLAGS@%$ARFLAGS%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%@PATH_SLRNFACE@%$PATH_SLRNFACE%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%@PKG_CONFIG@%$PKG_CONFIG%g
s%@NCURSES_CONFIG@%$NCURSES_CONFIG%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%@LINK_SIZE@%$LINK_SIZE%g
s%@EXTRAOBJS@%$EXTRAOBJS%g
s%@EXTRAO_DEP@%$EXTRAO_DEP%g
s%@CANDIR_MAKE@%$CANDIR_MAKE%g
s%@CANLIBS@%$CANLIBS%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%@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%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g
s%@NLS_TEXTDOMAIN@%$NLS_TEXTDOMAIN%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
s%@XCURSES_CONFIG@%$XCURSES_CONFIG%g
s%@LINTFLAGS@%$LINTFLAGS%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
	$CAN_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

