diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-01-16 10:49:40 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-01-16 10:49:46 +0100 |
commit | fd9356ba4eb5b3053caf506c750ec4cecb761b6d (patch) | |
tree | 11f1790c116ab655e2204f52f317c783ae1ea167 /configure.ac | |
parent | e1060c56cca7eeab8e217eb7b416c16487fd175e (diff) | |
parent | c0cf48d1ac5b661aa1dfbcd284c773f8f5bbe806 (diff) | |
download | bitcoin-fd9356ba4eb5b3053caf506c750ec4cecb761b6d.tar.xz |
Merge pull request #7322
c0cf48d c++11: add scoped enum fallbacks to CPPFLAGS rather than defining them locally (Cory Fields)
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 07f9a4a6f3..347016064c 100644 --- a/configure.ac +++ b/configure.ac @@ -619,6 +619,17 @@ if test x$use_boost = xyes; then BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB" + +dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums +dnl using c++98 constructs. Unfortunately, this implementation detail leaked into +dnl the abi. This was fixed in 1.57. + +dnl When building against that installed version using c++11, the headers pick up +dnl on the native c++11 scoped enum support and enable it, however it will fail to +dnl link. This can be worked around by disabling c++11 scoped enums if linking will +dnl fail. +dnl BOOST_NO_SCOPED_ENUMS was changed to BOOST_NO_CXX11_SCOPED_ENUMS in 1.51. + TEMP_LIBS="$LIBS" LIBS="$BOOST_LIBS $LIBS" TEMP_CPPFLAGS="$CPPFLAGS" @@ -640,7 +651,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ choke; #endif ]])], - [AC_MSG_RESULT(mismatched); AC_DEFINE(FORCE_BOOST_EMULATED_SCOPED_ENUMS, 1, [Define this symbol if boost scoped enums are emulated])], [AC_MSG_RESULT(ok)]) + [AC_MSG_RESULT(mismatched); BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS"], [AC_MSG_RESULT(ok)]) LIBS="$TEMP_LIBS" CPPFLAGS="$TEMP_CPPFLAGS" |