2018-02-23 09:53:12 +01:00
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
2014-03-10 23:46:12 +00:00
#
2016-06-27 14:56:38 +10:00
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
2018-02-23 09:53:12 +01:00
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
2014-03-10 12:14:35 -07:00
2019-02-21 16:04:33 -08:00
AC_INIT(BIND, [9.15], [info@isc.org], [], [https://www.isc.org/downloads/BIND/])
2018-08-28 21:27:48 +02:00
AC_PREREQ([2.60])
1998-12-11 20:10:26 +00:00
2019-06-19 14:26:49 +02:00
#
# Enable maintainer mode by default, but allow to disable it in the CI
#
AM_MAINTAINER_MODE([enable])
1998-12-11 20:10:26 +00:00
AC_CONFIG_HEADER(config.h)
2018-06-12 11:26:04 +02:00
AC_CONFIG_MACRO_DIR([m4])
1998-12-11 20:10:26 +00:00
AC_CANONICAL_HOST
2019-03-07 13:32:30 +01:00
#
# Enable system extensions to C and POSIX
#
2018-08-28 21:27:48 +02:00
AC_USE_SYSTEM_EXTENSIONS
2019-03-07 13:32:30 +01:00
#
# Enable large file support
#
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
2019-05-29 11:19:34 +02:00
LFS_CFLAGS=`getconf LFS_CFLAGS 2>/dev/null`
LFS_LDFLAGS=`getconf LFS_LDFLAGS 2>/dev/null`
LFS_LIBS=`getconf LFS_LIBS 2>/dev/null`
AC_SUBST([LFS_CFLAGS])
AC_SUBST([LFS_LDFLAGS])
AC_SUBST([LFS_LIBS])
2018-08-28 21:27:48 +02:00
# Enable RFC 3542 APIs on macOS
AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
1998-12-11 20:10:26 +00:00
1999-04-29 05:19:29 +00:00
AC_PROG_MAKE_SET
2009-06-10 02:23:42 +00:00
2009-01-19 01:39:50 +00:00
AC_PROG_LIBTOOL
1999-04-29 05:19:29 +00:00
AC_PROG_INSTALL
2005-06-20 01:05:33 +00:00
AC_PROG_LN_S
2018-11-06 17:09:08 +07:00
AX_POSIX_SHELL
1999-04-29 05:19:29 +00:00
AC_SUBST(STD_CINCLUDES)
AC_SUBST(STD_CDEFINES)
AC_SUBST(STD_CWARNINGS)
2000-06-23 22:38:26 +00:00
AC_SUBST(CCOPT)
2013-07-09 11:47:16 -07:00
AC_SUBST(CCNOOPT)
2014-02-12 09:07:54 +11:00
AC_SUBST(BACKTRACECFLAGS)
1999-04-29 05:19:29 +00:00
2018-06-04 08:54:58 +02:00
#
# Use pkg-config
#
PKG_PROG_PKG_CONFIG
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(buffer_useinline,
AS_HELP_STRING([--enable-buffer-useinline],
[define ISC_BUFFER_USEINLINE when compiling
[default=yes]]),
2017-11-08 23:28:10 +11:00
if test yes = "${enable}"
then
AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
[Define if you want to use inline buffers])
fi,
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
2019-06-19 11:16:47 +02:00
AC_ARG_ENABLE([warn_shadow],
[AS_HELP_STRING([--enable-warn-shadow],
[turn on -Wshadow when compiling])])
2015-01-20 13:29:18 -08:00
2019-06-19 11:16:47 +02:00
AC_ARG_ENABLE([warn_error],
[AS_HELP_STRING([--enable-warn-error],
[turn on -Werror when compiling])])
AC_ARG_ENABLE([developer],
[AS_HELP_STRING([--enable-developer],
[enable developer build settings])])
2014-07-08 15:51:40 +10:00
2017-01-12 14:02:51 +11:00
XTARGETS=
2019-06-19 11:16:47 +02:00
AS_IF([test "$enable_developer" = "yes"],
[STD_CDEFINES="$STD_CDEFINES -DISC_MEM_DEFAULTFILL=1 -DISC_LIST_CHECKINIT=1"
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
test "${enable_querytrace+set}" = set || enable_querytrace=yes
test "${with_cmocka+set}" = set || with_cmocka=yes
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
test "${enable_symtable+set}" = set || enable_symtable=all
test "${enable_warn_error+set}" = set || enable_warn_error=yes
test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
test "${with_zlib+set}" = set || with_zlib=yes
XTARGETS='${XTARGETS}'
])
AC_SUBST([XTARGETS])
2014-05-15 20:29:30 -07:00
2018-07-03 15:45:11 +02:00
AC_ARG_ENABLE([fuzzing],
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer>],
[Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
[],
[enable_fuzzing=no])
AC_MSG_CHECKING([whether to enable fuzzing mode])
AS_CASE([$enable_fuzzing],
[no],[AC_MSG_RESULT([no])],
[afl],[
AC_MSG_RESULT([using AFL])
AC_DEFINE([ENABLE_AFL], [1],
[Define to enable American Fuzzy Lop test harness])
CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
LIBS="$LIBS -lpthread"],
[libfuzzer],[
AC_MSG_RESULT([using libFuzzer])
CFLAGS="$CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer,address,undefined"
LDFLAGS="$LDFLAGS -fsanitize=fuzzer,address,undefined"],
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
AS_IF([test "$enable_fuzzing" = "afl"],
[AC_MSG_CHECKING("for AFL enabled compiler")
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[#ifndef __AFL_COMPILER
#error AFL compiler required
#endif
])],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([set CC=afl-<gcc|clang> when --enable-fuzzing=afl is used])])
])
2016-05-05 11:46:11 +02:00
2019-05-17 11:35:35 +02:00
AC_ARG_ENABLE(mutex_atomics,
AS_HELP_STRING([--enable-mutex-atomics],
[emulate atomics by mutex-locked variables, useful for debugging
[default=no]]),
[],
[enable_mutex_atomics=no])
AC_MSG_CHECKING([whether to emulate atomics with mutexes])
case "$enable_mutex_atomics" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
;;
esac
2005-09-05 00:12:29 +00:00
#
# Make very sure that these are the first files processed by
# config.status, since we use the processed output as the input for
2009-01-17 09:35:58 +00:00
# AC_SUBST_FILE() substitutions in other files.
2005-09-05 00:12:29 +00:00
#
AC_CONFIG_FILES([make/rules make/includes])
1999-09-30 20:09:33 +00:00
AC_PATH_PROG(AR, ar)
ARFLAGS="cruv"
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
2000-06-19 19:04:48 +00:00
# The POSIX ln(1) program. Non-POSIX systems may substitute
# "copy" or something.
LN=ln
AC_SUBST(LN)
2000-05-09 17:07:30 +00:00
case "$AR" in
"")
AC_MSG_ERROR([
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.
])
;;
esac
2000-06-13 17:34:28 +00:00
#
# Perl is optional; it is used only by some of the system test scripts.
2009-09-01 18:40:25 +00:00
# Note: the backtrace feature (see below) uses perl to build the symbol table,
# but it still compiles without perl, in which case an empty table will be used.
2000-06-13 17:34:28 +00:00
#
AC_PATH_PROGS(PERL, perl5 perl)
AC_SUBST(PERL)
2012-06-28 17:06:00 +10:00
#
2018-11-27 11:43:46 +01:00
# Python is also optional but required by default so that dnssec-keymgr gets
# installed unless explicitly prevented by the user using --without-python.
2012-06-28 17:06:00 +10:00
#
2018-11-27 11:43:46 +01:00
testminvers='import sys
if (sys.version_info < (2,7)) or (sys.version_info < (3,2) and sys.version_info >= (3,0)):
exit(1)'
2016-04-28 00:12:33 -07:00
testargparse='try: import argparse
except: exit(1)'
2018-11-27 11:43:46 +01:00
testply='try: import ply
2014-09-05 10:20:26 -07:00
except: exit(1)'
2016-04-28 00:12:33 -07:00
2018-12-18 15:05:52 +01:00
default_with_python="python python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
2018-11-27 11:43:46 +01:00
AC_ARG_WITH([python],
AS_HELP_STRING([--with-python=PATH],
[specify path to Python interpreter]),
2018-12-18 15:05:52 +01:00
[], [with_python=$default_with_python])
2018-11-27 11:43:46 +01:00
AC_ARG_WITH([python-install-dir],
AS_HELP_STRING([--with-python-install-dir=PATH],
[installation directory for Python modules]),
[], with_python_install_dir="")
2018-12-18 15:05:52 +01:00
AS_IF([test "$with_python" = "yes"],
[with_python=$default_with_python])
2018-11-27 11:43:46 +01:00
AS_IF([test "$with_python" = "no"],
[AC_MSG_CHECKING([for Python support])
AC_MSG_RESULT([disabled])],
[for p in $with_python
do
AS_CASE([$p],
[/*],[PYTHON="$p"])
AC_PATH_PROG([PYTHON], [$p])
# Do not cache the result of the check from the previous line. If the
# first found Python interpreter has missing module dependencies and
# the result of the above check is cached, subsequent module checks
# will erroneously keep on using the cached path to the first found
# Python interpreter instead of different ones.
unset ac_cv_path_PYTHON
AS_IF([test -z "$PYTHON"], [continue])
AC_MSG_CHECKING([if $PYTHON is python2 version >= 2.7 or python3 version >= 3.2])
AS_IF(["$PYTHON" -c "$testminvers" 2>/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
unset PYTHON
continue])
AC_MSG_CHECKING([Python module 'argparse'])
AS_IF(["$PYTHON" -c "$testargparse" 2>/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
unset PYTHON
continue])
AC_MSG_CHECKING([Python module 'ply'])
AS_IF(["$PYTHON" -c "$testply" 2>/dev/null],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
unset PYTHON
continue])
# Stop looking any further once we find a Python interpreter
# satisfying all requirements.
break
done
AS_IF([test "X$PYTHON" = "X"],
[AC_MSG_CHECKING([for Python support])
AC_MSG_RESULT([no])
2019-05-10 09:29:00 +07:00
AC_MSG_ERROR([m4_normalize(
[Python >= 2.7 or >= 3.2 and the PLY package
are required for dnssec-keymgr and other
Python-based tools. PLY may be
available from your OS package manager
as python-ply or python3-ply; it can also
be installed via pip. To build without
2019-05-27 13:19:25 +10:00
Python/PLY, use --without-python.]
2019-05-10 09:29:00 +07:00
)])])])
2012-06-28 17:06:00 +10:00
PYTHON_TOOLS=''
2012-06-28 23:08:07 +10:00
CHECKDS=''
2013-03-20 14:31:10 -07:00
COVERAGE=''
2016-04-28 00:12:33 -07:00
KEYMGR=''
2018-11-27 11:43:46 +01:00
AS_IF([test "X$PYTHON" != "X"],
[PYTHON_TOOLS=python
CHECKDS=checkds
COVERAGE=coverage
KEYMGR=keymgr
PYTHON_INSTALL_DIR="$with_python_install_dir"
AS_IF([test -n "$with_python_install_dir"],
[PYTHON_INSTALL_LIB="--install-lib=$with_python_install_dir"])])
2012-06-28 23:08:07 +10:00
AC_SUBST(CHECKDS)
2013-03-20 14:31:10 -07:00
AC_SUBST(COVERAGE)
2016-04-28 00:12:33 -07:00
AC_SUBST(KEYMGR)
2012-06-28 17:06:00 +10:00
AC_SUBST(PYTHON_TOOLS)
2017-08-23 11:50:01 +02:00
AC_SUBST(PYTHON_INSTALL_DIR)
AC_SUBST(PYTHON_INSTALL_LIB)
2012-06-28 17:06:00 +10:00
2000-02-11 18:35:11 +00:00
#
2019-02-05 15:14:21 +01:00
# expanded_sysconfdir is needed for replacement in the python utilities
2000-02-11 18:35:11 +00:00
#
2016-04-28 00:12:33 -07:00
expanded_sysconfdir=`eval echo $sysconfdir`
AC_SUBST(expanded_sysconfdir)
2000-02-10 01:14:06 +00:00
2000-02-11 18:35:11 +00:00
#
# 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.
#
2000-02-10 13:52:25 +00:00
case "$INSTALL" in
/*)
2006-12-04 01:54:53 +00:00
;;
*)
#
# Not all systems have dirname.
#
changequote({, })
ac_dir="`echo $INSTALL | sed 's%/[^/]*$%%'`"
changequote([, ])
ac_prog="`echo $INSTALL | sed 's%.*/%%'`"
2016-10-20 10:26:05 +11:00
test "X$ac_dir" = "X$ac_prog" && ac_dir=.
2006-12-04 01:54:53 +00:00
test -d "$ac_dir" && ac_dir="`(cd \"$ac_dir\" && pwd)`"
INSTALL="$ac_dir/$ac_prog"
;;
2000-02-10 13:52:25 +00:00
esac
2001-01-31 19:22:46 +00:00
AC_PROG_CC
2018-07-24 14:42:20 +02:00
AC_PROG_CC_C99
2003-01-21 04:11:26 +00:00
2019-06-19 11:21:36 +02:00
#
# Using Solaris linker with gcc on Solaris breaks Thread Local Storage
#
AS_CASE([$host],
[*-solaris*],[
AS_IF([test "$GCC" = "yes"],
[LDFLAGS="$LDFLAGS -zrelax=transtls"
AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
])
])
2013-07-09 11:47:16 -07:00
#
# CCNOOPT defaults to -O0 on gcc and disables optimization when is last
#
if test "X$CCNOOPT" = "X" -a "X$GCC" = "Xyes"; then
CCNOOPT="-O0"
fi
2001-01-31 19:22:46 +00:00
AC_HEADER_STDC
2014-02-10 09:46:54 +11:00
AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/mman.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h sys/socket.h net/route.h linux/netlink.h linux/rtnetlink.h,,,
2003-11-05 02:49:04 +00:00
[$ac_includes_default
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
2014-02-07 17:16:37 +11:00
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
2003-11-05 02:49:04 +00:00
])
2001-01-31 19:22:46 +00:00
2018-05-29 14:10:32 +02:00
#
# Check for thread local storage
#
AC_CHECK_HEADERS([threads.h],
[
AC_MSG_CHECKING([for C11 Thread-Local Storage using thread_local])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
#include <threads.h>
],[
static thread_local int tls = 0;
return (tls);
])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_THREAD_LOCAL],[1],[Define if thread_local keyword is available])
AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
],[
AC_MSG_RESULT([no])
])
],[
AC_MSG_CHECKING([for Thread-Local Storage using __thread])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[
],[
static __thread int tls = 0;
return (tls);
])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE___THREAD],[1],[Define if __thread keyword is available])
AC_DEFINE([HAVE_TLS],[1],[Define if Thread-Local Storage is available])
],[
AC_MSG_RESULT([no])
])
])
2001-01-31 19:22:46 +00:00
AC_C_CONST
AC_C_INLINE
2008-01-04 03:28:39 +00:00
AC_C_VOLATILE
2010-05-19 07:13:15 +00:00
AC_C_FLEXIBLE_ARRAY_MEMBER
2001-05-03 19:54:44 +00:00
2018-10-23 09:27:02 +02:00
#
# Check for yield support on ARM processors
#
AS_CASE([$host],
2019-05-06 18:06:59 +10:00
[arm*],
[AC_MSG_CHECKING([for yield instruction support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]],
[[__asm__ __volatile__ ("yield")]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_ARM_YIELD], [1],
[define if the ARM yield instruction is available])],
[AC_MSG_RESULT([no])])])
2018-10-23 09:27:02 +02:00
2019-08-08 08:33:10 +01:00
#
# Check for pause support on SPARC processors
#
AS_CASE([$host],
[sparc*],
[AC_MSG_CHECKING([for pause instruction support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]],
[[__asm__ __volatile__ ("pause")]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_SPARC_PAUSE], [1],
[define if the SPARC pause instruction is available])],
[AC_MSG_RESULT([no])])])
2018-09-05 13:33:59 +02:00
AC_CHECK_FUNCS([sysctlbyname])
2012-06-21 12:58:46 -07:00
#
# Check for the existence of mmap to enable the fast format zones
#
AC_CHECK_FUNCS(mmap)
2009-07-14 22:39:30 +00:00
#
# Older versions of HP/UX don't define seteuid() and setegid()
#
AC_CHECK_FUNCS(seteuid setresuid)
AC_CHECK_FUNCS(setegid setresgid)
2001-01-31 19:22:46 +00:00
AC_TYPE_SIZE_T
2018-07-24 14:42:20 +02:00
AC_TYPE_SSIZE_T
AC_TYPE_UINTPTR_T
2001-01-31 19:22:46 +00:00
AC_HEADER_TIME
2016-01-30 11:03:10 -08:00
#
# check for uname library routine
#
2018-09-05 12:58:02 +02:00
AC_MSG_CHECKING([for uname])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/utsname.h>
#include <stdio.h>
]],
[[
struct utsname uts;
uname(&uts);
printf("running on %s %s %s for %s\n",
uts.sysname, uts.release, uts.version, uts.machine);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_UNAME], [1], [define if uname is available])
],
[AC_MSG_RESULT(no)
AC_MSG_WARN([uname is not correctly supported])
])
2016-01-30 11:03:10 -08:00
2009-09-29 15:06:07 +00:00
#
# check for GCC noreturn attribute
#
AC_MSG_CHECKING(for GCC noreturn attribute)
AC_TRY_COMPILE([],[void foo() __attribute__((noreturn));],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_NORETURN_PRE="#define ISC_PLATFORM_NORETURN_PRE"
2009-10-02 06:28:27 +00:00
ISC_PLATFORM_NORETURN_POST="#define ISC_PLATFORM_NORETURN_POST"])
2009-09-29 15:06:07 +00:00
AC_SUBST(ISC_PLATFORM_NORETURN_PRE)
AC_SUBST(ISC_PLATFORM_NORETURN_POST)
2008-06-23 19:41:20 +00:00
#
# check if we have kqueue
#
2018-09-05 12:05:32 +02:00
AC_ARG_ENABLE([kqueue],
[AS_HELP_STRING([--enable-kqueue],
[use BSD kqueue when available [default=yes]])],
[], enable_kqueue="yes")
AS_IF([test "$enable_kqueue" = "yes"],
[AC_CHECK_FUNCS([kqueue])])
2008-06-23 19:41:20 +00:00
#
2008-08-22 13:17:56 +00:00
# check if we have epoll. Linux kernel 2.4 has epoll_create() which fails,
# so we need to try running the code, not just test its existence.
2008-06-23 19:41:20 +00:00
#
2018-09-05 12:14:27 +02:00
AC_ARG_ENABLE([epoll],
[AS_HELP_STRING([--enable-epoll],
[use Linux epoll when available [default=auto]])],
[], [enable_epoll="yes"])
AS_IF([test "$enable_epoll" = "yes"],
[AC_CHECK_FUNCS([epoll_create1])])
2008-06-23 19:41:20 +00:00
#
# check if we support /dev/poll
#
2018-09-05 12:26:40 +02:00
AC_ARG_ENABLE([devpoll],
[AS_HELP_STRING([--enable-devpoll],
[use /dev/poll when available [default=yes]])],
[], [enable_devpoll="yes"])
AS_IF([test "$enable_devpoll" = "yes"],
[AC_CHECK_HEADERS([sys/devpoll.h devpoll.h])])
2001-10-03 05:08:32 +00:00
2000-06-07 19:41:49 +00:00
#
# Find the machine's endian flavor.
#
AC_C_BIGENDIAN
2000-08-02 19:35:35 +00:00
#
2014-01-14 15:40:56 -08:00
# GeoIP support?
2000-08-02 19:35:35 +00:00
#
2019-06-27 21:19:30 -07:00
# Should be on by default if libmaxminddb exists.
#
2019-06-11 15:59:31 -07:00
AC_ARG_WITH([geoip2],
2019-06-27 21:19:30 -07:00
[AS_HELP_STRING([--with-geoip2],
[deprecated, use --with-maxminddb])],
[AC_MSG_WARN([--with-geoip2 is DEPRECATED and will be removed in a future release, use --with-maxminddb instead])],
[with_geoip2="auto"])
AC_ARG_ENABLE([geoip],
[AS_HELP_STRING([--disable-geoip],
[support GeoIP2 geolocation ACLs if available [default=yes]])],
[], [enable_geoip="yes"])
AC_ARG_WITH([maxminddb],
[AS_HELP_STRING([--with-maxminddb=PATH],
2019-06-27 21:08:20 -07:00
[Build with MaxMind GeoIP2 support (auto|yes|no|path) [default=auto]])],
2019-06-27 21:19:30 -07:00
[], [with_maxminddb="$with_geoip2"])
2019-06-11 15:59:31 -07:00
GEOIP2LINKSRCS=
GEOIP2LINKOBJS=
2019-06-27 21:19:30 -07:00
AS_IF([test "$enable_geoip" = "yes"],
[AS_CASE([$with_maxminddb],
[no],[AC_MSG_ERROR([Use '--disable-geoip' to disable the GeoIP])],
[auto],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
[AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
],[:])],
[yes],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
[AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
])],
[ # default
AX_SAVE_FLAGS([maxminddb])
MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
MAXMINDDB_LIBS="-L$with_maxminddb/libs"
CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
LDFLAGS="$LDFLAGS $MAXMINDDB_LIBS"
AC_SEARCH_LIBS([MMDB_open], [maxminddb],
[AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
GEOIP2LINKSRCS='${GEOIP2LINKSRCS}'
GEOIP2LINKOBJS='${GEOIP2LINKOBJS}'
MAXMINDDB_LIBS="$MAXMINDDB_LIBS $ac_cv_search_mmdb_open"
AC_MSG_NOTICE([GeoIP2 default database path set to $with_maxminddb/share/GeoIP])
AS_VAR_COPY([MAXMINDDB_PREFIX], [$with_maxminddb])
],
[AC_MSG_ERROR([GeoIP2 requested, but libmaxminddb not found])])
2019-07-09 13:35:39 +02:00
AX_RESTORE_FLAGS([maxminddb])
2019-06-27 21:19:30 -07:00
])
AC_ARG_VAR([MAXMINDDB_PREFIX], [value of prefix for MAXMINDDB, overriding pkg-config])
])
2019-06-11 15:59:31 -07:00
AC_SUBST([MAXMINDDB_CFLAGS])
AC_SUBST([MAXMINDDB_LIBS])
AC_SUBST([GEOIP2LINKSRCS])
AC_SUBST([GEOIP2LINKOBJS])
2000-08-02 19:35:35 +00:00
2008-03-31 14:42:51 +00:00
#
2016-11-01 14:00:16 -07:00
# Do we have arc4random(), etc ?
2008-03-31 14:42:51 +00:00
#
2018-04-22 14:56:28 +02:00
AC_CHECK_FUNCS(arc4random arc4random_buf arc4random_uniform getrandom)
2008-03-31 14:42:51 +00:00
2018-08-15 11:12:03 +02:00
AX_PTHREAD
2008-03-31 14:42:51 +00:00
2018-08-15 11:12:03 +02:00
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
2013-02-27 17:19:39 -08:00
2019-05-13 20:58:20 +07:00
AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize])
2018-06-06 11:39:50 +02:00
2018-08-15 11:12:03 +02:00
AC_ARG_WITH([locktype],
2018-06-06 11:39:50 +02:00
AS_HELP_STRING([--with-locktype=ARG],
[Specify mutex lock type
2018-08-15 11:12:03 +02:00
(adaptive or standard)]),
[], [with_locktype="adaptive"])
AS_CASE([$with_locktype],
[adaptive],[
AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <pthread.h>
]],
[[
return (PTHREAD_MUTEX_ADAPTIVE_NP);
]]
)],
[AC_MSG_RESULT([using adaptive lock type])
AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
[Support for PTHREAD_MUTEX_ADAPTIVE_NP]) ],
[AC_MSG_RESULT([using standard lock type])]
)],
[standard],[AC_MSG_RESULT([using standard lock type])],
[AC_MSG_ERROR([You must specify "adaptive" or "standard" for --with-locktype.])]
)
AC_CHECK_HEADERS([sched.h])
AC_SEARCH_LIBS([sched_yield],[rt])
AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np])
2018-06-06 11:39:50 +02:00
2018-10-03 23:20:22 +02:00
AC_CHECK_HEADERS([sys/cpuset.h])
AC_CHECK_HEADERS([sys/procset.h])
AC_CHECK_FUNCS([pthread_setaffinity_np cpuset_setaffinity processor_bind sched_setaffinity])
2018-06-06 11:39:50 +02:00
# Look for functions relating to thread naming
2018-08-15 11:12:03 +02:00
AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
2018-06-06 11:39:50 +02:00
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
2019-03-07 13:32:30 +01:00
#
# flockfile is usually provided by pthreads
#
AC_CHECK_FUNCS([flockfile getc_unlocked])
2018-06-06 11:39:50 +02:00
#
# Look for sysconf to allow detection of the number of processors.
#
2018-09-05 13:29:28 +02:00
AC_CHECK_FUNCS([sysconf])
2006-12-04 01:54:53 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(ALWAYS_DEFINES)
2018-05-03 13:59:04 +02:00
2018-06-12 11:26:04 +02:00
AC_MSG_CHECKING(for libtool)
AC_ARG_WITH(libtool, AS_HELP_STRING([--with-libtool], [use GNU libtool]),
use_libtool="$withval", use_libtool="no")
2010-12-18 01:56:23 +00:00
2018-06-12 11:26:04 +02:00
case $use_libtool in
2014-02-10 15:01:06 +11:00
yes)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(yes)
AM_PROG_LIBTOOL
O=lo
A=la
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
2018-08-27 09:42:11 +02:00
LIBTOOL_MODE_COMPILE='--mode=compile'
LIBTOOL_MODE_INSTALL='--mode=install'
LIBTOOL_MODE_LINK='--mode=link'
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
2018-06-12 11:26:04 +02:00
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
2019-09-12 14:25:57 +02:00
AC_DEFINE([USE_LIBTOOL],[1],[Define if libtool is used for compilation])
2014-02-10 15:01:06 +11:00
;;
*)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(no)
O=o
A=a
LIBTOOL=
AC_SUBST(LIBTOOL)
LIBTOOL_MKDEP_SED=
LIBTOOL_MODE_COMPILE=
LIBTOOL_MODE_INSTALL=
LIBTOOL_MODE_LINK=
LIBTOOL_MODE_UNINSTALL=
INSTALL_LIBRARY='${INSTALL_DATA}'
2014-02-10 15:01:06 +11:00
;;
2018-06-12 11:26:04 +02:00
esac
AC_SUBST(INSTALL_LIBRARY)
2017-07-31 15:26:00 +02:00
2019-01-25 12:29:52 +01:00
#
# Do we want to use pthread rwlock? (useful for ThreadSanitizer)
#
AC_ARG_ENABLE([pthread_rwlock],
[AS_HELP_STRING([--enable-pthread-rwlock],
[use pthread rwlock instead of internal rwlock implementation (EXPERIMENTAL)])],
[], [enable_pthread_rwlock=no])
AS_IF([test "$enable_pthread_rwlock" = "yes"],
[AC_CHECK_FUNCS([pthread_rwlock_rdlock], [],
[AC_MSG_ERROR([pthread_rwlock_rdlock requested but not found])])
AC_DEFINE([USE_PTHREAD_RWLOCK],[1],[Define if you want to use pthread rwlock implementation])
])
2018-08-24 14:17:34 -07:00
2019-06-04 21:53:15 +02:00
AS_IF([test "$enable_pthread_rwlock" = "yes" -a "$enable_developer" != "yes"],
[AC_MSG_ERROR([pthread rwlock is not meant used in production and the developer mode must be enabled])])
2018-06-12 11:26:04 +02:00
CRYPTO=OpenSSL
2017-07-31 15:26:00 +02:00
2018-06-12 11:26:04 +02:00
#
2019-06-24 14:06:56 +02:00
# OpenSSL/LibreSSL is mandatory
2018-06-12 11:26:04 +02:00
#
2019-06-24 14:06:56 +02:00
PKG_CHECK_MODULES([OPENSSL], [libcrypto], [],
[AX_CHECK_OPENSSL([:],[AC_MSG_FAILURE([OpenSSL/LibreSSL not found])])])
2018-06-12 11:26:04 +02:00
2019-06-19 11:16:47 +02:00
AX_SAVE_FLAGS([openssl])
2019-06-24 14:06:56 +02:00
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
2018-06-12 11:26:04 +02:00
LIBS="$LIBS $OPENSSL_LIBS"
AC_MSG_CHECKING([for OpenSSL >= 1.0.0 or LibreSSL])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],
[[#if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)
#error OpenSSL >= 1.0.0 or LibreSSL required
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found])])
2018-10-26 05:29:56 +02:00
#
# Check for functions added in OpenSSL or LibreSSL
#
AC_CHECK_FUNCS([CRYPTO_zalloc])
AC_CHECK_FUNCS([EVP_CIPHER_CTX_new EVP_CIPHER_CTX_free])
AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free EVP_MD_CTX_reset])
AC_CHECK_FUNCS([HMAC_CTX_new HMAC_CTX_free HMAC_CTX_reset HMAC_CTX_get_md])
2018-06-12 11:26:04 +02:00
#
# Check for algorithm support in OpenSSL
#
AC_CHECK_FUNCS([ECDSA_sign ECDSA_verify], [:],
[AC_MSG_FAILURE([ECDSA support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for ECDSA P-256 support])
AC_COMPILE_IFELSE(
2019-01-28 16:31:22 +01:00
[AC_LANG_PROGRAM([[#include <openssl/evp.h>
#include <openssl/ec.h>]],
[[EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);]])],
2018-06-12 11:26:04 +02:00
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found. ECDSA P-256 support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for ECDSA P-384 support])
AC_COMPILE_IFELSE(
2019-01-28 16:31:22 +01:00
[AC_LANG_PROGRAM([[#include <openssl/evp.h>
#include <openssl/ec.h>]],
[[EC_KEY *key = EC_KEY_new_by_curve_name(NID_secp384r1);]])],
2018-06-12 11:26:04 +02:00
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([not found. ECDSA P-384 support in OpenSSL is mandatory.])])
AC_MSG_CHECKING([for Ed25519 support])
AC_COMPILE_IFELSE(
2019-01-28 16:31:22 +01:00
[AC_LANG_PROGRAM([[#include <openssl/evp.h>
#include <openssl/ec.h>]],
[[EC_KEY *key = EC_KEY_new_by_curve_name(NID_ED25519);]])],
2018-06-12 11:26:04 +02:00
[AC_DEFINE([HAVE_OPENSSL_ED25519], [1], [define if OpenSSL supports Ed25519])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
2017-07-31 15:26:00 +02:00
2018-06-12 11:26:04 +02:00
AC_MSG_CHECKING([for Ed448 support])
2019-05-29 15:32:16 +10:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/evp.h>
#include <openssl/ec.h>]],
[[EC_KEY *key = EC_KEY_new_by_curve_name(NID_ED448);]])],
[AC_DEFINE([HAVE_OPENSSL_ED448], [1], [define if OpenSSL supports Ed448])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
2014-02-26 19:00:05 -08:00
2019-08-30 15:32:11 +02:00
AC_MSG_CHECKING([for SipHash support])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/evp.h>
#include <openssl/opensslv.h>]],
[[#if OPENSSL_VERSION_NUMBER < 0x10101010L
#error OpenSSL >= 1.1.1a required for working SipHash initialization
#endif
EVP_PKEY *key = EVP_PKEY_new_raw_private_key(
EVP_PKEY_SIPHASH, NULL, NULL, 0);]])],
[AC_DEFINE([HAVE_OPENSSL_SIPHASH], [1], [define if OpenSSL supports SipHash])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL SHA-1 support
#
AC_CHECK_FUNCS([EVP_sha1], [:],
[AC_MSG_FAILURE([SHA-1 support in OpenSSL is mandatory.])])
2014-02-26 19:00:05 -08:00
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL SHA-2 support
#
AC_CHECK_FUNCS([EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512], [:],
[AC_MSG_FAILURE([SHA-2 support in OpenSSL is mandatory.])])
2014-02-10 15:01:06 +11:00
2018-06-12 11:26:04 +02:00
#
# Check for OpenSSL AES support
#
AC_CHECK_FUNCS([EVP_aes_128_ecb EVP_aes_192_ecb EVP_aes_256_ecb], [:],
[AC_MSG_FAILURE([AES support in OpenSSL is mandatory.])])
2006-12-04 01:54:53 +00:00
2014-01-14 15:40:56 -08:00
#
2018-06-12 11:26:04 +02:00
# Check for OpenSSL 1.1.x/LibreSSL functions
2014-01-14 15:40:56 -08:00
#
2018-10-25 11:42:51 +02:00
AC_CHECK_FUNCS([DH_get0_key ECDSA_SIG_get0 RSA_set0_key])
2006-12-04 01:54:53 +00:00
2018-10-14 14:32:02 +02:00
#
# Check whether FIPS mode is available and whether we should enable it
#
AC_ARG_ENABLE([fips-mode],
[AS_HELP_STRING([--enable-fips-mode],
[enable FIPS mode in OpenSSL library [default=no]])],
[], [enable_fips_mode="no"])
AC_MSG_CHECKING([whether to enable FIPS mode in OpenSSL library])
AS_CASE([$enable_fips_mode],
[yes], [AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([FIPS_mode],
[], [AC_MSG_FAILURE([OpenSSL FIPS mode requested but not available.])])],
[no], [AC_MSG_RESULT([no])])
2019-06-19 11:16:47 +02:00
AX_RESTORE_FLAGS([openssl])
2006-12-04 01:54:53 +00:00
2019-06-24 14:06:56 +02:00
AC_SUBST([OPENSSL_CFLAGS])
2018-06-12 11:26:04 +02:00
AC_SUBST([OPENSSL_LIBS])
2014-02-19 12:53:42 +11:00
2018-06-12 11:26:04 +02:00
PKCS11_TOOLS=
2018-07-19 13:46:01 -04:00
PKCS11_TEST=
2014-02-26 19:00:05 -08:00
#
2018-06-12 11:26:04 +02:00
# was --enable-native-pkcs11 specified?
2014-02-26 19:00:05 -08:00
#
2018-06-12 11:26:04 +02:00
AC_ARG_ENABLE(native-pkcs11,
AS_HELP_STRING([--enable-native-pkcs11],
[use native PKCS11 for public-key crypto [default=no]]),
[:], [enable_native_pkcs11="no"])
AC_MSG_CHECKING([for PKCS11 for Public-Key Cryptography])
AS_CASE([$enable_native_pkcs11],
[no],[AC_MSG_RESULT([no])],
[yes],[PKCS11_TOOLS=pkcs11
2018-07-19 13:46:01 -04:00
PKCS11_TEST=pkcs11
2018-06-12 11:26:04 +02:00
CRYPTO=pkcs11
AS_IF([$use_threads],
[:],
[AC_MSG_ERROR([PKCS11 requires threading support])])
AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([getpassphrase])
2018-07-19 13:46:01 -04:00
])
AC_SUBST([PKCS11_TEST])
2018-06-12 11:26:04 +02:00
AC_SUBST([PKCS11_TOOLS])
AS_CASE([$CRYPTO],
[pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])],
[AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])])
# preparation for automake
# AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"])
2014-02-19 12:53:42 +11:00
2017-09-20 02:22:22 +05:30
#
2018-06-12 11:26:04 +02:00
# was --with-pkcs11 specified?
2017-09-20 02:22:22 +05:30
#
2018-06-12 11:26:04 +02:00
AC_ARG_WITH([pkcs11],
[AS_HELP_STRING([--with-pkcs11[=PATH]],
[Build with PKCS11 support [no|path] (PATH is for the PKCS11 provider)])],
[:], [with_pkcs11="undefined"])
2017-09-20 02:22:22 +05:30
2018-06-12 11:26:04 +02:00
AS_CASE([$with_pkcs11],
[yes|auto],[AC_MSG_ERROR([--with-pkcs11 needs explicit path to the PKCS11 library])],
[no|undefined],[with_pkcs11="undefined"])
AC_DEFINE_UNQUOTED([PK11_LIB_LOCATION], ["$with_pkcs11"], [define the default PKCS11 library path])
# for PKCS11 benchmarks
have_clock_gt=no
AC_CHECK_FUNC(clock_gettime,have_clock_gt=yes,)
if test "no" = "$have_clock_gt"; then
AC_CHECK_LIB(rt,clock_gettime,have_clock_gt=rt,)
fi
if test "no" != "$have_clock_gt"; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is available.])
fi
if test "rt" = "$have_clock_gt"; then
LIBS="-lrt $LIBS"
fi
AC_MSG_CHECKING(for GSSAPI library)
AC_ARG_WITH(gssapi,
AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
[Specify path for system-supplied GSSAPI
2019-04-17 16:32:35 +10:00
[default=auto]]),
use_gssapi="$withval", use_gssapi="auto")
2018-06-12 11:26:04 +02:00
# first try using krb5-config, if that does not work then fall back to "yes" method.
case "$use_gssapi" in
*/krb5-config|krb5-config)
AC_MSG_RESULT(trying $use_gssapi)
if test krb5-config = "$use_gssapi"
then
AC_PATH_PROG(KRB5_CONFIG, $use_gssapi)
else
KRB5_CONFIG="$use_gssapi"
fi
gssapi_cflags=`$KRB5_CONFIG --cflags gssapi`
gssapi_libs=`$KRB5_CONFIG --libs gssapi`
saved_cppflags="$CPPFLAGS"
CPPFLAGS="$gssapi_cflags $CPPFLAGS"
AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
[ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"])
if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
AC_MSG_RESULT([krb5-config: gssapi.h not found])
CPPFLAGS="$saved_cppflags"
use_gssapi="yes"
else
AC_CHECK_HEADERS(krb5/krb5.h krb5.h,
[ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"])
if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
AC_MSG_RESULT([krb5-config: krb5.h not found])
CPPFLAGS="$saved_cppflags"
use_gssapi="yes"
2017-09-06 11:28:02 +02:00
else
2018-06-12 11:26:04 +02:00
CPPFLAGS="$saved_cppflags"
saved_libs="$LIBS"
LIBS=$gssapi_libs
AC_MSG_CHECKING([krb5-config linking as $LIBS])
AC_TRY_LINK( , [gss_acquire_cred();krb5_init_context()],
gssapi_linked=yes, gssapi_linked=no)
case $gssapi_linked in
yes) AC_MSG_RESULT([krb5-config: linked]);;
no) AC_MSG_RESULT([krb5-config: could not determine proper GSSAPI linkage])
use_gssapi="yes"
;;
esac
LIBS=$saved_libs
2017-09-06 11:28:02 +02:00
fi
2018-06-12 11:26:04 +02:00
fi
if test "yes" = "$use_gssapi"; then
AC_MSG_CHECKING([for GSSAPI library, non krb5-config method])
fi
;;
esac
case "$host" in
*darwin*)
2019-04-17 16:32:35 +10:00
if test "yes" = "$use_gssapi" -o "auto" = "$use_gssapi"
2018-06-12 11:26:04 +02:00
then
use_gssapi=framework
fi
;;
2014-02-19 12:53:42 +11:00
esac
2017-09-08 16:15:37 +10:00
2018-06-12 11:26:04 +02:00
# gssapi is just the framework, we really require kerberos v5, so
# look for those headers (the gssapi headers must be there, too)
# The problem with this implementation is that it doesn't allow
# for the specification of gssapi and krb5 headers in different locations,
# which probably ought to be fixed although fixing might raise the issue of
# trying to build with incompatible versions of gssapi and krb5.
2019-04-17 16:32:35 +10:00
if test "yes" = "$use_gssapi" -o "auto" = "$use_gssapi"
2014-01-14 15:40:56 -08:00
then
2018-06-12 11:26:04 +02:00
# first, deal with the obvious
if test \( -f /usr/include/kerberosv5/krb5.h -o \
-f /usr/include/krb5/krb5.h -o \
-f /usr/include/krb5.h \) -a \
\( -f /usr/include/gssapi.h -o \
-f /usr/include/gssapi/gssapi.h \)
2014-01-14 15:40:56 -08:00
then
2018-06-12 11:26:04 +02:00
use_gssapi=/usr
2014-01-14 15:40:56 -08:00
else
2018-06-12 11:26:04 +02:00
krb5dirs="/usr/local /usr/local/krb5 /usr/local/kerberosv5 /usr/local/kerberos /usr/pkg /usr/krb5 /usr/kerberosv5 /usr/kerberos /usr"
for d in $krb5dirs
do
if test -f $d/include/gssapi/gssapi_krb5.h -o \
-f $d/include/krb5.h
then
if test -f $d/include/gssapi/gssapi.h -o \
-f $d/include/gssapi.h
then
use_gssapi=$d
break
fi
fi
done
2019-04-17 16:32:35 +10:00
if test "auto" = "$use_gssapi"
then
use_gssapi="no"
fi
2014-01-14 15:40:56 -08:00
fi
fi
2000-08-17 18:56:49 +00:00
2018-06-12 11:26:04 +02:00
case "$use_gssapi" in
2014-01-14 15:40:56 -08:00
no)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(disabled)
USE_GSSAPI=''
2000-08-17 18:56:49 +00:00
;;
2018-06-12 11:26:04 +02:00
yes)
AC_MSG_ERROR([--with-gssapi must specify a path])
2000-08-17 18:56:49 +00:00
;;
2018-06-12 11:26:04 +02:00
*/krb5-config|krb5-config)
USE_GSSAPI='-DGSSAPI'
DST_GSSAPI_INC="$gssapi_cflags"
DNS_GSSAPI_LIBS="$gssapi_libs"
2001-06-03 19:36:01 +00:00
;;
2018-06-12 11:26:04 +02:00
framework)
USE_GSSAPI='-DGSSAPI'
ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <Kerberos/Kerberos.h>"
ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <Kerberos/Kerberos.h>"
DNS_GSSAPI_LIBS="-framework Kerberos"
AC_MSG_RESULT(framework)
2014-01-14 15:40:56 -08:00
;;
2018-08-21 14:35:57 +02:00
2000-08-17 18:56:49 +00:00
*)
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT(looking in $use_gssapi/lib)
USE_GSSAPI='-DGSSAPI'
saved_cppflags="$CPPFLAGS"
CPPFLAGS="-I$use_gssapi/include $CPPFLAGS"
AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h,
[ISC_PLATFORM_GSSAPIHEADER="#define ISC_PLATFORM_GSSAPIHEADER <$ac_header>"
gssapi_hack="#include <$ac_header>"])
2000-08-17 18:56:49 +00:00
2018-06-12 11:26:04 +02:00
if test "" = "$ISC_PLATFORM_GSSAPIHEADER"; then
AC_MSG_ERROR([gssapi.h not found])
fi
2002-12-04 01:19:28 +00:00
2018-06-12 11:26:04 +02:00
AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h,
[ISC_PLATFORM_GSSAPI_KRB5_HEADER="#define ISC_PLATFORM_GSSAPI_KRB5_HEADER <$ac_header>"
gssapi_krb5_hack="#include <$ac_header>"])
2000-08-29 00:41:18 +00:00
2018-06-12 11:26:04 +02:00
AC_CHECK_HEADERS(krb5.h krb5/krb5.h kerberosv5/krb5.h,
[ISC_PLATFORM_KRB5HEADER="#define ISC_PLATFORM_KRB5HEADER <$ac_header>"
krb5_hack="#include <$ac_header>"])
if test "" = "$ISC_PLATFORM_KRB5HEADER"; then
AC_MSG_ERROR([krb5.h not found])
fi
#
# XXXDCL This probably doesn't work right on all systems.
# It will need to be worked on as problems become evident.
#
# Essentially the problems here relate to two different
# areas. The first area is building with either KTH
# or MIT Kerberos, particularly when both are present on
# the machine. The other is static versus dynamic linking.
#
# On the KTH vs MIT issue, Both have libkrb5 that can mess
# up the works if one implementation ends up trying to
# use the other's krb. This is unfortunately a situation
# that very easily arises.
#
# Dynamic linking when the dependency information is built
# into MIT's libgssapi_krb5 or KTH's libgssapi magically makes
# all such problems go away, but when that setup is not
# present, because either the dynamic libraries lack
# dependencies or static linking is being done, then the
# problems start to show up.
saved_libs="$LIBS"
for TRY_LIBS in \
"-lgssapi_krb5" \
"-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err" \
"-lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv" \
"-lgssapi" \
"-lgssapi -lkrb5 -ldes -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lgssapi_krb5 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgssapi -lkrb5 -lhx509 -lcrypt -lasn1 -lroken -lcom_err" \
"-lgss -lkrb5"
do
# Note that this does not include $saved_libs, because
# on FreeBSD machines this configure script has added
# -L/usr/local/lib to LIBS, which can make the
# -lgssapi_krb5 test succeed with shared libraries even
# when you are trying to build with KTH in /usr/lib.
if test "/usr" = "$use_gssapi"
then
LIBS="$TRY_LIBS $ISC_OPENSSL_LIBS"
else
LIBS="-L$use_gssapi/lib $TRY_LIBS $ISC_OPENSSL_LIBS"
fi
AC_MSG_CHECKING(linking as $TRY_LIBS)
AC_TRY_LINK([
#include <sys/types.h>
$gssapi_hack
$gssapi_krb5_hack
$krb5_hack
] , [gss_acquire_cred(NULL, NULL, 0, NULL, 0, NULL, NULL, NULL);krb5_init_context(NULL);
#if defined(HAVE_GSSAPI_KRB5_H) || defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
gsskrb5_register_acceptor_identity(NULL);
#endif],
gssapi_linked=yes, gssapi_linked=no)
case $gssapi_linked in
yes) AC_MSG_RESULT(yes); break ;;
no) AC_MSG_RESULT(no) ;;
esac
done
CPPFLAGS="$saved_cppflags"
case $gssapi_linked in
no) AC_MSG_ERROR(could not determine proper GSSAPI linkage) ;;
2006-07-20 05:42:09 +00:00
esac
2018-06-12 11:26:04 +02:00
#
# XXXDCL Major kludge. Tries to cope with KTH in /usr/lib
# but MIT in /usr/local/lib and trying to build with KTH.
# /usr/local/lib can end up earlier on the link lines.
# Like most kludges, this one is not only inelegant it
# is also likely to be the wrong thing to do at least as
# many times as it is the right thing. Something better
# needs to be done.
#
if test "/usr" = "$use_gssapi" -a \
-f /usr/local/lib/libkrb5.a; then
FIX_KTH_VS_MIT=yes
fi
case "$FIX_KTH_VS_MIT" in
yes)
case "$enable_static_linking" in
yes) gssapi_lib_suffix=".a" ;;
*) gssapi_lib_suffix=".so" ;;
esac
for lib in $LIBS; do
case $lib in
-L*)
;;
-l*)
new_lib=`echo $lib |
sed -e s%^-l%$use_gssapi/lib/lib% \
-e s%$%$gssapi_lib_suffix%`
NEW_LIBS="$NEW_LIBS $new_lib"
;;
2017-07-31 15:26:00 +02:00
*)
2018-06-12 11:26:04 +02:00
AC_MSG_ERROR([KTH vs MIT Kerberos confusion!])
;;
2017-07-31 15:26:00 +02:00
esac
2018-06-12 11:26:04 +02:00
done
LIBS="$NEW_LIBS"
;;
2016-08-19 08:02:51 +10:00
esac
2018-06-12 11:26:04 +02:00
DST_GSSAPI_INC="-I$use_gssapi/include"
DNS_GSSAPI_LIBS="$LIBS"
AC_MSG_RESULT(using GSSAPI from $use_gssapi/lib and $use_gssapi/include)
LIBS="$saved_libs"
2014-01-14 15:40:56 -08:00
;;
esac
2013-10-08 11:43:08 +11:00
2018-06-12 11:26:04 +02:00
AC_SUBST(ISC_PLATFORM_HAVEGSSAPI)
AC_SUBST(ISC_PLATFORM_GSSAPIHEADER)
AC_SUBST(ISC_PLATFORM_GSSAPI_KRB5_HEADER)
AC_SUBST(ISC_PLATFORM_KRB5HEADER)
2000-08-29 00:41:18 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(USE_GSSAPI)
AC_SUBST(DST_GSSAPI_INC)
AC_SUBST(DNS_GSSAPI_LIBS)
DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS"
2000-12-23 18:27:43 +00:00
2018-06-12 11:26:04 +02:00
#
# Applications linking with libdns also need to link with these libraries.
#
2000-08-29 18:24:01 +00:00
2018-06-12 11:26:04 +02:00
AC_SUBST(DNS_CRYPTO_LIBS)
2014-04-03 09:24:53 +02:00
2016-07-21 11:13:03 -07:00
#
# was --with-lmdb specified?
#
AC_MSG_CHECKING(for lmdb library)
AC_ARG_WITH(lmdb,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-lmdb[=PATH]],
[build with LMDB library [yes|no|path]]),
2016-07-21 11:13:03 -07:00
use_lmdb="$withval", use_lmdb="auto")
have_lmdb=""
case "$use_lmdb" in
no)
lmdb_libs=""
;;
auto|yes)
for d in /usr /usr/local /opt/local
do
if test -f "${d}/include/lmdb.h"
then
if test ${d} != /usr
then
lmdb_cflags="-I ${d}/include"
LIBS="$LIBS -L${d}/lib"
fi
have_lmdb="yes"
fi
done
;;
*)
if test -f "${use_lmdb}/include/lmdb.h"
then
lmdb_cflags="-I${use_lmdb}/include"
LIBS="$LIBS -L${use_lmdb}/lib"
have_lmdb="yes"
else
AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
fi
;;
esac
if test "X${have_lmdb}" != "X"
then
AC_MSG_RESULT(yes)
AC_SEARCH_LIBS([mdb_env_create], [lmdb], [],
[AC_MSG_ERROR([found lmdb include but not library.])
have_lmdb=""])
elif test "X$use_lmdb" = Xyes
then
AC_MSG_ERROR([include/lmdb.h not found.])
else
AC_MSG_RESULT(no)
fi
NZD_TOOLS=""
NZDSRCS=
NZDTARGETS=
if test "X${have_lmdb}" != "X"
then
CFLAGS="$CFLAGS $lmdb_cflags"
AC_DEFINE(HAVE_LMDB, 1, [Define if lmdb was found])
NZD_TOOLS="nzd"
2017-11-13 11:36:45 +11:00
NZDSRCS='${NZDSRCS}'
NZDTARGETS='${NZDTARGETS}'
2016-07-21 11:13:03 -07:00
fi
AC_SUBST(NZD_TOOLS)
AC_SUBST(NZDSRCS)
AC_SUBST(NZDTARGETS)
2006-12-21 06:03:37 +00:00
#
# was --with-libxml2 specified?
#
2019-06-24 14:25:55 +02:00
AC_ARG_WITH([libxml2],
[AS_HELP_STRING([--with-libxml2],
[build with libxml2 library [yes|no|auto] (default is auto)])],
[], [with_libxml2="auto"])
AS_CASE([$with_libxml2],
[no],[],
[auto],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
[AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])],
[:])],
[yes],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
[AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])])],
[AC_MSG_ERROR([Specifying libxml2 installation path is not supported, adjust PKG_CONFIG_PATH instead])])
2006-12-21 06:03:37 +00:00
2013-03-13 14:24:50 -07:00
#
2019-02-06 11:56:42 +01:00
# DEPRECATED
2013-03-13 14:24:50 -07:00
#
2019-02-06 11:56:42 +01:00
AC_ARG_WITH([libjson],
[AS_HELP_STRING([--with-libjson],
[deprecated, use --with-json-c])],
[AC_MSG_WARN([--with-libjson is DEPRECATED and will be removed in a future release, use --with-json-c instead])],
[with_libjson="detect"])
2013-03-13 14:24:50 -07:00
2019-02-06 11:56:42 +01:00
#
# was --with-json-c specified?
#
AC_ARG_WITH([json-c],
[AS_HELP_STRING([--with-json-c],
[build with json-c library [yes|no|detect] (default is detect)])],
[], [with_json_c="$with_libjson"])
2013-03-13 14:24:50 -07:00
2019-02-06 11:56:42 +01:00
AS_CASE([$with_json_c],
[no],[],
[detect],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
[AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])],
[:])],
[yes],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
[AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])])],
[AC_MSG_ERROR([Specifying json-c installation path is not supported, adjust PKG_CONFIG_PATH instead])]
)
2013-03-13 14:24:50 -07:00
2019-02-06 11:56:42 +01:00
AC_SUBST([JSON_C_CFLAGS])
AC_SUBST([JSON_C_LIBS])
2013-07-09 16:43:59 -07:00
2019-07-31 13:50:15 +02:00
AC_ARG_WITH([zlib],
[AS_HELP_STRING([--with-zlib],
[build with zlib for HTTP compression
[default=yes]])],
[], with_zlib="auto")
AS_CASE([$with_zlib],
[no],[],
[auto],[PKG_CHECK_MODULES([ZLIB], [zlib],
[AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
[:])],
[yes],[PKG_CHECK_MODULES([ZLIB], [zlib],
[AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
[AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])])
2015-10-02 10:45:10 +02:00
2004-09-01 07:25:51 +00:00
#
# In solaris 10, SMF can manage named service
#
AC_CHECK_LIB(scf, smf_enable_instance)
2000-12-23 18:27:43 +00:00
#
# Additional compiler settings.
#
MKDEPCC="$CC"
2019-06-19 11:16:47 +02:00
MKDEPCFLAGS="-M"
AS_CASE([$host],
[*-solaris*],[
AS_IF([test "$GCC" != "yes"],
[MKDEPCFLAGS="-xM"])])
AS_IF([test "$GCC" = "yes"],
[STD_CWARNINGS="$STD_CWARNINGS -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith"]
)
AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
[STD_CWARNINGS="$STD_CWARNINGS -fno-strict-aliasing"])
AX_CHECK_COMPILE_FLAG([-fno-delete-null-pointer-checks],
[STC_CWARNINGS="$STD_CWARNINGS -fno-delete-null-pointer-checks"])
AS_IF([test "$enable_warn_shadow" = "yes"],
[AX_CHECK_COMPILE_FLAG([-Wshadow],
[STD_CWARNINGS="$STD_CWARNINGS -Wshadow"])])
AS_IF([test "$enable_warn_error" = "yes"],
[AX_CHECK_COMPILE_FLAG([-Werror],
[STD_CWARNINGS="$STD_CWARNINGS -Werror"])])
AC_SUBST([MKDEPCC])
AC_SUBST([MKDEPCFLAGS])
AC_SUBST([MKDEPPROG])
2000-12-23 18:27:43 +00:00
2000-02-11 18:35:11 +00:00
#
# -lxnet buys us one big porting headache... standards, gotta love 'em.
#
# AC_CHECK_LIB(xnet, socket, ,
# AC_CHECK_LIB(socket, socket)
# )
#
# Use this for now, instead:
#
1999-02-11 06:38:12 +00:00
case "$host" in
2008-12-01 07:50:17 +00:00
*-linux*)
;;
1999-02-11 06:38:12 +00:00
*)
AC_CHECK_LIB(socket, socket)
2008-12-01 07:50:17 +00:00
AC_CHECK_LIB(nsl, inet_addr)
1999-02-11 06:38:12 +00:00
;;
esac
1999-01-22 04:35:11 +00:00
2008-10-21 02:43:08 +00:00
#
# Work around Solaris's select() limitations.
#
case "$host" in
*-solaris2.[[89]]|*-solaris2.1?)
AC_DEFINE(FD_SETSIZE, 65536,
[Solaris hack to get select_large_fdset.])
;;
esac
2001-02-01 23:16:10 +00:00
#
# Purify support
#
AC_MSG_CHECKING(whether to use purify)
AC_ARG_WITH(purify,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-purify[=PATH]],[use Rational purify]),
use_purify="$withval", use_purify="no")
2001-02-01 23:16:10 +00:00
case "$use_purify" in
no)
;;
yes)
AC_PATH_PROG(purify_path, purify, purify)
;;
*)
purify_path="$use_purify"
;;
esac
case "$use_purify" in
no)
AC_MSG_RESULT(no)
PURIFY=""
;;
*)
2017-07-19 15:53:01 +10:00
if test -f "$purify_path" || test purify = "$purify_path"; then
2001-02-01 23:16:10 +00:00
AC_MSG_RESULT($purify_path)
PURIFYFLAGS="`echo $PURIFYOPTIONS`"
PURIFY="$purify_path $PURIFYFLAGS"
else
AC_MSG_ERROR([$purify_path not found.
Please choose the proper path with the following command:
configure --with-purify=PATH
])
fi
;;
esac
AC_SUBST(PURIFY)
2014-10-08 15:14:02 +02:00
#
# Google/Great Performance Tools CPU Profiler
#
AC_MSG_CHECKING(whether to use gperftools profiler)
AC_ARG_WITH(gperftools-profiler,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-gperftools-profiler],
[use gperftools CPU profiler]),
use_profiler="$withval", use_profiler="no")
2014-10-08 15:14:02 +02:00
case $use_profiler in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GPERFTOOLS_PROFILER], 1,
[Define to use gperftools CPU profiler.])
LIBS="$LIBS -lprofiler"
;;
*)
AC_MSG_RESULT(no)
;;
esac
2008-04-28 23:43:24 +00:00
2009-09-01 18:40:25 +00:00
#
# enable/disable dumping stack backtrace. Also check if the system supports
# glibc-compatible backtrace() function.
#
2018-09-04 10:09:24 +02:00
AC_ARG_ENABLE([backtrace],
[AS_HELP_STRING([--enable-backtrace],
[log stack backtrace on abort [default=yes]])],
[], [enable_backtrace="yes"])
AS_IF([test "$enable_backtrace" = "yes"],
[AC_DEFINE([USE_BACKTRACE], [1], [define if we can use backtrace])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <execinfo.h>]],
[[return (backtrace((void **)0, 0));]]
)],
[AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])]
)])
2009-09-01 18:40:25 +00:00
AC_ARG_ENABLE(symtable,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-symtable],
[use internal symbol table for backtrace
[all|minimal(default)|none]]),
2009-09-01 18:40:25 +00:00
want_symtable="$enableval", want_symtable="minimal")
case $want_symtable in
2009-11-11 08:46:47 +00:00
yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
2016-10-20 10:26:05 +11:00
if test "" = "$PERL"
2009-09-01 18:40:25 +00:00
then
AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
Install perl or explicitly disable the feature by --disable-symtable.])
fi
2016-10-20 10:26:05 +11:00
if test "yes" = "$use_libtool"; then
2009-09-15 23:17:22 +00:00
AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
2009-09-01 18:40:25 +00:00
else
2009-11-11 08:46:47 +00:00
# we generate the internal symbol table only for those systems
# known to work to avoid unexpected build failure. Also, warn
# about unsupported systems when the feature is enabled
# manually.
case $host_os in
freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
MKSYMTBL_PROGRAM="$PERL"
2017-07-19 15:53:01 +10:00
if test "all" = "$want_symtable"; then
2009-11-11 08:46:47 +00:00
ALWAYS_MAKE_SYMTABLE="yes"
fi
;;
*)
2017-07-19 15:53:01 +10:00
if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
2009-11-11 08:46:47 +00:00
then
AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
fi
esac
2009-09-01 18:40:25 +00:00
fi
;;
*)
;;
esac
AC_SUBST(MKSYMTBL_PROGRAM)
AC_SUBST(ALWAYS_MAKE_SYMTABLE)
2001-02-02 02:07:57 +00:00
#
2000-02-23 23:02:28 +00:00
# File name extension for static archive files, for those few places
# where they are treated differently from dynamic ones.
2001-02-02 02:07:57 +00:00
#
2000-02-23 23:02:28 +00:00
SA=a
1999-07-03 21:07:10 +00:00
AC_SUBST(O)
AC_SUBST(A)
2000-02-23 23:02:28 +00:00
AC_SUBST(SA)
2001-03-15 19:12:53 +00:00
AC_SUBST(LIBTOOL_MKDEP_SED)
2004-02-24 01:41:28 +00:00
AC_SUBST(LIBTOOL_MODE_COMPILE)
AC_SUBST(LIBTOOL_MODE_INSTALL)
AC_SUBST(LIBTOOL_MODE_LINK)
2016-11-01 19:17:07 -07:00
AC_SUBST(LIBTOOL_MODE_UNINSTALL)
1999-07-03 21:07:10 +00:00
2013-04-10 13:49:57 -07:00
BIND9_CO_RULE=".c.$O:"
2009-09-01 00:22:28 +00:00
AC_SUBST(BIND9_CO_RULE)
2000-07-25 23:54:09 +00:00
#
# Here begins a very long section to determine the system's networking
2009-01-17 09:35:58 +00:00
# capabilities. The order of the tests is significant.
2000-07-25 23:54:09 +00:00
#
2000-02-11 18:35:11 +00:00
#
# We do the IPv6 compilation checking after libtool so that we can put
# the right suffix on the files.
#
2018-08-21 11:50:23 +02:00
AC_MSG_CHECKING([for IPv6 structures])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
]],
[[
2018-08-21 12:54:15 +02:00
struct sockaddr_in6 sin6;
struct in6_addr in6;
2018-08-21 13:22:40 +02:00
struct in6_pktinfo in6_pi;
2018-08-21 13:48:48 +02:00
struct sockaddr_storage storage;
2018-08-21 12:54:15 +02:00
in6 = in6addr_any;
2018-08-21 13:07:05 +02:00
in6 = in6addr_loopback;
2018-08-21 13:17:00 +02:00
sin6.sin6_scope_id = 0;
2018-08-21 12:54:15 +02:00
return (0);
2018-08-21 11:50:23 +02:00
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([IPv6 support is mandatory])])
2000-01-07 02:44:13 +00:00
2016-08-12 15:31:33 +10:00
#
2017-09-18 08:34:41 +02:00
# Allow forcibly disabling TCP Fast Open support as autodetection might yield
# confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
# comment in lib/isc/unix/socket.c).
2016-08-12 15:31:33 +10:00
#
2017-09-18 08:34:41 +02:00
2018-09-05 12:34:10 +02:00
AC_ARG_ENABLE([tcp_fastopen],
[AS_HELP_STRING([--disable-tcp-fastopen],
[disable TCP Fast Open support [default=yes]])],
[], [enable_tcp_fastopen="yes"])
2017-09-18 08:34:41 +02:00
2018-09-05 12:34:10 +02:00
AS_IF([test "$enable_tcp_fastopen" = "yes"],
[AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])])
2016-08-12 15:31:33 +10:00
2000-07-25 23:54:09 +00:00
#
2000-04-26 21:50:49 +00:00
# Check for some other useful functions that are not ever-present.
2000-07-25 23:54:09 +00:00
#
2018-09-04 21:10:02 +02:00
AC_CHECK_FUNCS([strlcpy strlcat])
2001-12-03 21:52:07 +00:00
2013-01-10 17:34:28 +11:00
AC_SUBST(READLINE_LIB)
2011-12-16 23:01:17 +00:00
AC_ARG_WITH(readline,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-readline[=LIBSPEC]],
[specify readline library [default auto]]),
use_readline="$withval", use_readline="auto")
2016-10-12 11:56:59 +11:00
case "$use_readline" in
2011-12-16 23:01:17 +00:00
no) ;;
2016-10-12 11:56:59 +11:00
*)
2015-04-17 15:27:47 -07:00
saved_LIBS="$LIBS"
2016-10-12 11:56:59 +11:00
case "$use_readline" in
yes|auto) try_readline="-ledit"; or_readline="-lreadline" ;;
*) try_readline="$use_readline"
esac
for readline in "$try_readline" $or_readline
2015-04-17 15:27:47 -07:00
do
2016-10-12 11:56:59 +11:00
LIBS="$readline"
AC_MSG_NOTICE(checking for readline with $readline)
2015-04-17 15:27:47 -07:00
AC_CHECK_FUNCS(readline)
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2015-04-17 15:27:47 -07:00
then
2016-10-12 11:56:59 +11:00
READLINE_LIB="$readline"
2015-04-17 15:27:47 -07:00
break
fi
for lib in -lterminfo -ltermcap -lncurses -lcurses
do
2016-10-12 11:56:59 +11:00
AC_MSG_NOTICE(checking for readline with $readline $lib)
2015-04-17 15:27:47 -07:00
unset ac_cv_func_readline
2016-10-12 11:56:59 +11:00
LIBS="$readline $lib"
2015-04-17 15:27:47 -07:00
AC_CHECK_FUNCS(readline)
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2015-04-17 15:27:47 -07:00
then
2016-10-12 11:56:59 +11:00
READLINE_LIB="$readline $lib"
2015-04-17 15:27:47 -07:00
break
fi
done
2016-10-20 10:26:05 +11:00
if test "yes" = "$ac_cv_func_readline"
2016-04-14 13:46:15 -07:00
then
break
fi
2015-04-17 15:27:47 -07:00
done
2017-07-19 15:53:01 +10:00
if test "auto" != "$use_readline" &&
2016-10-12 11:56:59 +11:00
test "X$READLINE_LIB" = "X"
2016-10-11 15:15:56 +11:00
then
AC_MSG_ERROR([The readline library was not found.])
fi
2013-01-10 17:34:28 +11:00
LIBS="$saved_LIBS"
2014-02-10 15:01:06 +11:00
;;
2011-12-16 23:01:17 +00:00
esac
2017-07-19 15:53:01 +10:00
if test "yes" = "$ac_cv_func_readline"
2016-10-27 15:48:51 +11:00
then
case "$READLINE_LIB" in
*edit*)
AC_CHECK_HEADERS(editline/readline.h)
2016-11-18 11:12:42 -08:00
AC_CHECK_HEADERS(edit/readline/readline.h)
AC_CHECK_HEADERS(edit/readline/history.h)
2016-10-27 15:48:51 +11:00
;;
esac
AC_CHECK_HEADERS(readline/readline.h)
AC_CHECK_HEADERS(readline/history.h)
fi
2011-12-16 23:01:17 +00:00
2006-12-04 01:54:53 +00:00
#
# Use our own SPNEGO implementation?
#
AC_ARG_ENABLE(isc-spnego,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--disable-isc-spnego],
[use SPNEGO from GSSAPI library]))
2006-12-04 01:54:53 +00:00
if test -n "$USE_GSSAPI"
then
case "$enable_isc_spnego" in
yes|'')
USE_ISC_SPNEGO='-DUSE_ISC_SPNEGO'
DST_EXTRA_OBJS="$DST_EXTRA_OBJS spnego.$O"
DST_EXTRA_SRCS="$DST_EXTRA_SRCS spnego.c"
AC_MSG_RESULT(using SPNEGO from lib/dns)
;;
no)
AC_MSG_RESULT(using SPNEGO from GSSAPI library)
;;
esac
fi
AC_SUBST(USE_ISC_SPNEGO)
AC_SUBST(DST_EXTRA_OBJS)
AC_SUBST(DST_EXTRA_SRCS)
2000-02-11 18:35:11 +00:00
#
# Security Stuff
#
2008-12-01 03:53:32 +00:00
# Note it is very recommended to *not* disable chroot(),
# this is only because chroot() was made obsolete by Posix.
2017-11-13 11:36:45 +11:00
AC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot]))
2008-12-01 03:53:32 +00:00
case "$enable_chroot" in
yes|'')
AC_CHECK_FUNCS(chroot)
;;
no)
;;
esac
2018-06-26 14:52:11 +02:00
LIBCAP_LIBS=""
AC_MSG_CHECKING([whether to enable Linux capabilities])
AC_ARG_ENABLE([linux-caps],
[AS_HELP_STRING([--disable-linux-caps],
[disable Linux capabilities])],
[],
[AS_CASE([$host],
[*-linux*],[enable_linux_caps=yes],
[enable_linux_caps=no])])
AS_IF([test "$enable_linux_caps" = "yes"],
[AC_MSG_RESULT([yes])
AC_CHECK_HEADERS([sys/capability.h],
[],
2018-07-02 08:53:13 +02:00
[AC_MSG_ERROR(m4_normalize([sys/capability.h header is required for Linux capabilities support.
Either install libcap or use --disable-linux-caps.]))])
2019-06-19 11:16:47 +02:00
AX_SAVE_FLAGS([cap])
2018-06-26 14:52:11 +02:00
AC_SEARCH_LIBS([cap_set_proc], [cap],
[LIBCAP_LIBS="$ac_cv_search_cap_set_proc"],
2018-07-02 08:53:13 +02:00
[AC_MSG_ERROR(m4_normalize([libcap is required for Linux capabilities support.
Either install libcap or use --disable-linux-caps.]))])
2019-06-19 11:16:47 +02:00
AX_RESTORE_FLAGS([cap])],
2018-06-26 14:52:11 +02:00
[AC_MSG_RESULT([no])])
AC_SUBST([LIBCAP_LIBS])
2005-02-23 01:09:23 +00:00
AC_CHECK_HEADERS(sys/un.h,
ISC_PLATFORM_HAVESYSUNH="#define ISC_PLATFORM_HAVESYSUNH 1"
,
ISC_PLATFORM_HAVESYSUNH="#undef ISC_PLATFORM_HAVESYSUNH"
)
AC_SUBST(ISC_PLATFORM_HAVESYSUNH)
case "$host" in
*-solaris*)
AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
[Define if connect does not honour the permission on the UNIX domain socket.])
;;
esac
2004-01-07 05:48:15 +00:00
#
# Time Zone Stuff
#
2018-09-05 12:58:02 +02:00
AC_CHECK_FUNCS([tzset])
2004-01-07 05:48:15 +00:00
2009-01-17 09:35:58 +00:00
AC_MSG_CHECKING(for optarg declaration)
2005-06-08 02:09:18 +00:00
AC_TRY_COMPILE([
#include <unistd.h>
],
[optarg = 0;],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
2006-01-05 00:30:34 +00:00
GEN_NEED_OPTARG="-DNEED_OPTARG=1"
2005-06-08 02:09:18 +00:00
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
2016-05-05 12:22:26 -07:00
#
# Check for nanoseconds in file stats
#
2018-09-05 12:39:51 +02:00
AC_MSG_CHECKING([for st_mtim.tv_nsec])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/fcntl.h>]],
[[struct stat s;
return(s.st_mtim.tv_nsec);
]])],
[AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])])
2016-05-05 12:22:26 -07:00
2002-11-26 03:53:42 +00:00
#
# Check for if_nametoindex() for IPv6 scoped addresses support
#
2018-09-04 12:35:42 +02:00
AC_CHECK_FUNCS([if_nametoindex])
2002-11-26 03:53:42 +00:00
2017-09-19 16:16:45 +05:30
AC_CHECK_FUNCS(nanosleep usleep explicit_bzero)
2008-12-01 03:53:32 +00:00
2018-08-14 09:52:25 +02:00
ISC_ATOMIC_LIBS=""
AC_CHECK_HEADERS(
[stdatomic.h],
[AC_MSG_CHECKING([for memory model aware atomic operations])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdatomic.h>]],
[[atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
)],
[AC_MSG_RESULT([stdatomic.h])
AC_MSG_CHECKING([whether -latomic is needed for 64-bit stdatomic.h functions])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdatomic.h>]],
[[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
)],
[AC_MSG_RESULT([no])],
2019-03-01 10:10:17 +01:00
[ISC_ATOMIC_LIBS="-latomic"
2019-06-19 11:16:47 +02:00
AX_SAVE_FLAGS([atomic])
2019-03-01 10:10:17 +01:00
LIBS="$LIBS $ISC_ATOMIC_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdatomic.h>]],
[[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
)],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])])
2019-06-19 11:16:47 +02:00
AX_RESTORE_FLAGS([atomic])
2018-08-14 09:52:25 +02:00
])
],
2019-03-01 10:10:17 +01:00
[AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, please fix your toolchain.])]
2018-08-14 09:52:25 +02:00
)],
[AC_MSG_CHECKING([for memory model aware atomic operations])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <inttypes.h>]],
[[int32_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
)],
[AC_MSG_RESULT([__atomic builtins])
AC_DEFINE([HAVE___ATOMIC], [1], [define if __atomic builtins are not available])
AC_MSG_CHECKING([whether -latomic is needed for 64-bit __atomic builtins])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <inttypes.h>]],
[[int64_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
)],
[AC_MSG_RESULT([no])],
2019-03-01 10:10:17 +01:00
[ISC_ATOMIC_LIBS="-latomic"
2019-06-19 11:16:47 +02:00
AX_SAVE_FLAGS([atomic])
2019-03-01 10:10:17 +01:00
LIBS="$LIBS $ISC_ATOMIC_LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <inttypes.h>]],
[[int64_t val = 0; __atomic_fetch_add(&val, 1, __ATOMIC_RELAXED);]]
)],
[AC_MSG_RESULT([yes])],
[AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])])
2019-06-19 11:16:47 +02:00
AX_RESTORE_FLAGS([atomic])
2018-08-14 09:52:25 +02:00
])
],
[AC_MSG_RESULT([__sync builtins])
])
])
LIBS="$LIBS $ISC_ATOMIC_LIBS"
2005-06-04 05:32:50 +00:00
2018-08-14 10:23:50 +02:00
AC_CHECK_HEADERS([uchar.h])
2018-06-04 13:41:09 +02:00
#
# Check for __builtin_unreachable
#
AC_MSG_CHECKING([compiler support for __builtin_unreachable()])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[__builtin_unreachable();]]
)],
[AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().])
],
[AC_MSG_RESULT([no])
])
2016-02-01 08:59:49 +05:30
#
# Check for __builtin_expect
#
AC_MSG_CHECKING([compiler support for __builtin_expect])
AC_TRY_LINK(, [
2017-11-13 11:36:45 +11:00
return (__builtin_expect(1, 1) ? 1 : 0);
2016-02-01 08:59:49 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_expect=yes
AC_MSG_RESULT(yes)
2016-02-01 08:59:49 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_expect=no
AC_MSG_RESULT(no)
2016-02-01 08:59:49 +05:30
])
2016-10-20 10:26:05 +11:00
if test "yes" = "$have_builtin_expect"; then
2017-11-13 11:36:45 +11:00
AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
2016-02-01 08:59:49 +05:30
fi
2016-07-10 19:46:17 +05:30
#
# Check for __builtin_clz
#
AC_MSG_CHECKING([compiler support for __builtin_clz])
AC_TRY_LINK(, [
2017-11-13 11:36:45 +11:00
return (__builtin_clz(0xff) == 24 ? 1 : 0);
2016-07-10 19:46:17 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_clz=yes
AC_MSG_RESULT(yes)
2016-07-10 19:46:17 +05:30
], [
2017-11-13 11:36:45 +11:00
have_builtin_clz=no
AC_MSG_RESULT(no)
2016-07-10 19:46:17 +05:30
])
2016-10-20 10:26:05 +11:00
if test "yes" = "$have_builtin_clz"; then
2017-11-13 11:36:45 +11:00
AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
2016-07-10 19:46:17 +05:30
fi
2008-04-23 21:32:57 +00:00
#
# Activate "rrset-order fixed" or not?
#
AC_ARG_ENABLE(fixed-rrset,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-fixed-rrset],
[enable fixed rrset ordering [default=no]]),
enable_fixed="$enableval", enable_fixed="no")
2008-04-23 21:32:57 +00:00
case "$enable_fixed" in
yes)
AC_DEFINE(DNS_RDATASET_FIXED, 1,
2009-08-13 01:51:19 +00:00
[Define to enable "rrset-order fixed" syntax.])
2008-04-23 21:32:57 +00:00
;;
no)
;;
*)
;;
esac
2015-10-02 12:32:42 -07:00
#
# Activate dnstap?
#
AC_ARG_ENABLE(dnstap,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-dnstap],
[enable dnstap support
(requires fstrm, protobuf-c)]),
use_dnstap=$enableval, use_dnstap=no)
2015-10-02 12:32:42 -07:00
DNSTAP=
DNSTAPSRCS=
DNSTAPOBJS=
DNSTAPTARGETS=
if test "x$use_dnstap" != "xno"; then
2016-06-24 09:37:04 +10:00
AC_ARG_WITH([protobuf-c],
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-protobuf-c=path],
2016-06-24 09:37:04 +10:00
[Path where protobuf-c is installed, for dnstap]), [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f $withval/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I$withval/include/google"
else
CFLAGS="$CFLAGS -I$withval/include"
fi
LDFLAGS="$LDFLAGS -L$withval/lib"
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([PROTOC_C], [protoc-c], [],
[$PATH$PATH_SEPARATOR$withval/bin])
2016-06-24 09:37:04 +10:00
], [
# workaround for protobuf-c includes at old dir
# before protobuf-c-1.0.0
if test -f /usr/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/include/google"
else
if test -f /usr/local/include/google/protobuf-c/protobuf-c.h
then
CFLAGS="$CFLAGS -I/usr/local/include/google"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
fi
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([PROTOC_C],[protoc-c])
2016-06-24 09:37:04 +10:00
])
2017-05-11 18:30:04 +10:00
if test -z "$PROTOC_C"; then
AC_MSG_ERROR([The protoc-c program was not found.])
fi
2017-11-13 11:36:45 +11:00
AC_ARG_WITH([libfstrm], AS_HELP_STRING([--with-libfstrm=path],
2016-06-24 09:37:04 +10:00
[Path where libfstrm is installed, for dnstap]), [
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
2017-05-11 18:30:04 +10:00
AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture], [], [$PATH$PATH_SEPARATOR$withval/bin])
],[
AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
2016-06-24 09:37:04 +10:00
])
AC_SEARCH_LIBS([fstrm_iothr_init], [fstrm], [],
AC_MSG_ERROR([The fstrm library was not found. Please install fstrm!]))
AC_SEARCH_LIBS([protobuf_c_message_pack], [protobuf-c], [],
AC_MSG_ERROR([The protobuf-c library was not found. Please install protobuf-c!]))
AC_DEFINE(HAVE_DNSTAP, 1, [Define to 1 to enable dnstap support])
DNSTAP=dnstap
DNSTAPSRCS='${DNSTAPSRCS}'
DNSTAPOBJS='${DNSTAPOBJS}'
DNSTAPTARGETS='${DNSTAPTARGETS}'
2015-10-02 12:32:42 -07:00
fi
AC_SUBST(DNSTAP)
AC_SUBST(DNSTAPSRCS)
AC_SUBST(DNSTAPOBJS)
AC_SUBST(DNSTAPTARGETS)
2005-07-08 04:30:22 +00:00
#
# The following sets up how non-blocking i/o is established.
2018-08-21 10:56:14 +02:00
# cygwin and solaris 2.x (x<5) require special handling.
2005-07-08 04:30:22 +00:00
#
case "$host" in
*-cygwin*) AC_DEFINE(PORT_NONBLOCK, O_NDELAY);;
2005-07-11 03:18:34 +00:00
*-solaris2.[[01234]])
2005-07-08 04:30:22 +00:00
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,
[Sets which flag to pass to open/fcntl to make non-blocking (O_NDELAY/O_NONBLOCK).])
;;
esac
2001-05-02 23:15:38 +00:00
#
2006-01-04 04:15:55 +00:00
# Solaris 2.5.1 and earlier cannot bind() then connect() a TCP socket.
# This prevents the source address being set.
#
case "$host" in
*-solaris2.[[012345]]|*-solaris2.5.1)
AC_DEFINE(BROKEN_TCP_BIND_BEFORE_CONNECT, 1,
[Define if you cannot bind() before connect() for TCP sockets.])
;;
esac
#
2001-05-02 23:15:38 +00:00
# The following sections deal with tools used for formatting
# the documentation. They are all optional, unless you are
# a developer editing the documentation source.
#
2000-11-15 23:53:00 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for TeX.
2000-11-15 23:53:00 +00:00
#
2005-05-11 05:55:41 +00:00
AC_PATH_PROGS(LATEX, latex, latex)
AC_SUBST(LATEX)
AC_PATH_PROGS(PDFLATEX, pdflatex, pdflatex)
AC_SUBST(PDFLATEX)
2000-11-15 23:53:00 +00:00
2015-10-05 21:59:35 -07:00
AC_PATH_PROGS(DBLATEX, dblatex, dblatex)
AC_SUBST(DBLATEX)
2005-08-17 22:55:57 +00:00
#
# Look for w3m
#
AC_PATH_PROGS(W3M, w3m, w3m)
AC_SUBST(W3M)
2017-04-20 19:21:54 -07:00
#
# Look for pandoc
#
AC_PATH_PROG(PANDOC, pandoc, pandoc)
AC_SUBST(PANDOC)
2001-02-02 22:37:20 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for xsltproc (libxslt)
2001-02-02 22:37:20 +00:00
#
2005-05-11 05:55:41 +00:00
AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
AC_SUBST(XSLTPROC)
#
# Look for xmllint (libxml2)
#
2001-02-02 22:37:20 +00:00
2005-05-11 05:55:41 +00:00
AC_PATH_PROG(XMLLINT, xmllint, xmllint)
AC_SUBST(XMLLINT)
2001-02-02 22:37:20 +00:00
2006-12-22 01:46:19 +00:00
#
# Look for Doxygen
#
AC_PATH_PROG(DOXYGEN, doxygen, doxygen)
AC_SUBST(DOXYGEN)
2015-06-29 18:33:18 +05:30
#
# Look for curl
#
AC_PATH_PROG(CURL, curl, curl)
AC_SUBST(CURL)
2001-07-11 23:35:33 +00:00
#
# 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
2018-08-21 14:35:57 +02:00
# variable VARIABLE is defined to its absolute pathname. Otherwise,
2001-07-11 23:35:33 +00:00
# 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.
2018-08-21 14:35:57 +02:00
#
2001-07-11 23:35:33 +00:00
2018-06-04 08:54:58 +02:00
AC_DEFUN([NOM_PATH_FILE], [
2001-07-11 23:35:33 +00:00
$1=""
AC_MSG_CHECKING(for $2)
for d in $3
do
f=$d/$2
if test -f $f
then
$1=$f
AC_MSG_RESULT($f)
break
fi
done
if test "X[$]$1" = "X"
then
AC_MSG_RESULT("not found");
$1=$2
fi
AC_SUBST($1)
])
2002-01-26 23:12:39 +00:00
#
2008-01-11 03:11:44 +00:00
# Look for Docbook-XSL stylesheets. Location probably varies by system.
# If it's not explicitly specified, guess where it might be found, based on
# where SGML stuff lives on some systems (FreeBSD is the only one we're sure
# of at the moment).
2002-01-26 23:12:39 +00:00
#
2008-01-11 03:11:44 +00:00
AC_MSG_CHECKING(for Docbook-XSL path)
AC_ARG_WITH(docbook-xsl,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-docbook-xsl[=PATH]],
[specify path for Docbook-XSL stylesheets]),
2008-01-11 03:11:44 +00:00
docbook_path="$withval", docbook_path="auto")
case "$docbook_path" in
auto)
AC_MSG_RESULT(auto)
2019-09-09 14:21:19 +02:00
docbook_xsl_trees="/usr/pkg/share/xsl/docbook /usr/local/share/xsl/docbook-ns /usr/local/share/xsl/docbook /usr/share/xsl/docbook /usr/share/sgml/docbook/xsl-stylesheets /opt/local/share/xsl/docbook-xsl /opt/local/share/xsl/docbook-xsl-nons /usr/share/xml/docbook/stylesheet/docbook-xsl"
2008-01-11 03:11:44 +00:00
;;
*)
docbook_xsl_trees="$withval"
2014-02-10 15:01:06 +11:00
AC_MSG_RESULT($docbook_xsl_trees)
2008-01-11 03:11:44 +00:00
;;
esac
2001-05-15 17:33:32 +00:00
2000-11-15 23:32:21 +00:00
#
2005-05-11 05:55:41 +00:00
# Look for stylesheets we need.
#
2008-01-11 03:11:44 +00:00
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)
2005-05-11 05:55:41 +00:00
2015-09-23 16:47:37 +02:00
#
# IDN support using libidn2
#
2018-03-14 11:30:47 +01:00
LIBIDN2_CFLAGS=
2018-04-03 20:35:29 +02:00
LIBIDN2_LDFLAGS=
2017-08-15 14:36:59 +02:00
LIBIDN2_LIBS=
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
AC_ARG_WITH([libidn2],
[AS_HELP_STRING([--with-libidn2[=PATH]], [enable IDN support using GNU libidn2 [yes|no(default)|path]])],
[with_libidn2="$withval"], [with_libidn2="no"])
AS_CASE([$with_libidn2],
[yes], [PKG_CHECK_MODULES([LIBIDN2], [libidn2],
[AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])])],
[no], [],
2019-06-19 11:16:47 +02:00
[*], [AX_SAVE_FLAGS([libidn2])
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
LIBIDN2_CFLAGS="-I$with_libidn2/include"
LIBIDN2_LDFLAGS="-L$with_libidn2/lib"
CFLAGS="$LIBIDN2_CFLAGS $CFLAGS"
CPPFLAGS="$LIBIDN2_CFLAGS $CPPFLAGS"
LDFLAGS="$LIBIDN2_LDFLAGS $LDFLAGS"
AC_CHECK_HEADERS([idn2.h],
[],
[AC_MSG_ERROR([idn2.h not found])])
AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
[LIBIDN2_LIBS="$ac_cv_search_idn2_to_ascii_lz"
AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])],
[AC_MSG_ERROR([libidn2 requested, but not found])])
2019-06-19 11:16:47 +02:00
AX_RESTORE_FLAGS([libidn2])])
2018-03-14 11:30:47 +01:00
AC_SUBST([LIBIDN2_CFLAGS])
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
AC_SUBST([LIBIDN2_LDFLAGS])
2018-03-14 11:30:47 +01:00
AC_SUBST([LIBIDN2_LIBS])
2015-09-23 16:47:37 +02:00
2018-06-04 08:54:58 +02:00
#
# Check whether to build with cmocka unit testing framework
#
AC_ARG_WITH([cmocka],
2019-02-06 15:26:19 -08:00
[AS_HELP_STRING([--with-cmocka=detect],[enable CMocka based tests (default is detect)])],
2019-02-06 01:30:57 +01:00
[],[with_cmocka=detect])
2018-06-04 08:54:58 +02:00
AS_CASE([$with_cmocka],
2019-02-06 01:30:57 +01:00
[no],[],
[detect],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.0.0],
2019-02-06 15:26:19 -08:00
[AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])
UNITTESTS=tests],[with_cmocka=no])],
2019-02-06 01:30:57 +01:00
[yes],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.0.0],
2019-02-06 15:26:19 -08:00
[AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])])
UNITTESTS=tests],
[AC_MSG_ERROR([Use PKG_CONFIG_PATH to specify path to CMocka library])]
2019-02-06 01:30:57 +01:00
)
2018-06-04 08:54:58 +02:00
AC_SUBST([CMOCKA_CFLAGS])
AC_SUBST([CMOCKA_LIBS])
2018-11-14 22:31:39 +00:00
AC_SUBST(UNITTESTS)
2018-06-04 08:54:58 +02:00
2018-10-23 11:44:33 +02:00
#
2018-11-15 13:27:09 -08:00
# Check for kyua execution engine if CMocka was requested
2018-10-23 11:44:33 +02:00
# and bail out if execution engine was not found
#
AC_ARG_VAR([KYUA], [path to kyua execution engine])
AS_IF([test "$with_cmocka" != "no"],
[AC_PATH_PROGS([KYUA], [kyua], [])
AS_IF([test -z "$KYUA"],
2018-11-15 13:27:09 -08:00
[AC_MSG_WARN([kyua test execution engine not found])])])
2018-10-23 11:44:33 +02:00
AC_SUBST([KYUA])
2018-06-14 09:05:08 +02:00
#
# Check for -Wl,--wrap= support
#
2019-07-22 17:52:55 +02:00
LD_WRAP_TESTS=false
AC_MSG_CHECKING([for linker support for --wrap option])
2019-07-31 16:09:43 +02:00
AX_SAVE_FLAGS([wrap])
LDFLAGS="-Wl,-wrap,exit"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <stdlib.h>
void __real_exit (int status);
void __wrap_exit (int status) { __real_exit (status); }
]],
[[exit (1);]])],
[LD_WRAP_TESTS=true
AC_DEFINE([LD_WRAP], [1], [define if the linker supports --wrap option])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AX_RESTORE_FLAGS([wrap])
2018-06-01 09:31:59 +02:00
2019-07-23 11:49:21 -04:00
AC_SUBST([LD_WRAP_TESTS])
2019-07-22 17:52:55 +02:00
2018-10-23 11:44:33 +02:00
#
# Check for i18n
#
2005-09-09 06:17:03 +00:00
AC_CHECK_HEADERS(locale.h)
AC_CHECK_FUNCS(setlocale)
2014-02-18 22:36:14 -08:00
#
# was --with-tuning specified?
#
AC_ARG_WITH(tuning,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-tuning=ARG],
[Specify server tuning (large or default)]),
use_tuning="$withval", use_tuning="no")
2014-02-18 22:36:14 -08:00
case "$use_tuning" in
large)
2014-02-26 19:00:05 -08:00
AC_DEFINE(TUNE_LARGE, 1, [Define to use large-system tuning.])
2014-02-18 22:36:14 -08:00
AC_MSG_RESULT(using large-system tuning)
;;
no|default)
AC_MSG_RESULT(using default tuning)
;;
yes|*)
2014-02-26 19:00:05 -08:00
AC_MSG_ERROR([You must specify "large" or "default" for --with-tuning.])
2014-02-18 22:36:14 -08:00
;;
esac
2015-02-26 16:49:27 +05:30
#
# was --enable-querytrace specified?
#
AC_ARG_ENABLE(querytrace,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-querytrace],
[enable very verbose query trace logging
[default=no]]),
want_querytrace="$enableval", want_querytrace="no")
2015-02-26 16:49:27 +05:30
2016-03-04 11:12:23 +05:30
AC_MSG_CHECKING([whether to enable query trace logging])
2015-02-26 16:49:27 +05:30
case "$want_querytrace" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR("--enable-querytrace requires yes or no")
;;
esac
2018-05-16 11:58:15 -07:00
#
# Was --disable-auto-validation specified?
#
2018-06-06 12:02:40 +02:00
validation_default=auto
2018-05-16 11:58:15 -07:00
AC_ARG_ENABLE(auto-validation,
AS_HELP_STRING([--enable-auto-validation],
[turn on DNSSEC validation by default, using the IANA root key [default=yes]]),
2018-06-06 12:02:40 +02:00
[:],[enable_auto_validation=yes])
AS_IF([test "$enable_auto_validation" = "no"],[validation_default=yes])
AC_DEFINE_UNQUOTED([VALIDATION_DEFAULT], ["$validation_default"], [the default value of dnssec-validation option])
2018-05-16 11:58:15 -07:00
2000-02-11 18:35:11 +00:00
#
# Substitutions
#
1999-02-18 01:24:32 +00:00
AC_SUBST(BIND9_TOP_BUILDDIR)
BIND9_TOP_BUILDDIR=`pwd`
1999-10-05 19:52:30 +00:00
AC_SUBST(BIND9_ISC_BUILDINCLUDE)
2001-03-27 00:44:59 +00:00
AC_SUBST(BIND9_ISCCC_BUILDINCLUDE)
2001-02-15 04:14:15 +00:00
AC_SUBST(BIND9_ISCCFG_BUILDINCLUDE)
1999-10-05 19:52:30 +00:00
AC_SUBST(BIND9_DNS_BUILDINCLUDE)
2017-09-08 13:39:09 -07:00
AC_SUBST(BIND9_NS_BUILDINCLUDE)
2001-09-20 15:17:07 +00:00
AC_SUBST(BIND9_BIND9_BUILDINCLUDE)
2014-02-16 13:03:17 -08:00
AC_SUBST(BIND9_IRS_BUILDINCLUDE)
1999-10-05 19:52:30 +00:00
if test "X$srcdir" != "X"; then
BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include"
2001-03-27 00:44:59 +00:00
BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include"
2001-02-15 04:14:15 +00:00
BIND9_ISCCFG_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccfg/include"
1999-10-05 19:52:30 +00:00
BIND9_DNS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns/include"
2017-09-08 13:39:09 -07:00
BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include"
2001-09-20 15:17:07 +00:00
BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include"
2014-02-16 13:03:17 -08:00
BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include"
1999-10-05 19:52:30 +00:00
else
BIND9_ISC_BUILDINCLUDE=""
2001-03-27 00:44:59 +00:00
BIND9_ISCCC_BUILDINCLUDE=""
2001-02-15 04:14:15 +00:00
BIND9_ISCCFG_BUILDINCLUDE=""
1999-10-05 19:52:30 +00:00
BIND9_DNS_BUILDINCLUDE=""
2017-09-08 13:39:09 -07:00
BIND9_NS_BUILDINCLUDE=""
2001-09-20 15:17:07 +00:00
BIND9_BIND9_BUILDINCLUDE=""
2014-02-16 13:03:17 -08:00
BIND9_IRS_BUILDINCLUDE=""
1999-10-05 19:52:30 +00:00
fi
2001-09-20 15:17:07 +00:00
AC_SUBST_FILE(BIND9_MAKE_INCLUDES)
BIND9_MAKE_INCLUDES=$BIND9_TOP_BUILDDIR/make/includes
1999-10-05 19:52:30 +00:00
1998-12-11 20:10:26 +00:00
AC_SUBST_FILE(BIND9_MAKE_RULES)
1999-02-18 01:24:32 +00:00
BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules
1998-12-11 20:10:26 +00:00
2013-08-15 12:41:52 +10:00
. "$srcdir/version"
2013-03-02 00:16:55 -08:00
BIND9_PRODUCT="PRODUCT=\"${PRODUCT}\""
2013-03-01 16:24:12 -06:00
AC_SUBST(BIND9_PRODUCT)
2013-05-03 15:08:45 -07:00
BIND9_DESCRIPTION="DESCRIPTION=\"${DESCRIPTION}\""
AC_SUBST(BIND9_DESCRIPTION)
2015-11-08 21:34:24 -08:00
BIND9_VERSION="${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
2000-04-27 23:47:49 +00:00
AC_SUBST(BIND9_VERSION)
2012-06-20 14:13:12 -05:00
BIND9_MAJOR="MAJOR=${MAJORVER}.${MINORVER}"
AC_SUBST(BIND9_MAJOR)
2014-10-20 23:34:21 -07:00
BIND9_VERSIONSTRING="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}${DESCRIPTION:+ }${DESCRIPTION}"
AC_SUBST(BIND9_VERSIONSTRING)
2015-10-05 21:59:35 -07:00
BIND9_VERSIONSHORT="${PRODUCT} ${MAJORVER}.${MINORVER}${PATCHVER:+.}${PATCHVER}${RELEASETYPE}${RELEASEVER}${EXTENSIONS}"
AC_SUBST(BIND9_VERSIONSHORT)
1998-12-11 20:10:26 +00:00
2016-10-19 17:18:42 +02:00
BIND9_SRCID="SRCID=unset_id"
2013-08-15 12:41:52 +10:00
if test -f "${srcdir}/srcid"; then
. "${srcdir}/srcid"
2012-10-22 12:56:47 -07:00
BIND9_SRCID="SRCID=$SRCID"
2013-08-15 12:41:52 +10:00
elif test -d "${srcdir}/.git"; then
2014-06-17 13:42:32 -07:00
BIND9_SRCID="SRCID="`(cd "${srcdir}";git rev-parse --short HEAD)`
2012-10-22 12:56:47 -07:00
fi
2013-08-15 12:41:52 +10:00
2012-10-22 12:56:47 -07:00
AC_SUBST(BIND9_SRCID)
2008-09-23 17:25:47 +00:00
if test -z "$ac_configure_args"; then
BIND9_CONFIGARGS="defaults"
else
for a in $ac_configure_args
do
BIND9_CONFIGARGS="$BIND9_CONFIGARGS $a"
done
fi
BIND9_CONFIGARGS="`echo $BIND9_CONFIGARGS | sed 's/^ //'`"
BIND9_CONFIGARGS="CONFIGARGS=${BIND9_CONFIGARGS}"
AC_SUBST(BIND9_CONFIGARGS)
1999-07-03 21:07:10 +00:00
AC_SUBST_FILE(LIBISC_API)
2013-08-15 12:41:52 +10:00
LIBISC_API="$srcdir/lib/isc/api"
1999-07-03 21:07:10 +00:00
2001-03-27 00:44:59 +00:00
AC_SUBST_FILE(LIBISCCC_API)
2013-08-15 12:41:52 +10:00
LIBISCCC_API="$srcdir/lib/isccc/api"
2001-03-27 00:44:59 +00:00
2001-02-15 04:14:15 +00:00
AC_SUBST_FILE(LIBISCCFG_API)
2013-08-15 12:41:52 +10:00
LIBISCCFG_API="$srcdir/lib/isccfg/api"
2001-02-15 04:14:15 +00:00
1999-07-03 21:07:10 +00:00
AC_SUBST_FILE(LIBDNS_API)
2013-08-15 12:41:52 +10:00
LIBDNS_API="$srcdir/lib/dns/api"
1999-07-03 21:07:10 +00:00
2013-01-24 14:20:48 -08:00
AC_SUBST_FILE(LIBDNS_MAPAPI)
2013-08-15 12:41:52 +10:00
LIBDNS_MAPAPI="$srcdir/lib/dns/mapapi"
2012-06-20 14:13:12 -05:00
2001-09-20 15:17:07 +00:00
AC_SUBST_FILE(LIBBIND9_API)
2013-08-15 12:41:52 +10:00
LIBBIND9_API="$srcdir/lib/bind9/api"
2001-09-20 15:17:07 +00:00
2009-09-01 00:22:28 +00:00
AC_SUBST_FILE(LIBIRS_API)
2013-08-15 12:41:52 +10:00
LIBIRS_API="$srcdir/lib/irs/api"
2009-09-01 00:22:28 +00:00
2017-09-08 13:39:09 -07:00
AC_SUBST_FILE(LIBNS_API)
LIBNS_API="$srcdir/lib/ns/api"
2005-09-05 00:12:29 +00:00
#
# Configure any DLZ drivers.
#
# If config.dlz.in selects one or more DLZ drivers, it will set
2011-03-10 04:36:16 +00:00
# CONTRIB_DLZ to a non-empty value, which will be our clue to
# build DLZ drivers in contrib.
2005-09-05 00:12:29 +00:00
#
# This section has to come after the libtool stuff because it needs to
# know how to name the driver object files.
#
2011-03-10 04:36:16 +00:00
CONTRIB_DLZ=""
2005-09-05 00:12:29 +00:00
DLZ_DRIVER_INCLUDES=""
DLZ_DRIVER_LIBS=""
DLZ_DRIVER_SRCS=""
DLZ_DRIVER_OBJS=""
2010-08-16 04:49:14 +00:00
DLZ_SYSTEM_TEST=""
2017-10-06 19:09:30 -07:00
DLZ_DRIVER_MYSQL_INCLUDES=""
DLZ_DRIVER_MYSQL_LIBS=""
2005-09-05 00:12:29 +00:00
2018-08-21 14:35:57 +02:00
#
2011-03-10 04:36:16 +00:00
# Configure support for building a shared library object
#
# Even when libtool is available it can't always be relied upon
# to build an object that can be dlopen()'ed, but this is necessary
# for building the dlzexternal system test, so we'll try it the
# old-fashioned way.
#
SO="so"
SO_CFLAGS=""
2014-02-10 15:01:06 +11:00
SO_LDFLAGS=""
2011-03-10 04:36:16 +00:00
SO_LD=""
SO_TARGETS=""
2016-11-10 11:31:21 +11:00
SO_STRIP="cat"
2011-03-10 04:36:16 +00:00
2018-08-25 11:12:29 +02:00
AC_ARG_WITH([dlopen],
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-dlopen=ARG],
2018-08-24 14:17:34 -07:00
[support dynamically loadable DLZ and DYNDB drivers]),
2018-08-25 11:12:29 +02:00
[], [with_dlopen="auto"])
2018-08-24 14:17:34 -07:00
#
# If PIC is disabled, dlopen must also be
#
2018-08-25 11:12:29 +02:00
AS_IF([test "$pic_mode" = "no"],
[AS_CASE([$with_dlopen],
[auto],[with_dlopen="no"],
[yes],[AC_MSG_ERROR([--with-dlopen requires PIC])])])
AS_CASE([$with_dlopen],
[auto|yes],[
AC_SEARCH_LIBS([dlopen],[dl])
AC_CHECK_FUNCS([dlopen dlclose dlsym],
[with_dlopen="yes"],
[with_dlopen="no"])
])
2011-03-10 04:36:16 +00:00
2018-08-25 11:12:29 +02:00
AS_IF([test "$with_dlopen" = "yes"],
[AS_CASE([$host],
[*-linux*|*-gnu*],[
2018-08-10 19:32:12 -07:00
LDFLAGS="${LDFLAGS} -Wl,--export-dynamic"
2018-08-25 11:12:29 +02:00
SO_CFLAGS="-fPIC"
SO_LDFLAGS=""
2018-08-27 09:42:11 +02:00
AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
2018-08-25 11:12:29 +02:00
],[
SO_LDFLAGS="-shared"
2018-08-27 09:42:11 +02:00
SO_LD="${CC}"
2018-08-25 11:12:29 +02:00
])
],
2018-11-22 15:15:11 +01:00
[*-freebsd*|*-openbsd*|*-netbsd*],[
2018-08-25 11:12:29 +02:00
LDFLAGS="${LDFLAGS} -Wl,-E"
SO_CFLAGS="-fpic"
AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
],[
SO_LDFLAGS="-shared"
SO_LD="${CC}"
])
],
2018-12-06 15:52:29 -08:00
[*-darwin*],[
SO_CFLAGS="-fPIC"
SO_LD="${CC}"
AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
],[
SO_LDFLAGS="-dynamiclib -undefined dynamic_lookup"
])
],
2018-08-25 11:12:29 +02:00
[*-solaris*],[
SO_CFLAGS="-KPIC"
SO_LDFLAGS="-G -z text"
SO_LD="ld"
],
2019-05-14 13:24:43 +10:00
[ia64-hp-hpux*],[
SO_CFLAGS="+z"
SO_LDFLAGS="-b"
SO_LD="${CC}"
],
2018-08-25 11:12:29 +02:00
[
SO_CFLAGS="-fPIC"
])
AS_IF([test "$GCC" = "yes"],[
SO_CFLAGS="-fPIC"
AS_IF([test -z "$SO_LD"],
[AS_IF([test "$use_libtool" = "yes"],[
SO_LDFLAGS="-Xcompiler -shared"
SO_LD="${CC}"
],[
SO_LDFLAGS="-shared"
SO_LD="${CC}"
])
])
])
# If we still don't know how to make shared objects, don't make any.
AS_IF([test -n "$SO_LD"],
[SO_TARGETS="\${SO_TARGETS}"
AC_DEFINE([ISC_DLZ_DLOPEN], [1],
[Define to allow building of objects for dlopen().])
])
])
2005-09-05 00:12:29 +00:00
2015-09-28 23:12:35 -07:00
CFLAGS="$CFLAGS $SO_CFLAGS"
2011-03-10 04:36:16 +00:00
AC_SUBST(SO)
AC_SUBST(SO_CFLAGS)
2014-02-10 15:01:06 +11:00
AC_SUBST(SO_LDFLAGS)
2011-03-10 04:36:16 +00:00
AC_SUBST(SO_LD)
2016-11-10 11:31:21 +11:00
AC_SUBST(SO_STRIP)
2011-03-10 04:36:16 +00:00
AC_SUBST(SO_TARGETS)
2018-08-25 13:15:06 +02:00
#
# Response policy rewriting using DNS Response Policy Service (DNSRPS)
# interface.
#
# DNSRPS can be compiled into BIND everywhere with a reasonably
# modern C compiler. It is enabled on systems with dlopen() and librpz.so.
#
dnsrps_avail=yes
AC_MSG_CHECKING([for librpz __attribute__s])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[
extern void f(char *p __attribute__((unused)), ...)
__attribute__((format(printf,1,2))) __attribute__((__noreturn__));
]])],
[
librpz_have_attr=yes
AC_DEFINE([LIBRPZ_HAVE_ATTR], [1], [have __attribute__s used in librpz.h])
AC_MSG_RESULT([yes])
],[
librpz_have_attr=no
AC_MSG_RESULT([no])
])
AC_ARG_ENABLE([dnsrps-dl],
[AS_HELP_STRING([--enable-dnsrps-dl],
[DNS Response Policy Service delayed link
[default=$librpz_dl]])],
[enable_librpz_dl="$enableval"], [enable_librpz_dl="$with_dlopen"])
AS_IF([test "$enable_librpz_dl" = "yes" -a "$with_dlopen" = "no"],
[AC_MSG_ERROR([DNS Response Policy Service delayed link requires dlopen to be enabled])])
AC_ARG_WITH([dnsrps-libname],
[AS_HELP_STRING([--with-dnsrps-libname],
[DNSRPS provider library name (librpz.so)])],
[librpz_name="$withval"], [librpz_name="librpz.so"])
AC_ARG_WITH([dnsrps-dir],
[AS_HELP_STRING([--with-dnsrps-dir],
[path to DNSRPS provider library])],
[librpz_path="$withval/$librpz_name"], [librpz_path="$librpz_name"])
AC_DEFINE_UNQUOTED([DNSRPS_LIBRPZ_PATH], ["$librpz_path"],
[dnsrps $librpz_name])
AS_IF([test "$enable_librpz_dl" = "yes"],
[
dnsrps_lib_open=2
],[
dnsrps_lib_open=1
# Add librpz.so to linked libraries if we are not using dlopen()
AC_SEARCH_LIBS([librpz_client_create], [rpz], [],
[dnsrps_lib_open=0
dnsrps_avail=no])
])
AC_DEFINE_UNQUOTED([DNSRPS_LIB_OPEN], [$dnsrps_lib_open],
[0=no DNSRPS 1=static link 2=dlopen()])
AC_ARG_ENABLE([dnsrps],
AS_HELP_STRING([--enable-dnsrps],
[enable DNS Response Policy Service API]),
[enable_dnsrps=$enableval], [enable_dnsrps=no])
AS_IF([test "$enable_dnsrps" != "no"],[
AS_IF([test "$dnsrps_avail" != "yes"],
[AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
AS_IF([test "$dnsrps_lib_open" = "0"],
[AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
AC_DEFINE([USE_DNSRPS], [1], [Enable DNS Response Policy Service API])
])
2011-03-10 04:36:16 +00:00
sinclude(contrib/dlz/config.dlz.in)
AC_MSG_CHECKING(contributed DLZ drivers)
2005-09-05 00:12:29 +00:00
2011-03-10 04:36:16 +00:00
if test -n "$CONTRIB_DLZ"
2005-09-05 00:12:29 +00:00
then
AC_MSG_RESULT(yes)
DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
2017-10-06 19:09:30 -07:00
AC_CONFIG_FILES([$DLZ_DRIVER_RULES
contrib/dlz/modules/mysql/Makefile
contrib/dlz/modules/mysqldyn/Makefile])
2005-09-05 00:12:29 +00:00
else
AC_MSG_RESULT(no)
DLZ_DRIVER_RULES=/dev/null
fi
2011-03-10 04:36:16 +00:00
AC_SUBST(CONTRIB_DLZ)
2005-09-05 00:12:29 +00:00
AC_SUBST(DLZ_DRIVER_INCLUDES)
AC_SUBST(DLZ_DRIVER_LIBS)
AC_SUBST(DLZ_DRIVER_SRCS)
AC_SUBST(DLZ_DRIVER_OBJS)
2010-08-16 04:49:14 +00:00
AC_SUBST(DLZ_SYSTEM_TEST)
2017-10-06 19:09:30 -07:00
AC_SUBST(DLZ_DRIVER_MYSQL_INCLUDES)
AC_SUBST(DLZ_DRIVER_MYSQL_LIBS)
2005-09-05 00:12:29 +00:00
AC_SUBST_FILE(DLZ_DRIVER_RULES)
2016-10-20 10:26:05 +11:00
if test "yes" = "$cross_compiling"; then
2006-01-05 00:30:34 +00:00
if test -z "$BUILD_CC"; then
2014-02-21 21:17:23 +11:00
AC_MSG_ERROR([BUILD_CC not set])
2006-01-05 00:30:34 +00:00
fi
BUILD_CFLAGS="$BUILD_CFLAGS"
BUILD_CPPFLAGS="$BUILD_CPPFLAGS"
BUILD_LDFLAGS="$BUILD_LDFLAGS"
BUILD_LIBS="$BUILD_LIBS"
else
2018-08-21 14:35:57 +02:00
BUILD_CC="$CC"
BUILD_CFLAGS="$CFLAGS"
2006-01-05 00:30:34 +00:00
BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
BUILD_LDFLAGS="$LDFLAGS"
BUILD_LIBS="$LIBS"
fi
2006-12-04 01:54:53 +00:00
NEWFLAGS=""
for e in $BUILD_LDFLAGS ; do
case $e in
-L*)
case $host_os in
netbsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
freebsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
BUILD_LDFLAGS="$NEWFLAGS"
NEWFLAGS=""
for e in $DNS_GSSAPI_LIBS ; do
case $e in
-L*)
case $host_os in
netbsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
freebsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
DNS_GSSAPI_LIBS="$NEWFLAGS"
2014-02-13 15:09:08 +11:00
NEWFLAGS=""
for e in $ISC_OPENSSL_LIBS ; do
case $e in
-L*)
case $host_os in
netbsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
freebsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
solaris*)
ee=`echo $e | sed -e 's%^-L%-R%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
ISC_OPENSSL_LIBS="$NEWFLAGS"
2006-12-04 01:54:53 +00:00
NEWFLAGS=""
for e in $DNS_CRYPTO_LIBS ; do
case $e in
-L*)
case $host_os in
netbsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
freebsd*)
ee=`echo $e | sed -e 's%^-L%-Wl,-rpath,%'`
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2008-09-25 01:22:47 +00:00
solaris*)
2008-09-25 03:33:11 +00:00
ee=`echo $e | sed -e 's%^-L%-R%'`
2008-09-25 01:22:47 +00:00
NEWFLAGS="$NEWFLAGS $e $ee"
;;
2006-12-04 04:27:29 +00:00
*)
NEWFLAGS="$NEWFLAGS $e"
;;
2006-12-04 01:54:53 +00:00
esac
;;
*)
NEWFLAGS="$NEWFLAGS $e"
;;
esac
done
DNS_CRYPTO_LIBS="$NEWFLAGS"
2006-01-05 00:30:34 +00:00
AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CFLAGS)
AC_SUBST(BUILD_CPPFLAGS)
AC_SUBST(BUILD_LDFLAGS)
AC_SUBST(BUILD_LIBS)
2005-09-05 00:12:29 +00:00
2005-05-11 05:55:41 +00:00
#
# Commands to run at the end of config.status.
# Don't just put these into configure, it won't work right if somebody
# runs config.status directly (which autoconf allows).
#
AC_CONFIG_COMMANDS(
[chmod],
2019-06-26 10:21:49 +02:00
[chmod a+x doc/doxygen/doxygen-input-filter])
2005-05-11 05:55:41 +00:00
#
2005-09-05 00:12:29 +00:00
# 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.
2005-05-11 05:55:41 +00:00
#
2005-09-05 00:12:29 +00:00
AC_CONFIG_FILES([
2018-12-06 15:52:29 -08:00
make/Makefile
make/mkdep
1998-12-11 20:10:26 +00:00
Makefile
bin/Makefile
2000-12-13 06:21:42 +00:00
bin/check/Makefile
2009-06-10 00:27:22 +00:00
bin/confgen/Makefile
bin/confgen/unix/Makefile
2014-04-23 11:14:12 -07:00
bin/delv/Makefile
2011-01-11 21:36:22 +00:00
bin/dig/Makefile
bin/dnssec/Makefile
1999-01-19 19:43:25 +00:00
bin/named/Makefile
1999-10-23 01:06:31 +00:00
bin/named/unix/Makefile
2000-06-21 20:57:33 +00:00
bin/nsupdate/Makefile
2011-01-11 21:36:22 +00:00
bin/pkcs11/Makefile
2018-11-30 15:32:03 -08:00
bin/plugins/Makefile
2012-06-28 17:06:00 +10:00
bin/python/Makefile
2016-04-28 00:12:33 -07:00
bin/python/isc/Makefile
bin/python/isc/utils.py
bin/python/isc/tests/Makefile
2012-06-28 17:06:00 +10:00
bin/python/dnssec-checkds.py
2013-03-20 14:31:10 -07:00
bin/python/dnssec-coverage.py
2016-04-28 00:12:33 -07:00
bin/python/dnssec-keymgr.py
2016-06-24 12:20:37 +10:00
bin/python/isc/__init__.py
bin/python/isc/checkds.py
bin/python/isc/coverage.py
bin/python/isc/dnskey.py
bin/python/isc/eventlist.py
bin/python/isc/keydict.py
bin/python/isc/keyevent.py
bin/python/isc/keymgr.py
bin/python/isc/keyseries.py
bin/python/isc/keyzone.py
bin/python/isc/policy.py
bin/python/isc/rndc.py
bin/python/isc/tests/dnskey_test.py
bin/python/isc/tests/policy_test.py
2011-01-11 21:36:22 +00:00
bin/rndc/Makefile
1999-05-01 01:41:14 +00:00
bin/tests/Makefile
2011-01-11 21:36:22 +00:00
bin/tests/headerdep_test.sh
2018-02-27 12:48:10 -08:00
bin/tests/optional/Makefile
2014-01-14 15:40:56 -08:00
bin/tests/pkcs11/Makefile
bin/tests/pkcs11/benchmarks/Makefile
2000-05-19 21:42:43 +00:00
bin/tests/system/Makefile
2014-09-10 15:31:40 +10:00
bin/tests/system/conf.sh
2011-03-10 04:36:16 +00:00
bin/tests/system/dlzexternal/Makefile
2018-02-20 15:43:27 -08:00
bin/tests/system/dlzexternal/ns1/dlzs.conf
2015-09-28 23:12:35 -07:00
bin/tests/system/dyndb/Makefile
bin/tests/system/dyndb/driver/Makefile
2015-01-20 16:10:30 -08:00
bin/tests/system/pipelined/Makefile
2014-11-14 15:58:54 -08:00
bin/tests/system/rndc/Makefile
2017-09-11 11:53:42 -07:00
bin/tests/system/rpz/Makefile
2012-06-14 15:44:20 +10:00
bin/tests/system/rsabigexponent/Makefile
2001-01-11 20:46:32 +00:00
bin/tests/system/tkey/Makefile
2009-03-02 03:54:10 +00:00
bin/tools/Makefile
2014-02-05 16:17:50 -08:00
contrib/scripts/check-secure-delegation.pl
contrib/scripts/zone-edit.sh
2000-12-01 02:16:28 +00:00
doc/Makefile
2001-01-09 21:28:28 +00:00
doc/arm/Makefile
2017-11-13 11:36:45 +11:00
doc/arm/noteversion.xml
doc/arm/pkgversion.xml
doc/arm/releaseinfo.xml
2011-01-11 21:36:22 +00:00
doc/doxygen/Doxyfile
doc/doxygen/Makefile
doc/doxygen/doxygen-input-filter
2001-07-26 21:31:12 +00:00
doc/misc/Makefile
2017-11-13 11:36:45 +11:00
doc/tex/Makefile
doc/tex/armstyle.sty
2005-07-19 04:55:25 +00:00
doc/xsl/Makefile
2005-05-11 05:55:41 +00:00
doc/xsl/isc-docbook-chunk.xsl
doc/xsl/isc-docbook-html.xsl
doc/xsl/isc-manpage.xsl
2015-01-07 17:26:03 -08:00
doc/xsl/isc-notes-html.xsl
2011-01-11 21:36:22 +00:00
lib/Makefile
lib/bind9/Makefile
lib/bind9/include/Makefile
lib/bind9/include/bind9/Makefile
lib/dns/Makefile
lib/dns/include/Makefile
lib/dns/include/dns/Makefile
lib/dns/include/dst/Makefile
2011-02-26 02:26:33 +00:00
lib/dns/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/irs/Makefile
lib/irs/include/Makefile
lib/irs/include/irs/Makefile
lib/irs/include/irs/netdb.h
lib/irs/include/irs/platform.h
2016-10-27 13:17:58 +11:00
lib/irs/tests/Makefile
2018-08-15 11:12:03 +02:00
lib/isc/pthreads/Makefile
lib/isc/pthreads/include/Makefile
lib/isc/pthreads/include/isc/Makefile
2011-01-11 21:36:22 +00:00
lib/isc/Makefile
lib/isc/include/Makefile
lib/isc/include/isc/Makefile
lib/isc/include/isc/platform.h
2014-02-11 21:20:28 -08:00
lib/isc/include/pk11/Makefile
lib/isc/include/pkcs11/Makefile
2011-07-06 01:36:32 +00:00
lib/isc/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/isc/unix/Makefile
lib/isc/unix/include/Makefile
lib/isc/unix/include/isc/Makefile
lib/isccc/Makefile
lib/isccc/include/Makefile
lib/isccc/include/isccc/Makefile
2018-11-10 10:21:44 +11:00
lib/isccc/tests/Makefile
2011-01-11 21:36:22 +00:00
lib/isccfg/Makefile
lib/isccfg/include/Makefile
lib/isccfg/include/isccfg/Makefile
2016-10-10 17:11:21 -07:00
lib/isccfg/tests/Makefile
2017-09-08 13:39:09 -07:00
lib/ns/Makefile
lib/ns/include/Makefile
lib/ns/include/ns/Makefile
lib/ns/tests/Makefile
2013-04-10 13:49:57 -07:00
lib/samples/Makefile
lib/samples/Makefile-postinstall
2011-02-26 02:26:33 +00:00
unit/unittest.sh
2018-07-03 15:45:11 +02:00
fuzz/Makefile
2005-09-05 00:12:29 +00:00
])
#
# Do it
#
AC_OUTPUT
2000-07-04 01:20:53 +00:00
2010-03-18 13:28:32 +00:00
#
# Now that the Makefiles exist we can ensure that everything is rebuilt.
#
AC_ARG_WITH(make-clean,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-make-clean],
[run "make clean" at end of configure [yes|no]]),
2010-03-18 13:28:32 +00:00
make_clean="$withval", make_clean="yes")
case "$make_clean" in
yes)
2017-07-19 15:53:01 +10:00
if test "yes" != "$no_create"
2016-03-18 08:28:21 +11:00
then
2017-07-19 15:53:01 +10:00
if test "yes" = "$silent"
2017-04-20 15:09:28 -07:00
then
2017-11-13 11:36:45 +11:00
make clean > /dev/null
else
make clean
2017-04-20 15:09:28 -07:00
fi
2016-03-18 08:28:21 +11:00
fi
2010-03-18 13:28:32 +00:00
;;
esac
2013-07-10 20:54:08 -07:00
AC_ARG_ENABLE(full-report,
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--enable-full-report],
[report values of all configure options]))
2013-07-10 20:54:08 -07:00
2017-04-20 15:09:28 -07:00
report() {
echo "==============================================================================="
echo "Configuration summary:"
echo "-------------------------------------------------------------------------------"
echo "Optional features enabled:"
2018-06-06 11:39:50 +02:00
if test "yes" = "$enable_full_report" -o "standard" = "$locktype"; then
echo " Mutex lock type: $locktype"
2017-04-20 15:09:28 -07:00
fi
2017-06-16 09:07:36 +02:00
test "large" = "$use_tuning" && echo " Large-system tuning (--with-tuning)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dnstap" || \
2017-11-13 11:36:45 +11:00
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
2019-06-27 21:19:30 -07:00
test -z "$MAXMINDDB_LIBS" || echo " GeoIP2 access control (--enable-geoip)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_gssapi" || echo " GSS-API (--with-gssapi)"
2014-01-18 11:51:07 -08:00
2018-08-21 14:35:57 +02:00
# these lines are only printed if run with --enable-full-report
2017-04-20 15:09:28 -07:00
if test "yes" = "$enable_full_report"; then
2018-08-21 11:28:24 +02:00
test "no" = "$found_ipv6" || echo " IPv6 support (--enable-ipv6)"
2017-11-13 11:36:45 +11:00
test "X$PYTHON" = "X" || echo " Python tools (--with-python)"
2019-06-26 12:53:35 +02:00
test "X$LIBXML2_LIBS" = "X" || echo " XML statistics (--with-libxml2)"
2019-02-06 11:56:42 +01:00
test "X$JSON_C_LIBS" = "X" || echo " JSON statistics (--with-json-c): $JSON_C_CFLAGS $JSON_C_LIBS"
2017-11-13 11:36:45 +11:00
test "X$ZLIB" = "X" || echo " HTTP zlib compression (--with-zlib)"
test "X$NZD_TOOLS" = "X" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
test "no" = "$with_libidn2" || echo " IDN support (--with-libidn2)"
2017-04-20 15:09:28 -07:00
fi
2014-01-18 11:51:07 -08:00
2017-09-11 11:53:42 -07:00
test "yes" = "$enable_dnsrps" && \
2017-11-13 11:36:45 +11:00
echo " DNS Response Policy Service interface (--enable-dnsrps)"
2017-04-20 15:09:28 -07:00
test "yes" = "$enable_fixed" && \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2018-11-01 13:43:44 +00:00
test "yes" = "$enable_backtrace" && \
2017-11-13 11:36:45 +11:00
echo " Print backtrace on crash (--enable-backtrace)"
2017-04-20 15:09:28 -07:00
test "minimal" = "$want_symtable" && \
2017-11-13 11:36:45 +11:00
echo " Use symbol table for backtrace, named only (--enable-symtable)"
2017-04-20 15:09:28 -07:00
test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
2017-11-13 11:36:45 +11:00
echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
test "yes" = "$want_querytrace" && \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2018-11-14 22:31:39 +00:00
test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)"
2017-04-20 15:09:28 -07:00
2019-04-04 10:43:33 -07:00
test "auto" = "$validation_default" && echo " DNSSEC validation active by default (--enable-auto-validation)"
2018-06-22 13:47:45 +02:00
test "$CRYPTO" = "pkcs11" && (
echo " Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)"
echo " PKCS#11 module (--with-pkcs11): $with_pkcs11"
)
2017-09-12 19:05:46 -07:00
2017-04-20 15:09:28 -07:00
echo " Dynamically loadable zone (DLZ) drivers:"
test "no" = "$use_dlz_bdb" || \
2017-11-13 11:36:45 +11:00
echo " Berkeley DB (--with-dlz-bdb)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_ldap" || \
2017-11-13 11:36:45 +11:00
echo " LDAP (--with-dlz-ldap)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_mysql" || \
2017-11-13 11:36:45 +11:00
echo " MySQL (--with-dlz-mysql)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_odbc" || \
2017-11-13 11:36:45 +11:00
echo " ODBC (--with-dlz-odbc)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_postgres" || \
2017-11-13 11:36:45 +11:00
echo " Postgres (--with-dlz-postgres)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_filesystem" || \
2017-11-13 11:36:45 +11:00
echo " Filesystem (--with-dlz-filesystem)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_dlz_stub" || \
2017-11-13 11:36:45 +11:00
echo " Stub (--with-dlz-stub)"
2017-04-20 15:09:28 -07:00
test "$use_dlz_bdb $use_dlz_ldap $use_dlz_mysql $use_dlz_odbc $use_dlz_postgres $use_dlz_filesystem $use_dlz_stub" = "no no no no no no no" && echo " None"
2017-09-30 10:01:01 -07:00
echo "-------------------------------------------------------------------------------"
2017-04-20 15:09:28 -07:00
echo "Features disabled or unavailable on this platform:"
2018-08-21 11:28:24 +02:00
test "no" = "$found_ipv6" && echo " IPv6 support (--enable-ipv6)"
2017-04-20 15:09:28 -07:00
test "large" = "$use_tuning" || echo " Large-system tuning (--with-tuning)"
test "no" = "$use_dnstap" && \
2017-11-13 11:36:45 +11:00
echo " Allow 'dnstap' packet logging (--enable-dnstap)"
2019-06-27 21:19:30 -07:00
test -z "$MAXMINDDB_LIBS" && echo " GeoIP2 access control (--enable-geoip)"
2017-04-20 15:09:28 -07:00
test "no" = "$use_gssapi" && echo " GSS-API (--with-gssapi)"
2017-09-11 11:53:42 -07:00
test "no" = "$enable_dnsrps" && \
2017-11-13 11:36:45 +11:00
echo " DNS Response Policy Service interface (--enable-dnsrps)"
2017-09-11 11:53:42 -07:00
2017-04-20 15:09:28 -07:00
test "yes" = "$enable_fixed" || \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2017-04-20 15:09:28 -07:00
2019-04-04 10:43:33 -07:00
test "yes" = "$validation_default" && echo " DNSSEC validation requires configuration (--enablee-auto-validation)"
2018-05-16 11:58:15 -07:00
2018-06-22 13:47:45 +02:00
test "$CRYPTO" = "pkcs11" || (
2019-04-04 10:43:33 -07:00
echo " Using PKCS#11 for Public-Key Cryptography (--with-native-pkcs11)"
2018-06-22 13:47:45 +02:00
)
2017-04-20 15:09:28 -07:00
2018-11-01 13:43:44 +00:00
test "yes" = "$enable_backtrace" || \
2017-11-13 11:36:45 +11:00
echo " Print backtrace on crash (--enable-backtrace)"
2017-04-20 15:09:28 -07:00
test "yes" = "$want_querytrace" || \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2017-04-20 15:09:28 -07:00
test "yes" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
2019-02-06 12:08:34 +01:00
test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)"
2017-04-20 15:09:28 -07:00
test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
2019-06-26 12:53:35 +02:00
test "X$LIBXML2_LIBS" = "X" && echo " XML statistics (--with-libxml2)"
2019-02-06 11:56:42 +01:00
test "X$JSON_C_LIBS" = "X" && echo " JSON statistics (--with-json-c)"
2017-04-20 15:09:28 -07:00
test "X$ZLIB" = "X" && echo " HTTP zlib compression (--with-zlib)"
test "X$NZD_TOOLS" = "X" && echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
Rework libidn2 detection
Clean up the parts of configure.in responsible for handling libidn2
detection and adjust other pieces of the build system to match these
cleanups:
- use pkg-config when --with-libidn2 is used without an explicit path,
- look for idn2_to_ascii_lz() rather than idn2_to_ascii_8z() as the
former is used in BIND while the latter is not,
- do not look for idn2_to_unicode_8zlz() as it is present in all
libidn2 versions which have idn2_to_ascii_lz(),
- check whether the <idn2.h> header is usable,
- set LDFLAGS in the Makefile for dig so that, if specified, the
requested libidn2 path is used when linking with libidn2,
- override CPPFLAGS when looking for libidn2 components so that the
configure script does not produce warnings when libidn2 is not
installed system-wide,
- merge the AS_CASE() call into the AS_IF() call below it to simplify
code,
- indicate the default value of --with-libidn2 in "./configure --help"
output,
- use $with_libidn2 rather than $use_libidn2 to better match the name
of the configure script argument,
- stop differentiating between IDN "in" and "out" support, i.e. make
dig either support libidn2 or not; remove WITH_* Autoconf macros and
use a new one, HAVE_LIBIDN2, to determine whether libidn2 support
should be enabled.
2018-07-10 14:34:35 +02:00
test "no" = "$with_libidn2" && echo " IDN support (--with-libidn2)"
2017-04-20 15:09:28 -07:00
2017-09-30 10:01:01 -07:00
echo "-------------------------------------------------------------------------------"
echo "Configured paths:"
echo " prefix: $prefix"
echo " sysconfdir: $sysconfdir"
echo " localstatedir: $localstatedir"
2018-09-07 10:59:04 -07:00
echo "-------------------------------------------------------------------------------"
echo "Compiler: $CC"
$CC --version 2>&1 | sed 's/^/ /'
2017-09-30 10:01:01 -07:00
2017-04-20 15:09:28 -07:00
if test "X$ac_unrecognized_opts" != "X"; then
2017-11-13 11:36:45 +11:00
echo "Unrecognized options:"
echo " $ac_unrecognized_opts"
2017-04-20 15:09:28 -07:00
fi
2017-09-30 10:01:01 -07:00
2017-07-19 15:53:01 +10:00
if test "yes" != "$enable_full_report"; then
2017-11-13 11:36:45 +11:00
echo "-------------------------------------------------------------------------------"
echo "For more detail, use --enable-full-report."
2017-04-20 15:09:28 -07:00
fi
echo "==============================================================================="
}
2017-07-19 15:53:01 +10:00
if test "yes" != "$silent"; then
2017-11-13 11:36:45 +11:00
report
2015-12-02 14:02:53 -08:00
fi
2013-07-10 20:54:08 -07:00
2000-07-04 01:20:53 +00:00
# Tell Emacs to edit this file in shell mode.
# Local Variables:
# mode: sh
# End: