From 55b374b8be0b53d6ee7243901dce851abae9fc61 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 23 Aug 2016 16:11:14 -0700 Subject: [PATCH] build: check for recent GCC with stdatomic.h --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index a455bfee..ca791433 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,16 @@ AX_CHECK_COMPILE_FLAG([-std=gnu11], [AC_MSG_ERROR([C compiler cannot compile GNU C11 code])]) +dnl *********************************************************************** +dnl GCC 4.8 supports gnu11, but lacked the stdatomic.h headers. +dnl *********************************************************************** +AC_MSG_CHECKING([whether C compiler supports stdatomic.h]) +AC_TRY_LINK([#include ], + [atomic_thread_fence(memory_order_acquire);atomic_thread_fence(memory_order_seq_cst);], + [AC_MSG_RESULT([yes])], + [AC_MSG_ERROR([Sysprof requires a C compiler with stdatomic support such as GCC 4.9 or newer])]) + + dnl *********************************************************************** dnl Check for required packages dnl ***********************************************************************