2 dnl # If -latomic exists and atomic.c doesn't link without it,
3 dnl # it's needed for __atomic intrinsics.
5 AC_DEFUN([ZFS_AC_CONFIG_USER_LIBATOMIC], [
6 AC_MSG_CHECKING([whether -latomic is required])
12 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
14 saved_cflags="$CFLAGS"
15 CFLAGS="$CFLAGS -isystem lib/libspl/include"
16 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include "lib/libspl/atomic.c"], [])], [], [LIBATOMIC_LIBS="-latomic"])
17 CFLAGS="$saved_cflags"
20 if test -n "$LIBATOMIC_LIBS"; then
27 AC_SUBST([LIBATOMIC_LIBS])