bug 1370506, libs-% and chrome-% targets should set AB_CD, r?glandium draft
authorAxel Hecht <axel@pike.org>
Mon, 19 Jun 2017 16:51:05 +0200
changeset 619223 88e123fb57b4958588f4ac47781e0728a96b7dbc
parent 619222 52c47f464ebe9d3959da016b8d180c28cdcfec58
child 619224 cf493cbc14a14d2400cadbb70e2e071a66497184
push id71621
push useraxel@mozilla.com
push dateTue, 01 Aug 2017 19:49:47 +0000
reviewersglandium
bugs1370506
milestone56.0a1
bug 1370506, libs-% and chrome-% targets should set AB_CD, r?glandium Set AB_CD on per-locale entry point pattern rules. Not setting this on the repackaging top-level pattern rules, as they need AB_CD to be en-US to find the original package to unpack. MozReview-Commit-ID: JqrLYyEyvvb
browser/locales/Makefile.in
mobile/android/locales/Makefile.in
mobile/locales/Makefile.in
toolkit/locales/Makefile.in
toolkit/locales/l10n.mk
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -88,16 +88,17 @@ include $(topsrcdir)/toolkit/locales/l10
 	$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
 searchplugins:: $(list-json)
 
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
 DEFINES += -DBOOKMARKS_INCLUDE_DIR=$(dir $(call MERGE_FILE,profile/bookmarks.inc))
 
+libs-%: AB_CD=$*
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
 ifndef RELEASE_OR_BETA
 	@$(MAKE) -C ../extensions/formautofill/locales AB_CD=$* XPI_NAME=locale-$*
 endif
@@ -110,16 +111,17 @@ ifneq '$(or $(MOZ_DEV_EDITION),$(NIGHTLY
 	@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
 endif
 	@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
 	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
 
+chrome-%: AB_CD=$*
 chrome-%:
 	@$(MAKE) -C ../../toolkit/locales chrome-$*
 	@$(MAKE) -C ../../services/sync/locales chrome AB_CD=$*
 	@$(MAKE) -C ../../extensions/spellcheck/locales chrome AB_CD=$*
 ifndef RELEASE_OR_BETA
 	@$(MAKE) -C ../extensions/formautofill/locales chrome AB_CD=$*
 endif
 	@$(MAKE) -C ../extensions/pocket/locale chrome AB_CD=$*
@@ -191,16 +193,17 @@ endif
 ident:
 	@printf 'fx_revision '
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App SourceStamp
 	@printf 'buildid '
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App BuildID
 
+merge-%: AB_CD=$*
 merge-%:
 ifdef LOCALE_MERGEDIR
 	$(RM) -rf $(LOCALE_MERGEDIR)
 	$(topsrcdir)/mach compare-locales --merge-dir $(LOCALE_MERGEDIR) $*
 endif
 	@echo
 
 # test target, depends on make package
--- a/mobile/android/locales/Makefile.in
+++ b/mobile/android/locales/Makefile.in
@@ -26,24 +26,26 @@ include $(topsrcdir)/toolkit/locales/l10
 # values-*/strings.xml and raw-*/suggestedsites.json.
 # Those would be in the way of a single locale build, which this
 # target is for
 clobber-stage:
 	$(RM) -rf $(STAGEDIST)
 	$(RM) $(DEPTH)/mobile/android/base/res/values-*/strings.xml
 	$(RM) $(DEPTH)/mobile/android/base/res/raw-*/suggestedsites.json
 
+libs-%: AB_CD=$*
 libs-%:
 	@$(MAKE) -C $(DEPTH)/mobile/locales libs-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 ifeq ($(OS_TARGET),Android)
 	@$(MAKE) -C $(DEPTH)/mobile/android/base/locales AB_CD=$* XPI_NAME=locale-$*
 endif
 
 # Tailored target to just add the chrome processing for multi-locale builds
+chrome-%: AB_CD=$*
 chrome-%:
 	@$(MAKE) -C $(DEPTH)/mobile/locales chrome-$*
 	@$(MAKE) chrome AB_CD=$*
 ifeq ($(OS_TARGET),Android)
 	@$(MAKE) -C $(DEPTH)/mobile/android/base/locales chrome-$*
 endif
 
 # This is a generic target that will make a langpack and repack tarball
@@ -65,14 +67,15 @@ endif
 ident:
 	@printf 'gecko_revision '
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(GECKO_PLATFORM_INI_PATH) Build SourceStamp
 	@printf 'fennec_revision '
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(FENNEC_APPLICATION_INI_PATH) App SourceStamp
 	@printf 'buildid '
 	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(FENNEC_APPLICATION_INI_PATH) App BuildID
 
+merge-%: AB_CD=$*
 merge-%:
 ifdef LOCALE_MERGEDIR
 	$(RM) -rf $(LOCALE_MERGEDIR)
 	$(topsrcdir)/mach compare-locales --merge-dir $(LOCALE_MERGEDIR) $*
 endif
 	@echo
--- a/mobile/locales/Makefile.in
+++ b/mobile/locales/Makefile.in
@@ -125,25 +125,27 @@ searchplugins: $(search-preqs)
 include $(topsrcdir)/config/rules.mk
 
 
 #############
 libs-preqs =\
   $(call mkdir-deps,$(DIST)/install) \
   $(NULL)
 
+libs-%: AB_CD=$*
 libs-%: $(libs-preqs)
 	$(display-deps)
 	@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
 	@$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
 
 # Tailored target to just add the chrome processing for multi-locale builds
+chrome-%: AB_CD=$*
 chrome-%:
 	$(display-deps)
 	@$(MAKE) -B searchplugins AB_CD=$*
 	@$(MAKE) chrome AB_CD=$*
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
 
 NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
 
--- a/toolkit/locales/Makefile.in
+++ b/toolkit/locales/Makefile.in
@@ -7,25 +7,27 @@ include $(topsrcdir)/config/rules.mk
 ifdef LOCALE_MERGEDIR
 vpath crashreporter.% $(LOCALE_MERGEDIR)/toolkit/crashreporter
 endif
 vpath crashreporter.% $(LOCALE_SRCDIR)/crashreporter
 ifdef LOCALE_MERGEDIR
 vpath crashreporter.% @srcdir@/en-US/crashreporter
 endif
 
+libs-%: AB_CD=$*
 libs-%:
 	@$(MAKE) -C ../../netwerk/locales/ libs AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../dom/locales/ libs AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../security/manager/locales/ libs AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../devtools/shared/locales/ libs AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$*
 
 # target to be used by multi-locale l10n builds, just add this locale
 # like regular chrome code
+chrome-%: AB_CD=$*
 chrome-%:
 	@$(MAKE) -C $(DEPTH)/netwerk/locales/ chrome AB_CD=$*
 	@$(MAKE) -C $(DEPTH)/dom/locales/ chrome AB_CD=$*
 	@$(MAKE) -C $(DEPTH)/security/manager/locales/ chrome AB_CD=$*
 	@$(MAKE) chrome AB_CD=$*
 
 libs:: update.locale
 	sed -e 's/%AB_CD%/$(AB_CD)/' $< > $(FINAL_TARGET)/update.locale
--- a/toolkit/locales/l10n.mk
+++ b/toolkit/locales/l10n.mk
@@ -14,16 +14,18 @@
 # installer-%
 #   This target should list all required targets, a typical rule would be
 #	installers-%: clobber-% langpack-% repackage-zip-%
 #		@echo "repackaging done"
 #   to initially clobber the locale staging area, and then to build the
 #   language pack and zip package.
 #   Other targets like windows installers might be listed, too, and should
 #   be defined in the including makefile.
+#   The installer-% targets should not set AB_CD, so that the unpackaging
+#   step finds the original package.
 # The including makefile should provide values for the variables
 #   MOZ_APP_VERSION and MOZ_LANGPACK_EID.
 
 
 run_for_effects := $(shell if test ! -d $(DIST); then $(NSINSTALL) -D $(DIST); fi)
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
@@ -50,16 +52,17 @@ ACDEFINES += \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION) \
 	-DLOCALE_SRCDIR=$(abspath $(LOCALE_SRCDIR)) \
 	-DPKG_BASENAME='$(PKG_BASENAME)' \
 	-DPKG_INST_BASENAME='$(PKG_INST_BASENAME)' \
 	$(NULL)
 
 
+clobber-%: AB_CD=$*
 clobber-%:
 	$(RM) -rf $(DIST)/xpi-stage/locale-$*
 
 
 PACKAGER_NO_LIBS = 1
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 STAGEDIST = $(ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)/$(_APPNAME)/Contents/Resources