summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac5
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 52cb1d0f2a..8cc4c26d60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,7 +208,10 @@ AC_CHECK_HEADERS([netinet/tcp.h])
AC_CHECK_HEADERS([stdatomic.h])
dnl This ensures that we link with the right library for atomic operations on Linux SPARC
-AC_SEARCH_LIBS([__atomic_load_4], [atomic], [AC_SUBST([LIBATOMIC_LIBS], [-latomic])])
+AC_SEARCH_LIBS([__atomic_load_4], [atomic], [], [AC_MSG_NOTICE([Could not detect libatomic])])
+AS_IF([test "$ac_cv_search___atomic_load_4" = "none required" || test "$ac_cv_search___atomic_load_4" = "no"],
+ [AC_SUBST([LIBATOMIC_LIBS], [])],
+ [AC_SUBST([LIBATOMIC_LIBS], [$ac_cv_search___atomic_load_4])])
dnl We use its presence to detect C11 threads
AC_CHECK_HEADERS([threads.h])