summaryrefslogtreecommitdiffstats
path: root/debian/architecture.mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:05 +0000
commit217d9223a5aa75daf9f286fd1fc06dae379b5dbc (patch)
treeb43bedae234ad56894a82934ee57e3619f3374d5 /debian/architecture.mk
parentAdding upstream version 1.64.0+dfsg1. (diff)
downloadrustc-217d9223a5aa75daf9f286fd1fc06dae379b5dbc.tar.xz
rustc-217d9223a5aa75daf9f286fd1fc06dae379b5dbc.zip
Adding debian version 1.64.0+dfsg1-1.debian/1.64.0+dfsg1-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/architecture.mk')
-rw-r--r--debian/architecture.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/architecture.mk b/debian/architecture.mk
new file mode 100644
index 000000000..dd027a13e
--- /dev/null
+++ b/debian/architecture.mk
@@ -0,0 +1,18 @@
+# This Makefile snippet defines DEB_*_RUST_TYPE triples based on DEB_*_GNU_TYPE
+
+include /usr/share/dpkg/architecture.mk
+
+rust_cpu = $(subst i586,i686,\
+$(if $(findstring -riscv64-,-$(2)-),$(subst riscv64,riscv64gc,$(1)),\
+$(if $(findstring -armhf-,-$(2)-),$(subst arm,armv7,$(1)),\
+$(if $(findstring -armel-,-$(2)-),$(subst arm,armv5te,$(1)),\
+$(1)))))
+rust_type_setvar = $(1)_RUST_TYPE ?= $(call rust_cpu,$($(1)_GNU_CPU),$($(1)_ARCH))-unknown-$($(1)_GNU_SYSTEM)
+
+$(foreach machine,BUILD HOST TARGET,\
+ $(eval $(call rust_type_setvar,DEB_$(machine))))
+
+# fallback for older dpkg versions
+ifeq ($(DEB_TARGET_RUST_TYPE),-unknown-)
+ DEB_TARGET_RUST_TYPE = $(DEB_HOST_RUST_TYPE)
+endif