The PTHREAD_CFLAGS
flags are only required. Suggesting to use them in a more idiomatic way:
0--- a/build-aux/m4/l_atomic.m4
1+++ b/build-aux/m4/l_atomic.m4
2@@ -18,7 +18,7 @@ m4_define([_CHECK_ATOMIC_testbody], [[
3
4 int main() {
5 std::atomic<bool> lock{true};
6- std::atomic_exchange(&lock, false);
7+ lock.exchange(false);
8
9 std::atomic<std::chrono::seconds> t{0s};
10 t.store(2s);
11@@ -34,6 +34,8 @@ m4_define([_CHECK_ATOMIC_testbody], [[
12 AC_DEFUN([CHECK_ATOMIC], [
13
14 AC_LANG_PUSH(C++)
15+ TEMP_CXXFLAGS="$CXXFLAGS"
16+ CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
17
18 AC_MSG_CHECKING([whether std::atomic can be used without link library])
19
20@@ -51,5 +53,6 @@ AC_DEFUN([CHECK_ATOMIC], [
21 ])
22 ])
23
24+ CXXFLAGS="$TEMP_CXXFLAGS"
25 AC_LANG_POP
26 ])