On Sat, Oct 10, 2009 at 01:27:48PM +0200, Marc Andre Tanner wrote:
>Hi all,
>
>I need the iconv interface but without the actual local data which is
>rather big. I therefore followed the instructions in extra/locale/README
>and took a look at the coressponding Makefile.in. There I found that
>UCLIBC_BUILD_MINIMAL_LOCALE apparently does what I want (why is this
>not linked up in the Kconfig and shown during make menuconfig?).

It's not "officially" supported, no ยน)
>
>I then had to fix the following issues in order to make it work:
>
>  - The Makefile.in passes @echo to the shell which causes an error
>    this is what the patch in this mail fixes.
>
>  - There is something wrong with the dependencies, the Makefile has
>    no rule to make include/bits/sysnum.h. This could be releated to
>    the following commented out line:
>
>      #DEPH-locale := $(top_builddir)include/bits/sysnum.h
>    
>    I worked around this in my scripts for now. They basically do:
>
>      make headers
>      make include/bits/sysnum.h 
>      cd extra/locale
>      make clean
>      make UCLIBC_BUILD_MINIMAL_LOCALE=y
>      cd - >/dev/null
>      make install

see above.
>
>This all was with version 0.9.30.1 but the relevant code seems to be
>the same in current master.

I'd rather do something like the attached..
thanks,
>
>Marc
>
>>From 6a3388b33049c5e6fde6a20e18681297981ed517 Mon Sep 17 00:00:00 2001
>From: Marc Andre Tanner <[email protected]>
>Date: Sat, 10 Oct 2009 12:50:33 +0200
>Subject: [PATCH] Fix minimal locale generation (UCLIBC_BUILD_MINIMAL_LOCALE)
>
>The Makefile.in used $(Q)echo on a continued line,
>this passed @echo to the shell which resulted in a
>command not found error.
>
>Remove the line continuation backslash. Another
>solution would be to remove $(Q) from all but the
>first line.
>
>Signed-off-by: Marc Andre Tanner <[email protected]>
>---
> extra/locale/Makefile.in |   14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
>diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in
>index fe2e3cf..464a931 100644
>--- a/extra/locale/Makefile.in
>+++ b/extra/locale/Makefile.in
>@@ -107,7 +107,7 @@ else
> $(locale_OUT)/codesets.txt:
>       @$(disp_gen)
> ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y)
>-      $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@ ; \
>+      $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@ ; 
>       $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ISO-8859-1.pairs" >> $@
> else
>       $(Q)set -e; \
>@@ -128,12 +128,12 @@ endif
> $(locale_OUT)/locales.txt: $(locale_DIR)/LOCALES
>       @$(disp_gen)
> ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y)
>-      $(Q)echo "@euro e" > $@ ; \
>-      $(Q)echo "#-" >> $@ ; \
>-      $(Q)echo "UTF-8 yes" >> $@ ; \
>-      $(Q)echo "8-BIT yes" >> $@ ; \
>-      $(Q)echo "#-" >> $@ ; \
>-      $(Q)echo "en_US.UTF-8 UTF-8" >> $@ ; \
>+      $(Q)echo "@euro e" > $@ ; 
>+      $(Q)echo "#-" >> $@ ; 
>+      $(Q)echo "UTF-8 yes" >> $@ ; 
>+      $(Q)echo "8-BIT yes" >> $@ ; 
>+      $(Q)echo "#-" >> $@ ; 
>+      $(Q)echo "en_US.UTF-8 UTF-8" >> $@ ; 
>       $(Q)echo "en_US ISO-8859-1" >> $@
> else
>       $(Q)cat $< > $@
>
>-- 
> Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
>_______________________________________________
>uClibc mailing list
>[email protected]
>http://lists.busybox.net/mailman/listinfo/uclibc
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 8fa9a47..ffc276d 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -1299,6 +1299,28 @@ config UCLIBC_HAS_LOCALE
 
          Answer Y to enable locale support.  Most people will answer N.
 
+config UCLIBC_BUILD_MINIMAL_LOCALE
+       bool "Only selected locale"
+       depends on UCLIBC_HAS_LOCALE
+       default n
+       help
+         If you do not need all locales that are available on your
+         host-box, then set this to 'Y'.
+
+config UCLIBC_BUILD_MINIMAL_LOCALES
+       string "locales to use"
+       depends on UCLIBC_BUILD_MINIMAL_LOCALE
+       default "en_GB"
+       default y
+       help
+         Space separated list of locales to use.
+
+         E.g.:
+             en_US en_GB de_AT
+         default:
+             en_GB
+
+if !UCLIBC_BUILD_MINIMAL_LOCALE
 config UCLIBC_PREGENERATED_LOCALE_DATA
        bool "Use Pre-generated Locale Data"
        depends on UCLIBC_HAS_LOCALE
@@ -1324,6 +1346,7 @@ config UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA
          directory.
 
          Go ahead and make life easy for yourself... Answer Y.
+endif
 
 config UCLIBC_HAS_XLOCALE
        bool "Extended Locale Support (experimental/incomplete)"
diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in
index fe2e3cf..9c05fe9 100644
--- a/extra/locale/Makefile.in
+++ b/extra/locale/Makefile.in
@@ -85,7 +85,7 @@ $(locale_OUT)/codesets.txt:
            echo "and then edit that file to disable/enable the codesets you 
wish to support. "; \
            echo " "; \
            false; \
-       fi;
+       fi
 
 $(locale_OUT)/locales.txt:
        @if [ ! -f $@ ] ; then \
@@ -100,14 +100,14 @@ $(locale_OUT)/locales.txt:
            echo "to support. "; \
            echo " "; \
            false; \
-       fi;
+       fi
 
 else
 
 $(locale_OUT)/codesets.txt:
        @$(disp_gen)
 ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y)
-       $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@ ; \
+       $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@
        $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ISO-8859-1.pairs" >> $@
 else
        $(Q)set -e; \
@@ -128,13 +128,15 @@ endif
 $(locale_OUT)/locales.txt: $(locale_DIR)/LOCALES
        @$(disp_gen)
 ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y)
-       $(Q)echo "@euro e" > $@ ; \
-       $(Q)echo "#-" >> $@ ; \
-       $(Q)echo "UTF-8 yes" >> $@ ; \
-       $(Q)echo "8-BIT yes" >> $@ ; \
-       $(Q)echo "#-" >> $@ ; \
-       $(Q)echo "en_US.UTF-8 UTF-8" >> $@ ; \
-       $(Q)echo "en_US ISO-8859-1" >> $@
+       $(Q)echo "@euro e" > $@
+       $(Q)echo "#-" >> $@
+       $(Q)echo "UTF-8 yes" >> $@
+       $(Q)echo "8-BIT yes" >> $@
+       $(Q)echo "#-" >> $@
+       $(Q)for locale in $(call qstrip,$(UCLIBC_BUILD_MINIMAL_LOCALES)); do \
+               echo "$$locale.UTF-8 UTF-8"; \
+               echo "$$locale ISO-8859-1"; \
+       done >> $@
 else
        $(Q)cat $< > $@
 endif
@@ -173,6 +175,7 @@ $(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 > $@ || \
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to