build: check for recent GCC with stdatomic.h

This commit is contained in:
Christian Hergert
2016-08-23 16:11:14 -07:00
parent d3a4355a97
commit 55b374b8be

View File

@ -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 <stdatomic.h>],
[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 ***********************************************************************