Fix the build system to be able to build language packs.

This commit is contained in:
Florian Quèze 2009-05-14 18:28:57 +02:00
Родитель 95e396c56c
Коммит ed920c38da
3 изменённых файлов: 118 добавлений и 0 удалений

Просмотреть файл

@ -42,11 +42,16 @@ relativesrcdir = instantbird/locales
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
_ABS_DIST := $(shell cd $(DIST) && pwd)
vpath %.xml @srcdir@/en-US/searchplugins
vpath %.xml $(LOCALE_SRCDIR)/searchplugins
DEFINES += \
-DAB_CD=$(AB_CD) \
-DMOZ_LANGPACK_EID=langpack-$(AB_CD)@addons.instantbird.org \
-DMOZ_APP_VERSION=$(APP_VERSION) \
-DLOCALE_SRCDIR=$(LOCALE_SRCDIR) \
$(NULL)
@ -69,6 +74,49 @@ else
endif
endif
tests:
ifeq (WINNT,$(OS_ARCH))
ifneq (en-US, $(AB_CD))
@echo "Verifying $(AB_CD) installer variable usage"
@$(PERL) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/check-locales.pl $(LOCALE_SRCDIR)/installer
endif
endif
ifneq (en-US,$(AB_CD))
libs realchrome::
@echo "Comparing $(AB_CD) to en-US"
@$(PERL) $(MOZILLA_SRCDIR)/toolkit/locales/compare-locales.pl $(srcdir)/en-US/chrome $(LOCALE_SRCDIR)/chrome
endif
clobber-%:
$(RM) -rf $(DIST)/xpi-stage/locale-$*
libs-%:
$(NSINSTALL) -D $(DIST)/install
@$(MAKE) -C ../../mozilla/toolkit/locales libs-$* BOTH_MANIFESTS=1
@$(MAKE) -C ../../purple/locales libs-$* AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
@$(MAKE) -C ../../mozilla/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref BOTH_MANIFESTS=1
@$(MAKE) tests AB_CD=$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
langpack-%: LANGPACK_FILE=$(_ABS_DIST)/$(PKG_LANGPACK_PATH)$(PKG_LANGPACK_BASENAME).xpi
langpack-%: AB_CD=$*
langpack-%: XPI_NAME=locale-$*
langpack-%: libs-%
@echo "Making langpack $(LANGPACK_FILE)"
$(NSINSTALL) -D $(_ABS_DIST)/$(PKG_LANGPACK_PATH)
$(PERL) $(MOZILLA_SRCDIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) \
-I$(call EXPAND_MOZLOCALE_SRCDIR,toolkit/locales)/defines.inc \
-I$(LOCALE_SRCDIR)/defines.inc $(srcdir)/generic/install.rdf > \
$(FINAL_TARGET)/install.rdf
cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
if test -d dictionaries; then \
$(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome chrome.manifest dictionaries -x chrome/$(AB_CD).manifest; \
else \
$(ZIP) -r9D $(LANGPACK_FILE) install.rdf chrome chrome.manifest -x chrome/$(AB_CD).manifest; \
fi
merge-%:
ifdef LOCALE_MERGEDIR
$(RM) -rf $(LOCALE_MERGEDIR)

Просмотреть файл

@ -0,0 +1,9 @@
#filter emptyLines
#define MOZ_LANGPACK_CREATOR instantbird.org
# If non-English locales wish to credit multiple contributors, uncomment this
# variable definition and use the format specified.
# #define MOZ_LANGPACK_CONTRIBUTORS <em:contributor>Joe Solon</em:contributor> <em:contributor>Suzy Solon</em:contributor>
#unfilter emptyLines

Просмотреть файл

@ -0,0 +1,61 @@
<?xml version="1.0"?>
<!--
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Firefox localization support scripts.
#
# The Initial Developer of the Original Code is
# Benjamin Smedberg <bsmedberg@covad.net>
# Portions created by the Initial Developer are Copyright (C) 2004
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#filter substitution
-->
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest"
em:id="@MOZ_LANGPACK_EID@"
em:name="@MOZ_LANG_TITLE@ Language Pack"
em:version="@MOZ_APP_VERSION@"
em:type="8"
em:creator="@MOZ_LANGPACK_CREATOR@">
#ifdef MOZ_LANGPACK_CONTRIBUTORS
@MOZ_LANGPACK_CONTRIBUTORS@
#endif
<em:targetApplication>
<Description>
<em:id>{33cb9019-c295-46dd-be21-8c4936574bee}</em:id>
<em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
<em:maxVersion>@MOZ_APP_VERSION@</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>