Link against "libatomic" on armel/mipsel/...
authorIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>
Wed, 21 Aug 2019 11:55:45 +0000 (13:55 +0200)
committerIOhannes m zmölnig <zmoelnig@umlautS.umlaeute.mur.at>
Wed, 21 Aug 2019 11:55:45 +0000 (13:55 +0200)
debian/rules

index 56bc79f1b174fc38efc773f6e51ff06cfc304400..6b7634275234f4a543ce90a1996b8ca3baedb648 100755 (executable)
@@ -19,6 +19,19 @@ DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
 
 LDFLAGS += $(shell pkg-config --libs libjpeg libpng zlib)
 
+# JUCE uses some c++11 features requiring atomic_store_8 and
+# atomic_load_8, so we need to link with libatomic on
+# armel, powerpc, powerpcspe, m68k, mips, mipsel, sh4, ...
+# see also:
+# - https://gcc.gnu.org/wiki/Atomic
+# - https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary
+# - the 'clasp' packaging
+noatomicarch = $(shell dpkg-architecture -qDEB_HOST_ARCH | egrep -x "(armel|powerpc|powerpcspe|m68k|mips|mipsel|sh4|riscv64)")
+# link with libatomic on architectures without built-in atomic
+ifeq ($(if $(noatomicarch),atomic), atomic)
+       LDFLAGS += -latomic
+endif
+
 %:
        dh $@