diff options
author | Max Kellermann <max@duempel.org> | 2014-06-16 18:32:53 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-06-16 18:39:16 +0200 |
commit | 52594e64d0f48eb83c9bf54eb1ac95a6de881829 (patch) | |
tree | 7374ecc74c7f8fce6bf47848e7c4cf587459c1c1 /configure.ac | |
parent | 3364c1b8939aaf2f758a9396d0b73298042516d9 (diff) | |
download | mpd-52594e64d0f48eb83c9bf54eb1ac95a6de881829.tar.gz mpd-52594e64d0f48eb83c9bf54eb1ac95a6de881829.tar.xz mpd-52594e64d0f48eb83c9bf54eb1ac95a6de881829.zip |
configure.ac: disable exceptions only with Boost 1.54 or newer
See https://svn.boost.org/trac/boost/ticket/7849
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index a60eafdc5..dbbb5a5ac 100644 --- a/configure.ac +++ b/configure.ac @@ -630,8 +630,27 @@ dnl --------------------------------------------------------------------------- dnl Mandatory Libraries dnl --------------------------------------------------------------------------- +no_exceptions=yes + AX_BOOST_BASE([1.46],, [AC_MSG_ERROR([Boost not found])]) +dnl Don't disable exceptions on Boost older than 1.54, because +dnl Boost.Intrusive supports this compiler mode only since 1.54; +dnl see https://svn.boost.org/trac/boost/ticket/7849 +CPPFLAGS_SAVED="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" +export CPPFLAGS +AC_LANG_PUSH(C++) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +@%:@include <boost/version.hpp> +]], [[ +#if BOOST_VERSION < 105400 +#error detected Boost older than 1.54 +#endif +]])],, [no_exceptions=no]) +AC_LANG_POP([C++]) +CPPFLAGS="$CPPFLAGS_SAVED" + AC_ARG_ENABLE(icu, AS_HELP_STRING([--enable-icu], [enable libicu for Unicode (default: enabled)]),, @@ -1726,8 +1745,12 @@ AC_LANG_PUSH([C++]) AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden]) AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics]) AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants]) -AX_APPEND_COMPILE_FLAGS([-fno-exceptions]) -AX_APPEND_COMPILE_FLAGS([-fno-rtti]) + +if test x$no_exceptions = xyes; then + AX_APPEND_COMPILE_FLAGS([-fno-exceptions]) + AX_APPEND_COMPILE_FLAGS([-fno-rtti]) +fi + AX_APPEND_COMPILE_FLAGS([-ffast-math]) AX_APPEND_COMPILE_FLAGS([-ftree-vectorize]) AC_LANG_POP |