Autotools: Check if std::chrono and std::random are available.

If yes, don't even try to find their Boost equivalents.
This commit is contained in:
sledgehammer_999 2017-09-09 04:30:17 +03:00 committed by Arvid Norberg
parent 43d7f980d0
commit d93869ff3b
1 changed files with 27 additions and 7 deletions

View File

@ -123,17 +123,27 @@ AX_BOOST_SYSTEM()
AS_IF([test -z "$BOOST_SYSTEM_LIB"], AS_IF([test -z "$BOOST_SYSTEM_LIB"],
[AC_MSG_ERROR(Boost.System library not found. Try using --with-boost-system=lib)]) [AC_MSG_ERROR(Boost.System library not found. Try using --with-boost-system=lib)])
AX_BOOST_CHRONO() AC_LANG_PUSH([C++])
AS_IF([test -z "$BOOST_CHRONO_LIB"], AC_CHECK_HEADERS([chrono])
[AC_MSG_ERROR(Boost.Chrono library not found. Try using --with-boost-chrono=lib)]) AC_CHECK_HEADERS([random])
AC_LANG_POP
AX_BOOST_RANDOM() AS_IF([test "x$ac_cv_header_chrono" = "xno"],
AS_IF([test -z "$BOOST_RANDOM_LIB"], [AX_BOOST_CHRONO()
[AC_MSG_ERROR(Boost.Random library not found. Try using --with-boost-random=lib)]) AS_IF([test -z "$BOOST_CHRONO_LIB"],
[AC_MSG_ERROR(Boost.Chrono library not found. Try using --with-boost-chrono=lib)])
LIBS="$BOOST_CHRONO_LIB $LIBS"
])
AS_IF([test "x$ac_cv_header_random" = "xno"],
[AX_BOOST_RANDOM()
AS_IF([test -z "$BOOST_RANDOM_LIB"],
[AC_MSG_ERROR(Boost.Random library not found. Try using --with-boost-random=lib)])
LIBS="$BOOST_RANDOM_LIB $LIBS"
])
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS" LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
LIBS="$BOOST_CHRONO_LIB $BOOST_RANDOM_LIB $LIBS"
############################################################################### ###############################################################################
# Checking for functions and other stuffs # Checking for functions and other stuffs
@ -642,9 +652,19 @@ Boost libraries:
CPPFlags: ${BOOST_CPPFLAGS} CPPFlags: ${BOOST_CPPFLAGS}
LDFlags: ${BOOST_LDFLAGS} LDFlags: ${BOOST_LDFLAGS}
boost.system: ${BOOST_SYSTEM_LIB} boost.system: ${BOOST_SYSTEM_LIB}
END
AS_IF([test "x$ac_cv_header_chrono" = "xno"], [
cat >> config.report << END
boost.chrono: ${BOOST_CHRONO_LIB} boost.chrono: ${BOOST_CHRONO_LIB}
END
])
AS_IF([test "x$ac_cv_header_random" = "xno"], [
cat >> config.report << END
boost.random: ${BOOST_RANDOM_LIB} boost.random: ${BOOST_RANDOM_LIB}
END END
])
AS_IF([test "x$ARG_ENABLE_PYTHON_BINDING" = "xyes"], [ AS_IF([test "x$ARG_ENABLE_PYTHON_BINDING" = "xyes"], [
cat >> config.report << END cat >> config.report << END