From 7b5002f84bd4248be96599992a484a5e28b976d2 Mon Sep 17 00:00:00 2001 From: Bushstar Date: Thu, 23 Nov 2023 10:35:20 +0000 Subject: [PATCH] build: Avoid BOOST_NO_CXX98_FUNCTION_BASE macro redefinition --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 7f98de8ba74..cd9d461742d 100644 --- a/configure.ac +++ b/configure.ac @@ -1061,10 +1061,12 @@ fi if test x$use_boost = xyes; then - 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 Prevent use of std::unary_function, which was removed in C++17, + 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_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB" LIBS="$BOOST_LIBS $LIBS"