# HG changeset patch # User "Yann E. MORIN" # Date 1280271787 -7200 # Node ID 67e02b48b595754cd0144948b8cd57f0c69a7000 # Parent c3967b2c49b4d8f93497085b859488560f7e62f0 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 -r c3967b2c49b4 -r 67e02b48b595 config/libc/uClibc.in --- a/config/libc/uClibc.in Thu Jul 22 23:26:08 2010 +0200 +++ b/config/libc/uClibc.in Wed Jul 28 01:03:07 2010 +0200 @@ -161,6 +161,18 @@ 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 -r c3967b2c49b4 -r 67e02b48b595 scripts/build/libc/uClibc.sh --- a/scripts/build/libc/uClibc.sh Thu Jul 22 23:26:08 2010 +0200 +++ b/scripts/build/libc/uClibc.sh Wed Jul 28 01:03:07 2010 +0200 @@ -12,7 +12,7 @@ # 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 @@ 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 @@ # 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