3 AC_INIT([pdns], m4_esyscmd([build-aux/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])
49 AX_CXX_COMPILE_STDCXX_11
51 AC_MSG_CHECKING([whether we will enable compiler security checks])
52 AC_ARG_ENABLE([hardening],
53 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
54 [enable_hardening=$enableval],
55 [enable_hardening=yes]
57 AC_MSG_RESULT([$enable_hardening])
59 AS_IF([test "x$enable_hardening" != "xno"], [
62 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
63 AC_CC_D_FORTIFY_SOURCE
69 PDNS_CHECK_NETWORK_LIBS
72 LT_INIT([disable-static dlopen])
77 # Define full_libdir to be the fully expanded (${exec_prefix}, etc.)
78 # "system" library path.
79 # We use this to search for other libraries.
80 eval full_libdir="\"$libdir\""
82 # detect pkg-config explicitly
89 [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
105 PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
106 PDNS_CHECK_CLOCK_GETTIME
108 BOOST_REQUIRE([1.35])
109 # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+
110 # to be compatible with C++11
111 AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148])
113 BOOST_PROGRAM_OPTIONS([mt])
114 AS_IF([test "$boost_cv_lib_program_options" = "no"], [
115 AC_MSG_ERROR([Boost Program Options library not found])
117 PDNS_ENABLE_UNIT_TESTS
118 PDNS_ENABLE_BACKEND_UNIT_TESTS
119 PDNS_ENABLE_REPRODUCIBLE
123 PDNS_CHECK_VIRTUALENV
126 dnl Checks for library functions.
127 AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg getrandom arc4random])
129 AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"])
131 AS_IF([test "x$lt_cv_dlopen" = "xno"],
132 [AC_MSG_ERROR([Your system does not support dlopen])]
135 AC_SUBST([LIBDL], [$lt_cv_dlopen_libs])
137 PDNS_ENABLE_VERBOSE_LOGGING
141 AC_SUBST([socketdir])
143 AC_ARG_WITH([socketdir],
144 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
145 [socketdir="$withval"]
148 modules="bind gmysql random"
149 AC_ARG_WITH([modules],
150 [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])],
155 AC_ARG_WITH([dynmodules],
156 [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])],
157 [dynmodules="$withval"]
160 AC_SUBST([moduledirs])
161 AC_SUBST([moduleobjects])
162 AC_SUBST([modulelibs])
163 AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules])
165 AS_IF([test x"$modules" = "xno"], [modules=""])
166 AS_IF([test x"$dynmodules" = "xno"], [dynmodules=""])
168 for a in $modules $dynmodules; do
194 AS_IF([test "x$enable_unit_tests" = "xyes"],
195 [PDNS_CHECK_CURL_PROGRAM]
197 have_remotebackend=yes
206 AS_IF([test "x$with_lua" = "xno"],
207 [AC_MSG_ERROR([${a} backend needs lua, run ./configure --with-lua])]
209 AS_IF([test "x$LUAPC" = "x"],
210 [AC_MSG_ERROR([${a} backend needs lua but we cannot find it])]
216 PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
218 AC_MSG_CHECKING([whether we will be building and installing the extra tools])
219 AC_ARG_ENABLE([tools],
220 [AS_HELP_STRING([--enable-tools], [if we should build and install the tools @<:@default=no@:>@])],
221 [enable_tools=$enableval],
225 AC_MSG_RESULT([$enable_tools])
226 AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"])
230 PDNS_WITH_LUA_RECORDS
232 AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"])
234 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
237 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
239 for a in $modules; do
240 AC_MSG_CHECKING([whether we can build module "${a}"])
241 if [[ -d "$srcdir/modules/${a}backend" ]]; then
243 moduledirs="$moduledirs ${a}backend"
245 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do
246 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
248 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
251 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.])
255 for a in $dynmodules; do
256 AC_MSG_CHECKING([whether we can build dynamic module "${a}"])
257 if [[ -d "$srcdir/modules/${a}backend" ]]; then
259 moduledirs="$moduledirs ${a}backend"
262 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.])
267 AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
269 LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
271 CFLAGS="$PIE_CFLAGS $CFLAGS"
272 CXXFLAGS="$PIE_CFLAGS $CXXFLAGS"
273 PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
274 AC_SUBST([PROGRAM_LDFLAGS])
277 PDNS_ENABLE_SANITIZERS
278 PDNS_ENABLE_MALLOC_TRACE
282 AC_SUBST([AM_CPPFLAGS],
283 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
286 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
287 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
289 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
291 AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
292 AS_IF([test "x$PACKAGEVERSION" != "x"],
293 [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
296 export moduledirs moduleobjects modulelibs
307 ext/yahttp/yahttp/Makefile
309 modules/bindbackend/Makefile
310 modules/geoipbackend/Makefile
311 modules/gmysqlbackend/Makefile
312 modules/godbcbackend/Makefile
313 modules/goraclebackend/Makefile
314 modules/gpgsqlbackend/Makefile
315 modules/gsqlite3backend/Makefile
316 modules/ldapbackend/Makefile
317 modules/luabackend/Makefile
318 modules/lua2backend/Makefile
319 modules/mydnsbackend/Makefile
320 modules/opendbxbackend/Makefile
321 modules/oraclebackend/Makefile
322 modules/pipebackend/Makefile
323 modules/randombackend/Makefile
324 modules/remotebackend/Makefile
325 modules/tinydnsbackend/Makefile
330 AC_MSG_NOTICE([Configuration summary])
331 AC_MSG_NOTICE([=====================])
333 AC_MSG_NOTICE([Configured with: $pdns_configure_args])
335 AC_MSG_NOTICE([CC: $CC])
336 AC_MSG_NOTICE([CXX: $CXX])
337 AC_MSG_NOTICE([LD: $LD])
338 AC_MSG_NOTICE([CFLAGS: $CFLAGS])
339 AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
340 AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
341 AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
342 AC_MSG_NOTICE([LIBS: $LIBS])
343 AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
345 AC_MSG_NOTICE([Features enabled])
346 AC_MSG_NOTICE([----------------])
347 AC_MSG_NOTICE([Built-in modules: $modules])
348 AC_MSG_NOTICE([Dynamic modules: $dynmodules])
350 AS_IF([test "x$libcrypto_ecdsa" = "xyes"],
351 [AC_MSG_NOTICE([OpenSSL ecdsa: yes])],
352 [AC_MSG_NOTICE([OpenSSL ecdsa: no])]
354 AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x"],
355 [AC_MSG_NOTICE([ed25519: yes])],
356 [AC_MSG_NOTICE([ed25519: no])]
358 AS_IF([test "x$LIBDECAF_LIBS" != "x"],
359 [AC_MSG_NOTICE([ed448: yes])],
360 [AC_MSG_NOTICE([ed448: no])]
362 AS_IF([test "x$BOTAN_LIBS" != "x"],
363 [AC_MSG_NOTICE([gost: yes])],
364 [AC_MSG_NOTICE([gost: no])]
366 AS_IF([test "x$needsqlite3" != "x"],
367 [AC_MSG_NOTICE([SQLite3: yes])],
368 [AC_MSG_NOTICE([SQLite3: no])]
370 AS_IF([test "x$LUAPC" != "x"],
371 [AC_MSG_NOTICE([Lua: $LUAPC])],
372 [AS_IF([test "x$LUAJITPC" != "x"],
373 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
374 [AC_MSG_NOTICE([Lua/LuaJit: no])])
376 AS_IF([test "x$enable_experimental_pkcs11" = "xyes"],
377 [AC_MSG_NOTICE([PKCS-11: yes])]
379 AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"],
380 [AC_MSG_NOTICE([GSS-TSIG: yes])]
382 AS_IF([test "x$systemd" != "xn"],
383 [AC_MSG_NOTICE([systemd: yes])],
384 [AC_MSG_NOTICE([systemd: no])]
386 AS_IF([test "x$enable_remotebackend_zeromq" != "xno"],
387 [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])]