libc/uClibc: do not systematically use pre-generated locale data

It seems that using pre-generated locale data can be more problematic
than usefull in some circumstances.

Offer a config knob to enable/disable use of the pregen locale data.
Also, do not extract pregen locales data ourselves, it's broken.
This commit is contained in:
Yann E. MORIN" 2010-07-28 01:03:07 +02:00
parent c03ac58aca
commit d0ed3f0fe0
2 changed files with 39 additions and 12 deletions

View File

@ -161,6 +161,18 @@ config LIBC_UCLIBC_LOCALES
Note that seems to be broken on recent uClibc releases.
config LIBC_UCLIBC_LOCALES_PREGEN_DATA
bool
prompt "Use pregen locales"
depends on LIBC_UCLIBC_LOCALES
default y
help
If you see issues with using pre-generated locales data,
you can try switching this off.
If so, please report the issue, so we can default this
to off if too many people complain.
config LIBC_UCLIBC_WCHAR
bool
prompt "Add support for WCHAR"

View File

@ -12,7 +12,7 @@ do_libc_get() {
# later...
CT_GetFile "uClibc-${CT_LIBC_VERSION}" ${libc_src}
# uClibc locales
if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
CT_GetFile "uClibc-locale-030818" ${libc_src}
fi
@ -40,11 +40,14 @@ do_libc_extract() {
fi
# uClibc locales
if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
# Extracting pregen locales ourselves is kinda
# broken, so just link it in place...
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" \
-a ! -f "${CT_SRC_DIR}/.uClibc-locales-030818.extracted" ]; then
CT_Pushd "$(libc_uclibc_src_dir)/extra/locale"
CT_Extract nochdir "uClibc-locale-030818"
CT_Patch nochdir "uClibc" "locale-030818"
CT_DoExecLog ALL ln -s "${CT_TARBALLS_DIR}/uClibc-locale-030818.tgz" .
CT_Popd
touch "${CT_SRC_DIR}/.uClibc-locales-030818.extracted"
fi
return 0
@ -354,14 +357,26 @@ mungeuClibcConfig() {
# arrangements. Note that having the uClibc Makefile download the
# pregenerated locales is not compatible with crosstool; besides,
# crosstool downloads them as part of getandpatch.sh.
if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ] ; then
cat <<-ENDSED
s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
UCLIBC_PREGENERATED_LOCALE_DATA=y\\
# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
# UCLIBC_HAS_XLOCALE is not set/
ENDSED
fi
case "${CT_LIBC_UCLIBC_LOCALES}:${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" in
:*)
;;
y:)
cat <<-ENDSED
s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
# UCLIBC_PREGENERATED_LOCALE_DATA is not set\\
# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
# UCLIBC_HAS_XLOCALE is not set/
ENDSED
;;
y:y)
cat <<-ENDSED
s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
UCLIBC_PREGENERATED_LOCALE_DATA=y\\
# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
# UCLIBC_HAS_XLOCALE is not set/
ENDSED
;;
esac
# WCHAR support
if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ] ; then