configure.ac revision 1.1.1.17 1 1.1 christos # Copyright (C) Internet Systems Consortium, Inc. ("ISC")
2 1.1 christos #
3 1.1.1.12 christos # SPDX-License-Identifier: MPL-2.0
4 1.1.1.12 christos #
5 1.1 christos # This Source Code Form is subject to the terms of the Mozilla Public
6 1.1.1.12 christos # License, v. 2.0. If a copy of the MPL was not distributed with this
7 1.1.1.12 christos # file, you can obtain one at https://mozilla.org/MPL/2.0/.
8 1.1 christos #
9 1.1 christos # See the COPYRIGHT file distributed with this work for additional
10 1.1 christos # information regarding copyright ownership.
11 1.1 christos
12 1.1.1.15 christos #
13 1.1.1.15 christos # Defining the version in m4 requires a bit of dancing around,
14 1.1.1.15 christos # so the strings are properly concatenated, as you can't use
15 1.1.1.15 christos # a shell variable in AC_INIT
16 1.1.1.15 christos #
17 1.1.1.15 christos m4_define([bind_VERSION_MAJOR], 9)dnl
18 1.1.1.17 christos m4_define([bind_VERSION_MINOR], 20)dnl
19 1.1.1.17 christos m4_define([bind_VERSION_PATCH], 4)dnl
20 1.1.1.15 christos m4_define([bind_VERSION_EXTRA], )dnl
21 1.1.1.17 christos m4_define([bind_DESCRIPTION], [(Stable Release)])dnl
22 1.1.1.15 christos m4_define([bind_SRCID], [m4_esyscmd_s([git rev-parse --short HEAD | cut -b1-7])])dnl
23 1.1.1.15 christos m4_define([bind_PKG_VERSION], [[bind_VERSION_MAJOR.bind_VERSION_MINOR.bind_VERSION_PATCH]bind_VERSION_EXTRA])dnl
24 1.1 christos
25 1.1.1.7 christos #
26 1.1.1.15 christos # Autoconf initialization
27 1.1.1.7 christos #
28 1.1.1.15 christos AC_INIT([BIND], bind_PKG_VERSION, [https://gitlab.isc.org/isc-projects/bind9/-/issues/new?issuable_template=Bug], [], [https://www.isc.org/downloads/])
29 1.1.1.15 christos AC_PREREQ([2.69])
30 1.1.1.7 christos
31 1.1.1.15 christos AC_DEFINE([PACKAGE_VERSION_MAJOR], ["][bind_VERSION_MAJOR]["], [BIND 9 Major part of the version])
32 1.1.1.15 christos AC_DEFINE([PACKAGE_VERSION_MINOR], ["][bind_VERSION_MINOR]["], [BIND 9 Minor part of the version])
33 1.1.1.15 christos AC_DEFINE([PACKAGE_VERSION_PATCH], ["][bind_VERSION_PATCH]["], [BIND 9 Patch part of the version])
34 1.1.1.15 christos AC_DEFINE([PACKAGE_VERSION_EXTRA], ["][bind_VERSION_EXTRA]["], [BIND 9 Extra part of the version])
35 1.1.1.15 christos AC_DEFINE([PACKAGE_DESCRIPTION], [m4_ifnblank(bind_DESCRIPTION, [" ]bind_DESCRIPTION["], [])], [An extra string to print after PACKAGE_STRING])
36 1.1.1.15 christos AC_DEFINE([PACKAGE_SRCID], ["][bind_SRCID]["], [A short hash from git])
37 1.1.1.15 christos
38 1.1.1.15 christos bind_CONFIGARGS="${ac_configure_args:-default}"
39 1.1.1.15 christos AC_DEFINE_UNQUOTED([PACKAGE_CONFIGARGS], ["$bind_CONFIGARGS"], [Either 'defaults' or used ./configure options])
40 1.1 christos
41 1.1.1.15 christos AC_DEFINE([PACKAGE_BUILDER], ["make"], [make or Visual Studio])
42 1.1.1.15 christos
43 1.1.1.15 christos #
44 1.1.1.15 christos # Get the Canonical System Type
45 1.1.1.15 christos #
46 1.1.1.15 christos AC_CANONICAL_BUILD
47 1.1 christos AC_CANONICAL_HOST
48 1.1.1.15 christos AC_CANONICAL_TARGET
49 1.1.1.15 christos
50 1.1.1.15 christos AC_CONFIG_SRCDIR([bin/named/main.c])
51 1.1.1.15 christos AM_INIT_AUTOMAKE([1.14 tar-pax foreign subdir-objects dist-xz no-dist-gzip -Wall -Werror])
52 1.1.1.15 christos AM_SILENT_RULES([yes])
53 1.1.1.15 christos AM_EXTRA_RECURSIVE_TARGETS([test unit doc])
54 1.1.1.15 christos
55 1.1.1.15 christos AC_CONFIG_HEADERS([config.h])
56 1.1.1.15 christos AC_CONFIG_MACRO_DIR([m4])
57 1.1.1.15 christos
58 1.1.1.15 christos #
59 1.1.1.15 christos # Enable maintainer mode by default only when building from git repository
60 1.1.1.15 christos # and not cross compling
61 1.1.1.15 christos #
62 1.1.1.15 christos AS_IF([test "$cross_compiling" = no],
63 1.1.1.15 christos [AM_MAINTAINER_MODE(m4_ifset([bind_SRCID],[enable],[disable]))],
64 1.1.1.15 christos [AM_MAINTAINER_MODE([disable])])
65 1.1.1.7 christos
66 1.1.1.7 christos #
67 1.1.1.7 christos # Enable system extensions to C and POSIX
68 1.1.1.7 christos #
69 1.1 christos AC_USE_SYSTEM_EXTENSIONS
70 1.1 christos
71 1.1.1.7 christos #
72 1.1.1.15 christos # Compiler compatibility flags
73 1.1.1.15 christos #
74 1.1.1.15 christos m4_version_prereq([2.70],
75 1.1.1.15 christos [AC_PROG_CC],
76 1.1.1.15 christos [AC_PROG_CC_C99])
77 1.1.1.15 christos AC_PROG_CPP_WERROR
78 1.1.1.15 christos
79 1.1.1.15 christos #
80 1.1.1.15 christos # Find build compiler when cross compiling
81 1.1.1.15 christos #
82 1.1.1.15 christos AX_PROG_CC_FOR_BUILD
83 1.1.1.15 christos
84 1.1.1.15 christos #
85 1.1.1.15 christos # Find the machine's endian flavor.
86 1.1.1.15 christos #
87 1.1.1.15 christos AC_C_BIGENDIAN
88 1.1.1.15 christos
89 1.1.1.15 christos #
90 1.1.1.7 christos # Enable large file support
91 1.1.1.7 christos #
92 1.1.1.7 christos AC_SYS_LARGEFILE
93 1.1.1.7 christos AC_FUNC_FSEEKO
94 1.1.1.7 christos
95 1.1 christos # Enable RFC 3542 APIs on macOS
96 1.1 christos AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
97 1.1 christos
98 1.1 christos AC_PROG_MAKE_SET
99 1.1 christos
100 1.1.1.15 christos # Checks for programs.
101 1.1.1.15 christos m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # call AM_PROG_AR only if available
102 1.1.1.15 christos
103 1.1 christos AC_PROG_INSTALL
104 1.1 christos AC_PROG_LN_S
105 1.1 christos AX_POSIX_SHELL
106 1.1.1.8 christos AC_PROG_MKDIR_P
107 1.1 christos
108 1.1.1.15 christos # Initialize libtool
109 1.1.1.15 christos LT_INIT([disable-static dlopen pic-only])
110 1.1.1.15 christos
111 1.1.1.17 christos DLOPEN_LIBS="$lt_cv_dlopen_libs"
112 1.1.1.17 christos AC_SUBST(DLOPEN_LIBS)
113 1.1.1.17 christos
114 1.1.1.15 christos AS_IF([test "$enable_static" != "no" && test "$enable_developer" != "yes"],
115 1.1.1.15 christos [AC_MSG_ERROR([Static linking is not supported as it disables dlopen() and certain security features (e.g. RELRO, ASLR)])])
116 1.1 christos
117 1.1.1.17 christos
118 1.1 christos #
119 1.1.1.15 christos # Set the default CFLAGS, CPPFLAGS, and LDFLAGS
120 1.1 christos #
121 1.1.1.15 christos STD_CFLAGS="-Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-initializers -Wformat -Wshadow"
122 1.1 christos
123 1.1.1.15 christos # These should be always errors
124 1.1.1.15 christos STD_CFLAGS="$STD_CFLAGS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes -Werror=vla"
125 1.1 christos
126 1.1.1.17 christos # Disable false positives generated by GCC 11+ and ASAN
127 1.1.1.17 christos AC_COMPILE_IFELSE(
128 1.1.1.17 christos [AC_LANG_PROGRAM([[]],
129 1.1.1.17 christos [[#if __GNUC__ >= 11 && defined(__SANITIZE_ADDRESS__)
130 1.1.1.17 christos #error Address Sanitizer enabled
131 1.1.1.17 christos #endif
132 1.1.1.17 christos ]])],
133 1.1.1.17 christos [],
134 1.1.1.17 christos [STD_CFLAGS="$STD_CFLAGS -Wno-stringop-overread"])
135 1.1.1.17 christos
136 1.1.1.17 christos # Silence GCC 11.1+ note about the changed alignment, see GL #4841
137 1.1.1.17 christos AS_CASE([$target_cpu],[i?86],[STD_CFLAGS="$STD_CFLAGS -Wno-psabi"])
138 1.1.1.17 christos
139 1.1.1.15 christos STD_LDFLAGS=""
140 1.1.1.7 christos
141 1.1.1.15 christos # ... except in test code
142 1.1.1.15 christos TEST_CFLAGS="-Wno-vla"
143 1.1.1.15 christos
144 1.1.1.17 christos # Fortify the sources by default (we undefine the macro first in case
145 1.1.1.17 christos # the compiler has a different built-in setting)
146 1.1.1.17 christos STD_CPPFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
147 1.1.1.15 christos
148 1.1.1.15 christos #
149 1.1.1.15 christos # Additional compiler settings.
150 1.1.1.15 christos #
151 1.1.1.15 christos AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
152 1.1.1.15 christos [STD_CFLAGS="$STD_CFLAGS -fno-strict-aliasing"])
153 1.1.1.15 christos # Clang only issues a warning so use -Werror to force a error.
154 1.1.1.15 christos AX_CHECK_COMPILE_FLAG([-Werror -fno-delete-null-pointer-checks],
155 1.1.1.15 christos [STD_CFLAGS="$STD_CFLAGS -fno-delete-null-pointer-checks"])
156 1.1.1.15 christos AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option],
157 1.1.1.15 christos [STD_CFLAGS="$STD_CFLAGS -fdiagnostics-show-option"])
158 1.1.1.15 christos
159 1.1.1.15 christos AX_CHECK_LINK_FLAG([-Wl,--export-dynamic],
160 1.1.1.15 christos [STD_LDFLAGS="$STD_LDFLAGS -Wl,--export-dynamic"])
161 1.1.1.7 christos
162 1.1.1.15 christos host_macos=no
163 1.1.1.15 christos AS_CASE([$host],[*-darwin*],[host_macos=yes])
164 1.1.1.15 christos AM_CONDITIONAL([HOST_MACOS], [test "$host_macos" = "yes"])
165 1.1.1.15 christos
166 1.1.1.15 christos #
167 1.1.1.15 christos # Change defaults for developers if not explicity set.
168 1.1.1.15 christos # Needs to be before the option is tested.
169 1.1.1.15 christos #
170 1.1.1.9 christos # [pairwise: --enable-developer, --disable-developer]
171 1.1.1.7 christos AC_ARG_ENABLE([developer],
172 1.1.1.7 christos [AS_HELP_STRING([--enable-developer],
173 1.1.1.7 christos [enable developer build settings])])
174 1.1.1.7 christos
175 1.1.1.7 christos AS_IF([test "$enable_developer" = "yes"],
176 1.1.1.15 christos [DEVELOPER_MODE=yes
177 1.1.1.17 christos STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_MEM_TRACKLINES=1 -DISC_LIST_CHECKINIT=1 -DISC_STATS_CHECKUNDERFLOW=1 -DDNS_RBTDB_STRONG_RWLOCK_CHECK=1 -DISC_MUTEX_ERROR_CHECK=1"
178 1.1.1.7 christos test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
179 1.1.1.7 christos test "${enable_querytrace+set}" = set || enable_querytrace=yes
180 1.1.1.7 christos test "${with_cmocka+set}" = set || with_cmocka=yes
181 1.1.1.7 christos test "${with_zlib+set}" = set || with_zlib=yes
182 1.1.1.15 christos test "${enable_warn_error+set}" = set || enable_warn_error=yes
183 1.1.1.7 christos ])
184 1.1.1.15 christos
185 1.1.1.15 christos AC_SUBST([DEVELOPER_MODE])
186 1.1.1.15 christos AC_SUBST([STD_CFLAGS])
187 1.1.1.15 christos AC_SUBST([STD_CPPFLAGS])
188 1.1.1.15 christos AC_SUBST([STD_LDFLAGS])
189 1.1.1.15 christos AC_SUBST([TEST_CFLAGS])
190 1.1.1.15 christos
191 1.1.1.15 christos # [pairwise: --enable-warn-error, --disable-warn-error]
192 1.1.1.15 christos AC_ARG_ENABLE([warn_error],
193 1.1.1.15 christos [AS_HELP_STRING([--enable-warn-error],
194 1.1.1.15 christos [turn on -Werror when compiling])],
195 1.1.1.15 christos [],[enable_warn_error=no])
196 1.1.1.15 christos AS_IF([test "$enable_warn_error" = "yes"],
197 1.1.1.15 christos [STD_CFLAGS="$STD_CFLAGS -Werror"])
198 1.1.1.15 christos
199 1.1.1.15 christos #
200 1.1.1.15 christos # Use pkg-config
201 1.1.1.15 christos #
202 1.1.1.15 christos
203 1.1.1.15 christos PKG_PROG_PKG_CONFIG
204 1.1.1.15 christos AS_IF([test -z "$PKG_CONFIG"],
205 1.1.1.15 christos [AC_MSG_ERROR([The pkg-config script could not be found or is too old.])])
206 1.1 christos
207 1.1.1.17 christos #
208 1.1.1.17 christos # Pick Userspace-RCU flavor (developer only option)
209 1.1.1.17 christos #
210 1.1.1.17 christos # [pairwise: skip]
211 1.1.1.17 christos AC_ARG_WITH([liburcu],
212 1.1.1.17 christos [AS_HELP_STRING([--with-liburcu=FLAVOR],
213 1.1.1.17 christos [Build with Userspace-RCU variant (developer-only option) (membarrier|qsbr|mb|bp) [default=membarrier]]))],
214 1.1.1.17 christos [], [with_liburcu=membarrier])
215 1.1.1.17 christos
216 1.1.1.17 christos AC_MSG_CHECKING([liburcu flavor])
217 1.1.1.17 christos AS_CASE([$with_liburcu],
218 1.1.1.17 christos [membarrier],
219 1.1.1.17 christos [RCU_FLAVOR="liburcu"
220 1.1.1.17 christos AC_DEFINE([RCU_MEMBARRIER], [1], [Build with membarrier Userspace-RCU flavor])],
221 1.1.1.17 christos [qsbr],
222 1.1.1.17 christos [RCU_FLAVOR="liburcu-qsbr"
223 1.1.1.17 christos AC_DEFINE([RCU_QSBR], [1], [Build with QSBR Userspace-RCU flavor])],
224 1.1.1.17 christos [mb],
225 1.1.1.17 christos [RCU_FLAVOR="liburcu-mb"
226 1.1.1.17 christos AC_DEFINE([RCU_MB], [1], [Build with mb Userspace-RCU flavor])],
227 1.1.1.17 christos [bp],
228 1.1.1.17 christos [RCU_FLAVOR="liburcu-bp"
229 1.1.1.17 christos AC_DEFINE([RCU_BP], [1], [Build with bulletproof Userspace-RCU flavor])],
230 1.1.1.17 christos [AC_MSG_ERROR([Invalid Userspace-RCU flavor picked])])
231 1.1.1.17 christos
232 1.1.1.17 christos AS_IF([test "$with_liburcu" != "membarrier" && test "$enable_developer" != "yes"],
233 1.1.1.17 christos [AC_MSG_ERROR([Changing Userspace-RCU variant is allowed only in developer mode])])
234 1.1.1.17 christos
235 1.1.1.17 christos AC_MSG_RESULT([$RCU_FLAVOR])
236 1.1.1.17 christos
237 1.1.1.17 christos #
238 1.1.1.17 christos # liburcu << v0.13.0 didn't add -lurcu-common and some toolchains would
239 1.1.1.17 christos # not add it automatically - we need to add it explicitly in such case.
240 1.1.1.17 christos #
241 1.1.1.17 christos PKG_CHECK_MODULES([LIBURCU], [$RCU_FLAVOR >= 0.13.0 liburcu-cds >= 0.13.0], [],
242 1.1.1.17 christos [PKG_CHECK_MODULES([LIBURCU], [$RCU_FLAVOR >= 0.10.0 liburcu-cds >= 0.10.0],
243 1.1.1.17 christos [LIBURCU_LIBS="$LIBURCU_LIBS -lurcu-common"])])
244 1.1.1.17 christos
245 1.1.1.17 christos AC_DEFINE_UNQUOTED([RCU_FLAVOR], ["$RCU_FLAVOR"], [Chosen Userspace-RCU flavor])
246 1.1.1.17 christos
247 1.1.1.17 christos PKG_CHECK_VERSION([RCU_VERSION], [$RCU_FLAVOR])
248 1.1.1.17 christos AC_DEFINE_UNQUOTED([RCU_VERSION], ["$RCU_VERSION"], [Compile-time Userspace-RCU version])
249 1.1.1.17 christos
250 1.1.1.17 christos CFLAGS="$CFLAGS $LIBURCU_CFLAGS"
251 1.1.1.17 christos LIBS="$LIBS $LIBURCU_LIBS"
252 1.1.1.17 christos
253 1.1.1.17 christos #
254 1.1.1.17 christos # Userspace-RCU inlining doesn't work for rcu_deference() with some combination
255 1.1.1.17 christos # of C compiler and library version.
256 1.1.1.17 christos #
257 1.1.1.17 christos AC_MSG_CHECKING([whether we can inline small liburcu functions])
258 1.1.1.17 christos AC_COMPILE_IFELSE(
259 1.1.1.17 christos [AC_LANG_PROGRAM([[#define URCU_INLINE_SMALL_FUNCTIONS 1
260 1.1.1.17 christos #include <urcu.h>]],
261 1.1.1.17 christos [[struct opaque *a; struct opaque *b = rcu_dereference(a);]])],
262 1.1.1.17 christos [AC_MSG_RESULT([yes])
263 1.1.1.17 christos AC_DEFINE([URCU_INLINE_SMALL_FUNCTIONS], [1], [Inline small (less than 10 lines) functions])],
264 1.1.1.17 christos [AC_MSG_RESULT([no])])
265 1.1.1.17 christos
266 1.1.1.9 christos # Fuzzing is not included in pairwise testing as fuzzing tools are
267 1.1.1.9 christos # not present in the relevant Docker image.
268 1.1.1.9 christos #
269 1.1.1.9 christos # [pairwise: skip]
270 1.1 christos AC_ARG_ENABLE([fuzzing],
271 1.1.1.15 christos [AS_HELP_STRING([--enable-fuzzing=<afl|libfuzzer|ossfuzz>],
272 1.1 christos [Enable fuzzing using American Fuzzy Lop or libFuzzer (default=no)])],
273 1.1 christos [],
274 1.1 christos [enable_fuzzing=no])
275 1.1 christos
276 1.1 christos AC_MSG_CHECKING([whether to enable fuzzing mode])
277 1.1 christos AS_CASE([$enable_fuzzing],
278 1.1 christos [no],[AC_MSG_RESULT([no])],
279 1.1 christos [afl],[
280 1.1 christos AC_MSG_RESULT([using AFL])
281 1.1 christos AC_DEFINE([ENABLE_AFL], [1],
282 1.1 christos [Define to enable American Fuzzy Lop test harness])
283 1.1.1.15 christos STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1"
284 1.1.1.15 christos FUZZ_LOG_COMPILER="afl.sh"],
285 1.1 christos [libfuzzer],[
286 1.1 christos AC_MSG_RESULT([using libFuzzer])
287 1.1.1.15 christos STD_CFLAGS="$STD_CFLAGS -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 -fsanitize=fuzzer-no-link,address,undefined"
288 1.1.1.15 christos LDFLAGS="$LDFLAGS -fsanitize=address,undefined"
289 1.1.1.15 christos FUZZ_LDFLAGS="-fsanitize=fuzzer,address,undefined"
290 1.1.1.15 christos FUZZ_LOG_COMPILER="libfuzzer.sh"],
291 1.1.1.15 christos [ossfuzz],[
292 1.1.1.15 christos AC_MSG_RESULT([using OSS-Fuzz])
293 1.1.1.15 christos FUZZ_LDFLAGS="$LIB_FUZZING_ENGINE"],
294 1.1 christos [*],[AC_MSG_ERROR([You need to explicitly select the fuzzer])])
295 1.1.1.15 christos AM_CONDITIONAL([HAVE_FUZZ_LOG_COMPILER], [test -n "$FUZZ_LOG_COMPILER"])
296 1.1.1.15 christos AC_SUBST([FUZZ_LOG_COMPILER])
297 1.1.1.15 christos AC_SUBST([FUZZ_LDFLAGS])
298 1.1 christos
299 1.1 christos AS_IF([test "$enable_fuzzing" = "afl"],
300 1.1 christos [AC_MSG_CHECKING("for AFL enabled compiler")
301 1.1 christos AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
302 1.1 christos [#ifndef __AFL_COMPILER
303 1.1 christos #error AFL compiler required
304 1.1 christos #endif
305 1.1 christos ])],
306 1.1 christos [AC_MSG_RESULT([yes])],
307 1.1 christos [AC_MSG_ERROR([set CC=afl-<gcc|clang> when --enable-fuzzing=afl is used])])
308 1.1 christos ])
309 1.1 christos
310 1.1 christos #
311 1.1 christos # Perl is optional; it is used only by some of the system test scripts.
312 1.1 christos #
313 1.1.1.15 christos AC_PATH_PROGS([PERL], [perl5 perl])
314 1.1.1.15 christos AC_SUBST([PERL])
315 1.1.1.15 christos AM_CONDITIONAL([HAVE_PERL], [test -n "$PERL"])
316 1.1 christos
317 1.1 christos #
318 1.1.1.15 christos # Python is optional, it is used only by some of the system test scripts.
319 1.1 christos #
320 1.1.1.15 christos AM_PATH_PYTHON([3.6], [], [:])
321 1.1.1.15 christos AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"])
322 1.1 christos
323 1.1.1.11 christos AC_PATH_PROGS([PYTEST], [pytest-3 py.test-3 pytest py.test pytest-pypy], [])
324 1.1.1.7 christos AS_IF([test -z "$PYTEST"],
325 1.1.1.7 christos [AC_MSG_WARN([pytest not found, some system tests will be skipped])])
326 1.1.1.7 christos AC_SUBST([PYTEST])
327 1.1.1.15 christos AM_CONDITIONAL([HAVE_PYTEST], [test -n "$PYTEST"])
328 1.1.1.7 christos
329 1.1.1.15 christos #
330 1.1.1.15 christos # xsltproc is optional, it is used only by system test scripts.
331 1.1.1.15 christos #
332 1.1.1.15 christos AC_PATH_PROG([XSLTPROC], [xsltproc])
333 1.1 christos
334 1.1 christos #
335 1.1.1.4 christos # Using Solaris linker with gcc on Solaris breaks Thread Local Storage
336 1.1.1.4 christos #
337 1.1.1.4 christos AS_CASE([$host],
338 1.1.1.4 christos [*-solaris*],[
339 1.1.1.4 christos AS_IF([test "$GCC" = "yes"],
340 1.1.1.4 christos [LDFLAGS="$LDFLAGS -zrelax=transtls"
341 1.1.1.4 christos AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
342 1.1.1.4 christos ])
343 1.1.1.15 christos ])
344 1.1 christos
345 1.1.1.16 christos AC_CHECK_HEADERS([sys/param.h sys/socket.h])
346 1.1.1.16 christos AC_CHECK_HEADERS([fcntl.h regex.h sys/time.h unistd.h sys/mman.h sys/sockio.h sys/select.h sys/sysctl.h net/if6.h net/route.h linux/netlink.h linux/rtnetlink.h], [], [],
347 1.1.1.15 christos [$ac_includes_default
348 1.1.1.15 christos #ifdef HAVE_SYS_PARAM_H
349 1.1.1.15 christos # include <sys/param.h>
350 1.1.1.15 christos #endif
351 1.1.1.15 christos #ifdef HAVE_SYS_SOCKET_H
352 1.1.1.15 christos # include <sys/socket.h>
353 1.1.1.15 christos #endif
354 1.1.1.15 christos ])
355 1.1 christos
356 1.1 christos #
357 1.1.1.17 christos # Check for C11 thread local storage
358 1.1.1.17 christos #
359 1.1.1.17 christos # NOTE: OpenBSD doesn't ship <threads.h>, so we can't require it (yet).
360 1.1 christos #
361 1.1.1.15 christos AC_CHECK_HEADERS([threads.h])
362 1.1.1.17 christos
363 1.1.1.17 christos #
364 1.1.1.17 christos # C11 Atomic Operations
365 1.1.1.17 christos #
366 1.1.1.17 christos
367 1.1.1.17 christos AC_CHECK_HEADERS([stdatomic.h],
368 1.1.1.17 christos [],
369 1.1.1.17 christos [AC_MSG_ERROR([C11 Atomic Operations required, update your toolchain to build BIND 9])])
370 1.1.1.17 christos
371 1.1.1.17 christos AC_COMPILE_IFELSE(
372 1.1.1.17 christos [AC_LANG_PROGRAM(
373 1.1.1.17 christos [[#include <stdatomic.h>]],
374 1.1.1.17 christos [[atomic_int_fast32_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
375 1.1.1.17 christos )],
376 1.1.1.17 christos [AC_MSG_CHECKING([whether -latomic is needed for 64-bit stdatomic.h functions])
377 1.1.1.17 christos AC_LINK_IFELSE(
378 1.1.1.17 christos [AC_LANG_PROGRAM(
379 1.1.1.17 christos [[#include <stdatomic.h>]],
380 1.1.1.17 christos [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
381 1.1.1.17 christos )],
382 1.1.1.17 christos [AC_MSG_RESULT([no])],
383 1.1.1.17 christos [LIBS="$LIBS -latomic"
384 1.1.1.17 christos AC_LINK_IFELSE(
385 1.1.1.17 christos [AC_LANG_PROGRAM(
386 1.1.1.17 christos [[#include <stdatomic.h>]],
387 1.1.1.17 christos [[atomic_int_fast64_t val = 0; atomic_fetch_add_explicit(&val, 1, memory_order_relaxed);]]
388 1.1.1.17 christos )],
389 1.1.1.17 christos [AC_MSG_RESULT([yes])],
390 1.1.1.17 christos [AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, please fix your toolchain.])])
391 1.1.1.17 christos ])
392 1.1.1.17 christos ],
393 1.1.1.17 christos [AC_MSG_FAILURE([stdatomic.h header found, but compilation failed, please fix your toolchain.])])
394 1.1.1.17 christos
395 1.1.1.17 christos AC_CHECK_HEADERS([stdnoreturn.h],
396 1.1.1.17 christos [],
397 1.1.1.17 christos [AC_MSG_ERROR([C11 standard headers not found, update your toolchain.])])
398 1.1 christos
399 1.1 christos AC_C_CONST
400 1.1 christos AC_C_INLINE
401 1.1 christos AC_C_VOLATILE
402 1.1 christos
403 1.1 christos #
404 1.1 christos # Check for yield support on ARM processors
405 1.1 christos #
406 1.1 christos AS_CASE([$host],
407 1.1.1.17 christos [arm*|aarch64*],
408 1.1.1.17 christos [AC_MSG_CHECKING([for ARM yield instruction support])
409 1.1.1.4 christos AC_COMPILE_IFELSE(
410 1.1.1.4 christos [AC_LANG_PROGRAM([[]],
411 1.1.1.4 christos [[__asm__ __volatile__ ("yield")]])],
412 1.1.1.4 christos [AC_MSG_RESULT([yes])
413 1.1.1.4 christos AC_DEFINE([HAVE_ARM_YIELD], [1],
414 1.1.1.4 christos [define if the ARM yield instruction is available])],
415 1.1.1.4 christos [AC_MSG_RESULT([no])])])
416 1.1.1.4 christos
417 1.1.1.4 christos #
418 1.1.1.4 christos # Check for pause support on SPARC processors
419 1.1.1.4 christos #
420 1.1.1.4 christos AS_CASE([$host],
421 1.1.1.4 christos [sparc*],
422 1.1.1.4 christos [AC_MSG_CHECKING([for pause instruction support])
423 1.1.1.4 christos AC_COMPILE_IFELSE(
424 1.1.1.4 christos [AC_LANG_PROGRAM([[]],
425 1.1.1.4 christos [[__asm__ __volatile__ ("pause")]])],
426 1.1.1.4 christos [AC_MSG_RESULT([yes])
427 1.1.1.4 christos AC_DEFINE([HAVE_SPARC_PAUSE], [1],
428 1.1.1.4 christos [define if the SPARC pause instruction is available])],
429 1.1.1.4 christos [AC_MSG_RESULT([no])])])
430 1.1 christos
431 1.1 christos AC_CHECK_FUNCS([sysctlbyname])
432 1.1 christos
433 1.1 christos AC_TYPE_SIZE_T
434 1.1 christos AC_TYPE_SSIZE_T
435 1.1 christos AC_TYPE_UINTPTR_T
436 1.1 christos
437 1.1 christos #
438 1.1 christos # check for uname library routine
439 1.1 christos #
440 1.1 christos AC_MSG_CHECKING([for uname])
441 1.1 christos AC_COMPILE_IFELSE(
442 1.1 christos [AC_LANG_PROGRAM(
443 1.1 christos [[#include <sys/utsname.h>
444 1.1 christos #include <stdio.h>
445 1.1 christos ]],
446 1.1 christos [[
447 1.1 christos struct utsname uts;
448 1.1 christos uname(&uts);
449 1.1 christos printf("running on %s %s %s for %s\n",
450 1.1 christos uts.sysname, uts.release, uts.version, uts.machine);
451 1.1 christos ]])],
452 1.1 christos [AC_MSG_RESULT(yes)
453 1.1 christos AC_DEFINE([HAVE_UNAME], [1], [define if uname is available])
454 1.1 christos ],
455 1.1 christos [AC_MSG_RESULT(no)
456 1.1 christos AC_MSG_WARN([uname is not correctly supported])
457 1.1 christos ])
458 1.1 christos
459 1.1 christos #
460 1.1 christos # check for GCC noreturn attribute
461 1.1 christos #
462 1.1.1.15 christos AX_GCC_FUNC_ATTRIBUTE([noreturn])
463 1.1 christos
464 1.1 christos #
465 1.1.1.11 christos # check for GCC malloc attribute
466 1.1.1.11 christos #
467 1.1.1.11 christos AX_GCC_FUNC_ATTRIBUTE([malloc])
468 1.1.1.11 christos
469 1.1.1.11 christos AC_MSG_CHECKING([for extended malloc attributes])
470 1.1.1.11 christos AC_COMPILE_IFELSE(
471 1.1.1.11 christos [AC_LANG_PROGRAM(
472 1.1.1.11 christos [[
473 1.1.1.11 christos #include <stddef.h>
474 1.1.1.11 christos #include <stdlib.h>
475 1.1.1.15 christos __attribute__ ((malloc, malloc (free, 1))
476 1.1.1.15 christos void * xmalloc(size_t sz) { return malloc(sz); }
477 1.1.1.11 christos ]],
478 1.1.1.11 christos [[
479 1.1.1.11 christos void *p = xmalloc(8);
480 1.1.1.15 christos free(p);
481 1.1.1.11 christos ]])],
482 1.1.1.11 christos [AC_MSG_RESULT(yes)
483 1.1.1.11 christos AC_DEFINE([HAVE_MALLOC_EXT_ATTR], [1], [define if extended attributes for malloc are available])
484 1.1.1.11 christos ],
485 1.1.1.11 christos [AC_MSG_RESULT(no)])
486 1.1.1.11 christos
487 1.1.1.11 christos #
488 1.1.1.11 christos # check for GCC returns_nonnull attribute
489 1.1.1.11 christos #
490 1.1.1.11 christos AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
491 1.1.1.11 christos
492 1.1.1.11 christos #
493 1.1.1.17 christos # how to link math functions?
494 1.1.1.17 christos #
495 1.1.1.17 christos AC_SEARCH_LIBS([sqrt],[m])
496 1.1.1.17 christos
497 1.1.1.17 christos #
498 1.1 christos # GeoIP support?
499 1.1 christos #
500 1.1.1.7 christos # Should be on by default if libmaxminddb exists.
501 1.1.1.7 christos #
502 1.1.1.9 christos # [pairwise: --enable-geoip --with-maxminddb=auto, --enable-geoip --with-maxminddb=yes, --disable-geoip]
503 1.1.1.7 christos AC_ARG_ENABLE([geoip],
504 1.1.1.7 christos [AS_HELP_STRING([--disable-geoip],
505 1.1.1.7 christos [support GeoIP2 geolocation ACLs if available [default=yes]])],
506 1.1.1.7 christos [], [enable_geoip="yes"])
507 1.1.1.7 christos
508 1.1.1.9 christos # [pairwise: skip]
509 1.1.1.7 christos AC_ARG_WITH([maxminddb],
510 1.1.1.7 christos [AS_HELP_STRING([--with-maxminddb=PATH],
511 1.1.1.7 christos [Build with MaxMind GeoIP2 support (auto|yes|no|path) [default=auto]])],
512 1.1.1.15 christos [], [with_maxminddb="auto"])
513 1.1.1.4 christos
514 1.1.1.7 christos AS_IF([test "$enable_geoip" = "yes"],
515 1.1.1.7 christos [AS_CASE([$with_maxminddb],
516 1.1.1.7 christos [no],[AC_MSG_ERROR([Use '--disable-geoip' to disable the GeoIP])],
517 1.1.1.7 christos [auto],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
518 1.1.1.7 christos [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
519 1.1.1.7 christos PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
520 1.1.1.7 christos ],[:])],
521 1.1.1.7 christos [yes],[PKG_CHECK_MODULES([MAXMINDDB], [libmaxminddb],
522 1.1.1.7 christos [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
523 1.1.1.7 christos PKG_CHECK_VAR([MAXMINDDB_PREFIX], [libmaxminddb], [prefix], [], [AC_MSG_ERROR([libmaxminddb prefix not found in pkg-config; set MAXMINDDB_PREFIX in the environment])])
524 1.1.1.7 christos ])],
525 1.1.1.7 christos [ # default
526 1.1.1.7 christos AX_SAVE_FLAGS([maxminddb])
527 1.1.1.7 christos MAXMINDDB_CFLAGS="-I$with_maxminddb/include"
528 1.1.1.7 christos MAXMINDDB_LIBS="-L$with_maxminddb/lib"
529 1.1.1.7 christos CFLAGS="$CFLAGS $MAXMINDDB_CFLAGS"
530 1.1.1.15 christos LIBS="$LIBS $MAXMINDDB_LIBS"
531 1.1.1.7 christos AC_SEARCH_LIBS([MMDB_open], [maxminddb],
532 1.1.1.7 christos [AC_DEFINE([HAVE_GEOIP2], [1], [Build with GeoIP2 support])
533 1.1.1.9 christos MAXMINDDB_LIBS="$MAXMINDDB_LIBS $ac_cv_search_MMDB_open"
534 1.1.1.7 christos AC_MSG_NOTICE([GeoIP2 default database path set to $with_maxminddb/share/GeoIP])
535 1.1.1.12 christos AS_VAR_COPY([MAXMINDDB_PREFIX], [with_maxminddb])
536 1.1.1.7 christos ],
537 1.1.1.7 christos [AC_MSG_ERROR([GeoIP2 requested, but libmaxminddb not found])])
538 1.1.1.7 christos AX_RESTORE_FLAGS([maxminddb])
539 1.1.1.7 christos ])
540 1.1.1.7 christos AC_ARG_VAR([MAXMINDDB_PREFIX], [value of prefix for MAXMINDDB, overriding pkg-config])
541 1.1.1.7 christos ])
542 1.1.1.7 christos
543 1.1.1.15 christos AM_CONDITIONAL([HAVE_GEOIP2], [test -n "$MAXMINDDB_LIBS"])
544 1.1.1.15 christos
545 1.1.1.4 christos AC_SUBST([MAXMINDDB_CFLAGS])
546 1.1.1.4 christos AC_SUBST([MAXMINDDB_LIBS])
547 1.1 christos
548 1.1 christos AX_PTHREAD
549 1.1 christos
550 1.1 christos LIBS="$PTHREAD_LIBS $LIBS"
551 1.1 christos CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
552 1.1 christos CC="$PTHREAD_CC"
553 1.1 christos
554 1.1.1.17 christos AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
555 1.1.1.17 christos AC_COMPILE_IFELSE(
556 1.1.1.17 christos [AC_LANG_PROGRAM([[#include <pthread.h>]],
557 1.1.1.17 christos [[(void)pthread_mutexattr_settype(&(pthread_mutexattr_t){ NULL }, PTHREAD_MUTEX_ADAPTIVE_NP);]])],
558 1.1.1.17 christos [AC_MSG_RESULT([yes])
559 1.1.1.17 christos AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], [1], [Define to 1 if PTHREAD_MUTEX_ADAPTIVE_NP is available])],
560 1.1.1.17 christos [AC_MSG_RESULT([no])])
561 1.1 christos
562 1.1.1.17 christos AC_CHECK_FUNCS([pthread_attr_getstacksize pthread_attr_setstacksize pthread_barrier_init pthread_spin_init])
563 1.1 christos
564 1.1 christos AC_CHECK_HEADERS([sched.h])
565 1.1 christos
566 1.1 christos AC_SEARCH_LIBS([sched_yield],[rt])
567 1.1 christos AC_CHECK_FUNCS([sched_yield pthread_yield pthread_yield_np])
568 1.1 christos
569 1.1 christos # Look for functions relating to thread naming
570 1.1 christos AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
571 1.1 christos AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
572 1.1 christos
573 1.1.1.7 christos # libuv
574 1.1.1.14 christos PKG_CHECK_MODULES([LIBUV], [libuv >= 1.37.0], [],
575 1.1.1.17 christos [PKG_CHECK_MODULES([LIBUV], [libuv >= 1.34.0 libuv < 1.35.0], [],
576 1.1.1.17 christos [AC_MSG_ERROR([libuv >= 1.34.0 (except 1.35.0 and 1.36.0) not found])])])
577 1.1.1.17 christos
578 1.1.1.17 christos PKG_CHECK_VERSION([LIBUV_VERSION], [libuv])
579 1.1.1.7 christos
580 1.1.1.12 christos AX_SAVE_FLAGS([libuv])
581 1.1.1.12 christos CFLAGS="$CFLAGS $LIBUV_CFLAGS"
582 1.1.1.12 christos LIBS="$LIBS $LIBUV_LIBS"
583 1.1.1.12 christos
584 1.1.1.12 christos # libuv recvmmsg support
585 1.1.1.12 christos AC_CHECK_DECLS([UV_UDP_MMSG_FREE, UV_UDP_MMSG_CHUNK], [], [], [[#include <uv.h>]])
586 1.1.1.12 christos AC_MSG_CHECKING([whether struct msghdr uses padding for alignment])
587 1.1.1.12 christos AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>],
588 1.1.1.12 christos [const struct msghdr h = { .__pad1 = 0, .__pad2 = 0 };])],
589 1.1.1.12 christos [AC_MSG_RESULT([yes])
590 1.1.1.12 christos AC_DEFINE([HAVE_DECL_UV_UDP_RECVMMSG],
591 1.1.1.12 christos [0], [Disable recvmmsg support on systems with MUSL glibc])],
592 1.1.1.12 christos [AC_MSG_RESULT([no])
593 1.1.1.12 christos AC_CHECK_DECLS([UV_UDP_RECVMMSG], [], [], [[#include <uv.h>]])])
594 1.1.1.12 christos
595 1.1.1.17 christos # libuv recverr support
596 1.1.1.17 christos AC_CHECK_DECLS([UV_UDP_LINUX_RECVERR], [], [], [[#include <uv.h>]])
597 1.1.1.17 christos
598 1.1.1.12 christos AX_RESTORE_FLAGS([libuv])
599 1.1.1.12 christos
600 1.1.1.15 christos # [pairwise: --enable-doh --with-libnghttp2=auto, --enable-doh --with-libnghttp2=yes, --disable-doh]
601 1.1.1.15 christos AC_ARG_ENABLE([doh],
602 1.1.1.15 christos [AS_HELP_STRING([--disable-doh], [disable DNS over HTTPS, removes dependency on libnghttp2 (default is --enable-doh)])],
603 1.1.1.15 christos [], [enable_doh=yes])
604 1.1.1.15 christos
605 1.1.1.15 christos # [pairwise: skip]
606 1.1.1.15 christos AC_ARG_WITH([libnghttp2],
607 1.1.1.15 christos [AS_HELP_STRING([--with-libnghttp2],
608 1.1.1.15 christos [build with libnghttp2 library [yes|no|auto] (default is auto)])],
609 1.1.1.15 christos [], [with_libnghttp2="auto"])
610 1.1.1.15 christos
611 1.1.1.15 christos AS_IF([test "$enable_doh" = "yes"],
612 1.1.1.15 christos [AS_CASE([$with_libnghttp2],
613 1.1.1.15 christos [no],[AC_MSG_ERROR([Use '--disable-doh' to disable DNS-over-HTTPS support])],
614 1.1.1.15 christos [auto|yes],[PKG_CHECK_MODULES([LIBNGHTTP2], [libnghttp2 >= 1.6.0],
615 1.1.1.15 christos [AC_DEFINE([HAVE_LIBNGHTTP2], [1], [Build with DNS-over-HTTPS support])],
616 1.1.1.15 christos [AC_MSG_ERROR(m4_normalize([DNS-over-HTTPS support requested, but libnghttp2 not found.
617 1.1.1.15 christos Either install libnghttp2 or use --disable-doh.]))])],
618 1.1.1.15 christos [AC_MSG_ERROR([Specifying libnghttp2 installation path is not supported, adjust PKG_CONFIG_PATH instead])])])
619 1.1.1.15 christos
620 1.1.1.15 christos AM_CONDITIONAL([HAVE_LIBNGHTTP2], [test -n "$LIBNGHTTP2_LIBS"])
621 1.1.1.15 christos
622 1.1.1.15 christos
623 1.1 christos #
624 1.1.1.3 christos # flockfile is usually provided by pthreads
625 1.1.1.3 christos #
626 1.1.1.3 christos AC_CHECK_FUNCS([flockfile getc_unlocked])
627 1.1.1.3 christos
628 1.1.1.3 christos #
629 1.1.1.16 christos # Look for sysconf or other ways to allow detection of the number of processors.
630 1.1 christos #
631 1.1 christos AC_CHECK_FUNCS([sysconf])
632 1.1.1.16 christos AC_CHECK_FUNCS(sysconf sched_getaffinity cpuset_getaffinity)
633 1.1.1.16 christos AC_CHECK_HEADERS([sys/cpuset.h], [], [],
634 1.1.1.16 christos [$ac_includes_default
635 1.1.1.16 christos #ifdef HAVE_SYS_PARAM_H
636 1.1.1.16 christos # include <sys/param.h>
637 1.1.1.16 christos #endif
638 1.1.1.16 christos ])
639 1.1 christos
640 1.1 christos #
641 1.1.1.7 christos # Do we want to use pthread rwlock?
642 1.1 christos #
643 1.1.1.9 christos # [pairwise: --enable-pthread-rwlock, --disable-pthread-rwlock]
644 1.1.1.7 christos AC_ARG_ENABLE([pthread_rwlock],
645 1.1.1.7 christos [AS_HELP_STRING([--enable-pthread-rwlock],
646 1.1.1.7 christos [use pthread rwlock instead of internal rwlock implementation])],
647 1.1.1.7 christos [], [enable_pthread_rwlock=no])
648 1.1.1.7 christos
649 1.1.1.7 christos AS_IF([test "$enable_pthread_rwlock" = "yes"],
650 1.1.1.7 christos [AC_CHECK_FUNCS([pthread_rwlock_rdlock], [],
651 1.1.1.7 christos [AC_MSG_ERROR([pthread_rwlock_rdlock requested but not found])])
652 1.1.1.7 christos AC_DEFINE([USE_PTHREAD_RWLOCK],[1],[Define if you want to use pthread rwlock implementation])
653 1.1.1.7 christos ])
654 1.1.1.17 christos AM_CONDITIONAL([USE_ISC_RWLOCK], [test "$enable_pthread_rwlock" != "yes"])
655 1.1 christos
656 1.1 christos CRYPTO=OpenSSL
657 1.1 christos
658 1.1 christos #
659 1.1.1.7 christos # OpenSSL/LibreSSL is mandatory
660 1.1 christos #
661 1.1.1.17 christos PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto], [PKG_CHECK_VERSION([OPENSSL_VERSION], [openssl])],
662 1.1.1.17 christos [AX_CHECK_OPENSSL([:], [AC_MSG_FAILURE([OpenSSL/LibreSSL not found])])])
663 1.1.1.7 christos
664 1.1.1.7 christos AX_SAVE_FLAGS([openssl])
665 1.1 christos
666 1.1.1.17 christos CFLAGS="$OPENSSL_CFLAGS $CFLAGS"
667 1.1.1.17 christos LIBS="$OPENSSL_LIBS $LIBS"
668 1.1 christos
669 1.1.1.10 christos AC_MSG_CHECKING([for OpenSSL >= 1.0.0 or LibreSSL >= 2.7.0])
670 1.1 christos AC_COMPILE_IFELSE(
671 1.1 christos [AC_LANG_PROGRAM([[#include <openssl/opensslv.h>]],
672 1.1.1.10 christos [[#if (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER < 0x1000000fL)) || \\
673 1.1.1.10 christos (defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x02070000fL))
674 1.1.1.10 christos #error OpenSSL >= 1.0.0 or LibreSSL >= 2.7.0 required
675 1.1 christos #endif
676 1.1 christos ]])],
677 1.1 christos [AC_MSG_RESULT([yes])],
678 1.1 christos [AC_MSG_FAILURE([not found])])
679 1.1 christos
680 1.1 christos #
681 1.1 christos # Check for functions added in OpenSSL or LibreSSL
682 1.1 christos #
683 1.1 christos
684 1.1.1.10 christos AC_CHECK_FUNCS([BIO_read_ex BIO_write_ex])
685 1.1.1.12 christos AC_CHECK_FUNCS([BN_GENCB_new])
686 1.1.1.15 christos AC_CHECK_FUNCS([CRYPTO_zalloc])
687 1.1.1.15 christos AC_CHECK_FUNCS([ERR_get_error_all])
688 1.1.1.15 christos AC_CHECK_FUNCS([EVP_CIPHER_CTX_new EVP_CIPHER_CTX_free])
689 1.1.1.15 christos AC_CHECK_FUNCS([EVP_MD_CTX_new EVP_MD_CTX_free EVP_MD_CTX_reset EVP_MD_CTX_get0_md])
690 1.1.1.15 christos AC_CHECK_FUNCS([EVP_PKEY_new_raw_private_key EVP_PKEY_eq])
691 1.1.1.15 christos AC_CHECK_FUNCS([OPENSSL_init_ssl OPENSSL_init_crypto OPENSSL_cleanup])
692 1.1.1.15 christos AC_CHECK_FUNCS([SSL_CTX_set_keylog_callback])
693 1.1.1.10 christos AC_CHECK_FUNCS([SSL_CTX_set_min_proto_version])
694 1.1.1.15 christos AC_CHECK_FUNCS([SSL_CTX_up_ref])
695 1.1.1.15 christos AC_CHECK_FUNCS([SSL_read_ex SSL_peek_ex SSL_write_ex])
696 1.1.1.15 christos AC_CHECK_FUNCS([SSL_CTX_set1_cert_store X509_STORE_up_ref])
697 1.1.1.17 christos AC_CHECK_FUNCS([SSL_CTX_up_ref])
698 1.1.1.15 christos AC_CHECK_FUNCS([SSL_SESSION_is_resumable])
699 1.1.1.17 christos AC_CHECK_FUNCS([SSL_CTX_set_ciphersuites])
700 1.1 christos
701 1.1 christos #
702 1.1 christos # Check for algorithm support in OpenSSL
703 1.1 christos #
704 1.1 christos
705 1.1.1.15 christos AC_CHECK_FUNCS([EVP_DigestSignInit EVP_DigestVerifyInit], [:],
706 1.1.1.15 christos [AC_MSG_FAILURE([EVP_DigestSignInit/EVP_DigestVerifyInit support in OpenSSL is mandatory.])])
707 1.1 christos
708 1.1 christos AC_MSG_CHECKING([for ECDSA P-256 support])
709 1.1 christos AC_COMPILE_IFELSE(
710 1.1.1.15 christos [AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
711 1.1.1.15 christos [[EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(NID_X9_62_prime256v1, NULL);]])],
712 1.1 christos [AC_MSG_RESULT([yes])],
713 1.1 christos [AC_MSG_FAILURE([not found. ECDSA P-256 support in OpenSSL is mandatory.])])
714 1.1 christos
715 1.1 christos AC_MSG_CHECKING([for ECDSA P-384 support])
716 1.1 christos AC_COMPILE_IFELSE(
717 1.1.1.15 christos [AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
718 1.1.1.15 christos [[EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(NID_secp384r1, NULL);]])],
719 1.1 christos [AC_MSG_RESULT([yes])],
720 1.1 christos [AC_MSG_FAILURE([not found. ECDSA P-384 support in OpenSSL is mandatory.])])
721 1.1 christos
722 1.1 christos AC_MSG_CHECKING([for Ed25519 support])
723 1.1 christos AC_COMPILE_IFELSE(
724 1.1.1.15 christos [AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
725 1.1.1.15 christos [[EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(NID_ED25519, NULL);]])],
726 1.1 christos [AC_DEFINE([HAVE_OPENSSL_ED25519], [1], [define if OpenSSL supports Ed25519])
727 1.1 christos AC_MSG_RESULT([yes])],
728 1.1 christos [AC_MSG_RESULT([no])])
729 1.1 christos
730 1.1 christos AC_MSG_CHECKING([for Ed448 support])
731 1.1.1.4 christos AC_COMPILE_IFELSE(
732 1.1.1.15 christos [AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
733 1.1.1.15 christos [[EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(NID_ED448, NULL);]])],
734 1.1.1.4 christos [AC_DEFINE([HAVE_OPENSSL_ED448], [1], [define if OpenSSL supports Ed448])
735 1.1.1.4 christos AC_MSG_RESULT([yes])],
736 1.1.1.4 christos [AC_MSG_RESULT([no])])
737 1.1 christos
738 1.1 christos #
739 1.1 christos # Check for OpenSSL SHA-1 support
740 1.1 christos #
741 1.1 christos AC_CHECK_FUNCS([EVP_sha1], [:],
742 1.1 christos [AC_MSG_FAILURE([SHA-1 support in OpenSSL is mandatory.])])
743 1.1 christos
744 1.1 christos #
745 1.1 christos # Check for OpenSSL SHA-2 support
746 1.1 christos #
747 1.1 christos AC_CHECK_FUNCS([EVP_sha224 EVP_sha256 EVP_sha384 EVP_sha512], [:],
748 1.1 christos [AC_MSG_FAILURE([SHA-2 support in OpenSSL is mandatory.])])
749 1.1 christos
750 1.1 christos #
751 1.1 christos # Check for OpenSSL 1.1.x/LibreSSL functions
752 1.1 christos #
753 1.1.1.17 christos AC_CHECK_FUNCS([ECDSA_SIG_get0 EVP_PKEY_get0_EC_KEY])
754 1.1.1.17 christos AC_CHECK_FUNCS([RSA_set0_key EVP_PKEY_get0_RSA])
755 1.1 christos
756 1.1.1.10 christos AC_CHECK_FUNCS([TLS_server_method TLS_client_method])
757 1.1.1.9 christos
758 1.1 christos #
759 1.1 christos # Check whether FIPS mode is available and whether we should enable it
760 1.1 christos #
761 1.1.1.9 christos # FIPS is not included in pairwise testing as the relevant Docker image
762 1.1.1.9 christos # does not support FIPS mode.
763 1.1.1.9 christos #
764 1.1.1.17 christos AC_CHECK_FUNCS(EVP_default_properties_enable_fips FIPS_mode)
765 1.1.1.17 christos
766 1.1.1.9 christos # [pairwise: skip]
767 1.1 christos AC_ARG_ENABLE([fips-mode],
768 1.1 christos [AS_HELP_STRING([--enable-fips-mode],
769 1.1 christos [enable FIPS mode in OpenSSL library [default=no]])],
770 1.1 christos [], [enable_fips_mode="no"])
771 1.1 christos
772 1.1 christos AC_MSG_CHECKING([whether to enable FIPS mode in OpenSSL library])
773 1.1 christos AS_CASE([$enable_fips_mode],
774 1.1 christos [yes], [AC_MSG_RESULT([yes])
775 1.1.1.17 christos AC_DEFINE([ENABLE_FIPS_MODE], [1], [Define to 1 if you want FIPS mode to be enabled])
776 1.1.1.17 christos AS_IF([test "x$ac_cv_func_FIPS_mode" != xyes -a "x$ac_cv_func_EVP_default_properties_enable_fips" != xyes],
777 1.1.1.17 christos AC_MSG_FAILURE([OpenSSL FIPS mode requested but not available.]))],
778 1.1 christos [no], [AC_MSG_RESULT([no])])
779 1.1 christos
780 1.1.1.7 christos AX_RESTORE_FLAGS([openssl])
781 1.1 christos
782 1.1.1.7 christos AC_SUBST([OPENSSL_CFLAGS])
783 1.1 christos AC_SUBST([OPENSSL_LIBS])
784 1.1 christos
785 1.1.1.15 christos AC_CHECK_FUNCS([clock_gettime])
786 1.1.1.9 christos
787 1.1.1.9 christos # [pairwise: --with-gssapi=yes, --with-gssapi=auto, --without-gssapi]
788 1.1.1.15 christos AC_ARG_WITH([gssapi],
789 1.1.1.15 christos [AS_HELP_STRING([--with-gssapi=[PATH|[/path/]krb5-config]],
790 1.1 christos [Specify path for system-supplied GSSAPI
791 1.1.1.15 christos [default=auto]])],
792 1.1.1.15 christos [], [with_gssapi="auto"])
793 1.1 christos
794 1.1.1.15 christos KRB5_CONFIG=
795 1.1.1.15 christos AS_CASE([$with_gssapi],
796 1.1.1.15 christos [no],[AC_MSG_CHECKING([for GSSAPI support])
797 1.1.1.15 christos AC_MSG_RESULT([no])],
798 1.1.1.15 christos [yes],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config])
799 1.1.1.15 christos AS_IF([test -z "$KRB5_CONFIG"],
800 1.1.1.15 christos [AC_MSG_ERROR([krb5-config required but not found])])],
801 1.1.1.15 christos [auto],[AC_PATH_PROG([KRB5_CONFIG], [krb5-config])],
802 1.1.1.15 christos [*krb5-config*],[KRB5_CONFIG="$with_gssapi"],
803 1.1.1.15 christos [AC_MSG_ERROR([--with-gssapi requires yes|no|auto|/path/to/krb5-config])])
804 1.1.1.15 christos
805 1.1.1.15 christos GSSAPI_CFLAGS=
806 1.1.1.15 christos GSSAPI_LIBS=
807 1.1.1.15 christos KRB5_CFLAGS=
808 1.1.1.15 christos KRB5_LIBS=
809 1.1.1.15 christos AS_IF([test -n "$KRB5_CONFIG"],
810 1.1.1.15 christos [AC_MSG_CHECKING([for gssapi libraries])
811 1.1.1.15 christos AX_SAVE_FLAGS([gssapi])
812 1.1.1.15 christos GSSAPI_CFLAGS=`"$KRB5_CONFIG" --cflags gssapi`
813 1.1.1.15 christos GSSAPI_LIBS=`"$KRB5_CONFIG" --libs gssapi`
814 1.1.1.15 christos CFLAGS="$CFLAGS $GSSAPI_CFLAGS"
815 1.1.1.15 christos LIBS="$LIBS $GSSAPI_LIBS"
816 1.1.1.15 christos AC_MSG_RESULT([$GSSAPI_CFLAGS $GSSAPI_LIBS])
817 1.1.1.15 christos AC_CHECK_HEADERS([gssapi/gssapi.h], [],
818 1.1.1.15 christos [AC_CHECK_HEADERS([gssapi.h], [],
819 1.1.1.15 christos [AC_MSG_ERROR([neither gssapi/gssapi.h nor gssapi.h found])])])
820 1.1.1.15 christos AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
821 1.1.1.15 christos [AC_CHECK_HEADERS([gssapi_krb5.h], []
822 1.1.1.15 christos [AC_MSG_ERROR([neither gssapi/gssapi_krb5.h nor gssapi_krb5.h found])])])
823 1.1.1.15 christos AC_CHECK_FUNCS([gss_acquire_cred],[],
824 1.1.1.15 christos [AC_MSG_ERROR([linking with $GSSAPI_LIBS does not work])])
825 1.1.1.15 christos AX_RESTORE_FLAGS([gssapi])
826 1.1.1.15 christos
827 1.1.1.15 christos AC_MSG_CHECKING([for krb5 libraries])
828 1.1.1.15 christos AX_SAVE_FLAGS([krb5])
829 1.1.1.15 christos KRB5_CFLAGS=`"$KRB5_CONFIG" --cflags krb5`
830 1.1.1.15 christos KRB5_LIBS=`$KRB5_CONFIG --libs krb5`
831 1.1.1.15 christos CFLAGS="$CFLAGS $KRB5_CFLAGS"
832 1.1.1.15 christos LIBS="$CFLAGS $KRB5_LIBS"
833 1.1.1.15 christos AC_MSG_RESULT([$KRB5_CFLAGS $KRB5_LIBS])
834 1.1.1.15 christos AC_CHECK_HEADERS([krb5/krb5.h], [],
835 1.1.1.15 christos [AC_CHECK_HEADERS([krb5.h], [],
836 1.1.1.15 christos [AC_MSG_ERROR([neither krb5/krb5.h nor krb5 found])])])
837 1.1.1.15 christos AC_CHECK_FUNCS([krb5_init_context], [],
838 1.1.1.15 christos [AC_MSG_ERROR([linking with $KRB5_LIBS failed])])
839 1.1.1.15 christos AX_RESTORE_FLAGS([krb5])
840 1.1.1.15 christos
841 1.1.1.15 christos AC_DEFINE([HAVE_GSSAPI], [1], [Define to 1 if you have the Kerberos Framework available])
842 1.1.1.15 christos # kludge to silence compiler warnings which recommend use of GSS.framework on macOS
843 1.1.1.15 christos AS_CASE([$host],[*-darwin*],[CFLAGS="$CFLAGS -Wno-deprecated-declarations"])])
844 1.1.1.15 christos AM_CONDITIONAL([HAVE_GSSAPI], [test -n "$GSSAPI_LIBS"])
845 1.1.1.15 christos AC_SUBST([GSSAPI_CFLAGS])
846 1.1.1.15 christos AC_SUBST([GSSAPI_LIBS])
847 1.1.1.15 christos AC_SUBST([KRB5_CFLAGS])
848 1.1.1.15 christos AC_SUBST([KRB5_LIBS])
849 1.1 christos
850 1.1 christos #
851 1.1 christos # was --with-lmdb specified?
852 1.1 christos #
853 1.1.1.9 christos
854 1.1.1.9 christos # [pairwise: --with-lmdb=auto, --with-lmdb=yes, --without-lmdb]
855 1.1.1.15 christos AC_ARG_WITH([lmdb],
856 1.1.1.15 christos [AS_HELP_STRING([--with-lmdb=@<:@PATH@:>@],
857 1.1.1.15 christos [use LMDB library @<:@default=auto@:>@, optionally specify the prefix for lmdb library])],
858 1.1.1.15 christos [:],
859 1.1.1.15 christos [with_lmdb="auto"])
860 1.1 christos
861 1.1.1.15 christos ac_lib_lmdb_found=no
862 1.1.1.15 christos AS_CASE([$with_lmdb],
863 1.1.1.15 christos [no],[],
864 1.1.1.15 christos [auto|yes], [PKG_CHECK_MODULES([LMDB], [lmdb],
865 1.1.1.15 christos [ac_lib_lmdb_found=yes],
866 1.1.1.15 christos [for ac_lib_lmdb_path in /usr /usr/local /opt /opt/local; do
867 1.1.1.15 christos AX_LIB_LMDB([$ac_lib_lmdb_path],
868 1.1.1.15 christos [ac_lib_lmdb_found=yes
869 1.1.1.15 christos break])
870 1.1.1.15 christos done
871 1.1.1.15 christos ])],
872 1.1.1.15 christos [AX_LIB_LMDB([$with_lmdb],[ac_lib_lmdb_found=yes])])
873 1.1.1.15 christos
874 1.1.1.15 christos # don't fail when in automatic mode
875 1.1.1.15 christos AS_IF([test "$with_lmdb" = "auto" && test "$ac_lib_lmdb_found" = "no"],
876 1.1.1.15 christos [with_lmdb=no])
877 1.1.1.15 christos
878 1.1.1.15 christos # hard fail when LMDB requested, but not found
879 1.1.1.15 christos AS_IF([test "$with_lmdb" != "no" && test "$ac_lib_lmdb_found" != "yes"],
880 1.1.1.15 christos [AC_MSG_ERROR([LMDB requested, but not found])])
881 1.1.1.15 christos
882 1.1.1.15 christos AS_IF([test "$ac_lib_lmdb_found" = "yes"],
883 1.1.1.15 christos [AC_DEFINE([HAVE_LMDB], [1], [Use lmdb library])])
884 1.1 christos
885 1.1.1.8 christos AC_SUBST([LMDB_CFLAGS])
886 1.1.1.8 christos AC_SUBST([LMDB_LIBS])
887 1.1.1.15 christos AM_CONDITIONAL([HAVE_LMDB], [test -n "$LMDB_LIBS"])
888 1.1 christos
889 1.1 christos #
890 1.1 christos # was --with-libxml2 specified?
891 1.1 christos #
892 1.1.1.9 christos # [pairwise: --with-libxml2=auto, --with-libxml2=yes, --without-libxml2]
893 1.1.1.7 christos AC_ARG_WITH([libxml2],
894 1.1.1.7 christos [AS_HELP_STRING([--with-libxml2],
895 1.1.1.7 christos [build with libxml2 library [yes|no|auto] (default is auto)])],
896 1.1.1.7 christos [], [with_libxml2="auto"])
897 1.1 christos
898 1.1.1.7 christos AS_CASE([$with_libxml2],
899 1.1.1.7 christos [no],[],
900 1.1.1.7 christos [auto],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
901 1.1.1.7 christos [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])],
902 1.1.1.7 christos [:])],
903 1.1.1.7 christos [yes],[PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.0],
904 1.1.1.7 christos [AC_DEFINE([HAVE_LIBXML2], [1], [Use libxml2 library])])],
905 1.1.1.7 christos [AC_MSG_ERROR([Specifying libxml2 installation path is not supported, adjust PKG_CONFIG_PATH instead])])
906 1.1 christos
907 1.1.1.15 christos AM_CONDITIONAL([HAVE_LIBXML2], [test -n "$LIBXML2_LIBS"])
908 1.1 christos
909 1.1 christos #
910 1.1.1.7 christos # was --with-json-c specified?
911 1.1 christos #
912 1.1.1.9 christos # [pairwise: --with-json-c=detect, --with-json-c=yes, --without-json-c]
913 1.1.1.7 christos AC_ARG_WITH([json-c],
914 1.1.1.7 christos [AS_HELP_STRING([--with-json-c],
915 1.1.1.7 christos [build with json-c library [yes|no|detect] (default is detect)])],
916 1.1.1.15 christos [], [with_json_c="detect"])
917 1.1 christos
918 1.1.1.7 christos AS_CASE([$with_json_c],
919 1.1.1.7 christos [no],[],
920 1.1.1.7 christos [detect],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
921 1.1.1.7 christos [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])],
922 1.1.1.7 christos [:])],
923 1.1.1.7 christos [yes],[PKG_CHECK_MODULES([JSON_C], [json-c >= 0.11],
924 1.1.1.7 christos [AC_DEFINE([HAVE_JSON_C], [1], [Use json-c library])])],
925 1.1.1.7 christos [AC_MSG_ERROR([Specifying json-c installation path is not supported, adjust PKG_CONFIG_PATH instead])]
926 1.1.1.7 christos )
927 1.1 christos
928 1.1.1.15 christos AM_CONDITIONAL([HAVE_JSON_C], [test -n "$JSON_C_LIBS"])
929 1.1.1.15 christos
930 1.1.1.7 christos AC_SUBST([JSON_C_CFLAGS])
931 1.1.1.7 christos AC_SUBST([JSON_C_LIBS])
932 1.1 christos
933 1.1.1.15 christos #
934 1.1.1.15 christos # was --with-zlib specified?
935 1.1.1.15 christos #
936 1.1.1.9 christos # [pairwise: --with-zlib=auto, --with-zlib=yes, --without-zlib]
937 1.1.1.7 christos AC_ARG_WITH([zlib],
938 1.1.1.15 christos [AS_HELP_STRING([--with-zlib],
939 1.1.1.15 christos [build with zlib for HTTP compression
940 1.1.1.15 christos [default=yes]])],
941 1.1.1.15 christos [], with_zlib="auto")
942 1.1.1.7 christos
943 1.1.1.7 christos AS_CASE([$with_zlib],
944 1.1.1.7 christos [no],[],
945 1.1.1.7 christos [auto],[PKG_CHECK_MODULES([ZLIB], [zlib],
946 1.1.1.15 christos [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
947 1.1.1.15 christos [:])],
948 1.1.1.7 christos [yes],[PKG_CHECK_MODULES([ZLIB], [zlib],
949 1.1.1.15 christos [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
950 1.1.1.7 christos [AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])])
951 1.1.1.7 christos AC_SUBST([ZLIB_CFLAGS])
952 1.1.1.7 christos AC_SUBST([ZLIB_LIBS])
953 1.1 christos
954 1.1 christos #
955 1.1.1.17 christos # was --with-libsystemd specified?
956 1.1.1.17 christos #
957 1.1.1.17 christos # [pairwise: --with-libsystemd=auto, --with-libsystemd=yes, --without-libsystemd]
958 1.1.1.17 christos AC_ARG_WITH([libsystemd],
959 1.1.1.17 christos [AS_HELP_STRING([--with-libsystemd],
960 1.1.1.17 christos [build with libsystemd integration [default=auto]])],
961 1.1.1.17 christos [], [with_libsystemd=auto])
962 1.1.1.17 christos
963 1.1.1.17 christos AS_CASE([$with_libsystemd],
964 1.1.1.17 christos [no],[],
965 1.1.1.17 christos [auto],[PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd],
966 1.1.1.17 christos [AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Use libsystemd library])],
967 1.1.1.17 christos [:])],
968 1.1.1.17 christos [yes],[PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd],
969 1.1.1.17 christos [AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Use libsystemd library])])],
970 1.1.1.17 christos [AC_MSG_ERROR([Specifying libsystemd installation path is not supported, adjust PKG_CONFIG_PATH instead])])
971 1.1.1.17 christos AC_SUBST([LIBSYSTEMD_CFLAGS])
972 1.1.1.17 christos AC_SUBST([LIBSYSTEMD_LIBS])
973 1.1.1.17 christos
974 1.1.1.17 christos #
975 1.1.1.15 christos # Check if the system supports glibc-compatible backtrace() function.
976 1.1 christos #
977 1.1.1.15 christos AC_CHECK_HEADERS([execinfo.h],
978 1.1.1.15 christos [AC_SEARCH_LIBS([backtrace_symbols], [execinfo],
979 1.1.1.15 christos [AC_CHECK_FUNCS([backtrace_symbols])])])
980 1.1 christos
981 1.1 christos #
982 1.1 christos # We do the IPv6 compilation checking after libtool so that we can put
983 1.1 christos # the right suffix on the files.
984 1.1 christos #
985 1.1 christos AC_MSG_CHECKING([for IPv6 structures])
986 1.1 christos AC_COMPILE_IFELSE(
987 1.1 christos [AC_LANG_PROGRAM(
988 1.1 christos [[
989 1.1 christos #include <sys/types.h>
990 1.1 christos #include <sys/socket.h>
991 1.1 christos #include <netinet/in.h>
992 1.1 christos ]],
993 1.1 christos [[
994 1.1 christos struct sockaddr_in6 sin6;
995 1.1 christos struct in6_addr in6;
996 1.1 christos struct in6_pktinfo in6_pi;
997 1.1 christos struct sockaddr_storage storage;
998 1.1 christos in6 = in6addr_any;
999 1.1 christos in6 = in6addr_loopback;
1000 1.1 christos sin6.sin6_scope_id = 0;
1001 1.1 christos return (0);
1002 1.1 christos ]])],
1003 1.1 christos [AC_MSG_RESULT([yes])],
1004 1.1 christos [AC_MSG_FAILURE([IPv6 support is mandatory])])
1005 1.1 christos
1006 1.1 christos #
1007 1.1 christos # Allow forcibly disabling TCP Fast Open support as autodetection might yield
1008 1.1 christos # confusing results on some systems (e.g. FreeBSD; see set_tcp_fastopen()
1009 1.1.1.15 christos # comment in lib/isc/socket.c).
1010 1.1 christos #
1011 1.1.1.9 christos # [pairwise: --enable-tcp-fastopen, --disable-tcp-fastopen]
1012 1.1 christos AC_ARG_ENABLE([tcp_fastopen],
1013 1.1 christos [AS_HELP_STRING([--disable-tcp-fastopen],
1014 1.1 christos [disable TCP Fast Open support [default=yes]])],
1015 1.1.1.15 christos [], [enable_tcp_fastopen="yes"])
1016 1.1 christos
1017 1.1 christos AS_IF([test "$enable_tcp_fastopen" = "yes"],
1018 1.1 christos [AC_DEFINE([ENABLE_TCP_FASTOPEN], [1], [define if you want TCP_FASTOPEN enabled if available])])
1019 1.1 christos
1020 1.1 christos #
1021 1.1 christos # Check for some other useful functions that are not ever-present.
1022 1.1 christos #
1023 1.1.1.13 christos AC_CHECK_FUNCS([strlcpy strlcat strnstr])
1024 1.1 christos
1025 1.1.1.15 christos #
1026 1.1.1.15 christos # Check for readline support
1027 1.1.1.15 christos #
1028 1.1.1.9 christos
1029 1.1.1.15 christos # editline is not included in pairwise testing as the library
1030 1.1.1.15 christos # is not present in the relevant Docker image.
1031 1.1.1.15 christos #
1032 1.1.1.15 christos # GNU Readline is not included in pairwise testing as the library
1033 1.1.1.15 christos # in the relevant Docker image does not support pkg-config.
1034 1.1.1.15 christos #
1035 1.1.1.15 christos # [pairwise: --with-readline=auto, --with-readline=yes, --with-readline=libedit, --without-readline]
1036 1.1.1.15 christos AC_ARG_WITH([readline],
1037 1.1.1.15 christos [AS_HELP_STRING([--with-readline=yes|no|libedit|readline],
1038 1.1.1.15 christos [specify readline library [default auto]])],
1039 1.1.1.15 christos [], [with_readline="auto"])
1040 1.1 christos
1041 1.1.1.15 christos AS_CASE([$with_readline],
1042 1.1.1.15 christos [no],[],
1043 1.1.1.15 christos [auto|yes],
1044 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [libedit],
1045 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])],
1046 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [libeditline],
1047 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support.])],
1048 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [readline],
1049 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support.])],
1050 1.1.1.15 christos [AS_IF([test "$with_readline" = "yes"],
1051 1.1.1.15 christos [AC_MSG_ERROR([readline support requested, but none of the libraries have been found.])])])])])],
1052 1.1.1.15 christos [libedit],
1053 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [libedit],
1054 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_LIBEDIT], [1], [Build with libedit support])])],
1055 1.1.1.15 christos [editline],
1056 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [libeditline],
1057 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_EDITLINE], [1], [Build with editline support])])],
1058 1.1.1.15 christos [readline],
1059 1.1.1.15 christos [PKG_CHECK_MODULES([READLINE], [readline],
1060 1.1.1.15 christos [AC_DEFINE([HAVE_READLINE_READLINE], [1], [Build with readline support])])],
1061 1.1.1.15 christos [AC_MSG_ERROR([Unknown readline '$with_readline' library requested.])])
1062 1.1.1.15 christos AM_CONDITIONAL([HAVE_READLINE], [test -n "$READLINE_LIBS"])
1063 1.1.1.15 christos AC_SUBST([READLINE_CFLAGS])
1064 1.1.1.15 christos AC_SUBST([READLINE_LIBS])
1065 1.1 christos
1066 1.1 christos #
1067 1.1 christos # Security Stuff
1068 1.1 christos #
1069 1.1 christos # Note it is very recommended to *not* disable chroot(),
1070 1.1 christos # this is only because chroot() was made obsolete by Posix.
1071 1.1.1.9 christos #
1072 1.1.1.9 christos # [pairwise: --enable-chroot, --disable-chroot]
1073 1.1 christos AC_ARG_ENABLE(chroot, AS_HELP_STRING([--disable-chroot], [disable chroot]))
1074 1.1 christos case "$enable_chroot" in
1075 1.1 christos yes|'')
1076 1.1 christos AC_CHECK_FUNCS(chroot)
1077 1.1 christos ;;
1078 1.1 christos no)
1079 1.1 christos ;;
1080 1.1 christos esac
1081 1.1 christos
1082 1.1.1.17 christos AS_CASE([$host],
1083 1.1.1.17 christos [*-linux*],
1084 1.1.1.17 christos [PKG_CHECK_MODULES([LIBCAP], [libcap],
1085 1.1.1.17 christos [AC_DEFINE([HAVE_LIBCAP], [1], [Define to 1 if libcap was found])])])
1086 1.1 christos
1087 1.1 christos case "$host" in
1088 1.1 christos *-solaris*)
1089 1.1 christos AC_DEFINE(NEED_SECURE_DIRECTORY, 1,
1090 1.1 christos [Define if connect does not honour the permission on the UNIX domain socket.])
1091 1.1 christos ;;
1092 1.1 christos esac
1093 1.1 christos
1094 1.1 christos #
1095 1.1 christos # Time Zone Stuff
1096 1.1 christos #
1097 1.1 christos AC_CHECK_FUNCS([tzset])
1098 1.1 christos
1099 1.1 christos AC_MSG_CHECKING(for optarg declaration)
1100 1.1.1.15 christos AC_COMPILE_IFELSE(
1101 1.1.1.15 christos [AC_LANG_PROGRAM(
1102 1.1.1.15 christos [[#include <unistd.h>]],
1103 1.1.1.15 christos [[optarg = 0;]]
1104 1.1.1.15 christos )],
1105 1.1.1.15 christos [AC_MSG_RESULT(yes)],
1106 1.1.1.15 christos [AC_MSG_RESULT(no)
1107 1.1.1.15 christos GEN_NEED_OPTARG="-DNEED_OPTARG=1"
1108 1.1.1.15 christos AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])]
1109 1.1.1.15 christos )
1110 1.1 christos
1111 1.1 christos #
1112 1.1 christos # Check for nanoseconds in file stats
1113 1.1 christos #
1114 1.1 christos AC_MSG_CHECKING([for st_mtim.tv_nsec])
1115 1.1 christos AC_COMPILE_IFELSE(
1116 1.1 christos [AC_LANG_PROGRAM(
1117 1.1.1.15 christos [[#include <sys/stat.h>]],
1118 1.1 christos [[struct stat s;
1119 1.1 christos return(s.st_mtim.tv_nsec);
1120 1.1 christos ]])],
1121 1.1.1.15 christos [AC_MSG_RESULT([yes])
1122 1.1.1.15 christos AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])],
1123 1.1.1.15 christos [AC_MSG_RESULT([no])])
1124 1.1 christos
1125 1.1 christos #
1126 1.1 christos # Check for if_nametoindex() for IPv6 scoped addresses support
1127 1.1 christos #
1128 1.1 christos AC_CHECK_FUNCS([if_nametoindex])
1129 1.1 christos
1130 1.1 christos AC_CHECK_HEADERS([uchar.h])
1131 1.1 christos
1132 1.1 christos #
1133 1.1 christos # Check for __builtin_unreachable
1134 1.1 christos #
1135 1.1 christos AC_MSG_CHECKING([compiler support for __builtin_unreachable()])
1136 1.1 christos AC_LINK_IFELSE(
1137 1.1 christos [AC_LANG_PROGRAM(
1138 1.1 christos [[]],
1139 1.1 christos [[__builtin_unreachable();]]
1140 1.1 christos )],
1141 1.1 christos [AC_MSG_RESULT([yes])
1142 1.1 christos AC_DEFINE([HAVE_BUILTIN_UNREACHABLE], [1], [define if the compiler supports __builtin_unreachable().])
1143 1.1 christos ],
1144 1.1 christos [AC_MSG_RESULT([no])
1145 1.1 christos ])
1146 1.1 christos
1147 1.1 christos #
1148 1.1.1.15 christos # Check for __builtin_clz
1149 1.1 christos #
1150 1.1.1.15 christos AC_MSG_CHECKING([compiler support for __builtin_clz])
1151 1.1.1.15 christos AC_LINK_IFELSE(
1152 1.1.1.15 christos [AC_LANG_PROGRAM(
1153 1.1.1.15 christos [[]],
1154 1.1.1.15 christos [[return (__builtin_clz(0xff) == 24 ? 1 : 0);]]
1155 1.1.1.15 christos )],
1156 1.1.1.15 christos [AC_MSG_RESULT([yes])
1157 1.1.1.15 christos AC_DEFINE(HAVE_BUILTIN_CLZ, 1, [Define to 1 if the compiler supports __builtin_clz.])
1158 1.1.1.15 christos ],
1159 1.1.1.15 christos [AC_MSG_RESULT([no])]
1160 1.1.1.15 christos )
1161 1.1 christos
1162 1.1 christos #
1163 1.1.1.17 christos # Check for __builtin_*_overflow
1164 1.1 christos #
1165 1.1.1.17 christos AC_MSG_CHECKING([compiler support for __builtin_add_overflow()])
1166 1.1.1.15 christos AC_LINK_IFELSE(
1167 1.1.1.15 christos [AC_LANG_PROGRAM(
1168 1.1.1.15 christos [[#include <limits.h>]],
1169 1.1.1.17 christos [[return (__builtin_add_overflow((unsigned int)UINT_MAX, (unsigned int)UINT_MAX, &(unsigned int){ 0 }));]]
1170 1.1.1.15 christos )],
1171 1.1.1.15 christos [AC_MSG_RESULT([yes])
1172 1.1.1.17 christos AC_DEFINE([HAVE_BUILTIN_ADD_OVERFLOW], [1], [define if the compiler supports __builtin_add_overflow().])
1173 1.1.1.17 christos ],
1174 1.1.1.17 christos [AC_MSG_RESULT([no])
1175 1.1.1.17 christos ])
1176 1.1.1.17 christos
1177 1.1.1.17 christos AC_MSG_CHECKING([compiler support for __builtin_sub_overflow()])
1178 1.1.1.17 christos AC_LINK_IFELSE(
1179 1.1.1.17 christos [AC_LANG_PROGRAM(
1180 1.1.1.17 christos [[#include <limits.h>]],
1181 1.1.1.17 christos [[return (__builtin_sub_overflow((unsigned int)0, (unsigned int)UINT_MAX, &(unsigned int){ 0 }));]]
1182 1.1.1.17 christos )],
1183 1.1.1.17 christos [AC_MSG_RESULT([yes])
1184 1.1.1.17 christos AC_DEFINE([HAVE_BUILTIN_SUB_OVERFLOW], [1], [define if the compiler supports __builtin_sub_overflow().])
1185 1.1.1.17 christos ],
1186 1.1.1.17 christos [AC_MSG_RESULT([no])
1187 1.1.1.17 christos ])
1188 1.1.1.17 christos
1189 1.1.1.17 christos AC_MSG_CHECKING([compiler support for __builtin_mul_overflow()])
1190 1.1.1.17 christos AC_LINK_IFELSE(
1191 1.1.1.17 christos [AC_LANG_PROGRAM(
1192 1.1.1.17 christos [[#include <limits.h>
1193 1.1.1.17 christos #include <stdint.h>
1194 1.1.1.17 christos ]],
1195 1.1.1.17 christos [[return (__builtin_mul_overflow(UINT64_MAX, UINT64_MAX, &(uint64_t){ 0 }));]]
1196 1.1.1.17 christos )],
1197 1.1.1.17 christos [AC_MSG_RESULT([yes])
1198 1.1.1.17 christos AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [define if the compiler supports __builtin_mul_overflow().])
1199 1.1.1.15 christos ],
1200 1.1.1.15 christos [AC_MSG_RESULT([no])
1201 1.1.1.15 christos ])
1202 1.1 christos
1203 1.1 christos #
1204 1.1 christos # Activate "rrset-order fixed" or not?
1205 1.1 christos #
1206 1.1.1.9 christos # [pairwise: --enable-fixed-rrset, --disable-fixed-rrset]
1207 1.1.1.15 christos AC_ARG_ENABLE([fixed-rrset],
1208 1.1.1.15 christos [AS_HELP_STRING([--enable-fixed-rrset],
1209 1.1.1.15 christos [enable fixed rrset ordering [default=no]])],
1210 1.1.1.15 christos [], [enable_fixed_rrset="no"])
1211 1.1.1.15 christos AS_IF([test "$enable_fixed_rrset" = "yes"],
1212 1.1.1.17 christos [AC_MSG_WARN([fixed rrset ordering is deprecated and will be removed in the future release])
1213 1.1.1.17 christos AC_DEFINE([DNS_RDATASET_FIXED], [1], [Define to enable "rrset-order fixed" syntax.])])
1214 1.1 christos
1215 1.1 christos #
1216 1.1 christos # Activate dnstap?
1217 1.1 christos #
1218 1.1.1.9 christos # [pairwise: --enable-dnstap, --disable-dnstap]
1219 1.1.1.15 christos AC_ARG_ENABLE([dnstap],
1220 1.1.1.15 christos [AS_HELP_STRING([--enable-dnstap],
1221 1.1.1.15 christos [enable dnstap support
1222 1.1.1.15 christos (requires fstrm, protobuf-c)])],
1223 1.1.1.15 christos [], [enable_dnstap=no])
1224 1.1.1.15 christos
1225 1.1.1.15 christos AS_IF([test "$enable_dnstap" != "no"],
1226 1.1.1.15 christos [PKG_CHECK_MODULES([DNSTAP], [libfstrm libprotobuf-c], [],
1227 1.1.1.15 christos [AC_MSG_FAILURE([Required libraries (fstrm, protobuf-c) were not found, please install them.])])
1228 1.1.1.15 christos AC_PATH_PROG([FSTRM_CAPTURE], [fstrm_capture])
1229 1.1.1.15 christos AC_PATH_PROG([PROTOC_C], [protoc-c])
1230 1.1.1.15 christos AS_IF([test -z "$PROTOC_C"],
1231 1.1.1.15 christos [AC_MSG_ERROR([protoc-c compiler not found])])
1232 1.1.1.15 christos AC_DEFINE([HAVE_DNSTAP], 1, [Define to 1 to enable dnstap support])
1233 1.1.1.15 christos ])
1234 1.1 christos
1235 1.1.1.15 christos AC_SUBST([DNSTAP_CFLAGS])
1236 1.1.1.15 christos AC_SUBST([DNSTAP_LIBS])
1237 1.1.1.15 christos AM_CONDITIONAL([HAVE_DNSTAP], [test "$enable_dnstap" != "no"])
1238 1.1 christos #
1239 1.1.1.8 christos # The following sections deal with tools used for formatting
1240 1.1.1.8 christos # the documentation. They are all optional, unless you are
1241 1.1.1.8 christos # a developer editing the documentation source.
1242 1.1 christos #
1243 1.1 christos
1244 1.1 christos #
1245 1.1.1.8 christos # Look for sphinx-build
1246 1.1 christos #
1247 1.1.1.8 christos AC_ARG_VAR([SPHINX_BUILD], [path to sphinx-build binary used to build the documentation])
1248 1.1.1.15 christos AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], [])
1249 1.1.1.15 christos AM_CONDITIONAL([HAVE_SPHINX_BUILD], [test -n "$SPHINX_BUILD"])
1250 1.1.1.8 christos
1251 1.1.1.8 christos #
1252 1.1.1.14 christos # Build the man pages only if we have prebuilt manpages or we can build them from RST sources
1253 1.1.1.14 christos #
1254 1.1.1.15 christos AM_CONDITIONAL([BUILD_MANPAGES], [test -e doc/man/named.conf.5in || test -n "$SPHINX_BUILD"])
1255 1.1.1.14 christos
1256 1.1.1.14 christos #
1257 1.1.1.16 christos # Pull release date from changelog.rst file last modification date
1258 1.1.1.8 christos # for reproducible builds
1259 1.1.1.8 christos #
1260 1.1.1.16 christos release_date=`date -u -r doc/arm/changelog.rst +%Y-%m-%d`
1261 1.1.1.8 christos AC_SUBST([RELEASE_DATE], $release_date)
1262 1.1.1.8 christos
1263 1.1 christos #
1264 1.1 christos # Look for Doxygen
1265 1.1 christos #
1266 1.1.1.8 christos AC_PATH_PROGS([DOXYGEN], [doxygen])
1267 1.1.1.15 christos
1268 1.1.1.15 christos AC_CONFIG_FILES([doc/doxygen/doxygen-input-filter],
1269 1.1.1.15 christos [chmod +x doc/doxygen/doxygen-input-filter])
1270 1.1 christos
1271 1.1 christos #
1272 1.1 christos # Look for curl
1273 1.1 christos #
1274 1.1 christos
1275 1.1 christos AC_PATH_PROG(CURL, curl, curl)
1276 1.1 christos AC_SUBST(CURL)
1277 1.1 christos
1278 1.1 christos #
1279 1.1.1.15 christos # Look for nc
1280 1.1.1.12 christos #
1281 1.1.1.12 christos
1282 1.1.1.15 christos AC_PATH_PROGS(NC, nc, nc)
1283 1.1.1.15 christos AC_SUBST(NC)
1284 1.1.1.12 christos
1285 1.1.1.12 christos #
1286 1.1 christos # IDN support using libidn2
1287 1.1 christos #
1288 1.1 christos
1289 1.1 christos LIBIDN2_CFLAGS=
1290 1.1 christos LIBIDN2_LIBS=
1291 1.1.1.9 christos
1292 1.1.1.9 christos # [pairwise: --with-libidn2=yes, --without-libidn2]
1293 1.1 christos AC_ARG_WITH([libidn2],
1294 1.1 christos [AS_HELP_STRING([--with-libidn2[=PATH]], [enable IDN support using GNU libidn2 [yes|no(default)|path]])],
1295 1.1 christos [with_libidn2="$withval"], [with_libidn2="no"])
1296 1.1 christos AS_CASE([$with_libidn2],
1297 1.1 christos [yes], [PKG_CHECK_MODULES([LIBIDN2], [libidn2],
1298 1.1 christos [AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])])],
1299 1.1 christos [no], [],
1300 1.1.1.7 christos [*], [AX_SAVE_FLAGS([libidn2])
1301 1.1 christos LIBIDN2_CFLAGS="-I$with_libidn2/include"
1302 1.1.1.15 christos LIBIDN2_LIBS="-L$with_libidn2/lib"
1303 1.1.1.15 christos CFLAGS="$CFLAGS $LIBIDN2_CFLAGS"
1304 1.1.1.15 christos LIBS="$LIBS $LIBIDN2_LIBS"
1305 1.1 christos AC_CHECK_HEADERS([idn2.h],
1306 1.1 christos [],
1307 1.1 christos [AC_MSG_ERROR([idn2.h not found])])
1308 1.1 christos AC_SEARCH_LIBS([idn2_to_ascii_lz], [idn2],
1309 1.1.1.15 christos [LIBIDN2_LIBS="$LIBIDN2_LIBS $ac_cv_search_idn2_to_ascii_lz"
1310 1.1 christos AC_DEFINE([HAVE_LIBIDN2], [1], [Define if libidn2 was found])],
1311 1.1 christos [AC_MSG_ERROR([libidn2 requested, but not found])])
1312 1.1.1.7 christos AX_RESTORE_FLAGS([libidn2])])
1313 1.1 christos AC_SUBST([LIBIDN2_CFLAGS])
1314 1.1 christos AC_SUBST([LIBIDN2_LIBS])
1315 1.1 christos
1316 1.1 christos #
1317 1.1 christos # Check whether to build with cmocka unit testing framework
1318 1.1 christos #
1319 1.1.1.9 christos # [pairwise: --with-cmocka=detect, --with-cmocka=yes, --without-cmocka]
1320 1.1 christos AC_ARG_WITH([cmocka],
1321 1.1.1.2 christos [AS_HELP_STRING([--with-cmocka=detect],[enable CMocka based tests (default is detect)])],
1322 1.1.1.2 christos [],[with_cmocka=detect])
1323 1.1 christos
1324 1.1 christos AS_CASE([$with_cmocka],
1325 1.1.1.2 christos [no],[],
1326 1.1.1.11 christos [detect],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3],
1327 1.1.1.11 christos [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])
1328 1.1.1.11 christos with_cmocka=yes],[with_cmocka=no])],
1329 1.1.1.11 christos [yes],[PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.3],
1330 1.1.1.8 christos [AC_DEFINE([HAVE_CMOCKA], [1], [Use CMocka])])],
1331 1.1.1.2 christos [AC_MSG_ERROR([Use PKG_CONFIG_PATH to specify path to CMocka library])]
1332 1.1.1.2 christos )
1333 1.1 christos AC_SUBST([CMOCKA_CFLAGS])
1334 1.1 christos AC_SUBST([CMOCKA_LIBS])
1335 1.1 christos
1336 1.1.1.15 christos AM_CONDITIONAL([HAVE_CMOCKA], [test "$with_cmocka" = "yes"])
1337 1.1.1.10 christos
1338 1.1 christos #
1339 1.1.1.15 christos # Compile with jemalloc (either provided as package or wired in the system on FreeBSD)
1340 1.1 christos #
1341 1.1.1.15 christos # [pairwise: --with-jemalloc=detect, --with-jemalloc=yes, --without-jemalloc]
1342 1.1.1.15 christos AC_ARG_WITH([jemalloc],
1343 1.1.1.15 christos [AS_HELP_STRING([--with-jemalloc=detect],[enable jemalloc memory allocator (default is detect)])],
1344 1.1.1.15 christos [],[with_jemalloc=detect])
1345 1.1 christos
1346 1.1.1.15 christos AS_CASE([$with_jemalloc],
1347 1.1.1.15 christos [no],[],
1348 1.1.1.15 christos [yes],[AX_CHECK_JEMALLOC(
1349 1.1.1.15 christos [AC_DEFINE([HAVE_JEMALLOC], [1], [Define to 1 if jemalloc is available])],
1350 1.1.1.15 christos [AC_MSG_ERROR([jemalloc not found])])],
1351 1.1.1.15 christos [AX_CHECK_JEMALLOC(
1352 1.1.1.15 christos [AC_DEFINE([HAVE_JEMALLOC], [1], [Define to 1 if jemalloc is available])
1353 1.1.1.15 christos with_jemalloc=yes],
1354 1.1.1.15 christos [AC_MSG_WARN([jemalloc not found; performance will be reduced])
1355 1.1.1.15 christos with_jemalloc=no])])
1356 1.1.1.7 christos
1357 1.1.1.15 christos AS_IF([test "$with_jemalloc" = "no"],
1358 1.1.1.15 christos [AS_CASE([$host],
1359 1.1.1.16 christos [*-freebsd*],[AC_MSG_ERROR([You cannot compile without jemalloc; jemalloc is the system allocator on FreeBSD])])])
1360 1.1.1.7 christos
1361 1.1.1.15 christos AM_CONDITIONAL([HAVE_JEMALLOC], [test "$with_jemalloc" = "yes"])
1362 1.1 christos
1363 1.1 christos #
1364 1.1.1.17 christos # Check memory leaks in external libraries
1365 1.1 christos #
1366 1.1.1.17 christos # [pairwise: --enable-leak-detection, --disable-leak-detection]
1367 1.1.1.17 christos AC_ARG_ENABLE([leak-detection],
1368 1.1.1.17 christos [AS_HELP_STRING([--enable-leak-detection],[enable the memory leak detection in external libraries (libxml2, libuv, OpenSSL) (disabled by default)])],
1369 1.1.1.17 christos [],[enable_leak_detection=no])
1370 1.1.1.17 christos AS_CASE([$enable_leak_detection],
1371 1.1.1.17 christos [yes],[AC_DEFINE([ENABLE_LEAK_DETECTION], [1], [Define to enable memory leak detection in external libraries])])
1372 1.1 christos
1373 1.1 christos #
1374 1.1.1.15 christos # was --enable-querytrace or --enable-singletrace specified?
1375 1.1 christos #
1376 1.1.1.15 christos # [pairwise: --enable-singletrace --enable-querytrace, --disable-singletrace --enable-querytrace, --disable-singletrace --disable-querytrace]
1377 1.1.1.15 christos AC_ARG_ENABLE([singletrace],
1378 1.1.1.15 christos AS_HELP_STRING([--enable-singletrace],
1379 1.1.1.15 christos [enable single-query trace logging
1380 1.1.1.15 christos [default=no]]),
1381 1.1.1.15 christos enable_singletrace="$enableval", enable_singletrace="no")
1382 1.1.1.15 christos
1383 1.1.1.15 christos AC_MSG_CHECKING([whether to enable single-query trace logging])
1384 1.1.1.15 christos case "$enable_singletrace" in
1385 1.1.1.15 christos yes)
1386 1.1.1.15 christos enable_querytrace=yes
1387 1.1.1.15 christos AC_MSG_RESULT(yes)
1388 1.1.1.15 christos AC_DEFINE(WANT_SINGLETRACE, 1, [Define to enable single-query tracing.])
1389 1.1.1.15 christos ;;
1390 1.1.1.15 christos no)
1391 1.1.1.15 christos AC_MSG_RESULT(no)
1392 1.1.1.15 christos ;;
1393 1.1.1.15 christos *)
1394 1.1.1.15 christos AC_MSG_ERROR("--enable-singletrace requires yes or no")
1395 1.1.1.15 christos ;;
1396 1.1.1.15 christos esac
1397 1.1.1.15 christos
1398 1.1.1.15 christos # [pairwise: skip]
1399 1.1 christos AC_ARG_ENABLE(querytrace,
1400 1.1 christos AS_HELP_STRING([--enable-querytrace],
1401 1.1 christos [enable very verbose query trace logging
1402 1.1 christos [default=no]]),
1403 1.1.1.15 christos enable_querytrace="$enableval",
1404 1.1.1.15 christos enable_querytrace="$enable_singletrace")
1405 1.1 christos
1406 1.1 christos AC_MSG_CHECKING([whether to enable query trace logging])
1407 1.1.1.15 christos case "$enable_querytrace" in
1408 1.1 christos yes)
1409 1.1 christos AC_MSG_RESULT(yes)
1410 1.1 christos AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
1411 1.1 christos ;;
1412 1.1 christos no)
1413 1.1.1.15 christos AS_IF([test "$enable_singletrace" = "yes"],
1414 1.1.1.15 christos [AC_MSG_ERROR([--enable-singletrace requires --enable-querytrace])])
1415 1.1 christos AC_MSG_RESULT(no)
1416 1.1 christos ;;
1417 1.1 christos *)
1418 1.1.1.17 christos AC_MSG_ERROR(["--enable-querytrace requires yes or no (not $enable_querytrace)"])
1419 1.1 christos ;;
1420 1.1 christos esac
1421 1.1 christos
1422 1.1 christos #
1423 1.1 christos # Was --disable-auto-validation specified?
1424 1.1 christos #
1425 1.1.1.9 christos
1426 1.1 christos validation_default=auto
1427 1.1.1.9 christos
1428 1.1.1.9 christos # [pairwise: --enable-auto-validation, --disable-auto-validation]
1429 1.1 christos AC_ARG_ENABLE(auto-validation,
1430 1.1 christos AS_HELP_STRING([--enable-auto-validation],
1431 1.1 christos [turn on DNSSEC validation by default, using the IANA root key [default=yes]]),
1432 1.1 christos [:],[enable_auto_validation=yes])
1433 1.1 christos AS_IF([test "$enable_auto_validation" = "no"],[validation_default=yes])
1434 1.1 christos AC_DEFINE_UNQUOTED([VALIDATION_DEFAULT], ["$validation_default"], [the default value of dnssec-validation option])
1435 1.1 christos
1436 1.1 christos #
1437 1.1 christos #
1438 1.1 christos # Response policy rewriting using DNS Response Policy Service (DNSRPS)
1439 1.1 christos # interface.
1440 1.1 christos #
1441 1.1 christos # DNSRPS can be compiled into BIND everywhere with a reasonably
1442 1.1 christos # modern C compiler. It is enabled on systems with dlopen() and librpz.so.
1443 1.1 christos #
1444 1.1 christos dnsrps_avail=yes
1445 1.1 christos AC_MSG_CHECKING([for librpz __attribute__s])
1446 1.1 christos AC_COMPILE_IFELSE(
1447 1.1 christos [AC_LANG_PROGRAM(
1448 1.1 christos [[]],
1449 1.1 christos [[
1450 1.1 christos extern void f(char *p __attribute__((unused)), ...)
1451 1.1 christos __attribute__((format(printf,1,2))) __attribute__((__noreturn__));
1452 1.1 christos ]])],
1453 1.1 christos [
1454 1.1 christos librpz_have_attr=yes
1455 1.1 christos AC_DEFINE([LIBRPZ_HAVE_ATTR], [1], [have __attribute__s used in librpz.h])
1456 1.1 christos AC_MSG_RESULT([yes])
1457 1.1 christos ],[
1458 1.1 christos librpz_have_attr=no
1459 1.1 christos AC_MSG_RESULT([no])
1460 1.1 christos ])
1461 1.1 christos
1462 1.1.1.15 christos # [pairwise: --enable-dnsrps --enable-dnsrps-dl, --disable-dnsrps]
1463 1.1 christos AC_ARG_ENABLE([dnsrps-dl],
1464 1.1 christos [AS_HELP_STRING([--enable-dnsrps-dl],
1465 1.1 christos [DNS Response Policy Service delayed link
1466 1.1.1.17 christos [default=yes]])],
1467 1.1.1.17 christos [enable_dnsrps_dl="$enableval"], [enable_dnsrps_dl="yes"])
1468 1.1 christos
1469 1.1.1.17 christos AS_IF([test "$enable_dnsrps_dl" = "yes" -a "$with_dlopen" = "no"],
1470 1.1 christos [AC_MSG_ERROR([DNS Response Policy Service delayed link requires dlopen to be enabled])])
1471 1.1 christos
1472 1.1.1.9 christos # [pairwise: skip]
1473 1.1 christos AC_ARG_WITH([dnsrps-libname],
1474 1.1 christos [AS_HELP_STRING([--with-dnsrps-libname],
1475 1.1 christos [DNSRPS provider library name (librpz.so)])],
1476 1.1 christos [librpz_name="$withval"], [librpz_name="librpz.so"])
1477 1.1.1.9 christos
1478 1.1.1.9 christos # [pairwise: skip]
1479 1.1 christos AC_ARG_WITH([dnsrps-dir],
1480 1.1 christos [AS_HELP_STRING([--with-dnsrps-dir],
1481 1.1 christos [path to DNSRPS provider library])],
1482 1.1 christos [librpz_path="$withval/$librpz_name"], [librpz_path="$librpz_name"])
1483 1.1 christos AC_DEFINE_UNQUOTED([DNSRPS_LIBRPZ_PATH], ["$librpz_path"],
1484 1.1 christos [dnsrps $librpz_name])
1485 1.1.1.17 christos AS_IF([test "$enable_dnsrps_dl" = "yes"],
1486 1.1 christos [
1487 1.1 christos dnsrps_lib_open=2
1488 1.1 christos ],[
1489 1.1 christos dnsrps_lib_open=1
1490 1.1 christos # Add librpz.so to linked libraries if we are not using dlopen()
1491 1.1 christos AC_SEARCH_LIBS([librpz_client_create], [rpz], [],
1492 1.1 christos [dnsrps_lib_open=0
1493 1.1 christos dnsrps_avail=no])
1494 1.1 christos ])
1495 1.1 christos AC_DEFINE_UNQUOTED([DNSRPS_LIB_OPEN], [$dnsrps_lib_open],
1496 1.1 christos [0=no DNSRPS 1=static link 2=dlopen()])
1497 1.1 christos
1498 1.1.1.9 christos # [pairwise: skip]
1499 1.1 christos AC_ARG_ENABLE([dnsrps],
1500 1.1 christos AS_HELP_STRING([--enable-dnsrps],
1501 1.1 christos [enable DNS Response Policy Service API]),
1502 1.1 christos [enable_dnsrps=$enableval], [enable_dnsrps=no])
1503 1.1 christos
1504 1.1 christos AS_IF([test "$enable_dnsrps" != "no"],[
1505 1.1 christos AS_IF([test "$dnsrps_lib_open" = "0"],
1506 1.1 christos [AC_MSG_ERROR([dlopen and librpz.so needed for DNSRPS])])
1507 1.1 christos AC_DEFINE([USE_DNSRPS], [1], [Enable DNS Response Policy Service API])
1508 1.1 christos ])
1509 1.1 christos
1510 1.1.1.17 christos AM_CONDITIONAL([DNSRPS], [test "$enable_dnsrps" != "no"])
1511 1.1.1.17 christos
1512 1.1.1.15 christos AC_CHECK_HEADERS([glob.h])
1513 1.1 christos
1514 1.1.1.10 christos #
1515 1.1.1.10 christos # Support for constructor and destructor attributes
1516 1.1.1.10 christos #
1517 1.1.1.10 christos AX_GCC_FUNC_ATTRIBUTE([constructor])
1518 1.1.1.10 christos AX_GCC_FUNC_ATTRIBUTE([destructor])
1519 1.1.1.10 christos
1520 1.1 christos #
1521 1.1.1.17 christos # Check whether to enable User Statically Defined Tracing.
1522 1.1.1.17 christos #
1523 1.1.1.17 christos # This is supported only on Linux now and requires SystemTap libraries.
1524 1.1.1.17 christos #
1525 1.1.1.17 christos # [pairwise: --enable-tracing=auto, --enable-tracing=yes, --disable-tracing]
1526 1.1.1.17 christos AC_ARG_ENABLE([tracing],
1527 1.1.1.17 christos [AS_HELP_STRING([--enable-tracing],
1528 1.1.1.17 christos [enable User Statically Defined Tracing])],
1529 1.1.1.17 christos [],
1530 1.1.1.17 christos [enable_tracing=auto])
1531 1.1.1.17 christos
1532 1.1.1.17 christos AC_ARG_VAR([DTRACE], [path to dtrace binary used to build User Statically Defined Tracing probes])
1533 1.1.1.17 christos AC_PATH_PROGS([DTRACE], [dtrace])
1534 1.1.1.17 christos AC_CHECK_HEADERS([sys/sdt.h])
1535 1.1.1.17 christos
1536 1.1.1.17 christos AC_MSG_CHECKING([whether to enable User Statically Defined Tracing support (default is auto)])
1537 1.1.1.17 christos AS_CASE([$enable_tracing],
1538 1.1.1.17 christos [auto], [enable_tracing=yes
1539 1.1.1.17 christos AS_IF([test "$ac_cv_header_sys_sdt_h" != "yes"], [enable_tracing=no])
1540 1.1.1.17 christos AS_IF([test -z "$DTRACE"],[enable_tracing=no])
1541 1.1.1.17 christos AC_COMPILE_IFELSE(
1542 1.1.1.17 christos [AC_LANG_PROGRAM([[]],
1543 1.1.1.17 christos [[#if !defined(__has_feature)
1544 1.1.1.17 christos #define __has_feature(x) 0
1545 1.1.1.17 christos #endif /* if !defined(__has_feature) */
1546 1.1.1.17 christos #if __has_feature(address_sanitizer)
1547 1.1.1.17 christos #define __SANITIZE_ADDRESS__ 1
1548 1.1.1.17 christos #endif /* if __has_feature(address_sanitizer) */
1549 1.1.1.17 christos #if defined(__SANITIZE_ADDRESS__)
1550 1.1.1.17 christos #error Address Sanitizer enabled
1551 1.1.1.17 christos #endif
1552 1.1.1.17 christos ]])],
1553 1.1.1.17 christos [],
1554 1.1.1.17 christos [enable_tracing=no]
1555 1.1.1.17 christos )])
1556 1.1.1.17 christos AS_CASE([$enable_tracing],
1557 1.1.1.17 christos [yes], [AS_IF([test "$ac_cv_header_sys_sdt_h" != "yes"],
1558 1.1.1.17 christos [AC_MSG_ERROR([sys/sdt.h header not found])])
1559 1.1.1.17 christos AS_IF([test -z "$DTRACE"],
1560 1.1.1.17 christos [AC_MSG_ERROR([The dtrace command not found])])
1561 1.1.1.17 christos AC_MSG_RESULT([yes])],
1562 1.1.1.17 christos [DTRACE=""
1563 1.1.1.17 christos AC_MSG_RESULT([no])])
1564 1.1.1.17 christos
1565 1.1.1.17 christos AS_CASE([$host],
1566 1.1.1.17 christos [*-linux*],[have_systemtap=true])
1567 1.1.1.17 christos
1568 1.1.1.17 christos AM_CONDITIONAL([HAVE_SYSTEMTAP], [test -n "$have_systemtap"])
1569 1.1.1.17 christos AM_CONDITIONAL([HAVE_DTRACE], [test -n "$DTRACE"])
1570 1.1.1.17 christos
1571 1.1.1.17 christos # Use shim script if dtrace is not available
1572 1.1.1.17 christos AS_IF([test -z "$DTRACE"],
1573 1.1.1.17 christos [DTRACE='$(top_srcdir)/util/dtrace.sh'])
1574 1.1.1.17 christos
1575 1.1.1.17 christos AC_SUBST([DTRACE])
1576 1.1.1.17 christos
1577 1.1.1.17 christos #
1578 1.1.1.17 christos # Which should be the default zone database, RBTDB or QPZONE?
1579 1.1.1.17 christos # [pairwise: --with-zonedb=qp, --with-zonedb=rbt]
1580 1.1.1.17 christos #
1581 1.1.1.17 christos AC_ARG_WITH([zonedb],
1582 1.1.1.17 christos [AS_HELP_STRING([--with-zonedb=detect],[specify default zone database type (default is "qpzone")])],
1583 1.1.1.17 christos [],[with_zonedb=qp])
1584 1.1.1.17 christos zonedb="qpzone"
1585 1.1.1.17 christos AS_CASE([$with_zonedb],
1586 1.1.1.17 christos [RBT*|rbt*],[zonedb="rbt"],
1587 1.1.1.17 christos [QP|qp],[],
1588 1.1.1.17 christos [AC_MSG_ERROR([Unknown zone database type])]
1589 1.1.1.17 christos )
1590 1.1.1.17 christos AC_DEFINE_UNQUOTED([ZONEDB_DEFAULT], ["$zonedb"], [Default zone database type])
1591 1.1.1.17 christos
1592 1.1.1.17 christos #
1593 1.1.1.17 christos # Which should be the default zone database, RBTDB or QPCACHE?
1594 1.1.1.17 christos # [pairwise: --with-cachedb=qp, --with-cachedb=rbt]
1595 1.1.1.17 christos #
1596 1.1.1.17 christos AC_ARG_WITH([cachedb],
1597 1.1.1.17 christos [AS_HELP_STRING([--with-cachedb=detect],[specify default cache database type (default is "qpcache")])],
1598 1.1.1.17 christos [],[with_cachedb=qp])
1599 1.1.1.17 christos cachedb="qpcache"
1600 1.1.1.17 christos AS_CASE([$with_cachedb],
1601 1.1.1.17 christos [RBT*|rbt*],[cachedb="rbt"],
1602 1.1.1.17 christos [QP*|qp*],[],
1603 1.1.1.17 christos [AC_MSG_ERROR([Unknown cache database type])]
1604 1.1.1.17 christos )
1605 1.1.1.17 christos AC_DEFINE_UNQUOTED([CACHEDB_DEFAULT], ["$cachedb"], [Default cache database type])
1606 1.1.1.17 christos
1607 1.1.1.17 christos #
1608 1.1 christos # Files to configure. These are listed here because we used to
1609 1.1.1.15 christos # specify them as arguments to AC_OUTPUT.
1610 1.1 christos #
1611 1.1 christos
1612 1.1.1.15 christos # Top
1613 1.1.1.15 christos
1614 1.1.1.15 christos AC_CONFIG_FILES([Makefile])
1615 1.1.1.15 christos
1616 1.1.1.15 christos # Binaries
1617 1.1.1.15 christos
1618 1.1.1.15 christos AC_CONFIG_FILES([bin/Makefile
1619 1.1.1.15 christos bin/named/Makefile
1620 1.1.1.15 christos bin/rndc/Makefile
1621 1.1.1.15 christos bin/dig/Makefile
1622 1.1.1.15 christos bin/delv/Makefile
1623 1.1.1.15 christos bin/dnssec/Makefile
1624 1.1.1.15 christos bin/tools/Makefile
1625 1.1.1.15 christos bin/nsupdate/Makefile
1626 1.1.1.15 christos bin/check/Makefile
1627 1.1.1.15 christos bin/confgen/Makefile
1628 1.1.1.15 christos bin/plugins/Makefile])
1629 1.1.1.15 christos
1630 1.1.1.15 christos # Libraries
1631 1.1.1.15 christos
1632 1.1.1.15 christos AC_CONFIG_FILES([lib/Makefile
1633 1.1.1.15 christos lib/isc/Makefile
1634 1.1.1.15 christos lib/dns/Makefile
1635 1.1.1.15 christos lib/ns/Makefile
1636 1.1.1.15 christos lib/isccfg/Makefile
1637 1.1.1.17 christos lib/isccc/Makefile])
1638 1.1.1.15 christos
1639 1.1.1.15 christos # Documentation
1640 1.1.1.15 christos
1641 1.1.1.15 christos AC_CONFIG_FILES([doc/Makefile
1642 1.1.1.15 christos doc/arm/Makefile
1643 1.1.1.15 christos doc/man/Makefile
1644 1.1.1.15 christos doc/misc/Makefile])
1645 1.1.1.15 christos
1646 1.1.1.17 christos # Unit tests and benchmarks
1647 1.1.1.15 christos
1648 1.1.1.15 christos AC_CONFIG_FILES([tests/Makefile
1649 1.1.1.17 christos tests/bench/Makefile
1650 1.1.1.15 christos tests/isc/Makefile
1651 1.1.1.15 christos tests/dns/Makefile
1652 1.1.1.15 christos tests/ns/Makefile
1653 1.1.1.15 christos tests/irs/Makefile
1654 1.1.1.15 christos tests/isccfg/Makefile
1655 1.1.1.15 christos tests/libtest/Makefile])
1656 1.1.1.15 christos
1657 1.1.1.15 christos AC_CONFIG_FILES([tests/unit-test-driver.sh],
1658 1.1.1.15 christos [chmod +x tests/unit-test-driver.sh])
1659 1.1.1.15 christos
1660 1.1.1.15 christos # System Tests
1661 1.1.1.15 christos
1662 1.1.1.15 christos AC_CONFIG_FILES([bin/tests/Makefile
1663 1.1.1.15 christos bin/tests/system/Makefile
1664 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR
1665 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR
1666 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE
1667 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/SHELL
1668 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/PYTHON
1669 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/PERL
1670 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/CURL
1671 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/NC
1672 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/XSLTPROC
1673 1.1.1.17 christos bin/tests/system/isctest/vars/.ac_vars/PYTEST
1674 1.1.1.15 christos bin/tests/system/dyndb/driver/Makefile
1675 1.1.1.15 christos bin/tests/system/dlzexternal/driver/Makefile
1676 1.1.1.17 christos bin/tests/system/hooks/driver/Makefile
1677 1.1.1.17 christos bin/tests/system/rpz/testlib/Makefile
1678 1.1.1.17 christos ])
1679 1.1.1.15 christos
1680 1.1.1.15 christos AC_CONFIG_FILES([bin/tests/system/ifconfig.sh],
1681 1.1.1.15 christos [chmod +x bin/tests/system/ifconfig.sh])
1682 1.1.1.15 christos AC_CONFIG_FILES([bin/tests/system/start.sh],
1683 1.1.1.15 christos [chmod +x bin/tests/system/start.sh])
1684 1.1.1.15 christos AC_CONFIG_FILES([bin/tests/system/stop.sh],
1685 1.1.1.15 christos [chmod +x bin/tests/system/stop.sh])
1686 1.1.1.15 christos
1687 1.1.1.15 christos # Fuzz Tests
1688 1.1.1.15 christos
1689 1.1.1.15 christos AC_CONFIG_FILES([fuzz/Makefile])
1690 1.1.1.15 christos
1691 1.1.1.15 christos # Misc
1692 1.1.1.15 christos
1693 1.1.1.15 christos AC_CONFIG_FILES([util/check-make-install])
1694 1.1 christos
1695 1.1 christos #
1696 1.1 christos # Do it
1697 1.1 christos #
1698 1.1 christos
1699 1.1 christos AC_OUTPUT
1700 1.1 christos
1701 1.1.1.9 christos # [pairwise: --enable-full-report, --disable-full-report]
1702 1.1 christos AC_ARG_ENABLE(full-report,
1703 1.1 christos AS_HELP_STRING([--enable-full-report],
1704 1.1 christos [report values of all configure options]))
1705 1.1 christos
1706 1.1 christos report() {
1707 1.1 christos echo "==============================================================================="
1708 1.1 christos echo "Configuration summary:"
1709 1.1 christos echo "-------------------------------------------------------------------------------"
1710 1.1 christos echo "Optional features enabled:"
1711 1.1.1.15 christos if test "yes" = "$with_jemalloc"; then
1712 1.1.1.15 christos echo " Memory allocator: jemalloc"
1713 1.1.1.15 christos fi
1714 1.1.1.17 christos if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then
1715 1.1.1.17 christos echo " Default zone database type: $zonedb"
1716 1.1.1.17 christos fi
1717 1.1.1.17 christos if test "yes" = "$enable_full_report" -o "rbt" = "$zonedb"; then
1718 1.1.1.17 christos echo " Default cache database type: $cachedb"
1719 1.1 christos fi
1720 1.1.1.15 christos test "no" = "$enable_dnstap" || \
1721 1.1 christos echo " Allow 'dnstap' packet logging (--enable-dnstap)"
1722 1.1.1.7 christos test -z "$MAXMINDDB_LIBS" || echo " GeoIP2 access control (--enable-geoip)"
1723 1.1.1.15 christos test -z "$GSSAPI_LIBS" || echo " GSS-API (--with-gssapi)"
1724 1.1 christos
1725 1.1 christos # these lines are only printed if run with --enable-full-report
1726 1.1 christos if test "yes" = "$enable_full_report"; then
1727 1.1.1.15 christos test -z "$LIBXML2_LIBS" || echo " XML statistics (--with-libxml2)"
1728 1.1.1.15 christos test -z "$JSON_C_LIBS" || echo " JSON statistics (--with-json-c): $JSON_C_CFLAGS $JSON_C_LIBS"
1729 1.1.1.15 christos test -z "$ZLIB_LIBS" || echo " HTTP zlib compression (--with-zlib)"
1730 1.1.1.15 christos test -z "$LMDB_LIBS" || echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
1731 1.1.1.15 christos test -z "$LIBIDN2_LIBS" || echo " IDN support (--with-libidn2)"
1732 1.1 christos fi
1733 1.1 christos
1734 1.1 christos test "yes" = "$enable_dnsrps" && \
1735 1.1 christos echo " DNS Response Policy Service interface (--enable-dnsrps)"
1736 1.1.1.15 christos test "yes" = "$enable_fixed_rrset" && \
1737 1.1 christos echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
1738 1.1.1.17 christos test "yes" = "$enable_fips_mode" && \
1739 1.1.1.17 christos echo " FIPS mode in OpenSSL (--enable-fips-mode)"
1740 1.1.1.17 christos
1741 1.1.1.15 christos test "yes" = "$enable_querytrace" && \
1742 1.1 christos echo " Very verbose query trace logging (--enable-querytrace)"
1743 1.1.1.15 christos test "yes" = "$enable_singletrace" && \
1744 1.1.1.15 christos echo " Single-query trace logging (--enable-singletrace)"
1745 1.1.1.15 christos test -z "$HAVE_CMOCKA" || echo " CMocka Unit Testing Framework (--with-cmocka)"
1746 1.1 christos
1747 1.1.1.4 christos test "auto" = "$validation_default" && echo " DNSSEC validation active by default (--enable-auto-validation)"
1748 1.1 christos
1749 1.1 christos echo "-------------------------------------------------------------------------------"
1750 1.1.1.17 christos echo " Library versions:"
1751 1.1.1.17 christos echo " OpenSSL: $OPENSSL_VERSION"
1752 1.1.1.17 christos echo " libuv: $LIBUV_VERSION"
1753 1.1.1.17 christos echo " Userspace-RCU: $RCU_VERSION"
1754 1.1.1.17 christos if test "no" != "$with_jemalloc"; then
1755 1.1.1.17 christos echo " jemalloc: $JEMALLOC_VERSION"
1756 1.1.1.17 christos fi
1757 1.1.1.17 christos echo "-------------------------------------------------------------------------------"
1758 1.1 christos
1759 1.1 christos echo "Features disabled or unavailable on this platform:"
1760 1.1.1.15 christos if test "no" = "$with_jemalloc"; then
1761 1.1.1.15 christos echo " Memory allocator: system"
1762 1.1.1.15 christos echo
1763 1.1.1.15 christos echo " +------------------------------------------+"
1764 1.1.1.15 christos echo " | ==== WARNING ==== |"
1765 1.1.1.15 christos echo " | |"
1766 1.1.1.15 christos echo " | This is NOT a recommended configuration. |"
1767 1.1.1.15 christos echo " | Using the system memory allocator causes |"
1768 1.1.1.15 christos echo " | reduced performance and increased memory |"
1769 1.1.1.15 christos echo " | fragmentation. Installing the jemalloc |"
1770 1.1.1.15 christos echo " | memory allocator (version >= 4.0.0) is |"
1771 1.1.1.15 christos echo " | strongly recommended. |"
1772 1.1.1.15 christos echo " +------------------------------------------+"
1773 1.1.1.15 christos echo
1774 1.1.1.15 christos fi
1775 1.1 christos
1776 1.1.1.15 christos test "no" = "$enable_dnstap" && \
1777 1.1 christos echo " Allow 'dnstap' packet logging (--enable-dnstap)"
1778 1.1.1.7 christos test -z "$MAXMINDDB_LIBS" && echo " GeoIP2 access control (--enable-geoip)"
1779 1.1.1.15 christos test -z "$GSSAPI_LIBS" && echo " GSS-API (--with-gssapi)"
1780 1.1 christos
1781 1.1 christos test "no" = "$enable_dnsrps" && \
1782 1.1 christos echo " DNS Response Policy Service interface (--enable-dnsrps)"
1783 1.1 christos
1784 1.1.1.15 christos test "yes" = "$enable_fixed_rrset" || \
1785 1.1 christos echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
1786 1.1 christos
1787 1.1.1.15 christos test "yes" = "$validation_default" && echo " DNSSEC validation requires configuration (--enable-auto-validation)"
1788 1.1 christos
1789 1.1.1.17 christos test "yes" = "$enable_fips_mode" || \
1790 1.1.1.17 christos echo " FIPS mode in OpenSSL (--enable-fips-mode)"
1791 1.1.1.17 christos
1792 1.1.1.15 christos test "yes" = "$enable_querytrace" || \
1793 1.1 christos echo " Very verbose query trace logging (--enable-querytrace)"
1794 1.1.1.15 christos test "yes" = "$enable_singletrace" || \
1795 1.1.1.15 christos echo " Single-query trace logging (--enable-singletrace)"
1796 1.1 christos
1797 1.1.1.2 christos test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)"
1798 1.1 christos
1799 1.1.1.15 christos test -z "$LIBXML2_LIBS" && echo " XML statistics (--with-libxml2)"
1800 1.1.1.15 christos test -z "$JSON_C_LIBS" && echo " JSON statistics (--with-json-c)"
1801 1.1.1.15 christos test -z "$ZLIB_LIBS" && echo " HTTP zlib compression (--with-zlib)"
1802 1.1.1.15 christos test -z "$LMDB_LIBS" && echo " LMDB database to store configuration for 'addzone' zones (--with-lmdb)"
1803 1.1.1.15 christos test -z "$LIBIDN2_LIBS" && echo " IDN support (--with-libidn2)"
1804 1.1 christos
1805 1.1 christos echo "-------------------------------------------------------------------------------"
1806 1.1 christos echo "Configured paths:"
1807 1.1 christos echo " prefix: $prefix"
1808 1.1 christos echo " sysconfdir: $sysconfdir"
1809 1.1 christos echo " localstatedir: $localstatedir"
1810 1.1 christos echo "-------------------------------------------------------------------------------"
1811 1.1 christos echo "Compiler: $CC"
1812 1.1.1.12 christos AS_IF([test "$GCC" = "yes"],
1813 1.1.1.12 christos [$CC --version 2>&1 | sed 's/^/ /'],
1814 1.1.1.12 christos [AS_CASE([$host],
1815 1.1.1.12 christos [*-solaris*],[$CC -V 2>&1 | sed 's/^/ /'],
1816 1.1.1.12 christos [$CC --version 2>&1 | sed 's/^/ /'])])
1817 1.1.1.15 christos echo "CFLAGS: $STD_CFLAGS $CFLAGS"
1818 1.1.1.15 christos echo "CPPFLAGS: $STD_CPPFLAGS $CPPFLAGS"
1819 1.1.1.15 christos echo "LDFLAGS: $LDFLAGS"
1820 1.1 christos
1821 1.1 christos if test "X$ac_unrecognized_opts" != "X"; then
1822 1.1.1.15 christos echo "-------------------------------------------------------------------------------"
1823 1.1 christos echo "Unrecognized options:"
1824 1.1 christos echo " $ac_unrecognized_opts"
1825 1.1 christos fi
1826 1.1 christos
1827 1.1 christos if test "yes" != "$enable_full_report"; then
1828 1.1 christos echo "-------------------------------------------------------------------------------"
1829 1.1 christos echo "For more detail, use --enable-full-report."
1830 1.1 christos fi
1831 1.1 christos echo "==============================================================================="
1832 1.1 christos }
1833 1.1 christos
1834 1.1 christos if test "yes" != "$silent"; then
1835 1.1 christos report
1836 1.1 christos fi
1837 1.1 christos
1838 1.1 christos # Tell Emacs to edit this file in shell mode.
1839 1.1 christos # Local Variables:
1840 1.1 christos # mode: sh
1841 1.1 christos # End:
1842