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
2018-08-07 16:46:53 +02:00
#
# Defining the version in m4 requires a bit of dancing around,
# so the strings are properly concatenated, as you can't use
2021-04-16 12:25:35 +02:00
# a shell variable in AC_INIT
2018-08-07 16:46:53 +02:00
#
m4_define([bind_VERSION_MAJOR], 9)dnl
m4_define([bind_VERSION_MINOR], 17)dnl
2021-04-12 12:31:49 +02:00
m4_define([bind_VERSION_PATCH], 12)dnl
2020-06-10 11:26:35 +02:00
m4_define([bind_VERSION_EXTRA], )dnl
2018-08-07 16:46:53 +02:00
m4_define([bind_DESCRIPTION], [(Development Release)])dnl
2020-06-09 14:47:06 +02:00
m4_define([bind_SRCID], [m4_esyscmd_s([git rev-parse --short HEAD | cut -b1-7])])dnl
2018-08-07 16:46:53 +02:00
m4_define([bind_PKG_VERSION], [[bind_VERSION_MAJOR.bind_VERSION_MINOR.bind_VERSION_PATCH]bind_VERSION_EXTRA])dnl
#
# Autoconf initialization
#
AC_INIT([BIND], bind_PKG_VERSION, [info@isc.org], [], [https://www.isc.org/downloads/])
2021-04-16 12:25:35 +02:00
AC_PREREQ([2.69])
2018-08-07 16:46:53 +02:00
AC_DEFINE([PACKAGE_VERSION_MAJOR], ["][bind_VERSION_MAJOR]["], [BIND 9 Major part of the version])
AC_DEFINE([PACKAGE_VERSION_MINOR], ["][bind_VERSION_MINOR]["], [BIND 9 Minor part of the version])
AC_DEFINE([PACKAGE_VERSION_PATCH], ["][bind_VERSION_PATCH]["], [BIND 9 Patch part of the version])
AC_DEFINE([PACKAGE_VERSION_EXTRA], ["][bind_VERSION_EXTRA]["], [BIND 9 Extra part of the version])
AC_DEFINE([PACKAGE_DESCRIPTION], [m4_ifnblank(bind_DESCRIPTION, [" ]bind_DESCRIPTION["], [])], [An extra string to print after PACKAGE_STRING])
AC_DEFINE([PACKAGE_SRCID], ["][bind_SRCID]["], [A short hash from git])
# This value should be increased whenever changing the structure of
# any object that will appear in a type 'map' master file (which
# contains a working memory image of an RBT database), as loading
# an incorrect memory image produces an inconsistent and probably
# nonfunctional database. These structures include but are not
# necessarily limited to dns_masterrawheader, rbtdb_file_header,
# rbt_file_header, dns_rbtdb, dns_rbt, dns_rbtnode, rdatasetheader.
#
# Err on the side of caution: if anything in the RBTDB is changed,
# bump the value. Making map files unreadable protects the system
# from instability; it's a feature not a bug.
#
# Whenever releasing a new major release of BIND9, set this value
# back to 1.0 when releasing the first alpha. Map files are *never*
# compatible across major releases.
AC_DEFINE([MAPAPI], ["2.0"], [BIND 9 MAPAPI Version])
bind_CONFIGARGS="${ac_configure_args:-default}"
AC_DEFINE_UNQUOTED([PACKAGE_CONFIGARGS], ["$bind_CONFIGARGS"], [Either 'defaults' or used ./configure options])
AC_DEFINE([PACKAGE_BUILDER], ["make"], [make or Visual Studio])
2021-04-16 12:25:35 +02:00
#
# Get the Canonical System Type
#
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
2018-08-07 16:46:53 +02:00
AC_CONFIG_SRCDIR([bin/named/main.c])
2020-06-22 20:13:41 +02:00
AM_INIT_AUTOMAKE([1.9 tar-pax foreign subdir-objects dist-xz no-dist-gzip -Wall -Werror])
2018-08-07 16:46:53 +02:00
AM_SILENT_RULES([yes])
2019-03-31 12:49:47 +02:00
AM_EXTRA_RECURSIVE_TARGETS([test unit doc])
2018-08-07 16:46:53 +02:00
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
1998-12-11 20:10:26 +00:00
2019-06-19 14:26:49 +02:00
#
2020-06-22 14:26:07 +02:00
# Enable maintainer mode by default only when building from git repository
2020-12-18 16:37:26 +11:00
# and not cross compling
2019-06-19 14:26:49 +02:00
#
2020-12-18 16:37:26 +11:00
AS_IF([test "$cross_compiling" = no],
[AM_MAINTAINER_MODE(m4_ifset([bind_SRCID],[enable],[disable]))],
[AM_MAINTAINER_MODE([disable])])
2019-06-19 14:26:49 +02:00
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
2018-08-07 16:46:53 +02:00
#
# Compiler compatibility flags
#
2021-04-16 12:25:35 +02:00
m4_version_prereq([2.70],
[AC_PROG_CC],
[AC_PROG_CC_C99])
2018-08-07 16:46:53 +02:00
AC_PROG_CPP_WERROR
2020-12-18 15:48:00 +11:00
#
# Find build compiler when cross compiling
#
AX_CC_FOR_BUILD
2018-08-07 16:46:53 +02:00
#
# Find the machine's endian flavor.
#
AC_C_BIGENDIAN
2018-08-28 21:27:48 +02:00
2019-03-07 13:32:30 +01:00
#
# Enable large file support
#
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
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
2018-08-07 16:46:53 +02:00
# Checks for programs.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # call AM_PROG_AR only if available
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
2019-03-31 12:49:47 +02:00
AC_PROG_MKDIR_P
1999-04-29 05:19:29 +00:00
2018-08-07 16:46:53 +02:00
# Initialize libtool
2020-06-16 10:38:46 +02:00
LT_INIT([disable-static dlopen pic-only])
2020-08-12 15:19:23 +02:00
AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"],
2020-06-16 10:38:46 +02:00
[AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])])
2018-08-07 16:46:53 +02:00
2018-06-04 08:54:58 +02:00
#
2018-08-07 16:46:53 +02:00
# Set the default CFLAGS and CPPFLAGS
2018-06-04 08:54:58 +02:00
#
2020-10-31 20:42:18 +01:00
STD_CFLAGS="-Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-initializers -Wformat -Wshadow"
2018-06-04 08:54:58 +02:00
2018-08-07 16:46:53 +02:00
# These should be always errors
STD_CFLAGS="$STD_CFLAGS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes"
2018-06-04 08:54:58 +02:00
2018-08-07 16:46:53 +02:00
# Fortify the sources by default
STD_CPPFLAGS="-D_FORTIFY_SOURCE=2"
2017-11-08 23:28:10 +11:00
2018-08-07 16:46:53 +02:00
#
# Additional compiler settings.
#
AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
[STD_CFLAGS="$STD_CFLAGS -fno-strict-aliasing"])
2020-04-22 13:02:18 +10:00
# Clang only issues a warning so use -Werror to force a error.
AX_CHECK_COMPILE_FLAG([-Werror -fno-delete-null-pointer-checks],
2018-08-07 16:46:53 +02:00
[STD_CFLAGS="$STD_CFLAGS -fno-delete-null-pointer-checks"])
AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option],
[STD_CFLAGS="$STD_CFLAGS -fdiagnostics-show-option"])
2015-01-20 13:29:18 -08:00
2020-09-28 09:09:21 +02:00
host_macos=no
AS_CASE([$host],[*-darwin*],[host_macos=yes])
AM_CONDITIONAL([HOST_MACOS], [test "$host_macos" = "yes"])
2020-04-23 14:29:07 -07:00
#
# Change defaults for developers if not explicity set.
# Needs to be before the option is tested.
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-developer, --disable-developer]
2019-06-19 11:16:47 +02:00
AC_ARG_ENABLE([developer],
[AS_HELP_STRING([--enable-developer],
[enable developer build settings])])
2014-07-08 15:51:40 +10:00
2019-06-19 11:16:47 +02:00
AS_IF([test "$enable_developer" = "yes"],
2020-07-30 14:07:49 +02:00
[DEVELOPER_MODE=yes
2021-02-05 10:25:07 +01:00
STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_MEM_TRACKLINES=1 -DISC_LIST_CHECKINIT=1"
2019-06-19 11:16:47 +02:00
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 "${with_zlib+set}" = set || with_zlib=yes
2018-08-07 16:46:53 +02:00
test "${enable_warn_error+set}" = set || enable_warn_error=yes
2019-06-19 11:16:47 +02:00
])
2018-08-07 16:46:53 +02:00
2020-07-30 14:07:49 +02:00
AC_SUBST([DEVELOPER_MODE])
2018-08-07 16:46:53 +02:00
AC_SUBST([STD_CFLAGS])
AC_SUBST([STD_CPPFLAGS])
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-warn-error, --disable-warn-error]
2020-04-23 14:29:07 -07:00
AC_ARG_ENABLE([warn_error],
[AS_HELP_STRING([--enable-warn-error],
[turn on -Werror when compiling])],
[],[enable_warn_error=no])
AS_IF([test "$enable_warn_error" = "yes"],
[STD_CFLAGS="$STD_CFLAGS -Werror"])
2018-08-07 16:46:53 +02:00
#
# Use pkg-config
#
PKG_PROG_PKG_CONFIG
AS_IF([test -z "$PKG_CONFIG"],
[AC_MSG_ERROR([The pkg-config script could not be found or is too old.])])
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-buffer-useinline, --disable-buffer-useinline]
2018-08-07 16:46:53 +02:00
AC_ARG_ENABLE(buffer_useinline,
AS_HELP_STRING([--enable-buffer-useinline],
2020-05-15 16:37:44 -07:00
[define ISC_BUFFER_USEINLINE when compiling
2018-08-07 16:46:53 +02:00
[default=yes]]),
if test yes = "${enable}"
then
AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
2020-05-15 16:37:44 -07:00
[Define if you want to use inline buffers])
2018-08-07 16:46:53 +02:00
fi,
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
2014-05-15 20:29:30 -07:00
2020-07-01 10:29:36 +02:00
# Fuzzing is not included in pairwise testing as fuzzing tools are
# not present in the relevant Docker image.
#
# [pairwise: skip]
2018-07-03 15:45:11 +02:00
AC_ARG_ENABLE([fuzzing],
2020-08-12 21:06:26 +02:00
[AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer|ossfuzz>],
2018-07-03 15:45:11 +02:00
[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])
2020-07-31 15:20:56 +02:00
STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
FUZZ_LOG_COMPILER="afl.sh"],
2018-07-03 15:45:11 +02:00
[libfuzzer],[
AC_MSG_RESULT([using libFuzzer])
2020-07-31 15:20:56 +02:00
STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer-no-link,address,undefined"
LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
FUZZ_LOG_COMPILER="libfuzzer.sh"],
2020-08-12 21:06:26 +02:00
[ossfuzz],[
AC_MSG_RESULT([using OSS-Fuzz])
FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"],
2018-07-03 15:45:11 +02:00
[*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
2020-07-31 15:20:56 +02:00
AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
AC_SUBST([FUZZ_LOG_COMPILER])
AC_SUBST([FUZZ_LDFLAGS])
2018-07-03 15:45:11 +02:00
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
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-mutex-atomics, --disable-mutex-atomics]
2019-05-17 11:35:35 +02:00
AC_ARG_ENABLE(mutex_atomics,
AS_HELP_STRING([--enable-mutex-atomics],
2020-05-15 16:37:44 -07:00
[emulate atomics by mutex-locked variables, useful for debugging
2019-05-17 11:35:35 +02:00
[default=no]]),
[],
[enable_mutex_atomics=no])
AC_MSG_CHECKING([whether to emulate atomics with mutexes])
case "$enable_mutex_atomics" in
yes)
2020-05-15 16:37:44 -07:00
AC_MSG_RESULT(yes)
AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
;;
2019-05-17 11:35:35 +02:00
no)
2020-05-15 16:37:44 -07:00
AC_MSG_RESULT(no)
;;
2019-05-17 11:35:35 +02:00
*)
2020-05-15 16:37:44 -07:00
AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
;;
2019-05-17 11:35:35 +02:00
esac
2000-06-13 17:34:28 +00:00
#
# Perl is optional; it is used only by some of the system test scripts.
#
2018-08-07 16:46:53 +02:00
AC_PATH_PROGS([PERL], [perl5 perl])
AC_SUBST([PERL])
AM_CONDITIONAL([HAVE_PERL], [test -n "$PERL"])
2000-06-13 17:34:28 +00:00
2018-08-07 16:46:53 +02:00
AX_PERL_MODULE([Digest::HMAC])
AM_CONDITIONAL([HAVE_PERLMOD_DIGEST_HMAC],
[test "$HAVE_PERLMOD_DIGEST__HMAC" = "yes"])
2018-12-18 15:05:52 +01:00
2018-08-07 16:46:53 +02:00
AX_PERL_MODULE([File::Fetch])
AM_CONDITIONAL([HAVE_PERLMOD_FILE_FETCH],
[test "$HAVE_PERLMOD_FILE__FETCH" = "yes"])
2019-12-03 08:38:50 +11:00
2018-08-07 16:46:53 +02:00
AX_PERL_MODULE([Net::DNS])
AM_CONDITIONAL([HAVE_PERLMOD_NET_DNS],
[test "$HAVE_PERLMOD_NET__DNS" = "yes"])
2018-11-27 11:43:46 +01:00
2018-08-07 16:46:53 +02:00
AX_PERL_MODULE([Net::DNS::Nameserver])
AM_CONDITIONAL([HAVE_PERLMOD_NET_DNS_NAMESERVER],
[test "$HAVE_PERLMOD_NET__DNS__NAMESERVER" = "yes"])
2018-12-18 15:05:52 +01:00
2018-08-07 16:46:53 +02:00
AX_PERL_MODULE([Time::HiRes])
AM_CONDITIONAL([HAVE_PERLMOD_TIME_HIRES],
[test "$HAVE_PERLMOD_TIME__HIRES" = "yes"])
2018-11-27 11:43:46 +01:00
2018-08-07 16:46:53 +02:00
#
# Python is optional, it is used only by some of the system test scripts.
#
AM_PATH_PYTHON([3.4], [], [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"])
2018-11-27 11:43:46 +01:00
2021-05-13 17:24:57 +02:00
AC_PATH_PROGS([PYTEST], [pytest-3 py.test-3 pytest py.test pytest-pypy], [])
2020-03-27 13:23:24 +01:00
AS_IF([test -z "$PYTEST"],
[AC_MSG_WARN([pytest not found, some system tests will be skipped])])
AC_SUBST([PYTEST])
2020-04-29 15:55:38 -03:00
AM_CONDITIONAL([HAVE_PYTEST], [test -n "$PYTEST"])
2020-03-27 13:23:24 +01:00
2018-08-07 16:46:53 +02:00
AX_PYTHON_MODULE([dns])
AM_CONDITIONAL([HAVE_PYMOD_DNS], [test "$HAVE_PYMOD_DNS" = "yes"])
2000-02-10 01:14:06 +00:00
2000-02-11 18:35:11 +00:00
#
2018-08-07 16:46:53 +02:00
# xsltproc is optional, it is used only by system test scripts.
2000-02-11 18:35:11 +00:00
#
2018-08-07 16:46:53 +02:00
AC_PATH_PROG([XSLTPROC], [xsltproc])
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])
])
])
2018-08-07 16:46:53 +02: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], [], [],
[$ac_includes_default
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
2001-01-31 19:22:46 +00:00
2018-05-29 14:10:32 +02:00
#
# Check for thread local storage
#
2018-08-07 16:46:53 +02:00
AC_CHECK_HEADERS([threads.h])
AX_TLS([AS_IF([test "$ac_cv_tls" != "thread_local"],
[AC_DEFINE_UNQUOTED([thread_local], [$ac_cv_tls], [Define if the compiler uses a different keyword than thread_local for TLS variables])])],
[AC_MSG_ERROR([Thread Local Storage support required, update your toolchain to build BIND 9])])
2018-05-29 14:10:32 +02:00
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
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()
#
2018-08-07 16:46:53 +02:00
AC_CHECK_FUNCS([seteuid setresuid])
AC_CHECK_FUNCS([setegid setresgid])
2009-07-14 22:39:30 +00:00
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
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
#
2018-08-07 16:46:53 +02:00
AX_GCC_FUNC_ATTRIBUTE([noreturn])
2009-09-29 15:06:07 +00:00
2021-04-01 17:03:59 -03:00
#
# check for GCC malloc attribute
#
AX_GCC_FUNC_ATTRIBUTE([malloc])
AC_MSG_CHECKING([for extended malloc attributes])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <stddef.h>
#include <stdlib.h>
__attribute__ ((malloc, malloc (free, 1))
void * xmalloc(size_t sz) { return malloc(sz); }
]],
[[
void *p = xmalloc(8);
free(p);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_MALLOC_EXT_ATTR], [1], [define if extended attributes for malloc are available])
],
[AC_MSG_RESULT(no)])
#
# check for GCC returns_nonnull attribute
#
AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
2008-06-23 19:41:20 +00:00
#
# check if we have kqueue
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-kqueue, --disable-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
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-epoll, --disable-epoll]
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
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-devpoll, --disable-devpoll]
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-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.
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-geoip --with-maxminddb=auto, --enable-geoip --with-maxminddb=yes, --disable-geoip]
2019-06-27 21:19:30 -07:00
AC_ARG_ENABLE([geoip],
[AS_HELP_STRING([--disable-geoip],
[support GeoIP2 geolocation ACLs if available [default=yes]])],
[], [enable_geoip="yes"])
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
2019-06-27 21:19:30 -07:00
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]])],
2018-08-07 16:46:53 +02:00
[], [with_maxminddb="auto"])
2019-06-11 15:59:31 -07:00
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])])
],[:])],
[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])])
])],
[ # default
AX_SAVE_FLAGS([maxminddb])
MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
2019-11-05 12:54:35 +11:00
MAXMINDDB_LIBS="-L$with_maxminddb/lib"
2019-06-27 21:19:30 -07:00
CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
2018-08-07 16:46:53 +02:00
LIBS="$LIBS $MAXMINDDB_LIBS"
2019-06-27 21:19:30 -07:00
AC_SEARCH_LIBS([MMDB_open], [maxminddb],
[AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
2021-01-06 18:05:58 +11:00
MAXMINDDB_LIBS="$MAXMINDDB_LIBS $ac_cv_search_MMDB_open"
2019-06-27 21:19:30 -07:00
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])
])
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_GEOIP2], [test -n "$MAXMINDDB_LIBS"])
2019-06-11 15:59:31 -07:00
AC_SUBST([MAXMINDDB_CFLAGS])
AC_SUBST([MAXMINDDB_LIBS])
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
2020-07-01 10:29:36 +02:00
# [pairwise: --with-locktype=adaptive, --with-locktype=standard]
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-11-05 13:55:54 -08:00
# libuv
2018-08-07 16:46:53 +02:00
AC_MSG_CHECKING([for libuv])
2019-11-05 13:55:54 -08:00
PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [],
[AC_MSG_ERROR([libuv not found])])
AX_SAVE_FLAGS([libuv])
CFLAGS="$CFLAGS $LIBUV_CFLAGS"
LIBS="$LIBS $LIBUV_LIBS"
2019-12-02 11:19:55 +01:00
# Those functions are only provided in newer versions of libuv, we'll be emulating them
# for now
2021-05-03 12:10:03 +02:00
AC_CHECK_FUNCS([uv_handle_get_data uv_handle_set_data uv_import uv_udp_connect uv_translate_sys_error uv_sleep])
2018-08-07 16:46:53 +02:00
AX_RESTORE_FLAGS([libuv])
2019-12-02 11:19:55 +01:00
2020-10-31 20:42:18 +01:00
# libnghttp2
AC_MSG_CHECKING([for libnghttp2])
PKG_CHECK_MODULES([LIBNGHTTP2], [libnghttp2 >= 1.6.0], [],
[AC_MSG_ERROR([libnghttp2 not found])])
AX_SAVE_FLAGS([libnghttp2])
CFLAGS="$CFLAGS $LIBNGHTTP2_CFLAGS"
LIBS="$LIBS $LIBNGHTTP2_LIBS"
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
2019-01-25 12:29:52 +01:00
#
2020-02-27 13:21:31 +01:00
# Do we want to use pthread rwlock?
2019-01-25 12:29:52 +01:00
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-pthread-rwlock, --disable-pthread-rwlock]
2019-01-25 12:29:52 +01:00
AC_ARG_ENABLE([pthread_rwlock],
2020-04-17 08:36:24 +02:00
[AS_HELP_STRING([--enable-pthread-rwlock],
[use pthread rwlock instead of internal rwlock implementation])],
[], [enable_pthread_rwlock=no])
2019-01-25 12:29:52 +01:00
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
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
#
2020-05-13 17:37:51 +02:00
PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto], [],
2019-06-24 14:06:56 +02:00
[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"
2020-12-17 11:40:29 +01:00
AC_MSG_CHECKING([for OpenSSL >= 1.0.0 or LibreSSL >= 2.7.0])
2018-06-12 11:26:04 +02:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],
2020-12-17 11:40:29 +01:00
[[#if (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)) || \\
(defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x02070000fL))
#error OpenSSL >= 1.0.0 or LibreSSL >= 2.7.0 required
2018-06-12 11:26:04 +02:00
#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
#
2020-12-17 11:40:29 +01:00
AC_CHECK_FUNCS([OPENSSL_init_ssl OPENSSL_init_crypto])
2018-10-26 05:29:56 +02:00
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])
2020-12-17 11:40:29 +01:00
AC_CHECK_FUNCS([SSL_read_ex SSL_peek_ex SSL_write_ex])
AC_CHECK_FUNCS([BIO_read_ex BIO_write_ex])
AC_CHECK_FUNCS([SSL_CTX_up_ref])
AC_CHECK_FUNCS([SSL_CTX_set_min_proto_version])
2018-10-26 05:29:56 +02:00
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])],
2019-08-30 15:32:11 +02:00
[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
2020-12-17 11:40:29 +01:00
AC_CHECK_FUNCS([TLS_server_method TLS_client_method])
2020-05-13 17:37:51 +02:00
2018-10-14 14:32:02 +02:00
#
# Check whether FIPS mode is available and whether we should enable it
#
2020-07-01 10:29:36 +02:00
# FIPS is not included in pairwise testing as the relevant Docker image
# does not support FIPS mode.
#
# [pairwise: skip]
2018-10-14 14:32:02 +02:00
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
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
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-native-pkcs11, --disable-native-pkcs11]
2018-08-07 16:46:53 +02:00
AC_ARG_ENABLE([native-pkcs11],
2018-06-12 11:26:04 +02:00
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])],
2018-08-07 16:46:53 +02:00
[yes],[CRYPTO=pkcs11
2018-06-12 11:26:04 +02:00
AC_MSG_RESULT([yes])
AC_CHECK_FUNCS([getpassphrase])
2018-07-19 13:46:01 -04:00
])
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_PKCS11], [test "$CRYPTO" = "pkcs11"])
2018-06-12 11:26:04 +02:00
2020-04-17 10:58:46 +02:00
AC_SUBST([CRYPTO])
2018-06-12 11:26:04 +02:00
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])])
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
#
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
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])
2018-08-07 16:46:53 +02:00
AC_CHECK_FUNCS([clock_gettime])
2018-06-12 11:26:04 +02:00
2020-07-01 10:29:36 +02:00
# [pairwise: --with-gssapi=yes, --with-gssapi=auto, --without-gssapi]
2018-08-07 16:46:53 +02:00
AC_ARG_WITH([gssapi],
[AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
2018-06-12 11:26:04 +02:00
[Specify path for system-supplied GSSAPI
2018-08-07 16:46:53 +02:00
[default=auto]])],
[], [with_gssapi="auto"])
KRB5_CONFIG=
AS_CASE([$with_gssapi],
[no],[AC_MSG_CHECKING([for GSSAPI support])
AC_MSG_RESULT([no])],
[yes],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
AS_IF([test -z "$KRB5_CONFIG"],
[AC_MSG_ERROR([krb5-config required but not found])])],
[auto],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config])],
[*krb5-config*],[KRB5_CONFIG="$with_gssapi"],
[AC_MSG_ERROR([--with-gssapi requires yes|no|auto|/path/to/krb5-config])])
GSSAPI_CFLAGS=
GSSAPI_LIBS=
KRB5_CFLAGS=
KRB5_LIBS=
AS_IF([test -n "$KRB5_CONFIG"],
[AC_MSG_CHECKING([for gssapi libraries])
AX_SAVE_FLAGS([gssapi])
GSSAPI_CFLAGS=`"$KRB5_CONFIG" --cflags gssapi`
GSSAPI_LIBS=`"$KRB5_CONFIG" --libs gssapi`
CFLAGS="$CFLAGS $GSSAPI_CFLAGS"
LIBS="$LIBS $GSSAPI_LIBS"
AC_MSG_RESULT([$GSSAPI_CFLAGS $GSSAPI_LIBS])
AC_CHECK_HEADERS([gssapi/gssapi.h], [],
[AC_CHECK_HEADERS([gssapi.h], [],
[AC_MSG_ERROR([neither gssapi/gssapi.h nor gssapi.h found])])])
AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
[AC_CHECK_HEADERS([gssapi_krb5.h], []
[AC_MSG_ERROR([neither gssapi/gssapi_krb5.h nor gssapi_krb5.h found])])])
AC_CHECK_FUNCS([gss_acquire_cred],[],
[AC_MSG_ERROR([linking with $GSSAPI_LIBS does not work])])
AX_RESTORE_FLAGS([gssapi])
AC_MSG_CHECKING([for krb5 libraries])
AX_SAVE_FLAGS([krb5])
KRB5_CFLAGS=`"$KRB5_CONFIG" --cflags krb5`
KRB5_LIBS=`$KRB5_CONFIG --libs krb5`
CFLAGS="$CFLAGS $KRB5_CFLAGS"
LIBS="$CFLAGS $KRB5_LIBS"
AC_MSG_RESULT([$KRB5_CFLAGS $KRB5_LIBS])
AC_CHECK_HEADERS([krb5/krb5.h], [],
[AC_CHECK_HEADERS([krb5.h], [],
[AC_MSG_ERROR([neither krb5/krb5.h nor krb5 found])])])
AC_CHECK_FUNCS([krb5_init_context], [],
[AC_MSG_ERROR([linking with $KRB5_LIBS failed])])
AX_RESTORE_FLAGS([krb5])
AC_DEFINE([HAVE_GSSAPI], [1], [Define to 1 if you have the Kerberos Framework available])
# kludge to silence compiler warnings which recommend use of GSS.framework on macOS
AS_CASE([$host],[*-darwin*],[CFLAGS="$CFLAGS -Wno-deprecated-declarations"])])
AM_CONDITIONAL([HAVE_GSSAPI], [test -n "$GSSAPI_LIBS"])
AC_SUBST([GSSAPI_CFLAGS])
AC_SUBST([GSSAPI_LIBS])
AC_SUBST([KRB5_CFLAGS])
AC_SUBST([KRB5_LIBS])
2014-04-03 09:24:53 +02:00
2016-07-21 11:13:03 -07:00
#
# was --with-lmdb specified?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-lmdb=auto, --with-lmdb=yes, --without-lmdb]
2020-03-10 12:37:25 +01:00
AC_ARG_WITH([lmdb],
[AS_HELP_STRING([--with-lmdb=@<:@PATH@:>@],
[use LMDB library @<:@default=auto@:>@, optionally specify the prefix for lmdb library])],
[:],
[with_lmdb="auto"])
2016-07-21 11:13:03 -07:00
2020-03-10 12:37:25 +01:00
ac_lib_lmdb_found=no
AS_CASE([$with_lmdb],
[no],[],
[auto|yes], [PKG_CHECK_MODULES([LMDB], [lmdb],
[ac_lib_lmdb_found=yes],
[for ac_lib_lmdb_path in /usr /usr/local /opt /opt/local; do
AX_LIB_LMDB([$ac_lib_lmdb_path],
[ac_lib_lmdb_found=yes
break])
done
])],
[AX_LIB_LMDB([$with_lmdb],[ac_lib_lmdb_found=yes])])
# don't fail when in automatic mode
AS_IF([test "$with_lmdb" = "auto" && test "$ac_lib_lmdb_found" = "no"],
[with_lmdb=no])
# hard fail when LMDB requested, but not found
AS_IF([test "$with_lmdb" != "no" && test "$ac_lib_lmdb_found" != "yes"],
[AC_MSG_ERROR([LMDB requested, but not found])])
AS_IF([test "$ac_lib_lmdb_found" = "yes"],
[AC_DEFINE([HAVE_LMDB], [1], [Use lmdb library])])
AC_SUBST([LMDB_CFLAGS])
AC_SUBST([LMDB_LIBS])
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_LMDB], [test -n "$LMDB_LIBS"])
2016-07-21 11:13:03 -07:00
2006-12-21 06:03:37 +00:00
#
# was --with-libxml2 specified?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-libxml2=auto, --with-libxml2=yes, --without-libxml2]
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
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_LIBXML2], [test -n "$LIBXML2_LIBS"])
2013-03-13 14:24:50 -07:00
2019-02-06 11:56:42 +01:00
#
# was --with-json-c specified?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-json-c=detect, --with-json-c=yes, --without-json-c]
2019-02-06 11:56:42 +01:00
AC_ARG_WITH([json-c],
[AS_HELP_STRING([--with-json-c],
[build with json-c library [yes|no|detect] (default is detect)])],
2018-08-07 16:46:53 +02:00
[], [with_json_c="detect"])
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
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_JSON_C], [test -n "$JSON_C_LIBS"])
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
2018-08-07 16:46:53 +02:00
#
# was --with-zlib specified?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-zlib=auto, --with-zlib=yes, --without-zlib]
2019-07-31 13:50:15 +02:00
AC_ARG_WITH([zlib],
2018-08-07 16:46:53 +02:00
[AS_HELP_STRING([--with-zlib],
[build with zlib for HTTP compression
[default=yes]])],
[], with_zlib="auto")
2019-07-31 13:50:15 +02:00
AS_CASE([$with_zlib],
[no],[],
[auto],[PKG_CHECK_MODULES([ZLIB], [zlib],
2020-05-15 16:37:44 -07:00
[AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
[:])],
2019-07-31 13:50:15 +02:00
[yes],[PKG_CHECK_MODULES([ZLIB], [zlib],
2020-05-15 16:37:44 -07:00
[AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
2019-07-31 13:50:15 +02:00
[AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])])
2020-02-19 00:17:03 -08:00
AC_SUBST([ZLIB_CFLAGS])
AC_SUBST([ZLIB_LIBS])
2015-10-02 10:45:10 +02:00
2009-09-01 18:40:25 +00:00
#
2020-03-11 09:55:48 +01:00
# Check if the system supports glibc-compatible backtrace() function.
2009-09-01 18:40:25 +00:00
#
2020-03-11 09:55:48 +01:00
AC_CHECK_HEADERS([execinfo.h],
2021-04-27 16:20:03 +02:00
[AC_SEARCH_LIBS([backtrace_symbols], [execinfo],
[AC_CHECK_FUNCS([backtrace_symbols])])])
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
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-tcp-fastopen, --disable-tcp-fastopen]
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]])],
2018-08-07 16:46:53 +02:00
[], [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
2020-08-11 16:14:36 +02:00
#
# Check for readline support
#
2020-07-01 10:29:36 +02:00
# editline is not included in pairwise testing as the library
# is not present in the relevant Docker image.
#
# GNU Readline is not included in pairwise testing as the library
# in the relevant Docker image does not support pkg-config.
#
# [pairwise: --with-readline=auto, --with-readline=yes, --with-readline=libedit, --without-readline]
2020-08-11 16:14:36 +02:00
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline=yes|no|libedit|readline],
[specify readline library [default auto]])],
[], [with_readline="auto"])
AS_CASE([$with_readline],
[no],[],
2020-08-18 16:31:20 +02:00
[auto|yes],
2020-08-11 16:14:36 +02:00
[PKG_CHECK_MODULES([READLINE], [libedit],
[AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])],
2020-08-19 17:12:25 +02:00
[PKG_CHECK_MODULES([READLINE], [libeditline],
2020-08-11 16:14:36 +02:00
[AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support.])],
[PKG_CHECK_MODULES([READLINE], [readline],
[AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support.])],
[AS_IF([test "$with_readline" = "yes"],
[AC_MSG_ERROR([readline support requested, but none of the libraries have been found.])])])])])],
[libedit],
[PKG_CHECK_MODULES([READLINE], [libedit],
[AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])])],
[editline],
2020-08-19 17:12:25 +02:00
[PKG_CHECK_MODULES([READLINE], [libeditline],
2020-08-11 16:14:36 +02:00
[AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support])])],
[readline],
[PKG_CHECK_MODULES([READLINE], [readline],
[AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support])])],
[AC_MSG_ERROR([Unknown readline '$with_readline' library requested.])])
AM_CONDITIONAL([HAVE_READLINE], [test -n "$READLINE_LIBS"])
AC_SUBST([READLINE_CFLAGS])
AC_SUBST([READLINE_LIBS])
2011-12-16 23:01:17 +00:00
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.
2020-07-01 10:29:36 +02:00
#
# [pairwise: --enable-chroot, --disable-chroot]
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])
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-linux-caps, --disable-linux-caps]
2018-06-26 14:52:11 +02:00
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
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)
2021-04-16 12:25:35 +02:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <unistd.h>]],
[[optarg = 0;]]
)],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
GEN_NEED_OPTARG="-DNEED_OPTARG=1"
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])]
)
2005-06-08 02:09:18 +00:00
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
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
2019-11-05 13:28:50 -08:00
AC_CHECK_HEADERS([stdalign.h])
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])
2021-04-16 12:25:35 +02:00
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[return (__builtin_expect(1, 1) ? 1 : 0);]]
)],
[have_builtin_expect=yes
AC_MSG_RESULT(yes)],
[have_builtin_expect=no
AC_MSG_RESULT(no)]
)
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])
2021-04-16 12:25:35 +02:00
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[return (__builtin_clz(0xff) == 24 ? 1 : 0);]]
)],
[have_builtin_clz=yes
AC_MSG_RESULT(yes)],
[have_builtin_clz=no
AC_MSG_RESULT(no)]
)
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?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-fixed-rrset, --disable-fixed-rrset]
2018-08-07 16:46:53 +02:00
AC_ARG_ENABLE([fixed-rrset],
[AS_HELP_STRING([--enable-fixed-rrset],
[enable fixed rrset ordering [default=no]])],
[], [enable_fixed_rrset="no"])
AS_IF([test "$enable_fixed_rrset" = "yes"],
[AC_DEFINE([DNS_RDATASET_FIXED], [1],
[Define to enable "rrset-order fixed" syntax.])])
2008-04-23 21:32:57 +00:00
2015-10-02 12:32:42 -07:00
#
# Activate dnstap?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-dnstap, --disable-dnstap]
2018-08-07 16:46:53 +02:00
AC_ARG_ENABLE([dnstap],
[AS_HELP_STRING([--enable-dnstap],
[enable dnstap support
(requires fstrm, protobuf-c)])],
[], [enable_dnstap=no])
AS_IF([test "$enable_dnstap" != "no"],
[PKG_CHECK_MODULES([DNSTAP], [libfstrm libprotobuf-c], [],
[AC_MSG_FAILURE([Required libraries (fstrm, protobuf-c) were not found, please install them.])])
2020-04-23 08:34:11 +02:00
AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
AC_PATH_PROG([PROTOC_C], [protoc-c])
2018-08-07 16:46:53 +02:00
AS_IF([test -z "$PROTOC_C"],
[AC_MSG_ERROR([protoc-c compiler not found])])
AC_DEFINE([HAVE_DNSTAP], 1, [Define to 1 to enable dnstap support])
])
2006-12-22 01:46:19 +00:00
2018-08-07 16:46:53 +02:00
AC_SUBST([DNSTAP_CFLAGS])
AC_SUBST([DNSTAP_LIBS])
AM_CONDITIONAL([HAVE_DNSTAP], [test "$enable_dnstap" != "no"])
2019-03-31 12:49:47 +02: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.
#
#
# Look for sphinx-build
#
AC_ARG_VAR([SPHINX_BUILD], [path to sphinx-build binary used to build the documentation])
AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], [:])
AM_CONDITIONAL([HAVE_SPHINX_BUILD], [test "$SPHINX_BUILD" != ":"])
AC_PATH_PROG([XELATEX], [xelatex], [:])
AC_PATH_PROG([LATEXMK], [latexmk], [:])
AM_CONDITIONAL([HAVE_XELATEX], [test "$XELATEX" != ":" && test "$LATEXMK" != ":"])
#
# Pull release date from CHANGES file last modification date
# for reproducible builds
#
release_date=`date -r CHANGES +%Y-%m-%d`
AC_SUBST([RELEASE_DATE], $release_date)
#
# Look for Doxygen
#
AC_PATH_PROGS([DOXYGEN], [doxygen])
AC_CONFIG_FILES([doc/doxygen/doxygen-input-filter],
[chmod +x doc/doxygen/doxygen-input-filter])
2006-12-22 01:46:19 +00:00
2015-06-29 18:33:18 +05:30
#
# Look for curl
#
AC_PATH_PROG(CURL, curl, curl)
AC_SUBST(CURL)
2015-09-23 16:47:37 +02:00
#
# IDN support using libidn2
#
2018-03-14 11:30:47 +01:00
LIBIDN2_CFLAGS=
2017-08-15 14:36:59 +02:00
LIBIDN2_LIBS=
2020-07-01 10:29:36 +02:00
# [pairwise: --with-libidn2=yes, --without-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
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"
2020-11-24 14:51:51 +01:00
LIBIDN2_LIBS="-L$with_libidn2/lib"
CFLAGS="$CFLAGS $LIBIDN2_CFLAGS"
LIBS="$LIBS $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_CHECK_HEADERS([idn2.h],
[],
[AC_MSG_ERROR([idn2.h not found])])
AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
2020-11-24 14:51:51 +01:00
[LIBIDN2_LIBS="$LIBIDN2_LIBS $ac_cv_search_idn2_to_ascii_lz"
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_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])
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
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-cmocka=detect, --with-cmocka=yes, --without-cmocka]
2018-06-04 08:54:58 +02:00
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],[],
2021-03-15 10:22:15 +01:00
[detect],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3],
2019-02-06 15:26:19 -08:00
[AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])
2018-08-07 16:46:53 +02:00
with_cmocka=yes],[with_cmocka=no])],
2021-03-15 10:22:15 +01:00
[yes],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3],
2018-08-07 16:46:53 +02:00
[AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])])],
2019-02-06 15:26:19 -08:00
[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-10-23 11:44:33 +02:00
2018-08-07 16:46:53 +02:00
AM_CONDITIONAL([HAVE_CMOCKA], [test "$with_cmocka" = "yes"])
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?
#
2020-07-01 10:29:36 +02:00
# [pairwise: --with-tuning=small, --without-tuning]
2020-02-03 10:50:18 +01:00
AC_ARG_WITH([tuning],
2017-11-13 11:36:45 +11:00
AS_HELP_STRING([--with-tuning=ARG],
2020-02-03 10:50:18 +01:00
[Specify server tuning (default or small)]),
[],[with_tuning=no])
2014-02-18 22:36:14 -08:00
2020-02-03 10:50:18 +01:00
AS_CASE([$with_tuning],
[small],[AC_MSG_NOTICE(using small system tuning)],
[AC_DEFINE(TUNE_LARGE, 1, [Define to use default system tuning.])
AC_MSG_NOTICE(using default system tuning)])
2014-02-18 22:36:14 -08:00
2015-02-26 16:49:27 +05:30
#
2020-05-15 16:37:44 -07:00
# was --enable-querytrace or --enable-singletrace specified?
2015-02-26 16:49:27 +05:30
#
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-singletrace --enable-querytrace, --disable-singletrace --enable-querytrace, --disable-singletrace --disable-querytrace]
2020-05-15 16:37:44 -07:00
AC_ARG_ENABLE([singletrace],
AS_HELP_STRING([--enable-singletrace],
[enable single-query trace logging
[default=no]]),
enable_singletrace="$enableval", enable_singletrace="no")
AC_MSG_CHECKING([whether to enable single-query trace logging])
case "$enable_singletrace" in
yes)
enable_querytrace=yes
AC_MSG_RESULT(yes)
AC_DEFINE(WANT_SINGLETRACE, 1, [Define to enable single-query tracing.])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR("--enable-singletrace requires yes or no")
;;
esac
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
2015-02-26 16:49:27 +05:30
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]]),
2020-05-15 16:37:44 -07:00
enable_querytrace="$enableval",
enable_querytrace="$enable_singletrace")
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])
2020-04-23 14:29:07 -07:00
case "$enable_querytrace" in
2015-02-26 16:49:27 +05:30
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
;;
no)
2020-05-15 16:37:44 -07:00
AS_IF([test "$enable_singletrace" = "yes"],
[AC_MSG_ERROR([--enable-singletrace requires --enable-querytrace])])
2015-02-26 16:49:27 +05:30
AC_MSG_RESULT(no)
;;
*)
2020-05-15 16:37:44 -07:00
AC_MSG_ERROR("--enable-querytrace requires yes or no (not $enable_querytrace)")
2015-02-26 16:49:27 +05:30
;;
esac
2018-05-16 11:58:15 -07:00
#
# Was --disable-auto-validation specified?
#
2020-07-01 10:29:36 +02:00
2018-06-06 12:02:40 +02:00
validation_default=auto
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-auto-validation, --disable-auto-validation]
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
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=""
2005-09-05 00:12:29 +00:00
2018-08-21 14:35:57 +02:00
#
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])
])
2020-07-01 10:29:36 +02:00
# DNSRPS is not included in pairwise testing as the librpz library is not
# present in the relevant Docker image.
#
# [pairwise: skip]
2018-08-25 13:15:06 +02:00
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])])
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
2018-08-25 13:15:06 +02:00
AC_ARG_WITH([dnsrps-libname],
[AS_HELP_STRING([--with-dnsrps-libname],
[DNSRPS provider library name (librpz.so)])],
[librpz_name="$withval"], [librpz_name="librpz.so"])
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
2018-08-25 13:15:06 +02:00
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()])
2020-07-01 10:29:36 +02:00
# [pairwise: skip]
2018-08-25 13:15:06 +02:00
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])
])
2020-04-23 14:29:07 -07:00
# FIXME BEGIN
2018-08-07 16:46:53 +02:00
#sinclude(contrib/dlz/config.dlz.in)
# AC_MSG_CHECKING(contributed DLZ drivers)
#
# if test -n "$CONTRIB_DLZ"
# then
# AC_MSG_RESULT(yes)
# DLZ_DRIVER_RULES=contrib/dlz/drivers/rules
# AC_CONFIG_FILES([$DLZ_DRIVER_RULES
# contrib/dlz/modules/mysql/Makefile
# contrib/dlz/modules/mysqldyn/Makefile])
# else
# AC_MSG_RESULT(no)
# DLZ_DRIVER_RULES=/dev/null
# fi
#
# AC_SUBST(CONTRIB_DLZ)
# AC_SUBST(DLZ_DRIVER_INCLUDES)
# AC_SUBST(DLZ_DRIVER_LIBS)
# AC_SUBST(DLZ_DRIVER_SRCS)
# AC_SUBST(DLZ_DRIVER_OBJS)
# AC_SUBST(DLZ_SYSTEM_TEST)
# AC_SUBST_FILE(DLZ_DRIVER_RULES)
2020-04-23 14:29:07 -07:00
# this ensures the configure summary report comes out right
test -z "$with_dlz_bdb" && with_dlz_bdb=no
test -z "$with_dlz_ldap" && with_dlz_ldap=no
test -z "$with_dlz_mysql" && with_dlz_mysql=no
test -z "$with_dlz_odbc" && with_dlz_odbc=no
test -z "$with_dlz_postgres" && with_dlz_postgres=no
test -z "$with_dlz_filesystem" && with_dlz_filesystem=no
test -z "$with_dlz_stub" && with_dlz_stub=no
# FIXME END
2005-09-05 00:12:29 +00:00
2018-08-07 16:46:53 +02:00
AC_CHECK_HEADERS([glob.h])
2005-09-05 00:12:29 +00:00
2021-02-09 17:44:40 +01:00
#
# Support for constructor and destructor attributes
#
AX_GCC_FUNC_ATTRIBUTE([constructor])
AX_GCC_FUNC_ATTRIBUTE([destructor])
2018-08-07 16:46:53 +02:00
#
# Files to configure. These are listed here because we used to
# specify them as arguments to AC_OUTPUT.
#
2005-09-05 00:12:29 +00:00
2018-08-07 16:46:53 +02:00
# Top
2019-10-23 16:25:06 -03:00
2018-08-07 16:46:53 +02:00
AC_CONFIG_FILES([Makefile])
2006-01-05 00:30:34 +00:00
2018-08-07 16:46:53 +02:00
# Binaries
2006-12-04 01:54:53 +00:00
2018-08-07 16:46:53 +02:00
AC_CONFIG_FILES([bin/Makefile
bin/named/Makefile
bin/rndc/Makefile
bin/dig/Makefile
bin/delv/Makefile
bin/dnssec/Makefile
bin/tools/Makefile
bin/nsupdate/Makefile
bin/check/Makefile
bin/confgen/Makefile
bin/pkcs11/Makefile
bin/plugins/Makefile])
2005-09-05 00:12:29 +00:00
2018-08-07 16:46:53 +02:00
# Libraries
2005-05-11 05:55:41 +00:00
2018-08-07 16:46:53 +02:00
AC_CONFIG_FILES([lib/Makefile
lib/isc/Makefile
lib/dns/Makefile
lib/ns/Makefile
lib/irs/Makefile
lib/isccfg/Makefile
lib/isccc/Makefile
2021-03-22 18:40:21 -07:00
lib/bind9/Makefile])
2005-05-11 05:55:41 +00:00
2019-03-31 12:49:47 +02:00
# Documentation
AC_CONFIG_FILES([doc/Makefile
doc/arm/Makefile
doc/man/Makefile
doc/misc/Makefile])
2018-08-07 16:46:53 +02:00
# Generated headers
AC_CONFIG_FILES([lib/isc/include/isc/platform.h])
# Unit Tests
AC_CONFIG_FILES([lib/isc/tests/Makefile
lib/dns/tests/Makefile
lib/ns/tests/Makefile
lib/irs/tests/Makefile
lib/isccc/tests/Makefile
lib/isccfg/tests/Makefile])
2020-04-03 11:26:02 +02:00
AC_CONFIG_FILES([lib/unit-test-driver.sh],
[chmod +x lib/unit-test-driver.sh])
2018-08-07 16:46:53 +02:00
# System Tests
AC_CONFIG_FILES([bin/tests/Makefile
bin/tests/system/Makefile
bin/tests/system/conf.sh
bin/tests/system/dyndb/driver/Makefile
2020-11-19 17:58:45 -08:00
bin/tests/system/dlzexternal/driver/Makefile
bin/tests/system/hooks/driver/Makefile])
2018-08-07 16:46:53 +02:00
AC_CONFIG_FILES([bin/tests/system/ifconfig.sh],
[chmod +x bin/tests/system/ifconfig.sh])
AC_CONFIG_FILES([bin/tests/system/run.sh],
[chmod +x bin/tests/system/run.sh])
AC_CONFIG_FILES([bin/tests/system/start.sh],
[chmod +x bin/tests/system/start.sh])
AC_CONFIG_FILES([bin/tests/system/stop.sh],
[chmod +x bin/tests/system/stop.sh])
2020-07-31 15:20:56 +02:00
# Fuzz Tests
AC_CONFIG_FILES([fuzz/Makefile])
2018-08-07 16:46:53 +02:00
# Misc
AC_CONFIG_FILES([util/check-make-install])
2005-09-05 00:12:29 +00:00
#
# Do it
#
AC_OUTPUT
2000-07-04 01:20:53 +00:00
2020-07-01 10:29:36 +02:00
# [pairwise: --enable-full-report, --disable-full-report]
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:"
2020-02-19 00:17:03 -08:00
if test "yes" = "$enable_full_report" -o "standard" = "$with_locktype"; then
echo " Mutex lock type: $with_locktype"
2017-04-20 15:09:28 -07:00
fi
2020-02-21 12:51:49 +01:00
test "small" = "$with_tuning" && echo " Small-system tuning (--with-tuning)"
2020-04-23 14:29:07 -07:00
test "no" = "$enable_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)"
2020-04-23 14:29:07 -07:00
test -z "$GSSAPI_LIBS" || 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
2020-04-23 14:29:07 -07:00
test -z "$LIBXML2_LIBS" || echo " XML statistics (--with-libxml2)"
test -z "$JSON_C_LIBS" || echo " JSON statistics (--with-json-c): $JSON_C_CFLAGS $JSON_C_LIBS"
test -z "$ZLIB_LIBS" || echo " HTTP zlib compression (--with-zlib)"
test -z "$LMDB_LIBS" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
test -z "$LIBIDN2_LIBS" || 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)"
2020-04-23 14:29:07 -07:00
test "yes" = "$enable_fixed_rrset" && \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2020-04-23 14:29:07 -07:00
test "yes" = "$enable_querytrace" && \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2020-05-15 16:37:44 -07:00
test "yes" = "$enable_singletrace" && \
echo " Single-query trace logging (--enable-singletrace)"
2020-04-23 14:29:07 -07:00
test -z "$HAVE_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:"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_bdb" || \
2017-11-13 11:36:45 +11:00
echo " Berkeley DB (--with-dlz-bdb)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_ldap" || \
2017-11-13 11:36:45 +11:00
echo " LDAP (--with-dlz-ldap)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_mysql" || \
2017-11-13 11:36:45 +11:00
echo " MySQL (--with-dlz-mysql)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_odbc" || \
2017-11-13 11:36:45 +11:00
echo " ODBC (--with-dlz-odbc)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_postgres" || \
2017-11-13 11:36:45 +11:00
echo " Postgres (--with-dlz-postgres)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_filesystem" || \
2017-11-13 11:36:45 +11:00
echo " Filesystem (--with-dlz-filesystem)"
2020-04-23 14:29:07 -07:00
test "no" = "$with_dlz_stub" || \
2017-11-13 11:36:45 +11:00
echo " Stub (--with-dlz-stub)"
2020-04-23 14:29:07 -07:00
test "$with_dlz_bdb $with_dlz_ldap $with_dlz_mysql $with_dlz_odbc $with_dlz_postgres $with_dlz_filesystem $with_dlz_stub" = "no no no no no no no" && \
2020-05-15 16:37:44 -07:00
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:"
2020-02-21 12:51:49 +01:00
test "small" = "$with_tuning" || echo " Small-system tuning (--with-tuning)"
2017-04-20 15:09:28 -07:00
2020-04-23 14:29:07 -07:00
test "no" = "$enable_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)"
2020-04-23 14:29:07 -07:00
test -z "$GSSAPI_LIBS" && echo " GSS-API (--with-gssapi)"
2017-04-20 15:09:28 -07:00
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
2020-04-23 14:29:07 -07:00
test "yes" = "$enable_fixed_rrset" || \
2017-11-13 11:36:45 +11:00
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
2017-04-20 15:09:28 -07:00
2020-04-23 14:29:07 -07:00
test "yes" = "$validation_default" && echo " DNSSEC validation requires configuration (--enable-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
2020-04-23 14:29:07 -07:00
test "yes" = "$enable_querytrace" || \
2017-11-13 11:36:45 +11:00
echo " Very verbose query trace logging (--enable-querytrace)"
2020-05-15 16:37:44 -07:00
test "yes" = "$enable_singletrace" || \
echo " Single-query trace logging (--enable-singletrace)"
2017-04-20 15:09:28 -07:00
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
2020-04-23 14:29:07 -07:00
test -z "$LIBXML2_LIBS" && echo " XML statistics (--with-libxml2)"
test -z "$JSON_C_LIBS" && echo " JSON statistics (--with-json-c)"
test -z "$ZLIB_LIBS" && echo " HTTP zlib compression (--with-zlib)"
test -z "$LMDB_LIBS" && echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
test -z "$LIBIDN2_LIBS" && 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/^/ /'
2018-08-07 16:46:53 +02:00
echo "CFLAGS: $STD_CFLAGS $CFLAGS"
echo "CPPFLAGS: $STD_CPPFLAGS $CPPFLAGS"
echo "LDFLAGS: $LDFLAGS"
2017-09-30 10:01:01 -07:00
2017-04-20 15:09:28 -07:00
if test "X$ac_unrecognized_opts" != "X"; then
2020-05-15 16:37:44 -07:00
echo "-------------------------------------------------------------------------------"
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: