3 AC_INIT([pdns], m4_esyscmd([builder-support/gen-version]))
5 AC_CONFIG_SRCDIR([pdns/receiver.cc])
6 AC_CONFIG_MACRO_DIR([m4])
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_AUX_DIR([build-aux])
10 AC_SUBST([pdns_configure_args], ["$ac_configure_args"])
11 AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],
12 ["$pdns_configure_args"],
13 [pdns configure arguments]
16 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar -Wno-portability subdir-objects parallel-tests 1.11])
17 AM_SILENT_RULES([yes])
20 : ${CFLAGS="-Wall -g -O2"}
21 : ${CXXFLAGS="-Wall -g -O2"}
31 AS_IF([test "x$CXX" = "xno" || test "x$CXX:x$GXX" = "xg++:x"],
32 [AC_MSG_ERROR([no C++ compiler found])]
37 AC_DEFINE([_GNU_SOURCE], [1],
38 [Define _GNU_SOURCE so that we get all necessary prototypes]
41 # Warn when pkg.m4 is missing
42 m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config])
50 AX_CXX_COMPILE_STDCXX_11
52 AC_MSG_CHECKING([whether we will enable compiler security checks])
53 AC_ARG_ENABLE([hardening],
54 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
55 [enable_hardening=$enableval],
56 [enable_hardening=yes]
58 AC_MSG_RESULT([$enable_hardening])
60 AS_IF([test "x$enable_hardening" != "xno"], [
63 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
64 AC_CC_D_FORTIFY_SOURCE
70 PDNS_CHECK_NETWORK_LIBS
73 LT_INIT([disable-static dlopen])
78 # Define full_libdir to be the fully expanded (${exec_prefix}, etc.)
79 # "system" library path.
80 # We use this to search for other libraries.
81 eval full_libdir="\"$libdir\""
83 # detect pkg-config explicitly
90 [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])],
98 PDNS_CHECK_LIBCRYPTO([
100 AC_MSG_ERROR([OpenSSL/libcrypto not found])
103 PDNS_CHECK_LIBCRYPTO_ECDSA
104 PDNS_CHECK_LIBCRYPTO_EDDSA
106 PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
107 PDNS_CHECK_CLOCK_GETTIME
109 BOOST_REQUIRE([1.35])
110 # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+
111 # to be compatible with C++11
112 AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148])
113 AS_IF([test "$boost_major_version" -ge 148], [
114 AC_DEFINE(HAVE_BOOST_GE_148, [1], [Define to 1 if you have boost >= 1.48])
117 BOOST_PROGRAM_OPTIONS([mt])
118 AS_IF([test "$boost_cv_lib_program_options" = "no"], [
119 AC_MSG_ERROR([Boost Program Options library not found])
121 PDNS_ENABLE_UNIT_TESTS
122 PDNS_ENABLE_BACKEND_UNIT_TESTS
123 PDNS_ENABLE_REPRODUCIBLE
124 PDNS_ENABLE_FUZZ_TARGETS
128 PDNS_CHECK_VIRTUALENV
131 dnl Checks for library functions.
132 AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg getrandom arc4random])
134 AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"])
136 AS_IF([test "x$lt_cv_dlopen" = "xno"],
137 [AC_MSG_ERROR([Your system does not support dlopen])]
140 AC_SUBST([LIBDL], [$lt_cv_dlopen_libs])
142 PDNS_ENABLE_VERBOSE_LOGGING
146 AC_SUBST([socketdir])
148 AC_ARG_WITH([socketdir],
149 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
150 [socketdir="$withval"]
153 modules="bind gmysql random"
154 AC_ARG_WITH([modules],
155 [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])],
160 AC_ARG_WITH([dynmodules],
161 [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])],
162 [dynmodules="$withval"]
165 AC_SUBST([moduledirs])
166 AC_SUBST([moduleobjects])
167 AC_SUBST([modulelibs])
168 AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules])
170 AS_IF([test x"$modules" = "xno"], [modules=""])
171 AS_IF([test x"$dynmodules" = "xno"], [dynmodules=""])
173 for a in $modules $dynmodules; do
199 AS_IF([test "x$enable_unit_tests" = "xyes"],
200 [PDNS_CHECK_CURL_PROGRAM]
202 have_remotebackend=yes
211 AS_IF([test "x$with_lua" = "xno"],
212 [AC_MSG_ERROR([${a} backend needs lua, run ./configure --with-lua])]
214 AS_IF([test "x$LUAPC" = "x"],
215 [AC_MSG_ERROR([${a} backend needs lua but we cannot find it])]
225 PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
227 AC_MSG_CHECKING([whether we will be building and installing the extra tools])
228 AC_ARG_ENABLE([tools],
229 [AS_HELP_STRING([--enable-tools], [if we should build and install the tools @<:@default=no@:>@])],
230 [enable_tools=$enableval],
234 AC_MSG_RESULT([$enable_tools])
235 AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"])
240 PDNS_WITH_LUA_RECORDS
242 AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"])
244 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
247 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
249 for a in $modules; do
250 AC_MSG_CHECKING([whether we can build module "${a}"])
251 if [[ -d "$srcdir/modules/${a}backend" ]]; then
253 moduledirs="$moduledirs ${a}backend"
255 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do
256 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
258 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
261 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.])
265 for a in $dynmodules; do
266 AC_MSG_CHECKING([whether we can build dynamic module "${a}"])
267 if [[ -d "$srcdir/modules/${a}backend" ]]; then
269 moduledirs="$moduledirs ${a}backend"
272 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.])
277 AX_CHECK_SYSTEMD_FEATURES
278 AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
280 LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
282 CFLAGS="$PIE_CFLAGS $CFLAGS"
283 CXXFLAGS="$PIE_CFLAGS $CXXFLAGS"
284 PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
285 AC_SUBST([PROGRAM_LDFLAGS])
288 PDNS_ENABLE_SANITIZERS
289 PDNS_ENABLE_MALLOC_TRACE
293 AC_SUBST([AM_CPPFLAGS],
294 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
297 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
298 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
300 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
302 AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
303 AS_IF([test "x$PACKAGEVERSION" != "x"],
304 [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
307 export moduledirs moduleobjects modulelibs
318 ext/yahttp/yahttp/Makefile
320 modules/bindbackend/Makefile
321 modules/geoipbackend/Makefile
322 modules/gmysqlbackend/Makefile
323 modules/godbcbackend/Makefile
324 modules/goraclebackend/Makefile
325 modules/gpgsqlbackend/Makefile
326 modules/gsqlite3backend/Makefile
327 modules/ldapbackend/Makefile
328 modules/lmdbbackend/Makefile
329 modules/luabackend/Makefile
330 modules/lua2backend/Makefile
331 modules/mydnsbackend/Makefile
332 modules/opendbxbackend/Makefile
333 modules/oraclebackend/Makefile
334 modules/pipebackend/Makefile
335 modules/randombackend/Makefile
336 modules/remotebackend/Makefile
337 modules/tinydnsbackend/Makefile
342 AC_MSG_NOTICE([Configuration summary])
343 AC_MSG_NOTICE([=====================])
345 AC_MSG_NOTICE([Configured with: $pdns_configure_args])
347 AC_MSG_NOTICE([CC: $CC])
348 AC_MSG_NOTICE([CXX: $CXX])
349 AC_MSG_NOTICE([LD: $LD])
350 AC_MSG_NOTICE([CFLAGS: $CFLAGS])
351 AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
352 AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
353 AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
354 AC_MSG_NOTICE([LIBS: $LIBS])
355 AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
357 AC_MSG_NOTICE([Features enabled])
358 AC_MSG_NOTICE([----------------])
359 AC_MSG_NOTICE([Built-in modules: $modules])
360 AC_MSG_NOTICE([Dynamic modules: $dynmodules])
362 AS_IF([test "x$libcrypto_ecdsa" = "xyes"],
363 [AC_MSG_NOTICE([OpenSSL ecdsa: yes])],
364 [AC_MSG_NOTICE([OpenSSL ecdsa: no])]
366 AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed25519" = "xyes"],
367 [AC_MSG_NOTICE([ed25519: yes])],
368 [AC_MSG_NOTICE([ed25519: no])]
370 AS_IF([test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed448" = "xyes"],
371 [AC_MSG_NOTICE([ed448: yes])],
372 [AC_MSG_NOTICE([ed448: no])]
374 AS_IF([test "x$needsqlite3" != "x"],
375 [AC_MSG_NOTICE([SQLite3: yes])],
376 [AC_MSG_NOTICE([SQLite3: no])]
378 AS_IF([test "x$LUAPC" != "x"],
379 [AC_MSG_NOTICE([Lua: $LUAPC])],
380 [AS_IF([test "x$LUAJITPC" != "x"],
381 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
382 [AC_MSG_NOTICE([Lua/LuaJit: no])])
384 AS_IF([test "x$enable_experimental_pkcs11" = "xyes"],
385 [AC_MSG_NOTICE([PKCS-11: yes])]
387 AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"],
388 [AC_MSG_NOTICE([GSS-TSIG: yes])]
390 AS_IF([test "x$systemd" != "xn"],
391 [AC_MSG_NOTICE([systemd: yes])],
392 [AC_MSG_NOTICE([systemd: no])]
394 AS_IF([test "x$enable_remotebackend_zeromq" != "xno"],
395 [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])]