aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-21 13:52:55 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-21 13:52:55 +0200
commit4a1cd104952ed95c6f3fc9329de3cfd7c65a8931 (patch)
tree377c26b482ea94eb19eb81b9f414ae48f280e255 /configure.ac
parent8426d99b0efc0b22a01db0e2e97adb72134ac5bf (diff)
parentaabf5c86c9df1b4e1616a4cf06ee14a6edf2e5e1 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 43e398543..77cd3ad15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,18 @@ AX_BOOST_BASE([1.66], [CXXFLAGS="$BOOST_CPPFLAGS $CXXFLAGS"], [AC_MSG_ERROR([Nix
# ends up with LDFLAGS being empty, so we set it afterwards.
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
+# On some platforms, new-style atomics need a helper library
+AC_MSG_CHECKING(whether -latomic is needed)
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <stdint.h>
+uint64_t v;
+int main() {
+ return (int)__atomic_load_n(&v, __ATOMIC_ACQUIRE);
+}]])], GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=no, GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=yes)
+AC_MSG_RESULT($GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC)
+if test "x$GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC" = xyes; then
+ LIBS="-latomic $LIBS"
+fi
# Look for OpenSSL, a required dependency.
PKG_CHECK_MODULES([OPENSSL], [libcrypto], [CXXFLAGS="$OPENSSL_CFLAGS $CXXFLAGS"])