Handle MODULE_LICENSE_MPL the same as MODULE_LICENSE_GPL.
Change-Id: Iefc6df3f3401a591f53ec3f22202044c60acf460
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 1178800..25564b2 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -106,11 +106,11 @@
# Add implicit tags.
#
# If the local directory or one of its parents contains a MODULE_LICENSE_GPL
-# file, tag the module as "gnu". Search for "*_GNU*" so that we can also
+# file, tag the module as "gnu". Search for "*_GPL*" and "*_MPL*" so that we can also
# find files like MODULE_LICENSE_GPL_AND_AFL but exclude files like
# MODULE_LICENSE_LGPL.
#
-ifneq ($(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL*),)
+ifneq ($(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL*),)
LOCAL_MODULE_TAGS += gnu
endif
diff --git a/core/definitions.mk b/core/definitions.mk
index 2875e28..6db9d8f 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -339,7 +339,7 @@
define find-parent-file
$(strip \
- $(eval _fpf := $(wildcard $(strip $(1))/$(strip $(2)))) \
+ $(eval _fpf := $(wildcard $(foreach f, $(2), $(strip $(1))/$(f)))) \
$(if $(_fpf),$(_fpf), \
$(if $(filter-out ./ .,$(1)), \
$(call find-parent-file,$(patsubst %/,%,$(dir $(1))),$(2)) \