3 AC_INIT([pdns], m4_esyscmd([builder-support/gen-version]))
4 AC_CONFIG_AUX_DIR([build-aux])
5 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar -Wno-portability subdir-objects parallel-tests 1.11])
7 AC_CONFIG_SRCDIR([pdns/auth-main.cc])
8 AC_CONFIG_MACRO_DIR([m4])
10 AC_USE_SYSTEM_EXTENSIONS
11 AC_CONFIG_HEADERS([config.h])
14 # Add some default CFLAGS and CXXFLAGS, can be appended to using the environment variables
15 CFLAGS="-g -O2 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CFLAGS"
16 CXXFLAGS="-g -O2 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CXXFLAGS"
18 AC_SUBST([pdns_configure_args], ["$ac_configure_args"])
19 AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],
20 ["$pdns_configure_args"],
21 [pdns configure arguments]
33 # Warn when pkg.m4 is missing
34 m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config])
36 AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
38 LT_INIT([disable-static dlopen])
44 PDNS_WITH_LUA([mandatory])
47 AC_MSG_CHECKING([whether we will enable compiler security checks])
48 AC_ARG_ENABLE([hardening],
49 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
50 [enable_hardening=$enableval],
51 [enable_hardening=yes]
53 AC_MSG_RESULT([$enable_hardening])
55 AS_IF([test "x$enable_hardening" != "xno"], [
58 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
59 AC_CC_D_FORTIFY_SOURCE
65 PDNS_CHECK_NETWORK_LIBS
70 # Define full_libdir to be the fully expanded (${exec_prefix}, etc.)
71 # "system" library path.
72 # We use this to search for other libraries.
73 eval full_libdir="\"$libdir\""
75 # detect pkg-config explicitly
82 [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])],
90 PDNS_CHECK_LIBCRYPTO([
92 AC_MSG_ERROR([OpenSSL/libcrypto not found])
95 PDNS_CHECK_LIBCRYPTO_ECDSA
96 PDNS_CHECK_LIBCRYPTO_EDDSA
98 AM_CONDITIONAL([HAVE_GNUTLS], [false])
99 AM_CONDITIONAL([HAVE_LIBSSL], [false])
101 PDNS_ENABLE_DNS_OVER_TLS
102 AS_IF([test "x$enable_dns_over_tls" != "xno"], [
105 AS_IF([test "x$HAVE_GNUTLS" != "x1" -a "x$HAVE_LIBSSL" != "x1"], [
106 AC_MSG_ERROR([DNS over TLS support requested but neither GnuTLS nor OpenSSL are available])
112 PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
113 PDNS_CHECK_CLOCK_GETTIME
115 BOOST_REQUIRE([1.42])
116 # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+
117 # to be compatible with C++11
118 AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148])
119 AS_IF([test "$boost_major_version" -ge 148], [
120 AC_DEFINE(HAVE_BOOST_GE_148, [1], [Define to 1 if you have boost >= 1.48])
123 BOOST_PROGRAM_OPTIONS([mt])
124 AS_IF([test "$boost_cv_lib_program_options" = "no"], [
125 AC_MSG_ERROR([Boost Program Options library not found])
127 PDNS_ENABLE_UNIT_TESTS
128 PDNS_ENABLE_BACKEND_UNIT_TESTS
129 PDNS_ENABLE_REPRODUCIBLE
130 PDNS_ENABLE_FUZZ_TARGETS
134 PDNS_CHECK_PYTHON_VENV
136 AM_CONDITIONAL([HAVE_API_SWAGGER_JSON], [test -e "$srcdir/pdns/api-swagger.json"])
137 AM_COND_IF([HAVE_API_SWAGGER_JSON],[],[
138 AM_COND_IF([HAVE_VENV],[],[
139 AC_MSG_ERROR([Python 3 and/or venv module are not available, Authoritative Server cannot be built.])
143 AM_CONDITIONAL([HAVE_MANPAGES], [test -e "$srcdir/docs/pdns_server.1"])
144 AM_COND_IF([HAVE_MANPAGES],[],[
145 AM_COND_IF([HAVE_VENV],[],[
146 AC_MSG_WARN([Python 3 and/or venv module are not available, documentation will not be built.])
152 dnl Checks for library functions.
153 dnl the *_r functions are in posix so we can use them unconditionally, but the ext/yahttp code is
154 dnl using the defines.
155 AC_CHECK_FUNCS_ONCE([strcasestr localtime_r gmtime_r recvmmsg sched_setscheduler getrandom arc4random])
157 AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"])
159 AS_IF([test "x$lt_cv_dlopen" = "xno"],
160 [AC_MSG_ERROR([Your system does not support dlopen])]
163 AC_SUBST([LIBDL], [$lt_cv_dlopen_libs])
165 PDNS_ENABLE_VERBOSE_LOGGING
169 AC_SUBST([socketdir])
171 AC_ARG_WITH([socketdir],
172 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
173 [socketdir="$withval"]
176 modules="bind gmysql"
177 AC_ARG_WITH([modules],
178 [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql@:>@])],
183 AC_ARG_WITH([dynmodules],
184 [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])],
185 [dynmodules="$withval"]
188 AC_SUBST([moduledirs])
189 AC_SUBST([moduleobjects])
190 AC_SUBST([modulelibs])
191 AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules])
193 AS_IF([test x"$modules" = "xno"], [modules=""])
194 AS_IF([test x"$dynmodules" = "xno"], [dynmodules=""])
196 for a in $modules $dynmodules; do
215 AS_IF([test "x$enable_unit_tests" = "xyes"],
216 [PDNS_CHECK_CURL_PROGRAM]
218 have_remotebackend=yes
228 dnl Lua has been checked above
238 PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
243 PDNS_WITH_LUA_RECORDS
245 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
248 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
250 AM_CONDITIONAL([LMDB], [test "x$needlmdb" != "x"])
251 AM_CONDITIONAL([HAVE_LMDB], [test "x$LMDB_LIBS" != "x"])
253 AS_IF([test "x$needlmdb" = "xyes"], [
254 AS_IF([test "$with_lmdb" = "no"], [
255 AC_MSG_ERROR([--with-lmdb is set to 'no', but lmdb support is required])
257 AS_IF([test "x$HAVE_LMDB" != "x1"], [
258 AC_MSG_ERROR([lmdb not found via pkg-config, please install lmdb or set --with-lmdb to your lmdb installation directory])
262 AM_CONDITIONAL([CDB], [test "x$needcdb" != "x"])
263 AM_CONDITIONAL([HAVE_CDB], [test "x$CDB_LIBS" != "x"])
265 AS_IF([test "x$needcdb" = "xyes"], [
266 AS_IF([test "x$HAVE_CDB" != "x1"], [
267 AC_MSG_ERROR([cdb not found via pkg-config, please install cdb])
271 for a in $modules; do
272 AC_MSG_CHECKING([whether we can build module "${a}"])
273 if [[ -d "$srcdir/modules/${a}backend" ]]; then
275 moduledirs="$moduledirs ${a}backend"
277 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do
278 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
280 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
283 AC_MSG_ERROR([Do not know how to build module "$a", "$srcdir/modules/${a}backend" does not exist! Please review --with-modules parameter for supported values.])
287 for a in $dynmodules; do
288 AC_MSG_CHECKING([whether we can build dynamic module "${a}"])
289 if [[ -d "$srcdir/modules/${a}backend" ]]; then
291 moduledirs="$moduledirs ${a}backend"
294 AC_MSG_ERROR([Do not know how to build module "$a", "$srcdir/modules/${a}backend" does not exist! Please review --with-dynmodules parameter for supported values.])
299 AX_CHECK_SYSTEMD_FEATURES
300 AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
301 PDNS_WITH_SERVICE_USER([pdns])
303 LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
305 CFLAGS="$PIE_CFLAGS $CFLAGS"
306 CXXFLAGS="$PIE_CFLAGS $CXXFLAGS"
307 PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
308 AC_SUBST([PROGRAM_LDFLAGS])
312 PDNS_ENABLE_SANITIZERS
313 PDNS_ENABLE_MALLOC_TRACE
317 AC_SUBST([AM_CPPFLAGS],
318 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
321 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
322 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
323 AC_SUBST([IPCRYPT_CFLAGS], ['-I$(top_srcdir)/ext/ipcrypt'])
324 AC_SUBST([IPCRYPT_LIBS], ['$(top_builddir)/ext/ipcrypt/libipcrypt.la'])
326 CFLAGS="$SANITIZER_FLAGS $CFLAGS"
327 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
329 CCVERSION=`$CC --version | head -1`
330 CXXVERSION=`$CXX --version | head -1`
332 AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
333 AS_IF([test "x$PACKAGEVERSION" != "x"],
334 [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
337 export moduledirs moduleobjects modulelibs
349 ext/yahttp/yahttp/Makefile
351 modules/bindbackend/Makefile
352 modules/geoipbackend/Makefile
353 modules/gmysqlbackend/Makefile
354 modules/godbcbackend/Makefile
355 modules/gpgsqlbackend/Makefile
356 modules/gsqlite3backend/Makefile
357 modules/ldapbackend/Makefile
358 modules/lmdbbackend/Makefile
359 modules/lua2backend/Makefile
360 modules/pipebackend/Makefile
361 modules/remotebackend/Makefile
362 modules/tinydnsbackend/Makefile
367 AC_MSG_NOTICE([Configuration summary])
368 AC_MSG_NOTICE([=====================])
370 AC_MSG_NOTICE([Configured with: $pdns_configure_args])
372 AC_MSG_NOTICE([CC: $CC ($CCVERSION)])
373 AC_MSG_NOTICE([CXX: $CXX ($CXXVERSION)])
374 AC_MSG_NOTICE([LD: $LD])
375 AC_MSG_NOTICE([CFLAGS: $CFLAGS])
376 AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
377 AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
378 AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
379 AC_MSG_NOTICE([LIBS: $LIBS])
380 AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
382 AC_MSG_NOTICE([Extras enabled])
383 AC_MSG_NOTICE([--------------])
384 AS_IF([test "x$enable_tools" = "xyes"],
385 [AC_MSG_NOTICE([Tools: yes])],
386 [AC_MSG_NOTICE([Tools: no])]
388 AS_IF([test "x$enable_ixfrdist" = "xyes"],
389 [AC_MSG_NOTICE([ixfrdist: yes])],
390 [AC_MSG_NOTICE([ixfrdist: no])]
393 AC_MSG_NOTICE([Server Features enabled])
394 AC_MSG_NOTICE([-----------------------])
395 AC_MSG_NOTICE([Built-in modules: $modules])
396 AC_MSG_NOTICE([Dynamic modules: $dynmodules])
398 AS_IF([test "x$libcrypto_ecdsa" = "xyes"],
399 [AC_MSG_NOTICE([OpenSSL ecdsa: yes])],
400 [AC_MSG_NOTICE([OpenSSL ecdsa: no])]
402 AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed25519" = "xyes"],
403 [AC_MSG_NOTICE([ed25519: yes])],
404 [AC_MSG_NOTICE([ed25519: no])]
406 AS_IF([test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed448" = "xyes"],
407 [AC_MSG_NOTICE([ed448: yes])],
408 [AC_MSG_NOTICE([ed448: no])]
410 AS_IF([test "x$needsqlite3" != "x"],
411 [AC_MSG_NOTICE([SQLite3: yes])],
412 [AC_MSG_NOTICE([SQLite3: no])]
414 AS_IF([test "x$LUAPC" != "x"],
415 [AC_MSG_NOTICE([Lua: $LUAPC])],
416 [AS_IF([test "x$LUAJITPC" != "x"],
417 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
418 [AC_MSG_NOTICE([Lua/LuaJit: no])])
420 AS_IF([test "x$enable_experimental_pkcs11" = "xyes"],
421 [AC_MSG_NOTICE([PKCS-11: yes])]
423 AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"],
424 [AC_MSG_NOTICE([GSS-TSIG: yes])]
426 AS_IF([test "x$enable_lua_records" = "xyes"],
427 [AC_MSG_NOTICE([LUA records: yes])]
429 AS_IF([test "x$systemd" != "xn"],
430 [AC_MSG_NOTICE([systemd: yes])],
431 [AC_MSG_NOTICE([systemd: no])]
433 AS_IF([test "x$enable_remotebackend_zeromq" != "xno"],
434 [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])]
436 AS_IF([test -n "$GEOIP_LIBS"],
437 [AC_MSG_NOTICE([libgeoip for geoipbackend: yes])]
439 AS_IF([test -n "$MMDB_LIBS"],
440 [AC_MSG_NOTICE([libmaxminddb for geoipbackend: yes])]