#
config.status, since we use the processed output as the input for
# AC_SUBST_FILE() subsitutions in other files.
# The POSIX ln(1) program. Non-POSIX systems may substitute
ar program not found. Please fix your PATH to include the directory in
which ar resides, or set AR in the environment with the full path to ar.
AC_PATH_PROGS(ETAGS, etags emacs-etags)
# Some systems,
e.g. RH7, have the Exuberant Ctags etags instead of
# GNU emacs etags, and it requires the -L flag.
if test "X$ETAGS" != "X"; then
AC_MSG_CHECKING(for Exuberant Ctags etags)
if $ETAGS --version 2>&1 | grep 'Exuberant Ctags' >
/dev/null 2>&1; then
# Perl is optional; it is used only by some of the system test scripts.
AC_PATH_PROGS(PERL, perl5 perl)
# Special processing of paths depending on whether --prefix,
# --sysconfdir or --localstatedir arguments were given. What's
# desired is some compatibility with the way previous versions
# of BIND built; they defaulted to
/usr/local for most parts of
# So ... if none of --prefix, --sysconfdir or --localstatedir are
# specified, set things up that way. If --prefix is given, use
# it for sysconfdir and localstatedir the way configure normally
# would. To change the prefix for everything but leave
named.conf# ./configure --prefix=/somewhere --sysconfdir=/etc
# ./configure --prefix=/somewhere --localstatedir=/var
# set the prefix explicitly to
/usr/local even though that's the default:
# Make sure INSTALL uses an absolute path, else it will be wrong in all
# Makefiles, since they use
make/rules.in and INSTALL will be adjusted by
# configure based on the location of the file where it is substituted.
# Since in BIND9 INSTALL is only substituted into
make/rules.in, an immediate
# subdirectory of install-sh, This relative path will be wrong for all
# directories more than one level down from install-sh.
# Not all systems have dirname.
ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
test "$ac_dir" = "$ac_prog" && ac_dir=.
test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
INSTALL="$ac_dir/$ac_prog"
# On these hosts, we really want to use cc, not gcc, even if it is
# found. The gcc that these systems have will not correctly handle
# However, if the user sets $CC to be something, let that override
if test "X$CC" = "X" ; then
# Use Sun's cc if it is available, but watch
# If setting CC here fails, the AC_PROG_CC done
# below might still find gcc.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
test -z "$ac_dir" && ac_dir=.
# gcc's optimiser is broken at -02 for ultrasparc
if test "$ac_env_CFLAGS_set" != set -a "X$GCC" = "Xyes"; then
# OSF 5.0:
recv/send are only avaliable with -D_POSIX_PII_SOCKET or
# -D_XOPEN_SOURCE_EXTENDED.
STD_CDEFINES="$STD_CDEFINES -D_POSIX_PII_SOCKET"
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
#HP-UX: need -D_XOPEN_SOURCE_EXTENDED and -lxnet for CMSG macros
STD_CDEFINES="$STD_CDEFINES -D_XOPEN_SOURCE_EXTENDED"
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
# Solaris: need -D_XPG4_2 and -D__EXTENSIONS__ for CMSG macros
STD_CDEFINES="$STD_CDEFINES -D_XPG4_2 -D__EXTENSIONS__"
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
AC_CHECK_FUNC(sysctlbyname, AC_DEFINE(HAVE_SYSCTLBYNAME))
# UnixWare 7.1.1 with the feature supplement to the UDK compiler
# is reported to not support "static inline" (RT #1212).
AC_MSG_CHECKING(for static inline breakage)
static inline int foo1() {
static inline int foo2() {
AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(uintptr_t,unsigned long)
[AC_DEFINE(ISC_SOCKADDR_LEN_T, socklen_t)],
int getsockname(int, struct sockaddr *, size_t *);
[AC_DEFINE(ISC_SOCKADDR_LEN_T, size_t)],
[AC_DEFINE(ISC_SOCKADDR_LEN_T, int)])
AC_SUBST(ISC_SOCKADDR_LEN_T)
AC_MSG_CHECKING(for long long)
AC_TRY_COMPILE([],[long long i = 0; return (0);],
ISC_PLATFORM_HAVELONGLONG="#define ISC_PLATFORM_HAVELONGLONG 1"],
ISC_PLATFORM_HAVELONGLONG="#undef ISC_PLATFORM_HAVELONGLONG"])
AC_SUBST(ISC_PLATFORM_HAVELONGLONG)
# check if we have lifconf
AC_MSG_CHECKING(for struct lifconf)
ISC_PLATFORM_HAVELIFCONF="#define ISC_PLATFORM_HAVELIFCONF 1"],
ISC_PLATFORM_HAVELIFCONF="#undef ISC_PLATFORM_HAVELIFCONF"])
AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
case $ac_cv_header_unistd_h in
[fd_set read_set; return (0);],
ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"],
case $ac_cv_header_sys_select_h in
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
case $ac_cv_header_sys_select_h in
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1"
AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH)
# Find the machine's endian flavor.
# was --with-openssl specified?
AC_MSG_CHECKING(for OpenSSL library)
[ --with-openssl[=PATH] Build with OpenSSL [yes|no|path].
use_openssl="$withval", use_openssl="auto")
if test "$use_openssl" = "auto"
if test "$use_openssl" = "yes"
# User did not specify a path - guess it
if test "$use_openssl" = "yes"
[OpenSSL was not found in any of $openssldirs; use --with-openssl=/path])
if test "$use_openssl" = "/usr"
DNS_OPENSSL_LIBS="-lcrypto"
CFLAGS="$CFLAGS $DST_OPENSSL_INC"
LIBS="$LIBS $DNS_OPENSSL_LIBS"
AC_MSG_CHECKING(whether linking with OpenSSL works)
AC_MSG_ERROR(Could not run test program using OpenSSL from
Please check the argument to --with-openssl and your
shared library configuration (
e.g., LD_LIBRARY_PATH).)],
[AC_MSG_RESULT(assuming it does work on target platform)])
AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
],[ DSO_METHOD_dlfcn(); ],
DNS_OPENSSL_LIBS="$DNS_OPENSSL_LIBS -ldl"
AC_MSG_ERROR(OpenSSL has unsupported dynamic loading)],
[AC_MSG_RESULT(assuming it does work on target platform)])
[AC_MSG_RESULT(assuming it does work on target platform)]
AC_CHECK_FUNC(DH_generate_parameters,
AC_DEFINE(HAVE_DH_GENERATE_PARAMETERS, 1,
[Define if libcrypto has DH_generate_parameters]))
AC_CHECK_FUNC(RSA_generate_key,
AC_DEFINE(HAVE_RSA_GENERATE_KEY, 1,
[Define if libcrypto has RSA_generate_key]))
AC_CHECK_FUNC(DSA_generate_parameters,
AC_DEFINE(HAVE_DSA_GENERATE_PARAMETERS, 1,
[Define if libcrypto has DSA_generate_parameters]))
# OpenSSLDie is new with CERT CS-2002-23. If we see it we have may
# have a patched library otherwise check that we are greater than
AC_CHECK_FUNC(OpenSSLDie,
AC_MSG_CHECKING(OpenSSL library version)
if (OPENSSL_VERSION_NUMBER >= 0x0090581fL)
printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
printf("Require OPENSSL_VERSION_NUMBER 0x0090581f or greater\n\n");
[AC_MSG_RESULT(not compatible)
AC_MSG_ERROR(you need OpenSSL 0.9.5a or newer)],
[AC_MSG_RESULT(assuming target platform has compatible version)])
AC_MSG_RESULT(did not find fixes for CERT CA-2002-23)
AC_MSG_CHECKING(OpenSSL library version)
if ((OPENSSL_VERSION_NUMBER >= 0x0090605fL &&
OPENSSL_VERSION_NUMBER < 0x009070000L) ||
OPENSSL_VERSION_NUMBER >= 0x00907003L)
printf("\n\nFound OPENSSL_VERSION_NUMBER %#010x\n",
printf("Require OPENSSL_VERSION_NUMBER 0x0090605f or greater (0.9.6e)\n"
"Require OPENSSL_VERSION_NUMBER 0x00907003 or greater (0.9.7-beta2)\n\n");
[AC_MSG_RESULT(not compatible)
AC_MSG_ERROR(you need OpenSSL 0.9.6e/0.9.7-beta2 (or newer): CERT CA-2002-23)],
[AC_MSG_RESULT(assuming target platform has compatible version)]))
AC_MSG_CHECKING(for OpenSSL DSA support)
AC_DEFINE(HAVE_OPENSSL_DSA)
# This would include the system openssl path (and linker options to use
# it as needed) if it is found.
AC_SUBST(DST_OPENSSL_INC)
DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_OPENSSL_LIBS"
# was --with-gssapi specified?
#AC_MSG_CHECKING(for GSSAPI library)
#[ --with-gssapi=PATH Specify path for system-supplied GSSAPI],
# use_gssapi="$withval", use_gssapi="no")
# AC_MSG_RESULT(not specified)
# AC_MSG_ERROR([--with-gssapi must specify a path])
DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DNS_GSSAPI_LIBS"
# Applications linking with libdns also need to link with these libraries.
AC_SUBST(DNS_CRYPTO_LIBS)
# was --with-randomdev specified?
AC_MSG_CHECKING(for random device)
[ --with-randomdev=PATH Specify path for random device],
use_randomdev="$withval", use_randomdev="unspec")
AC_MSG_RESULT($devrandom)
AC_CHECK_FILE($devrandom,
AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
AC_MSG_ERROR([--with-randomdev must specify a path])
AC_DEFINE_UNQUOTED(PATH_RANDOMDEV, "$use_randomdev")
AC_MSG_RESULT(using "$use_randomdev")
# Do we have arc4random() ?
AC_CHECK_FUNC(arc4random, AC_DEFINE(HAVE_ARC4RANDOM))
# We'd like to use sigwait() too
AC_CHECK_LIB(pthread, sigwait,
AC_CHECK_LIB(pthread, _Psigwait,
AC_DEFINE(HAVE_SIGWAIT),))
AC_CHECK_FUNC(pthread_attr_getstacksize,
AC_DEFINE(HAVE_PTHREAD_ATTR_GETSTACKSIZE),)
AC_CHECK_FUNC(pthread_attr_setstacksize,
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE),)
# Additional OS-specific issues related to pthreads and sigwait.
# One more place to look for sigwait.
AC_CHECK_LIB(c_r, sigwait, AC_DEFINE(HAVE_SIGWAIT),)
*-freebsd5.[[012]]|*-freebsd5.[[012]].*);;
*-freebsd5.[[3456789]]|*-freebsd5.[[3456789]].*)
AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
AC_DEFINE(NEED_PTHREAD_SCOPE_SYSTEM)
# BSDI 3.0 through 4.0.1 needs pthread_init() to be
# called before certain pthreads calls. This is deprecated
AC_DEFINE(NEED_PTHREAD_INIT)
# LinuxThreads requires some changes to the way we
AC_DEFINE(HAVE_LINUXTHREADS)
# Ensure the right sigwait() semantics on Solaris and make
# sure we call pthread_setconcurrency.
AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
AC_CHECK_FUNC(pthread_setconcurrency,
AC_DEFINE(CALL_PTHREAD_SETCONCURRENCY))
# UnixWare does things its own way.
*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
AC_DEFINE(HAVE_UNIXWARE_SIGWAIT)
# Look for sysconf to allow detection of the number of processors.
AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF),)
if test "X$GCC" = "Xyes"; then
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
STD_CDEFINES="$STD_CDEFINES -D_THREAD_SAFE"
*-sco-sysv*uw*|*-*-sysv*UnixWare*)
ALWAYS_DEFINES="-D_REENTRANT"
ISC_PLATFORM_USETHREADS="#define ISC_PLATFORM_USETHREADS 1"
ISC_PLATFORM_USETHREADS="#undef ISC_PLATFORM_USETHREADS"
AC_SUBST(ISC_PLATFORM_USETHREADS)
ISC_THREAD_DIR=$thread_dir
# In solaris 10, SMF can manage named service
AC_CHECK_LIB(scf, smf_enable_instance)
# flockfile is usually provided by pthreads, but we may want to use it
# even if compiled with --disable-threads. getc_unlocked might also not
AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
# Indicate what the final decision was regarding threads.
AC_MSG_CHECKING(whether to build with threads)
AC_ARG_ENABLE(largefile, [ --enable-largefile 64-bit file support],
want_largefile="yes", want_largefile="no")
ALWAYS_DEFINES="$ALWAYS_DEFINES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
# Additional compiler settings.
IRIX_DNSSEC_WARNINGS_HACK=""
if test "X$GCC" = "Xyes"; then
STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing"
LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
# The version of the C compiler that constantly warns about
# 'const' as well as alignment issues is unfortunately not
# able to be discerned via the version of the operating
# system, nor does cc have a version flag.
case "`$CC +W 123 2>&1`" in
# Turn off the pointlessly noisy warnings.
STD_CWARNINGS="+w1 +W 474,530,2193,2236"
LDFLAGS="-Wl,+vnocompatwarnings $LDFLAGS"
MKDEPPROG='cc -Ae -E -Wp,-M >
/dev/null 2>>$TMP'
STD_CWARNINGS="-fullwarn -woff 1209"
# Silence more than 250 instances of
# "prototyped function redeclared without prototype"
# "variable ... was set but never used"
IRIX_DNSSEC_WARNINGS_HACK="-woff 1692,1552"
*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
AC_SUBST(IRIX_DNSSEC_WARNINGS_HACK)
AC_CHECK_FUNC(catgets, AC_DEFINE(HAVE_CATGETS),)
# -lxnet buys us one big porting headache... standards, gotta love 'em.
# AC_CHECK_LIB(xnet, socket, ,
# AC_CHECK_LIB(socket, socket)
# AC_CHECK_LIB(nsl, inet_ntoa)
# Use this for now, instead:
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, inet_ntoa)
AC_MSG_CHECKING(whether to use purify)
[ --with-purify[=PATH] use Rational purify],
use_purify="$withval", use_purify="no")
AC_PATH_PROG(purify_path, purify, purify)
purify_path="$use_purify"
if test -f $purify_path || test $purify_path = purify; then
AC_MSG_RESULT($purify_path)
PURIFYFLAGS="`echo $PURIFYOPTIONS`"
PURIFY="$purify_path $PURIFYFLAGS"
AC_MSG_ERROR([$purify_path not found.
Please choose the proper path with the following command:
configure --with-purify=PATH
[ --with-libtool use GNU libtool (following indented options supported)],
use_libtool="$withval", use_libtool="no")
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
LIBTOOL_MODE_COMPILE='--mode=compile'
LIBTOOL_MODE_INSTALL='--mode=install'
LIBTOOL_MODE_LINK='--mode=link'
*) LIBTOOL_ALLOW_UNDEFINED= ;;
# File name extension for static archive files, for those few places
# where they are treated differently from dynamic ones.
AC_SUBST(LIBTOOL_MKDEP_SED)
AC_SUBST(LIBTOOL_MODE_COMPILE)
AC_SUBST(LIBTOOL_MODE_INSTALL)
AC_SUBST(LIBTOOL_MODE_LINK)
AC_SUBST(LIBTOOL_ALLOW_UNDEFINED)
AC_SUBST(LIBTOOL_IN_MAIN)
[ --enable-libbind build libbind [default=no]])
case "$enable_libbind" in
# Here begins a very long section to determine the system's networking
# capabilities. The order of the tests is signficant.
[ --enable-ipv6 use IPv6 [default=autodetect]])
# We do the IPv6 compilation checking after libtool so that we can put
# the right suffix on the files.
AC_MSG_CHECKING(for IPv6 structures)
[struct sockaddr_in6 sin6; return (0);],
# See whether IPv6 support is provided via a Kame add-on.
# This is done before other IPv6 linking tests to LIBS is properly set.
AC_MSG_CHECKING(for Kame IPv6 support)
[ --with-kame[=PATH] use Kame IPv6 [default path
/usr/local/v6]],
use_kame="$withval", use_kame="no")
Please choose the proper path with the following command:
configure --with-kame=PATH
# Including it on Kame-using platforms is very bad, though, because
# Kame uses #error against direct inclusion. So include it on only
# the platform that is otherwise broken without it --
BSD/OS 4.0 through 4.1.
# This is done before the in6_pktinfo check because that's what
ISC_PLATFORM_NEEDNETINET6IN6H="#define ISC_PLATFORM_NEEDNETINET6IN6H 1"
LWRES_PLATFORM_NEEDNETINET6IN6H="#define LWRES_PLATFORM_NEEDNETINET6IN6H 1"
ISC_PLATFORM_NEEDNETINET6IN6H="#undef ISC_PLATFORM_NEEDNETINET6IN6H"
LWRES_PLATFORM_NEEDNETINET6IN6H="#undef LWRES_PLATFORM_NEEDNETINET6IN6H"
*-sco-sysv*uw*|*-*-sysv*UnixWare*|*-*-sysv*OpenUNIX*)
ISC_PLATFORM_NEEDNETINETIN6H="#define ISC_PLATFORM_NEEDNETINETIN6H 1"
LWRES_PLATFORM_NEEDNETINETIN6H="#define LWRES_PLATFORM_NEEDNETINETIN6H 1"
ISC_PLATFORM_FIXIN6ISADDR="#define ISC_PLATFORM_FIXIN6ISADDR 1"
ISC_PLATFORM_NEEDNETINETIN6H="#undef ISC_PLATFORM_NEEDNETINETIN6H"
LWRES_PLATFORM_NEEDNETINETIN6H="#undef LWRES_PLATFORM_NEEDNETINETIN6H"
ISC_PLATFORM_FIXIN6ISADDR="#undef ISC_PLATFORM_FIXIN6ISADDR"
# Now delve deeper into the suitability of the IPv6 support.
ISC_PLATFORM_HAVEIPV6="#define ISC_PLATFORM_HAVEIPV6 1"
LWRES_PLATFORM_HAVEIPV6="#define LWRES_PLATFORM_HAVEIPV6 1"
AC_MSG_CHECKING(for in6_addr)
[struct in6_addr in6; return (0);],
ISC_PLATFORM_HAVEINADDR6="#undef ISC_PLATFORM_HAVEINADDR6"
LWRES_PLATFORM_HAVEINADDR6="#undef LWRES_PLATFORM_HAVEINADDR6"
ISC_PLATFORM_HAVEINADDR6="#define ISC_PLATFORM_HAVEINADDR6 1"
LWRES_PLATFORM_HAVEINADDR6="#define LWRES_PLATFORM_HAVEINADDR6 1"
isc_in_addr6_hack="#define in6_addr in_addr6"])
AC_MSG_CHECKING(for in6addr_any)
[struct in6_addr in6; in6 = in6addr_any; return (
in6.s6_addr[0]);],
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"],
ISC_PLATFORM_NEEDIN6ADDRANY="#define ISC_PLATFORM_NEEDIN6ADDRANY 1"
LWRES_PLATFORM_NEEDIN6ADDRANY="#define LWRES_PLATFORM_NEEDIN6ADDRANY 1"])
AC_MSG_CHECKING(for in6addr_loopback)
[struct in6_addr in6; in6 = in6addr_loopback; return (
in6.s6_addr[0]);],
ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK"
LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#undef LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK"],
ISC_PLATFORM_NEEDIN6ADDRLOOPBACK="#define ISC_PLATFORM_NEEDIN6ADDRLOOPBACK 1"
LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK="#define LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK 1"])
AC_MSG_CHECKING(for sin6_scope_id in struct sockaddr_in6)
ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
result="#define LWRES_HAVE_SIN6_SCOPE_ID 1"],
ISC_PLATFORM_HAVESCOPEID="#undef ISC_PLATFORM_HAVESCOPEID"
result="#undef LWRES_HAVE_SIN6_SCOPE_ID"])
LWRES_HAVE_SIN6_SCOPE_ID="$result"
AC_MSG_CHECKING(for in6_pktinfo)
[struct in6_pktinfo xyzzy; return (0);],
ISC_PLATFORM_HAVEIN6PKTINFO="#define ISC_PLATFORM_HAVEIN6PKTINFO 1"],
[AC_MSG_RESULT(no -- disabling runtime ipv6 support)
ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"])
ISC_PLATFORM_HAVEIPV6="#undef ISC_PLATFORM_HAVEIPV6"
LWRES_PLATFORM_HAVEIPV6="#undef LWRES_PLATFORM_HAVEIPV6"
ISC_PLATFORM_NEEDIN6ADDRANY="#undef ISC_PLATFORM_NEEDIN6ADDRANY"
LWRES_PLATFORM_NEEDIN6ADDRANY="#undef LWRES_PLATFORM_NEEDIN6ADDRANY"
ISC_PLATFORM_HAVEIN6PKTINFO="#undef ISC_PLATFORM_HAVEIN6PKTINFO"
LWRES_HAVE_SIN6_SCOPE_ID="#define LWRES_HAVE_SIN6_SCOPE_ID 1"
ISC_PLATFORM_HAVESCOPEID="#define ISC_PLATFORM_HAVESCOPEID 1"
AC_SUBST(ISC_PLATFORM_HAVEIPV6)
AC_SUBST(LWRES_PLATFORM_HAVEIPV6)
AC_SUBST(ISC_PLATFORM_NEEDNETINETIN6H)
AC_SUBST(LWRES_PLATFORM_NEEDNETINETIN6H)
AC_SUBST(ISC_PLATFORM_NEEDNETINET6IN6H)
AC_SUBST(LWRES_PLATFORM_NEEDNETINET6IN6H)
AC_SUBST(ISC_PLATFORM_HAVEINADDR6)
AC_SUBST(LWRES_PLATFORM_HAVEINADDR6)
AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRANY)
AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRANY)
AC_SUBST(ISC_PLATFORM_NEEDIN6ADDRLOOPBACK)
AC_SUBST(LWRES_PLATFORM_NEEDIN6ADDRLOOPBACK)
AC_SUBST(ISC_PLATFORM_HAVEIN6PKTINFO)
AC_SUBST(ISC_PLATFORM_FIXIN6ISADDR)
AC_SUBST(LWRES_HAVE_SIN6_SCOPE_ID)
AC_SUBST(ISC_PLATFORM_HAVESCOPEID)
AC_MSG_CHECKING([for struct if_laddrreq])
],[ struct if_laddrreq a; ],
ISC_PLATFORM_HAVEIF_LADDRREQ="#define ISC_PLATFORM_HAVEIF_LADDRREQ 1"],
ISC_PLATFORM_HAVEIF_LADDRREQ="#undef ISC_PLATFORM_HAVEIF_LADDRREQ"])
AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRREQ)
AC_MSG_CHECKING([for struct if_laddrconf])
],[ struct if_laddrconf a; ],
ISC_PLATFORM_HAVEIF_LADDRCONF="#define ISC_PLATFORM_HAVEIF_LADDRCONF 1"],
ISC_PLATFORM_HAVEIF_LADDRCONF="#undef ISC_PLATFORM_HAVEIF_LADDRCONF"])
AC_SUBST(ISC_PLATFORM_HAVEIF_LADDRCONF)
# Check for network functions that are often missing. We do this
# after the libtool checking, so we can put the right suffix on
# the files. It also needs to come after checking for a Kame add-on,
# which provides some (all?) of the desired functions.
AC_MSG_CHECKING([for inet_ntop with IPv6 support])
char a[16],b[64]; return(inet_ntop(AF_INET6, a, b, sizeof(b)) == (char*)0);}],
ISC_PLATFORM_NEEDNTOP="#undef ISC_PLATFORM_NEEDNTOP"],
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"],
[AC_MSG_RESULT(assuming inet_ntop needed)
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_ntop.$O"
ISC_PLATFORM_NEEDNTOP="#define ISC_PLATFORM_NEEDNTOP 1"])
# On NetBSD 1.4.2 and maybe others, inet_pton() incorrectly accepts
# addresses with less than four octets, like "1.2.3". Also leading
# zeros should also be rejected.
AC_MSG_CHECKING([for working inet_pton with IPv6 support])
main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
(inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
[AC_MSG_RESULT(assuming target platform has working inet_pton)
ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
[AC_MSG_RESULT(assuming inet_pton needed)
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_pton.$O"
ISC_PLATFORM_NEEDPTON="#define ISC_PLATFORM_NEEDPTON 1"],
[AC_MSG_RESULT(assuming target platform has working inet_pton)
ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"])
AC_MSG_CHECKING([for inet_aton])
[struct in_addr in; inet_aton(0, &in); return (0);],
ISC_PLATFORM_NEEDATON="#undef ISC_PLATFORM_NEEDATON"],
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS inet_aton.$O"
ISC_PLATFORM_NEEDATON="#define ISC_PLATFORM_NEEDATON 1"])
AC_SUBST(ISC_PLATFORM_NEEDNTOP)
AC_SUBST(ISC_PLATFORM_NEEDPTON)
AC_SUBST(ISC_PLATFORM_NEEDATON)
# Look for a 4.4BSD-style sa_len member in struct sockaddr.
# Turn on 4.4BSD style sa_len support.
AC_MSG_CHECKING(for sa_len in struct sockaddr)
[struct sockaddr sa;
sa.sa_len = 0; return (0);],
ISC_PLATFORM_HAVESALEN="#define ISC_PLATFORM_HAVESALEN 1"
LWRES_PLATFORM_HAVESALEN="#define LWRES_PLATFORM_HAVESALEN 1"],
ISC_PLATFORM_HAVESALEN="#undef ISC_PLATFORM_HAVESALEN"
LWRES_PLATFORM_HAVESALEN="#undef LWRES_PLATFORM_HAVESALEN"])
AC_SUBST(ISC_PLATFORM_HAVESALEN)
AC_SUBST(LWRES_PLATFORM_HAVESALEN)
# Look for a 4.4BSD or 4.3BSD struct msghdr
AC_MSG_CHECKING(for struct msghdr flavor)
ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD44MSGHDR 1"],
ISC_PLATFORM_MSGHDRFLAVOR="#define ISC_NET_BSD43MSGHDR 1"])
AC_SUBST(ISC_PLATFORM_MSGHDRFLAVOR)
AC_MSG_CHECKING(for type in_port_t)
[in_port_t port = 25; return (0);],
ISC_PLATFORM_NEEDPORTT="#undef ISC_PLATFORM_NEEDPORTT"],
ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
AC_SUBST(ISC_PLATFORM_NEEDPORTT)
AC_MSG_CHECKING(for struct addrinfo)
[struct addrinfo a; return (0);],
ISC_LWRES_NEEDADDRINFO="#undef ISC_LWRES_NEEDADDRINFO"
AC_DEFINE(HAVE_ADDRINFO)],
ISC_LWRES_NEEDADDRINFO="#define ISC_LWRES_NEEDADDRINFO 1"])
AC_SUBST(ISC_LWRES_NEEDADDRINFO)
AC_MSG_CHECKING(for struct rrsetinfo)
[struct rrsetinfo r; return (0);],
ISC_LWRES_NEEDRRSETINFO="#undef ISC_LWRES_NEEDRRSETINFO"],
ISC_LWRES_NEEDRRSETINFO="#define ISC_LWRES_NEEDRRSETINFO 1"])
AC_SUBST(ISC_LWRES_NEEDRRSETINFO)
AC_MSG_CHECKING(for int sethostent)
[int i = sethostent(0); return(0);],
ISC_LWRES_SETHOSTENTINT="#define ISC_LWRES_SETHOSTENTINT 1"],
ISC_LWRES_SETHOSTENTINT="#undef ISC_LWRES_SETHOSTENTINT"])
AC_SUBST(ISC_LWRES_SETHOSTENTINT)
AC_MSG_CHECKING(for int endhostent)
[int i = endhostent(); return(0);],
ISC_LWRES_ENDHOSTENTINT="#define ISC_LWRES_ENDHOSTENTINT 1"],
ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"])
AC_SUBST(ISC_LWRES_ENDHOSTENTINT)
AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...))
struct netent *getnetbyaddr(in_addr_t, int);],
ISC_LWRES_GETNETBYADDRINADDR="#define ISC_LWRES_GETNETBYADDRINADDR 1"],
ISC_LWRES_GETNETBYADDRINADDR="#undef ISC_LWRES_GETNETBYADDRINADDR"])
AC_SUBST(ISC_LWRES_GETNETBYADDRINADDR)
AC_MSG_CHECKING(for int setnetent)
[int i = setnetent(0); return(0);],
ISC_LWRES_SETNETENTINT="#define ISC_LWRES_SETNETENTINT 1"],
ISC_LWRES_SETNETENTINT="#undef ISC_LWRES_SETNETENTINT"])
AC_SUBST(ISC_LWRES_SETNETENTINT)
AC_MSG_CHECKING(for int endnetent)
[int i = endnetent(); return(0);],
ISC_LWRES_ENDNETENTINT="#define ISC_LWRES_ENDNETENTINT 1"],
ISC_LWRES_ENDNETENTINT="#undef ISC_LWRES_ENDNETENTINT"])
AC_SUBST(ISC_LWRES_ENDNETENTINT)
AC_MSG_CHECKING(for gethostbyaddr(const void *, size_t, ...))
struct hostent *gethostbyaddr(const void *, size_t, int);],
ISC_LWRES_GETHOSTBYADDRVOID="#define ISC_LWRES_GETHOSTBYADDRVOID 1"],
ISC_LWRES_GETHOSTBYADDRVOID="#undef ISC_LWRES_GETHOSTBYADDRVOID"])
AC_SUBST(ISC_LWRES_GETHOSTBYADDRVOID)
AC_MSG_CHECKING(for h_errno in
netdb.h)
[h_errno = 1; return(0);],
ISC_LWRES_NEEDHERRNO="#undef ISC_LWRES_NEEDHERRNO"],
ISC_LWRES_NEEDHERRNO="#define ISC_LWRES_NEEDHERRNO 1"])
AC_SUBST(ISC_LWRES_NEEDHERRNO)
AC_CHECK_FUNC(getipnodebyname,
[ISC_LWRES_GETIPNODEPROTO="#undef ISC_LWRES_GETIPNODEPROTO"],
[ISC_LWRES_GETIPNODEPROTO="#define ISC_LWRES_GETIPNODEPROTO 1"])
AC_CHECK_FUNC(getnameinfo,
[ISC_LWRES_GETNAMEINFOPROTO="#undef ISC_LWRES_GETNAMEINFOPROTO"],
[ISC_LWRES_GETNAMEINFOPROTO="#define ISC_LWRES_GETNAMEINFOPROTO 1"])
AC_CHECK_FUNC(getaddrinfo,
[ISC_LWRES_GETADDRINFOPROTO="#undef ISC_LWRES_GETADDRINFOPROTO"
AC_DEFINE(HAVE_GETADDRINFO)],
[ISC_LWRES_GETADDRINFOPROTO="#define ISC_LWRES_GETADDRINFOPROTO 1"])
AC_CHECK_FUNC(gai_strerror, AC_DEFINE(HAVE_GAISTRERROR))
AC_SUBST(ISC_LWRES_GETIPNODEPROTO)
AC_SUBST(ISC_LWRES_GETADDRINFOPROTO)
AC_SUBST(ISC_LWRES_GETNAMEINFOPROTO)
AC_ARG_ENABLE(getifaddrs,
[ --enable-getifaddrs Enable the use of getifaddrs() [[yes|no|glibc]].
glibc: Use getifaddrs() in glibc if you know it supports IPv6.],
want_getifaddrs="$enableval", want_getifaddrs="yes")
# Do we have getifaddrs() ?
# Some recent versions of glibc support getifaddrs() which does not
# provide AF_INET6 addresses while the function provided by the USAGI
# project handles the AF_INET6 case correctly. We need to avoid
# using the former but prefer the latter unless overridden by
# --enable-getifaddrs=glibc.
if test $want_getifaddrs = glibc
AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
AC_CHECK_LIB(inet6, getifaddrs,
AC_DEFINE(HAVE_GETIFADDRS),
AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAVE_GETIFADDRS))
# Look for a sysctl call to get the list of network interfaces.
case $ac_cv_header_sys_sysctl_h in
AC_MSG_CHECKING(for interface list sysctl)
AC_EGREP_CPP(found_rt_iflist, [
AC_DEFINE(HAVE_IFLIST_SYSCTL)],
# Check for some other useful functions that are not ever-present.
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
# reportedly defines strsep() without declaring it in <
string.h> when
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
# AC_CHECK_FUNC() incorrectly succeeds because it declares
AC_MSG_CHECKING(for correctly declared strsep())
AC_TRY_LINK([#include <
string.h>], [char *sp; char *foo = strsep(&sp, ".");],
[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])
AC_SUBST(ISC_PLATFORM_NEEDMEMMOVE)
[ISC_PLATFORM_NEEDSTRTOUL="#undef ISC_PLATFORM_NEEDSTRTOUL"
LWRES_PLATFORM_NEEDSTRTOUL="#undef LWRES_PLATFORM_NEEDSTRTOUL"
[ISC_PLATFORM_NEEDSTRTOUL="#define ISC_PLATFORM_NEEDSTRTOUL 1"
LWRES_PLATFORM_NEEDSTRTOUL="#define LWRES_PLATFORM_NEEDSTRTOUL 1"
GENRANDOMLIB='${ISCLIBS}'])
AC_SUBST(ISC_PLATFORM_NEEDSTRTOUL)
AC_SUBST(LWRES_PLATFORM_NEEDSTRTOUL)
[ISC_PLATFORM_NEEDSTRLCPY="#undef ISC_PLATFORM_NEEDSTRLCPY"],
[ISC_PLATFORM_NEEDSTRLCPY="#define ISC_PLATFORM_NEEDSTRLCPY 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRLCPY)
[ISC_PLATFORM_NEEDSTRLCAT="#undef ISC_PLATFORM_NEEDSTRLCAT"],
[ISC_PLATFORM_NEEDSTRLCAT="#define ISC_PLATFORM_NEEDSTRLCAT 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRLCAT)
[ char buf[2]; return(*sprintf(buf,"x"));],
ISC_PRINT_OBJS="print.$O"
ISC_PLATFORM_NEEDSPRINTF="#define ISC_PLATFORM_NEEDSPRINTF"
LWRES_PLATFORM_NEEDSPRINTF="#define LWRES_PLATFORM_NEEDSPRINTF"
[ISC_PLATFORM_NEEDSPRINTF="#undef ISC_PLATFORM_NEEDSPRINTF"
LWRES_PLATFORM_NEEDSPRINTF="#undef LWRES_PLATFORM_NEEDSPRINTF"]
AC_SUBST(ISC_PLATFORM_NEEDSPRINTF)
AC_SUBST(LWRES_PLATFORM_NEEDSPRINTF)
[ISC_PLATFORM_NEEDVSNPRINTF="#undef ISC_PLATFORM_NEEDVSNPRINTF"
LWRES_PLATFORM_NEEDVSNPRINTF="#undef LWRES_PLATFORM_NEEDVSNPRINTF"],
[ISC_PRINT_OBJS="print.$O"
ISC_PLATFORM_NEEDVSNPRINTF="#define ISC_PLATFORM_NEEDVSNPRINTF 1"
LWRES_PLATFORM_NEEDVSNPRINTF="#define LWRES_PLATFORM_NEEDVSNPRINTF 1"])
AC_SUBST(ISC_PLATFORM_NEEDVSNPRINTF)
AC_SUBST(LWRES_PLATFORM_NEEDVSNPRINTF)
ISC_EXTRA_OBJS="$ISC_EXTRA_OBJS $ISC_PRINT_OBJS"
ISC_EXTRA_SRCS="$ISC_EXTRA_SRCS $ISC_PRINT_SRCS"
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR))
# Determine the printf format characters to use when printing
# values of type isc_int64_t. This will normally be "ll", but where
# the compiler treats "long long" as a alias for "long" and printf
# doesn't know about "long long" use "l". Hopefully the sprintf
# will produce a inconsistant result in the later case. If the compiler
# fails due to seeing "%lld" we fall back to "l".
# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
# %ld even for (long long)/
# Win32 uses "%I64d", but that's defined elsewhere since we don't use
AC_MSG_CHECKING(printf format modifier for 64-bit integers)
exit((sizeof(long long int) != sizeof(long int))? 0 :
(strcmp(buf, "0") != 0));
ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
[AC_MSG_RESULT(assuming target platform uses ll)
ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
AC_SUBST(ISC_PLATFORM_QUADFORMAT)
AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
AC_CHECK_FUNC(chroot, AC_DEFINE(HAVE_CHROOT))
AC_ARG_ENABLE(linux-caps,
[ --disable-linux-caps disable linux capabilities])
case "$enable_linux_caps" in
ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
[Define if connect does not honour the permission on the UNIX domain socket.])
AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
[Define if connect does not honour the permission on the UNIX domain socket.])
AC_CHECK_FUNC(tzset, AC_DEFINE(HAVE_TZSET))
AC_MSG_CHECKING(for optarg decarartion)
GEN_NEED_OPTARG="-DNEED_OPTARG=1"
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
#
BSD/OS, and perhaps some others, don't define rlim_t.
AC_MSG_CHECKING(for type rlim_t)
[rlim_t rl = 19671212; return (0);],
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE rlim_t"],
AC_MSG_CHECKING(type of rlim_cur)
main() { struct rlimit r; exit(!(sizeof(
r.rlim_cur) == sizeof(int)));}],
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE int"],
main() { struct rlimit r; exit(!(sizeof(
r.rlim_cur) == sizeof(long int)));}],
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long int"],
main() { struct rlimit r; exit((!sizeof(
r.rlim_cur) == sizeof(long long int)));}],
[AC_MSG_RESULT(long long int)
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"],
[AC_MSG_ERROR([unable to determine sizeof rlim_cur])
],[AC_MSG_ERROR(this cannot happen)])
],[AC_MSG_ERROR(this cannot happen)])
ISC_PLATFORM_RLIMITTYPE="#define ISC_PLATFORM_RLIMITTYPE long long int"
AC_MSG_RESULT(cannot determine type of rlim_cur when cross compiling - assuming long long int)])
AC_SUBST(ISC_PLATFORM_RLIMITTYPE)
# Compaq TruCluster requires more code for handling cluster IP aliases
AC_CHECK_LIB(clua, clua_getaliasaddress, LIBS="-lclua $LIBS")
AC_CHECK_FUNC(clua_getaliasaddress,
AC_DEFINE(HAVE_TRUCLUSTER, 1,
[Define if running under Compaq TruCluster]))
# Some hosts need msg_namelen to match the size of the socket structure.
# Some hosts don't set msg_namelen appropriately on return from recvmsg().
AC_DEFINE(BROKEN_RECVMSG, 1,
[Define if recvmsg() does not meet all of the BSD socket API specifications.])
# Microsoft has their own way of handling shared libraries that requires
# additional qualifiers on extern variables. Unix systems don't need it.
AC_SUBST(ISC_PLATFORM_USEDECLSPEC)
ISC_PLATFORM_USEDECLSPEC="#undef ISC_PLATFORM_USEDECLSPEC"
AC_SUBST(LWRES_PLATFORM_USEDECLSPEC)
LWRES_PLATFORM_USEDECLSPEC="#undef LWRES_PLATFORM_USEDECLSPEC"
# Random remaining OS-specific issues involving compiler warnings.
# XXXDCL print messages to indicate some compensation is being done?
AC_SUBST(ISC_PLATFORM_BRACEPTHREADONCEINIT)
ISC_PLATFORM_BRACEPTHREADONCEINIT="#undef ISC_PLATFORM_BRACEPTHREADONCEINIT"
hack_shutup_pthreadonceinit=yes
hack_shutup_stdargcast=yes
hack_shutup_pthreadonceinit=yes
case "$hack_shutup_pthreadonceinit" in
# Shut up PTHREAD_ONCE_INIT unbraced initializer warnings.
ISC_PLATFORM_BRACEPTHREADONCEINIT="#define ISC_PLATFORM_BRACEPTHREADONCEINIT 1"
case "$hack_shutup_sigwait" in
# Shut up a -Wmissing-prototypes warning for sigwait().
AC_DEFINE(SHUTUP_SIGWAIT)
case "$hack_shutup_sputaux" in
# Shut up a -Wmissing-prototypes warning from <
stdio.h>.
AC_DEFINE(SHUTUP_SPUTAUX)
case "$hack_shutup_stdargcast" in
# Shut up a -Wcast-qual warning from va_start().
AC_DEFINE(SHUTUP_STDARG_CAST)
# Check for if_nametoindex() for IPv6 scoped addresses support
AC_CHECK_FUNC(if_nametoindex, ac_cv_have_if_nametoindex=yes,
ac_cv_have_if_nametoindex=no)
case $ac_cv_have_if_nametoindex in
AC_CHECK_LIB(ipv6, if_nametoindex,
ac_cv_have_if_nametoindex=yes
case $ac_cv_have_if_nametoindex in
ISC_PLATFORM_HAVEIFNAMETOINDEX="#define ISC_PLATFORM_HAVEIFNAMETOINDEX 1"
ISC_PLATFORM_HAVEIFNAMETOINDEX="#undef ISC_PLATFORM_HAVEIFNAMETOINDEX"
AC_SUBST(ISC_PLATFORM_HAVEIFNAMETOINDEX)
# Machine architecture dependent features
[ --enable-atomic enable machine specific atomic operations
enable_atomic="$enableval",
enable_atomic="autodetect")
ISC_PLATFORM_USEOSFASM="#undef ISC_PLATFORM_USEOSFASM"
if test "$use_atomic" = "yes"; then
AC_MSG_CHECKING([architecture type for atomic operations])
have_atomic=yes # set default
# XXX: some old x86 architectures actually do not support
# (some of) these operations. Do we need stricter checks?
exit((sizeof(void *) == 8) ? 0 : 1);
if test "$have_atomic" = "yes"; then
AC_MSG_CHECKING([compiler support for inline assembly code])
# Check whether the compiler supports the assembly syntax we provide.
if test "X$GCC" = "Xyes"; then
# GCC's ASM extension always works
if test $arch = "x86_64"; then
# We can share the same code for gcc with x86_32
# Tru64 compiler has its own syntax for inline
#error "unexpected compiler"
ISC_PLATFORM_USEGCCASM="#define ISC_PLATFORM_USEGCCASM 1"
ISC_PLATFORM_USEOSFASM="#define ISC_PLATFORM_USEOSFASM 1"
# See if the generic __asm function works. If not,
# we need to disable the atomic operations.
ISC_PLATFORM_USESTDASM="#define ISC_PLATFORM_USESTDASM 1"],
[compiler="not supported (atomic operations disabled)"
if test "$have_atomic" = "yes"; then
ISC_PLATFORM_HAVEXADD="#define ISC_PLATFORM_HAVEXADD 1"
ISC_PLATFORM_HAVECMPXCHG="#define ISC_PLATFORM_HAVECMPXCHG 1"
ISC_PLATFORM_HAVEATOMICSTORE="#define ISC_PLATFORM_HAVEATOMICSTORE 1"
ISC_PLATFORM_HAVEXADD="#undef ISC_PLATFORM_HAVEXADD"
ISC_PLATFORM_HAVECMPXCHG="#undef ISC_PLATFORM_HAVECMPXCHG"
ISC_PLATFORM_HAVEATOMICSTORE="#undef ISC_PLATFORM_HAVEATOMICSTORE"
AC_SUBST(ISC_PLATFORM_HAVEXADD)
AC_SUBST(ISC_PLATFORM_HAVECMPXCHG)
AC_SUBST(ISC_PLATFORM_HAVEATOMICSTORE)
AC_SUBST(ISC_PLATFORM_USEGCCASM)
AC_SUBST(ISC_PLATFORM_USEOSFASM)
AC_SUBST(ISC_PLATFORM_USESTDASM)
# The following sets up how non-blocking i/o is established.
# Sunos, cygwin and solaris
2.x (x<5) require special handling.
*-sunos*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK)
AC_DEFINE(USE_FIONBIO_IOCTL, 1,
[Defined if you need to use ioctl(FIONBIO) instead a fcntl call to make non-blocking.])
*) AC_DEFINE(PORT_NONBLOCK, O_NONBLOCK,
# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
# This prevents the source address being set.
*-solaris2.[[012345]]|*-solaris2.5.1)
AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
[Define if you cannot bind() before connect() for TCP sockets.])
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
# a developer editing the documentation source.
AC_PATH_PROGS(LATEX, latex, latex)
AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
AC_PATH_PROGS(W3M, w3m, w3m)
# Look for xsltproc (libxslt)
AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
# Look for xmllint (libxml2)
AC_PATH_PROG(XMLLINT, xmllint, xmllint)
# Subroutine for searching for an ordinary file (
e.g., a stylesheet)
# in a number of directories:
# NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
# If the file FILENAME is found in one of the DIRECTORIES, the shell
# variable VARIABLE is defined to its absolute pathname. Otherwise,
# it is set to FILENAME, with no directory prefix (that's not terribly
# useful, but looks less confusing in substitutions than leaving it
# empty). The variable VARIABLE will be substituted into output files.
AC_DEFUN(NOM_PATH_FILE, [
AC_MSG_RESULT("not found");
# Look for Docbook-XSL stylesheets. Location probably varies by
# system. Guessing where it might be found, based on where SGML stuff
# lives on some systems. FreeBSD is the only one I'm sure of at the
# Look for stylesheets we need.
# Same dance for db2latex
# No idea where this lives except on FreeBSD.
# Look for stylesheets we need.
# Look for "admonition" image directory. Can't use NOM_PATH_FILE()
# because it's a directory, so just do the same things, inline.
for d in $db2latex_xsl_trees
XSLT_DB2LATEX_ADMONITIONS=$dd
if test "X$XSLT_DB2LATEX_ADMONITIONS" = "X"
AC_SUBST(XSLT_DB2LATEX_ADMONITIONS)
[ --with-idn[=MPREFIX] enable IDN support using idnkit [default PREFIX]],
use_idn="$withval", use_idn="no")
if test X$prefix = XNONE ; then
[ --with-libiconv[=IPREFIX] GNU libiconv are in IPREFIX [default PREFIX]],
use_libiconv="$withval", use_libiconv="no")
if test X$prefix = XNONE ; then
[ --with-iconv[=LIBSPEC] specify iconv library [default -liconv]],
[ --with-idnlib=ARG specify libidnkit],
idnlib="$withval", idnlib="no")
if test "$idnlib" = yes; then
AC_MSG_ERROR([You must specify ARG for --with-idnlib.])
if test "$use_idn" != no; then
AC_DEFINE(WITH_IDN, 1, [define if idnkit support is to be included.])
if test "$idnlib" != no; then
IDNLIBS="$idnlib $iconvlib"
AC_CHECK_FUNCS(setlocale)
AC_SUBST(BIND9_TOP_BUILDDIR)
AC_SUBST(BIND9_ISC_BUILDINCLUDE)
AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
AC_SUBST(BIND9_DNS_BUILDINCLUDE)
AC_SUBST(BIND9_LWRES_BUILDINCLUDE)
AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
if test "X$srcdir" != "X"; then
BIND9_ISC_BUILDINCLUDE=""
BIND9_ISCCC_BUILDINCLUDE=""
BIND9_ISCCFG_BUILDINCLUDE=""
BIND9_DNS_BUILDINCLUDE=""
BIND9_LWRES_BUILDINCLUDE=""
BIND9_BIND9_BUILDINCLUDE=""
AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
AC_SUBST_FILE(BIND9_MAKE_RULES)
BIND9_VERSION="VERSION=${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
AC_SUBST_FILE(LIBISC_API)
AC_SUBST_FILE(LIBISCCC_API)
AC_SUBST_FILE(LIBISCCFG_API)
AC_SUBST_FILE(LIBDNS_API)
AC_SUBST_FILE(LIBBIND9_API)
AC_SUBST_FILE(LIBLWRES_API)
# Configure any DLZ drivers.
# USE_DLZ to a non-empty value, which will be our clue to
# enable the DLZ core functions.
# This section has to come after the libtool stuff because it needs to
# know how to name the driver object files.
AC_CONFIG_FILES([$DLZ_DRIVER_RULES])
AC_SUBST(DLZ_DRIVER_INCLUDES)
AC_SUBST(DLZ_DRIVER_LIBS)
AC_SUBST(DLZ_DRIVER_SRCS)
AC_SUBST(DLZ_DRIVER_OBJS)
AC_SUBST_FILE(DLZ_DRIVER_RULES)
if test "cross_compiling" = "yes"; then
if test -z "$BUILD_CC"; then
AC_ERROR([BUILD_CC not set])
BUILD_CFLAGS="$BUILD_CFLAGS"
BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
BUILD_LDFLAGS="$BUILD_LDFLAGS"
BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
# Don't just put these into configure, it won't work right if somebody
# Files to configure. These are listed here because we used to
# specify them as arguments to AC_OUTPUT. It's (now) ok to move these
# elsewhere if there's a good reason for doing so.
# Tell Emacs to edit this file in shell mode.