+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE[
+ #include <thread>
+ #include <chrono>
+ void func() { std::this_thread::sleep_for(std::chrono::seconds(1)); }]],
+ [AC_DEFINE([HAVE_STD__THIS_THREAD__SLEEP_FOR], [1],
+ [Define to 1 if std::this_thread::sleep_for() is defined.])])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE[
+ #include <cstring>
+ static constexpr int val = strlen("foo");]],
+ [AC_DEFINE([HAVE_CONSTEXPR_STRLEN], [1],
+ [Define to 1 if strlen(3) is constexpr.])])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE[
+ #include <type_traits>
+ #if !_LIBCPP_VERSION
+ #error No libc++
+ #endif
+ void func() {}]
+ ],
+ [AC_DEFINE([USE_LIBCPP], [1], [Define to 1 if we're using libc++.])])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE[
+ #include <type_traits>
+ const bool val = std::is_trivially_copyable<bool>::value;]
+ ],
+ [AC_DEFINE([HAVE_STD__IS_TRIVIALLY_COPYABLE], [1],
+ [Define to 1 if we have a usable std::is_trivially_copyable<T>
+ implementation.])])
+
+# Figure out if we support weak symbols. If not, we will link in some null
+# stubs for functions that would otherwise be weak.
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE[
+ extern "C" void configure_link_extern_weak_test() __attribute__((weak));
+ int main(int argc, char** argv) {
+ return configure_link_extern_weak_test == nullptr;
+ }]
+ ],
+ [
+ ac_have_weak_symbols="yes"
+ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+ [Define to 1 if the linker supports weak symbols.])])
+
+# Check for clock_gettime(2). This is not in an AC_CHECK_FUNCS() because we
+# want to link with librt if necessary.
+AC_SEARCH_LIBS([clock_gettime], [rt],
+ AC_DEFINE(
+ [HAVE_CLOCK_GETTIME],
+ [1],
+ [Define to 1 if we support clock_gettime(2).]),
+ [])
+