diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-02-18 12:17:34 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-02-18 12:17:34 +0000 |
commit | 8ebbe99328248d45f3937c4f15f936d5d36f4a58 (patch) | |
tree | 58dfa9555171528528912a8cb6109d351ea767eb /tools | |
parent | 43141cbfdb247b7e64bc3d3d5732f43732d59da0 (diff) | |
download | rockbox-8ebbe99328248d45f3937c4f15f936d5d36f4a58.tar.gz 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-x | tools/buildzip.pl | 35 | ||||
-rwxr-xr-x | tools/configure | 16 | ||||
-rw-r--r-- | tools/make.inc | 10 | ||||
-rw-r--r-- | tools/makesrc.inc | 4 |
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 { | |||
154 | return $size; | 154 | return $size; |
155 | } | 155 | } |
156 | 156 | ||
157 | sub buildlangs { | ||
158 | my ($outputlang)=@_; | ||
159 | my $dir = "$ROOT/apps/lang"; | ||
160 | opendir(DIR, $dir); | ||
161 | my @files = grep { /\.lang$/ } readdir(DIR); | ||
162 | closedir(DIR); | ||
163 | |||
164 | # Exclude some bad languages (uncomment and adjust in case of release | ||
165 | # and/or End Times) | ||
166 | # @files = grep(!/(afrikaans|hindi|slovenscina|turkce)\.lang/, @files); | ||
167 | |||
168 | # Exclude more languages on the player which won't work on charcell display | ||
169 | if ($archos =~ /^"?player:/ ) { | ||
170 | @files = grep(!/(chinese-simp|chinese-trad|hindi|japanese|korean|thai)\.lang/, @files); | ||
171 | } | ||
172 | |||
173 | for(@files) { | ||
174 | my $output = $_; | ||
175 | $output =~ s/(.*)\.lang/$1.lng/; | ||
176 | print "$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_\n" if($verbose); | ||
177 | system ("$ROOT/tools/genlang -e=$dir/english.lang -t=$archos -i=$target_id -b=$outputlang/$output $dir/$_ >/dev/null 2>&1"); | ||
178 | } | ||
179 | } | ||
180 | |||
181 | sub buildzip { | 157 | sub buildzip { |
182 | my ($zip, $image, $fonts)=@_; | 158 | my ($zip, $image, $fonts)=@_; |
183 | 159 | ||
@@ -413,15 +389,8 @@ STOP | |||
413 | # and the info file | 389 | # and the info file |
414 | system("cp rockbox-info.txt .rockbox/"); | 390 | system("cp rockbox-info.txt .rockbox/"); |
415 | 391 | ||
416 | # now copy the file made for reading on the unit: | 392 | # copy the already built lng files |
417 | #if($notplayer) { | 393 | `cp apps/lang/*lng .rockbox/langs/` |
418 | # `cp $webroot/docs/Help-JBR.txt .rockbox/docs/`; | ||
419 | #} | ||
420 | #else { | ||
421 | # `cp $webroot/docs/Help-Stu.txt .rockbox/docs/`; | ||
422 | #} | ||
423 | |||
424 | buildlangs(".rockbox/langs"); | ||
425 | 394 | ||
426 | } | 395 | } |
427 | 396 | ||
diff --git a/tools/configure b/tools/configure index 49773e1a6f..e1ca5be190 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -1785,6 +1785,11 @@ else | |||
1785 | voicetoolset="voicefont wavtrim" | 1785 | voicetoolset="voicefont wavtrim" |
1786 | fi | 1786 | fi |
1787 | 1787 | ||
1788 | if test "$apps" = "apps"; then | ||
1789 | # only when we build "real" apps we build the .lng files | ||
1790 | buildlangs="langs" | ||
1791 | fi | ||
1792 | |||
1788 | sed > Makefile \ | 1793 | sed > Makefile \ |
1789 | -e "s,@ROOTDIR@,${rootdir},g" \ | 1794 | -e "s,@ROOTDIR@,${rootdir},g" \ |
1790 | -e "s,@DEBUG@,${debug},g" \ | 1795 | -e "s,@DEBUG@,${debug},g" \ |
@@ -1842,6 +1847,7 @@ sed > Makefile \ | |||
1842 | -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \ | 1847 | -e "s,@TTS_ENGINE@,${TTS_ENGINE},g" \ |
1843 | -e "s,@TTS_OPTS@,${TTS_OPTS},g" \ | 1848 | -e "s,@TTS_OPTS@,${TTS_OPTS},g" \ |
1844 | -e "s,@VOICETOOLSET@,${voicetoolset},g" \ | 1849 | -e "s,@VOICETOOLSET@,${voicetoolset},g" \ |
1850 | -e "s,@LANGS@,${buildlangs},g" \ | ||
1845 | <<EOF | 1851 | <<EOF |
1846 | ## Automaticly generated. http://www.rockbox.org/ | 1852 | ## Automaticly generated. http://www.rockbox.org/ |
1847 | 1853 | ||
@@ -1919,14 +1925,14 @@ export ENCODER=@ENCODER@ | |||
1919 | # Do not print "Entering directory ..." | 1925 | # Do not print "Entering directory ..." |
1920 | MAKEFLAGS += --no-print-directory | 1926 | MAKEFLAGS += --no-print-directory |
1921 | 1927 | ||
1922 | .PHONY: all clean tags zip tools manual bin build info | 1928 | .PHONY: all clean tags zip tools manual bin build info langs |
1923 | 1929 | ||
1924 | all: info | 1930 | all: info |
1925 | 1931 | ||
1926 | info: build | 1932 | info: build |
1927 | \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt | 1933 | \$(SILENT)\$(TOOLSDIR)/mkinfo.pl \$(BUILDDIR)/rockbox-info.txt |
1928 | 1934 | ||
1929 | build: tools | 1935 | build: tools @LANGS@ |
1930 | @SIMUL1@ | 1936 | @SIMUL1@ |
1931 | @SIMUL2@ | 1937 | @SIMUL2@ |
1932 | \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware | 1938 | \$(SILENT)\$(MAKE) -C \$(FIRMDIR) OBJDIR=\$(BUILDDIR)/firmware |
@@ -1952,7 +1958,7 @@ clean: | |||
1952 | manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \ | 1958 | manual *.pdf *.a credits.raw @OUTPUT@ bitmaps pluginbitmaps \ |
1953 | @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \ | 1959 | @ARCHOSROM@ @FLASHFILE@ UI256.bmp rockbox-full.zip \ |
1954 | html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \ | 1960 | html txt rockbox-manual*.zip sysfont.h rockbox-info.txt \ |
1955 | voicefontids *.wav *.mp3 *.voice | 1961 | voicefontids *.wav *.mp3 *.voice max_language_size.h |
1956 | 1962 | ||
1957 | tools: | 1963 | tools: |
1958 | \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@ | 1964 | \$(SILENT)\$(MAKE) -C \$(TOOLSDIR) CC=\$(HOSTCC) AR=\$(HOSTAR) @TOOLSET@ |
@@ -1996,6 +2002,10 @@ bzip2: tar | |||
1996 | gzip: tar | 2002 | gzip: tar |
1997 | \$(SILENT)gzip -f9 rockbox.tar | 2003 | \$(SILENT)gzip -f9 rockbox.tar |
1998 | 2004 | ||
2005 | langs: features | ||
2006 | \$(SILENT)mkdir -p \$(BUILDDIR)/apps/lang | ||
2007 | \$(SILENT)\$(MAKE) -C \$(APPSDIR)/lang OBJDIR=\$(BUILDDIR)/apps/lang | ||
2008 | |||
1999 | manual: manual-pdf | 2009 | manual: manual-pdf |
2000 | manual-pdf: | 2010 | manual-pdf: |
2001 | \$(SILENT)\$(MAKE) -C \$(MANUALDIR) OBJDIR=\$(BUILDDIR)/manual manual-pdf | 2011 | \$(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 | |||
24 | # play nicely into this as it then adds a dependency to the lang.h file | 24 | # play nicely into this as it then adds a dependency to the lang.h file |
25 | # without the proper path. | 25 | # without the proper path. |
26 | # | 26 | # |
27 | # The trailing sed hack for a range of files is present because how gcc works | ||
28 | # for generating dependencies when the include file doesn't exist. Then it | ||
29 | # makes the dependency without any path, and that breaks how things work for | ||
30 | # us. We thus add the correct path for a few generated files! | ||
31 | # | ||
27 | $(DEPFILE): $(SOURCES) | 32 | $(DEPFILE): $(SOURCES) |
28 | $(SILENT)mkdir -p $(dir $(DEPFILE)) | 33 | $(SILENT)mkdir -p $(dir $(DEPFILE)) |
29 | $(SILENT)rm -f $(DEPFILE) | 34 | $(SILENT)rm -f $(DEPFILE) |
@@ -40,7 +45,10 @@ $(DEPFILE): $(SOURCES) | |||
40 | rm $$del; \ | 45 | rm $$del; \ |
41 | del=""; \ | 46 | del=""; \ |
42 | fi \ | 47 | fi \ |
43 | done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" > $(DEPFILE); \ | 48 | done | sed -e "s:[^[:space:]]*lang.h:$(OBJDIR)/lang.o:" \ |
49 | -e "s:[^[:space:]]*sysfont.h:$(BUILDDIR)/sysfont.h:" \ | ||
50 | -e "s:[^[:space:]]*max_language_size.h:$(BUILDDIR)/max_language_size.h:" \ | ||
51 | > $(DEPFILE); \ | ||
44 | echo "oo" > /dev/null ) | 52 | echo "oo" > /dev/null ) |
45 | 53 | ||
46 | tags: | 54 | 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 @@ | |||
10 | # to make this do right when used on Mac OS X. | 10 | # to make this do right when used on Mac OS X. |
11 | 11 | ||
12 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ | 12 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
13 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - | \ | 13 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - 2>/dev/null \ |
14 | grep -v "^\#") | 14 | | grep -v "^\#") |