#! /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_default_prefix=/var/dcc
ac_help="$ac_help  --with-installroot=DIR prefix DIR to installation directories
"
ac_help="$ac_help  --with-DCC-MD5	use MD5 code in the DCC source
"
ac_help="$ac_help  --disable-sys-inst	install in private directories
"
ac_help="$ac_help  --with-uid=UID	set-UID user name for cdcc, dccproc, and dccsight
"
ac_help="$ac_help  --disable-server	do not build DCC server, dccd
"
ac_help="$ac_help  --disable-dccifd	do not build DCC program interface, dccifd
"
ac_help="$ac_help  --disable-dccm	do not build DCC sendmail interface, dccm
"
ac_help="$ac_help  --with-sendmail=DIR	build dccm with sendmail milter interface in dir
"
ac_help="$ac_help  --with-cgibin=DIR	directory for DCC white list CGI scripts
"
ac_help="$ac_help  --with-rundir=DIR	for PID files and milter socket
"
ac_help="$ac_help  --with-db-memory=MB	server database buffer size 32 to 4096 MByte [32]
"
ac_help="$ac_help  --with-max-db-mem=MB	maximum server database buffer size [3072]
"
ac_help="$ac_help  --with-max-log-size=KB max dccm & dccifd log size; 0=no limit [32]
"
ac_help="$ac_help  --with-bad-locks	work around broken NFS fcntl() locking
"
ac_help="$ac_help  --disable-IPv6	no IPv6 support
"
ac_help="$ac_help  --with-kludge=FILE	include header FILE
"
ac_help="$ac_help  --with-socks[=lib]	build DCC clients with SOCKS support
"

# 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=
sitefile=
srcdir=
target=NONE
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
libexecdir='${exec_prefix}/libexec'
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" ;;

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

  -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'" ;;

  -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]
Options: [defaults in brackets after descriptions]
Configuration:
  --help		print this message
  --no-create		do not create output files
  --quiet		do not print \`checking...' messages
  --homedir=HOMEDIR	DCC home directory [/var/dcc]
  --bindir=DIR		user executables [/usr/local/bin]
  --libexecdir=DIR	program executables [HOMEDIR/libexec]
  --mandir=DIR		documentation [/usr/local/man]
EOF
    if test -n "$ac_help"; then
      echo "$ac_help"
    fi
    exit 0 ;;

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

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

  -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 ;;

  --homedir | -homedir | --home | -home)
    ac_prev=prefix ;;
  --homedir=* | -homedir=* | --home=* | -home=*)
    prefix="$ac_optarg" ;;

  -prefix | --prefix | -prefix=* | --prefix=*)
    { echo "configure: error: --prefix is not what you think it is.  
    Use --homedir, --bindir, --libexecdir, --mandir, --with-installroot,
    and perhaps --disable-sys-inst" 1>&2; exit 1; }    ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=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=dccproc/dccproc.c

# 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 "$sitefile"; then
  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
else
  CONFIG_SITE="$sitefile"
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

# pay no attention to old autoconf cache files in case the target system
# has been upgraded
if test -f "$cache_file"; then
    old_cache_file=`find "$cache_file" -mtime +1 -type f -size +1c`
    if test "$cache_file" = "$old_cache_file"; then
       echo "ignore old cache $cache_file"
       rm $cache_file
    fi
    if grep '^ac_cv_DCC_VERSION.*1.2.74' $cache_file 2>&1 1>/dev/null; then : ;
    else
       echo "ignore stray cache $cache_file"
       rm -f $cache_file
    fi
fi
ac_cv_DCC_VERSION=1.2.74
if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

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

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



ac_aux_dir=
for ac_dir in autoconf $srcdir/autoconf; 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 autoconf $srcdir/autoconf" 1>&2; exit 1; }
fi
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.


RCS_REVISION="`echo 'Rhyolite Software DCC 1.2.74-1.116' | sed -e 's/-[.0-9]*//'`"
echo "$ac_t"""$RCS_REVISION"" 1>&6


TARGET_SYS="`uname`"


# How were we started?
#   Mangle $ac_configure_args to prevent duplicates from updatedcc -cwhatever
DCC_PARMS='
DCC_PARM_CACHE	    DCC_PARM_HOMEDIR	DCC_PARM_BINDIR
DCC_PARM_LIBEXECDIR DCC_PARM_MANDIR	DCC_PARM_MD5
DCC_PARM_SYS_INST   DCC_PARM_UID	DCC_PARM_SERVER
DCC_PARM_DCCIFD	    DCC_PARM_DCCM	DCC_PARM_SENDMAIL
DCC_PARM_CGIBIN	    DCC_PARM_RUNDIR	DCC_PARM_DB_MEMORY
DCC_PARM_MAX_DB_MEM DCC_PARM_MAX_LOG    DCC_PARM_BAD_LOCKS
DCC_PARM_IPV6	    DCC_PARM_KLUDGE	DCC_PARM_SOCKS
DCC_PARM_UDP_CONNECT DCC_PARM_MX_DNSBL'
for var in $DCC_PARMS; do
    eval $var=
done
var=
for c in $ac_configure_args; do
    if test -z "$var"; then
	var="$c"
	case $var in
	-[a-z]*) var="-$var";;
	esac
    else
	var="$var=$c"
    fi

    case $var in
    # allow blank instead of '='
    --homedir|--home|--prefix|--bindir|--libexecdir|--mandir)
			continue;;

    # allow these but do not record them in updatedcc
    --with-installroot*) continue;;

    # remember these for updatedcc
    --cache-file=*)	DCC_PARM_CACHE=" $var";;
    --homedir=*|--home=*|--prefix=*)
		DCC_PARM_HOMEDIR=" --homedir=`expr X$var : '.*=\(.*\)'`";;
    --quiet|--silent|--no-create)	;;
    --bindir=*)		DCC_PARM_BINDIR=" $var";;
    --libexecdir=*)	DCC_PARM_LIBEXECDIR=" $var";;
    --mandir=*)		DCC_PARM_MANDIR=" $var";;
    --with-DCC-MD5)	DCC_PARM_MD5=" $var";;
    --without-DCC-MD5)	DCC_PARM_MD5=;;
    --disable-sys-inst)	DCC_PARM_SYS_INST=" $var";;
    --enable-sys-inst)	DCC_PARM_SYS_INST=;;
    --with-uid=*)	DCC_PARM_UID=" $var";;
    --withuid-uid)	DCC_PARM_UID=;;
    --disable-server)	DCC_PARM_SERVER=" $var";;
    --enable-server)	DCC_PARM_SERVER=;;
    --disable-dccifd)	DCC_PARM_DCCIFD=" $var";;
    --enable-dccifd)	DCC_PARM_DCCIFD=;;
    --disable-dccm)	DCC_PARM_DCCM=" $var";;
    --enable-dccm)	DCC_PARM_DCCM=;;
    --with*-sendmail*)	DCC_PARM_SENDMAIL=" $var";;
    --with-cgibin=*)	DCC_PARM_CGIBIN=" $var";;
    --without-cgibin)	DCC_PARM_CGIBIN=;;
    --with-rundir=*)	DCC_PARM_RUNDIR=" $var";;
    --without-rundir)	DCC_PARM_RUNDIR=;;
    --enable-big-db)	;; # obsolete with 1.2.31
    --with-db-memory=*)	DCC_PARM_DB_MEMORY=" $var";;
    --without-db-memory) DCC_PARM_DB_MEMORY=;;
    --with-max-db-mem=*) DCC_PARM_MAX_DB_MEM=" $var";;
    --without-max-db-mem) DCC_PARM_MAX_DB_MEM=;;
    --with-max-log-size=*) DCC_PARM_MAX_LOG=" $var";;
    --without-max-log-size) DCC_PARM_MAX_LOG=;;
    --with-bad-locks)	DCC_PARM_BAD_LOCKS=" $var";;
    --without-bad-locks) DCC_PARM_BAD_LOCKS=;;
    --*able-IPv6)	DCC_PARM_IPV6=" $var";;
    --with*-socks*)	DCC_PARM_SOCKS=" $var";;
    --without-socks)	DCC_PARM_SOCKS=;;
    --with-kludge=*)	DCC_PARM_KLUDGE=" $var";;
    --without-kludge)	DCC_PARM_KLUDGE=;;
    --enable-connect)	DCC_PARM_UDP_CONNECT=;;
    --disable-connect)	DCC_PARM_UDP_CONNECT=" $var";;
    --enable-mx-dnsbl)	DCC_PARM_MX_DNL=;;
    --disable-mx-dnsbl)	DCC_PARM_MX_DNL=" $var";;
    *)			echo "unofficial configure parameter: $var";;
    esac
    var=
done
eval UPDATEDCC_PARMS=\"`echo $DCC_PARMS | sed -e 's/ *DCC_PARM/$DCC_PARM/g'`\"

# We cannot
#	- use `env -` because that clears $PATH.
#	- just set variables because CC= breaks the C compiler on Solaris.
#	- just unset variables, because unsetting a variable that is not
#	    set generates errors in some versions of sh or bash..
#	- export unset variables because that sets them to null on NetBSD.
# This assumes that a null value any dcc ./configure environment variable
#   is the same as not setting it.  That is mostly true.  Exceptions include
#   NOMAN.
UPDATEDCC_ENV='NOMAN DCC_SUID DCC_OWN DCC_GRP DCC_MODE MANOWN MANGRP CFLAGS DCC_CFLAGS PTHREAD_CFLAGS LDFLAGS DCC_LDFLAGS PTHREAD_LDFLAGS LIBS PTHREAD_LIBS CC INSTALL DCCD_MAX_FLOODS DBGFLAGS'
UPDATEDCC_ENV_SET=
UPDATEDCC_ENV_UNSET=
UPDATEDCC_ENV_EXPORT=
for var in `echo $UPDATEDCC_ENV`; do
    if test "$var" = '#'; then
	continue
    fi
    val=`eval echo '$'$var | sed -e 's/\([^-_/:=+,.a-zA-Z0-9]\)/\\\\\1/g'`
    if test -z "$val"; then
	UPDATEDCC_ENV_UNSET="$UPDATEDCC_ENV_UNSET $var"
    else
	UPDATEDCC_ENV_SET="$UPDATEDCC_ENV_SET$var=$val "
	UPDATEDCC_ENV_EXPORT="$UPDATEDCC_ENV_EXPORT $var"
    fi
done
if test ! -z "$UPDATEDCC_ENV_UNSET"; then
    UPDATEDCC_ENV_UNSET="unset$UPDATEDCC_ENV_UNSET"
fi
if test ! -z "$UPDATEDCC_ENV_EXPORT"; then
    UPDATEDCC_ENV_EXPORT="export$UPDATEDCC_ENV_EXPORT"
fi

# Check whether --with-installroot or --without-installroot was given.
if test "${with_installroot+set}" = set; then
  withval="$with_installroot"
  :
fi
if test ! -z "$with_installroot" -a "$with_installroot" != no; then
   installroot=$with_installroot
   fi

# Look for the C compiler only if it is not the obvious because the
# autoconf system likes to prefer gcc if gcc is present even if cc
# is also present and is not gcc.
DCC_CC="#CC="
if test "$TARGET_SYS" = SunOS -a -z "$CC"; then
    # detect the free, non-compilers shipped by Sun
    CC_INST="`${CC-cc} -v 2>&1 | head -1`"
    if expr X"$CC_INST" : '.*package not installed.*' >/dev/null; then
	echo "$ac_t""$CC_INST; setting CC=gcc" 1>&6
	CC=gcc
	DCC_CC="CC=gcc"
    fi
fi
# the cache conflicts with users alternating `CC=gcc ./configure`
#	with `./configure`
unset ac_cv_prog_CC
OLD_CC="$CC"
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:569: 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="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_CC" && ac_cv_prog_CC=""""
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
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:599: 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:629: 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:680: 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:712: 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 723 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:728: \"$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:754: 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:759: 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:768: \"$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:787: 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
 if test "$OLD_CC" != "$CC" -a -n "$OLD_CC"; then
    echo "$ac_t""	*** Setting CC=$CC instead of $OLD_CC ***" 1>&6
    DCC_CC="CC=$CC"
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:822: 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 837 "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:843: \"$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 854 "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:860: \"$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 871 "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:877: \"$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


# how do we run the C compiler?
HAVE_CC_M='#do not have cc -M'
LIBS="$LIBS -lm"
RANLIB="ranlib"
case "$TARGET_SYS" in
    BSD/OS)
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	;;
    FreeBSD)
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	PTHREAD_LIBS="$PTHREAD_LIBS -lc_r"
	;;
    DragonFly)
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	PTHREAD_LIBS="$PTHREAD_LIBS -lc_r"
	;;
    Darwin)
	PTHREAD_CFLAGS=
	PTHREAD_LIBS=
	RANLIB="ranlib -c"
	LIBS="$LIBS -lresolv"
	;;
    SunOS)
	DCC_CFLAGS="-D_REENTRANT $DCC_CFLAGS"
	PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
	LIBS="$LIBS -lsocket -lnsl -lresolv"
	;;
    HP-UX)
	PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
	;;
    AIX)
	echo $ac_n "checking for AIX""... $ac_c" 1>&6
echo "configure:934: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
#line 936 "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*

 	DCC_CFLAGS="-D_THREAD_SAFE $DCC_CFLAGS"
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	PTHREAD_LIBS="$PTHREAD_LIBS -lpthreads"
	LIBS="$LIBS -lbsd -lc_r"
	;;
    IRIX*)
	PTHREAD_LIBS="$PTHREAD_LIBS -lpthread"
	DCC_CFLAGS="-woff 1185 $DCC_CFLAGS"
	CFLAGS="-woff 1185 $CFLAGS"
	DCC_LDFLAGS="-LD_MSG:OFF=84 $DCC_LDFLAGS"
	RANLIB="@#ranlib"
	HAVE_CC_M='HAVE_CC_M=yes'
	;;
    Linux|OpenBSD)
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	;;
    NetBSD)
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -lpthread"
	PTHREAD_CFLAGS="$PTHREAD_CFLAGS -I/usr/pkg/include"
	CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -L/usr/pkg/lib"
	;;
    OSF1)
	# OSF1 is too messy for AC_CHECK_FUNC(pthread_mutex_lock...)
	have_pthreads=yes
	PTHREAD_CFLAGS="$PTHREAD_CFLAGS -pthread -D_REENTRANT"
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	PTHREAD_LIBS="$PTHREAD_LIBS -lpthread -lexc"
	HAVE_CC_M='HAVE_CC_M=yes'
	;;
    OpenUNIX)
	DCC_CFLAGS="-Kthread $DCC_CFLAGS"
	PTHREAD_LIBS="$PTHREAD_LIBS -Kthread"
	LIBS="$LIBS -lsocket -lnsl"
	RANLIB="@#ranlib"
	;;
    *)
	echo "$ac_t""	*** unrecognized system $TARGET_SYS ***" 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:997: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

	if test "$RANLIB" = ':'; then
	    RANLIB="@#ranlib"
	fi
	PTHREAD_LDFLAGS="$PTHREAD_LDFLAGS -pthread"
	;;
esac
if test "$have_pthreads" != yes; then
    OLD_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    OLD_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS"
    OLD_LIBS="$LIBS"
    LIBS="$LIBS $PTHREAD_LIBS"
    echo $ac_n "checking for pthread_mutex_lock""... $ac_c" 1>&6
echo "configure:1038: checking for pthread_mutex_lock" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_mutex_lock'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 1043 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char pthread_mutex_lock(); 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 pthread_mutex_lock();

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_pthread_mutex_lock) || defined (__stub___pthread_mutex_lock)
choke me
#else
pthread_mutex_lock();
#endif

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

if eval "test \"`echo '$ac_cv_func_'pthread_mutex_lock`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  have_pthreads=yes
else
  echo "$ac_t""no" 1>&6
fi
    CFLAGS="$OLD_CFLAGS"
    LDFLAGS="$OLD_LDFLAGS"
    LIBS="$OLD_LIBS"
fi
cat > conftest.$ac_ext <<EOF
#line 1089 "configure"
#include "confdefs.h"
#include <sys/mman.h>
MS_ASYNC
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "^MS_ASYNC$" >/dev/null 2>&1; then
  rm -rf conftest*
  cat >> confdefs.h <<\EOF
#define HAVE_OLD_MSYNC 
EOF

fi
rm -f conftest*

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

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

echo "$ac_t""$ac_cv_have_gcc_attributes" 1>&6
if test "$ac_cv_have_gcc_attributes" = yes; then
    CWARN="CWARN"
    HAVE_CC_M='HAVE_CC_M=yes'
    cat >> confdefs.h <<\EOF
#define HAVE_GCC_ATTRIBUTES 1
EOF
    cat >> confdefs.h <<\EOF
#define HAVE_GCC_INLINE 1
EOF
else
    CWARN="#CWARN"
fi


# does this system have 64 bit longs?
echo $ac_n "checking sizeof(long)""... $ac_c" 1>&6
echo "configure:1146: checking sizeof(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
  ac_cv_sizeof_long=4
else
  cat > conftest.$ac_ext <<EOF
#line 1154 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:1167: \"$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=4
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_sizeof_long" 1>&6
if test 0$ac_cv_sizeof_long -eq 8; then
    cat >> confdefs.h <<\EOF
#define HAVE_64BIT_LONG 1
EOF
fi

# does this system have 64 bit file offsets?
echo $ac_n "checking sizeof(off_t)""... $ac_c" 1>&6
echo "configure:1190: checking sizeof(off_t)" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_off_t=4
else
  cat > conftest.$ac_ext <<EOF
#line 1198 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(off_t));
  exit(0);
}
EOF
if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_off_t=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_off_t=4
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_sizeof_off_t" 1>&6
if test 0$ac_cv_sizeof_off_t -eq 8; then
    cat >> confdefs.h <<\EOF
#define HAVE_BIG_FILES 1
EOF
fi

# use va_copy()?
echo $ac_n "checking for va_copy()""... $ac_c" 1>&6
echo "configure:1234: checking for va_copy()" >&5
if eval "test \"`echo '$''{'ac_cv_use_va_copy'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_use_va_copy=no
else
  cat > conftest.$ac_ext <<EOF
#line 1242 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
FILE *f;
static void vtest(const char *p, va_list args)
{
  va_list args2;
  va_copy(args2, args);
  vfprintf(f, p, args2);
  va_end(args2);
}
static void test(const char *p,...)
{
  va_list args;
  va_start(args, p);
  vtest(p, args);
  va_end(args);
}
main()
{
  f=fopen("conftestval", "w");
  if (!f) exit(1);
  test("%s", "yes");
  exit(0);
}
EOF
if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_use_va_copy=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_use_va_copy=no
fi
rm -fr conftest*
fi

fi

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


# set switches to generate the meat of a makefile
echo $ac_n "checking for gmake""... $ac_c" 1>&6
echo "configure:1295: checking for gmake" >&5
if make -v nosuchtarget 2>&1 | grep '^GNU Make' >/dev/null; then
    # make is gmake but called make
    MAKE_TYPE=gmake
    DCCMAKE=make
    echo "$ac_t""yes" 1>&6
else
    if test -f /usr/share/mk/bsd.prog.mk; then
	MAKE_TYPE=make
	DCCMAKE=make
	echo "$ac_t""no, assume 4.4BSD make" 1>&6
    else
	echo "$ac_t""	*** You must use gmake ***" 1>&6
	MAKE_TYPE=gmake
	DCCMAKE=gmake
    fi
fi
DEPTH=.
if test "$MAKE_TYPE" = gmake; then
    MAKE_DOT=
    MAKE_INC='#include "${DEPTH}/Makefile.inc"'
    MAKE_INC2='include ${DEPTH}/Makefile.inc2'
    MAKE_PROG='include ${DEPTH}/gmake.inc'
    MAKE_SUBDIR='include ${DEPTH}/gmake.inc'
    MAKE_LIB='include ${DEPTH}/gmake.inc\
include ${DEPTH}/Makefile.inc2'
else
    MAKE_DOT="."
    MAKE_INC='.include "${DEPTH}/Makefile.inc"'
    MAKE_INC2='.include "${DEPTH}/Makefile.inc2"'
    MAKE_PROG='.include <bsd.prog.mk>'
    if test "$TARGET_SYS" = 'NetBSD'; then
	MAKE_SUBDIR='.include <bsd.subdir.mk>'
    else
	MAKE_SUBDIR='.include <bsd.prog.mk>'
    fi
    MAKE_LIB='.include <bsd.lib.mk>'
fi


# On some systems `logger` does not have -s
case "$TARGET_SYS" in
    SunOS|AIX|OSF1)
	DCC_LOGGER="\$DCC_LIBEXEC/logger -p \${DCC_ERROR_LOG_FACILITY-mail.err}"
		;;
    BSD/OS|FreeBSD|DragonFly|Darwin|Linux|OpenBSD|NetBSD)
	DCC_LOGGER="logger -s -p \${DCC_ERROR_LOG_FACILITY-mail.err} -t DCC"
		;;
    *)
	# Extract the first word of "logger", so it can be a program name with args.
set dummy logger; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1347: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DCC_LOGGER'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DCC_LOGGER"; then
  ac_cv_prog_DCC_LOGGER="$DCC_LOGGER" # 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_DCC_LOGGER="logger -s -p \${DCC_ERROR_LOG_FACILITY-mail.err} -t DCC"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_DCC_LOGGER" && ac_cv_prog_DCC_LOGGER="echo 1>&2"
fi
fi
DCC_LOGGER="$ac_cv_prog_DCC_LOGGER"
if test -n "$DCC_LOGGER"; then
  echo "$ac_t""$DCC_LOGGER" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    ;;
esac

# How can we fetch a file specified by URL?
#   Fall back to ftp and just hope it understands URL.
for ac_prog in wget fetch curl
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:1384: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_FETCH_CMD'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$FETCH_CMD" in
  /*)
  ac_cv_path_FETCH_CMD="$FETCH_CMD" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_FETCH_CMD="$FETCH_CMD" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_FETCH_CMD="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
FETCH_CMD="$ac_cv_path_FETCH_CMD"
if test -n "$FETCH_CMD"; then
  echo "$ac_t""$FETCH_CMD" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$FETCH_CMD" && break
done
test -n "$FETCH_CMD" || FETCH_CMD="ftp"


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

# choose between `su` and `su -`
case "$TARGET_SYS" in
    Linux|BSD/OS|FreeBSD|DragonFly)
	# `su -` is required on Linux and desirable where it's known to work
	DCC_SU="su -";;
    SunOS|Darwin)
	# `su -` is known to not work or has bad side effects on some systems
	DCC_SU="su";;
    *)
	# be considervative the rest of the time
	DCC_SU="su";;
esac

# check for 4.4BSD sockets
# look for sockets with lengths
echo $ac_n "checking for sa_len""... $ac_c" 1>&6
echo "configure:1473: checking for sa_len" >&5
if eval "test \"`echo '$''{'ac_cv_have_sa_len'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 1478 "configure"
#include "confdefs.h"
#include <sys/socket.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "[^_]sa_len[^_a-z0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  	ac_cv_have_sa_len=yes
else
  rm -rf conftest*
  ac_cv_have_sa_len=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_have_sa_len" 1>&6
if test "$ac_cv_have_sa_len" = yes; then
    cat >> confdefs.h <<\EOF
#define DCC_HAVE_SA_LEN 1
EOF
fi
# many systems want recvfrom() to use a pointer to a socklen_t
echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
echo "configure:1502: checking for socklen_t" >&5
if eval "test \"`echo '$''{'ac_cv_have_socklen_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 1507 "configure"
#include "confdefs.h"
#include <sys/socket.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "typedef.*[^_]socklen_t[^_a-z0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  	ac_cv_have_socklen_t=yes
else
  rm -rf conftest*
  ac_cv_have_socklen_t=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_have_socklen_t" 1>&6
if test "$ac_cv_have_socklen_t" = yes; then
    cat >> confdefs.h <<\EOF
#define DCC_HAVE_SOCKLEN_T 1
EOF
fi
# some systems have broken UDP connected sockets
echo $ac_n "checking for connected UDP sockets""... $ac_c" 1>&6
echo "configure:1531: checking for connected UDP sockets" >&5
case "$TARGET_SYS" in
    BSD/OS|SunOS|IRIX*|OpenBSD|NetBSD)
	cat >> confdefs.h <<\EOF
#define DCC_UDP_DISCON_LEN 0
EOF
	echo "$ac_t""yes" 1>&6
	;;
    FreeBSD|DragonFly|Darwin)
	if test "$ac_cv_have_socklen_t" = yes; then
	    cat >> confdefs.h <<\EOF
#define DCC_UDP_DISCON_LEN ctxt->conn_su.sa.sa_len
EOF
	else
	    cat >> confdefs.h <<\EOF
#define DCC_UDP_DISCON_LEN 0
EOF
	fi
	echo "$ac_t""yes" 1>&6
	;;
    Linux)
				# RedHat 6.0 & newer work in the Linux Way,
				#   but older versions don't even do that
	UNAME_R=`uname -r`
	UNAME_R_MAJ=`expr "$UNAME_R" : '\([0-9]*\)\..*'`
	UNAME_R_MIN=`expr "$UNAME_R" : '[0-9]*\.\([0-9]*\)\..*'`
	if test `expr $UNAME_R_MAJ \* 100 + $UNAME_R_MIN` -ge 202; then
	    cat >> confdefs.h <<\EOF
#define DCC_UDP_DISCON_LEN sizeof(ctxt->conn_su.sa)
EOF
	    echo "$ac_t""yes" 1>&6
	else
	    echo "$ac_t""no" 1>&6
	fi
	;;
    AIX|OpenUNIX)		# AIX and OpenUNIX do not work.
	echo "$ac_t""no" 1>&6;;
    *)				# be conservative the rest of the time
	echo "$ac_t""no" 1>&6;;
esac

# turn off connected UDP sockets just in case
if test "$enable_udp_connect" != no; then
    cat >> confdefs.h <<\EOF
#define DCC_UDP_CONNECT 1
EOF
fi

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

fi

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

# Some systems have uint32_t, others have u_int32_t, and some have both.
#   Then there is OpenUNIX but in sys/types.h and */bitypes.h which
#   is included by network header files.
echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
echo "configure:1615: checking for u_int32_t" >&5
if eval "test \"`echo '$''{'ac_cv_have_u_int32_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 1620 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "u_int32_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_have_u_int32_t=yes
else
  rm -rf conftest*
  ac_cv_have_u_int32_t=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_have_u_int32_t" 1>&6
if test "$ac_cv_have_u_int32_t" = yes; then
    cat >> confdefs.h <<\EOF
#define DCC_HAVE_U_INT32_T 1
EOF
fi
# and then there is u_*int64_t
echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6
echo "configure:1645: checking for u_int64_t" >&5
if eval "test \"`echo '$''{'ac_cv_have_u_int64_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 1650 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "u_int64_t" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_have_u_int64_t=yes
else
  rm -rf conftest*
  ac_cv_have_u_int64_t=no
fi
rm -f conftest*

fi

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

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

fi

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

# Checks for library functions and headers.
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:1704: 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 1709 "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:1718: \"$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

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

for ac_func in daemon vsyslog getipnodebyname getipnodebyaddr freehostent   	getaddrinfo getnameinfo freeaddrinfo gai_strerror hstrerror	    	_res res_init res_query dn_expand inet_ntop inet_aton gethostid	    	localtime_r poll strlcpy getprogname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1781: 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 1786 "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:1809: \"$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


# turn off DNS blacklist MX code just in case the resolver library is odd
if test "$enable_mx_dnsbl" != no; then
    cat >> confdefs.h <<\EOF
#define MX_DNSBL 1
EOF
fi

# deal with getifaddrs(), MD5, and getrlimits()
for ac_func in getifaddrs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1845: 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 1850 "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:1873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test "$ac_cv_func_getifaddrs" = yes; then
    for ac_func in freeifaddrs
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1900: 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 1905 "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:1928: \"$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
    echo $ac_n "checking getifaddrs replacement""... $ac_c" 1>&6
echo "configure:1953: checking getifaddrs replacement" >&5
if eval "test \"`echo '$''{'ac_cv_use_dcc_getifaddrs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      OLD_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -I include"
    cat > conftest.$ac_ext <<EOF
#line 1960 "configure"
#include "confdefs.h"
#define TEST_DCC_GETIFADDRS
#include "dcclib/getifaddrs.c"
int main() {

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

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

# Try to use a local md5.h and md5.c.  Some systems such as RedHat 7.3
#   have versions of /usr/include/md5.h that are not directly usable.
#   Then there are the odd versions that are installed on systems.
# Check whether --with-DCC-MD5 or --without-DCC-MD5 was given.
if test "${with_DCC_MD5+set}" = set; then
  withval="$with_DCC_MD5"
  :
fi
if test "$with_DCC_MD5" = yes; then
    unset ac_cv_header_md5_h
    unset ac_cv_search_MD5Init
else
    ac_safe=`echo "md5.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for md5.h""... $ac_c" 1>&6
echo "configure:2003: checking for md5.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 2008 "configure"
#include "confdefs.h"
#include <md5.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2013: \"$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 > conftest.$ac_ext <<EOF
#line 2030 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/param.h>
#include <md5.h>
int main() {

; return 0; }
EOF
if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  
echo $ac_n "checking for library containing MD5Init""... $ac_c" 1>&6
echo "configure:2045: checking for library containing MD5Init" >&5
if eval "test \"`echo '$''{'ac_cv_search_MD5Init'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_func_search_save_LIBS="$LIBS"
ac_cv_search_MD5Init="no"
cat > conftest.$ac_ext <<EOF
#line 2052 "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 MD5Init();

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

int main() {
MD5Init()
; return 0; }
EOF
if { (eval echo configure:2085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_search_MD5Init="-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_MD5Init" 1>&6
if test "$ac_cv_search_MD5Init" != "no"; then
  test "$ac_cv_search_MD5Init" = "none required" || LIBS="$ac_cv_search_MD5Init $LIBS"
  cat >> confdefs.h <<\EOF
#define HAVE_MD5 1
EOF

else :
  ac_cv_header_md5_h=no
fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  echo "$ac_t""md5.h does not compile" 1>&6; ac_cv_header_md5_h=no
fi
rm -f conftest*
else
  echo "$ac_t""no" 1>&6
fi
fi

# does this system have getrlimit()?
for ac_func in getrlimit
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2124: 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 2129 "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:2152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done
if test "$ac_cv_func_getrlimit" = yes; then
    echo $ac_n "checking for RLIMIT_NOFILE""... $ac_c" 1>&6
echo "configure:2177: checking for RLIMIT_NOFILE" >&5
if eval "test \"`echo '$''{'ac_cv_rlimit_nofile'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 2182 "configure"
#include "confdefs.h"
#include <sys/resource.h>
#ifdef RLIMIT_NOFILE
  yes
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "yes" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_rlimit_nofile=yes
else
  rm -rf conftest*
  ac_cv_rlimit_nofile=no
fi
rm -f conftest*

fi

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

# How can the database code discover the size of physical memory?
GOT_PHYSMEM=
# Solaris sysconf()
if test -z "$GOT_PHYSMEM"; then
    echo $ac_n "checking for sysconf(_SC_PHYS_PAGES)+sysconf(_SC_PAGESIZE)""... $ac_c" 1>&6
echo "configure:2214: checking for sysconf(_SC_PHYS_PAGES)+sysconf(_SC_PAGESIZE)" >&5
if eval "test \"`echo '$''{'ac_cv_have_sysconf_pages'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 2219 "configure"
#include "confdefs.h"
#include <unistd.h>
int main() {
sysconf(_SC_PHYS_PAGES)+sysconf(_SC_PAGESIZE)
; return 0; }
EOF
if { (eval echo configure:2226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_sysconf_pages=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_sysconf_pages=no
fi
rm -f conftest*
fi

echo "$ac_t""$ac_cv_have_sysconf_pages" 1>&6
    if test "$ac_cv_have_sysconf_pages" = yes; then
	GOT_PHYSMEM=sysconf
	cat >> confdefs.h <<\EOF
#define HAVE__SC_PHYS_PAGES 1
EOF
    fi
fi
# BSD sysctl()
if test -z "$GOT_PHYSMEM"; then
    echo $ac_n "checking for sysctl(HW_PHYSMEM)""... $ac_c" 1>&6
echo "configure:2249: checking for sysctl(HW_PHYSMEM)" >&5
if eval "test \"`echo '$''{'ac_cv_have_hw_physmem'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      cat > conftest.$ac_ext <<EOF
#line 2254 "configure"
#include "confdefs.h"
#include <sys/types.h>
	#include <sys/param.h>
	#include <sys/sysctl.h>
int main() {
sysctl(0,HW_PHYSMEM,0,0,0,0)
; return 0; }
EOF
if { (eval echo configure:2263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  rm -rf conftest*
  ac_cv_have_hw_physmem=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_have_hw_physmem=no
fi
rm -f conftest*
fi

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

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

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

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


# how big is NUM_CWFS
echo $ac_n "checking FD_SETSIZE to compute NUM_CWFS""... $ac_c" 1>&6
echo "configure:2320: checking FD_SETSIZE to compute NUM_CWFS" >&5
if eval "test \"`echo '$''{'ac_cv_num_cwfs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_num_cwfs=32
else
  cat > conftest.$ac_ext <<EOF
#line 2328 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", max(2, min(20, FD_SETSIZE-32)));
  exit(0);
}
EOF
if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_num_cwfs=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_num_cwfs=32
fi
rm -fr conftest*
fi

fi

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


# Check whether --enable-chown or --disable-chown was given.
if test "${enable_chown+set}" = set; then
  enableval="$enable_chown"
  :
fi
# Check whether --with-uid or --without-uid was given.
if test "${with_uid+set}" = set; then
  withval="$with_uid"
  :
fi

case "$TARGET_SYS" in
    Darwin)				# Apple Thinks Different
	DCCUID=root
	BINUID=daemon
	BIN_GRP=daemon
	;;
    *)
	DCCUID=root
	BINUID=bin
	BIN_GRP=bin
	;;
esac

if test "$enable_sys_install" = no; then
    #correct common misspelling
    enable_sys_inst=no
fi
if test "$enable_sys_inst" != no; then
    NO_SYS_INSTALL="#install man pages"
else
    # Do not install the man pages and try to avoid chown and chgrp if
    # not installing on the system.
    NO_SYS_INSTALL="NO_SYS_INSTALL=not-system-install"
    # not all systems have `id -n`
    uid=`id | sed -n \
		-e 's/.*uid=[0-9][0-9]*(\([^)][^)]*\)).*/\1/p' \
		-e 's/.*uid=\([0-9][0-9]*\).*/\1/p'`
    if test ! -z "$uid"; then
	DCCUID="$uid"
	BINUID="$uid"
    fi
    gid=`id | sed -n \
		-e 's/.*gid=[0-9][0-9]*(\([^)][^)]*\)).*/\1/p' \
		-e 's/.*gid=\([0-9][0-9]*\).*/\1/p'`
    if test ! -z "$gid"; then
	BIN_GRP="$gid"
    fi
fi
if test ! -z "$with_uid" -a "$with_uid" != no; then
    DCCUID="$with_uid"
fi

# Check whether --enable-server or --disable-server was given.
if test "${enable_server+set}" = set; then
  enableval="$enable_server"
  :
fi
# Check whether --enable-dccifd or --disable-dccifd was given.
if test "${enable_dccifd+set}" = set; then
  enableval="$enable_dccifd"
  :
fi
# Check whether --enable-dccm or --disable-dccm was given.
if test "${enable_dccm+set}" = set; then
  enableval="$enable_dccm"
  :
fi

# Look for sendmail
#	dccm requires the sendmail milter header file and library.
#	Without an explicit hint in the SENDMAIL environment variable,
#	look for them first in a sendmail directory parallel to the DCC
#	source directory.
# Check whether --with-sendmail or --without-sendmail was given.
if test "${with_sendmail+set}" = set; then
  withval="$with_sendmail"
  :
fi
if test "$enable_dccm" = no -o "$with_sendmail" = no -o ! -d dccm; then
    with_sendmail=no
    enable_dccm=no
    SENDMAIL=no
    SENDMAIL_OBJ=/dev/null
    SENDMAIL_LIB=/usr/lib
else
    SENDMAIL_OBJ=
    SENDMAIL_LIB=
fi
if test ! -z "$with_sendmail" -a "$with_sendmail" != yes -a "$with_sendmail" != no; then
    SENDMAIL="$with_sendmail"
    SENDMAIL_EVAL="$SENDMAIL"
    with_sendmail=yes
fi
if test -z "$SENDMAIL"; then
    # prefer a parallel ../sendmail directory
    DEPTH=.
    SENDMAIL='${DEPTH}/../sendmail'
    eval SENDMAIL_EVAL=$SENDMAIL
    # notice native sendmail installation on Freebsd 4.6 and elsewhere
    #	prefer a shared library, without dependin on test getting the
    #	    precedent of -a and -o right
    if test ! -d $SENDMAIL_EVAL						\
	    -a -f /usr/include/libmilter/mfapi.h; then
	if test -f /usr/lib/libmilter.so; then				\
	    SENDMAIL=/usr/include
	    SENDMAIL_EVAL=$SENDMAIL
	    SENDMAIL_OBJ=/usr/lib
	    SENDMAIL_OBJ_EVAL=$SENDMAIL_OBJ
	    SENDMAIL_LIB=$SENDMAIL_OBJ/libmilter.so
	fi
	if test ! -d $SENDMAIL_EVAL					\
		-a -f /usr/lib/libmilter.a; then			\
	    SENDMAIL=/usr/include
	    SENDMAIL_EVAL=$SENDMAIL
	    SENDMAIL_OBJ=/usr/lib
	    SENDMAIL_OBJ_EVAL=$SENDMAIL_OBJ
	    SENDMAIL_LIB=$SENDMAIL_OBJ/libmilter.a
	fi
    fi
    # notice a FreeBSD sendmail package if there is only one
    if test ! -d $SENDMAIL_EVAL; then				\
	SENDMAIL_PKG=`echo /usr/ports/mail/sendmail/work/sendmail*`
	if test -d "$SENDMAIL_PKG"; then
	    SENDMAIL="$SENDMAIL_PKG"
	    SENDMAIL_EVAL="$SENDMAIL"
	fi
    fi
    # notice native installation on some versions of NetBSD
    if test ! -d $SENDMAIL_EVAL						\
	    -a -f /usr/pkg/include/libmilter/mfapi.h			\
	    -a -f /usr/pkg/lib/libmilter.a				\
	    -a "$TARGET_SYS" = NetBSD; then				\
	SENDMAIL=/usr/pkg/include
	SENDMAIL_EVAL=$SENDMAIL
	SENDMAIL_OBJ=/usr/pkg/lib
	SENDMAIL_OBJ_EVAL=$SENDMAIL_OBJ
	SENDMAIL_LIB=$SENDMAIL_OBJ/libmilter.a
    fi
    # notice native installation on some flavors of Linux
    if test ! -d $SENDMAIL_EVAL						\
	    -a -f /usr/include/libmilter/mfapi.h			\
	    -a -f /usr/lib/libmilter/libmilter.a			\
	    -a "$TARGET_SYS" = Linux; then				\
	SENDMAIL=/usr/include
	SENDMAIL_EVAL=$SENDMAIL
	SENDMAIL_OBJ=/usr/lib/libmilter
	SENDMAIL_OBJ_EVAL=$SENDMAIL_OBJ
	SENDMAIL_LIB=$SENDMAIL_OBJ/libmilter.a
    fi
fi
# look for a standard sendmail object directory if we still lack libmilter.a
if test -z "$SENDMAIL_LIB"; then
    case "$TARGET_SYS" in
    AIX)
	# sendmail thinks all AIX systems are "PPC"
	PLATFORM=`uname -vs | tr ' /' '.\-'`.`uname -r`.PPC;;
    SunOS)
	# sendmail does not like the trailing 'u' in sun4u
	PLATFORM=`uname -rsm | tr ' /' '.\-'				\
		| sed -e 's/sun4u$/sun4/'`;;
    Darwin)
	# sendmail does not like the period in the middle of Power.Macintosh
	PLATFORM=`uname -rsm | tr ' /' '.\-'				\
	    | sed -e 's/Power.Macintosh/PowerMacintosh/'`;;
    *)
	PLATFORM=`uname -rsm | tr ' /' '.\-'`;;
    esac
    SENDMAIL_OBJ="$SENDMAIL/obj.$PLATFORM"
    SENDMAIL_LIB="$SENDMAIL_OBJ/libmilter/libmilter.a"
    # add the odd old sendmail 8.11 milter extra library
    eval SENDMAIL_OBJ_EVAL="\"$SENDMAIL_OBJ\""
    if test -f "$SENDMAIL_OBJ_EVAL/libsmutil/libsmutil.a"; then
	SENDMAIL_LIB="$SENDMAIL_LIB $SENDMAIL_OBJ/libsmutil/libsmutil.a"
    fi
    # and the odd libsm.a that 8.12.1 needs for sm_printf()
    if test -f "$SENDMAIL_OBJ_EVAL/libsm/libsm.a"; then
	SENDMAIL_LIB="$SENDMAIL_LIB $SENDMAIL_OBJ/libsm/libsm.a"
    fi
fi


# Check whether --with-cgibin or --without-cgibin was given.
if test "${with_cgibin+set}" = set; then
  withval="$with_cgibin"
  :
fi
if test ! -z "$with_cgibin" -a "$with_cgi_bin" != no; then
    cgibin="$with_cgibin"
fi


# where is a good place to put the dccm and dccifd sockets and PID files?
# Check whether --with-rundir or --without-rundir was given.
if test "${with_rundir+set}" = set; then
  withval="$with_rundir"
  :
fi
dcc_rundir=/var/run/dcc
if test ! -z "$with_rundir" -a "$with_rundir" != no; then
    unset ac_cv_path_varrun
    dcc_rundir="$with_rundir"
else
    echo $ac_n "checking run directory""... $ac_c" 1>&6
echo "configure:2569: checking run directory" >&5
if eval "test \"`echo '$''{'ac_cv_path_varrun'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
      if test "$cross_compiling" = yes; then
  ac_cv_path_varrun=/var/run
else
  cat > conftest.$ac_ext <<EOF
#line 2577 "configure"
#include "confdefs.h"
#include <stdio.h>
#include "include/dcc_paths.h"
main()
{
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, _PATH_VARRUN"\n");
    exit(0);
}
EOF
if { (eval echo configure:2589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  x=`cat conftestval`; ac_cv_path_varrun=`expr "$x" \: '\(.*\)/$' \| "$x"`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_path_varrun=/var/run
fi
rm -fr conftest*
fi

fi

echo "$ac_t""$ac_cv_path_varrun" 1>&6
    dcc_rundir=$ac_cv_path_varrun/dcc
fi
cat >> confdefs.h <<EOF
#define DCC_RUNDIR "$dcc_rundir"
EOF


# Check whether --with-db-memory or --without-db-memory was given.
if test "${with_db_memory+set}" = set; then
  withval="$with_db_memory"
  :
fi
if test -z "$with_db_memory" -o "$with_db_memory" = no; then
    with_db_memory=0
fi
if test ! -z "`expr "$with_db_memory" : '[0-9]*\(.*\)'`"; then
    { echo "configure: error: --with-db-memory=X requires a number" 1>&2; exit 1; }
    with_db_memory=0
fi
if test "$with_db_memory" -ne 0; then
    # if >= 2048*1024, assume the number is MByte
    # if <, assume the number is KByte
    if test "$with_db_memory" -ge 33554432; then
	with_db_memory=`expr "$with_db_memory" / 1048576`
    fi
    if test "$with_db_memory" -lt 32 -o $with_db_memory -gt 3072; then
	{ echo "configure: error: --with-db-memory=X must be between 32 MByte and 3 GByte" 1>&2; exit 1; }
	with_db_memory=0
    fi
fi
cat >> confdefs.h <<EOF
#define DCC_DB_MBYTE $with_db_memory
EOF

# Check whether --with-max-db-mem or --without-max-db-mem was given.
if test "${with_max_db_mem+set}" = set; then
  withval="$with_max_db_mem"
  :
fi
if test -z "$with_max_db_mem" -o "$with_max_db_mem" = no; then
    with_max_db_mem=0
fi
if test ! -z "`expr "$with_max_db_mem" : '[0-9]*\(.*\)'`"; then
    { echo "configure: error: --with-max-db_mem=X requires a number" 1>&2; exit 1; }
    with_max_db_mem=0
fi
if test "$with_max_db_mem" -ne 0; then
    # if >= 2048*1024, assume the number is MByte
    # if <, assume the number is KByte
    if test "$with_max_db_mem" -ge 33554432; then
	with_max_db_mem=`expr "$with_max_db_mem" / 1048576`
    fi
    if test "$with_max_db_mem" -lt 32 -o $with_max_db_mem -gt 3072; then
	{ echo "configure: error: --with-max-db_mem=X must be between 32 MByte and 3 GByte" 1>&2; exit 1; }
	with_max_db_mem=0
    fi
    if test "$with_db_memory" -ne 0	\
		-a "$with_max_db_mem" -lt $with_db_memory; then
	{ echo "configure: error: --with-max-db_mem=$with_max_db_mem less than --with-db-memory=$with_db_memory" 1>&2; exit 1; }
	with_max_db_mem=0
    fi
fi
cat >> confdefs.h <<EOF
#define DCC_MAX_DB_MBYTE $with_max_db_mem
EOF

# Check whether --with-max-log-size or --without-max-log-size was given.
if test "${with_max_log_size+set}" = set; then
  withval="$with_max_log_size"
  :
fi
if test ! -z "$with_max_log_size" -a "$with_max_log_size" != no \
	-a ! -z "`expr 0$with_max_log_size : '[0-9]*\(.*\)'`"; then
    { echo "configure: error: --with-max-log-size=X requires a number" 1>&2; exit 1; }
    with_max_log_size=
fi
if test -z "$with_max_log_size"; then
    with_max_log_size=32
fi
if test $with_max_log_size -lt 2097152; then
    with_max_log_size=`expr 0$with_max_log_size '*' 1024`
fi
cat >> confdefs.h <<EOF
#define MAX_LOG_SIZE $with_max_log_size
EOF


# Check whether --with-bad-locks or --without-bad-locks was given.
if test "${with_bad_locks+set}" = set; then
  withval="$with_bad_locks"
  :
fi
if test "$with_bad_locks" = yes; then
    cat >> confdefs.h <<\EOF
#define DCC_BAD_FCNTL_LOCKS 1
EOF
fi


# Decide whether we should try to build IPv6 support.  Be conservative
#	and give up at the first sign of trouble.
# Check whether --enable-IPv6 or --disable-IPv6 was given.
if test "${enable_IPv6+set}" = set; then
  enableval="$enable_IPv6"
  :
fi
# some systems think they have IPv6 but don't or have odd definitions
#   for the structure tags
case "$TARGET_SYS" in
    SunOS)
	cat >> confdefs.h <<\EOF
#define CONF_S6_ADDR32 _S6_un._S6_u32
EOF
#	use poll() instead of select() on Solaris because socket() can yield
#	file descriptors larger than FD_SETSIZE
	if test "$ac_cv_func_poll" = yes; then
	    cat >> confdefs.h <<\EOF
#define USE_POLL 1
EOF
	fi
#	use `dbclean -F` on Solaris to force less unneeded disk I/O
	cat >> confdefs.h <<\EOF
#define USE_DBCLEAN_F 1
EOF
	;;
    OSF1)
	cat >> confdefs.h <<\EOF
#define CONF_S6_ADDR32 s6_laddr
EOF
	;;
    OpenUNIX)
	enable_IPv6=no
	cat >> confdefs.h <<\EOF
#define CONF_S6_ADDR32 S6_un.S6_l
EOF
	;;
    FreeBSD|DragonFly)
#	allow file descriptors larger than FD_SETSIZE
	if test "$ac_cv_func_poll" = yes; then
	    cat >> confdefs.h <<\EOF
#define USE_POLL 1
EOF
	fi
	cat >> confdefs.h <<\EOF
#define CONF_S6_ADDR32 __u6_addr.__u6_addr32
EOF
	;;
    *)
	cat >> confdefs.h <<\EOF
#define CONF_S6_ADDR32 __u6_addr.__u6_addr32
EOF
	;;
esac
if test "$enable_IPv6"SET = noSET -o "$enable_IPV6"SET = noSET	\
	-o "$enable_ipv6"SET = noSET; then
    NO_IPV6="disabled"
else
    if test "$ac_cv_func_gai_strerror" != yes; then
	no_getaddrinfo="no gai_strerror()"
    fi
    if test "$ac_cv_func_freeaddrinfo" != yes; then
	no_getaddrinfo="no freeaddrinfo()"
    fi
    if test "$ac_cv_func_getaddrinfo" != yes; then
	no_getaddrinfo="no getaddrinfo()"
    fi
    if test "$ac_cv_func_freehostent" != yes; then
	no_getipnodebyname="no freehostent()"
    fi
    if test "$ac_cv_func_gethostbyaddr" != yes; then
	no_getipnodebyname="no gethostbyaddr()"
    fi
    if test "$ac_cv_func_getipnodebyname" != yes; then
	no_getipnodebyname="no getipnodebyname()"
    fi
    if test ! -z "$no_getipnodebyname" -a ! -z "$no_getaddrinfo"; then
	NO_IPV6="$no_getipnodebyname and $no_getaddrinfo"
    fi
fi
echo $ac_n "checking for IPv6""... $ac_c" 1>&6
echo "configure:2784: checking for IPv6" >&5
cat > conftest.$ac_ext <<EOF
#line 2786 "configure"
#include "confdefs.h"
#include <netinet/in.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "sockaddr_in6" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  NO_IPV6="no sockaddr_in6"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 2799 "configure"
#include "confdefs.h"
#include <netinet/in.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "in6_addr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  NO_IPV6="no in6_addr"
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 2812 "configure"
#include "confdefs.h"
#include<sys/socket.h>
AF_INET6
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "^AF_INET6$" >/dev/null 2>&1; then
  rm -rf conftest*
  NO_IPV6="no AF_INET6"
    cat >> confdefs.h <<\EOF
#define NO_AF_INET6 1
EOF

fi
rm -f conftest*

if test -z "$NO_IPV6"; then
    echo "$ac_t""yes" 1>&6
else
    echo "$ac_t""$NO_IPV6" 1>&6
    cat >> confdefs.h <<EOF
#define NO_IPV6 "$NO_IPV6"
EOF
fi



# Decide about man pages and what to build
if test "$prefix" = NONE; then
    if test -z "$DCC_HOMEDIR"; then
	DCC_HOMEDIR=$ac_default_prefix
    fi
    prefix=$DCC_HOMEDIR
fi
cat >> confdefs.h <<EOF
#define DCC_HOMEDIR "$prefix"
EOF
if test "$libexecdir" = '${exec_prefix}/libexec'; then
    libexecdir=$prefix/libexec
fi
cat >> confdefs.h <<EOF
#define DCC_LIBEXECDIR "$libexecdir"
EOF
if test "$bindir" = '${exec_prefix}/bin'; then
    if test "$enable_sys_inst" = no -a ! -w /usr/local/bin -a -d $HOME/bin; then
	bindir=$HOME/bin
	echo "$ac_t""install binaries in $bindir" 1>&6
    else
	bindir=/usr/local/bin
    fi
fi

# default cgibin after $prefix has been figured out
if test -z "$cgibin"; then
    cgibin="$prefix/cgi-bin"
fi

# Pick the default target location of the man pages and
#	decide whether to generate .8 or .0 files.
case "$TARGET_SYS" in
    Linux)
	# default to /usr/local/man/man8 and use roff files
	mancat=man
	MAN8='dcc.8 $(SUBDIR_MAN8)'
	MAN8INST=''
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    OpenBSD)
	# default to /usr/local/man/cat8 and wahtever.0 names
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST=''
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    HP-UX)
	# default to /usr/local/man/cat8 and use cleartext files and
	#   whatever.8 names
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST='/`expr $$NM : "\(.*\)".0`.8'
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    IRIX*)
	# default to /usr/local/man/man8 and use cleartext files and
	#   whatever.8 names
	mancat=man
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST='/`expr $$NM : "\(.*\)".0`.8'
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    SunOS)
	# default to /usr/local/man/cat8 and use cleartext files,
	#   use our installation rule, and whatever.8 names
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST='/`expr $$NM : "\(.*\)".0`.8'
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    FreeBSD)
	# default to /usr/local/man/man8 and use nroff files, possibly
	#   compressed via /usr/share/mk
	mancat=man
	MAN8='dcc.8 $(SUBDIR_MAN8)'
	MAN8INST=''
	USE_DCCMANINSTALL='# do not use dccmaninstall'
	;;
    DragonFly)
	# default to /usr/local/man/man8 and use nroff files, possibly
	#   compressed via /usr/share/mk
	mancat=man
	MAN8='dcc.8 $(SUBDIR_MAN8)'
	MAN8INST=''
	USE_DCCMANINSTALL='# do not use dccmaninstall'
	;;
    Darwin)
	# default to /usr/local/man/man8 and use nroff files
	mancat=man
	MAN8='dcc.8 $(SUBDIR_MAN8)'
	MAN8INST=''
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    NetBSD)
	# default to /usr/local/man/man8 and use nroff files, possibly
	#   compressed via /usr/share/mk on versions well after 1.4.2.
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST=''
	# force NetBSD to install the man pages
	USE_DCCMANINSTALL='install maninstall: dccmaninstall'
	;;
    BSD/OS)
	# default to /usr/local/man/cat8 and use cleartext files, possibly
	#   compressed via /usr/share/mk, and named whatever.0
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST=''
	USE_DCCMANINSTALL='# do not use dccmaninstall'
	;;
    AIX)
	# default to /usr/local/man/cat8, use our installation rule,
	#   and use cleartext files named whatever.8
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST='/`expr $$NM : "\(.*\)".0`.8'
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    OpenUNIX)
	# default to /usr/local/man/cat8 and use cleartext files named
	#   whatever.8
	mancat=cat
	MAN8='dcc.0 $(SUBDIR_MAN0)'
	MAN8INST='/`expr $$NM : "\(.*\)".0`.8'
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
    *)
	echo "$ac_t""	*** Cannot install man pages on unfamiliar systems ***" 1>&6
	USE_DCCMANINSTALL='maninstall:dccmaninstall'
	;;
esac
if test "$mandir" = '${prefix}/man'; then
    if test "$DCC_MANDIR"SET != SET; then
	mandir="$DCC_MANDIR"
    else
	mandir=/usr/local/man
    fi
fi
mandir="$mandir/$mancat"

# Enough systems have idiosyncratic native install programs and we install
#   few enough files that it is usually best to use the autoconf script.
#   A few systems cannot tolerate the autoconf script.
case "$TARGET_SYS" in
    CYGWIN*)
	DCCINSTALL=install
	;;
    *)
	DCCINSTALL='${DEPTH}/autoconf/install-sh -c'
	# some systems do not have UNIX file permissions
	cat >> confdefs.h <<\EOF
#define HAVE_PRIVATE_FILES 1
EOF
	;;
esac

if test "$enable_dccifd" = no; then
    SUBDIR_DCCIFD=
else
    if test "$have_pthreads" = yes; then
	SUBDIR_DCCIFD=dccifd
    else
	echo "$ac_t""	*** cannot build dccifd without threads ***" 1>&6
    fi
fi

if test "$enable_server" = no -o "$enable_dccd" = no; then
    SUBDIR_DCCD=
    SUBDIR_SRVRLIB=
else
    SUBDIR_DCCD="dbclean dccd dblist"
    SUBDIR_SRVRLIB="srvrlib"
fi

# We have already chosen the sendmail source directory.  Here we only
#	check that the milter library is present and turn dccm on or off.
SUBDIR_DCCM=
if test "$with_sendmail"SET != noSET -a "$enable_dccm"SET != noSET; then
    echo "$ac_t""look for sendmail milter library in $SENDMAIL_OBJ_EVAL" 1>&6
    if test ! -d $SENDMAIL_OBJ_EVAL; then
	echo "$ac_t""	*** cannot build dccm without sendmail headers in $SENDMAIL_EVAL
		and libraries in $SENDMAIL_OBJ_EVAL ***" 1>&6
    else
	if test "$have_pthreads" = yes; then
	    SUBDIR_DCCM=dccm
	else
	    echo "$ac_t""	*** cannot build dccm without threads ***" 1>&6
	fi
    fi
# If dccm has been installed but there is no sendmail library,
# then assume something is recently broken and try to build dccm regardless.
# This prevents bad things like losing a sendmail directory from letting
# a DCC build appear to succeed.
    if test -x "$libexecdir/dccm"; then
	if test -z "$SUBDIR_DCCM"; then
	    echo "$ac_t""	*** try to rebuild dccm because it is already installed ***" 1>&6
	fi
	SUBDIR_DCCM=dccm
    fi
fi
if test -z "$SUBDIR_DCCM"; then
    CONF_DCCM_ENABLE=off
else
    CONF_DCCM_ENABLE=on
fi
if test -z "$SUBDIR_DCCM$SUBDIR_DCCIFD"; then
    SUBDIR_THRLIB=
else
    SUBDIR_THRLIB=thrlib
fi


# Check whether --with-kludge or --without-kludge was given.
if test "${with_kludge+set}" = set; then
  withval="$with_kludge"
  :
fi
if test ! -z "$with_kludge" -a "$with_kludge" != no; then
    kludge_h="$with_kludge"
    cat >> confdefs.h <<\EOF
#define NEED_KLUDGE_H 1
EOF
else
    kludge_h="@kludge_h@"
fi


# Check whether --with-socks or --without-socks was given.
if test "${with_socks+set}" = set; then
  withval="$with_socks"
  :
fi
if test "$ac_cv_lib_socks" != "$with_socks"; then
    unset ac_cv_func_Rsendto
fi
ac_cv_lib_socks="$with_socks"
if test ! -z "$with_socks" -a "$with_socks" != no; then
    cat >> confdefs.h <<\EOF
#define HAVE_LIBSOCKS 1
EOF
    if test "$with_socks" != yes; then
	OLD_LIBS="$LIBS"
	LIBS="$LIBS -l$with_socks"
						echo $ac_n "checking for Rsendto""... $ac_c" 1>&6
echo "configure:3084: checking for Rsendto" >&5
if eval "test \"`echo '$''{'ac_cv_func_Rsendto'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3089 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char Rsendto(); 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 Rsendto();

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_Rsendto) || defined (__stub___Rsendto)
choke me
#else
Rsendto();
#endif

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

if eval "test \"`echo '$ac_cv_func_'Rsendto`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
LIBS="$OLD_LIBS"
	    echo "$ac_t""	warnng: SOCKS functions including Rsendto() not found in -l$with_socks" 1>&6
fi
    else
	echo $ac_n "checking for Rsendto""... $ac_c" 1>&6
echo "configure:3134: checking for Rsendto" >&5
if eval "test \"`echo '$''{'ac_cv_func_Rsendto'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3139 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char Rsendto(); 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 Rsendto();

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_Rsendto) || defined (__stub___Rsendto)
choke me
#else
Rsendto();
#endif

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

if eval "test \"`echo '$ac_cv_func_'Rsendto`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
echo "$ac_t""	warnng: SOCKS functions including Rsendto() not found" 1>&6
fi
    fi
else
    echo $ac_n "checking for Rsendto""... $ac_c" 1>&6
echo "configure:3184: checking for Rsendto" >&5
if eval "test \"`echo '$''{'ac_cv_func_Rsendto'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3189 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char Rsendto(); 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 Rsendto();

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_Rsendto) || defined (__stub___Rsendto)
choke me
#else
Rsendto();
#endif

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

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

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

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

trap 'rm -fr `echo "include/kludge.h Makefile Makefile.inc Makefile.inc2 gmake.inc dcclib/Makefile cdcc/Makefile dccproc/Makefile dccm/Makefile dccifd/Makefile dccifd/dccif.pl dccifd/dccif-test/Makefile dbclean/Makefile dccd/Makefile dblist/Makefile dccsight/Makefile homedir/Makefile homedir/dcc_conf misc/Makefile srvrlib/Makefile thrlib/Makefile misc/cron-dccd misc/crontab misc/dcc.m4 misc/fetch-testmsg-whitelist misc/newwebuser misc/rcDCC misc/start-dccd misc/start-grey misc/start-dccifd misc/start-dccm misc/stop-dccd misc/dcc-stats-collect misc/dcc-stats-graph misc/dcc-stats-init misc/stats-get misc/updatedcc cgi-bin/Makefile cgi-bin/chgpasswd cgi-bin/common cgi-bin/list-log cgi-bin/list-msg cgi-bin/edit-whiteclnt include/dcc_config.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%@libexecdir@%$libexecdir%g
s%@mandir@%$mandir%g
s%@UPDATEDCC_PARMS@%$UPDATEDCC_PARMS%g
s%@UPDATEDCC_ENV@%$UPDATEDCC_ENV%g
s%@UPDATEDCC_ENV_SET@%$UPDATEDCC_ENV_SET%g
s%@UPDATEDCC_ENV_UNSET@%$UPDATEDCC_ENV_UNSET%g
s%@UPDATEDCC_ENV_EXPORT@%$UPDATEDCC_ENV_EXPORT%g
s%@installroot@%$installroot%g
s%@CC@%$CC%g
s%@DCC_CC@%$DCC_CC%g
s%@CPP@%$CPP%g
s%@RANLIB@%$RANLIB%g
s%@DCC_CFLAGS@%$DCC_CFLAGS%g
s%@DCC_LDFLAGS@%$DCC_LDFLAGS%g
s%@PTHREAD_CFLAGS@%$PTHREAD_CFLAGS%g
s%@PTHREAD_LDFLAGS@%$PTHREAD_LDFLAGS%g
s%@PTHREAD_LIBS@%$PTHREAD_LIBS%g
s%@CWARN@%$CWARN%g
s%@HAVE_CC_M@%$HAVE_CC_M%g
s%@DCCMAKE@%$DCCMAKE%g
s%@MAKE_INC@%$MAKE_INC%g
s%@MAKE_INC2@%$MAKE_INC2%g
s%@MAKE_PROG@%$MAKE_PROG%g
s%@MAKE_SUBDIR@%$MAKE_SUBDIR%g
s%@MAKE_LIB@%$MAKE_LIB%g
s%@MAKE_DOT@%$MAKE_DOT%g
s%@DCC_LOGGER@%$DCC_LOGGER%g
s%@FETCH_CMD@%$FETCH_CMD%g
s%@PERL@%$PERL%g
s%@DCC_SU@%$DCC_SU%g
s%@NO_SYS_INSTALL@%$NO_SYS_INSTALL%g
s%@DCCUID@%$DCCUID%g
s%@BINUID@%$BINUID%g
s%@BIN_GRP@%$BIN_GRP%g
s%@SENDMAIL@%$SENDMAIL%g
s%@SENDMAIL_LIB@%$SENDMAIL_LIB%g
s%@cgibin@%$cgibin%g
s%@dcc_rundir@%$dcc_rundir%g
s%@MAN8@%$MAN8%g
s%@MAN8INST@%$MAN8INST%g
s%@USE_DCCMANINSTALL@%$USE_DCCMANINSTALL%g
s%@DCCINSTALL@%$DCCINSTALL%g
s%@SUBDIR_DCCIFD@%$SUBDIR_DCCIFD%g
s%@SUBDIR_DCCD@%$SUBDIR_DCCD%g
s%@SUBDIR_SRVRLIB@%$SUBDIR_SRVRLIB%g
s%@SUBDIR_DCCM@%$SUBDIR_DCCM%g
s%@CONF_DCCM_ENABLE@%$CONF_DCCM_ENABLE%g
s%@SUBDIR_THRLIB@%$SUBDIR_THRLIB%g
s%@kludge_h@%$kludge_h%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-"include/kludge.h Makefile Makefile.inc Makefile.inc2 gmake.inc dcclib/Makefile cdcc/Makefile dccproc/Makefile dccm/Makefile dccifd/Makefile dccifd/dccif.pl dccifd/dccif-test/Makefile dbclean/Makefile dccd/Makefile dblist/Makefile dccsight/Makefile homedir/Makefile homedir/dcc_conf misc/Makefile srvrlib/Makefile thrlib/Makefile misc/cron-dccd misc/crontab misc/dcc.m4 misc/fetch-testmsg-whitelist misc/newwebuser misc/rcDCC misc/start-dccd misc/start-grey misc/start-dccifd misc/start-dccm misc/stop-dccd misc/dcc-stats-collect misc/dcc-stats-graph misc/dcc-stats-init misc/stats-get misc/updatedcc cgi-bin/Makefile cgi-bin/chgpasswd cgi-bin/common cgi-bin/list-log cgi-bin/list-msg cgi-bin/edit-whiteclnt"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

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

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

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


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

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

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

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="include/dcc_config.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

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

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

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

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF

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






sed -e 's@\(HREF="[^"]*\)\.in">@\1">@' INSTALL.html > INSTALL.html$$
rm INSTALL.html; mv INSTALL.html$$ INSTALL.html


sed -e 's@\(HREF="[^"]*\)\.in">@\1">@' FAQ.html > FAQ.html$$
rm FAQ.html; mv FAQ.html$$ FAQ.html



