summaryrefslogtreecommitdiffstats
path: root/scripts/mk/architecture.mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:58:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:58:51 +0000
commitcbffab246997fb5a06211dfb706b54e5ae5bb59f (patch)
tree0573c5d96f58d74d76a49c0f2a70398e389a36d3 /scripts/mk/architecture.mk
parentInitial commit. (diff)
downloaddpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.tar.xz
dpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.zip
Adding upstream version 1.21.22.upstream/1.21.22upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/mk/architecture.mk')
-rw-r--r--scripts/mk/architecture.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/mk/architecture.mk b/scripts/mk/architecture.mk
new file mode 100644
index 0000000..c11cada
--- /dev/null
+++ b/scripts/mk/architecture.mk
@@ -0,0 +1,11 @@
+# This Makefile fragment (since dpkg 1.16.1) defines all the DEB_HOST_* and
+# DEB_BUILD_* variables that dpkg-architecture can return. Existing values
+# of those variables are preserved as per policy.
+
+dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1)))
+
+dpkg_architecture_setvar = export $(1) ?= $(call dpkg_lazy_eval,$(1),dpkg-architecture -q$(1))
+
+$(foreach machine,BUILD HOST TARGET,\
+ $(foreach var,ARCH ARCH_ABI ARCH_LIBC ARCH_OS ARCH_CPU ARCH_BITS ARCH_ENDIAN GNU_CPU GNU_SYSTEM GNU_TYPE MULTIARCH,\
+ $(eval $(call dpkg_architecture_setvar,DEB_$(machine)_$(var)))))