configure.in revision ad9107efaaae2407cf11bf0c55407d8daed2e2d4
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# Copyright (C) 1998-2003 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# Permission to use, copy, modify, and/or distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# copyright notice and this permission notice appear in all copies.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1633838b8255282d10af15c5c84cee5a51466712Bob Halley# PERFORMANCE OF THIS SOFTWARE.
d25afd60ee2286cb171c4960a790f3d7041b6f85Bob HalleyAC_DIVERT_PUSH(1)dnl
d25afd60ee2286cb171c4960a790f3d7041b6f85Bob Halleyesyscmd([sed "s/^/# /" COPYRIGHT])dnl
d25afd60ee2286cb171c4960a790f3d7041b6f85Bob HalleyAC_DIVERT_POP()dnl
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_REVISION($Revision: 1.502 $)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PREREQ(2.59)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CONFIG_HEADER(config.h)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CANONICAL_HOST
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PROG_MAKE_SET
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# GNU libtool support
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $build_os in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Just set the maximum command line length for sunos as it otherwise
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # takes a exceptionally long time to work it out. Required for libtool.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley lt_cv_sys_max_cmd_len=4096;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PROG_LIBTOOL
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PROG_INSTALL
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(STD_CINCLUDES)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(STD_CDEFINES)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(STD_CWARNINGS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(CCOPT)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Warn if the user specified libbind, which is now deprecated
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(libbind, [ --enable-libbind deprecated])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$enable_libbind" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(['libbind' is no longer part of the BIND 9 distribution.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyIt is available from http://www.isc.org as a separate download.])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Make very sure that these are the first files processed by
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# config.status, since we use the processed output as the input for
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# AC_SUBST_FILE() substitutions in other files.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PATH_PROG(AR, ar)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyARFLAGS="cruv"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ARFLAGS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# The POSIX ln(1) program. Non-POSIX systems may substitute
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# "copy" or something.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$AR" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyar program not found. Please fix your PATH to include the directory in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleywhich ar resides, or set AR in the environment with the full path to ar.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PATH_PROGS(ETAGS, etags emacs-etags)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Some systems, e.g. RH7, have the Exuberant Ctags etags instead of
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# GNU emacs etags, and it requires the -L flag.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif test "X$ETAGS" != "X"; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(for Exuberant Ctags etags)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >/dev/null 2>&1; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ETAGS="$ETAGS -L"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ETAGS)
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# Perl is optional; it is used only by some of the system test scripts.
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# Note: the backtrace feature (see below) uses perl to build the symbol table,
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# but it still compiles without perl, in which case an empty table will be used.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_PATH_PROGS(PERL, perl5 perl)
3740b569ae76295b941d57a724a43beb75b533baBob HalleyAC_SUBST(PERL)
3740b569ae76295b941d57a724a43beb75b533baBob Halley# Special processing of paths depending on whether --prefix,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# --sysconfdir or --localstatedir arguments were given. What's
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# desired is some compatibility with the way previous versions
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# of BIND built; they defaulted to /usr/local for most parts of
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# the installation, but named.boot/named.conf was in /etc
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# So ... if none of --prefix, --sysconfdir or --localstatedir are
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# specified, set things up that way. If --prefix is given, use
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# it for sysconfdir and localstatedir the way configure normally
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# would. To change the prefix for everything but leave named.conf
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# in /etc or named.pid in /var/run, then do this the usual configure way:
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# ./configure --prefix=/somewhere --sysconfdir=/etc
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# ./configure --prefix=/somewhere --localstatedir=/var
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# To put named.conf and named.pid in /usr/local with everything else,
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# set the prefix explicitly to /usr/local even though that's the default:
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley# ./configure --prefix=/usr/local
577179503f2eb7695ec668d8eeb41889a150e28fBob Halleycase "$prefix" in
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley case "$sysconfdir" in
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley '${prefix}/etc')
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley sysconfdir=/etc
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley case "$localstatedir" in
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley '${prefix}/var')
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley localstatedir=/var
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Make sure INSTALL uses an absolute path, else it will be wrong in all
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Makefiles, since they use make/rules.in and INSTALL will be adjusted by
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# configure based on the location of the file where it is substituted.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Since in BIND9 INSTALL is only substituted into make/rules.in, an immediate
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# subdirectory of install-sh, This relative path will be wrong for all
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# directories more than one level down from install-sh.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$INSTALL" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Not all systems have dirname.
3740b569ae76295b941d57a724a43beb75b533baBob Halley changequote({, })
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley changequote([, ])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley test "$ac_dir" = "$ac_prog" && ac_dir=.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley INSTALL="$ac_dir/$ac_prog"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# On these hosts, we really want to use cc, not gcc, even if it is
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# found. The gcc that these systems have will not correctly handle
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# However, if the user sets $CC to be something, let that override
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# our change.
3740b569ae76295b941d57a724a43beb75b533baBob Halleyif test "X$CC" = "X" ; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Use Sun's cc if it is available, but watch
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # out for /usr/ucb/cc; it will never be the right
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # compiler to use.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # If setting CC here fails, the AC_PROG_CC done
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # below might still find gcc.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley for ac_dir in $PATH; do
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley test -z "$ac_dir" && ac_dir=.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$ac_dir" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test -f "$ac_dir/cc"; then
3740b569ae76295b941d57a724a43beb75b533baBob Halley IFS="$ac_save_ifs"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley mips-sgi-irix*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# gcc's optimiser is broken at -02 for ultrasparc
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCFLAGS="-g -O1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# OS dependent CC flags
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # OSF 5.0: recv/send are only available with -D_POSIX_PII_SOCKET or
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # -D_XOPEN_SOURCE_EXTENDED.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley #HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="-lxnet $LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # parts of the IPv6 Advanced Socket API as a result. This is stupid
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # as it breaks how the two halves (Basic and Advanced) of the IPv6
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Socket API were designed to be used but we have to live with it.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_GNU_SOURCE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_HEADER_STDC
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[$ac_includes_default
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley#ifdef HAVE_SYS_PARAM_H
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_C_VOLATILE
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_C_FLEXIBLE_ARRAY_MEMBER
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Older versions of HP/UX don't define seteuid() and setegid()
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNCS(seteuid setresuid)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNCS(setegid setresgid)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# UnixWare 7.1.1 with the feature supplement to the UDK compiler
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# is reported to not support "static inline" (RT #1212).
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for static inline breakage)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE(, [
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley static inline int foo1() {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley static inline int foo2() {
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley return foo1();
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(inline, )])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TYPE_SIZE_T
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_TYPE(ssize_t, int)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_TYPE(uintptr_t,unsigned long)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_TYPE(socklen_t,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE(
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyint getsockname(int, struct sockaddr *, size_t *);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_SOCKADDR_LEN_T)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_HEADER_TIME
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for long long)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE([],[long long i = 0; return (0);],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_HAVELONGLONG)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# check for GCC noreturn attribute
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for GCC noreturn attribute)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_NORETURN_PRE)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_NORETURN_POST)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# check if we have lifconf
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for struct lifconf)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleystruct lifconf lifconf;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_HAVELIFCONF)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# check if we have kqueue
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(kqueue,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [ --enable-kqueue use BSD kqueue when available [[default=yes]]],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley want_kqueue="$enableval", want_kqueue="yes")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $want_kqueue in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $ac_cv_have_kqueue in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# so we need to try running the code, not just test its existence.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(epoll,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --enable-epoll use Linux epoll when available [[default=auto]]],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley want_epoll="$enableval", want_epoll="auto")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $want_epoll in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(epoll support)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_RUN([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if (epoll_create(1) < 0)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
3740b569ae76295b941d57a724a43beb75b533baBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_HAVEEPOLL)
3740b569ae76295b941d57a724a43beb75b533baBob Halley# check if we support /dev/poll
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(devpoll,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [ --enable-devpoll use /dev/poll when available [[default=yes]]],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley want_devpoll="$enableval", want_devpoll="yes")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $want_devpoll in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_HEADERS(sys/devpoll.h,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
3740b569ae76295b941d57a724a43beb75b533baBob HalleyAC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# check if we need to #include sys/select.h explicitly
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $ac_cv_header_unistd_h in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_TRY_COMPILE([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley#include <sys/types.h> /* Ultrix */
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[fd_set read_set; return (0);],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $ac_cv_header_sys_select_h in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([need either working unistd.h or sys/select.h])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $ac_cv_header_sys_select_h in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([need either unistd.h or sys/select.h])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Find the machine's endian flavor.
3740b569ae76295b941d57a724a43beb75b533baBob HalleyAC_C_BIGENDIAN
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# was --with-openssl specified?
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyOPENSSL_WARNING=
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for OpenSSL library)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_WITH(openssl,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley (Required for DNSSEC)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_openssl="$withval", use_openssl="auto")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyopenssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
3740b569ae76295b941d57a724a43beb75b533baBob Halleyif test "$use_openssl" = "auto"
3740b569ae76295b941d57a724a43beb75b533baBob Halley for d in $openssldirs
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_openssl=$d
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_openssl" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_OPENSSL_INC=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_OPENSSL=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKOBJS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKSRCS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_OPENSSL_INC=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_OPENSSL=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKOBJS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKSRCS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyIf you don't want OpenSSL, use --without-openssl])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$use_openssl" = "yes"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # User did not specify a path - guess it
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley for d in $openssldirs
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_openssl=$d
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$use_openssl" = "yes"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(not found)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley elif ! test -f "$use_openssl"/include/openssl/opensslv.h
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_OPENSSL='-DOPENSSL'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$use_openssl" = "/usr"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_OPENSSL_INC=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="-lcrypto"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_OPENSSL_INC="-I$use_openssl/include"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $host in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="-L$use_openssl/lib -R$use_openssl/lib -lcrypto"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="-L$use_openssl/lib -Wl,+b: -lcrypto"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-apple-darwin*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Apple's ld seaches for serially for dynamic
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # then static libraries. This means you can't
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # use -L to override dynamic system libraries
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # with static ones when linking. Instead
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # we specify a absolute path.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="$use_openssl/lib/libcrypto.a"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="-L$use_openssl/lib -lcrypto"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(using OpenSSL from $use_openssl/lib and $use_openssl/include)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley saved_cflags="$CFLAGS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley saved_libs="$LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CFLAGS="$CFLAGS $DST_OPENSSL_INC"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$LIBS $DNS_OPENSSL_LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(whether linking with OpenSSL works)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_RUN([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ERR_clear_error();
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(Could not run test program using OpenSSL from
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyPlease check the argument to --with-openssl and your
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyshared library configuration (e.g., LD_LIBRARY_PATH).)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(assuming it does work on target platform)])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_LINK([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ DSO_METHOD_dlfcn(); ],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(no)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [LIBS="$LIBS -ldl"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_LINK([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley],[ DSO_METHOD_dlfcn(); ],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(unknown)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(assuming it does work on target platform)])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(assuming it does work on target platform)]
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(openssl-version-check,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[AC_HELP_STRING([--enable-openssl-version-check],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [Check OpenSSL Version @<:@default=yes@:>@])])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$enable_openssl_version_check" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(OpenSSL library version)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_RUN([
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if ((OPENSSL_VERSION_NUMBER >= 0x009070cfL &&
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSL_VERSION_NUMBER < 0x00908000L) ||
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSL_VERSION_NUMBER >= 0x0090804fL)
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSL_VERSION_NUMBER);
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley printf("Require OPENSSL_VERSION_NUMBER 0x009070cf or greater (0.9.7l)\n"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "Require OPENSSL_VERSION_NUMBER 0x0090804f or greater (0.9.8d)\n\n");
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(ok)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(not compatible)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSL_WARNING=yes
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [AC_MSG_RESULT(assuming target platform has compatible version)])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(Skipped OpenSSL version check)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(for OpenSSL DSA support)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_OPENSSL_DSA)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNCS(EVP_sha256 EVP_sha512)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CFLAGS="$saved_cflags"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$saved_libs"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKOBJS='${OPENSSLLINKOBJS}'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley OPENSSLLINKSRCS='${OPENSSLLINKSRCS}'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# This would include the system openssl path (and linker options to use
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# it as needed) if it is found.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(USE_OPENSSL)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(DST_OPENSSL_INC)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(OPENSSLLINKOBJS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(OPENSSLLINKSRCS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyDNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Use OpenSSL for hash functions
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(openssl-hash,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [ --enable-openssl-hash use OpenSSL for hash functions [[default=no]]],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley want_openssl_hash="$enableval", want_openssl_hash="no")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $want_openssl_hash in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$USE_OPENSSL" = ""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([No OpenSSL for hash functions])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_OPENSSLHASH="#define ISC_PLATFORM_OPENSSLHASH 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_OPENSSL_INC="$DST_OPENSSL_INC"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_OPENSSL_INC=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_OPENSSLHASH)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_OPENSSL_INC)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# PKCS11 (aka crypto hardware) support
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# This works only with the right OpenSSL with PKCS11 engine!
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for PKCS11 support)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_WITH(pkcs11,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --with-pkcs11[=PATH] Build with PKCS11 support [yes|no|path]
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley (PATH is for the PKCS11 provider)],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_pkcs11="$withval", use_pkcs11="no")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_pkcs11" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(disabled)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_PKCS11=''
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley PKCS11_TOOLS=''
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(using OpenSSL with PKCS11 support)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_PKCS11='-DUSE_PKCS11'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley PKCS11_TOOLS=pkcs11
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(USE_PKCS11)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(PKCS11_TOOLS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for PKCS11 tools)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_pkcs11" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(disabled)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley PKCS11_PROVIDER="undefined"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(PKCS11 provider is "$use_pkcs11")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley PKCS11_PROVIDER="$use_pkcs11"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(PKCS11_PROVIDER)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for GSSAPI library)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_WITH(gssapi,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_gssapi="$withval", use_gssapi="no")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleygssapidirs="/usr/local /usr/pkg /usr/kerberos /usr"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif test "$use_gssapi" = "yes"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley for d in $gssapidirs
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test -f $d/include/gssapi/gssapi.h -o -f $d/include/gssapi.h
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_gssapi=$d
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_gssapi" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(disabled)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_GSSAPI=''
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([--with-gssapi must specify a path])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(looking in $use_gssapi/lib)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley USE_GSSAPI='-DGSSAPI'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley saved_cppflags="$CPPFLAGS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$ISC_PLATFORM_GSSAPIHEADER" = ""; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([gssapi.h not found])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$ISC_PLATFORM_KRB5HEADER" = ""; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([krb5.h not found])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CPPFLAGS="$saved_cppflags"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # XXXDCL This probably doesn't work right on all systems.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # It will need to be worked on as problems become evident.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Essentially the problems here relate to two different
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # areas. The first area is building with either KTH
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # or MIT Kerberos, particularly when both are present on
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # the machine. The other is static versus dynamic linking.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # On the KTH vs MIT issue, Both have libkrb5 that can mess
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # up the works if one implementation ends up trying to
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # use the other's krb. This is unfortunately a situation
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # that very easily arises.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Dynamic linking when the dependency information is built
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # all such problems go away, but when that setup is not
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # present, because either the dynamic libraries lack
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # dependencies or static linking is being done, then the
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # problems start to show up.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley saved_libs="$LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley for TRY_LIBS in \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi_krb5" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgssapi -lkrb5 -lcrypto -lcrypt -lasn1 -lroken -lcom_err" \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "-lgss -lkrb5"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Note that this does not include $saved_libs, because
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # on FreeBSD machines this configure script has added
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # -L/usr/local/lib to LIBS, which can make the
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # -lgssapi_krb5 test succeed with shared libraries even
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # when you are trying to build with KTH in /usr/lib.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="-L$use_gssapi/lib $TRY_LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(linking as $TRY_LIBS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley gssapi_linked=yes, gssapi_linked=no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $gssapi_linked in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley yes) AC_MSG_RESULT(yes); break ;;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley no) AC_MSG_RESULT(no) ;;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $gssapi_linked in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # but MIT in /usr/local/lib and trying to build with KTH.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # /usr/local/lib can end up earlier on the link lines.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Like most kludges, this one is not only inelegant it
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # is also likely to be the wrong thing to do at least as
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # many times as it is the right thing. Something better
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # needs to be done.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$use_gssapi" = "/usr" -a \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley FIX_KTH_VS_MIT=yes
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$FIX_KTH_VS_MIT" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$enable_static_linking" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley yes) gssapi_lib_suffix=".a" ;;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *) gssapi_lib_suffix=".so" ;;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley for lib in $LIBS; do
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $lib in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley new_lib=`echo $lib |
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley sed -e s%^-l%$use_gssapi/lib/lib% \
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley -e s%$%$gssapi_lib_suffix%`
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley NEW_LIBS="$NEW_LIBS $new_lib"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$NEW_LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_GSSAPI_INC="-I$use_gssapi/include"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DNS_GSSAPI_LIBS="$LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$saved_libs"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_KRB5HEADER)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(USE_GSSAPI)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(DST_GSSAPI_INC)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(DNS_GSSAPI_LIBS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyDNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Applications linking with libdns also need to link with these libraries.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(DNS_CRYPTO_LIBS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# was --with-randomdev specified?
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for random device)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_WITH(randomdev,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --with-randomdev=PATH Specify path for random device],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_randomdev="$withval", use_randomdev="unspec")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_randomdev" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
577179503f2eb7695ec668d8eeb41889a150e28fBob Halley AC_MSG_RESULT($devrandom)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FILE($devrandom,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley "$devrandom"),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_ERROR([--with-randomdev must specify a path])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(disabled)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(using "$use_randomdev")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Do we have arc4random() ?
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif $use_threads
3740b569ae76295b941d57a724a43beb75b533baBob Halley if test "X$GCC" = "Xyes"; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$LIBS -lthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $host in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -pthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -mt"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -mt"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-sco-sysv*uw*|*-*-sysv*UnixWare*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -Kthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -Kthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-*-sysv*OpenUNIX*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -Kpthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -Kpthread"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ALWAYS_DEFINES="-D_REENTRANT"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley THREADOPTOBJS='${THREADOPTOBJS}'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley THREADOPTSRCS='${THREADOPTSRCS}'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley thread_dir=pthreads
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # We'd like to use sigwait() too
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(sigwait,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_SIGWAIT),
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(c, sigwait,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_SIGWAIT),
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(pthread, sigwait,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_SIGWAIT),
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(pthread, _Psigwait,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_SIGWAIT),))))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(pthread_attr_getstacksize,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(pthread_attr_setstacksize,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Additional OS-specific issues related to pthreads and sigwait.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # One more place to look for sigwait.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $host in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-freebsd6.*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # BSDI 3.0 through 4.0.1 needs pthread_init() to be
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # called before certain pthreads calls. This is deprecated
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-bsdi3.*|*-bsdi4.0*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(NEED_PTHREAD_INIT)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # LinuxThreads requires some changes to the way we
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # deal with signals.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_LINUXTHREADS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Ensure the right sigwait() semantics on Solaris and make
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # sure we call pthread_setconcurrency.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(pthread_setconcurrency,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # UnixWare does things its own way.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Look for sysconf to allow detection of the number of processors.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley thread_dir=nothreads
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley THREADOPTOBJS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley THREADOPTSRCS=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ALWAYS_DEFINES=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ALWAYS_DEFINES)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_PLATFORM_USETHREADS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(THREADOPTOBJS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(THREADOPTSRCS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyISC_THREAD_DIR=$thread_dir
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(ISC_THREAD_DIR)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# was --with-libxml2 specified?
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_MSG_CHECKING(for libxml2 library)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_WITH(libxml2,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley[ --with-libxml2[=PATH] Build with libxml2 library [yes|no|path]],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley use_libxml2="$withval", use_libxml2="auto")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$use_libxml2" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley DST_LIBXML2_INC=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case X`(xml2-config --version) 2>/dev/null` in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley X2.[[67]].*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley libxml2_libs=`xml2-config --libs`
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley libxml2_cflags=`xml2-config --cflags`
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley libxml2_libs=
3740b569ae76295b941d57a724a43beb75b533baBob Halley libxml2_cflags=
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test -f "$use_libxml2/bin/xml2-config" ; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif test "X$libxml2_libs" != "X"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CFLAGS="$CFLAGS $libxml2_cflags"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LIBS="$LIBS $libxml2_libs"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# In solaris 10, SMF can manage named service
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_LIB(scf, smf_enable_instance)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# flockfile is usually provided by pthreads, but we may want to use it
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# even if compiled with --disable-threads. getc_unlocked might also not
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# be defined.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Indicate what the final decision was regarding threads.
3740b569ae76295b941d57a724a43beb75b533baBob HalleyAC_MSG_CHECKING(whether to build with threads)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif $use_threads; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# End of pthreads stuff.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley want_largefile="yes", want_largefile="no")
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase $want_largefile in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Additional compiler settings.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyMKDEPCC="$CC"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyMKDEPCFLAGS="-M"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyIRIX_DNSSEC_WARNINGS_HACK=""
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleyif test "X$GCC" = "Xyes"; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_CHECKING(if "$CC" supports -fno-strict-aliasing)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley SAVE_CFLAGS=$CFLAGS
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CFLAGS="$CFLAGS -fno-strict-aliasing"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_TRY_COMPILE(,, [FNOSTRICTALIASING=yes],[FNOSTRICTALIASING=no])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CFLAGS=$SAVE_CFLAGS
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley if test "$FNOSTRICTALIASING" = "yes"; then
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(yes)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_MSG_RESULT(no)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case $host in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -std"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -std"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley MKDEPCC="$CC"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CC="$CC -Ae -z"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # The version of the C compiler that constantly warns about
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # 'const' as well as alignment issues is unfortunately not
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # able to be discerned via the version of the operating
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # system, nor does cc have a version flag.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley case "`$CC +W 123 2>&1`" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *Unknown?option*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CWARNINGS="+w1"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Turn off the pointlessly noisy warnings.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CWARNINGS="+w1 +W 474,530,2193,2236"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley CCOPT="$CCOPT -Ae -z"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley MKDEPPROG='cc -Ae -E -Wp,-M >/dev/null 2>>$TMP'
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-sgi-irix*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley STD_CWARNINGS="-fullwarn -woff 1209"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # Silence more than 250 instances of
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # "prototyped function redeclared without prototype"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # and 11 instances of
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley # "variable ... was set but never used"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley MKDEPCFLAGS="-xM"
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(MKDEPCC)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(MKDEPCFLAGS)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(MKDEPPROG)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob HalleyAC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# -lxnet buys us one big porting headache... standards, gotta love 'em.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# AC_CHECK_LIB(xnet, socket, ,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# AC_CHECK_LIB(socket, socket)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Use this for now, instead:
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley mips-sgi-irix*)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(socket, socket)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_CHECK_LIB(nsl, inet_addr)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Work around Solaris's select() limitations.
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halleycase "$host" in
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley *-solaris2.[[89]]|*-solaris2.1?)
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley AC_DEFINE(FD_SETSIZE, 65536,
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley [Solaris hack to get select_large_fdset.])
c50fd34a4e0e6978f8ca5f6f3ad8545549c3cfeeBob Halley# Purify support
*-ibm-aix*) LIBTOOL_IN_MAIN="-Wl,-bI:T_testlist.imp" ;;
# enable/disable dumping stack backtrace. Also check if the system supports
AC_TRY_LINK([#include <execinfo.h>],
LIBEXPORT=lib/export
[[EPREFIX/lib/bind9]]],
export_libdir="\${exec_prefix}/lib/bind9/"
export library [[PREFIX/include/bind9]]],
export_includedir="\${prefix}/include/bind9/"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>],
[ --with-kame[=PATH] use Kame IPv6 [default path /usr/local/v6]],
kame_path=/usr/local/v6
if test -f $kame_path/lib/libinet6.a; then
AC_MSG_RESULT($kame_path/lib/libinet6.a)
LIBS="-L$kame_path/lib -linet6 $LIBS"
AC_MSG_ERROR([$kame_path/lib/libinet6.a not found.
# the platform that is otherwise broken without it -- BSD/OS 4.0 through 4.1.
# netinet6/in6.h is needed for.
isc_netinet6in6_hack="#include <netinet6/in6.h>"
# This is similar to the netinet6/in6.h issue.
isc_netinetin6_hack="#include <netinet/in6.h>"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
[struct in6_addr in6; in6 = in6addr_any; return (in6.s6_addr[0]);],
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
[struct in6_addr in6; in6 = in6addr_loopback; return (in6.s6_addr[0]);],
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
[struct sockaddr_in6 xyzzy; xyzzy.sin6_scope_id = 0; return (0);],
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
ISC_IPV6_H="ipv6.h"
ISC_ISCIPV6_O="unix/ipv6.$O"
ISC_IPV6_C="ipv6.c"
#include <sys/types.h>
#include <net/if6.h>
#include <sys/types.h>
#include <net/if6.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_ntop.c"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS inet_pton.c"
#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr sa; sa.sa_len = 0; return (0);],
#include <sys/types.h>
#include <sys/socket.h>],
[struct msghdr msg; msg.msg_flags = 0; return (0);],
#include <sys/types.h>
#include <netinet/in.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>
#include <netdb.h>],
#include <netdb.h>],
#include <netdb.h>
AC_MSG_CHECKING(for h_errno in netdb.h)
#include <netdb.h>],
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
# ...and same for gai_strerror().
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
# /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
# reportedly defines strsep() without declaring it in <string.h> when
AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
#include <stdio.h>
ISC_PRINT_SRCS="print.c"
ISC_PRINT_SRCS="print.c"
DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
AC_MSG_RESULT(using SPNEGO from lib/dns)
#include <stdio.h>
AC_CHECK_HEADERS(sys/prctl.h)
AC_CHECK_HEADERS(sys/un.h,
#include <unistd.h>
# BSD/OS, and perhaps some others, don't define rlim_t.
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(int)));}],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit(!(sizeof(r.rlim_cur) == sizeof(long int)));}],
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
main() { struct rlimit r; exit((!sizeof(r.rlim_cur) == sizeof(long long int)));}],
AC_CHECK_HEADERS(sys/dyntune.h)
AC_TRY_COMPILE([ #include <pthread.h> ], [ static pthread_once_t once_test = { PTHREAD_ONCE_INIT }; ], [hack_shutup_pthreadonceinit=yes], )
# Shut up a -Wmissing-prototypes warning from <stdio.h>.
AC_CHECK_HEADERS(strings.h,
# zero. Under linux/ibm it is "0" for register 0.
# Sunos, cygwin and solaris 2.x (x<5) require special handling.
# Subroutine for searching for an ordinary file (e.g., a stylesheet)
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_HTML, html/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_XHTML, xhtml/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_STYLE_MAN, manpages/docbook.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_HTML, html/chunk.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNK_XHTML, xhtml/chunk.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_HTML, html/chunktoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_CHUNKTOC_XHTML, xhtml/chunktoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_HTML, html/maketoc.xsl, $docbook_xsl_trees)
NOM_PATH_FILE(XSLT_DOCBOOK_MAKETOC_XHTML, xhtml/maketoc.xsl, $docbook_xsl_trees)
db2latex_xsl_trees="/usr/local/share"
NOM_PATH_FILE(XSLT_DB2LATEX_STYLE, db2latex/xsl/docbook.xsl, $db2latex_xsl_trees)
AC_MSG_CHECKING(for db2latex/xsl/figures)
XSLT_DB2LATEX_ADMONITIONS=db2latex/xsl/figures
idn_path=/usr/local
STD_CINCLUDES="$STD_CINCLUDES -I$idn_path/include"
IDNLIBS="-L$idn_path/lib -lidnkit $iconvlib"
AC_CHECK_HEADERS(locale.h)
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
BIND9_LWRES_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/lwres/include"
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
LIBISC_API=$srcdir/lib/isc/api
LIBISCCC_API=$srcdir/lib/isccc/api
LIBISCCFG_API=$srcdir/lib/isccfg/api
LIBDNS_API=$srcdir/lib/dns/api
LIBBIND9_API=$srcdir/lib/bind9/api
LIBLWRES_API=$srcdir/lib/lwres/api
LIBIRS_API=$srcdir/lib/irs/api
# If config.dlz.in selects one or more DLZ drivers, it will set
sinclude(contrib/dlz/config.dlz.in)
DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
DLZ_DRIVER_RULES=/dev/null
# Commands to run at the end of config.status.
# runs config.status directly (which autoconf allows).