Skip to content

Commit

Permalink
build: Avoid BOOST_NO_CXX98_FUNCTION_BASE macro redefinition (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar authored Nov 28, 2023
1 parent 5455aa5 commit c875196
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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/config.hpp>]])])

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB"
LIBS="$BOOST_LIBS $LIBS"
Expand Down

0 comments on commit c875196

Please sign in to comment.