Bug 870396 - Replace XPI_ROOT_APPID with MOZ_APP_ID; remove last defs.mk. r?ted.mielczarek
The rationale is in the comment in recursivemake.py: as best I can
tell, _if_ we're using split GRE and app (which everything but
mobile/android uses), anything under MOZ_BUILD_APP needs the appid,
_and_ everything that registers locale-aware chrome. Right now, the
former is handled by defs.mk and the latter is handled by manually
passing XPI_ROOT_APPID around in sub-Make invocations. This is better
than both of those approaches. The split between GRE and app is
detected by DIST_SUBDIR, so this changes nothing for mobile/android.
With this patch I produce bit-identical langpack XPIs, and the
chrome.manifest files in the langpacks really do include the expected
appids.
MozReview-Commit-ID: 4MZQdVDdpXD
deleted file mode 100644
--- a/browser/defs.mk
+++ /dev/null
@@ -1,1 +0,0 @@
-XPI_ROOT_APPID=$(MOZ_APP_ID)
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -64,27 +64,27 @@ include $(topsrcdir)/toolkit/locales/l10
$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
searchplugins:: $(list-json)
libs-%: AB_CD=$*
libs-%:
$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
$(NSINSTALL) -D $(DIST)/install
- @$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ @$(MAKE) -C ../../toolkit/locales libs-$*
@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
ifneq (,$(wildcard ../extensions/formautofill/locales))
@$(MAKE) -C ../extensions/formautofill/locales AB_CD=$* XPI_NAME=locale-$*
endif
@$(MAKE) -C ../extensions/onboarding/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../extensions/pocket/locale AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
- @$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
- @$(MAKE) -C ../../devtools/startup/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
+ @$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) -C ../../devtools/startup/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@$(MAKE) multilocale.txt-$* AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
chrome-%: AB_CD=$*
chrome-%: IS_LANGUAGE_REPACK=1
chrome-%:
--- a/config/config.mk
+++ b/config/config.mk
@@ -40,28 +40,16 @@ ifndef STANDALONE_MAKEFILE
GLOBAL_DEPS += backend.mk
include backend.mk
endif
endif
space = $(NULL) $(NULL)
-# Include defs.mk files that can be found in $(srcdir)/$(DEPTH),
-# $(srcdir)/$(DEPTH-1), $(srcdir)/$(DEPTH-2), etc., and $(srcdir)
-# where $(DEPTH-1) is one level less of depth, $(DEPTH-2), two, etc.
-# i.e. for DEPTH=../../.., DEPTH-1 is ../.. and DEPTH-2 is ..
-# These defs.mk files are used to define variables in a directory
-# and all its subdirectories, recursively.
-__depth := $(subst /, ,$(DEPTH))
-ifeq (.,$(__depth))
-__depth :=
-endif
-$(foreach __d,$(__depth) .,$(eval __depth = $(wordlist 2,$(words $(__depth)),$(__depth))$(eval -include $(subst $(space),/,$(strip $(srcdir) $(__depth) defs.mk)))))
-
COMMA = ,
# Sanity check some variables
CHECK_VARS := \
XPI_NAME \
LIBRARY_NAME \
MODULE \
DEPTH \
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1210,41 +1210,32 @@ chrome::
$(LOOP_OVER_DIRS)
$(FINAL_TARGET)/chrome: $(call mkdir_deps,$(FINAL_TARGET)/chrome)
ifneq (,$(JAR_MANIFEST))
ifndef NO_DIST_INSTALL
ifdef XPI_NAME
-ifdef XPI_ROOT_APPID
+ifneq (,$(DIST_SUBDIR))
# For add-on packaging we may specify that an application
# sub-dir should be added to the root chrome manifest with
# a specific application id.
-MAKE_JARS_FLAGS += --root-manifest-entry-appid='$(XPI_ROOT_APPID)'
-endif
-
-# if DIST_SUBDIR is defined but XPI_ROOT_APPID is not there's
-# no way langpacks will get packaged right, so error out.
-ifneq (,$(DIST_SUBDIR))
-ifndef XPI_ROOT_APPID
-$(error XPI_ROOT_APPID is not defined - langpacks will break.)
-endif
-endif
-endif
+MAKE_JARS_FLAGS += --root-manifest-entry-appid='$(MOZ_APP_ID)'
+endif # DIST_SUBDIR
+endif # XPI_NAME
libs realchrome:: $(FINAL_TARGET)/chrome
$(call py_action,jar_maker,\
$(QUIET) -d $(FINAL_TARGET) \
$(MAKE_JARS_FLAGS) $(DEFINES) $(ACDEFINES) \
$(JAR_MANIFEST))
-endif
-
-endif
+endif # NO_DIST_INSTALL
+endif # JAR_MANIFEST
# When you move this out of the tools tier, please remove the corresponding
# hacks in recursivemake.py that check if Makefile.in sets the variable.
ifneq ($(XPI_PKGNAME),)
tools realchrome::
ifdef STRIP_XPI
ifndef MOZ_DEBUG
@echo 'Stripping $(XPI_PKGNAME) package directory...'