From 4cf43b2a1d569a786e549962e867eb506f4fc76a Mon Sep 17 00:00:00 2001 From: Haochen Tong Date: Tue, 12 Oct 2021 02:16:51 +0800 Subject: Rename fp_gcc_supports__atomics to fp_cc_supports__atomics --- m4/fp_cc_supports__atomics.m4 | 41 +++++++++++++++++++++++++++++++++++++++++ m4/fp_gcc_supports__atomics.m4 | 41 ----------------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 m4/fp_cc_supports__atomics.m4 delete mode 100644 m4/fp_gcc_supports__atomics.m4 (limited to 'm4') diff --git a/m4/fp_cc_supports__atomics.m4 b/m4/fp_cc_supports__atomics.m4 new file mode 100644 index 0000000000..6a6b16b92b --- /dev/null +++ b/m4/fp_cc_supports__atomics.m4 @@ -0,0 +1,41 @@ +dnl FP_CC_SUPPORTS__ATOMICS +dnl ------------------------ +dnl Does C compiler support the __atomic_* family of builtins? +AC_DEFUN([FP_CC_SUPPORTS__ATOMICS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_MSG_CHECKING([whether C compiler supports __atomic_ builtins]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y;]], [[__atomic_load(&x, &y, __ATOMIC_SEQ_CST); return y]])], + [ + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(whether -latomic is needed for sub-word-sized atomic operations) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned char a;]], [[__atomic_fetch_or(&a, 1, __ATOMIC_RELAXED);]])], + [ + AC_MSG_RESULT(no) + AC_SUBST([CabalNeedLibatomic],[False]) + need_latomic=0 + ], + [ + _save_LIBS=$LIBS + LIBS="-latomic" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned char a;]], [[__atomic_fetch_or(&a, 1, __ATOMIC_RELAXED);]])], + [ + AC_MSG_RESULT(yes) + AC_SUBST([CabalNeedLibatomic],[True]) + need_latomic=1 + ], + [ + AC_MSG_RESULT(failed) + AC_MSG_ERROR([sub-word-sized atomic operations are not available.]) + ]) + LIBS=$_save_LIBS + ]) + ], + [ + AC_MSG_RESULT(no) + AC_MSG_ERROR([C compiler needs to support __atomic primitives.]) + ]) + AC_DEFINE([HAVE_C11_ATOMICS], [1], [Does C compiler support __atomic primitives?]) + AC_DEFINE_UNQUOTED([NEED_ATOMIC_LIB], [$need_latomic], + [Define to 1 if we need -latomic for sub-word atomic operations.]) +]) diff --git a/m4/fp_gcc_supports__atomics.m4 b/m4/fp_gcc_supports__atomics.m4 deleted file mode 100644 index 6aa3c9dc93..0000000000 --- a/m4/fp_gcc_supports__atomics.m4 +++ /dev/null @@ -1,41 +0,0 @@ -dnl FP_GCC_SUPPORTS__ATOMICS -dnl ------------------------ -dnl 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]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y;]], [[__atomic_load(&x, &y, __ATOMIC_SEQ_CST); return y]])], - [ - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(whether -latomic is needed for sub-word-sized atomic operations) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned char a;]], [[__atomic_fetch_or(&a, 1, __ATOMIC_RELAXED);]])], - [ - AC_MSG_RESULT(no) - AC_SUBST([CabalNeedLibatomic],[False]) - need_latomic=0 - ], - [ - _save_LIBS=$LIBS - LIBS="-latomic" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[unsigned char a;]], [[__atomic_fetch_or(&a, 1, __ATOMIC_RELAXED);]])], - [ - AC_MSG_RESULT(yes) - AC_SUBST([CabalNeedLibatomic],[True]) - need_latomic=1 - ], - [ - AC_MSG_RESULT(failed) - AC_MSG_ERROR([sub-word-sized atomic operations are not available.]) - ]) - LIBS=$_save_LIBS - ]) - ], - [ - AC_MSG_RESULT(no) - AC_MSG_ERROR([C compiler needs to support __atomic primitives.]) - ]) - AC_DEFINE([HAVE_C11_ATOMICS], [1], [Does GCC support __atomic primitives?]) - AC_DEFINE_UNQUOTED([NEED_ATOMIC_LIB], [$need_latomic], - [Define to 1 if we need -latomic for sub-word atomic operations.]) -]) -- cgit v1.2.1