From 60a5636b46ad15ef8c78def67d1ae6d9ba6f7fe5 Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Wed, 7 Oct 2015 15:02:56 -0700 Subject: [PATCH] Fixed #317 - unresolved reference to __atomic_is_lock_free Summary: Tested in: Distro: Fedora 20 - x86_64 kernel: 3.19 compiler: gcc version 4.8.3 Closes https://github.com/facebook/folly/pull/320 Reviewed By: @sgolemon Differential Revision: D2519083 fb-gh-sync-id: 07b1437326c393c99feeb6e0764d664d3e22faea --- folly/configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/folly/configure.ac b/folly/configure.ac index 0a2b10a9..bceb1e58 100644 --- a/folly/configure.ac +++ b/folly/configure.ac @@ -231,6 +231,26 @@ if test "$folly_cv_lib_libcpp" = yes; then AC_DEFINE([USE_LIBCPP], [1], [Define to 1 if we are using libc++.]) fi +AC_CACHE_CHECK( + [for c++11 atomic support without GNU Atomic library], + [folly_cv_lib_libatomic], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM[ + #include + int main() { + struct Test { int val; }; + std::atomic s; + s.is_lock_free(); + } + ]], + [folly_cv_lib_libatomic=yes], + [folly_cv_lib_libatomic=no])]) + +if test "$folly_cv_lib_libatomic" = no; then + AC_HAVE_LIBRARY([atomic],[],[AC_MSG_ERROR( + [Please install the GNU Atomic library])]) +fi + AC_CACHE_CHECK( [for usable std::is_trivially_copyable], [folly_cv_decl_std_is_trivially_copyable], -- 2.34.1