diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-07-28 01:03:07 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-07-28 01:03:07 +0200 |
commit | d0ed3f0fe055667bf150d0b31f04d2201e579b0d (patch) | |
tree | 7d8d3acb77b7958b3f2ca5cf4ccf31d3f7f43bcc | |
parent | c03ac58aca82f9a1249978f8b686f85d9a27dba8 (diff) | |
download | crosstool-ng-d0ed3f0fe055667bf150d0b31f04d2201e579b0d.tar.gz crosstool-ng-d0ed3f0fe055667bf150d0b31f04d2201e579b0d.tar.bz2 crosstool-ng-d0ed3f0fe055667bf150d0b31f04d2201e579b0d.zip |
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.
-rw-r--r-- | config/libc/uClibc.in | 12 | ||||
-rw-r--r-- | scripts/build/libc/uClibc.sh | 39 |
2 files changed, 39 insertions, 12 deletions
diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in index 7f10a649..47589627 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 97cf2f27..4725d073 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 |