summaryrefslogtreecommitdiff
path: root/m4/fp_gcc_supports__atomics.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/fp_gcc_supports__atomics.m4')
-rw-r--r--m4/fp_gcc_supports__atomics.m417
1 files changed, 17 insertions, 0 deletions
diff --git a/m4/fp_gcc_supports__atomics.m4 b/m4/fp_gcc_supports__atomics.m4
new file mode 100644
index 0000000000..81fc44c500
--- /dev/null
+++ b/m4/fp_gcc_supports__atomics.m4
@@ -0,0 +1,17 @@
+# FP_GCC_SUPPORTS__ATOMICS
+# ------------------------
+# Does gcc support the __atomic_* family of builtins?
+AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
+ echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c
+ if $CC -c conftest.c > /dev/null 2>&1; then
+ CONF_GCC_SUPPORTS__ATOMICS=YES
+ AC_MSG_RESULT([yes])
+ else
+ CONF_GCC_SUPPORTS__ATOMICS=NO
+ AC_MSG_RESULT([no])
+ fi
+ rm -f conftest.c conftest.o
+])