]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/recursordist/configure.ac
Merge pull request #5504 from rgacogne/dnsdist-nmg-dest
[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
13: ${CFLAGS="-Wall -g -O2"}
14: ${CXXFLAGS="-Wall -g -O2"}
15
16AC_SUBST([pdns_configure_args],["$ac_configure_args"])
17AC_DEFINE_UNQUOTED([PDNS_CONFIG_ARGS],
18 ["$pdns_configure_args"],
19 [pdns-recursor configure arguments]
20)
21
22AC_PROG_CC
23AC_PROG_CXX
24AC_LANG([C++])
25
26AC_DEFINE([_GNU_SOURCE], [1],
27 [Define _GNU_SOURCE so that we get all necessary prototypes]
28)
29
acbfb1c1
PL
30AC_DEFINE([RECURSOR], [1],
31 [This is the PowerDNS Recursor]
32)
33
0c6f6275 34# Warn when pkg.m4 is missing
8c8b9197 35m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-config])
0c6f6275 36
8c8b9197 37AX_CXX_COMPILE_STDCXX_11([ext], [mandatory])
0c6f6275
PL
38AC_PROG_LIBTOOL
39
40PDNS_CHECK_OS
e10b6528 41PDNS_CHECK_NETWORK_LIBS
0c6f6275 42
e512f4f9
AN
43# Boost Context was introduced in 1.51 (Aug 2012), but there was an immediate
44# API break in 1.52 (Nov 2012), so we only support that, and later.
0079fda2 45pdns_context_library="System V ucontexts"
e512f4f9 46
7158b2f5 47AC_DEFUN([PDNS_SELECT_CONTEXT_IMPL], [
e512f4f9 48 AC_MSG_CHECKING([whether Boost is new enough to use the context library...])
f53de853 49 if test $boost_major_version -ge 152; then
e512f4f9
AN
50 AC_MSG_RESULT([yes])
51 if test $boost_major_version -ge 157; then
52 BOOST_THREAD([$1])
53 m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
54 LIBS="$LIBS $BOOST_THREAD_LIBS"
55 LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
56 fi
57 AC_MSG_NOTICE([checking whether the Boost context library actually links...])
f53de853
RG
58 if test $boost_major_version -ge 161; then
59 BOOST_FIND_HEADER([boost/context/detail/fcontext.hpp], [ : ], [
60 BOOST_FIND_LIB([context], [$1], [boost/context/detail/fcontext.hpp], [[]])
61 ])
62 else
63 BOOST_FIND_HEADER([boost/context/fcontext.hpp], [ : ], [
64 BOOST_FIND_LIB([context], [$1], [boost/context/fcontext.hpp], [[]])
65 ])
66 fi
e512f4f9
AN
67 case $boost_cv_lib_context in
68 (yes)
0079fda2 69 pdns_context_library="Boost context"
e512f4f9
AN
70 AC_MSG_NOTICE([MTasker will use the Boost context library for context switching])
71 ;;
72 *)
73 AC_MSG_NOTICE([Boost context library is missing])
74 AC_MSG_NOTICE([MTasker will use System V ucontexts for context switching])
75 ;;
76 esac
77 else
78 AC_MSG_RESULT([no])
79 AC_MSG_NOTICE([MTasker will use System V ucontexts for context switching])
80 fi
7158b2f5
AN
81])
82
85c7ca75
PD
83PDNS_CHECK_CLOCK_GETTIME
84
aa4c56be
PL
85boost_required_version=1.35
86
87PDNS_WITH_PROTOBUF
88AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"],
89 # The protobuf code needs boost::uuid, which is available from 1.42 onward
d778e06d
PL
90 [AC_MSG_WARN([Bumping minimal Boost requirement to 1.42. To keep the requirement at 1.35, disable protobuf support])
91 boost_required_version=1.42]
aa4c56be
PL
92)
93
94BOOST_REQUIRE([$boost_required_version])
7158b2f5
AN
95PDNS_SELECT_CONTEXT_IMPL
96
35d883a8 97PDNS_ENABLE_UNIT_TESTS
0c6f6275
PL
98PDNS_ENABLE_REPRODUCIBLE
99
100PDNS_WITH_LUAJIT
101AS_IF([test "x$with_luajit" = "xno"], [
102 PDNS_WITH_LUA
103])
c790f462
PD
104AS_IF([test "x$LUAPC" = "x" -a "x$LUAJITPC" = "x"], [
105 AC_MSG_ERROR([Neither Lua nor LuaJIT found, Lua support is not optional])
106])
9a927586 107PDNS_CHECK_LUA_HPP
0c6f6275
PL
108
109PDNS_ENABLE_VERBOSE_LOGGING
110
111# Crypto libraries
0c6f6275 112PDNS_ENABLE_BOTAN
74d83458 113PDNS_CHECK_LIBCRYPTO([
df85a9a0 114],[
74d83458
PL
115 AC_MSG_ERROR([OpenSSL/libcrypto not found])
116 ]
117)
118PDNS_CHECK_LIBCRYPTO_ECDSA
d1b28475 119PDNS_CHECK_LIBSODIUM
21a8834a 120PDNS_CHECK_LIBDECAF
0c6f6275 121
d705aad9
RG
122PDNS_WITH_NET_SNMP
123
0c6f6275
PL
124# check for tools we might need
125PDNS_CHECK_RAGEL
126PDNS_CHECK_CURL
127
128AC_CHECK_FUNCS([strcasestr])
129
8c8b9197 130AC_SUBST([socketdir])
0c6f6275
PL
131socketdir="/var/run"
132AC_ARG_WITH([socketdir],
8c8b9197 133 [AS_HELP_STRING([--with-socketdir], [where the controlsocket lives @<:@default=/var/run@:>@])],
0c6f6275
PL
134 [socketdir="$withval"]
135)
136
137AC_MSG_CHECKING([whether we will enable compiler security checks])
138AC_ARG_ENABLE([hardening],
8c8b9197 139 [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
0c6f6275
PL
140 [enable_hardening=$enableval],
141 [enable_hardening=yes]
142)
143AC_MSG_RESULT([$enable_hardening])
144
145AS_IF([test "x$enable_hardening" != "xno"], [
146 AC_CC_PIE
147 AC_CC_STACK_PROTECTOR
148 AC_CC_PARAM_SSP_BUFFER_SIZE([4])
149 AC_CC_D_FORTIFY_SOURCE
150 AC_LD_RELRO
151])
152
153PDNS_ENABLE_SANITIZERS
154PDNS_ENABLE_MALLOC_TRACE
ec7fcc43 155PDNS_ENABLE_VALGRIND
6b6720de
PL
156AX_AVAILABLE_SYSTEMD
157AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
223bb49e 158PDNS_CHECK_VIRTUALENV
0c6f6275
PL
159
160AC_SUBST(LIBS)
161
162AC_SUBST([AM_CPPFLAGS],
163 ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
164)
165
166AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
23448838 167AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
0c6f6275 168
0c6f6275 169LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
5e4a410d
RG
170CFLAGS="$PIE_CFLAGS $CFLAGS"
171CXXFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CXXFLAGS"
172PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
173AC_SUBST([PROGRAM_LDFLAGS])
0c6f6275
PL
174
175AC_CONFIG_FILES([Makefile
176 ext/Makefile
177 ext/json11/Makefile
178 ext/yahttp/Makefile
179 ext/yahttp/yahttp/Makefile])
180
181AC_OUTPUT
231da4c6
PL
182
183AC_MSG_NOTICE([])
184AC_MSG_NOTICE([Configuration summary])
185AC_MSG_NOTICE([=====================])
186AC_MSG_NOTICE([])
187AS_IF([test "x$pdns_configure_args" != "x"],
188 [summary_conf_opts=$pdns_configure_args],
189 [summary_conf_opts="(no options)"]
190)
191AC_MSG_NOTICE([PowerDNS Recursor configured with: $summary_conf_opts])
192AC_MSG_NOTICE([])
193AC_MSG_NOTICE([CC: $CC])
194AC_MSG_NOTICE([CXX: $CXX])
195AC_MSG_NOTICE([LD: $LD])
196AC_MSG_NOTICE([CFLAGS: $CFLAGS])
197AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
198AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
199AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
200AC_MSG_NOTICE([LIBS: $LIBS])
231da4c6
PL
201AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
202AC_MSG_NOTICE([])
dab358de
PL
203AC_MSG_NOTICE([Features enabled])
204AC_MSG_NOTICE([----------------])
231da4c6 205AS_IF([test "x$LUAPC" != "x"],
dab358de
PL
206 [AC_MSG_NOTICE([Lua: $LUAPC])],
207 [AS_IF([test "x$LUAJITPC" != "x"],
208 [AC_MSG_NOTICE([LuaJit: $LUAJITPC])],
209 [AC_MSG_NOTICE([Lua/LuaJit: no])])
210])
74d83458 211AC_MSG_NOTICE([OpenSSL ECDSA: $libcrypto_ecdsa])
a613e8b6
PL
212AS_IF([test "x$LIBSODIUM_LIBS" != "x"],
213 [AC_MSG_NOTICE([libsodium ed25519: yes])],
214 [AC_MSG_NOTICE([libsodium ed25519: no])]
215)
21a8834a
KM
216AS_IF([test "x$LIBDECAF_LIBS" != "x"],
217 [AC_MSG_NOTICE([libdecaf ed25519 and ed448: yes])],
218 [AC_MSG_NOTICE([libdecaf ed25519 and ed448: no])]
219)
231da4c6 220AS_IF([test "x$PROTOBUF_LIBS" != "x" -a x"$PROTOC" != "x"],
dab358de
PL
221 [AC_MSG_NOTICE([Protobuf: yes])],
222 [AC_MSG_NOTICE([Protobuf: no])]
231da4c6 223)
d705aad9
RG
224AS_IF([test "x$NET_SNMP_LIBS" != "x"],
225 [AC_MSG_NOTICE([SNMP: yes])],
226 [AC_MSG_NOTICE([SNMP: no])]
227)
dab358de
PL
228AS_IF([test "x$systemd" != "xn"],
229 [AC_MSG_NOTICE([systemd: yes])],
230 [AC_MSG_NOTICE([systemd: no])]
231da4c6 231)
0079fda2 232AC_MSG_NOTICE([Context library: $pdns_context_library])
231da4c6 233AC_MSG_NOTICE([])