summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-09-06 14:06:20 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-09-06 14:06:20 +0200
commit4de65ee303837504e6c05f5d71d94c8b23a0270d (patch)
tree027eefe682a2c86f124762b68b0954e7ddabe918
parent34fcbdac42ee29170a7a270cd02ea30d80c2a0cd (diff)
Fix atomic configure test (hopefully for the last time).
-rw-r--r--configure.ac22
-rw-r--r--src/Makefile.am.drumgizmo2
2 files changed, 10 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index e1fcec5..6a38c8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -469,25 +469,21 @@ AC_HAVE_LIBRARY([rt],[],[])
dnl ======================
dnl Check for the atomic library
dnl ======================
+AC_MSG_CHECKING([for the need for linkage with libatomic])
AC_LANG_PUSH([C++])
-AC_COMPILE_IFELSE(
- AC_LANG_SOURCE(
+AC_LINK_IFELSE([AC_LANG_SOURCE[
#include <atomic>
int main() {
struct Test { int val; };
std::atomic<Test> s;
- s.is_lock_free();
+ return s.is_lock_free()?1:0;
}
- ),
- [needs_libatomic=no],
- [needs_libatomic=yes])
-
-ATOMIC_LIBS=""
-if test x$needs_libatomic = xyes; then
- AC_MSG_RESULT([Needs to link with libatomic])
- ATOMIC_LIBS="-latomic"
-fi
-AC_SUBST(ATOMIC_LIBS)
+ ]],
+ [AC_MSG_RESULT([no])],
+ [AC_MSG_RESULT([yes])
+ AC_HAVE_LIBRARY([atomic],[],[])
+ ]
+)
AC_LANG_POP([C++])
dnl ======================
diff --git a/src/Makefile.am.drumgizmo b/src/Makefile.am.drumgizmo
index a92d195..9a5b211 100644
--- a/src/Makefile.am.drumgizmo
+++ b/src/Makefile.am.drumgizmo
@@ -37,7 +37,7 @@ DRUMGIZMO_SOURCES = \
DRUMGIZMO_LIBS = \
$(ZITA_LIBS) $(SNDFILE_LIBS) $(EXPAT_LIBS) $(SAMPLERATE_LIBS) \
- $(PTHREAD_LIBS) $(ATOMIC_LIBS)
+ $(PTHREAD_LIBS)
DRUMGIZMO_CPPFLAGS = \
-I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_srcdir)/hugin \