From: Francis Dupont Date: Sat, 21 Sep 2019 13:50:29 +0000 (+0200) Subject: [918-check-c-11-thread-support-in-configure] Added checks for C++11 thread, mutex... X-Git-Tag: tmark-pre-35~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32a02fd2542971bae3be30b2eda0aa226dd73685;p=thirdparty%2Fkea.git [918-check-c-11-thread-support-in-configure] Added checks for C++11 thread, mutex and atomic --- diff --git a/m4macros/ax_cpp11.m4 b/m4macros/ax_cpp11.m4 index 17fbda1809..aae1668d42 100644 --- a/m4macros/ax_cpp11.m4 +++ b/m4macros/ax_cpp11.m4 @@ -173,10 +173,45 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do [AC_LANG_PROGRAM( [], [auto myincr = [[]](int x) { return x + 1; };])], - [AC_MSG_RESULT([yes]) - break], + [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) continue]) + + AC_MSG_CHECKING(thread support) + feature="thread" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include + std::shared_ptr th;], + [th.reset(new std::thread([[]]() { return; })); + th->join();])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + continue]) + + AC_MSG_CHECKING(mutex support) + feature="mutex" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include + std::mutex mtx;], + [std::lock_guard lock(mtx);])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + continue]) + + AC_MSG_CHECKING(atomic support) + feature="atomic" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include + std::atomic_flag flag;], + [])], + [AC_MSG_RESULT([yes]) + break], + [AC_MSG_RESULT([no]) + continue]) + done ])dnl AX_ISC_RPATH