]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move minmial boost version to 1.54
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 6 Sep 2024 14:12:47 +0000 (16:12 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 9 Sep 2024 07:10:35 +0000 (09:10 +0200)
14 files changed:
configure.ac
docs/Makefile.am
docs/appendices/compiling.rst
meson.build
meson/boost/meson.build
pdns/Makefile.am
pdns/dnsdistdist/configure.ac
pdns/dnsscope.cc
pdns/dnswriter.cc
pdns/recursordist/configure.ac
pdns/recursordist/docs/appendices/compiling.rst
pdns/recursordist/meson.build
pdns/recursordist/pdns_recursor.cc
pdns/recursordist/rec-main.hh

index 93a4e8cee71534765f1dc6fd805cd0cb6f3bb407..011b5a7ec61e7a2def8629ee7f228d7d12b85718 100644 (file)
@@ -114,13 +114,7 @@ PDNS_ENABLE_IPCIPHER
 PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com])
 PDNS_CHECK_CLOCK_GETTIME
 
-BOOST_REQUIRE([1.42])
-# Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+
-# to be compatible with C++11
-AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148])
-AS_IF([test "$boost_major_version" -ge 148], [
-  AC_DEFINE(HAVE_BOOST_GE_148, [1], [Define to 1 if you have boost >= 1.48])
-])
+BOOST_REQUIRE([1.54])
 
 BOOST_PROGRAM_OPTIONS([mt])
 AS_IF([test "$boost_cv_lib_program_options" = "no"], [
index f9dab778a603a61f8ae7c540adcced6be5813ecf..f66969b91aedb18b6997b06cfc3d3a34204a5792 100644 (file)
@@ -36,10 +36,8 @@ MANPAGES_DIST += $(MANPAGES_TARGET_TOOLS) \
        dnsbulktest.1 \
        dnstcpbench.1
 
-if HAVE_BOOST_GE_148
 MANPAGES_INSTALL += dnsbulktest.1 \
        dnstcpbench.1
-endif
 
 if TOOLS
 MANPAGES_INSTALL += $(MANPAGES_TARGET_TOOLS)
index 6d165b4a1f52293deb4ea1dea2016f6a7873a80f..97fda12ff0c74bf8da87861f890a189bff8dda75 100644 (file)
@@ -42,7 +42,7 @@ Furthermore, the Makefiles require GNU make, not BSD make.
 
 By default, the PowerDNS Authoritative Server requires the following libraries and headers:
 
-* `Boost <http://boost.org/>`_ 1.35 or newer
+* `Boost <http://boost.org/>`_ 1.54 or newer
 * `OpenSSL <https://openssl.org>`_
 
 To build from a Git repository clone, the following dependencies are also required:
index 0b426d1875cb2352fc991658287721e3fe7430d4..65598a86ada4808b59bd74f2bec3f01a4d910e98 100644 (file)
@@ -805,6 +805,14 @@ if get_option('tools')
       'main': src_dir / 'ixplore.cc',
       'manpages': ['ixplore.1'],
     },
+    'dnstcpbench': {
+      'main': src_dir / 'dnstcpbench.cc',
+      'manpages': ['dnstcpbench.1'],
+    },
+    'dnsbulktest': {
+      'main': src_dir / 'dnsbulktest.cc',
+      'manpages': ['dnsbulktest.1'],
+    },
     # Broken
     # 'comfun' : {
     #   'main': src_dir / 'comfun.cc',
@@ -833,18 +841,6 @@ if get_option('tools')
     src_dir / 'tcpiohandler.hh',
   )
 
-  if have_boost_1_48_0
-    tools += {
-      'dnstcpbench': {
-        'main': src_dir / 'dnstcpbench.cc',
-        'manpages': ['dnstcpbench.1'],
-      },
-      'dnsbulktest': {
-        'main': src_dir / 'dnsbulktest.cc',
-        'manpages': ['dnsbulktest.1'],
-      },
-    }
-  endif
 endif
 
 if get_option('tools-ixfrdist')
index 943f0c4d803686822215c8641f520e4a609898fa..76e97576bb32e5d1f7216d6c16e70575a076f283 100644 (file)
@@ -1,8 +1,4 @@
-dep_boost = dependency('boost', version: '>= 1.42', required: true)
-# Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ to be compatible
-# with C++11.
-have_boost_1_48_0 = dep_boost.version().version_compare('>= 1.48.0')
-conf.set('HAVE_BOOST_GE_148', have_boost_1_48_0, description: 'Boost version >= 1.48.0')
+dep_boost = dependency('boost', version: '>= 1.54', required: true)
 # conf.set('BOOST_CONTAINER_USE_STD_EXCEPTIONS', true, description: 'Boost use std exceptions')
 add_project_arguments('-DBOOST_CONTAINER_USE_STD_EXCEPTIONS', language: ['c', 'cpp'])
 summary('Boost', dep_boost.found(), bool_yn: true, section: 'Boost')
index bee1d58ef06d9ef2bf07f4dd03bf6c1ab84a515a..2522839a0f3cbbb4a8d016828e1b6c2931bba5d2 100644 (file)
@@ -145,11 +145,9 @@ bin_PROGRAMS += \
 
 bin_PROGRAMS += calidns
 
-if HAVE_BOOST_GE_148
 bin_PROGRAMS += \
        dnsbulktest \
        dnstcpbench
-endif
 
 endif # TOOLS
 
@@ -1533,13 +1531,8 @@ noinst_PROGRAMS = speedtest
 
 if UNIT_TESTS
 noinst_PROGRAMS += testrunner
-if HAVE_BOOST_GE_148
 TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message BOOST_TEST_RANDOM=1 SRCDIR='$(srcdir)'
 TESTS=testrunner
-else
-check-local:
-       @echo "Unit tests disabled, boost is too old"
-endif
 
 else
 check-local:
index 3ae9a5f98fb60785f4a8a61f978b47eaebd07a99..aa1892f4c1f750dacfbe5f4af609e31d7800b499 100644 (file)
@@ -39,7 +39,7 @@ PDNS_CHECK_PTHREAD_NP
 PDNS_CHECK_SECURE_MEMSET
 AC_FUNC_STRERROR_R
 
-BOOST_REQUIRE([1.42])
+BOOST_REQUIRE([1.54])
 
 PDNS_ENABLE_UNIT_TESTS
 PDNS_ENABLE_FUZZ_TARGETS
index 9322c392bfd7f695d4b465a267b9cf670f1bf8e3..3495034bf01dc3e6329611e6c4ff970afc2f8e41 100644 (file)
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#ifdef HAVE_BOOST_GE_148
-#include "histog.hh"
-#endif
 
+#include "histog.hh"
 #include "statbag.hh"
 #include "dnspcap.hh"
 #include "dnsparser.hh"
@@ -139,10 +137,8 @@ try
     ("rd", po::value<bool>(), "If set to true, only process RD packets, to false only non-RD, unset: both")
     ("ipv4", po::value<bool>()->default_value(true), "Process IPv4 packets")
     ("ipv6", po::value<bool>()->default_value(true), "Process IPv6 packets")
-#ifdef HAVE_BOOST_GE_148
     ("log-histogram", "Write a log-histogram to file 'log-histogram'")
     ("full-histogram", po::value<double>(), "Write a log-histogram to file 'full-histogram' with this millisecond bin size")
-#endif
     ("filter-name,f", po::value<string>(), "Do statistics only for queries within this domain")
     ("load-stats,l", po::value<string>()->default_value(""), "if set, emit per-second load statistics (questions, answers, outstanding)")
     ("no-servfail-stats", "Don't include servfails in response time stats")
@@ -472,7 +468,6 @@ try
   cout.precision(4);
   sum=0;
 
-#ifdef HAVE_BOOST_GE_148
   if(g_vm.count("log-histogram")) {
     string fname = g_vm["stats-dir"].as<string>()+"/log-histogram";
     ofstream loglog(fname);
@@ -489,8 +484,6 @@ try
       throw runtime_error("Unable to write statistics to "+fname);
     writeFullHistogramFile(cumul, g_vm["full-histogram"].as<double>(), loglog);
   }
-#endif
-
 
   sum=0;
   double lastperc=0, perc=0;
index cc6f32516f9f9afff23cef8c229d56c4473ab191..67ed5c57d12f083bf71ccc0cd7120b88357b77f7 100644 (file)
@@ -217,11 +217,8 @@ template <typename Container> uint16_t GenericDNSPacketWriter<Container>::lookup
   */
   unsigned int bestpos=0;
   *matchLen=0;
-#if BOOST_VERSION >= 105400
-  boost::container::static_vector<uint16_t, 34> nvect, pvect;
-#else
-  vector<uint16_t> nvect, pvect;
-#endif
+  boost::container::static_vector<uint16_t, 34> nvect;
+  boost::container::static_vector<uint16_t, 34> pvect;
 
   try {
     for(auto riter= raw.cbegin(); riter < raw.cend(); ) {
index 43813f2403f8284c1fd321c0a1352c4bc35b6c11..bdc9d94ffaf3bd51aa874d69d600b4a7e54aadad 100644 (file)
@@ -51,10 +51,7 @@ AC_FUNC_STRERROR_R
 
 PDNS_CHECK_CLOCK_GETTIME
 
-BOOST_REQUIRE([1.42])
-
-# Check against flat_set header that requires boost >= 1.48
-BOOST_FIND_HEADER([boost/container/flat_set.hpp], [AC_MSG_NOTICE([boost::container::flat_set not available, will fallback to std::set])])
+BOOST_REQUIRE([1.54])
 
 # Boost Context was introduced in 1.51 (Aug 2012), but there was an immediate
 # API break in 1.52 (Nov 2012), so we only support that, and later.
index 7827ff2f6a24cfbd5539cbd0dcc9b997f271e988..f9e462b11233dc4964f54881f78a5303caf9eca9 100644 (file)
@@ -36,7 +36,7 @@ Starting with version 5, a Rust compiler is needed.
 
 By default, the :program:`Recursor` requires the following libraries and headers:
 
-* `Boost <http://boost.org/>`_ 1.35 or newer
+* `Boost <http://boost.org/>`_ 1.54 or newer
 * `Lua <http://www.lua.org/>`_ 5.1+ or `LuaJit <http://luajit.org/>`_
 * `OpenSSL <https://openssl.org>`_
 * For :program:`Recursor` version 5 and higher, `cargo <https://www.rust-lang.org/tools/install>`_ version 1.64 or newer.
index b3db25c9b13f3b65fb5b473b81d4f348c2080fa2..1be86449c0f64159ba58cb41c25f477ccb889b77 100644 (file)
@@ -200,7 +200,7 @@ foreach name, info: conditional_sources
   endif
 endforeach
 
-conf.set('HAVE_BOOST_CONTAINER_FLAT_SET_HPP', have_boost_1_48_0, description: 'Boost version >= 1.48.0 has boost::container::flat_set')
+conf.set('HAVE_BOOST_CONTAINER_FLAT_SET_HPP', true)
 
 # Generate config.h
 config_h = configure_file(configuration: conf, output: 'config.h')
index e636cf57a86f1deae8b5bf01fe85bd38d6a9a82c..d550ffdd8c1293e9f84783b6656e44b6875574cb 100644 (file)
@@ -79,11 +79,7 @@ bool g_reusePort{false};
 bool g_gettagNeedsEDNSOptions{false};
 bool g_useKernelTimestamp;
 std::atomic<uint32_t> g_maxCacheEntries, g_maxPacketCacheEntries;
-#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP
 boost::container::flat_set<uint16_t> g_avoidUdpSourcePorts;
-#else
-std::set<uint16_t> g_avoidUdpSourcePorts;
-#endif
 uint16_t g_minUdpSourcePort;
 uint16_t g_maxUdpSourcePort;
 double g_balancingFactor;
index 40b75a6a848c5edee274e1592bdd807d9c7ab762..4423ffcf8b4ca38c18160891fd77d84776a5d7a7 100644 (file)
@@ -43,9 +43,7 @@
 #include "nod.hh"
 #endif /* NOD_ENABLED */
 
-#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP
 #include <boost/container/flat_set.hpp>
-#endif
 
 extern std::shared_ptr<Logr::Logger> g_slogtcpin;
 extern std::shared_ptr<Logr::Logger> g_slogudpin;
@@ -277,11 +275,7 @@ extern thread_local FrameStreamServersInfo t_frameStreamServersInfo;
 extern thread_local FrameStreamServersInfo t_nodFrameStreamServersInfo;
 #endif /* HAVE_FSTRM */
 
-#ifdef HAVE_BOOST_CONTAINER_FLAT_SET_HPP
 extern boost::container::flat_set<uint16_t> g_avoidUdpSourcePorts;
-#else
-extern std::set<uint16_t> g_avoidUdpSourcePorts;
-#endif
 
 /* without reuseport, all listeners share the same sockets */
 typedef vector<pair<int, std::function<void(int, boost::any&)>>> deferredAdd_t;