Skip to content

Commit 70452a0

Browse files
committed
build: set minimum required Boost to 1.58
Any systems which only have an older install-able Boost can use depends. Fixes: #19506
1 parent 0f16212 commit 70452a0

File tree

2 files changed

+4
-65
lines changed

2 files changed

+4
-65
lines changed

configure.ac

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,9 +1180,9 @@ fi
11801180
if test x$use_boost = xyes; then
11811181

11821182
dnl Minimum required Boost version
1183-
define(MINIMUM_REQUIRED_BOOST, 1.47.0)
1183+
define(MINIMUM_REQUIRED_BOOST, 1.58.0)
11841184

1185-
dnl Check for boost libs
1185+
dnl Check for Boost libs
11861186
AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
11871187
if test x$want_boost = xno; then
11881188
AC_MSG_ERROR([[only libbitcoinconsensus can be built without boost]])
@@ -1196,25 +1196,7 @@ dnl counter implementations. In 1.63 and later the std::atomic approach is defau
11961196
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
11971197
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"
11981198

1199-
if test x$use_reduce_exports = xyes; then
1200-
AC_MSG_CHECKING([for working boost reduced exports])
1201-
TEMP_CPPFLAGS="$CPPFLAGS"
1202-
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
1203-
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
1204-
@%:@include <boost/version.hpp>
1205-
]], [[
1206-
#if BOOST_VERSION >= 104900
1207-
// Everything is okay
1208-
#else
1209-
# error Boost version is too old
1210-
#endif
1211-
]])],[
1212-
AC_MSG_RESULT(yes)
1213-
],[
1214-
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
1215-
])
1216-
CPPFLAGS="$TEMP_CPPFLAGS"
1217-
fi
1199+
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"
12181200
fi
12191201

12201202
if test x$use_reduce_exports = xyes; then
@@ -1228,7 +1210,6 @@ if test x$use_tests = xyes; then
12281210
AC_MSG_ERROR(hexdump is required for tests)
12291211
fi
12301212

1231-
12321213
if test x$use_boost = xyes; then
12331214

12341215
AX_BOOST_UNIT_TEST_FRAMEWORK
@@ -1254,48 +1235,6 @@ if test x$use_tests = xyes; then
12541235
fi
12551236
fi
12561237

1257-
if test x$use_boost = xyes; then
1258-
1259-
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"
1260-
1261-
1262-
dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
1263-
dnl using c++98 constructs. Unfortunately, this implementation detail leaked into
1264-
dnl the abi. This was fixed in 1.57.
1265-
1266-
dnl When building against that installed version using c++11, the headers pick up
1267-
dnl on the native c++11 scoped enum support and enable it, however it will fail to
1268-
dnl link. This can be worked around by disabling c++11 scoped enums if linking will
1269-
dnl fail.
1270-
dnl BOOST_NO_SCOPED_ENUMS was changed to BOOST_NO_CXX11_SCOPED_ENUMS in 1.51.
1271-
1272-
TEMP_LIBS="$LIBS"
1273-
LIBS="$BOOST_LIBS $LIBS"
1274-
TEMP_CPPFLAGS="$CPPFLAGS"
1275-
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1276-
AC_MSG_CHECKING([for mismatched boost c++11 scoped enums])
1277-
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1278-
#include <boost/config.hpp>
1279-
#include <boost/version.hpp>
1280-
#if !defined(BOOST_NO_SCOPED_ENUMS) && !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && BOOST_VERSION < 105700
1281-
#define BOOST_NO_SCOPED_ENUMS
1282-
#define BOOST_NO_CXX11_SCOPED_ENUMS
1283-
#define CHECK
1284-
#endif
1285-
#include <boost/filesystem.hpp>
1286-
]],[[
1287-
#if defined(CHECK)
1288-
boost::filesystem::copy_file("foo", "bar");
1289-
#else
1290-
choke;
1291-
#endif
1292-
]])],
1293-
[AC_MSG_RESULT(mismatched); BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS"], [AC_MSG_RESULT(ok)])
1294-
LIBS="$TEMP_LIBS"
1295-
CPPFLAGS="$TEMP_CPPFLAGS"
1296-
1297-
fi
1298-
12991238
dnl libevent check
13001239

13011240
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ These are the dependencies currently used by Bitcoin Core. You can find instruct
66
| Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html#third-party-libraries) |
77
| --- | --- | --- | --- | --- | --- |
88
| Berkeley DB | [4.8.30](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No | | |
9-
| Boost | [1.70.0](https://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No | | |
9+
| Boost | [1.70.0](https://www.boost.org/users/download/) | [1.58.0](https://github.com/bitcoin/bitcoin/pull/19667) | No | | |
1010
| Clang | | [3.3+](https://releases.llvm.org/download.html) (C++11 support) | | | |
1111
| Expat | [2.2.7](https://libexpat.github.io/) | | No | Yes | |
1212
| fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) | | No | Yes | |

0 commit comments

Comments
 (0)