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