summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-02-18 12:17:34 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-02-18 12:17:34 +0000
commit8ebbe99328248d45f3937c4f15f936d5d36f4a58 (patch)
tree58dfa9555171528528912a8cb6109d351ea767eb /tools
parent43141cbfdb247b7e64bc3d3d5732f43732d59da0 (diff)
downloadrockbox-8ebbe99328248d45f3937c4f15f936d5d36f4a58.tar.gz
rockbox-8ebbe99328248d45f3937c4f15f936d5d36f4a58.tar.bz2
rockbox-8ebbe99328248d45f3937c4f15f936d5d36f4a58.zip
FS#8482 take two. Make the language files built first, so that the largest
size can be used as buffer size for languages. Work to this also contributed by Jonas Haggqvist. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16343 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl35
-rwxr-xr-xtools/configure16
-rw-r--r--tools/make.inc10
-rw-r--r--tools/makesrc.inc4
4 files changed, 26 insertions, 39 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 4c21ae819f..4faa38ac54 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -154,30 +154,6 @@ sub filesize {
return $size;
}
-sub buildlangs {
- my ($outputlang)=@_;
- my $dir = "$ROOT/apps/lang";
- opendir(DIR, $dir);
- my @files = grep { /\.lang$/ } readdir(DIR);
- closedir(DIR);
-
- # Exclude some bad languages (uncomment and adjust in case of release
- # and/or End Times)
- # @files = grep(!/(afrikaans|hindi|slovenscina|turkce)\.lang/, @files);
-
- # Exclude more languages on the player which won't work on charcell display
- if ($archos =~ /^"?player:/ ) {
- @files = grep(!/(chinese-simp|chinese-trad|hindi|japanese|korean|thai)\.lang/, @files);
- }
-
- for(@files) {
- my $output = $_;
- $output =~ s/(.*)\.lang/$1.lng/;
- print "$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_\n" if($verbose);
- system ("$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_ >/dev/null 2>&1");
- }
-}
-
sub buildzip {
my ($zip, $image, $fonts)=@_;
@@ -413,15 +389,8 @@ STOP
# and the info file
system("cp rockbox-info.txt .rockbox/");
- # now copy the file made for reading on the unit:
- #if($notplayer) {
- # `cp $webroot/docs/Help-JBR.txt .rockbox/docs/`;
- #}
- #else {
- # `cp $webroot/docs/Help-Stu.txt .rockbox/docs/`;
- #}
-
- buildlangs(".rockbox/langs");
+ # copy the already built lng files
+ `cp apps/lang/*lng .rockbox/langs/`
}
diff --git a/tools/configure b/tools/configure
index 49773e1a6f..e1ca5be190 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1785,6 +1785,11 @@ else
voicetoolset="voicefont wavtrim"
fi
+if test "$apps" = "apps"; then
+ # only when we build "real" apps we build the .lng files
+ buildlangs="langs"
+fi
+
sed > Makefile \
-e "s,@ROOTDIR@,${rootdir},g" \
-e "s,@DEBUG@,${debug},g" \
@@ -1842,6 +1847,7 @@ sed > Makefile \
-e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \
-e "s,@TTS_OPTS@,${TTS_OPTS},g" \
-e "s,@VOICETOOLSET@,${voicetoolset},g" \
+ -e "s,@LANGS@,${buildlangs},g" \
<<EOF
## Automaticly generated. http://www.rockbox.org/
@@ -1919,14 +1925,14 @@ export ENCODER=@ENCODER@
# Do not print "Entering directory ..."
MAKEFLAGS += --no-print-directory
-.PHONY: all clean tags zip tools manual bin build info
+.PHONY: all clean tags zip tools manual bin build info langs
all: info
info: build
\$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt
-build: tools
+build: tools @LANGS@
@SIMUL1@
@SIMUL2@
\$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware
@@ -1952,7 +1958,7 @@ clean:
manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \
@ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \
html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \
- voicefontids *.wav *.mp3 *.voice
+ voicefontids *.wav *.mp3 *.voice max_language_size.h
tools:
\$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@
@@ -1996,6 +2002,10 @@ bzip2: tar
gzip: tar
\$(SILENT)gzip -f9 rockbox.tar
+langs: features
+ \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang
+ \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang
+
manual: manual-pdf
manual-pdf:
\$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf
diff --git a/tools/make.inc b/tools/make.inc
index 8e125c834e..d9f4c14cf4 100644
--- a/tools/make.inc
+++ b/tools/make.inc
@@ -24,6 +24,11 @@ $(OBJDIR)/%.o: %.S
# play nicely into this as it then adds a dependency to the lang.h file
# without the proper path.
#
+# The trailing sed hack for a range of files is present because how gcc works
+# for generating dependencies when the include file doesn't exist. Then it
+# makes the dependency without any path, and that breaks how things work for
+# us. We thus add the correct path for a few generated files!
+#
$(DEPFILE): $(SOURCES)
$(SILENT)mkdir -p $(dir $(DEPFILE))
$(SILENT)rm -f $(DEPFILE)
@@ -40,7 +45,10 @@ $(DEPFILE): $(SOURCES)
rm $$del; \
del=""; \
fi \
- done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" > $(DEPFILE); \
+ done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" \
+ -e "s:[^[:space:]]*sysfont.h:$(BUILDDIR)/sysfont.h:" \
+ -e "s:[^[:space:]]*max_language_size.h:$(BUILDDIR)/max_language_size.h:" \
+ > $(DEPFILE); \
echo "oo" > /dev/null )
tags:
diff --git a/tools/makesrc.inc b/tools/makesrc.inc
index 78d97f3283..846df8cb9e 100644
--- a/tools/makesrc.inc
+++ b/tools/makesrc.inc
@@ -10,5 +10,5 @@
# to make this do right when used on Mac OS X.
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
-$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - | \
-grep -v "^\#")
+$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - 2>/dev/null \
+| grep -v "^\#")