]> git.ipfire.org Git - thirdparty/pdns.git/blob - configure.ac
ixfrdist: Load configuration from yaml file
[thirdparty/pdns.git] / configure.ac
1 AC_PREREQ([2.61])
2
3 AC_INIT([pdns], m4_esyscmd([build-aux/gen-version]))
4
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])
9
10 AC_SUBST([pdns_configure_args], ["$ac_configure_args"])
11 AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],
12 ["$pdns_configure_args"],
13 [pdns configure arguments]
14 )
15
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])
18
19 AC_CANONICAL_HOST
20 : ${CFLAGS="-Wall -g -O2"}
21 : ${CXXFLAGS="-Wall -g -O2"}
22
23 AC_PROG_CC
24 AM_PROG_CC_C_O
25 PDNS_CHECK_BISON
26 PDNS_CHECK_FLEX
27 AC_PROG_INSTALL
28 AC_PROG_MAKE_SET
29
30 AC_PROG_CXX
31 AS_IF([test "x$CXX" = "xno" || test "x$CXX:x$GXX" = "xg++:x"],
32 [AC_MSG_ERROR([no C++ compiler found])]
33 )
34
35 AC_LANG([C++])
36
37 AC_DEFINE([_GNU_SOURCE], [1],
38 [Define _GNU_SOURCE so that we get all necessary prototypes]
39 )
40
41 # Warn when pkg.m4 is missing
42 m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config])
43
44 PDNS_CHECK_OS
45
46 PDNS_WITH_LUA
47 PDNS_CHECK_LUA_HPP
48
49 AX_CXX_COMPILE_STDCXX_11
50
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]
56 )
57 AC_MSG_RESULT([$enable_hardening])
58
59 AS_IF([test "x$enable_hardening" != "xno"], [
60 AC_CC_PIE
61 AC_CC_STACK_PROTECTOR
62 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
63 AC_CC_D_FORTIFY_SOURCE
64 AC_LD_RELRO
65 ])
66
67 PDNS_ENABLE_KISS
68
69 PDNS_CHECK_NETWORK_LIBS
70
71 LT_PREREQ([2.2.2])
72 LT_INIT([disable-static dlopen])
73
74
75 MC_TM_GMTOFF
76
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\""
81
82 # detect pkg-config explicitly
83 PKG_PROG_PKG_CONFIG
84
85 AC_CHECK_HEADERS(
86 [sys/mman.h],
87 [AC_CHECK_FUNC(
88 [mmap],
89 [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])],
90 [have_mmap=no]
91 )],
92 [have_mmap=no]
93 )
94
95 PDNS_ENABLE_BOTAN
96 PDNS_CHECK_LIBSODIUM
97 PDNS_CHECK_LIBDECAF
98 PDNS_CHECK_LIBCRYPTO([
99 ],[
100 AC_MSG_ERROR([OpenSSL/libcrypto not found])
101 ]
102 )
103 PDNS_CHECK_LIBCRYPTO_ECDSA
104
105 PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
106 PDNS_CHECK_CLOCK_GETTIME
107
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])
112
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])
116 ])
117 PDNS_ENABLE_UNIT_TESTS
118 PDNS_ENABLE_BACKEND_UNIT_TESTS
119 PDNS_ENABLE_REPRODUCIBLE
120
121 PDNS_WITH_SQLITE3
122
123 PDNS_CHECK_VIRTUALENV
124 PDNS_FROM_GIT
125
126 dnl Checks for library functions.
127 AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg getrandom arc4random])
128
129 AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"])
130
131 AS_IF([test "x$lt_cv_dlopen" = "xno"],
132 [AC_MSG_ERROR([Your system does not support dlopen])]
133 )
134
135 AC_SUBST([LIBDL], [$lt_cv_dlopen_libs])
136
137 PDNS_ENABLE_VERBOSE_LOGGING
138 PDNS_ENABLE_PKCS11
139 PDNS_ENABLE_GSS_TSIG
140
141 AC_SUBST([socketdir])
142 socketdir="/var/run"
143 AC_ARG_WITH([socketdir],
144 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
145 [socketdir="$withval"]
146 )
147
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@:>@])],
151 [modules="$withval"]
152 )
153
154 dynmodules="pipe"
155 AC_ARG_WITH([dynmodules],
156 [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])],
157 [dynmodules="$withval"]
158 )
159
160 AC_SUBST([moduledirs])
161 AC_SUBST([moduleobjects])
162 AC_SUBST([modulelibs])
163 AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules])
164
165 AS_IF([test x"$modules" = "xno"], [modules=""])
166 AS_IF([test x"$dynmodules" = "xno"], [dynmodules=""])
167
168 for a in $modules $dynmodules; do
169 case "$a" in
170 oracle|goracle)
171 PDNS_WITH_ORACLE
172 needoracle=yes
173 ;;
174 godbc)
175 PDNS_WITH_UNIXODBC
176 ;;
177 mydns|gmysql|pdns)
178 PDNS_WITH_MYSQL
179 ;;
180 gpgsql)
181 PDNS_WITH_POSTGRESQL
182 ;;
183 gsqlite3)
184 needsqlite3=yes
185 ;;
186 ldap)
187 PDNS_CHECK_LDAP
188 needldap=yes
189 ;;
190 opendbx)
191 PDNS_CHECK_OPENDBX
192 ;;
193 remote)
194 AS_IF([test "x$enable_unit_tests" = "xyes"],
195 [PDNS_CHECK_CURL_PROGRAM]
196 )
197 have_remotebackend=yes
198 ;;
199 tinydns)
200 PDNS_CHECK_CDB
201 ;;
202 geoip)
203 PDNS_CHECK_GEOIP
204 ;;
205 lua*)
206 AS_IF([test "x$with_lua" = "xno"],
207 [AC_MSG_ERROR([${a} backend needs lua, run ./configure --with-lua])]
208 )
209 AS_IF([test "x$LUAPC" = "x"],
210 [AC_MSG_ERROR([${a} backend needs lua but we cannot find it])]
211 )
212 ;;
213 esac
214 done
215
216 PDNS_ENABLE_REMOTEBACKEND_ZEROMQ
217
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],
222 [enable_tools=no]
223 )
224
225 AC_MSG_RESULT([$enable_tools])
226 AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"])
227 AS_IF([test "x$enable_tools" != "xno"], [
228 PKG_CHECK_MODULES([YAML], [yaml-cpp >= 0.5],[],
229 AC_MSG_ERROR([Could not find yaml-cpp])
230 )]
231 )
232
233 PDNS_WITH_PROTOBUF
234
235 PDNS_WITH_LUA_RECORDS
236
237 AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"])
238
239 AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"])
240
241 PDNS_CHECK_SQLITE3
242 AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"])
243
244 for a in $modules; do
245 AC_MSG_CHECKING([whether we can build module "${a}"])
246 if [[ -d "$srcdir/modules/${a}backend" ]]; then
247 AC_MSG_RESULT([yes])
248 moduledirs="$moduledirs ${a}backend"
249
250 for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do
251 moduleobjects="$moduleobjects ../modules/${a}backend/$b"
252 done
253 modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`"
254 else
255 AC_MSG_RESULT([no])
256 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.])
257 fi
258 done
259
260 for a in $dynmodules; do
261 AC_MSG_CHECKING([whether we can build dynamic module "${a}"])
262 if [[ -d "$srcdir/modules/${a}backend" ]]; then
263 AC_MSG_RESULT([yes])
264 moduledirs="$moduledirs ${a}backend"
265 else
266 AC_MSG_RESULT([no])
267 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.])
268 fi
269 done
270
271 AX_AVAILABLE_SYSTEMD
272 AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
273
274 LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
275
276 CFLAGS="$PIE_CFLAGS $CFLAGS"
277 CXXFLAGS="$PIE_CFLAGS $CXXFLAGS"
278 PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
279 AC_SUBST([PROGRAM_LDFLAGS])
280
281 PDNS_ENABLE_COVERAGE
282 PDNS_ENABLE_SANITIZERS
283 PDNS_ENABLE_MALLOC_TRACE
284
285 AC_SUBST(LIBS)
286
287 AC_SUBST([AM_CPPFLAGS],
288 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
289 )
290
291 AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
292 AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
293
294 CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS"
295
296 AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
297 AS_IF([test "x$PACKAGEVERSION" != "x"],
298 [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
299 )
300
301 export moduledirs moduleobjects modulelibs
302
303 AC_CONFIG_FILES([
304 Makefile
305 modules/Makefile
306 pdns/Makefile
307 codedocs/Makefile
308 docs/Makefile
309 pdns/pdns.init
310 ext/Makefile
311 ext/yahttp/Makefile
312 ext/yahttp/yahttp/Makefile
313 ext/json11/Makefile
314 modules/bindbackend/Makefile
315 modules/geoipbackend/Makefile
316 modules/gmysqlbackend/Makefile
317 modules/godbcbackend/Makefile
318 modules/goraclebackend/Makefile
319 modules/gpgsqlbackend/Makefile
320 modules/gsqlite3backend/Makefile
321 modules/ldapbackend/Makefile
322 modules/luabackend/Makefile
323 modules/lua2backend/Makefile
324 modules/mydnsbackend/Makefile
325 modules/opendbxbackend/Makefile
326 modules/oraclebackend/Makefile
327 modules/pipebackend/Makefile
328 modules/randombackend/Makefile
329 modules/remotebackend/Makefile
330 modules/tinydnsbackend/Makefile
331 ])
332 AC_OUTPUT
333
334 AC_MSG_NOTICE([])
335 AC_MSG_NOTICE([Configuration summary])
336 AC_MSG_NOTICE([=====================])
337 AC_MSG_NOTICE([])
338 AC_MSG_NOTICE([Configured with: $pdns_configure_args])
339 AC_MSG_NOTICE([])
340 AC_MSG_NOTICE([CC: $CC])
341 AC_MSG_NOTICE([CXX: $CXX])
342 AC_MSG_NOTICE([LD: $LD])
343 AC_MSG_NOTICE([CFLAGS: $CFLAGS])
344 AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
345 AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
346 AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
347 AC_MSG_NOTICE([LIBS: $LIBS])
348 AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
349 AC_MSG_NOTICE([])
350 AC_MSG_NOTICE([Features enabled])
351 AC_MSG_NOTICE([----------------])
352 AC_MSG_NOTICE([Built-in modules: $modules])
353 AC_MSG_NOTICE([Dynamic modules: $dynmodules])
354 AC_MSG_NOTICE([])
355 AS_IF([test "x$libcrypto_ecdsa" = "xyes"],
356 [AC_MSG_NOTICE([OpenSSL ecdsa: yes])],
357 [AC_MSG_NOTICE([OpenSSL ecdsa: no])]
358 )
359 AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x"],
360 [AC_MSG_NOTICE([ed25519: yes])],
361 [AC_MSG_NOTICE([ed25519: no])]
362 )
363 AS_IF([test "x$LIBDECAF_LIBS" != "x"],
364 [AC_MSG_NOTICE([ed448: yes])],
365 [AC_MSG_NOTICE([ed448: no])]
366 )
367 AS_IF([test "x$BOTAN_LIBS" != "x"],
368 [AC_MSG_NOTICE([gost: yes])],
369 [AC_MSG_NOTICE([gost: no])]
370 )
371 AS_IF([test "x$needsqlite3" != "x"],
372 [AC_MSG_NOTICE([SQLite3: yes])],
373 [AC_MSG_NOTICE([SQLite3: no])]
374 )
375 AS_IF([test "x$LUAPC" != "x"],
376 [AC_MSG_NOTICE([Lua: $LUAPC])],
377 [AS_IF([test "x$LUAJITPC" != "x"],
378 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
379 [AC_MSG_NOTICE([Lua/LuaJit: no])])
380 ])
381 AS_IF([test "x$enable_experimental_pkcs11" = "xyes"],
382 [AC_MSG_NOTICE([PKCS-11: yes])]
383 )
384 AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"],
385 [AC_MSG_NOTICE([GSS-TSIG: yes])]
386 )
387 AS_IF([test "x$systemd" != "xn"],
388 [AC_MSG_NOTICE([systemd: yes])],
389 [AC_MSG_NOTICE([systemd: no])]
390 )
391 AS_IF([test "x$enable_remotebackend_zeromq" != "xno"],
392 [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])]
393 )
394 AC_MSG_NOTICE([])