#! /bin/sh

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

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
  --enable-shared         build shared libraries [default=yes]
  --enable-shared=PKGS    only build shared libraries if the current package
                          appears as an element in the PKGS list"
ac_help="$ac_help
  --enable-static         build static libraries [default=yes]
  --enable-static=PKGS    only build shared libraries if the current package
                          appears as an element in the PKGS list"
ac_help="$ac_help
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
ac_help="$ac_help
  --enable-debug          compile with debugging support"
ac_help="$ac_help
  --enable-warnings       show compilation warnings"
ac_help="$ac_help
  --enable-diagnostic     enable diagnostic"
ac_help="$ac_help
  --enable-profiling      compile with profiling support in server"
ac_help="$ac_help
  --enable-linting        enable lint"
ac_help="$ac_help
  --disable-libwrap       never use libwrap, even if it is available"
ac_help="$ac_help
  --disable-preload       disable preloading in server and client"
ac_help="$ac_help
  --disable-clientdl      disable support for preloading in the client"
ac_help="$ac_help
  --disable-serverdl      disable support for preloading in the server"
ac_help="$ac_help
  --with-domainname=NAME  hardcode local domainname (only on broken platforms)"
ac_help="$ac_help
  --with-socks-conf=FILE  change location of socks client configuration file"
ac_help="$ac_help
  --with-sockd-conf=FILE  change location of socks server configuration file"
ac_help="$ac_help
  --with-pidfile=FILE     change location of server pidfile"
ac_help="$ac_help
  --with-libc=NAME        manually set name of c library if necessary"

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

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

ac_prev=
for ac_option
do

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

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

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

  case "$ac_option" in

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  esac
done

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

trap 'rm -fr conftest* confdefs* core 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/socks.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



#set this to enable prerelease, changes some defaults (debug enabled)
#prerelease="2"
if test x$prerelease != x; then
	prename="-pre$prerelease"
else
	prename=""
fi

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

# 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:603: 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'

echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:656: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments.  Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
   if test "$*" = "X"; then
      # -L didn't work.
      set X `ls -t $srcdir/configure conftestfile`
   fi
   if test "$*" != "X $srcdir/configure conftestfile" \
      && test "$*" != "X conftestfile $srcdir/configure"; then

      # If neither matched, then we have a broken ls.  This can happen
      # if, for instance, CONFIG_SHELL is bash and it inherits a
      # broken ls alias from the environment.  This has actually
      # happened.  Such a system could not be considered "sane".
      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
alias in your environment" 1>&2; exit 1; }
   fi

   test "$2" = conftestfile
   )
then
   # Ok.
   :
else
   { echo "configure: error: newly created file is older than distributed files!
Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
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,"

echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:713: 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


PACKAGE=dante

VERSION=1.1.6$prename

if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
cat >> confdefs.h <<EOF
#define PACKAGE "$PACKAGE"
EOF

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



missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:759: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
   ACLOCAL=aclocal
   echo "$ac_t""found" 1>&6
else
   ACLOCAL="$missing_dir/missing aclocal"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:772: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
   AUTOCONF=autoconf
   echo "$ac_t""found" 1>&6
else
   AUTOCONF="$missing_dir/missing autoconf"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:785: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (automake --version) < /dev/null > /dev/null 2>&1; then
   AUTOMAKE=automake
   echo "$ac_t""found" 1>&6
else
   AUTOMAKE="$missing_dir/missing automake"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:798: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (autoheader --version) < /dev/null > /dev/null 2>&1; then
   AUTOHEADER=autoheader
   echo "$ac_t""found" 1>&6
else
   AUTOHEADER="$missing_dir/missing autoheader"
   echo "$ac_t""missing" 1>&6
fi

echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:811: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf.  Sigh.
if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
   MAKEINFO=makeinfo
   echo "$ac_t""found" 1>&6
else
   MAKEINFO="$missing_dir/missing makeinfo"
   echo "$ac_t""missing" 1>&6
fi





#NOTE: save CFLAGS; wish to compile without -O2 when debugging
oCFLAGS=$CFLAGS
unset CFLAGS
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
  enableval="$enable_shared"
  p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
  enable_shared=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_shared=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_shared=yes
fi

# Check whether --enable-static or --disable-static was given.
if test "${enable_static+set}" = set; then
  enableval="$enable_static"
  p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
  enable_static=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_static=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
else
  enable_static=yes
fi


# 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:883: 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

# 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:906: 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

# 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:936: 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:966: 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:1017: 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:1049: 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 1060 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1065: \"$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:1091: 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:1096: 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:1105: \"$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:1124: 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

# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
  withval="$with_gnu_ld"
  test "$withval" = no || with_gnu_ld=yes
else
  with_gnu_ld=no
fi


ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
  # Check if gcc -print-prog-name=ld gives a path.
  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
echo "configure:1168: checking for ld used by GCC" >&5
  ac_prog=`($CC -print-prog-name=ld) 2>&5`
  case "$ac_prog" in
  # Accept absolute paths.
  /* | A-Za-z:\\*)
    test -z "$LD" && LD="$ac_prog"
    ;;
  "")
    # If it fails, then pretend we aren't using GCC.
    ac_prog=ld
    ;;
  *)
    # If it is relative, then search for the first ld in PATH.
    with_gnu_ld=unknown
    ;;
  esac
elif test "$with_gnu_ld" = yes; then
  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
echo "configure:1186: checking for GNU ld" >&5
else
  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
echo "configure:1189: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "$LD"; then
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f "$ac_dir/$ac_prog"; then
      ac_cv_path_LD="$ac_dir/$ac_prog"
      # Check to see if the program is GNU ld.  I'd rather use --version,
      # but apparently some GNU ld's only accept -v.
      # Break only if it was the GNU/non-GNU ld that we prefer.
      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
	test "$with_gnu_ld" != no && break
      else
        test "$with_gnu_ld" != yes && break
      fi
    fi
  done
  IFS="$ac_save_ifs"
else
  ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi

LD="$ac_cv_path_LD"
if test -n "$LD"; then
  echo "$ac_t""$LD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }

echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
echo "configure:1225: checking if the linker ($LD) is GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  ac_cv_prog_gnu_ld=yes
else
  ac_cv_prog_gnu_ld=no
fi
fi

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


echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
echo "configure:1241: checking for BSD-compatible nm" >&5
if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$NM" in
/* | A-Za-z:\\*)
  ac_cv_path_NM="$NM" # Let the user override the test with a path.
  ;;
*)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/nm; then
      # Check to see if the nm accepts a BSD-compat flag.
      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
      #   nm: unknown option "B" ignored
      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
        ac_cv_path_NM="$ac_dir/nm -B"
      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
        ac_cv_path_NM="$ac_dir/nm -p"
      else
        ac_cv_path_NM="$ac_dir/nm"
      fi
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
  ;;
esac
fi

NM="$ac_cv_path_NM"
echo "$ac_t""$NM" 1>&6


echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:1278: 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

# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'

# Check for any special flags to pass to ltconfig.
libtool_flags=
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"

# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$host" in
*-*-irix6*)
  # Find out which ABI we are using.
  echo '#line 1314 "configure"' > conftest.$ac_ext
  if { (eval echo configure:1315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    case "`/usr/bin/file conftest.o`" in
    *32-bit*)
      LD="${LD-ld} -32"
      ;;
    *N32*)
      LD="${LD-ld} -n32"
      ;;
    *64-bit*)
      LD="${LD-ld} -64"
      ;;
    esac
  fi
  rm -rf conftest*
  ;;

*-*-sco3.2v5*)
  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  CFLAGS="$CFLAGS -belf"
  ;;
esac

# Actually configure libtool.  ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }

autoconf_compflags=$CFLAGS
CFLAGS=$oCFLAGS

echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1348: 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 1363 "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:1369: \"$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 1380 "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:1386: \"$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 1397 "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:1403: \"$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



# 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:1435: 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




if test x$prerelease != x; then
  PRERELEASE_TRUE=
  PRERELEASE_FALSE='#'
else
  PRERELEASE_TRUE='#'
  PRERELEASE_FALSE=
fi

#known keywords for --enable/disable-foo(=yes/no)?
KNOWN_KEYWORDS="shared|static|debug|warnings|diagnostic|profiling|linting|libwrap|preload|serverdl|clientdl"
for keyword in `set | egrep '^enable_' | sed -e 's/^enable_\(.*\)=.*/\1/'`;
do
	echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null
	if test $? -ne 0; then
		echo "configure: warning: unknown option '$keyword'" 1>&2
		sleep 10;
	fi
done

#Solaris 2.5.1 is broken in many places
case $host in
    *-*-solaris2.5.1)
	echo "configure: warning: the server might not work properly on solaris 2.5.1" 1>&2
	cat >> confdefs.h <<\EOF
#define HAVE_SOLARIS_2_5_1 1
EOF

    ;;
esac

#disable acceptlock
#XXX add proper test for this?
case $host in

	*-*-*bsd* | alpha-dec-osf* | *-*-hpux* | *-*-aix4*)
		no_acceptlock=t
	;;

	*-*-solaris*)
		unset solaris_newversion
		ver=`echo $host | sed -e 's/.*solaris//'`
		ver_major=`echo $ver | cut -d. -f1`
		ver_minor=`echo $ver | cut -d. -f2`
		if test x"${ver_major}" != x -a x"${ver_minor}" != x; then
			if test $ver_major -ge 2 -a $ver_minor -gt 5; then
				solaris_newversion=t
			fi
		fi
		if test x"${solaris_newversion}" = x"t"; then
			no_acceptlock=t
		fi
	;;

esac

case $host in

	alpha-dec-osf*)
		cat >> confdefs.h <<\EOF
#define HAVE_DEC_PROTO 1
EOF

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

		PRELOAD="RLD"
		CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE_EXTENDED -DBYTE_ORDER=LITTLE_ENDIAN -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_OSF_SOURCE"
	;;

	*-*-hpux*)
		#HPUX needs _PROTOTYPES to include prototypes
		#for configure (for gcc and cc)
		CPPFLAGS="${CPPFLAGS} -D_PROTOTYPES"
	;;

	*-*-sunos4*)
		#XXX hardcode library path (find better way to do this?)
		cat >> confdefs.h <<\EOF
#define LIBRARY_PATH "/usr/lib/"
EOF

		base_library_path="/usr/lib/"
		echo "configure: warning: "notice: hardcoding /usr/lib for dlopen"" 1>&2
		#nonstandard libfunction workaround #XXX proper test
		cat >> confdefs.h <<\EOF
#define HAVE_BROKEN_VSPRINTF 1
EOF

		#link problems with libresolv, hardcode domainname
		if test -s /etc/resolv.conf; then
		    domainname_hardcoded=`grep domain /etc/resolv.conf | awk '{ print $2 }'`
		fi
		no_res_init=t
		cat >> confdefs.h <<\EOF
#define HAVE_NO_RESOLVESTUFF 1
EOF

	;;

	*-*-solaris*)
		cat >> confdefs.h <<\EOF
#define HAVE_SENDMSG_DEADLOCK 1
EOF

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

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

	;;

	*-*-linux-*) # XXX This might only concern 2.0.x kernels (add test?)
		cat >> confdefs.h <<\EOF
#define HAVE_DEFECT_RECVMSG 1
EOF

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

		cat >> confdefs.h <<\EOF
#define SPT_PADCHAR '\0'
EOF

	;;

	*-*-openbsd*) #static sockd when profiling is enabled
		no_dynamic_profiled_sockd=t
	;;

	*-*-irix*)
		PRELOAD="RLD"
	;;
	*-*-aix4*)
		OSPIDFILE="/etc/sockd.pid"
		echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:1598: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 1600 "configure"
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

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

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


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

	;;

esac

case $PRELOAD in
	RLD)
		PRELOAD_SEPERATOR=":"
		PRELOAD_VARIABLE="_RLD_LIST"
		PRELOAD_POSTFIX="DEFAULT"
	;;

	*)
		PRELOAD_SEPERATOR=" "
		PRELOAD_VARIABLE="LD_PRELOAD"
		PRELOAD_POSTFIX=""
	;;
esac





#define hosttype
cat >> confdefs.h <<EOF
#define HAVE_HOST_TYPE "$host"
EOF


#XXX add proper test for this?
if test x$no_acceptlock != xt; then
	cat >> confdefs.h <<\EOF
#define NEED_ACCEPTLOCK 1
EOF

fi

echo $ac_n "checking for compiler flags""... $ac_c" 1>&6
echo "configure:1662: checking for compiler flags" >&5
case $host in

    #XXX check for compiler type, not architecture
    *-*-solaris*)
	if test "x$GCC" = x; then
	    #-xs provides allows easier debugging with gdb
	    comp_flags="-Xt -xs" #XXX -Xt needed to compile?
	    #XXX due to some problems with sockaddr alignment
	    #XXX sun cc needs -misalign
	    comp_flags="$comp_flags -misalign -xO0"
	    echo "$ac_t""$comp_flags" 1>&6
	    echo "configure: warning: there might currenly be some performance problems with suncc - it needs -misalign" 1>&2
	    $CC 2>&1 | grep ucbcc > /dev/null
	    if test $? -eq 0; then
		#XXX ucbcc uses includes from /usr/ucbinclude, but these are
		#not complete. add /usr/include to include path to get
		#all prototypes (read/write are missing)
		#XXX
		host_cc="solaris-ucbcc"
		CPPFLAGS="-I/usr/include $CPPFLAGS${CPPFLAGS:+ } "
	    fi
	fi
#	AC_MSG_RESULT($comp_flags)
    ;;

    alpha-dec-osf*) #XXX is it possible to get it to work with -newc?
	if test "x$GCC" = x; then
	    comp_flags="-std1 -oldc"
	fi
	echo "$ac_t""$comp_flags" 1>&6
    ;;

    *-*-hpux*)
	if test "x$GCC" = x; then
	    CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE"
	    #XXX when cc is used as CPP it needs -Ae to work
	    #    for L_SOCKPROTO; add -Ae to CPPFLAGS.
	    #    This won't work if CPP is specified by hand
	    #    and is something else than cc (when CC is hp cc)
#	    comp_flags="-Ae"
	    CPPFLAGS="${CPPFLAGS} -Ae"
	fi
	echo "$ac_t""$comp_flags" 1>&6
	;;

    *-*-aix4*)
	if test "x$GCC" = x; then
	    comp_flags="-qlanglvl=ansi"
	    #XXX
	    CPPFLAGS="${CPPFLAGS} -qlanglvl=ansi"
	fi
	echo "$ac_t""$comp_flags" 1>&6
     ;;

    *)
	echo "$ac_t""none" 1>&6
    ;;
    #XXX make sure compiling with compiler options works
esac

echo $ac_n "checking for support for -pipe compiler flag""... $ac_c" 1>&6
echo "configure:1724: checking for support for -pipe compiler flag" >&5
oCFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pipe"
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 1731 "configure"
#include "confdefs.h"

int main()
{
	return 0;
}
EOF
if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
     comp_flags="${comp_flags} -pipe"
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

CFLAGS="$oCFLAGS"


echo $ac_n "checking for compilation with debugging""... $ac_c" 1>&6
echo "configure:1756: checking for compilation with debugging" >&5
# Check whether --enable-debug or --disable-debug was given.
if test "${enable_debug+set}" = set; then
  enableval="$enable_debug"
  debug_enabled=t
else
  if test x$prerelease != x; then
	   debug_enabled=t
	 fi
fi


if test x$debug_enabled = xt; then
    #no optimalization wanted
    if test $ac_cv_prog_cc_g = yes; then
	CFLAGS="$CFLAGS -g"
    fi
    CPPFLAGS="-DDEBUG $CPPFLAGS"
    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""no" 1>&6
    #autoconf_compflags is set to "-g -O2" with GCC
    CFLAGS="$CFLAGS $autoconf_compflags"
fi

#-Wall ?
echo $ac_n "checking for warning flags""... $ac_c" 1>&6
echo "configure:1783: checking for warning flags" >&5
# Check whether --enable-warnings or --disable-warnings was given.
if test "${enable_warnings+set}" = set; then
  enableval="$enable_warnings"
  enable_warnings=t
else
  if test x$prerelease != x; then
	    enable_warnings=t
	 fi
fi


#construct warning flags in $warn
if test x$enable_warnings != x; then
    #try to enable compiler specific warning flags
    if test "x$GCC" = x; then
	case $host in

	    *sunos4*) #sunos cc
#		warn=""
		true
	    ;;

	    alpha-dec-osf*) #osf cc
#		warn="-w0 -check -portable -warnprotos"
		true
	    ;;

	    *-*-hpux*)
		warn="-v"
	    ;;

	    *-*-solaris*)
		warn="-v"
		true
	    ;;

	    *-*-irix*) #sgi cc
		warn="-fullwarn"
	    ;;

	    *) #try -Wall (gcc)
		warn="-Wall"
	    ;;
	esac
    else
	#gcc warnings
	warn="-Wall -W -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wundef"
	#warn="$warn -Wold-style-cast -Winline -Waggregate-return -Wconversion -Wwrite-strings -Wtraditional -Wshadow"
    fi

    oCFLAGS=$CFLAGS
    CFLAGS="$CFLAGS $warn"
    #make sure compilation is still possible
    cat > conftest.$ac_ext <<EOF
#line 1838 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:1845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""$warn" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""none" 1>&6
		    unset warn
fi
rm -f conftest*
    CFLAGS=$oCFLAGS
else
    echo "$ac_t""none" 1>&6
fi

#NOTE: set warnings at the bottom; might interfere with tests
CFLAGS="$CFLAGS $comp_flags"

#-DDIAGNOSTICS?
echo $ac_n "checking for compliation with DIAGNOSTIC""... $ac_c" 1>&6
echo "configure:1866: checking for compliation with DIAGNOSTIC" >&5
# Check whether --enable-diagnostic or --disable-diagnostic was given.
if test "${enable_diagnostic+set}" = set; then
  enableval="$enable_diagnostic"
  cat >> confdefs.h <<\EOF
#define DIAGNOSTIC 1
EOF

	 echo "$ac_t""yes" 1>&6
else
  if test x$prerelease != x; then
	      cat >> confdefs.h <<\EOF
#define DIAGNOSTIC 1
EOF

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


# Check whether --enable-profiling or --disable-profiling was given.
if test "${enable_profiling+set}" = set; then
  enableval="$enable_profiling"
     cat >> confdefs.h <<\EOF
#define HAVE_PROFILING 1
EOF

    s_profiling=t
fi




if test x$s_profiling = xt; then
  SPROFIL_TRUE=
  SPROFIL_FALSE='#'
else
  SPROFIL_TRUE='#'
  SPROFIL_FALSE=
fi
#static or dynamic sockd?


if test x$no_dynamic_profiled_sockd = xt; then
  STATIC_SOCKD_TRUE=
  STATIC_SOCKD_FALSE='#'
else
  STATIC_SOCKD_TRUE='#'
  STATIC_SOCKD_FALSE=
fi
if test "x$s_profiling" = "xt" -a "x$no_dynamic_profiled_sockd" = "xt"; then
	no_preload_server=t
	echo "configure: warning: sockd is built static when profiling is enabled" 1>&2
fi

# Check whether --enable-linting or --disable-linting was given.
if test "${enable_linting+set}" = set; then
  enableval="$enable_linting"
  s_linting=t
fi



if test x$s_linting = xt; then
  LINT_TRUE=
  LINT_FALSE='#'
else
  LINT_TRUE='#'
  LINT_FALSE=
fi

echo $ac_n "checking whether libwrap should be disabled""... $ac_c" 1>&6
echo "configure:1940: checking whether libwrap should be disabled" >&5
# Check whether --enable-libwrap or --disable-libwrap was given.
if test "${enable_libwrap+set}" = set; then
  enableval="$enable_libwrap"
  if test x$enableval = xno; then
	no_libwrap=t
	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""no" 1>&6
fi
else
  echo "$ac_t""no" 1>&6
fi


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

test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"

for ac_prog in mawk gawk nawk awk
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:1995: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AWK"; then
  ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AWK="$ac_cv_prog_AWK"
if test -n "$AWK"; then
  echo "$ac_t""$AWK" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AWK" && break
done

missing_dir=`cd $ac_aux_dir && pwd`
for ac_prog in flex lex
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:2030: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # 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_LEX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
  echo "$ac_t""$LEX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$LEX" && break
done
test -n "$LEX" || LEX=""$missing_dir/missing flex""

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

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:2097: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | 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$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2105 "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 yywrap();

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

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

fi

echo $ac_n "checking lex output file root""... $ac_c" 1>&6
echo "configure:2139: checking lex output file root" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # The minimal lex program is just a single line: %%.  But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
  ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
  ac_cv_prog_lex_root=lexyy
else
  { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
fi
fi

echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root

echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
echo "configure:2160: checking whether yytext is a pointer" >&5
if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  # POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations.
ac_cv_prog_lex_yytext_pointer=no
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB"
cat > conftest.$ac_ext <<EOF
#line 2172 "configure"
#include "confdefs.h"
`cat $LEX_OUTPUT_ROOT.c`
int main() {

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

fi

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

fi


echo $ac_n "checking size of char""... $ac_c" 1>&6
echo "configure:2202: checking size of char" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_char'+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 2210 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(char));
  exit(0);
}
EOF
if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_char=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_char=0
fi
rm -fr conftest*
fi

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


echo $ac_n "checking size of short""... $ac_c" 1>&6
echo "configure:2241: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+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 2249 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(short));
  exit(0);
}
EOF
if { (eval echo configure:2260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_short=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_short=0
fi
rm -fr conftest*
fi

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


echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:2280: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+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 2288 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

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


echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:2319: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+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 2327 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

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



echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:2359: 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 2364 "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:2372: \"$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 2389 "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 2407 "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 2428 "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:2439: \"$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

echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
echo "configure:2463: 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 2468 "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:2484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_header_sys_wait_h=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_sys_wait_h=no
fi
rm -f conftest*
fi

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

fi

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

for ac_hdr in unistd.h crypt.h sys/file.h sys/ioctl.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2548: 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 2553 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2558: \"$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 netinet/ip_var.h tcpd.h shadow.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2588: 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 2593 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2598: \"$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


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

	;;
	*) ;;
esac

#build without support for preloading?
echo $ac_n "checking whether all interposition usage should be disabled""... $ac_c" 1>&6
echo "configure:2673: checking whether all interposition usage should be disabled" >&5
# Check whether --enable-preload or --disable-preload was given.
if test "${enable_preload+set}" = set; then
  enableval="$enable_preload"
  if test x$enableval = xno; then
	no_preload_client=t
	no_preload_server=t
	no_preload=t
	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""no" 1>&6
fi
else
  echo "$ac_t""no" 1>&6
fi


if test "x$no_preload" = x; then
    echo $ac_n "checking whether interposition in the client should be disabled""... $ac_c" 1>&6
echo "configure:2692: checking whether interposition in the client should be disabled" >&5
    # Check whether --enable-clientdl or --disable-clientdl was given.
if test "${enable_clientdl+set}" = set; then
  enableval="$enable_clientdl"
  if test x$enableval = xno; then
	    no_preload_client=t
	    echo "$ac_t""yes" 1>&6
    else
	    echo "$ac_t""no" 1>&6
    fi
else
  echo "$ac_t""no" 1>&6
fi


    echo $ac_n "checking whether interposition in the server should be disabled""... $ac_c" 1>&6
echo "configure:2708: checking whether interposition in the server should be disabled" >&5
    # Check whether --enable-serverdl or --disable-serverdl was given.
if test "${enable_serverdl+set}" = set; then
  enableval="$enable_serverdl"
  if test x$enableval = xno; then
	    no_preload_server=t
	    echo "$ac_t""yes" 1>&6
    else
	    if text x$enableval = xyes; then
		serverdl_always_on=t
	    fi
	    echo "$ac_t""no" 1>&6
    fi
else
  echo "$ac_t""no" 1>&6
fi

fi



if test x$no_preload_server = x; then
  SERVER_INTERPOSITION_TRUE=
  SERVER_INTERPOSITION_FALSE='#'
else
  SERVER_INTERPOSITION_TRUE='#'
  SERVER_INTERPOSITION_FALSE=
fi


if test x$serverdl_always_on = xt; then
  SERVER_INTERPOSITION_ALWAYS_TRUE=
  SERVER_INTERPOSITION_ALWAYS_FALSE='#'
else
  SERVER_INTERPOSITION_ALWAYS_TRUE='#'
  SERVER_INTERPOSITION_ALWAYS_FALSE=
fi

if test "x${no_preload_client}" = "xt" -a "x${no_preload_server}" = "xt"; then
    unset preload_enabled
else
    preload_enabled=t
fi


#allow manual specification
echo $ac_n "checking for hardcoded domainname""... $ac_c" 1>&6
echo "configure:2755: checking for hardcoded domainname" >&5
# Check whether --with-domainname or --without-domainname was given.
if test "${with_domainname+set}" = set; then
  withval="$with_domainname"
  domainname_hardcoded=$withval
fi


if test x${domainname_hardcoded} != x; then
    cat >> confdefs.h <<EOF
#define SOCKS_DOMAINNAME "${domainname_hardcoded}"
EOF

    echo "$ac_t""yes" 1>&6
    echo "configure: warning: using hardcoded domainname ${domainname_hardcoded}" 1>&2
else
    echo "$ac_t""no" 1>&6
    if test x${no_res_init} = xt; then
	echo "configure: warning: unable to locate domainname" 1>&2
    fi
fi

#allow default file locations to be overridden
echo $ac_n "checking for socks config file location""... $ac_c" 1>&6
echo "configure:2779: checking for socks config file location" >&5
# Check whether --with-socks-conf or --without-socks-conf was given.
if test "${with_socks_conf+set}" = set; then
  withval="$with_socks_conf"
  echo "$ac_t""$withval" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_SOCKS_CONFIGFILE 1
EOF

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


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


echo $ac_n "checking for sockd config file location""... $ac_c" 1>&6
echo "configure:2799: checking for sockd config file location" >&5
# Check whether --with-sockd-conf or --without-sockd-conf was given.
if test "${with_sockd_conf+set}" = set; then
  withval="$with_sockd_conf"
  echo "$ac_t""$withval" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_SOCKD_CONFIGFILE 1
EOF

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


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


echo $ac_n "checking for pid file location""... $ac_c" 1>&6
echo "configure:2819: checking for pid file location" >&5
# Check whether --with-pidfile or --without-pidfile was given.
if test "${with_pidfile+set}" = set; then
  withval="$with_pidfile"
  echo "$ac_t""$withval" 1>&6
 cat >> confdefs.h <<\EOF
#define HAVE_SOCKD_PIDFILE 1
EOF

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

 have_pidfile=t

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


#os default?
if test x"${have_pidfile}" != xt; then
    if test x"$OSPIDFILE" != x; then
	cat >> confdefs.h <<\EOF
#define HAVE_SOCKD_PIDFILE 1
EOF

	cat >> confdefs.h <<EOF
#define HAVE_ALT_SOCKD_PIDFILE "$OSPIDFILE"
EOF

    fi
fi

# SOCKSLIBRARY_DYNAMIC is set in the lib directory when preloading
# is supported (and requested).
# HAVE_DLFCN_H only determines if the include file exists
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
echo "configure:2858: checking for dlfcn.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 2863 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2868: \"$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_DLFCN_H 1
EOF

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


#building of shared libraries enabled?
unset build_preload_lib
if test "x${no_preload_client}" = "x" -a "x$have_dlfcn_h" = "xt"; then
    build_preload_lib=t
fi


if test "x$build_preload_lib" = "xt"; then
  BUILD_PRELOAD_LIB_TRUE=
  BUILD_PRELOAD_LIB_FALSE='#'
else
  BUILD_PRELOAD_LIB_TRUE='#'
  BUILD_PRELOAD_LIB_FALSE=
fi

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

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


echo $ac_n "checking whether <sys/types.h> defines const""... $ac_c" 1>&6
echo "configure:2948: checking whether <sys/types.h> defines const" >&5
cat > conftest.$ac_ext <<EOF
#line 2950 "configure"
#include "confdefs.h"

#include <sys/types.h>
#ifdef const
yes
#endif

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

if test x$check_const = xyes; then
    echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2972: 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 2977 "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:3026: \"$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

fi

echo $ac_n "checking whether <netdb.h> declares h_errno""... $ac_c" 1>&6
echo "configure:3049: checking whether <netdb.h> declares h_errno" >&5
cat > conftest.$ac_ext <<EOF
#line 3051 "configure"
#include "confdefs.h"

#include <netdb.h>

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

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


#XXXsys/socket.h?
echo $ac_n "checking for struct ip_opts in <netinet/in.h>""... $ac_c" 1>&6
echo "configure:3074: checking for struct ip_opts in <netinet/in.h>" >&5
cat > conftest.$ac_ext <<EOF
#line 3076 "configure"
#include "confdefs.h"

#include <netinet/ip_var.h>

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "struct.*ipoption" >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPOPTS 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 <sys/types.h> defines inline""... $ac_c" 1>&6
echo "configure:3098: checking whether <sys/types.h> defines inline" >&5
cat > conftest.$ac_ext <<EOF
#line 3100 "configure"
#include "confdefs.h"

#include <sys/types.h>
#ifdef inline
yes
#endif

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

if test x$check_inline="yes";then
    echo $ac_n "checking for inline""... $ac_c" 1>&6
echo "configure:3122: 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 3129 "configure"
#include "confdefs.h"

int main() {
} $ac_kw foo() {
; return 0; }
EOF
if { (eval echo configure:3136: \"$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

fi

echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
echo "configure:3164: 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 3169 "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 off_t""... $ac_c" 1>&6
echo "configure:3198: 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 3203 "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:3231: 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 3236 "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:3264: 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 3269 "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 whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3297: 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 3302 "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:3311: \"$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 sockaddr_storage in sys/socket.h""... $ac_c" 1>&6
echo "configure:3333: checking for sockaddr_storage in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
#line 3335 "configure"
#include "confdefs.h"

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

int main() {

struct sockaddr_storage __ss;
struct sockaddr_in *sin;
sin = (struct sockaddr_in *) &__ss;

; return 0; }
EOF
if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_SOCKADDR_STORAGE 1
EOF

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

echo $ac_n "checking to see if openlog accepts LOG_PERROR""... $ac_c" 1>&6
echo "configure:3365: checking to see if openlog accepts LOG_PERROR" >&5
cat > conftest.$ac_ext <<EOF
#line 3367 "configure"
#include "confdefs.h"

#include <syslog.h>
#ifdef LOG_PERROR
yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_OPENLOG_LOG_PERROR 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 to see if stdlib.h defines EXIT_FAILURE""... $ac_c" 1>&6
echo "configure:3392: checking to see if stdlib.h defines EXIT_FAILURE" >&5
cat > conftest.$ac_ext <<EOF
#line 3394 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifdef EXIT_FAILURE
yes
#endif

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

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


#XXX actually checks if AF_UNIX should be used instead of AF_LOCAL
echo $ac_n "checking whether <sys/socket.h> uses AF_UNIX""... $ac_c" 1>&6
echo "configure:3420: checking whether <sys/socket.h> uses AF_UNIX" >&5
cat > conftest.$ac_ext <<EOF
#line 3422 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/socket.h>
#ifdef AF_LOCAL
#else
#ifdef AF_UNIX
yes
#endif
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define NEED_AF_LOCAL 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 for SIGINFO""... $ac_c" 1>&6
echo "configure:3451: checking for SIGINFO" >&5
cat > conftest.$ac_ext <<EOF
#line 3453 "configure"
#include "confdefs.h"

#include <signal.h>
#ifdef SIGINFO
yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_SIGNAL_SIGINFO 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 to see if MSG_WAITALL exists""... $ac_c" 1>&6
echo "configure:3478: checking to see if MSG_WAITALL exists" >&5
cat > conftest.$ac_ext <<EOF
#line 3480 "configure"
#include "confdefs.h"

#include <sys/socket.h>
#ifdef MSG_WAITALL
yes
#endif

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

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


#SO_SNDLOWAT
#irix 6.2 only seems to look at lowest 8 bit of value
#Solaris also seems to be broken (up to 2.6 atleast)
echo $ac_n "checking whether a working SO_SNDLOWAT exists""... $ac_c" 1>&6
echo "configure:3508: checking whether a working SO_SNDLOWAT exists" >&5
cat > conftest.$ac_ext <<EOF
#line 3510 "configure"
#include "confdefs.h"

#include <sys/socket.h>
#ifdef SO_SNDLOWAT
yes
#endif

EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  
case $host in
	*bsd*)
		so_sndlowat=t
	;;
	*-osf*)
		so_sndlowat=t
	;;
esac
if test "x${so_sndlowat}" = xt; then
	cat >> confdefs.h <<\EOF
#define HAVE_SO_SNDLOWAT 1
EOF

	echo "$ac_t""yes" 1>&6
else
	echo "$ac_t""disabled" 1>&6
	echo "configure: warning: performance in the server might be degraded without support for the SO_SNDLOWAT socket option" 1>&2
fi
else
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
      echo "configure: warning: performance in the server might be degraded without support for the SO_SNDLOWAT socket option" 1>&2
fi
rm -f conftest*


echo $ac_n "checking whether realloc with a NULL pointer calls malloc""... $ac_c" 1>&6
echo "configure:3550: checking whether realloc with a NULL pointer calls malloc" >&5
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 3555 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifndef NULL
#define NULL (char *)0
#endif

int main()
{
	/* will assume this test doesn\'t fail because of lack of memory */
	if (realloc(NULL, 1) == NULL)
		return 1;
	else
		return 0;
}
EOF
if { (eval echo configure:3572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_NOMALLOC_REALLOC 1
EOF

     echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi


echo $ac_n "checking whether free with can be called with NULL""... $ac_c" 1>&6
echo "configure:3590: checking whether free with can be called with NULL" >&5
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 3595 "configure"
#include "confdefs.h"

#include <stdlib.h>
#ifndef NULL
#define NULL (char *)0
#endif

int main()
{
	/* will assume core dump/seg fault if it doesn\'t work */
	free(NULL);
	return 0;
}
EOF
if { (eval echo configure:3610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_NONULL_FREE 1
EOF

     echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi


#A good time to save the cache (L_SOCKPROTO might fail)
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


#find prototypes for interposition.c
if test "x$preload_enabled" = "xt"; then

    unset failproto

    if test "x${ac_cv_header_stdc}" = xyes; then

	#does $CPP define __STDC__?
	cat > conftest.$ac_ext <<EOF
#line 3685 "configure"
#include "confdefs.h"

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


	#L_SOCKPROTO is used to determine the argument types of the functions
	#which are used in dlib/interposition.c. It compares the prototypes in
	#(mainly) <sys/socket.h> and compares them to a list of known
	#values. The arguments to L_SOCKPROTO are:
	#1: the name of the function
	#2: shell code which is executed if no known prototype is found
	#3...: a list of known types, the first is a list of known return values,
	#      the second a list of known values for the first argument etc.
	#To add new values to the list simply add the new values at the end of
	#the list. (to add a new function a set of #undef statements in
	#acconfig.h is also needed).
	case $host in
		*-*-aix4*)
			PROTO_ACCEPT=naccept
			PROTO_GETPEERNAME=ngetpeername
			PROTO_GETSOCKNAME=ngetsockname
			PROTO_RECVFROM=nrecvfrom
			PROTO_RECVMSG=nrecvmsg
			PROTO_SENDMSG=nsendmsg
		;;
		*)
			PROTO_ACCEPT=accept
			PROTO_GETPEERNAME=getpeername
			PROTO_GETSOCKNAME=getsockname
			PROTO_RECVFROM=recvfrom
			PROTO_RECVMSG=recvmsg
			PROTO_SENDMSG=sendmsg
		;;
	esac

	
 
nargs=6

paramcnt=4


func=connect
ucfunc=CONNECT


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:3746: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct sockaddr *" "__CONST_SOCKADDR_ARG" "struct sockaddr *" "const void *" "__const struct sockaddr *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t" "int" "size_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=${PROTO_ACCEPT}
ucfunc=ACCEPT



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:3934: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct sockaddr *" "__SOCKADDR_ARG" "__const struct sockaddr *" "void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t *" "int *" "Psocklen_t" "size_t *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=bind
ucfunc=BIND


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:4121: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct sockaddr *" "__CONST_SOCKADDR_ARG" "struct sockaddr *" "const void *" "__const struct sockaddr *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t" "int" "size_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=${PROTO_GETPEERNAME}
ucfunc=GETPEERNAME



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:4309: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct sockaddr *" "__SOCKADDR_ARG" "void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t *" "int *" "Psocklen_t" "size_t *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=${PROTO_GETSOCKNAME}
ucfunc=GETSOCKNAME



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:4497: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct sockaddr *" "__SOCKADDR_ARG" "void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int *" "socklen_t *" "Psocklen_t" "size_t *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=9

paramcnt=7


func=${PROTO_RECVFROM}
ucfunc=RECVFROM



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:4685: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "void *" "char *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fourth argument
	
_arg=4
_param=conftest.out_param_4
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fifth argument
	
_arg=5
_param=conftest.out_param_5
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct sockaddr *" "__SOCKADDR_ARG" "void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#sixth argument
	
_arg=6
_param=conftest.out_param_6
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t *" "int *" "Psocklen_t" "size_t *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi


#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=7

paramcnt=5


func=send
ucfunc=SEND


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:4950: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const void *" "__const void *" "const char *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fourth argument
	
_arg=4
_param=conftest.out_param_4
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi




#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=9

paramcnt=7


func=sendto
ucfunc=SENDTO


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:5163: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const void *" "__const void *" "const char *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fourth argument
	
_arg=4
_param=conftest.out_param_4
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fifth argument
	
_arg=5
_param=conftest.out_param_5
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct sockaddr *" "__CONST_SOCKADDR_ARG" "const void *" "__const struct sockaddr *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#sixth argument
	
_arg=6
_param=conftest.out_param_6
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "socklen_t" "int" "size_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi


#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=7

paramcnt=5


func=recv
ucfunc=RECV


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:5428: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "void *" "char *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#fourth argument
	
_arg=4
_param=conftest.out_param_4
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi




#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=readv
ucfunc=READV


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:5641: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct iovec *" "__const struct iovec *" "struct iovec *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "size_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=${PROTO_RECVMSG}
ucfunc=RECVMSG



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:5829: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct msghdr *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=writev
ucfunc=WRITEV


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:6016: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct iovec *" "__const struct iovec *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "size_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=${PROTO_SENDMSG}
ucfunc=SENDMSG



echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:6204: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t" "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const struct msghdr *" "__const struct msghdr *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "unsigned int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=write
ucfunc=WRITE


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:6391: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const void *" "__const void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "unsigned"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*


	
 
nargs=6

paramcnt=4


func=read
ucfunc=READ


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:6578: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "ssize_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "size_t" "unsigned"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*



#XXX
case $host in
	mips-sgi-irix*)
	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETHOSTBYADDR_1 const char *
EOF

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

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

	;;
	*)

	
 
nargs=6

paramcnt=4


func=gethostbyaddr
ucfunc=GETHOSTBYADDR


echo $ac_n "checking prototypes for $func""... $ac_c" 1>&6
echo "configure:6788: checking prototypes for $func" >&5

unset failure

cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <netdb.h>
#include <unistd.h>
EOF

${CPP} ${CPPFLAGS} ${CPPFLAG_STDC} conftest.$ac_ext | $AWK "{ if (/[^a-z0-9_]${func}[^a-z0-9_]/) { s=10 }; if ( s > 0 ) { s -= 1; print; } }" | egrep -v '^#' | tr '\n' ' ' | tr -s '/' |  tr ';' '\n'  | grep -v "__${func}" | egrep "[^a-z0-9_]${func}[^a-z0-9_]" | tr -s '[:blank:]' | sed -e 's/extern//' > conftest.out_proto

cnt=0
while test $cnt -lt $paramcnt; do
	if test $cnt -eq 0; then
		cat conftest.out_proto | sed -e "s/${func}.*//" | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	else
		cat conftest.out_proto | sed -e "s/.*${func}//" | sed -e "s/[\(\)]//g" | cut -d, -f $cnt | sed -e 's/^[ 	]*//' | sed -e 's/[ 	]*$//g' > conftest.out_param
	fi

	cat conftest.out_param | tr -s '[:blank:]' > conftest.out_nospace
	if test -s conftest.out_nospace; then
		cp -f conftest.out_param conftest.out_param_${cnt}
	else
		echo "not found" > conftest.out_param_${cnt}
		echo "warning: found no argument"
	fi

	#XXX avoid subshell
	case $cnt in
		0) cnt=1;;
		1) cnt=2;;
		2) cnt=3;;
		3) cnt=4;;
		4) cnt=5;;
		5) cnt=6;;
		6) cnt=7;;
		7) cnt=8;;
		8) cnt=9;;
		9) cnt=10;;
		10) cnt=11;;
	esac

done


	#return value
	
_arg=0
_param=conftest.out_param_0
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "struct hostent *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#first argument
	
_arg=1
_param=conftest.out_param_1
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "const char *" "const void *" "__const char *" "__const void *"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#second argument
	
_arg=2
_param=conftest.out_param_2
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int" "size_t" "__socklen_t"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi

	#third argument
	
_arg=3
_param=conftest.out_param_3
_func=$func
_ucfunc=$ucfunc

unset _nofunc

for val in "int"
do
	cat ${_param} | egrep "^${val}" > /dev/null
	test $? -eq 0 && _nofunc="" && break
	_nofunc=t
done
if test "x${_nofunc}" = xt; then
	if test "x$failure" != x; then
		failure="$failure|"
	fi
	failure="$failure ${_func} (${_arg}): (`cat ${_param}`)"
else
	cat >> confdefs.h <<EOF
#define HAVE_PROT_${_ucfunc}_${_arg} ${val}
EOF

fi





#failure
if test "x$failure" != x; then
echo "$ac_t""failure" 1>&6

echo "$failure" | tr '|' '\n'

 failproto=t
else
	echo "$ac_t""ok" 1>&6
fi

rm -f conftest.*

	;;
esac

	if test x$failproto != x; then
	    echo ""
	    echo "error: some unfamiliar function prototypes were found,"
	    echo "       and will probably mean that building of libdsocks,"
	    echo "       which allows on-the-fly socksification of dynamic"
	    echo "       binaries will not work."
	    echo ""
	    echo "       You have several options:"
	    echo ""
	    echo "       1. If you do not need libdsocks, run configure with the"
	    echo "          option --disable-preload."
	    echo "       2. Send the output from configure to dante-bugs@inet.no"
	    echo "          and if possible you'll get a patch fixing the problem."
	    echo "          If you think this might be a generic problem, sending"
	    echo "          the output might allow the problem to be solved for all"
	    echo "          users of your platform in the next release."
	    echo "       3. Fix the problem yourself. If you have autoconf installed,"
	    echo "          using the output above to modify configure.in should"
	    echo "          enable you to compile without problems."
	    exit 1
	fi
    else #non ansi
	#defaults
	cat >> confdefs.h <<\EOF
#define HAVE_PROT_CONNECT_0 int
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_CONNECT_2 const struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_CONNECT_3 socklen_t
EOF


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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_ACCEPT_2 struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_ACCEPT_3 socklen_t *
EOF


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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_BIND_2 const struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_BIND_3 socklen_t
EOF


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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETPEERNAME_2 struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETPEERNAME_3 socklen_t *
EOF


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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETSOCKNAME_2 struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETSOCKNAME_3 socklen_t *
EOF


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVFROM_0 ssize_t
EOF

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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVFROM_3 size_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVFROM_5 struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVFROM_6 socklen_t *
EOF


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SEND_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SEND_2 const void *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SEND_3 size_t
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECV_0 ssize_t
EOF

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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECV_3 size_t
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDTO_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDTO_2 const void *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDTO_3 size_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDTO_5 const struct sockaddr *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDTO_6 socklen_t
EOF


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_READV_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_READV_2 const struct iovec *
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_WRITEV_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_WRITEV_2 const struct iovec *
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVMSG_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_RECVMSG_2 struct msghdr *
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDMSG_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_SENDMSG_2 const struct msghdr *
EOF

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


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_WRITE_0 ssize_t
EOF

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_WRITE_2 const void *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_WRITE_3 size_t
EOF


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_READ_0 ssize_t
EOF

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

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

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_READ_3 size_t
EOF


	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
EOF

	cat >> confdefs.h <<\EOF
#define HAVE_PROT_GETHOSTBYADDR_1 const char *
EOF

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

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

    fi #stdc_headers
fi #no preload

echo $ac_n "checking if getsockopt needs cast""... $ac_c" 1>&6
echo "configure:7295: checking if getsockopt needs cast" >&5
cat > conftest.$ac_ext <<EOF
#line 7297 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/socket.h>
int getsockopt(int, int, int, char *, int *);

int main() {
 1 
; return 0; }
EOF
if { (eval echo configure:7308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define NEED_GETSOCKOPT_CAST 1
EOF

  echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

#include both <sys/ioctl.h> and <sys/sockio.h>?
if test x$have_sys_sockio_h = xt; then
	echo $ac_n "checking to see if <sys/sockio.h> should be included""... $ac_c" 1>&6
echo "configure:7326: checking to see if <sys/sockio.h> should be included" >&5
	cat > conftest.$ac_ext <<EOF
#line 7328 "configure"
#include "confdefs.h"

#include <sys/ioctl.h>
#ifdef SIOCATMARK
#else
#include <sys/sockio.h>
#ifdef SIOCATMARK
yes
#endif
#endif

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

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

fi

#XXX should be more generic, check if nonexistent
echo $ac_n "checking to see if dlopen param has DL_ and not RTLD_ prefix""... $ac_c" 1>&6
echo "configure:7359: checking to see if dlopen param has DL_ and not RTLD_ prefix" >&5
cat > conftest.$ac_ext <<EOF
#line 7361 "configure"
#include "confdefs.h"

#include <dlfcn.h>
#ifdef DL_LAZY
#else
# ifdef RTLD_LAZY
yes
# endif
#endif

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

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


#XXX should be more generic, check if nonexistent
#SV_INTERRUPT, but not SA_RESTART defined?
echo $ac_n "checking to see if SV_INTERRUPT should be used""... $ac_c" 1>&6
echo "configure:7391: checking to see if SV_INTERRUPT should be used" >&5
cat > conftest.$ac_ext <<EOF
#line 7393 "configure"
#include "confdefs.h"

#include <signal.h>
#ifdef SA_RESTART
#else
# ifdef SV_INTERRUPT
yes
# endif
#endif

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

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


#XXXseems to be supported on Solaris2.6, but there might be some
#defines that need to be set (should _XOPEN_SOURCE be defined on all
#platforms?)
echo $ac_n "checking if cmsghdr exists in <sys/socket.h>""... $ac_c" 1>&6
echo "configure:7424: checking if cmsghdr exists in <sys/socket.h>" >&5
case $host in
    *)
	cat > conftest.$ac_ext <<EOF
#line 7428 "configure"
#include "confdefs.h"

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

int main() {
struct cmsghdr foo = {1,1,1};
 struct msghdr bar;
 foo.cmsg_len = 0;
 foo.cmsg_type = SCM_RIGHTS;
 foo.cmsg_level = SOL_SOCKET;
 bar.msg_controllen = 1;

; return 0; }
EOF
if { (eval echo configure:7444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_CMSGHDR 1
EOF

    echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
	;;
esac

echo $ac_n "checking to see if malloc_options exists""... $ac_c" 1>&6
echo "configure:7462: checking to see if malloc_options exists" >&5
cat > conftest.$ac_ext <<EOF
#line 7464 "configure"
#include "confdefs.h"
extern char *malloc_options;
int main() {
 malloc_options = 0; 
; return 0; }
EOF
if { (eval echo configure:7471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_MALLOC_OPTIONS 1
EOF

 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*

echo $ac_n "checking to see if __progname exists""... $ac_c" 1>&6
echo "configure:7487: checking to see if __progname exists" >&5
cat > conftest.$ac_ext <<EOF
#line 7489 "configure"
#include "confdefs.h"
extern char *__progname;
int main() {
 __progname = 0; 
; return 0; }
EOF
if { (eval echo configure:7496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_PROGNAME 1
EOF

 echo "$ac_t""yes" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*


echo $ac_n "checking for library containing crypt""... $ac_c" 1>&6
echo "configure:7513: checking for library containing crypt" >&5
if eval "test \"`echo '$''{'ac_cv_search_crypt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_crypt="no"
cat > conftest.$ac_ext <<EOF
#line 7520 "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 crypt();

int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:7531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_crypt="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_crypt" = "no" && for i in crypt; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 7542 "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 crypt();

int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:7553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_crypt="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_crypt" 1>&6
if test "$ac_cv_search_crypt" != "no"; then
  test "$ac_cv_search_crypt" = "none required" || LIBS="$ac_cv_search_crypt $LIBS"
  
else :
  
fi

#HP-UX 11.00

echo $ac_n "checking for library containing getspnam""... $ac_c" 1>&6
echo "configure:7577: checking for library containing getspnam" >&5
if eval "test \"`echo '$''{'ac_cv_search_getspnam'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_getspnam="no"
cat > conftest.$ac_ext <<EOF
#line 7584 "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 getspnam();

int main() {
getspnam()
; return 0; }
EOF
if { (eval echo configure:7595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_getspnam="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_getspnam" = "no" && for i in sec; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 7606 "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 getspnam();

int main() {
getspnam()
; return 0; }
EOF
if { (eval echo configure:7617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_getspnam="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_getspnam" 1>&6
if test "$ac_cv_search_getspnam" != "no"; then
  test "$ac_cv_search_getspnam" = "none required" || LIBS="$ac_cv_search_getspnam $LIBS"
  
else :
  
fi

echo $ac_n "checking for library containing bindresvport""... $ac_c" 1>&6
echo "configure:7639: checking for library containing bindresvport" >&5
if eval "test \"`echo '$''{'ac_cv_search_bindresvport'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_bindresvport="no"
cat > conftest.$ac_ext <<EOF
#line 7646 "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 bindresvport();

int main() {
bindresvport()
; return 0; }
EOF
if { (eval echo configure:7657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_bindresvport="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_bindresvport" = "no" && for i in rpcsoc; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 7668 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char bindresvport();

int main() {
bindresvport()
; return 0; }
EOF
if { (eval echo configure:7679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_bindresvport="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_bindresvport" 1>&6
if test "$ac_cv_search_bindresvport" != "no"; then
  test "$ac_cv_search_bindresvport" = "none required" || LIBS="$ac_cv_search_bindresvport $LIBS"
  
else :
  
fi #XXX?

#FreeBSD has setproctitle in -lutil (Per Hedeland <per@erix.ericsson.se>)

echo $ac_n "checking for library containing setproctitle""... $ac_c" 1>&6
echo "configure:7703: checking for library containing setproctitle" >&5
if eval "test \"`echo '$''{'ac_cv_search_setproctitle'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_setproctitle="no"
cat > conftest.$ac_ext <<EOF
#line 7710 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char setproctitle();

int main() {
setproctitle()
; return 0; }
EOF
if { (eval echo configure:7721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_setproctitle="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_setproctitle" = "no" && for i in util; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 7732 "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 setproctitle();

int main() {
setproctitle()
; return 0; }
EOF
if { (eval echo configure:7743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_setproctitle="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_setproctitle" 1>&6
if test "$ac_cv_search_setproctitle" != "no"; then
  test "$ac_cv_search_setproctitle" = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS"
  
else :
  
fi

#Look for functions needed for socksify located in other places than libc
SOCKSIFY_PRELOAD_LIBS=""

oLIBS=$LIBS
LIBS=""


echo $ac_n "checking for library containing connect""... $ac_c" 1>&6
echo "configure:7772: checking for library containing connect" >&5
if eval "test \"`echo '$''{'ac_cv_search_connect'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_connect="no"
cat > conftest.$ac_ext <<EOF
#line 7779 "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:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_connect="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_connect" = "no" && for i in socket; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 7801 "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:7812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_connect="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_connect" 1>&6
if test "$ac_cv_search_connect" != "no"; then
  test "$ac_cv_search_connect" = "none required" || LIBS="$ac_cv_search_connect $LIBS"
  
else :
  
fi

NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
LIBS=""

#ignore when preloading is disabled (only the AC_SEARCH_LIBS test is needed)
if test "x$preload_enabled" = "xt" -a "x${ac_cv_search_connect}" = "x-lsocket"; then
	cat >> confdefs.h <<EOF
#define LIBRARY_LIBSOCKET "${base_library_path}libsocket.so"
EOF

	SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libsocket.so"

	cat >> confdefs.h <<\EOF
#define LIBRARY_CONNECT LIBRARY_LIBSOCKET
EOF


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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


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

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

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

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

fi

#doesn't work if test links with -lsocket (Solaris)

echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
echo "configure:8381: checking for library containing inet_addr" >&5
if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_inet_addr="no"
cat > conftest.$ac_ext <<EOF
#line 8388 "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_addr();

int main() {
inet_addr()
; return 0; }
EOF
if { (eval echo configure:8399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_inet_addr="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_inet_addr" = "no" && for i in nsl; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 8410 "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_addr();

int main() {
inet_addr()
; return 0; }
EOF
if { (eval echo configure:8421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_inet_addr="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_inet_addr" 1>&6
if test "$ac_cv_search_inet_addr" != "no"; then
  test "$ac_cv_search_inet_addr" = "none required" || LIBS="$ac_cv_search_inet_addr $LIBS"
  
else :
  
fi

NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
LIBS=""

if test "x$preload_enabled" = "xt" -a "x${ac_cv_search_inet_addr}" = "x-lnsl"; then
	cat >> confdefs.h <<EOF
#define LIBRARY_LIBNSL "${base_library_path}libnsl.so"
EOF


	SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libnsl.so"

	echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:8454: 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 8462 "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:8473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

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

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



	echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
echo "configure:8499: checking for gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyaddr | 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 8507 "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 gethostbyaddr();

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

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

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

fi

#XXX used for anything but gethostbyname2? consider testing for it
# on Solaris (atleast 2.6, gcc)
#linking with -lresolv results in error unless -shared is included
#since gcc insists on linking statically with libresolv for which
#no static version exists

echo $ac_n "checking for library containing inet_aton""... $ac_c" 1>&6
echo "configure:8550: checking for library containing inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_search_inet_aton'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_inet_aton="no"
cat > conftest.$ac_ext <<EOF
#line 8557 "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_aton();

int main() {
inet_aton()
; return 0; }
EOF
if { (eval echo configure:8568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_inet_aton="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_inet_aton" = "no" && for i in resolv; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 8579 "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_aton();

int main() {
inet_aton()
; return 0; }
EOF
if { (eval echo configure:8590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_inet_aton="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_inet_aton" 1>&6
if test "$ac_cv_search_inet_aton" != "no"; then
  test "$ac_cv_search_inet_aton" = "none required" || LIBS="$ac_cv_search_inet_aton $LIBS"
  
else :
  
fi

NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
LIBS=""

if test "x$preload_enabled" = "xt" -a "x${ac_cv_search_inet_aton}" = "x-lresolv"; then
	cat >> confdefs.h <<EOF
#define LIBRARY_LIBRESOLV "${base_library_path}libresolv.so"
EOF


	SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libresolv.so"

	echo $ac_n "checking for gethostbyname2 in -lresolv""... $ac_c" 1>&6
echo "configure:8623: checking for gethostbyname2 in -lresolv" >&5
ac_lib_var=`echo resolv'_'gethostbyname2 | 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  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 8631 "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 gethostbyname2();

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

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

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

fi

#XXX gcc on Solaris (using gnu ld) doesn't seems to implicitly link
#with libdl in this test, which means that libdl will not be included
#in socksify.

if test "x$preload_enabled" = "xt"; then
    
echo $ac_n "checking for library containing dlopen""... $ac_c" 1>&6
echo "configure:8674: checking for library containing dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_search_dlopen'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_dlopen="no"
cat > conftest.$ac_ext <<EOF
#line 8681 "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 dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:8692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_dlopen="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_dlopen" = "no" && for i in dl; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 8703 "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 dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:8714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_dlopen="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_dlopen" 1>&6
if test "$ac_cv_search_dlopen" != "no"; then
  test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
  
else :
  
fi

    NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
    LIBS=""
    if test "x${ac_cv_search_dlopen}" = "x-ldl"; then
	    case $host in
		*-*-sunos4*) #XXX attempt to get libdl name
		    libdl=`ls ${base_library_path}libdl.so* | sed -e 's/.*\///' | sort -nr | head -1`
		    if test x$libdl = x; then
			echo "configure: warning: unable to locate libdl" 1>&2
		    else
			LIBRARY_DLOPEN=${base_library_path}${libdl}
			echo "configure: warning: hardcoding libdl to $LIBRARY_DLOPEN" 1>&2
		    fi
		;;
		*)
		    LIBRARY_DLOPEN="${base_library_path}libdl.so"
		;;
	    esac
	    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${LIBRARY_DLOPEN:+${PRELOAD_SEPERATOR}}${LIBRARY_DLOPEN}"
    fi
fi
LIBS="$oLIBS $NLIBS"



#specify location of the socks library in socksify too
#NOTE: exec_prefix and prefix have the value NONE here if they are unset
o_exec_prefix=${exec_prefix}
o_prefix=${prefix}
if test x${prefix} = xNONE; then
	prefix=$ac_default_prefix
fi
if test x${exec_prefix} = xNONE; then
	exec_prefix=$prefix
fi
LIBRARY_PREFIX=`eval echo \$libdir`
LIBRARY_PREFIX=`eval echo \$LIBRARY_PREFIX`
exec_prefix=${o_exec_prefix}
prefix=${o_prefix}


#allow user to specify libc name, use default value otherwise
echo $ac_n "checking for libc name""... $ac_c" 1>&6
echo "configure:8777: checking for libc name" >&5
# Check whether --with-libc or --without-libc was given.
if test "${with_libc+set}" = set; then
  withval="$with_libc"
  LIBC_NAME=$withval
fi


#set default?
if test "x${LIBC_NAME}" = x; then
	case $host in
		*-*-linux-*)
		#XXX attempt to find latest c library
		#can't set it to libc.so directly, might be ld script
		LIBC_NAME=`ls /usr/lib/libc.so* /lib/libc.so* | sed -e 's/.*\///' | sort -nr | head -1`
		if test "x${LIBC_NAME}" = x; then
			#nothing found, set libc.so anyway
			LIBC_NAME="${base_library_path}libc.so"
		fi
	;;
	*)
		LIBC_NAME="${base_library_path}libc.so"
	;;
	esac
fi

echo "$ac_t""${LIBC_NAME}" 1>&6
cat >> confdefs.h <<EOF
#define LIBRARY_LIBC "${LIBC_NAME}"
EOF


if test "x${ac_cv_header_tcpd_h}" = "xyes"; then
    case $host in
	*-*-linux-*)
	    #XXX needed on atleast redhat
	    
echo $ac_n "checking for library containing yp_get_default_domain""... $ac_c" 1>&6
echo "configure:8815: checking for library containing yp_get_default_domain" >&5
if eval "test \"`echo '$''{'ac_cv_search_yp_get_default_domain'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_yp_get_default_domain="no"
cat > conftest.$ac_ext <<EOF
#line 8822 "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 yp_get_default_domain();

int main() {
yp_get_default_domain()
; return 0; }
EOF
if { (eval echo configure:8833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_yp_get_default_domain="none required"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
test "$ac_cv_search_yp_get_default_domain" = "no" && for i in nsl; do
LIBS="-l$i  $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
#line 8844 "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 yp_get_default_domain();

int main() {
yp_get_default_domain()
; return 0; }
EOF
if { (eval echo configure:8855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_yp_get_default_domain="-l$i"
break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
done
LIBS="$ac_func_search_save_LIBS"
fi

echo "$ac_t""$ac_cv_search_yp_get_default_domain" 1>&6
if test "$ac_cv_search_yp_get_default_domain" != "no"; then
  test "$ac_cv_search_yp_get_default_domain" = "none required" || LIBS="$ac_cv_search_yp_get_default_domain $LIBS"
  
else :
  
fi 
	;;
    esac
    oLIBS=$LIBS
    echo $ac_n "checking for libwrap""... $ac_c" 1>&6
echo "configure:8879: checking for libwrap" >&5
    if test x$no_libwrap = xt; then
	echo "disabled"
    else
	LIBS="$LIBS -lwrap"
	cat > conftest.$ac_ext <<EOF
#line 8885 "configure"
#include "confdefs.h"

int allow_severity;
int deny_severity;

int main() {
hosts_access(0);
; return 0; }
EOF
if { (eval echo configure:8895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_LIBWRAP 1
EOF

  want_libwrap=t
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
    LIBS="$oLIBS"
fi
#programs wanting libwrap should test for this Makefile.am conditional
#(programs which don't use it probably won't enjoy being linked with it)


if test "x${want_libwrap}" != "x"; then
  WANT_LIBWRAP_TRUE=
  WANT_LIBWRAP_FALSE='#'
else
  WANT_LIBWRAP_TRUE='#'
  WANT_LIBWRAP_FALSE=
fi

#XXX should be more generic
case $host in
	*-*-freebsd1.* | *-*-freebsd2.*)
		#a.out (XXX 3.x also elf; "Jacques A . Vidrine" <n@nectar.com>)
	;;
	*-*-freebsd* | *-*-solaris* | *-*-linux-* | *-*-irix* | \
	alpha-dec-osf* | *-*-aix4* | *-*-bsdi*)
		cat >> confdefs.h <<\EOF
#define HAVE_NO_SYMBOL_UNDERSCORE 1
EOF

	;;
esac

#try to detect gcc bug (irix 64 problem, affects among others inet_ntoa)
echo $ac_n "checking for incorrect inet_ntoa behaviour""... $ac_c" 1>&6
echo "configure:8941: checking for incorrect inet_ntoa behaviour" >&5
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 8946 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
int main(void)
{
  struct sockaddr_in addr;
  char *a, *b = "195.195.195.195";
  addr.sin_addr.s_addr = inet_addr(b);
  a = inet_ntoa(addr.sin_addr);
  if (strcmp(a, b) == 0)
    return 1;
  else
    return 0;

}

EOF
if { (eval echo configure:8967: \"$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_BROKEN_INET_NTOA 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


echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
echo "configure:8985: 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 8990 "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


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

#include <sys/types.h>
#include <netinet/in.h>

int main() {

    in_port_t foo = 42;

; return 0; }
EOF
if { (eval echo configure:9031: \"$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*
  echo $ac_n "checking for in_port_t""... $ac_c" 1>&6
echo "configure:9038: checking for in_port_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_in_port_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9043 "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_port_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_in_port_t=yes
else
  rm -rf conftest*
  ac_cv_type_in_port_t=no
fi
rm -f conftest*

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

fi

fi
rm -f conftest*

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

#include <sys/types.h>
#include <netinet/in.h>

int main() {

    in_addr_t foo = 42;

; return 0; }
EOF
if { (eval echo configure:9086: \"$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*
  echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
echo "configure:9093: 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 9098 "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 ubits_32
EOF

fi

fi
rm -f conftest*

#Linux (redhat 5.2) defines socklen_t in <socketbits.h>, which is
#included by <sys/socket.h>.  check for this first.
echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
echo "configure:9131: checking for socklen_t" >&5
cat > conftest.$ac_ext <<EOF
#line 9133 "configure"
#include "confdefs.h"

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

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

if test x"$socklen_found" = x; then
    case $host in
	alpha-dec-osf* | *-*-aix*)
		cat >> confdefs.h <<\EOF
#define socklen_t size_t
EOF

		;;
	*)
		cat >> confdefs.h <<\EOF
#define socklen_t int
EOF

		;;
    esac
fi

#sig_atomic_t
echo $ac_n "checking for sig_atomic_t in <signal.h>""... $ac_c" 1>&6
echo "configure:9175: checking for sig_atomic_t in <signal.h>" >&5
cat > conftest.$ac_ext <<EOF
#line 9177 "configure"
#include "confdefs.h"

#include <signal.h>

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

    case $host in
	*-*-aix*)
		cat >> confdefs.h <<\EOF
#define HAVE_VOLATILE_SIG_ATOMIC_T 1
EOF

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


echo $ac_n "checking for int32_t""... $ac_c" 1>&6
echo "configure:9207: checking for int32_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9212 "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])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_int32_t=yes
else
  rm -rf conftest*
  ac_cv_type_int32_t=no
fi
rm -f conftest*

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

fi

echo $ac_n "checking for int16_t""... $ac_c" 1>&6
echo "configure:9240: checking for int16_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 9245 "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])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_int16_t=yes
else
  rm -rf conftest*
  ac_cv_type_int16_t=no
fi
rm -f conftest*

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

fi


if test $ac_cv_prog_gcc = yes; then
    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:9275: 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 9281 "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 9299 "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 for 8-bit clean memcmp""... $ac_c" 1>&6
echo "configure:9321: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_func_memcmp_clean=no
else
  cat > conftest.$ac_ext <<EOF
#line 9329 "configure"
#include "confdefs.h"

main()
{
  char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
}

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

fi

echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"

echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
echo "configure:9357: 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 9365 "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:9379: \"$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

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

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_strftime) || defined (__stub___strftime)
choke me
#else
strftime();
#endif

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

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

else
  echo "$ac_t""no" 1>&6
# strftime is in -lintl on SCO UNIX.
echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
echo "configure:9494: checking for strftime in -lintl" >&5
ac_lib_var=`echo intl'_'strftime | 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="-lintl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 9502 "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 strftime();

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

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

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

fi

echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6
echo "configure:9540: checking whether utime accepts a null argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata; > conftestdata
# Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
if test "$cross_compiling" = yes; then
  ac_cv_func_utime_null=no
else
  cat > conftest.$ac_ext <<EOF
#line 9550 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
main() {
struct stat s, t;
exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}
EOF
if { (eval echo configure:9561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_func_utime_null=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_func_utime_null=no
fi
rm -fr conftest*
fi

rm -f core core.* *.core
fi

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

fi

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

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_vprintf) || defined (__stub___vprintf)
choke me
#else
vprintf();
#endif

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

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

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

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

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__doprnt) || defined (__stub____doprnt)
choke me
#else
_doprnt();
#endif

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

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

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

fi

for ac_func in select socket strcspn strdup strspn hstrerror issetugid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9692: 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 9697 "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:9720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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

for ac_func in strvis vsnprintf getdtablesize sysconf inet_pton vsyslog
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9747: 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 9752 "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:9775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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

for ac_func in daemon bzero sockatmark difftime memmove seteuid setproctitle
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9802: 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 9807 "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:9830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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

for ac_func in inet_aton gethostbyname2 getprpwnam getspnam
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9857: 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 9862 "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:9885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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


echo $ac_n "checking for system V getpwnam""... $ac_c" 1>&6
echo "configure:9911: checking for system V getpwnam" >&5
unset getpwnam_alt
if test x"${ac_cv_func_getprpwnam}" = xyes; then
    getpwnam_alt=t
fi

if test x"${ac_cv_func_getspnam}" = xyes; then
    getpwnam_alt=t
fi

#XXX
if test x"${getpwnam_alt}" = x; then
    cat >> confdefs.h <<\EOF
#define HAVE_WORKING_GETPWNAM 1
EOF

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

#sun4 seems to have a profiled libc missing strerror
if test x$s_profiling = x; then
	for ac_func in strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9937: 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 9942 "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:9965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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

else
	case $host in

		*-*-sunos4*)
			echo "configure: warning: omitting strerror test on sunos4 with profiling enabled" 1>&2
		;;

		*)
			for ac_func in strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:10000: 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 10005 "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:10028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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

		;;
	esac
fi

#add any warning flags (value set above)
CFLAGS="$CFLAGS $warn"

if test "x${prerelease}" != "x"; then
    echo "warning flags: $warn"
    echo "compiler flags: $comp_flags"
    echo "CFLAGS: $CFLAGS"
    echo "CPPFLAGS: $CPPFLAGS"
fi

#XXXslow














#The dlib directory is for building a shared library with preloading
#support (SOCKSLIBRARY_DYNAMIC is defined), when dlopen support is
#available and requested.





































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"
    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 "sockd/Makefile include/Makefile lib/Makefile dlib/Makefile \
	   Makefile example/Makefile doc/Makefile bin/Makefile \
	   SPECS/Makefile SPECS/dante.spec bin/socksify \
	   libscompat/Makefile VERSION include/autoconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
s%@AUTOCONF@%$AUTOCONF%g
s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@SET_MAKE@%$SET_MAKE%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%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@LD@%$LD%g
s%@NM@%$NM%g
s%@LN_S@%$LN_S%g
s%@LIBTOOL@%$LIBTOOL%g
s%@CPP@%$CPP%g
s%@PRERELEASE_TRUE@%$PRERELEASE_TRUE%g
s%@PRERELEASE_FALSE@%$PRERELEASE_FALSE%g
s%@PRELOAD_SEPERATOR@%$PRELOAD_SEPERATOR%g
s%@PRELOAD_VARIABLE@%$PRELOAD_VARIABLE%g
s%@PRELOAD_POSTFIX@%$PRELOAD_POSTFIX%g
s%@SPROFIL_TRUE@%$SPROFIL_TRUE%g
s%@SPROFIL_FALSE@%$SPROFIL_FALSE%g
s%@STATIC_SOCKD_TRUE@%$STATIC_SOCKD_TRUE%g
s%@STATIC_SOCKD_FALSE@%$STATIC_SOCKD_FALSE%g
s%@LINT_TRUE@%$LINT_TRUE%g
s%@LINT_FALSE@%$LINT_FALSE%g
s%@YACC@%$YACC%g
s%@AWK@%$AWK%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
s%@SERVER_INTERPOSITION_TRUE@%$SERVER_INTERPOSITION_TRUE%g
s%@SERVER_INTERPOSITION_FALSE@%$SERVER_INTERPOSITION_FALSE%g
s%@SERVER_INTERPOSITION_ALWAYS_TRUE@%$SERVER_INTERPOSITION_ALWAYS_TRUE%g
s%@SERVER_INTERPOSITION_ALWAYS_FALSE@%$SERVER_INTERPOSITION_ALWAYS_FALSE%g
s%@BUILD_PRELOAD_LIB_TRUE@%$BUILD_PRELOAD_LIB_TRUE%g
s%@BUILD_PRELOAD_LIB_FALSE@%$BUILD_PRELOAD_LIB_FALSE%g
s%@SOCKSIFY_PRELOAD_LIBS@%$SOCKSIFY_PRELOAD_LIBS%g
s%@LIBRARY_PREFIX@%$LIBRARY_PREFIX%g
s%@WANT_LIBWRAP_TRUE@%$WANT_LIBWRAP_TRUE%g
s%@WANT_LIBWRAP_FALSE@%$WANT_LIBWRAP_FALSE%g
s%@LIBOBJS@%$LIBOBJS%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-"sockd/Makefile include/Makefile lib/Makefile dlib/Makefile \
	   Makefile example/Makefile doc/Makefile bin/Makefile \
	   SPECS/Makefile SPECS/dante.spec bin/socksify \
	   libscompat/Makefile VERSION"}
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"
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
ac_sources="lib/config.c lib/config_parse.y lib/config_scan.l lib/io.c lib/log.c lib/protocol.c lib/socket.c lib/util.c lib/udp_util.c lib/debug.c lib/hostcache.c lib/serr.c lib/broken.c lib/Raccept.c lib/Rbind.c lib/Rbindresvport.c lib/Rconnect.c lib/Rgethostbyname.c lib/Rgetpeername.c lib/Rgetsockname.c lib/Rrresvport.c lib/Rcompat.c lib/address.c lib/authneg.c lib/client.c lib/clientconfig.c lib/clientprotocol.c lib/msproxy_clientprotocol.c lib/config.c lib/config_parse.y lib/config_scan.l lib/debug.c lib/io.c lib/log.c lib/method_uname.c lib/protocol.c lib/socket.c lib/connectchild.c lib/udp.c lib/udp_util.c lib/userio.c lib/util.c lib/broken.c lib/hostcache.c lib/serr.c lib/httpproxy.c dlib/interposition.c"
ac_dests="sockd/config.c sockd/config_parse.y sockd/config_scan.l sockd/io.c sockd/log.c sockd/lib_protocol.c sockd/socket.c sockd/util.c sockd/udp_util.c sockd/debug.c sockd/hostcache.c sockd/serr.c sockd/broken.c dlib/Raccept.c dlib/Rbind.c dlib/Rbindresvport.c dlib/Rconnect.c dlib/Rgethostbyname.c dlib/Rgetpeername.c dlib/Rgetsockname.c dlib/Rrresvport.c dlib/Rcompat.c dlib/address.c dlib/authneg.c dlib/client.c dlib/clientconfig.c dlib/clientprotocol.c dlib/msproxy_clientprotocol.c dlib/config.c dlib/config_parse.y dlib/config_scan.l dlib/debug.c dlib/io.c dlib/log.c dlib/method_uname.c dlib/protocol.c dlib/socket.c dlib/connectchild.c dlib/udp.c dlib/udp_util.c dlib/userio.c dlib/util.c dlib/broken.c dlib/hostcache.c dlib/serr.c dlib/httpproxy.c sockd/interposition.c"
EOF

cat >> $CONFIG_STATUS <<\EOF
srcdir=$ac_given_srcdir
while test -n "$ac_sources"; do
  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
  set $ac_sources; ac_source=$1; shift; ac_sources=$*

  echo "linking $srcdir/$ac_source to $ac_dest"

  if test ! -r $srcdir/$ac_source; then
    { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
  fi
  rm -f $ac_dest

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

  case "$srcdir" in
  [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
  *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
  esac

  # Make a symlink if possible; otherwise try a hard link.
  if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
    ln $srcdir/$ac_source $ac_dest; then :
  else
    { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
  fi
done
EOF
cat >> $CONFIG_STATUS <<EOF


EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > include/stamp-h

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

