Skip to contentSkip to conversation

support: better check for a host with an UTF8 locale

PATCH New Yann E. MORIN 2 participants 5 messages Dec 4, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover support: better check for a host with an UTF8 locale

Hello All!

When configured with support for locales, uClibc needs an UTF-8 locale on the build machine.

This series makes it simpler to require such a locale, by introducing a blind kconfig option to require an UTF-8 locale.

uClibc is made to select this option when it wants to build locales.

Then, when checking dependencies, we use that option rather than reconstructign the conditions in the script. This means we no longer check it for glibc or musl, but tests have shown that this is not needed.

Changes v1 -> v2;
- drop the tvheadend patch
- rework changelogs accordingly

Regards,
Yann E. MORIN.

The following changes since commit 9139822448592b8b388c525f2e7beb0b14fa9bc7

core: find an UFT8 locale on the host (2016-12-03 16:52:15 +0100)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 8b7030696b25d8b072124ac60530bd98eca8f3f6

support/dependencies: use the new kconfig option to check UTF8 locale (2016-12-04 10:38:29 +0100)

----------------------------------------------------------------
Yann E. MORIN (3):
core: add a kconfig option to require an UTF8 locale on the host package/uclibc: needs a host with an UTF8 locale to build locales support/dependencies: use the new kconfig option to check UTF8 locale

 Config.in                            | 5 +++++
 package/uclibc/Config.in             | 1 +
 support/dependencies/dependencies.sh | 3 +--
 3 files changed, 7 insertions(+), 2 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v2 1/3 core: add a kconfig option to require an UTF8 locale on the host

This can be selected when we need the host to have an UTF-8 locale (e.g. to build uClibc with support for locales).

---
 Config.in | 5 +++++
 1 file changed, 5 insertions(+)
Config.in +5 -0
index 98096df..495b71c 100644
@@ -84,6 +84,11 @@ config BR2_HOSTARCH_NEEDS_IA32_LIBS
 config BR2_HOSTARCH_NEEDS_IA32_COMPILER
 	bool
 
+# Hidden boolean selected by packages that need the host to have an
+# UTF8 locale.
+config BR2_NEEDS_HOST_UTF8_LOCALE
+	bool
+
 source "arch/Config.in"
 
 menu "Build options"
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/3 package/uclibc: needs a host with an UTF8 locale to build locales

In reply to Yann E. MORIN
---
 package/uclibc/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/uclibc/Config.in +1 -0
index fdf007e..88b9947 100644
@@ -41,6 +41,7 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 	bool "Enable toolchain locale/i18n support"
 	select BR2_TOOLCHAIN_BUILDROOT_WCHAR
 	select BR2_ENABLE_LOCALE
+	select BR2_NEEDS_HOST_UTF8_LOCALE
 	help
 	  Enable this option if you want your toolchain to support
 	  localization and internationalization.
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/3 support/dependencies: use the new kconfig option to check UTF8 locale

In reply to Yann E. MORIN

Currently, we require a host with an UTF-8 locale as soone as we build a Buildroot toolchain with support for locales. This means that we do erquire such a locale when building a toolchain with either uClibc, glibc or musl.

However, glibc and musl do not require such a locale to be present.

Use the new option to check if an UTF8 locale is needed on the host, rather than deriving that from toolchain settings.

---
 support/dependencies/dependencies.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
support/dependencies/dependencies.sh +1 -2
index e632a14..bfd6596 100755
@@ -178,8 +178,7 @@ if test "${missing_progs}" = "yes" ; then
 	exit 1
 fi
 
-if grep ^BR2_TOOLCHAIN_BUILDROOT=y $BR2_CONFIG > /dev/null && \
-	grep ^BR2_ENABLE_LOCALE=y       $BR2_CONFIG > /dev/null ; then
+if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then
 	if ! which locale > /dev/null ; then
 		echo
 		echo "You need locale support on your build machine to build a toolchain supporting locales"
Signature · 1 line
2.7.4
#4 lore raw

v2 cover support: better check for a host with an UTF8 locale

In reply to Yann E. MORIN

Hello,

Quoted 4 lines · Yann E. MORIN

Yann E. MORIN (3):
core: add a kconfig option to require an UTF8 locale on the host package/uclibc: needs a host with an UTF8 locale to build locales support/dependencies: use the new kconfig option to check UTF8 locale

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com