From b4f7d8b1566e3220d0e9004499ef9c257e079c57 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 7 Aug 2024 15:30:11 +0200 Subject: Merging upstream version 1.22.7. Signed-off-by: Daniel Baumann --- scripts/mk/buildapi.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/mk/buildapi.mk') 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 -- cgit v1.2.3