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