Bug 914482 - Allow overrides from the command line for variables defined in moz.build. r=gps
☠☠ backed out by b9552f5d4476 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 12 Sep 2013 08:14:52 +0900
changeset 146624 237c3227948158d41d6c6dd3ea2bf915681e352f
parent 146623 895784bef7fd3464860f5d8a7102d8ae89da604a
child 146625 e9ee43da0c16f04c18505048c7846bc07173e69e
push id33653
push usermh@glandium.org
push dateWed, 11 Sep 2013 23:15:55 +0000
treeherdermozilla-inbound@237c32279481 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs914482
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 914482 - Allow overrides from the command line for variables defined in moz.build. r=gps
config/rules.mk
js/src/config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -49,21 +49,21 @@ INCLUDED_RULES_MK = 1
   XPIDL_FLAGS \
   $(NULL)
 
 ifndef EXTERNALLY_MANAGED_MAKE_FILE
 # Using $(firstword) may not be perfect. But it should be good enough for most
 # scenarios.
 _current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST))
 
-$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $($(var)),\
+$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
     $(error Variable $(var) is defined in $(_current_makefile). It should only be defined in moz.build files),\
     ))
 
-$(foreach var,$(_DEPRECATED_VARIABLES),$(if $($(var)),\
+$(foreach var,$(_DEPRECATED_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
     $(error Variable $(var) is defined in $(_current_makefile). This variable has been deprecated. It does nothing. It must be removed in order to build)\
     ))
 
 ifneq (,$(XPIDLSRCS)$(SDK_XPIDLSRCS))
     $(error XPIDLSRCS and SDK_XPIDLSRCS have been merged and moved to moz.build files as the XPIDL_SOURCES variable. You must move these variables out of $(_current_makefile))
 endif
 
 # Import the automatically generated backend file. If this file doesn't exist,
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -49,21 +49,21 @@ INCLUDED_RULES_MK = 1
   XPIDL_FLAGS \
   $(NULL)
 
 ifndef EXTERNALLY_MANAGED_MAKE_FILE
 # Using $(firstword) may not be perfect. But it should be good enough for most
 # scenarios.
 _current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST))
 
-$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $($(var)),\
+$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
     $(error Variable $(var) is defined in $(_current_makefile). It should only be defined in moz.build files),\
     ))
 
-$(foreach var,$(_DEPRECATED_VARIABLES),$(if $($(var)),\
+$(foreach var,$(_DEPRECATED_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\
     $(error Variable $(var) is defined in $(_current_makefile). This variable has been deprecated. It does nothing. It must be removed in order to build)\
     ))
 
 ifneq (,$(XPIDLSRCS)$(SDK_XPIDLSRCS))
     $(error XPIDLSRCS and SDK_XPIDLSRCS have been merged and moved to moz.build files as the XPIDL_SOURCES variable. You must move these variables out of $(_current_makefile))
 endif
 
 # Import the automatically generated backend file. If this file doesn't exist,