mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-11 04:46:18 +03:00
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #18077
30 lines
732 B
Plaintext
30 lines
732 B
Plaintext
dnl # SPDX-License-Identifier: CDDL-1.0
|
|
dnl #
|
|
dnl # If -latomic exists and atomic.c doesn't link without it,
|
|
dnl # it's needed for __atomic intrinsics.
|
|
dnl #
|
|
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBATOMIC], [
|
|
AC_MSG_CHECKING([whether -latomic is required])
|
|
|
|
saved_libs="$LIBS"
|
|
LIBS="$LIBS -latomic"
|
|
LIBATOMIC_LIBS=""
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
|
|
LIBS="$saved_libs"
|
|
saved_cflags="$CFLAGS"
|
|
CFLAGS="$CFLAGS -isystem lib/libspl/include"
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include "lib/libspl/atomic.c"], [])], [], [LIBATOMIC_LIBS="-latomic"])
|
|
CFLAGS="$saved_cflags"
|
|
])
|
|
|
|
if test -n "$LIBATOMIC_LIBS"; then
|
|
AC_MSG_RESULT([yes])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
fi
|
|
|
|
LIBS="$saved_libs"
|
|
AC_SUBST([LIBATOMIC_LIBS])
|
|
])
|