Changeset View
Changeset View
Standalone View
Standalone View
configure.ac
Show First 20 Lines • Show All 792 Lines • ▼ Show 20 Lines | |||||
AX_BOOST_PROGRAM_OPTIONS | AX_BOOST_PROGRAM_OPTIONS | ||||
AX_BOOST_THREAD | AX_BOOST_THREAD | ||||
AX_BOOST_CHRONO | AX_BOOST_CHRONO | ||||
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic | dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic | ||||
dnl counter implementations. In 1.63 and later the std::atomic approach is default. | dnl counter implementations. In 1.63 and later the std::atomic approach is default. | ||||
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro | m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro | ||||
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS" | BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS" | ||||
if test x$use_reduce_exports = xyes; then | |||||
AC_MSG_CHECKING([for working boost reduced exports]) | |||||
TEMP_CPPFLAGS="$CPPFLAGS" | |||||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" | |||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ | |||||
@%:@include <boost/version.hpp> | |||||
]], [[ | |||||
#if BOOST_VERSION >= 104900 | |||||
// Everything is okay | |||||
#else | |||||
# error Boost version is too old | |||||
#endif | |||||
]])],[ | |||||
AC_MSG_RESULT(yes) | |||||
],[ | |||||
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.]) | |||||
]) | |||||
CPPFLAGS="$TEMP_CPPFLAGS" | |||||
fi | |||||
fi | fi | ||||
if test x$use_reduce_exports = xyes; then | if test x$use_reduce_exports = xyes; then | ||||
CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" | CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" | ||||
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) | AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) | ||||
fi | fi | ||||
if test x$use_tests = xyes; then | if test x$use_tests = xyes; then | ||||
Show All 24 Lines | AC_LINK_IFELSE([AC_LANG_SOURCE([ | ||||
[AC_MSG_RESULT(no)]) | [AC_MSG_RESULT(no)]) | ||||
LIBS="$TEMP_LIBS" | LIBS="$TEMP_LIBS" | ||||
CPPFLAGS="$TEMP_CPPFLAGS" | CPPFLAGS="$TEMP_CPPFLAGS" | ||||
fi | fi | ||||
fi | fi | ||||
if test x$use_boost = xyes; then | 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" | 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" | |||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |||||
AC_MSG_CHECKING([for mismatched boost c++11 scoped enums]) | |||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |||||
#include <boost/config.hpp> | |||||
#include <boost/version.hpp> | |||||
#if !defined(BOOST_NO_SCOPED_ENUMS) && !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && BOOST_VERSION < 105700 | |||||
#define BOOST_NO_SCOPED_ENUMS | |||||
#define BOOST_NO_CXX11_SCOPED_ENUMS | |||||
#define CHECK | |||||
#endif | |||||
#include <boost/filesystem.hpp> | |||||
]],[[ | |||||
#if defined(CHECK) | |||||
boost::filesystem::copy_file("foo", "bar"); | |||||
#else | |||||
choke; | |||||
#endif | |||||
]])], | |||||
[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" | |||||
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however | |||||
dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if | |||||
dnl a working version is available, else fall back to sleep. sleep was removed | |||||
dnl after 1.56. | |||||
dnl If neither is available, abort. | |||||
TEMP_LIBS="$LIBS" | |||||
LIBS="$BOOST_LIBS $LIBS" | |||||
TEMP_CPPFLAGS="$CPPFLAGS" | |||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |||||
#include <boost/thread/thread.hpp> | |||||
#include <boost/version.hpp> | |||||
]],[[ | |||||
#if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200) | |||||
boost::this_thread::sleep_for(boost::chrono::milliseconds(0)); | |||||
#else | |||||
choke me | |||||
#endif | |||||
]])], | |||||
[boost_sleep=yes; | |||||
AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])], | |||||
[boost_sleep=no]) | |||||
LIBS="$TEMP_LIBS" | |||||
CPPFLAGS="$TEMP_CPPFLAGS" | |||||
if test x$boost_sleep != xyes; then | |||||
TEMP_LIBS="$LIBS" | |||||
LIBS="$BOOST_LIBS $LIBS" | |||||
TEMP_CPPFLAGS="$CPPFLAGS" | |||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" | |||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | |||||
#include <boost/version.hpp> | |||||
#include <boost/thread.hpp> | |||||
#include <boost/date_time/posix_time/posix_time_types.hpp> | |||||
]],[[ | |||||
#if BOOST_VERSION <= 105600 | |||||
boost::this_thread::sleep(boost::posix_time::milliseconds(0)); | |||||
#else | |||||
choke me | |||||
#endif | |||||
]])], | |||||
[boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])], | |||||
[boost_sleep=no]) | |||||
LIBS="$TEMP_LIBS" | |||||
CPPFLAGS="$TEMP_CPPFLAGS" | |||||
fi | |||||
if test x$boost_sleep != xyes; then | |||||
AC_MSG_ERROR(No working boost sleep implementation found.) | |||||
fi | |||||
fi | fi | ||||
if test x$use_pkgconfig = xyes; then | if test x$use_pkgconfig = xyes; then | ||||
: dnl | : dnl | ||||
m4_ifdef( | m4_ifdef( | ||||
[PKG_CHECK_MODULES], | [PKG_CHECK_MODULES], | ||||
[ | [ | ||||
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) | PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)]) | ||||
▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines |