Commit c293dd14 authored by Michael Shigorin's avatar Michael Shigorin

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).
parent 5cede154
......@@ -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); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment