Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#8482 - Build languages before main binary

Attached to Project: Rockbox
Opened by Jonas Häggqvist (rasher) - Sunday, 20 January 2008, 02:57 GMT+1
Last edited by Daniel Stenberg (bagder) - Monday, 18 February 2008, 13:32 GMT+1
Task Type Patches
Category Build environment
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch makes the build system build languages before it starts building the main binary. It also generates a file "max_language_size.h" in the build dir, containing the size of the largest language for the selected target.

Unfortunately, my build-fu is not quite strong enough to use this inside of language.h, which is the motivation for this change since it'd bring a few nice benefits:

1. We'd no longer have to keep increasing the language buffer manually each time a language grows too large.

2. The language buffer will be no larger than it needs to be. This is especially important on Archos, where this could potentially save around 10kb on the player, and less (but still significant) on the other targets.
   build-langs-before-main.diff (2.1 KiB)
 buildzip.pl |    3 ++-
 configure   |   12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

This task depends upon

Closed by  Daniel Stenberg (bagder)
Monday, 18 February 2008, 13:32 GMT+1
Reason for closing:  Accepted
Additional comments about closing:  This work is now in SVN!
Comment by Daniel Stenberg (bagder) - Monday, 21 January 2008, 00:01 GMT+1
A good idea, and I've poked on it further somewhat and this is my current state - not yet ready for inclusion or anything but I thought I'd still show the somewhat modified concept that I have in mind.

The biggest annoyance right now is our automatic generation of dependency-files as they go nuts when we #include non-existing files and the generated ones of course are non-existing before they're made...

(For some reason I tend to get make errors on sysfont.h with this patch applied)
   8482-2.patch (5.9 KiB)
 apps/Makefile      |    3 ++-
 apps/lang/Makefile |   36 ++++++++++++++++++++++++++++++++++++
 apps/language.h    |   11 ++++++++++-
 tools/buildzip.pl  |   25 +------------------------
 tools/configure    |   10 +++++++---
 5 files changed, 56 insertions(+), 29 deletions(-)

Comment by Jonas Häggqvist (rasher) - Monday, 21 January 2008, 10:57 GMT+1
Haven't tried it, but that's obviuosly a much cleaner solution, and should even bring down rebuild times.
Comment by Jonas Häggqvist (rasher) - Wednesday, 30 January 2008, 23:38 GMT+1
Something to consider: it would be nice to have an ignore file or something like that, preferably with global and charcell ignores (so the really outdated translations can be excluded, and non-ascii/greek/cyrillic translations can be excluded from the player).
Comment by Jonas Häggqvist (rasher) - Sunday, 17 February 2008, 23:06 GMT+1
Synced against current SVN - seems to work for me.
   langbuild-FS8482-v3.diff (4.2 KiB)
 apps/language.h   |   11 ++++++++++-
 tools/buildzip.pl |   34 +---------------------------------
 tools/configure   |   10 +++++++---
 3 files changed, 18 insertions(+), 37 deletions(-)

Comment by Jonas Häggqvist (rasher) - Sunday, 17 February 2008, 23:10 GMT+1
And here's a version with the apps/lang/Makefile included...
   langbuild-FS8482-v4.diff (5.6 KiB)
 apps/lang/Makefile |   36 ++++++++++++++++++++++++++++++++++++
 apps/language.h    |   11 ++++++++++-
 tools/buildzip.pl  |   34 +---------------------------------
 tools/configure    |   10 +++++++---
 4 files changed, 54 insertions(+), 37 deletions(-)

Comment by Jonas Häggqvist (rasher) - Sunday, 17 February 2008, 23:22 GMT+1
This version uses a file apps/lang/SOURCES to decide which languages to include. It's currently split by HAVE_LCD_BITMAP, which is the only reasonable distinction that I can see.
   langbuild-FS8482-v5.diff (6.6 KiB)
 apps/FILES         |    1 +
 apps/lang/Makefile |   37 +++++++++++++++++++++++++++++++++++++
 apps/lang/SOURCES  |   35 +++++++++++++++++++++++++++++++++++
 apps/language.h    |   11 ++++++++++-
 tools/buildzip.pl  |   34 +---------------------------------
 tools/configure    |   10 +++++++---
 6 files changed, 91 insertions(+), 37 deletions(-)

Comment by Daniel Stenberg (bagder) - Sunday, 17 February 2008, 23:52 GMT+1
Just to be a bit overly paranoid, here's my v6 that has make.inc modified and that seems to build fine for me.
   8482v6.patch (7.1 KiB)
 apps/FILES         |    1 +
 apps/lang/Makefile |   37 +++++++++++++++++++++++++++++++++++++
 apps/lang/SOURCES  |   35 +++++++++++++++++++++++++++++++++++
 apps/language.h    |   11 ++++++++++-
 tools/buildzip.pl  |   35 ++---------------------------------
 tools/configure    |   10 +++++++---
 tools/make.inc     |    3 ++-
 7 files changed, 94 insertions(+), 38 deletions(-)

Comment by Jonas Häggqvist (rasher) - Monday, 18 February 2008, 00:02 GMT+1
This modifies genlang to print out slightly nicer errors/warnings and silence the warning for no quotes around 'none' in the voice part. Also fixes two small errors in language files.

Still an error before the genlang lines: cc1: error: config.h: No such file or directory
   langbuild-FS8482-v7.diff (8.9 KiB)
 apps/FILES               |    1 +
 apps/lang/Makefile       |   37 +++++++++++++++++++++++++++++++++++++
 apps/lang/SOURCES        |   35 +++++++++++++++++++++++++++++++++++
 apps/lang/bulgarian.lang |    2 +-
 apps/lang/greek.lang     |    2 +-
 apps/language.h          |   11 ++++++++++-
 tools/buildzip.pl        |   14 +++++---------
 tools/configure          |   10 +++++++---
 tools/genlang            |   12 ++++++------
 tools/make.inc           |    3 ++-
 10 files changed, 105 insertions(+), 22 deletions(-)

Comment by Daniel Stenberg (bagder) - Monday, 18 February 2008, 00:30 GMT+1
Ok, I committed a version but it was not good since it broke the bootloaders and lacked using the actual max_language_size.h file

This v8 version fixes the latter part, does not include the genlang fix from Jonas' v7 (it is better committed separately) but has not got the bootloader builds fixed. I'll get to it later unless someone else does it!
   8482v8.patch (8.3 KiB)
 apps/FILES         |    1 +
 apps/lang/Makefile |   37 +++++++++++++++++++++++++++++++++++++
 apps/lang/SOURCES  |   35 +++++++++++++++++++++++++++++++++++
 apps/language.h    |   12 +++++++++---
 tools/buildzip.pl  |   35 ++---------------------------------
 tools/configure    |   10 +++++++---
 tools/make.inc     |   10 +++++++++-
 tools/makesrc.inc  |    4 ++--
 8 files changed, 102 insertions(+), 42 deletions(-)

Comment by Daniel Stenberg (bagder) - Monday, 18 February 2008, 00:34 GMT+1
Uhm, it wasn't clear in my previous message but I reverted my committed pretty quickly due to these problems.
Comment by Jonas Häggqvist (rasher) - Monday, 18 February 2008, 00:36 GMT+1
I've committed the genlang change as r16340.

Loading...