summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-05-21 21:26:25 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-05-21 21:26:25 +0200
commit79cd3d7b8a53dcb6bd2e32025b1c44fe5cd99b7c (patch)
tree3af068a3df458e1f77039a8a487d8fb899d2b2d1 /configure.ac
parente310675e9ede0d92a539ca6faeb45ca3534575c4 (diff)
Check for linkage against libatomic and librt.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 25 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index d35887a..6c85c0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,6 @@ dnl ===========================
AC_LANG_PUSH([C++])
TMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-std=c++11
-LDFLAGS=-lrt
AC_MSG_CHECKING([whether CXX supports -std=c++11])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])],
@@ -464,6 +463,31 @@ AS_IF([test x$enable_resampler == xsrc],
)
dnl ======================
+dnl Check for the rt library
+dnl ======================
+AC_HAVE_LIBRARY([rt],[],[])
+
+dnl ======================
+dnl Check for the atomic library
+dnl ======================
+AC_LINK_IFELSE(
+ [AC_LANG_SOURCE[
+ #include <atomic>
+ int main() {
+ struct Test { int val; };
+ std::atomic<Test> s;
+ s.is_lock_free();
+ }
+ ]],
+ [libatomic=yes],
+ [libatomic=no])
+
+if test "$libatomic" = no; then
+ AC_HAVE_LIBRARY([atomic],[],[AC_MSG_ERROR(
+ [Please install the GNU Atomic library])])
+fi
+
+dnl ======================
dnl Check for the pthread library
dnl ======================
tmp_CXXFLAGS="$CXXFLAGS"