summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2020-12-31 20:04:11 +0000
committernia <nia@pkgsrc.org>2020-12-31 20:04:11 +0000
commitf463db40c65bad3f65128ddcf5be6b3bf0337d5c (patch)
tree7bfa4e57ef6b84af56bd417dbec9fd094a6e383d /mk
parent3add785e86facdcafd3301cc7d879bd6c2d3bc37 (diff)
downloadpkgsrc-f463db40c65bad3f65128ddcf5be6b3bf0337d5c.tar.gz
Normalize handling packages that require 64-bit atomic ops.
Diffstat (limited to 'mk')
-rw-r--r--mk/atomic64.mk24
1 files changed, 24 insertions, 0 deletions
diff --git a/mk/atomic64.mk b/mk/atomic64.mk
new file mode 100644
index 00000000000..b9c4b333947
--- /dev/null
+++ b/mk/atomic64.mk
@@ -0,0 +1,24 @@
+# $NetBSD: atomic64.mk,v 1.1 2020/12/31 20:04:12 nia Exp $
+#
+# This Makefile fragment is included by packages that require 64-bit atomic
+# operations, and will attempt to set the appropriate architecture-specific
+# compiler flags.
+
+.if !defined(ATOMIC64_MK)
+
+ATOMIC64_MK:=
+
+.include "../../bsd.fast.prefs.mk"
+
+.if ${MACHINE_ARCH} == "i386"
+. if empty(CFLAGS:M*march=*)
+CFLAGS+= -march=i586
+CXXFLAGS+= -march=i586
+. endif
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc"
+. include "../../devel/libatomic/buildlink3.mk"
+.endif
+
+.endif