summaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc
diff options
context:
space:
mode:
authorThomas Petazzoni2012-05-08 06:39:22 +0200
committerPeter Korsgaard2012-05-09 00:26:21 +0200
commitaebf199ff034460c817782c1b14ec4e8c75a8959 (patch)
treebeb3e402244778f464e4a2d25e4e93d045cfbe52 /toolchain/uClibc
parentlocaledef: new package (diff)
downloadbuildroot-aebf199ff034460c817782c1b14ec4e8c75a8959.tar.gz
buildroot-aebf199ff034460c817782c1b14ec4e8c75a8959.tar.xz
buildroot-aebf199ff034460c817782c1b14ec4e8c75a8959.zip
Add support to generate locale data
In order to use locale support on a Linux system, you need locale data to be present: * on a (e)glibc based system, this data is typically in the /usr/lib/locale/locale-archive file, which can be created and extended using the localedef program * on an uClibc based system, the set of supported locales is defined at build time by an uClibc configuration option. This patch implements generating locale data for the following cases: * Internal toolchain * External toolchain based on (e)glibc. uClibc external toolchains are not supported, because with uClibc, the set of supported locales is defined at build time. CodeSourcery and Linaro toolchains have been tested, Crosstool-NG toolchains are believed to work properly as well. * Toolchains built using the Crosstool-NG backend, but only (e)glibc toolchains. This feature was runtime tested with internal uClibc toolchain, CodeSourcery ARM toolchain and Linaro ARM toolchain, thanks to a simple C program that shows the data and a gettext translated message. Note that this option differs from the "purge locales" option, which is responsible for removing translation files and other locale stuff installed by packages. At some point in the future, we may want to clarify the respective roles of those options. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/uClibc')
-rw-r--r--toolchain/uClibc/uclibc.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index 32cbe4605..07281351b 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -66,6 +66,15 @@ endif
UCLIBC_ARM_TYPE:=CONFIG_$(call qstrip,$(BR2_ARM_TYPE))
UCLIBC_SPARC_TYPE:=CONFIG_SPARC_$(call qstrip,$(BR2_SPARC_TYPE))
+ifeq ($(GENERATE_LOCALE),)
+# We need at least one locale
+UCLIBC_LOCALES = en_US
+else
+# Strip out the encoding part of locale names, if any
+UCLIBC_LOCALES = $(foreach locale,$(GENERATE_LOCALE),\
+ $(firstword $(subst .,$(space),$(locale))))
+endif
+
$(DL_DIR)/$(UCLIBC_SOURCE):
$(call DOWNLOAD,$(UCLIBC_SITE)/$(UCLIBC_SOURCE))
@@ -309,7 +318,7 @@ else
echo "# PTHREADS_DEBUG_SUPPORT is not set" >> $(UCLIBC_DIR)/.oldconfig
endif
ifeq ($(BR2_ENABLE_LOCALE),y)
- $(SED) 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y\n# UCLIBC_BUILD_ALL_LOCALE is not set\nUCLIBC_BUILD_MINIMAL_LOCALE=y\nUCLIBC_BUILD_MINIMAL_LOCALES="en_US"\nUCLIBC_PREGENERATED_LOCALE_DATA=n\nUCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=n\nUCLIBC_HAS_XLOCALE=y\nUCLIBC_HAS_GLIBC_DIGIT_GROUPING=n\n,g' $(UCLIBC_DIR)/.oldconfig
+ $(SED) 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y\n# UCLIBC_BUILD_ALL_LOCALE is not set\nUCLIBC_BUILD_MINIMAL_LOCALE=y\nUCLIBC_BUILD_MINIMAL_LOCALES="$(UCLIBC_LOCALES)"\nUCLIBC_PREGENERATED_LOCALE_DATA=n\nUCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA=n\nUCLIBC_HAS_XLOCALE=y\nUCLIBC_HAS_GLIBC_DIGIT_GROUPING=n\n,g' $(UCLIBC_DIR)/.oldconfig
else
$(SED) 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=n,g' $(UCLIBC_DIR)/.oldconfig
endif