]>
Commit | Line | Data |
---|---|---|
39653d75 RK |
1 | AC_PREREQ([2.61]) |
2 | ||
a4e9add5 | 3 | AC_INIT([pdns], m4_esyscmd_s(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 | ||
0060b613 RK |
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 | ||
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 RK |
41 | # Warn when pkg.m4 is missing |
42 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) | |
43 | ||
4f6c5ee6 RK |
44 | PDNS_WITH_LUAJIT |
45 | AS_IF([test "x$with_luajit" = "xno"], [ | |
46 | PDNS_WITH_LUA | |
47 | ]) | |
48 | ||
d064abb1 | 49 | AX_CXX_COMPILE_STDCXX_11() |
0b61c633 T |
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 | ||
c77252b6 RK |
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 | ]) | |
d6e5e940 | 66 | |
3bdd9625 RK |
67 | AC_SEARCH_LIBS([socket], [socket]) |
68 | AC_SEARCH_LIBS([gethostent], [nsl]) | |
69 | AC_SEARCH_LIBS([inet_aton], [resolv]) | |
9d44a523 | 70 | |
28bb0d13 | 71 | LT_PREREQ([2.2.2]) |
a596b8e9 | 72 | LT_INIT([disable-static dlopen]) |
59414d0e | 73 | |
d6e5e940 | 74 | |
96ae9a2e KM |
75 | MC_TM_GMTOFF |
76 | ||
0949b8ae CH |
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\"" | |
39653d75 | 81 | |
27fe16bd RK |
82 | # detect pkg-config explicitly |
83 | PKG_PROG_PKG_CONFIG | |
84 | ||
a49b3356 RK |
85 | # check if we want a static build |
86 | AC_MSG_CHECKING([whether we will be building static binaries]) | |
87 | ||
88 | AC_ARG_ENABLE([static-binaries], | |
89 | [AS_HELP_STRING([--enable-static-binaries],[build static binaries @<:@default=no@:>@])], | |
90 | [static=$enableval], | |
91 | [static=no], | |
92 | ) | |
93 | AC_MSG_RESULT([$static]) | |
94 | ||
95 | AS_IF([test "x$static" != "xno"], [ | |
96 | PKG_CONFIG="$PKG_CONFIG --static" | |
97 | ]) | |
98 | ||
709ca59f AT |
99 | AC_CHECK_HEADERS( |
100 | [sys/mman.h], | |
101 | [AC_CHECK_FUNC( | |
102 | [mmap], | |
103 | [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])], | |
104 | [have_mmap=no] | |
105 | )], | |
106 | [have_mmap=no] | |
107 | ) | |
108 | ||
1d026a23 | 109 | |
af32e666 | 110 | PDNS_CHECK_READLINE |
e3881b46 | 111 | PDNS_CHECK_RAGEL |
7b61d6f3 | 112 | PDNS_CHECK_LIBSODIUM |
bcd17c71 | 113 | PDNS_CHECK_CLOCK_GETTIME |
d81a3e14 | 114 | |
94ac5f34 PD |
115 | BOOST_REQUIRE([1.35]) |
116 | BOOST_FOREACH | |
117 | BOOST_PROGRAM_OPTIONS([mt]) | |
118 | BOOST_SERIALIZATION([mt]) | |
051f0aaa | 119 | |
fedea66a | 120 | PDNS_ENABLE_UNIT_TESTS |
5e6a3d93 | 121 | PDNS_ENABLE_REPRODUCIBLE |
051f0aaa | 122 | |
13305eb1 | 123 | PDNS_WITH_SQLITE3 |
32869e14 | 124 | |
e9046dbc PL |
125 | PDNS_CHECK_PANDOC |
126 | PDNS_CHECK_MKDOCS | |
b43f4f8a | 127 | PDNS_CHECK_LINKCHECKER |
e9046dbc | 128 | |
92a4978f | 129 | dnl Checks for library functions. |
4ab95bea RK |
130 | AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg]) |
131 | ||
132 | AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"]) | |
92a4978f | 133 | |
b6be1d3b RK |
134 | AS_IF([test "x$lt_cv_dlopen" = "xno"], |
135 | [AC_MSG_ERROR([Your system does not support dlopen])] | |
136 | ) | |
137 | ||
a596b8e9 | 138 | AC_SUBST([LIBDL], [$lt_cv_dlopen_libs]) |
92a4978f | 139 | |
92a4978f BH |
140 | THREADFLAGS="" |
141 | ||
142 | case "$host_os" in | |
143 | solaris2.10) | |
5c5249bd | 144 | LIBS="-lposix4 -lpthread $LIBS" |
39653d75 | 145 | CXXFLAGS="-D_REENTRANT $CXXFLAGS" |
d4c30a75 | 146 | have_solaris="yes" |
39653d75 | 147 | ;; |
be1bd362 | 148 | solaris2.8 | solaris2.9 ) |
39653d75 RK |
149 | AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined]) |
150 | AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype]) | |
29403f48 | 151 | LIBS="-lposix4 -lpthread $LIBS" |
39653d75 | 152 | CXXFLAGS="-D_REENTRANT $CXXFLAGS" |
d4c30a75 | 153 | have_solaris="yes" |
39653d75 | 154 | ;; |
92a4978f | 155 | linux*) |
39653d75 | 156 | THREADFLAGS="-pthread" |
df72c277 | 157 | have_linux="yes" |
39653d75 | 158 | ;; |
bf5a4844 | 159 | darwin*) |
bded797d | 160 | CXXFLAGS="-D__APPLE_USE_RFC_3542 -D_XOPEN_SOURCE $CXXFLAGS" |
39653d75 | 161 | ;; |
69f79f96 | 162 | freebsd*) |
2ca3e75b | 163 | THREADFLAGS="-pthread" |
69f79f96 RK |
164 | have_freebsd="yes" |
165 | ;; | |
92a4978f | 166 | *) |
39653d75 RK |
167 | LDFLAGS="-pthread $LDFLAGS" |
168 | CXXFLAGS="-pthread $CXXFLAGS" | |
169 | ;; | |
92a4978f BH |
170 | esac |
171 | ||
69f79f96 | 172 | AM_CONDITIONAL([HAVE_FREEBSD], [test "x$have_freebsd" = "xyes"]) |
df72c277 | 173 | AM_CONDITIONAL([HAVE_LINUX], [test "x$have_linux" = "xyes"]) |
d4c30a75 | 174 | AM_CONDITIONAL([HAVE_SOLARIS], [test "x$have_solaris" = "xyes"]) |
df72c277 | 175 | |
92a4978f | 176 | AC_SUBST(THREADFLAGS) |
2cfb6b6e | 177 | AC_SUBST([DYNLINKFLAGS], [-export-dynamic]) |
92a4978f | 178 | |
8ffe1c55 | 179 | PDNS_ENABLE_VERBOSE_LOGGING |
08bc56f4 | 180 | PDNS_WITH_SYSTEM_POLARSSL |
5b117c5e | 181 | PDNS_ENABLE_BOTAN |
8daea594 | 182 | PDNS_ENABLE_PKCS11 |
1f0f33bc | 183 | PDNS_WITH_CRYPTOPP |
fcc5d084 | 184 | PDNS_ENABLE_ED25519 |
fcc4170a | 185 | PDNS_ENABLE_GSS_TSIG |
a7db8aa6 | 186 | |
a49b3356 RK |
187 | AS_IF([test "x$static" != "xno"], [ |
188 | LDFLAGS="-all-static $LDFLAGS" | |
189 | ]) | |
92a4978f | 190 | |
e53a4bf6 | 191 | modules="bind gmysql geo random" |
39653d75 | 192 | AC_ARG_WITH([modules], |
ae2f3feb | 193 | [AS_HELP_STRING([--with-modules],[which backends to compile with @<:@default=bind gmysql geo random@:>@])], |
39653d75 RK |
194 | [modules="$withval"] |
195 | ) | |
92a4978f BH |
196 | |
197 | dynmodules="pipe" | |
39653d75 RK |
198 | AC_ARG_WITH([dynmodules], |
199 | [AS_HELP_STRING([--with-dynmodules],[which backends to build for dynamic loading @<:@default=pipe@:>@])], | |
200 | [dynmodules="$withval"] | |
201 | ) | |
92a4978f BH |
202 | |
203 | AC_SUBST(socketdir) | |
204 | socketdir="/var/run" | |
39653d75 RK |
205 | AC_ARG_WITH([socketdir], |
206 | [AS_HELP_STRING([--with-socketdir],[where the controlsocket lives @<:@default=/var/run@:>@])], | |
207 | [socketdir="$withval"] | |
208 | ) | |
92a4978f BH |
209 | |
210 | AC_SUBST(moduledirs) | |
211 | AC_SUBST(moduleobjects) | |
212 | AC_SUBST(modulelibs) | |
39653d75 | 213 | AC_DEFINE_UNQUOTED([PDNS_MODULES],"$modules", [Built-in modules]) |
92a4978f | 214 | |
39653d75 RK |
215 | AC_MSG_CHECKING([whether we will be building the server]) |
216 | AC_ARG_ENABLE([pdns-server], | |
217 | [AS_HELP_STRING([--enable-pdns_server],[if we should build the server @<:@default=yes@:>@])], | |
218 | [enable_pdns_server=$enableval], | |
219 | [enable_pdns_server=yes] | |
220 | ) | |
221 | AC_MSG_RESULT([$enable_pdns_server]) | |
0ff5c0a3 | 222 | AM_CONDITIONAL([WITH_PDNS_SERVER],[test "x$enable_pdns_server" != "xno"]) |
92a4978f | 223 | |
39653d75 RK |
224 | AC_ARG_ENABLE([gcc-skip-locking], |
225 | [AS_HELP_STRING([--enable-gcc-skip-locking],[if we should forcefully skip gcc locking @<:@default=no@:>@])], | |
226 | [AC_DEFINE(GCC_SKIP_LOCKING,[],[Skip gcc locking])], | |
227 | ) | |
228 | ||
229 | AC_MSG_CHECKING([whether we will be building and installing the extra tools]) | |
230 | AC_ARG_ENABLE([tools], | |
231 | [AS_HELP_STRING([--enable-tools],[if we should build and install the tools @<:@default=no@:>@])], | |
232 | [enable_tools=$enableval], | |
233 | [enable_tools=no] | |
234 | ) | |
235 | ||
236 | AC_MSG_RESULT([$enable_tools]) | |
fd9b086f | 237 | AM_CONDITIONAL([TOOLS],[test "x$enable_tools" != "xno"]) |
39653d75 | 238 | |
26870de7 | 239 | |
39653d75 RK |
240 | for a in $modules $dynmodules; do |
241 | case "$a" in | |
242 | oracle|goracle) | |
243 | PDNS_WITH_ORACLE | |
244 | needoracle=yes | |
245 | ;; | |
6a85d81e MZ |
246 | lmdb) |
247 | PDNS_WITH_LMDB | |
cec11b41 | 248 | needlmdb=yes |
6a85d81e | 249 | ;; |
39653d75 RK |
250 | mydns|gmysql|pdns) |
251 | PDNS_WITH_MYSQL | |
252 | ;; | |
253 | gpgsql) | |
254 | PDNS_WITH_POSTGRESQL | |
255 | ;; | |
256 | gsqlite3) | |
257 | needsqlite3=yes | |
258 | ;; | |
259 | ldap) | |
260 | PDNS_CHECK_LDAP | |
b63843d9 | 261 | needldap=yes |
39653d75 RK |
262 | ;; |
263 | opendbx) | |
264 | PDNS_CHECK_OPENDBX | |
265 | ;; | |
e29ece13 | 266 | remote) |
98540f9f T |
267 | AS_IF([test "x$enable_unit_tests" = "xyes"], |
268 | [PDNS_CHECK_CURL_PROGRAM] | |
269 | ) | |
270 | ||
e29ece13 T |
271 | have_remotebackend=yes |
272 | ;; | |
39653d75 RK |
273 | tinydns) |
274 | PDNS_CHECK_CDB | |
275 | ;; | |
709ca59f AT |
276 | geoip) |
277 | PDNS_CHECK_GEOIP | |
278 | ;; | |
a20adc10 RK |
279 | lua) |
280 | AS_IF([test "x$with_lua" = "xno"], | |
281 | AC_MSG_ERROR([Lua backend needs lua, run ./configure --with-lua]) | |
282 | ) | |
283 | AS_IF([test "x$LUAPC" = "x"], | |
284 | AC_MSG_ERROR([Lua backend needs lua but we cannot find it]) | |
285 | ) | |
286 | ;; | |
39653d75 | 287 | esac |
92a4978f BH |
288 | done |
289 | ||
e29ece13 T |
290 | PDNS_ENABLE_REMOTEBACKEND_ZEROMQ |
291 | ||
39653d75 RK |
292 | AM_CONDITIONAL([ORACLE],[test "x$needoracle" = "xyes"]) |
293 | ||
b63843d9 RK |
294 | AM_CONDITIONAL([LDAP],[test "x$needldap" = "xyes"]) |
295 | ||
cec11b41 KM |
296 | AM_CONDITIONAL([LMDB],[test "x$needlmdb" = "xyes"]) |
297 | ||
13305eb1 | 298 | PDNS_CHECK_SQLITE3 |
39653d75 | 299 | AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"]) |
64e3aade | 300 | |
39653d75 RK |
301 | for a in $modules; do |
302 | moduledirs="$moduledirs ${a}backend" | |
303 | ||
304 | for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do | |
305 | moduleobjects="$moduleobjects ../modules/${a}backend/$b" | |
306 | done | |
307 | modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" | |
92a4978f BH |
308 | done |
309 | ||
39653d75 RK |
310 | for a in $dynmodules; do |
311 | moduledirs="$moduledirs ${a}backend" | |
92a4978f BH |
312 | done |
313 | ||
3cc618c5 | 314 | LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" |
d6e5e940 | 315 | |
62e6530a RK |
316 | AS_IF([test "x$static" != "xyes"], [ |
317 | CFLAGS="$PIE_CFLAGS $CFLAGS" | |
318 | CXXFLAGS="$PIE_CFLAGS $CXXFLAGS" | |
b2053c28 | 319 | PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS" |
62e6530a | 320 | ]) |
b2053c28 | 321 | AC_SUBST([PROGRAM_LDFLAGS]) |
62e6530a | 322 | |
366c610a | 323 | PDNS_ENABLE_COVERAGE |
4c69af87 | 324 | PDNS_ENABLE_SANITIZERS |
62e6530a | 325 | |
92a4978f BH |
326 | AC_SUBST(LIBS) |
327 | ||
aa357125 RK |
328 | AC_SUBST([AM_CPPFLAGS], |
329 | ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"] | |
330 | ) | |
bf491b87 | 331 | |
d4cc4c4a RK |
332 | AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp']) |
333 | AC_SUBST([YAHTTP_LIBS], ['-L$(top_builddir)/ext/yahttp/yahttp -lyahttp']) | |
1f974019 | 334 | |
4c69af87 RK |
335 | CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS" |
336 | ||
722ac035 RK |
337 | AC_ARG_VAR(PACKAGEVERSION,[The version used in secpoll queries]) |
338 | AS_IF([test "x$PACKAGEVERSION" != "x"], | |
339 | [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])] | |
340 | ) | |
341 | ||
d9a44db5 | 342 | export moduledirs moduleobjects modulelibs |
e9046dbc | 343 | |
39653d75 RK |
344 | AC_CONFIG_FILES([ |
345 | Makefile | |
346 | modules/Makefile | |
347 | pdns/Makefile | |
348 | codedocs/Makefile | |
21557318 | 349 | docs/Makefile |
cd42e98f | 350 | pdns/pdns.init |
d4cc4c4a RK |
351 | ext/Makefile |
352 | ext/ed25519/Makefile | |
353 | ext/yahttp/Makefile | |
354 | ext/yahttp/yahttp/Makefile | |
355 | ext/polarssl/Makefile | |
356 | ext/polarssl/library/Makefile | |
357 | ext/rapidjson/Makefile | |
39653d75 | 358 | modules/bindbackend/Makefile |
39653d75 | 359 | modules/geobackend/Makefile |
709ca59f | 360 | modules/geoipbackend/Makefile |
39653d75 RK |
361 | modules/gmysqlbackend/Makefile |
362 | modules/goraclebackend/Makefile | |
363 | modules/gpgsqlbackend/Makefile | |
364 | modules/gsqlite3backend/Makefile | |
365 | modules/ldapbackend/Makefile | |
366 | modules/luabackend/Makefile | |
367 | modules/mydnsbackend/Makefile | |
368 | modules/opendbxbackend/Makefile | |
369 | modules/oraclebackend/Makefile | |
370 | modules/pipebackend/Makefile | |
371 | modules/randombackend/Makefile | |
372 | modules/remotebackend/Makefile | |
373 | modules/tinydnsbackend/Makefile | |
6a85d81e | 374 | modules/lmdbbackend/Makefile |
39653d75 | 375 | ]) |
6867a5ad | 376 | AC_OUTPUT |
39653d75 | 377 | |
06d0f550 RK |
378 | AC_MSG_NOTICE([]) |
379 | AC_MSG_NOTICE([Configuration summary]) | |
380 | AC_MSG_NOTICE([=====================]) | |
381 | AC_MSG_NOTICE([]) | |
0060b613 RK |
382 | AC_MSG_NOTICE([Configured with:$pdns_configure_args]) |
383 | AC_MSG_NOTICE([]) | |
06d0f550 RK |
384 | AC_MSG_NOTICE([Modules: $modules]) |
385 | AC_MSG_NOTICE([Dynamic Modules: $dynmodules]) | |
386 | AC_MSG_NOTICE([]) | |
80b2fad2 T |
387 | AC_MSG_NOTICE([With ZeroMQ connector for remotebackend: $enable_remotebackend_zeromq]) |
388 | AC_MSG_NOTICE([]) | |
06d0f550 RK |
389 | AC_MSG_NOTICE([CC: $CC]) |
390 | AC_MSG_NOTICE([CXX: $CXX]) | |
391 | AC_MSG_NOTICE([LD: $LD]) | |
392 | AC_MSG_NOTICE([CFLAGS: $CFLAGS]) | |
393 | AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS]) | |
394 | AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS]) | |
395 | AC_MSG_NOTICE([LDFLAGS: $LDFLAGS]) | |
396 | AC_MSG_NOTICE([]) | |
19cedc4b | 397 | AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS]) |
19cedc4b | 398 | AC_MSG_NOTICE([]) |
786d771e PL |
399 | AS_IF([test "x$needsqlite3" != "x"], |
400 | [AC_MSG_NOTICE([SQLite3 support: yes])], | |
401 | [AC_MSG_NOTICE([SQLite3 support: no])] | |
402 | ) | |
c92ada53 RK |
403 | AS_IF([test "x$LUAPC" != "x"], |
404 | [AC_MSG_NOTICE([Lua support: $LUAPC])], | |
405 | [AC_MSG_NOTICE([Lua support: no])] | |
406 | ) | |
fcc4170a AT |
407 | AS_IF(test "x$enable_experimental_gss_tsig" != "xno"], |
408 | [AC_MSG_NOTICE([GSS-TSIG support: yes])], | |
409 | [AC_MSG_NOTICE([GSS-TSIG support: no])] | |
410 | ) | |
06d0f550 | 411 | AC_MSG_NOTICE([]) |