[PATCH] Fix minimal locale generation (UCLIBC_BUILD_MINIMAL_LOCALE)
Marc Andre Tanner
mat at brain-dump.org
Fri Oct 16 08:03:49 UTC 2009
On Tue, Oct 13, 2009 at 12:01:08PM +0200, Marc Andre Tanner wrote:
> On Mon, Oct 12, 2009 at 04:05:01PM +0200, Bernhard Reutner-Fischer wrote:
> > On Mon, Oct 12, 2009 at 01:24:00PM +0200, Marc Andre Tanner wrote:
> > >On Sun, Oct 11, 2009 at 01:03:31AM +0200, Bernhard Reutner-Fischer wrote:
> > >> On Sat, Oct 10, 2009 at 05:42:51PM +0200, Marc Andre Tanner wrote:
> > >> >On Sat, Oct 10, 2009 at 03:51:49PM +0200, Bernhard Reutner-Fischer wrote:
> > >>
> > >> >> I'd rather do something like the attached..
> > >> >
> > >> >Yes this is even better! Does this mean that it will be "officially"
> > >> >supported?
> > >>
> > >> It should use a choice for "all" vs. "selected" locales and i think
> > >> the wctables should also use the given selected, for consistency.
> > >
> > >Ok, I am not sure whether I understand what you mean hear.
> >
> > Here i mean thatthere should be a choice (in the kconfig language sense)
> > between "all" and "selected". OTOH we could just drop PREGENERATED and be
> > done..
>
> It doesn't matter much for me, but it may be handy to use the PREGENERATED ones
> if the host system doesn't have all the needed ones installed.
>
> > >Currently wctables.h contains only the data for 1 locale (en_US or if that
> > >fails en_GB). Now you would like to generate the data for all locales
> > >specified in UCLIBC_BUILD_MINIMAL_LOCALES, right? As far as I can see this
> > >would need some changes in gen_wctype.c so it builds all the locales given
> > >on the command line.
> >
> > No, it should still only contain 1, and perhaps (didn't look) one from
> > the selected and not US || GB since both of them may be unavailable.
>
> Ok, thanks for the clarification. I hope the following patch on top of your
> previous one doese what you want?
Could you or someone else please comment on this patch? I would like to get
this functionality included in current git.
Thanks,
Marc
> >From 8720947a51bc90ceca4118ac1750468ff2ca011c Mon Sep 17 00:00:00 2001
> From: Marc Andre Tanner <mat at brain-dump.org>
> Date: Tue, 13 Oct 2009 11:52:39 +0200
> Subject: [PATCH] locale: generate wctables.h based on minimal locale selection
>
> If the locales given in UCLIBC_BUILD_MINIMAL_LOCALES aren't working
> we fall back to en_US and en_GB.
>
> Signed-off-by: Marc Andre Tanner <mat at brain-dump.org>
> ---
> extra/locale/Makefile.in | 10 ++++------
> 1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in
> index 9c05fe9..d5231f1 100644
> --- a/extra/locale/Makefile.in
> +++ b/extra/locale/Makefile.in
> @@ -175,14 +175,12 @@ $(locale_OUT)/c8tables.h: $(locale_OUT)/gen_wc8bit $(locale_OUT)/codesets.txt
> $(Q)$< `cat $(word 2,$^)` > $@
>
> # Warning! Beware tr_TR toupper/tolower exceptions!
> -# TODO: handle/prefer UCLIBC_BUILD_MINIMAL_LOCALE ?
> $(locale_OUT)/wctables.h: $(locale_OUT)/gen_wctype
> @$(disp_gen)
> - $(Q)$< $(FLAG-locale-verbose) en_US > $@ || \
> - $< $(FLAG-locale-verbose) en_US.UTF-8 > $@ || \
> - $< $(FLAG-locale-verbose) en_US.iso8859-1 > $@ || \
> - $< $(FLAG-locale-verbose) en_GB > $@ || \
> - $< $(FLAG-locale-verbose) en_GB.UTF-8 > $@
> + $(Q)for locale in $(call qstrip,$(UCLIBC_BUILD_MINIMAL_LOCALES)) en_US en_GB; do \
> + $< $(FLAG-locale-verbose) $$locale > $@ || \
> + $< $(FLAG-locale-verbose) $$locale.UTF-8 > $@ && break; \
> + done
>
> $(locale_OUT)/locale_tables.h: $(locale_OUT)/gen_locale $(locale_OUT)/locales.txt
> @$(disp_gen)
> --
> 1.6.4.3
--
Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
More information about the uClibc
mailing list