From d0ed3f0fe055667bf150d0b31f04d2201e579b0d Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 28 Jul 2010 01:03:07 +0200 Subject: 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. diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index 7f10a64..4758962 100644 --- a/config/libc/uClibc.in +++ b/config/libc/uClibc.in @@ -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" diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh index 97cf2f2..4725d07 100644 --- a/scripts/build/libc/uClibc.sh +++ b/scripts/build/libc/uClibc.sh @@ -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 -- cgit v0.10.2-6-g49f6