]>
Commit | Line | Data |
---|---|---|
39653d75 RK |
1 | AC_PREREQ([2.61]) |
2 | ||
8c8b9197 | 3 | AC_INIT([pdns], m4_esyscmd([build-aux/gen-version])) |
39653d75 | 4 | |
6707cb12 | 5 | AC_CONFIG_SRCDIR([pdns/receiver.cc]) |
39653d75 RK |
6 | AC_CONFIG_MACRO_DIR([m4]) |
7 | AC_CONFIG_HEADERS([config.h]) | |
8 | AC_CONFIG_AUX_DIR([build-aux]) | |
9 | ||
8c8b9197 | 10 | AC_SUBST([pdns_configure_args], ["$ac_configure_args"]) |
0060b613 RK |
11 | AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS], |
12 | ["$pdns_configure_args"], | |
13 | [pdns configure arguments] | |
14 | ) | |
15 | ||
afbdd9f0 | 16 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar -Wno-portability subdir-objects parallel-tests 1.11]) |
dcf224eb | 17 | AM_SILENT_RULES([yes]) |
39653d75 | 18 | |
92a4978f | 19 | AC_CANONICAL_HOST |
46a09ebd | 20 | : ${CFLAGS="-Wall -g -O2"} |
5801cd92 | 21 | : ${CXXFLAGS="-Wall -g -O2"} |
39653d75 | 22 | |
92a4978f | 23 | AC_PROG_CC |
dd50be34 | 24 | AM_PROG_CC_C_O |
44362487 | 25 | PDNS_CHECK_BISON |
33086d97 | 26 | PDNS_CHECK_FLEX |
92a4978f BH |
27 | AC_PROG_INSTALL |
28 | AC_PROG_MAKE_SET | |
26870de7 | 29 | |
27a4e655 RK |
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 | ||
66da2833 | 35 | AC_LANG([C++]) |
92a4978f | 36 | |
f33c1fff RK |
37 | AC_DEFINE([_GNU_SOURCE], [1], |
38 | [Define _GNU_SOURCE so that we get all necessary prototypes] | |
39 | ) | |
40 | ||
ad313e37 | 41 | # Warn when pkg.m4 is missing |
8c8b9197 | 42 | m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config]) |
ad313e37 | 43 | |
6484f26c PL |
44 | PDNS_CHECK_OS |
45 | ||
4f6c5ee6 RK |
46 | PDNS_WITH_LUAJIT |
47 | AS_IF([test "x$with_luajit" = "xno"], [ | |
48 | PDNS_WITH_LUA | |
49 | ]) | |
9a927586 | 50 | PDNS_CHECK_LUA_HPP |
4f6c5ee6 | 51 | |
8c8b9197 | 52 | AX_CXX_COMPILE_STDCXX_11 |
0b61c633 T |
53 | |
54 | AC_MSG_CHECKING([whether we will enable compiler security checks]) | |
55 | AC_ARG_ENABLE([hardening], | |
8c8b9197 | 56 | [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])], |
0b61c633 T |
57 | [enable_hardening=$enableval], |
58 | [enable_hardening=yes] | |
59 | ) | |
60 | AC_MSG_RESULT([$enable_hardening]) | |
61 | ||
c77252b6 RK |
62 | AS_IF([test "x$enable_hardening" != "xno"], [ |
63 | AC_CC_PIE | |
64 | AC_CC_STACK_PROTECTOR | |
65 | AC_CC_PARAM_SSP_BUFFER_SIZE([4]) | |
66 | AC_CC_D_FORTIFY_SOURCE | |
67 | AC_LD_RELRO | |
68 | ]) | |
d6e5e940 | 69 | |
020b39f3 | 70 | PDNS_CHECK_NETWORK_LIBS |
9d44a523 | 71 | |
28bb0d13 | 72 | LT_PREREQ([2.2.2]) |
a596b8e9 | 73 | LT_INIT([disable-static dlopen]) |
59414d0e | 74 | |
d6e5e940 | 75 | |
96ae9a2e KM |
76 | MC_TM_GMTOFF |
77 | ||
0949b8ae CH |
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\"" | |
39653d75 | 82 | |
27fe16bd RK |
83 | # detect pkg-config explicitly |
84 | PKG_PROG_PKG_CONFIG | |
85 | ||
709ca59f AT |
86 | AC_CHECK_HEADERS( |
87 | [sys/mman.h], | |
88 | [AC_CHECK_FUNC( | |
89 | [mmap], | |
90 | [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])], | |
91 | [have_mmap=no] | |
92 | )], | |
93 | [have_mmap=no] | |
94 | ) | |
95 | ||
df85a9a0 | 96 | PDNS_ENABLE_BOTAN |
df85a9a0 | 97 | PDNS_CHECK_LIBSODIUM |
74d83458 | 98 | PDNS_CHECK_LIBCRYPTO([ |
df85a9a0 | 99 | ],[ |
74d83458 | 100 | AC_MSG_ERROR([OpenSSL/libcrypto not found]) |
df85a9a0 | 101 | ] |
7581a35b | 102 | ) |
74d83458 | 103 | PDNS_CHECK_LIBCRYPTO_ECDSA |
1d026a23 | 104 | |
e3881b46 | 105 | PDNS_CHECK_RAGEL |
bcd17c71 | 106 | PDNS_CHECK_CLOCK_GETTIME |
d81a3e14 | 107 | |
94ac5f34 | 108 | BOOST_REQUIRE([1.35]) |
6cedc26d RG |
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 | ||
94ac5f34 | 113 | BOOST_PROGRAM_OPTIONS([mt]) |
b2ab38c3 PL |
114 | AS_IF([test "$boost_cv_lib_program_options" = "no"], [ |
115 | AC_MSG_ERROR([Boost Program Options library not found]) | |
116 | ]) | |
fedea66a | 117 | PDNS_ENABLE_UNIT_TESTS |
5e6a3d93 | 118 | PDNS_ENABLE_REPRODUCIBLE |
051f0aaa | 119 | |
13305eb1 | 120 | PDNS_WITH_SQLITE3 |
32869e14 | 121 | |
e9046dbc | 122 | PDNS_CHECK_PANDOC |
154fd082 | 123 | PDNS_FROM_GIT |
e9046dbc | 124 | |
92a4978f | 125 | dnl Checks for library functions. |
4ab95bea RK |
126 | AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg]) |
127 | ||
128 | AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"]) | |
92a4978f | 129 | |
b6be1d3b RK |
130 | AS_IF([test "x$lt_cv_dlopen" = "xno"], |
131 | [AC_MSG_ERROR([Your system does not support dlopen])] | |
132 | ) | |
133 | ||
a596b8e9 | 134 | AC_SUBST([LIBDL], [$lt_cv_dlopen_libs]) |
92a4978f | 135 | |
8ffe1c55 | 136 | PDNS_ENABLE_VERBOSE_LOGGING |
8daea594 | 137 | PDNS_ENABLE_PKCS11 |
fcc4170a | 138 | PDNS_ENABLE_GSS_TSIG |
a7db8aa6 | 139 | |
a7285d5a | 140 | modules="bind gmysql random" |
39653d75 | 141 | AC_ARG_WITH([modules], |
8c8b9197 | 142 | [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])], |
39653d75 RK |
143 | [modules="$withval"] |
144 | ) | |
92a4978f BH |
145 | |
146 | dynmodules="pipe" | |
39653d75 | 147 | AC_ARG_WITH([dynmodules], |
8c8b9197 | 148 | [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])], |
39653d75 RK |
149 | [dynmodules="$withval"] |
150 | ) | |
92a4978f | 151 | |
8c8b9197 | 152 | AC_SUBST([socketdir]) |
92a4978f | 153 | socketdir="/var/run" |
39653d75 | 154 | AC_ARG_WITH([socketdir], |
8c8b9197 | 155 | [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])], |
39653d75 RK |
156 | [socketdir="$withval"] |
157 | ) | |
92a4978f | 158 | |
8c8b9197 RK |
159 | AC_SUBST([moduledirs]) |
160 | AC_SUBST([moduleobjects]) | |
161 | AC_SUBST([modulelibs]) | |
162 | AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules]) | |
92a4978f | 163 | |
39653d75 RK |
164 | AC_MSG_CHECKING([whether we will be building the server]) |
165 | AC_ARG_ENABLE([pdns-server], | |
8c8b9197 | 166 | [AS_HELP_STRING([--enable-pdns_server], [if we should build the server @<:@default=yes@:>@])], |
39653d75 RK |
167 | [enable_pdns_server=$enableval], |
168 | [enable_pdns_server=yes] | |
169 | ) | |
170 | AC_MSG_RESULT([$enable_pdns_server]) | |
8c8b9197 | 171 | AM_CONDITIONAL([WITH_PDNS_SERVER], [test "x$enable_pdns_server" != "xno"]) |
92a4978f | 172 | |
39653d75 | 173 | AC_ARG_ENABLE([gcc-skip-locking], |
8c8b9197 RK |
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])], | |
39653d75 RK |
176 | ) |
177 | ||
178 | AC_MSG_CHECKING([whether we will be building and installing the extra tools]) | |
179 | AC_ARG_ENABLE([tools], | |
8c8b9197 | 180 | [AS_HELP_STRING([--enable-tools], [if we should build and install the tools @<:@default=no@:>@])], |
39653d75 RK |
181 | [enable_tools=$enableval], |
182 | [enable_tools=no] | |
183 | ) | |
184 | ||
185 | AC_MSG_RESULT([$enable_tools]) | |
8c8b9197 | 186 | AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"]) |
39653d75 | 187 | |
e3e0caa5 | 188 | PDNS_WITH_PROTOBUF |
26870de7 | 189 | |
39653d75 RK |
190 | for a in $modules $dynmodules; do |
191 | case "$a" in | |
192 | oracle|goracle) | |
193 | PDNS_WITH_ORACLE | |
194 | needoracle=yes | |
195 | ;; | |
4f983d1b PD |
196 | godbc) |
197 | PDNS_WITH_UNIXODBC | |
198 | ;; | |
39653d75 RK |
199 | mydns|gmysql|pdns) |
200 | PDNS_WITH_MYSQL | |
201 | ;; | |
202 | gpgsql) | |
203 | PDNS_WITH_POSTGRESQL | |
204 | ;; | |
205 | gsqlite3) | |
206 | needsqlite3=yes | |
207 | ;; | |
208 | ldap) | |
209 | PDNS_CHECK_LDAP | |
b63843d9 | 210 | needldap=yes |
39653d75 RK |
211 | ;; |
212 | opendbx) | |
213 | PDNS_CHECK_OPENDBX | |
214 | ;; | |
e29ece13 | 215 | remote) |
98540f9f T |
216 | AS_IF([test "x$enable_unit_tests" = "xyes"], |
217 | [PDNS_CHECK_CURL_PROGRAM] | |
218 | ) | |
e29ece13 T |
219 | have_remotebackend=yes |
220 | ;; | |
39653d75 RK |
221 | tinydns) |
222 | PDNS_CHECK_CDB | |
223 | ;; | |
709ca59f AT |
224 | geoip) |
225 | PDNS_CHECK_GEOIP | |
226 | ;; | |
a20adc10 RK |
227 | lua) |
228 | AS_IF([test "x$with_lua" = "xno"], | |
229 | AC_MSG_ERROR([Lua backend needs lua, run ./configure --with-lua]) | |
230 | ) | |
231 | AS_IF([test "x$LUAPC" = "x"], | |
232 | AC_MSG_ERROR([Lua backend needs lua but we cannot find it]) | |
233 | ) | |
234 | ;; | |
39653d75 | 235 | esac |
92a4978f BH |
236 | done |
237 | ||
e29ece13 T |
238 | PDNS_ENABLE_REMOTEBACKEND_ZEROMQ |
239 | ||
8c8b9197 | 240 | AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"]) |
39653d75 | 241 | |
8c8b9197 | 242 | AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"]) |
b63843d9 | 243 | |
13305eb1 | 244 | PDNS_CHECK_SQLITE3 |
39653d75 | 245 | AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"]) |
64e3aade | 246 | |
39653d75 | 247 | for a in $modules; do |
8a32d90d T |
248 | AC_MSG_CHECKING([whether we can build module "${a}"]) |
249 | if [[ -d "$srcdir/modules/${a}backend" ]]; then | |
250 | AC_MSG_RESULT([yes]) | |
251 | moduledirs="$moduledirs ${a}backend" | |
252 | ||
253 | for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do | |
254 | moduleobjects="$moduleobjects ../modules/${a}backend/$b" | |
255 | done | |
256 | modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" | |
257 | else | |
258 | AC_MSG_RESULT([no]) | |
a59ccf7a | 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.]) |
8a32d90d | 260 | fi |
92a4978f BH |
261 | done |
262 | ||
39653d75 | 263 | for a in $dynmodules; do |
09acf546 T |
264 | AC_MSG_CHECKING([whether we can build dynamic module "${a}"]) |
265 | if [[ -d "$srcdir/modules/${a}backend" ]]; then | |
266 | AC_MSG_RESULT([yes]) | |
267 | moduledirs="$moduledirs ${a}backend" | |
268 | else | |
269 | AC_MSG_RESULT([no]) | |
a59ccf7a | 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.]) |
09acf546 | 271 | fi |
92a4978f BH |
272 | done |
273 | ||
6988eae9 PL |
274 | AX_AVAILABLE_SYSTEMD |
275 | AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ]) | |
276 | ||
3cc618c5 | 277 | LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" |
d6e5e940 | 278 | |
b0e68161 RK |
279 | CFLAGS="$PIE_CFLAGS $CFLAGS" |
280 | CXXFLAGS="$PIE_CFLAGS $CXXFLAGS" | |
281 | PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS" | |
b2053c28 | 282 | AC_SUBST([PROGRAM_LDFLAGS]) |
62e6530a | 283 | |
366c610a | 284 | PDNS_ENABLE_COVERAGE |
4c69af87 | 285 | PDNS_ENABLE_SANITIZERS |
8f7473d7 | 286 | PDNS_ENABLE_MALLOC_TRACE |
62e6530a | 287 | |
92a4978f BH |
288 | AC_SUBST(LIBS) |
289 | ||
aa357125 RK |
290 | AC_SUBST([AM_CPPFLAGS], |
291 | ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"] | |
292 | ) | |
bf491b87 | 293 | |
d4cc4c4a | 294 | AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp']) |
23448838 | 295 | AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la']) |
1f974019 | 296 | |
4c69af87 RK |
297 | CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS" |
298 | ||
8c8b9197 | 299 | AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries]) |
722ac035 RK |
300 | AS_IF([test "x$PACKAGEVERSION" != "x"], |
301 | [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])] | |
302 | ) | |
303 | ||
d9a44db5 | 304 | export moduledirs moduleobjects modulelibs |
e9046dbc | 305 | |
39653d75 RK |
306 | AC_CONFIG_FILES([ |
307 | Makefile | |
308 | modules/Makefile | |
309 | pdns/Makefile | |
310 | codedocs/Makefile | |
21557318 | 311 | docs/Makefile |
cd42e98f | 312 | pdns/pdns.init |
d4cc4c4a | 313 | ext/Makefile |
d4cc4c4a RK |
314 | ext/yahttp/Makefile |
315 | ext/yahttp/yahttp/Makefile | |
76c758c4 | 316 | ext/json11/Makefile |
39653d75 | 317 | modules/bindbackend/Makefile |
709ca59f | 318 | modules/geoipbackend/Makefile |
39653d75 | 319 | modules/gmysqlbackend/Makefile |
4f983d1b | 320 | modules/godbcbackend/Makefile |
39653d75 RK |
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 | |
333 | ]) | |
6867a5ad | 334 | AC_OUTPUT |
39653d75 | 335 | |
06d0f550 RK |
336 | AC_MSG_NOTICE([]) |
337 | AC_MSG_NOTICE([Configuration summary]) | |
338 | AC_MSG_NOTICE([=====================]) | |
339 | AC_MSG_NOTICE([]) | |
b43b4a67 | 340 | AC_MSG_NOTICE([Configured with: $pdns_configure_args]) |
80b2fad2 | 341 | AC_MSG_NOTICE([]) |
06d0f550 RK |
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]) | |
ea80a933 | 349 | AC_MSG_NOTICE([LIBS: $LIBS]) |
19cedc4b | 350 | AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS]) |
19cedc4b | 351 | AC_MSG_NOTICE([]) |
b43b4a67 PL |
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]) | |
356 | AC_MSG_NOTICE([]) | |
061c0ee1 | 357 | AS_IF([test "x$libcrypto_ecdsa" = "xyes"], |
b43b4a67 PL |
358 | [AC_MSG_NOTICE([OpenSSL ecdsa: yes])], |
359 | [AC_MSG_NOTICE([OpenSSL ecdsa: no])] | |
de4e1d0d | 360 | ) |
299b43b6 RG |
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])] | |
364 | ) | |
365 | AS_IF([test "x$LIBDECAF_LIBS" != "x"], | |
366 | [AC_MSG_NOTICE([ed448: yes])], | |
367 | [AC_MSG_NOTICE([ed448: no])] | |
368 | ) | |
369 | AS_IF([test "x$BOTAN_LIBS" != "x"], | |
370 | [AC_MSG_NOTICE([gost: yes])], | |
371 | [AC_MSG_NOTICE([gost: no])] | |
372 | ) | |
786d771e | 373 | AS_IF([test "x$needsqlite3" != "x"], |
b43b4a67 PL |
374 | [AC_MSG_NOTICE([SQLite3: yes])], |
375 | [AC_MSG_NOTICE([SQLite3: no])] | |
786d771e | 376 | ) |
c92ada53 | 377 | AS_IF([test "x$LUAPC" != "x"], |
b43b4a67 PL |
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])]) | |
382 | ]) | |
df27c113 | 383 | AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"], |
b43b4a67 PL |
384 | [AC_MSG_NOTICE([GSS-TSIG: yes])] |
385 | ) | |
386 | AS_IF([test "x$systemd" != "xn"], | |
387 | [AC_MSG_NOTICE([systemd: yes])], | |
388 | [AC_MSG_NOTICE([systemd: no])] | |
389 | ) | |
390 | AS_IF([test "x$enable_remotebackend_zeromq" != "xno"], | |
391 | [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])] | |
fcc4170a | 392 | ) |
06d0f550 | 393 | AC_MSG_NOTICE([]) |