mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
More work for bug 271324 - source localization - reviewed by Pike and biesi
This commit is contained in:
parent
548276e71d
commit
985c5975ce
@ -859,3 +859,12 @@ ifneq (,$(CYGDRIVE_MOUNT))
|
||||
export CYGDRIVE_MOUNT
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Localization build automation
|
||||
#
|
||||
|
||||
# Because you might wish to "make locales AB_CD=ab-CD", we don't hardcode
|
||||
# MOZ_UI_LOCALE directly, but use an intermediate variable that can be
|
||||
# overridden by the command line. (Besides, AB_CD is prettier).
|
||||
AB_CD = $(MOZ_UI_LOCALE)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/perl
|
||||
|
||||
# make-jars [-f] [-v] [-l] [-x] [-d <chromeDir>] [-s <srcdir>] [-t <topsrcdir>] [-z zipprog] [-o operating-system] < <jar.mn>
|
||||
# make-jars [-f] [-v] [-l] [-x] [-d <chromeDir>] [-s <srcdir>] [-t <topsrcdir>] [-c <localedir>] [-z zipprog] [-o operating-system] < <jar.mn>
|
||||
|
||||
my $cygwin_mountprefix = "";
|
||||
if ($^O eq "cygwin") {
|
||||
@ -48,7 +48,7 @@ foreach my $arg (@ARGV) {
|
||||
}
|
||||
my $defines = join(' ', @ARGV[ $ddindex .. $#ARGV ]);
|
||||
|
||||
getopts("d:s:t:f:avlD:o:p:xz:");
|
||||
getopts("d:s:t:c:f:avlD:o:p:xz:");
|
||||
|
||||
my $baseFilesDir = ".";
|
||||
if (defined($::opt_s)) {
|
||||
@ -60,6 +60,11 @@ if (defined($::opt_t)) {
|
||||
$topSrcDir = $::opt_t;
|
||||
}
|
||||
|
||||
my $localeDir;
|
||||
if (defined($::opt_c)) {
|
||||
$localeDir = $::opt_c;
|
||||
}
|
||||
|
||||
my $maxCmdline = 4000;
|
||||
if ($Config{'archname'} =~ /VMS/) {
|
||||
$maxCmdline = 200;
|
||||
@ -367,7 +372,11 @@ sub EnsureFileInDir
|
||||
if (defined($src)) {
|
||||
if ($src =~ m|^/|) {
|
||||
# "absolute" patch from topSrcDir
|
||||
defined($topSrcDir) || die("Command-line option -t <topsrcdir> missing.");
|
||||
$src = $topSrcDir.$srcFile;
|
||||
} elsif ($srcFile =~ s|^\%|/|) {
|
||||
defined($localeDir) || die("Command-line option -c <localedir> missing.");
|
||||
$src = $localeDir.$srcFile;
|
||||
} elsif (! -e $src ) {
|
||||
$src = "$srcPath/$srcFile";
|
||||
}
|
||||
@ -485,7 +494,7 @@ start:
|
||||
my $cwd = cwd();
|
||||
print "+++ making chrome $cwd => $chromeDir/$jarfile.jar\n";
|
||||
while (defined($_ = shift @gLines)) {
|
||||
if (/^\s+([\w\d.\-\_\\\/\+]+)\s*(\([\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
if (/^\s+([\w\d.\-\_\\\/\+]+)\s*(\(\%?[\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
my $dest = $1;
|
||||
my $srcPath = defined($2) ? substr($2, 1, -1) : $2;
|
||||
EnsureFileInDir("$chromeDir/$jarfile", $baseFilesDir, $dest, $srcPath, 0, 0);
|
||||
@ -497,7 +506,7 @@ start:
|
||||
my $pkg_name = $2;
|
||||
RegIt($chromeDir, $jarfile, $chrome_type, $pkg_name);
|
||||
}
|
||||
} elsif (/^\+\s+([\w\d.\-\_\\\/\+]+)\s*(\([\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
} elsif (/^\+\s+([\w\d.\-\_\\\/\+]+)\s*(\(\%?[\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
my $dest = $1;
|
||||
my $srcPath = defined($2) ? substr($2, 1, -1) : $2;
|
||||
EnsureFileInDir("$chromeDir/$jarfile", $baseFilesDir, $dest, $srcPath, 1, 0);
|
||||
@ -508,7 +517,7 @@ start:
|
||||
my $pkg_name = $2;
|
||||
RegIt($chromeDir, $jarfile, $chrome_type, $pkg_name);
|
||||
}
|
||||
} elsif (/^\*\+?\s+([\w\d.\-\_\\\/\+]+)\s*(\([\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
} elsif (/^\*\+?\s+([\w\d.\-\_\\\/\+]+)\s*(\(\%?[\w\d.\-\_\\\/]+\))?$\s*/) {
|
||||
# preprocessed (always override)
|
||||
my $dest = $1;
|
||||
my $srcPath = defined($2) ? substr($2, 1, -1) : $2;
|
||||
|
@ -1505,6 +1505,10 @@ ifdef NO_JAR_AUTO_REG
|
||||
_JAR_AUTO_REG=-a
|
||||
endif
|
||||
|
||||
ifdef relativesrcdir
|
||||
_JAR_LOCALE_SOURCE = -c $(if $(filter en-US,$(AB_CD)),$(srcdir)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(relativesrcdir))
|
||||
endif
|
||||
|
||||
ifeq ($(OS_TARGET),WIN95)
|
||||
_NO_FLOCK=-l
|
||||
endif
|
||||
@ -1524,6 +1528,7 @@ ifndef NO_DIST_INSTALL
|
||||
$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \
|
||||
$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(_NO_FLOCK) $(_JAR_AUTO_REG) \
|
||||
-f $(MOZ_CHROME_FILE_FORMAT) -d $(DIST)/bin/chrome \
|
||||
$(_JAR_LOCALE_SOURCE) \
|
||||
-s $(srcdir) -t $(topsrcdir) -z $(ZIP) -p $(MOZILLA_DIR)/config/preprocessor.pl -- \
|
||||
"$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \
|
||||
@ -1542,6 +1547,7 @@ ifndef NO_INSTALL
|
||||
$(if $(filter gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)),-x) \
|
||||
$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(_NO_FLOCK) $(_JAR_AUTO_REG) \
|
||||
-f $(MOZ_CHROME_FILE_FORMAT) -d $(DESTDIR)$(mozappdir)/chrome \
|
||||
$(_JAR_LOCALE_SOURCE) \
|
||||
-s $(srcdir) -t $(topsrcdir) -z $(ZIP) -p $(MOZILLA_DIR)/config/preprocessor.pl -- \
|
||||
"$(XULPPFLAGS) $(DEFINES) $(ACDEFINES)"; \
|
||||
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/make-chromelist.pl \
|
||||
|
Loading…
x
Reference in New Issue
Block a user