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])
47 AS_IF([test "x$with_luajit" = "xno"], [
52 AX_CXX_COMPILE_STDCXX_11
54 AC_MSG_CHECKING([whether we will enable compiler security checks])
55 AC_ARG_ENABLE([hardening],
56 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
57 [enable_hardening=$enableval],
58 [enable_hardening=yes]
60 AC_MSG_RESULT([$enable_hardening])
62 AS_IF([test "x$enable_hardening" != "xno"], [
65 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
66 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
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_REPRODUCIBLE
125 dnl Checks for library functions.
126 AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg])
128 AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"])
130 AS_IF([test "x$lt_cv_dlopen" = "xno"],
131 [AC_MSG_ERROR([Your system does not support dlopen])]
134 AC_SUBST([LIBDL], [$lt_cv_dlopen_libs])
136 PDNS_ENABLE_VERBOSE_LOGGING
140 modules="bind gmysql random"
141 AC_ARG_WITH([modules],
142 [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])],
147 AC_ARG_WITH([dynmodules],
148 [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])],
149 [dynmodules="$withval"]
152 AC_SUBST([socketdir])
154 AC_ARG_WITH([socketdir],
155 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
156 [socketdir="$withval"]
159 AC_SUBST([moduledirs])
160 AC_SUBST([moduleobjects])
161 AC_SUBST([modulelibs])
162 AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules])
164 AC_MSG_CHECKING([whether we will be building the server])
165 AC_ARG_ENABLE([pdns-server],
166 [AS_HELP_STRING([--enable-pdns_server], [if we should build the server @<:@default=yes@:>@])],
167 [enable_pdns_server=$enableval],
168 [enable_pdns_server=yes]
170 AC_MSG_RESULT([$enable_pdns_server])
171 AM_CONDITIONAL([WITH_PDNS_SERVER], [test "x$enable_pdns_server" != "xno"])
173 AC_ARG_ENABLE([gcc-skip-locking],
174 [AS_HELP_STRING([--enable-gcc-skip-locking], [if we should forcefully skip gcc locking @<:@default=no@:>@])],
175 [AC_DEFINE(GCC_SKIP_LOCKING,[], [Skip gcc locking])],
178 AC_MSG_CHECKING([whether we will be building and installing the extra tools])
179 AC_ARG_ENABLE([tools],
180 [AS_HELP_STRING([--enable-tools], [if we should build and install the tools @<:@default=no@:>@])],
181 [enable_tools=$enableval],
185 AC_MSG_RESULT([$enable_tools])
186 AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"])
190 for a in $modules $dynmodules; do
216 AS_IF([test "x$enable_unit_tests" = "xyes"],
217 [PDNS_CHECK_CURL_PROGRAM]
219 have_remotebackend=yes
228 AS_IF([test "x$with_lua" = "xno"],
229 AC_MSG_ERROR([Lua backend needs lua, run ./configure --with-lua])
231 AS_IF([test "x$LUAPC" = "x"],
232 AC_MSG_ERROR([Lua backend needs lua but we cannot find it])
238 PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
240 AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"])
242 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
245 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
247 for a in $modules; do
248 AC_MSG_CHECKING([whether we can build module "${a}"])
249 if [[ -d "$srcdir/modules/${a}backend" ]]; then
251 moduledirs="$moduledirs ${a}backend"
253 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do
254 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
256 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
259 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.])
263 for a in $dynmodules; do
264 AC_MSG_CHECKING([whether we can build dynamic module "${a}"])
265 if [[ -d "$srcdir/modules/${a}backend" ]]; then
267 moduledirs="$moduledirs ${a}backend"
270 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.])
275 AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
277 LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
279 CFLAGS="$PIE_CFLAGS $CFLAGS"
280 CXXFLAGS="$PIE_CFLAGS $CXXFLAGS"
281 PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
282 AC_SUBST([PROGRAM_LDFLAGS])
285 PDNS_ENABLE_SANITIZERS
286 PDNS_ENABLE_MALLOC_TRACE
290 AC_SUBST([AM_CPPFLAGS],
291 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
294 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
295 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
297 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
299 AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
300 AS_IF([test "x$PACKAGEVERSION" != "x"],
301 [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
304 export moduledirs moduleobjects modulelibs
315 ext/yahttp/yahttp/Makefile
317 modules/bindbackend/Makefile
318 modules/geoipbackend/Makefile
319 modules/gmysqlbackend/Makefile
320 modules/godbcbackend/Makefile
321 modules/goraclebackend/Makefile
322 modules/gpgsqlbackend/Makefile
323 modules/gsqlite3backend/Makefile
324 modules/ldapbackend/Makefile
325 modules/luabackend/Makefile
326 modules/mydnsbackend/Makefile
327 modules/opendbxbackend/Makefile
328 modules/oraclebackend/Makefile
329 modules/pipebackend/Makefile
330 modules/randombackend/Makefile
331 modules/remotebackend/Makefile
332 modules/tinydnsbackend/Makefile
337 AC_MSG_NOTICE([Configuration summary])
338 AC_MSG_NOTICE([=====================])
340 AC_MSG_NOTICE([Configured with: $pdns_configure_args])
342 AC_MSG_NOTICE([CC: $CC])
343 AC_MSG_NOTICE([CXX: $CXX])
344 AC_MSG_NOTICE([LD: $LD])
345 AC_MSG_NOTICE([CFLAGS: $CFLAGS])
346 AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
347 AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
348 AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
349 AC_MSG_NOTICE([LIBS: $LIBS])
350 AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
352 AC_MSG_NOTICE([Features enabled])
353 AC_MSG_NOTICE([----------------])
354 AC_MSG_NOTICE([Built-in modules: $modules])
355 AC_MSG_NOTICE([Dynamic modules: $dynmodules])
357 AS_IF([test "x$libcrypto_ecdsa" = "xyes"],
358 [AC_MSG_NOTICE([OpenSSL ecdsa: yes])],
359 [AC_MSG_NOTICE([OpenSSL ecdsa: no])]
361 AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x"],
362 [AC_MSG_NOTICE([ed25519: yes])],
363 [AC_MSG_NOTICE([ed25519: no])]
365 AS_IF([test "x$LIBDECAF_LIBS" != "x"],
366 [AC_MSG_NOTICE([ed448: yes])],
367 [AC_MSG_NOTICE([ed448: no])]
369 AS_IF([test "x$BOTAN_LIBS" != "x"],
370 [AC_MSG_NOTICE([gost: yes])],
371 [AC_MSG_NOTICE([gost: no])]
373 AS_IF([test "x$needsqlite3" != "x"],
374 [AC_MSG_NOTICE([SQLite3: yes])],
375 [AC_MSG_NOTICE([SQLite3: no])]
377 AS_IF([test "x$LUAPC" != "x"],
378 [AC_MSG_NOTICE([Lua: $LUAPC])],
379 [AS_IF([test "x$LUAJITPC" != "x"],
380 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
381 [AC_MSG_NOTICE([Lua/LuaJit: no])])
383 AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"],
384 [AC_MSG_NOTICE([GSS-TSIG: yes])]
386 AS_IF([test "x$systemd" != "xn"],
387 [AC_MSG_NOTICE([systemd: yes])],
388 [AC_MSG_NOTICE([systemd: no])]
390 AS_IF([test "x$enable_remotebackend_zeromq" != "xno"],
391 [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])]