aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-01-31 14:53:13 +0000
committerfanquake <fanquake@gmail.com>2023-01-31 14:58:52 +0000
commit2b211b41e36f914b8d0487e698b619039cc3c8e2 (patch)
tree21653157da7a80481bfc02a56f265f58f22d8fa5 /configure.ac
parent357d750cab5221695d718e6d3e8ce63fa2b5ab3a (diff)
parentd4c59da8d6e3aac14306249aa12332fed55efebd (diff)
downloadbitcoin-2b211b41e36f914b8d0487e698b619039cc3c8e2.tar.xz
Merge bitcoin/bitcoin#26952: build: Avoid `BOOST_NO_CXX98_FUNCTION_BASE` macro redefinition
d4c59da8d6e3aac14306249aa12332fed55efebd build: Avoid `BOOST_NO_CXX98_FUNCTION_BASE` macro redefinition (Hennadii Stepanov) Pull request description: With GCC 12 and Boost 1.81 (from depends) having multiple warnings: ``` In file included from /home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config.hpp:48: /home/hebasto/bitcoin/depends/x86_64-pc-linux-gnu/include/boost/config/stdlib/libstdcpp3.hpp:397:9: warning: 'BOOST_NO_CXX98_FUNCTION_BASE' macro redefined [-Wmacro-redefined] #define BOOST_NO_CXX98_FUNCTION_BASE ^ <command line>:8:9: note: previous definition is here #define BOOST_NO_CXX98_FUNCTION_BASE 1 ^ 1 warning generated. ``` This PR fixes those warnings. Defining of the `BOOST_NO_CXX98_FUNCTION_BASE` macro was introduced in https://github.com/bitcoin/bitcoin/pull/25436, but since https://github.com/boostorg/config/pull/430, it is required to check it before adding. ACKs for top commit: fanquake: ACK d4c59da8d6e3aac14306249aa12332fed55efebd - it works now. Tree-SHA512: 53b9ddcf8dad729638ed41251e30c80f2d7d1ae3ffe47466865834f1f10184fe0881abeb339b3e46c270c3eb11fb63d19ab12cc9461bf5c2be12b4763c1b1c34
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 5 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index e8414a48ba..aa1a45c527 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1467,9 +1467,11 @@ if test "$use_boost" = "yes"; then
BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION"
dnl Prevent use of std::unary_function, which was removed in C++17,
- dnl and will generate warnings with newer compilers.
- dnl See: https://github.com/boostorg/container_hash/issues/22.
- BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"
+ dnl and will generate warnings with newer compilers for Boost
+ dnl older than 1.80.
+ dnl See: https://github.com/boostorg/config/pull/430.
+ AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR],
+ [AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
if test "$enable_debug" = "yes" || test "$enable_fuzz" = "yes"; then
BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE"