8204682: Parsing for LOG=report=none is broken when combined with other keywords
authorihse
Mon, 11 Jun 2018 20:18:38 +0200
changeset 50507 e5cdf2569510
parent 50506 54fcaffa8fac
child 50508 6aa873a6dae9
child 56740 d6b3c3658d3d
8204682: Parsing for LOG=report=none is broken when combined with other keywords Reviewed-by: erikj
make/InitSupport.gmk
--- a/make/InitSupport.gmk	Mon Jun 11 19:09:15 2018 +0200
+++ b/make/InitSupport.gmk	Mon Jun 11 20:18:38 2018 +0200
@@ -34,6 +34,9 @@
 
 ifeq ($(HAS_SPEC),)
 
+  # COMMA is defined in spec.gmk, but that is not included yet
+  COMMA := ,
+
   # Include the corresponding closed file, if present.
   ifneq ($(CUSTOM_MAKE_DIR), )
     -include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
@@ -531,8 +534,6 @@
 define ParseLogOption
   ifneq ($$(findstring $1, $$(LOG)),)
     override $2 := true
-    # COMMA is defined in spec.gmk, but that is not included yet
-    COMMA := ,
     # First try to remove ",<option>" if it exists, otherwise just remove "<option>"
     LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
     # We might have ended up with a leading comma. Remove it. Need override
@@ -550,8 +551,6 @@
     # Make words of out comma-separated list and find the one with opt=val
     value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
     override $2 := $$(value)
-    # COMMA is defined in spec.gmk, but that is not included yet
-    COMMA := ,
     # First try to remove ",<option>" if it exists, otherwise just remove "<option>"
     LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
         $$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))