summaryrefslogtreecommitdiffstats
path: root/scripts/mk/buildapi.mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:30:08 +0000
commit44cf9c6d2d274eac37502e835155f7e985f1b8e6 (patch)
tree9576ba968924c5b9a55ba9e14f4f26184c62c7d4 /scripts/mk/buildapi.mk
parentAdding upstream version 1.22.6. (diff)
downloaddpkg-44cf9c6d2d274eac37502e835155f7e985f1b8e6.tar.xz
dpkg-44cf9c6d2d274eac37502e835155f7e985f1b8e6.zip
Adding upstream version 1.22.7.upstream/1.22.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/mk/buildapi.mk')
-rw-r--r--scripts/mk/buildapi.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/mk/buildapi.mk b/scripts/mk/buildapi.mk
index 668e325..6b665f3 100644
--- a/scripts/mk/buildapi.mk
+++ b/scripts/mk/buildapi.mk
@@ -1,9 +1,18 @@
# This Makefile fragment (since dpkg 1.22.0) handles the build API.
+ifndef dpkg_buildapi_mk_included
+dpkg_buildapi_mk_included = yes
+
# Default API level when not set.
-DPKG_BUILD_API ?= $(shell dpkg-buildapi)
+ifndef DPKG_BUILD_API
+ dpkg_lazy_eval ?= $(eval $(1) = $(2)$$($(1)))
+ dpkg_lazy_set ?= $(call dpkg_lazy_eval,$(1),$$(eval $(1) := $(2)))
+ $(call dpkg_lazy_set,DPKG_BUILD_API,$$(shell dpkg-buildapi))
+endif
# We could use only built-in GNU make functions, but that seems too much
# complexity given no integer operators, given that we currently have to
# fetch the build API level anyway.
dpkg_build_api_ge = $(shell test "$(DPKG_BUILD_API)" -ge "$(1)" && echo yes)
+
+endif # dpkg_buildapi_mk_included