]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/recursordist/configure.ac
Revert "Bail out when no Context library is available"
[thirdparty/pdns.git] / pdns / recursordist / configure.ac
CommitLineData
49ffe59e
RK
1AC_PREREQ([2.61])
2
831525d2 3AC_INIT([pdns-recursor], m4_esyscmd(build-aux/gen-version))
0c6f6275
PL
4AC_CONFIG_AUX_DIR([build-aux])
5AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip tar-ustar -Wno-portability subdir-objects parallel-tests 1.11])
6AM_SILENT_RULES([yes])
7AC_CONFIG_SRCDIR([pdns_recursor.cc])
8AC_CONFIG_MACRO_DIR([m4])
9
10AC_CONFIG_HEADERS([config.h])
11
12AC_CANONICAL_HOST
d44335b4
PL
13# Add some default CFLAGS and CXXFLAGS, can be appended to using the environment variables
14CFLAGS="-Wall -g -O2 $CFLAGS"
15CXXFLAGS="-Wall -g -O2 $CXXFLAGS"
0c6f6275
PL
16
17AC_SUBST([pdns_configure_args],["$ac_configure_args"])
18AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],
19 ["$pdns_configure_args"],
20 [pdns-recursor configure arguments]
21)
22
23AC_PROG_CC
24AC_PROG_CXX
25AC_LANG([C++])
26
8fd25133 27AC_GNU_SOURCE
0c6f6275 28
acbfb1c1
PL
29AC_DEFINE([RECURSOR], [1],
30 [This is the PowerDNS Recursor]
31)
32
0c6f6275 33# Warn when pkg.m4 is missing
8c8b9197 34m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config])
0c6f6275 35
8c8b9197 36AX_CXX_COMPILE_STDCXX_11([ext], [mandatory])
0c6f6275
PL
37AC_PROG_LIBTOOL
38
39PDNS_CHECK_OS
e10b6528 40PDNS_CHECK_NETWORK_LIBS
519f5484 41PTHREAD_SET_NAME
0c6f6275 42
85c7ca75
PD
43PDNS_CHECK_CLOCK_GETTIME
44
aa4c56be 45PDNS_WITH_PROTOBUF
aa4c56be 46
431f0584 47BOOST_REQUIRE([1.42])
f097141b
CHB
48
49# Check against flat_set header that requires boost >= 1.48
a0b04353 50BOOST_FIND_HEADER([boost/container/flat_set.hpp], [AC_MSG_NOTICE([boost::container::flat_set not available, will fallback to std::set])])
f097141b 51
4c75f029
PL
52# Boost Context was introduced in 1.51 (Aug 2012), but there was an immediate
53# API break in 1.52 (Nov 2012), so we only support that, and later.
e07fdfc2 54pdns_context_library="System V ucontexts"
4c75f029
PL
55AS_IF([test $boost_major_version -ge 152], [BOOST_CONTEXT([], [no])])
56AC_MSG_CHECKING([what context library to use for MTasker])
e07fdfc2
OM
57AS_IF([test x"$boost_cv_lib_context" = "xyes"], [pdns_context_library="Boost Context"])
58AC_MSG_RESULT([$pdns_context_library])
7158b2f5 59
35d883a8 60PDNS_ENABLE_UNIT_TESTS
0c6f6275
PL
61PDNS_ENABLE_REPRODUCIBLE
62
026090e8 63PDNS_WITH_LUA([mandatory])
7e03f04c
RG
64AS_IF([test "x$LUAPC" = "xluajit"], [
65 # export all symbols to be able to use the Lua FFI interface
66 AC_MSG_NOTICE([Adding -rdynamic to export all symbols for the Lua FFI interface])
f1f50454 67 LDFLAGS="$LDFLAGS -rdynamic"
7e03f04c
RG
68])
69
9a927586 70PDNS_CHECK_LUA_HPP
0c6f6275
PL
71
72PDNS_ENABLE_VERBOSE_LOGGING
73
74# Crypto libraries
74d83458 75PDNS_CHECK_LIBCRYPTO([
df85a9a0 76],[
74d83458
PL
77 AC_MSG_ERROR([OpenSSL/libcrypto not found])
78 ]
79)
80PDNS_CHECK_LIBCRYPTO_ECDSA
f4bd644d 81PDNS_CHECK_LIBCRYPTO_EDDSA
cb264691 82PDNS_WITH_LIBSODIUM
ee89ca58 83PDNS_WITH_LIBDECAF
1f2b341e 84PDNS_WITH_LIBCAP
0c6f6275 85
d705aad9
RG
86PDNS_WITH_NET_SNMP
87
0c6f6275 88# check for tools we might need
29e13421 89PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
0c6f6275
PL
90PDNS_CHECK_CURL
91
e97cb679 92AC_CHECK_FUNCS_ONCE([strcasestr getrandom arc4random])
0c6f6275 93
8fd25133
RG
94PDNS_CHECK_PTHREAD_NP
95
8c8b9197 96AC_SUBST([socketdir])
0c6f6275
PL
97socketdir="/var/run"
98AC_ARG_WITH([socketdir],
8c8b9197 99 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
0c6f6275
PL
100 [socketdir="$withval"]
101)
102
af1377b7
NC
103PDNS_ENABLE_NOD
104
81d510b1
NC
105AM_COND_IF([NOD_ENABLED],
106 [
107 BOOST_FILESYSTEM
108 AS_IF([test -z "$BOOST_FILESYSTEM_LIBS"], [ AC_MSG_ERROR([Boost filesystem library is not installed])])],
109 [])
110
af1377b7 111AC_SUBST([nodcachedir])
bc39363f 112nodcachedir='${localstatedir}/lib/pdns-recursor'
af1377b7 113AC_ARG_WITH([nod-cache-dir],
bc39363f 114 [AS_HELP_STRING([--with-nodcachedir], [where newly observed domain cache files live @<:@default=LOCALSTATEDIR/lib/pdns-recursor@:>@])],
af1377b7
NC
115 [nodcachedir="$withval"]
116)
117
ebd67986 118PDNS_CHECK_DNSTAP
7badc366 119
0c6f6275
PL
120AC_MSG_CHECKING([whether we will enable compiler security checks])
121AC_ARG_ENABLE([hardening],
8c8b9197 122 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
0c6f6275
PL
123 [enable_hardening=$enableval],
124 [enable_hardening=yes]
125)
126AC_MSG_RESULT([$enable_hardening])
127
128AS_IF([test "x$enable_hardening" != "xno"], [
129 AC_CC_PIE
130 AC_CC_STACK_PROTECTOR
131 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
132 AC_CC_D_FORTIFY_SOURCE
133 AC_LD_RELRO
134])
135
136PDNS_ENABLE_SANITIZERS
137PDNS_ENABLE_MALLOC_TRACE
ec7fcc43 138PDNS_ENABLE_VALGRIND
6b6720de 139AX_AVAILABLE_SYSTEMD
a3dfb540 140AX_CHECK_SYSTEMD_FEATURES
6b6720de 141AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
7e6d27b7 142PDNS_WITH_SERVICE_USER([pdns-recursor])
223bb49e 143PDNS_CHECK_VIRTUALENV
0c6f6275
PL
144
145AC_SUBST(LIBS)
146
147AC_SUBST([AM_CPPFLAGS],
148 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
149)
150
151AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
23448838 152AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
0c6f6275 153
0c6f6275 154LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
5e4a410d
RG
155CFLAGS="$PIE_CFLAGS $CFLAGS"
156CXXFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CXXFLAGS"
157PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
158AC_SUBST([PROGRAM_LDFLAGS])
0c6f6275
PL
159
160AC_CONFIG_FILES([Makefile
161 ext/Makefile
162 ext/json11/Makefile
af1377b7 163 ext/probds/Makefile
0c6f6275
PL
164 ext/yahttp/Makefile
165 ext/yahttp/yahttp/Makefile])
166
167AC_OUTPUT
231da4c6
PL
168
169AC_MSG_NOTICE([])
170AC_MSG_NOTICE([Configuration summary])
171AC_MSG_NOTICE([=====================])
172AC_MSG_NOTICE([])
173AS_IF([test "x$pdns_configure_args" != "x"],
174 [summary_conf_opts=$pdns_configure_args],
175 [summary_conf_opts="(no options)"]
176)
177AC_MSG_NOTICE([PowerDNS Recursor configured with: $summary_conf_opts])
178AC_MSG_NOTICE([])
179AC_MSG_NOTICE([CC: $CC])
180AC_MSG_NOTICE([CXX: $CXX])
181AC_MSG_NOTICE([LD: $LD])
182AC_MSG_NOTICE([CFLAGS: $CFLAGS])
183AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
184AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
185AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
186AC_MSG_NOTICE([LIBS: $LIBS])
231da4c6
PL
187AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
188AC_MSG_NOTICE([])
dab358de
PL
189AC_MSG_NOTICE([Features enabled])
190AC_MSG_NOTICE([----------------])
026090e8 191AC_MSG_NOTICE([Lua: $LUAPC])
74d83458 192AC_MSG_NOTICE([OpenSSL ECDSA: $libcrypto_ecdsa])
f4bd644d
PL
193AS_IF([test "x$LIBSODIUM_LIBS" != "x" || test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed25519" = "xyes"],
194 [AC_MSG_NOTICE([ed25519: yes])],
195 [AC_MSG_NOTICE([ed25519: no])]
a613e8b6 196)
f4bd644d
PL
197AS_IF([test "x$LIBDECAF_LIBS" != "x" || test "x$libcrypto_ed448" = "xyes"],
198 [AC_MSG_NOTICE([ed448: yes])],
199 [AC_MSG_NOTICE([ed448: no])]
21a8834a 200)
231da4c6 201AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"],
dab358de
PL
202 [AC_MSG_NOTICE([Protobuf: yes])],
203 [AC_MSG_NOTICE([Protobuf: no])]
231da4c6 204)
d705aad9
RG
205AS_IF([test "x$NET_SNMP_LIBS" != "x"],
206 [AC_MSG_NOTICE([SNMP: yes])],
207 [AC_MSG_NOTICE([SNMP: no])]
208)
dab358de
PL
209AS_IF([test "x$systemd" != "xn"],
210 [AC_MSG_NOTICE([systemd: yes])],
211 [AC_MSG_NOTICE([systemd: no])]
231da4c6 212)
81d510b1 213AM_COND_IF([NOD_ENABLED],
af1377b7
NC
214 [AC_MSG_NOTICE([nod: yes])],
215 [AC_MSG_NOTICE([nod: no])]
216)
ebd67986 217AM_COND_IF([FSTRM],
7badc366
OM
218 [AC_MSG_NOTICE([dnstap: yes])],
219 [AC_MSG_NOTICE([dnstap: no])]
220)
0079fda2 221AC_MSG_NOTICE([Context library: $pdns_context_library])
231da4c6 222AC_MSG_NOTICE([])