]>
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 | |
4f6c5ee6 RK |
44 | PDNS_WITH_LUAJIT |
45 | AS_IF([test "x$with_luajit" = "xno"], [ | |
46 | PDNS_WITH_LUA | |
47 | ]) | |
9a927586 | 48 | PDNS_CHECK_LUA_HPP |
4f6c5ee6 | 49 | |
8c8b9197 | 50 | AX_CXX_COMPILE_STDCXX_11 |
0b61c633 T |
51 | |
52 | AC_MSG_CHECKING([whether we will enable compiler security checks]) | |
53 | AC_ARG_ENABLE([hardening], | |
8c8b9197 | 54 | [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])], |
0b61c633 T |
55 | [enable_hardening=$enableval], |
56 | [enable_hardening=yes] | |
57 | ) | |
58 | AC_MSG_RESULT([$enable_hardening]) | |
59 | ||
c77252b6 RK |
60 | AS_IF([test "x$enable_hardening" != "xno"], [ |
61 | AC_CC_PIE | |
62 | AC_CC_STACK_PROTECTOR | |
63 | AC_CC_PARAM_SSP_BUFFER_SIZE([4]) | |
64 | AC_CC_D_FORTIFY_SOURCE | |
65 | AC_LD_RELRO | |
66 | ]) | |
d6e5e940 | 67 | |
020b39f3 | 68 | PDNS_CHECK_NETWORK_LIBS |
9d44a523 | 69 | |
28bb0d13 | 70 | LT_PREREQ([2.2.2]) |
a596b8e9 | 71 | LT_INIT([disable-static dlopen]) |
59414d0e | 72 | |
d6e5e940 | 73 | |
96ae9a2e KM |
74 | MC_TM_GMTOFF |
75 | ||
0949b8ae CH |
76 | # Define full_libdir to be the fully expanded (${exec_prefix}, etc.) |
77 | # "system" library path. | |
78 | # We use this to search for other libraries. | |
79 | eval full_libdir="\"$libdir\"" | |
39653d75 | 80 | |
27fe16bd RK |
81 | # detect pkg-config explicitly |
82 | PKG_PROG_PKG_CONFIG | |
83 | ||
709ca59f AT |
84 | AC_CHECK_HEADERS( |
85 | [sys/mman.h], | |
86 | [AC_CHECK_FUNC( | |
87 | [mmap], | |
88 | [AC_DEFINE(HAVE_MMAP, [1], [Define to 1 if you have mmap])], | |
89 | [have_mmap=no] | |
90 | )], | |
91 | [have_mmap=no] | |
92 | ) | |
93 | ||
df85a9a0 | 94 | PDNS_ENABLE_BOTAN |
df85a9a0 | 95 | PDNS_CHECK_LIBSODIUM |
7581a35b | 96 | AX_CHECK_OPENSSL([ |
df85a9a0 PL |
97 | ],[ |
98 | AC_MSG_ERROR([OpenSSL not found]) | |
99 | ] | |
7581a35b | 100 | ) |
1d026a23 | 101 | |
e3881b46 | 102 | PDNS_CHECK_RAGEL |
bcd17c71 | 103 | PDNS_CHECK_CLOCK_GETTIME |
d81a3e14 | 104 | |
94ac5f34 | 105 | BOOST_REQUIRE([1.35]) |
6cedc26d RG |
106 | # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ |
107 | # to be compatible with C++11 | |
108 | AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148]) | |
109 | ||
94ac5f34 | 110 | BOOST_PROGRAM_OPTIONS([mt]) |
fedea66a | 111 | PDNS_ENABLE_UNIT_TESTS |
5e6a3d93 | 112 | PDNS_ENABLE_REPRODUCIBLE |
051f0aaa | 113 | |
13305eb1 | 114 | PDNS_WITH_SQLITE3 |
32869e14 | 115 | |
e9046dbc | 116 | PDNS_CHECK_PANDOC |
154fd082 | 117 | PDNS_FROM_GIT |
e9046dbc | 118 | |
92a4978f | 119 | dnl Checks for library functions. |
4ab95bea RK |
120 | AC_CHECK_FUNCS_ONCE([strcasestr localtime_r recvmmsg]) |
121 | ||
122 | AM_CONDITIONAL([HAVE_RECVMMSG], [test "x$ac_cv_func_recvmmsg" = "xyes"]) | |
92a4978f | 123 | |
b6be1d3b RK |
124 | AS_IF([test "x$lt_cv_dlopen" = "xno"], |
125 | [AC_MSG_ERROR([Your system does not support dlopen])] | |
126 | ) | |
127 | ||
a596b8e9 | 128 | AC_SUBST([LIBDL], [$lt_cv_dlopen_libs]) |
92a4978f | 129 | |
0c6f6275 | 130 | PDNS_CHECK_OS |
8ffe1c55 | 131 | PDNS_ENABLE_VERBOSE_LOGGING |
8daea594 | 132 | PDNS_ENABLE_PKCS11 |
fcc4170a | 133 | PDNS_ENABLE_GSS_TSIG |
a7db8aa6 | 134 | |
a7285d5a | 135 | modules="bind gmysql random" |
39653d75 | 136 | AC_ARG_WITH([modules], |
8c8b9197 | 137 | [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])], |
39653d75 RK |
138 | [modules="$withval"] |
139 | ) | |
92a4978f BH |
140 | |
141 | dynmodules="pipe" | |
39653d75 | 142 | AC_ARG_WITH([dynmodules], |
8c8b9197 | 143 | [AS_HELP_STRING([--with-dynmodules], [which backends to build for dynamic loading @<:@default=pipe@:>@])], |
39653d75 RK |
144 | [dynmodules="$withval"] |
145 | ) | |
92a4978f | 146 | |
8c8b9197 | 147 | AC_SUBST([socketdir]) |
92a4978f | 148 | socketdir="/var/run" |
39653d75 | 149 | AC_ARG_WITH([socketdir], |
8c8b9197 | 150 | [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])], |
39653d75 RK |
151 | [socketdir="$withval"] |
152 | ) | |
92a4978f | 153 | |
8c8b9197 RK |
154 | AC_SUBST([moduledirs]) |
155 | AC_SUBST([moduleobjects]) | |
156 | AC_SUBST([modulelibs]) | |
157 | AC_DEFINE_UNQUOTED([PDNS_MODULES], "$modules", [Built-in modules]) | |
92a4978f | 158 | |
39653d75 RK |
159 | AC_MSG_CHECKING([whether we will be building the server]) |
160 | AC_ARG_ENABLE([pdns-server], | |
8c8b9197 | 161 | [AS_HELP_STRING([--enable-pdns_server], [if we should build the server @<:@default=yes@:>@])], |
39653d75 RK |
162 | [enable_pdns_server=$enableval], |
163 | [enable_pdns_server=yes] | |
164 | ) | |
165 | AC_MSG_RESULT([$enable_pdns_server]) | |
8c8b9197 | 166 | AM_CONDITIONAL([WITH_PDNS_SERVER], [test "x$enable_pdns_server" != "xno"]) |
92a4978f | 167 | |
39653d75 | 168 | AC_ARG_ENABLE([gcc-skip-locking], |
8c8b9197 RK |
169 | [AS_HELP_STRING([--enable-gcc-skip-locking], [if we should forcefully skip gcc locking @<:@default=no@:>@])], |
170 | [AC_DEFINE(GCC_SKIP_LOCKING,[], [Skip gcc locking])], | |
39653d75 RK |
171 | ) |
172 | ||
173 | AC_MSG_CHECKING([whether we will be building and installing the extra tools]) | |
174 | AC_ARG_ENABLE([tools], | |
8c8b9197 | 175 | [AS_HELP_STRING([--enable-tools], [if we should build and install the tools @<:@default=no@:>@])], |
39653d75 RK |
176 | [enable_tools=$enableval], |
177 | [enable_tools=no] | |
178 | ) | |
179 | ||
180 | AC_MSG_RESULT([$enable_tools]) | |
8c8b9197 | 181 | AM_CONDITIONAL([TOOLS], [test "x$enable_tools" != "xno"]) |
39653d75 | 182 | |
e3e0caa5 | 183 | PDNS_WITH_PROTOBUF |
26870de7 | 184 | |
39653d75 RK |
185 | for a in $modules $dynmodules; do |
186 | case "$a" in | |
187 | oracle|goracle) | |
188 | PDNS_WITH_ORACLE | |
189 | needoracle=yes | |
190 | ;; | |
4f983d1b PD |
191 | godbc) |
192 | PDNS_WITH_UNIXODBC | |
193 | ;; | |
39653d75 RK |
194 | mydns|gmysql|pdns) |
195 | PDNS_WITH_MYSQL | |
196 | ;; | |
197 | gpgsql) | |
198 | PDNS_WITH_POSTGRESQL | |
199 | ;; | |
200 | gsqlite3) | |
201 | needsqlite3=yes | |
202 | ;; | |
203 | ldap) | |
204 | PDNS_CHECK_LDAP | |
b63843d9 | 205 | needldap=yes |
39653d75 RK |
206 | ;; |
207 | opendbx) | |
208 | PDNS_CHECK_OPENDBX | |
209 | ;; | |
e29ece13 | 210 | remote) |
98540f9f T |
211 | AS_IF([test "x$enable_unit_tests" = "xyes"], |
212 | [PDNS_CHECK_CURL_PROGRAM] | |
213 | ) | |
e29ece13 T |
214 | have_remotebackend=yes |
215 | ;; | |
39653d75 RK |
216 | tinydns) |
217 | PDNS_CHECK_CDB | |
218 | ;; | |
709ca59f AT |
219 | geoip) |
220 | PDNS_CHECK_GEOIP | |
221 | ;; | |
a20adc10 RK |
222 | lua) |
223 | AS_IF([test "x$with_lua" = "xno"], | |
224 | AC_MSG_ERROR([Lua backend needs lua, run ./configure --with-lua]) | |
225 | ) | |
226 | AS_IF([test "x$LUAPC" = "x"], | |
227 | AC_MSG_ERROR([Lua backend needs lua but we cannot find it]) | |
228 | ) | |
229 | ;; | |
39653d75 | 230 | esac |
92a4978f BH |
231 | done |
232 | ||
e29ece13 T |
233 | PDNS_ENABLE_REMOTEBACKEND_ZEROMQ |
234 | ||
8c8b9197 | 235 | AM_CONDITIONAL([ORACLE], [test "x$needoracle" = "xyes"]) |
39653d75 | 236 | |
8c8b9197 | 237 | AM_CONDITIONAL([LDAP], [test "x$needldap" = "xyes"]) |
b63843d9 | 238 | |
13305eb1 | 239 | PDNS_CHECK_SQLITE3 |
39653d75 | 240 | AM_CONDITIONAL([SQLITE3], [test "x$needsqlite3" = "xyes"]) |
64e3aade | 241 | |
39653d75 | 242 | for a in $modules; do |
8a32d90d T |
243 | AC_MSG_CHECKING([whether we can build module "${a}"]) |
244 | if [[ -d "$srcdir/modules/${a}backend" ]]; then | |
245 | AC_MSG_RESULT([yes]) | |
246 | moduledirs="$moduledirs ${a}backend" | |
247 | ||
248 | for b in `cat $srcdir/modules/${a}backend/OBJECTFILES`; do | |
249 | moduleobjects="$moduleobjects ../modules/${a}backend/$b" | |
250 | done | |
251 | modulelibs="$modulelibs `cat $srcdir/modules/${a}backend/OBJECTLIBS`" | |
252 | else | |
253 | AC_MSG_RESULT([no]) | |
a59ccf7a | 254 | 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 | 255 | fi |
92a4978f BH |
256 | done |
257 | ||
39653d75 | 258 | for a in $dynmodules; do |
09acf546 T |
259 | AC_MSG_CHECKING([whether we can build dynamic module "${a}"]) |
260 | if [[ -d "$srcdir/modules/${a}backend" ]]; then | |
261 | AC_MSG_RESULT([yes]) | |
262 | moduledirs="$moduledirs ${a}backend" | |
263 | else | |
264 | AC_MSG_RESULT([no]) | |
a59ccf7a | 265 | 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 | 266 | fi |
92a4978f BH |
267 | done |
268 | ||
6988eae9 PL |
269 | AX_AVAILABLE_SYSTEMD |
270 | AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ]) | |
271 | ||
3cc618c5 | 272 | LDFLAGS="$RELRO_LDFLAGS $LDFLAGS" |
d6e5e940 | 273 | |
b0e68161 RK |
274 | CFLAGS="$PIE_CFLAGS $CFLAGS" |
275 | CXXFLAGS="$PIE_CFLAGS $CXXFLAGS" | |
276 | PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS" | |
b2053c28 | 277 | AC_SUBST([PROGRAM_LDFLAGS]) |
62e6530a | 278 | |
366c610a | 279 | PDNS_ENABLE_COVERAGE |
4c69af87 | 280 | PDNS_ENABLE_SANITIZERS |
8f7473d7 | 281 | PDNS_ENABLE_MALLOC_TRACE |
62e6530a | 282 | |
92a4978f BH |
283 | AC_SUBST(LIBS) |
284 | ||
aa357125 RK |
285 | AC_SUBST([AM_CPPFLAGS], |
286 | ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"] | |
287 | ) | |
bf491b87 | 288 | |
d4cc4c4a | 289 | AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp']) |
23448838 | 290 | AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la']) |
1f974019 | 291 | |
4c69af87 RK |
292 | CXXFLAGS="$SANITIZER_FLAGS $CXXFLAGS" |
293 | ||
8c8b9197 | 294 | AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries]) |
722ac035 RK |
295 | AS_IF([test "x$PACKAGEVERSION" != "x"], |
296 | [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])] | |
297 | ) | |
298 | ||
d9a44db5 | 299 | export moduledirs moduleobjects modulelibs |
e9046dbc | 300 | |
39653d75 RK |
301 | AC_CONFIG_FILES([ |
302 | Makefile | |
303 | modules/Makefile | |
304 | pdns/Makefile | |
305 | codedocs/Makefile | |
21557318 | 306 | docs/Makefile |
cd42e98f | 307 | pdns/pdns.init |
d4cc4c4a | 308 | ext/Makefile |
d4cc4c4a RK |
309 | ext/yahttp/Makefile |
310 | ext/yahttp/yahttp/Makefile | |
76c758c4 | 311 | ext/json11/Makefile |
39653d75 | 312 | modules/bindbackend/Makefile |
709ca59f | 313 | modules/geoipbackend/Makefile |
39653d75 | 314 | modules/gmysqlbackend/Makefile |
4f983d1b | 315 | modules/godbcbackend/Makefile |
39653d75 RK |
316 | modules/goraclebackend/Makefile |
317 | modules/gpgsqlbackend/Makefile | |
318 | modules/gsqlite3backend/Makefile | |
319 | modules/ldapbackend/Makefile | |
320 | modules/luabackend/Makefile | |
321 | modules/mydnsbackend/Makefile | |
322 | modules/opendbxbackend/Makefile | |
323 | modules/oraclebackend/Makefile | |
324 | modules/pipebackend/Makefile | |
325 | modules/randombackend/Makefile | |
326 | modules/remotebackend/Makefile | |
327 | modules/tinydnsbackend/Makefile | |
328 | ]) | |
6867a5ad | 329 | AC_OUTPUT |
39653d75 | 330 | |
06d0f550 RK |
331 | AC_MSG_NOTICE([]) |
332 | AC_MSG_NOTICE([Configuration summary]) | |
333 | AC_MSG_NOTICE([=====================]) | |
334 | AC_MSG_NOTICE([]) | |
b43b4a67 | 335 | AC_MSG_NOTICE([Configured with: $pdns_configure_args]) |
80b2fad2 | 336 | AC_MSG_NOTICE([]) |
06d0f550 RK |
337 | AC_MSG_NOTICE([CC: $CC]) |
338 | AC_MSG_NOTICE([CXX: $CXX]) | |
339 | AC_MSG_NOTICE([LD: $LD]) | |
340 | AC_MSG_NOTICE([CFLAGS: $CFLAGS]) | |
341 | AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS]) | |
342 | AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS]) | |
343 | AC_MSG_NOTICE([LDFLAGS: $LDFLAGS]) | |
ea80a933 | 344 | AC_MSG_NOTICE([LIBS: $LIBS]) |
19cedc4b | 345 | AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS]) |
19cedc4b | 346 | AC_MSG_NOTICE([]) |
b43b4a67 PL |
347 | AC_MSG_NOTICE([Features enabled]) |
348 | AC_MSG_NOTICE([----------------]) | |
349 | AC_MSG_NOTICE([Built-in modules: $modules]) | |
350 | AC_MSG_NOTICE([Dynamic modules: $dynmodules]) | |
351 | AC_MSG_NOTICE([]) | |
df27c113 | 352 | AS_IF([test "x$openssl_ecdsa" = "xyes"], |
b43b4a67 PL |
353 | [AC_MSG_NOTICE([OpenSSL ecdsa: yes])], |
354 | [AC_MSG_NOTICE([OpenSSL ecdsa: no])] | |
de4e1d0d | 355 | ) |
786d771e | 356 | AS_IF([test "x$needsqlite3" != "x"], |
b43b4a67 PL |
357 | [AC_MSG_NOTICE([SQLite3: yes])], |
358 | [AC_MSG_NOTICE([SQLite3: no])] | |
786d771e | 359 | ) |
c92ada53 | 360 | AS_IF([test "x$LUAPC" != "x"], |
b43b4a67 PL |
361 | [AC_MSG_NOTICE([Lua: $LUAPC])], |
362 | [AS_IF([test "x$LUAJITPC" != "x"], | |
363 | [AC_MSG_NOTICE([LuaJit: $LUAJITPC])], | |
364 | [AC_MSG_NOTICE([Lua/LuaJit: no])]) | |
365 | ]) | |
df27c113 | 366 | AS_IF([test "x$enable_experimental_gss_tsig" = "xyes"], |
b43b4a67 PL |
367 | [AC_MSG_NOTICE([GSS-TSIG: yes])] |
368 | ) | |
369 | AS_IF([test "x$systemd" != "xn"], | |
370 | [AC_MSG_NOTICE([systemd: yes])], | |
371 | [AC_MSG_NOTICE([systemd: no])] | |
372 | ) | |
373 | AS_IF([test "x$enable_remotebackend_zeromq" != "xno"], | |
374 | [AC_MSG_NOTICE([ZeroMQ connector for remotebackend: yes])] | |
fcc4170a | 375 | ) |
06d0f550 | 376 | AC_MSG_NOTICE([]) |