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 ***********************************************************************