diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:32:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:32:52 +0000 |
commit | 3c14ed72233b22898a70db82f4674931b2a717fd (patch) | |
tree | f2bf9e8cd0690cc6cb8dd702d0ecf05a26764e71 /scripts/mk/buildflags.mk | |
parent | Releasing progress-linux version 1.22.9-0.0~progress7.99u1. (diff) | |
download | dpkg-3c14ed72233b22898a70db82f4674931b2a717fd.tar.xz dpkg-3c14ed72233b22898a70db82f4674931b2a717fd.zip |
Merging upstream version 1.22.10.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | scripts/mk/buildflags.mk | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/scripts/mk/buildflags.mk b/scripts/mk/buildflags.mk index bc04488..1159700 100644 --- a/scripts/mk/buildflags.mk +++ b/scripts/mk/buildflags.mk @@ -35,6 +35,8 @@ dpkg_buildflags_mk_included = yes # This list is kept in sync with the default set of flags returned # by dpkg-buildflags. +dpkg_lazy_eval ?= $$(or $$(value DPKG_CACHE_$(1)),$$(eval DPKG_CACHE_$(1) := $$(shell $(2)))$$(value DPKG_CACHE_$(1))) + DPKG_BUILDFLAGS_LIST := $(foreach var,\ ASFLAGS \ CFLAGS \ @@ -48,26 +50,26 @@ DPKG_BUILDFLAGS_LIST := $(foreach var,\ LDFLAGS \ ,$(var) $(var)_FOR_BUILD) -dpkg_buildflags_run = $(eval $(shell \ - $(foreach exported,\ - DEB_BUILD_OPTIONS \ - DEB_BUILD_MAINT_OPTIONS \ - DEB_BUILD_PATH \ - $(foreach flag,$(DPKG_BUILDFLAGS_LIST),\ - $(foreach operation,SET STRIP APPEND PREPEND,\ - DEB_$(flag)_MAINT_$(operation))),\ - $(if $(value $(exported)),\ - $(exported)="$($(exported))"))\ - dpkg-buildflags | sed 's/\([^=]*\)\(.*\)/$$(eval \1:\2)/')) +define dpkg_buildflags_export_envvar + ifdef $(1) + DPKG_BUILDFLAGS_EXPORT_ENVVAR += $(1)="$$(value $(1))" + endif +endef + +$(eval $(call dpkg_buildflags_export_envvar,DEB_BUILD_OPTIONS)) +$(eval $(call dpkg_buildflags_export_envvar,DEB_BUILD_MAINT_OPTIONS)) +$(eval $(call dpkg_buildflags_export_envvar,DEB_BUILD_PATH)) +$(foreach flag,$(DPKG_BUILDFLAGS_LIST),\ + $(foreach operation,SET STRIP APPEND PREPEND,\ + $(eval $(call dpkg_buildflags_export_envvar,DEB_$(flag)_MAINT_$(operation))))) + +dpkg_buildflags_setvar = $(1) = $(call dpkg_lazy_eval,$(1),$(DPKG_BUILDFLAGS_EXPORT_ENVVAR) dpkg-buildflags --get $(1)) + +$(foreach flag,$(DPKG_BUILDFLAGS_LIST),\ + $(eval $(call dpkg_buildflags_setvar,$(flag)))) ifdef DPKG_EXPORT_BUILDFLAGS - # We need to compute the values right now. - $(dpkg_buildflags_run) export $(DPKG_BUILDFLAGS_LIST) -else - dpkg_lazy_eval ?= $(eval $(1) = $(2)$$($(1))) - $(foreach v,$(DPKG_BUILDFLAGS_LIST),\ - $(call dpkg_lazy_eval,$(v),$$(dpkg_buildflags_run))) endif endif # dpkg_buildflags_mk_included |