From c293dd141c52805828e3155ea3c9f1a425acf5b0 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Wed, 12 Nov 2014 15:01:04 +0300 Subject: [PATCH] lib/functions.mk: tiny but important note There's a particular problem with lazy evaluation in case of BOOT_LANG: mkimage uses internal variable, BOOT_LANG = $(GLOBAL_BOOT_LANG) (note the lack of immediate assignment there), and if we set up export GLOBAL_BOOT_LANG = $(BOOT_LANG) in the same namespace we end up with recursively defined pair of variables; a ":=" in either place would save the day _but_ it's not there in m-p due to accumulator variables, e.g. USERS, which are defined and exported by a corresponding feature and then get populated *after* having been declared for export, _and_ it's not in mkimage as of 0.2.16 for some reason that might even be good (I don't know yet). --- lib/functions.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/functions.mk b/lib/functions.mk index b807bcbb..e639280e 100644 --- a/lib/functions.mk +++ b/lib/functions.mk @@ -38,6 +38,7 @@ printf '%s ?= %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; } endef # xport() requests a variable to be exported to the scripts +# NB: immediate assignment would break accumulators like USERS xport = $(and $(1),$(xport_body)) define xport_body { $(log_body); \