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).
This commit is contained in:
Michael Shigorin 2014-11-12 15:01:04 +03:00
parent 5cede154fa
commit c293dd141c

View File

@ -38,6 +38,7 @@ printf '%s ?= %s\n' '$(1)' '$(2)' >> "$(CONFIG)"; }
endef endef
# xport() requests a variable to be exported to the scripts # xport() requests a variable to be exported to the scripts
# NB: immediate assignment would break accumulators like USERS
xport = $(and $(1),$(xport_body)) xport = $(and $(1),$(xport_body))
define xport_body define xport_body
{ $(log_body); \ { $(log_body); \