Uniq the system properties.
If multiple items with the same key appear in a config variable,
only the first item is taken.
Change-Id: Icf57befafb36ec35dd4d48c8c3ec595f353f68e7
diff --git a/core/definitions.mk b/core/definitions.mk
index 9251017..4c499ad 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -600,6 +600,21 @@
endef
###########################################################
+## Given a list of pairs, if multiple pairs have the same
+## first components, keep only the first pair.
+##
+## $(1): list of pairs
+## $(2): the separator word, such as ":", "=", etc.
+define uniq-pairs-by-first-component
+$(eval _upbfc_fc_set :=)\
+$(strip $(foreach w,$(1), $(eval _first := $(word 1,$(subst $(2),$(space),$(w))))\
+ $(if $(filter $(_upbfc_fc_set),$(_first)),,$(w)\
+ $(eval _upbfc_fc_set += $(_first)))))\
+$(eval _upbfc_fc_set :=)\
+$(eval _first:=)
+endef
+
+###########################################################
## MODULE_TAG set operations
###########################################################