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