All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 009/100] system: introduce BR2_SYSTEM_ENABLE_NLS
Date: Tue,  4 Jul 2017 16:47:49 +0200	[thread overview]
Message-ID: <20170704144920.12318-10-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <20170704144920.12318-1-thomas.petazzoni@free-electrons.com>

Until now, the option BR2_ENABLE_LOCALE was more-or-less controlling
whether NLS support was enabled in packages. More precisely, if
BR2_ENABLE_LOCALE=y, we were not doing anything (so some packages
could have NLS support enabled, some not). And only when
BR2_ENABLE_LOCALE was disabled we were explicitly passing
--disable-nls to packages.

This doesn't make much sense, and there is no reason to tie NLS
support to locale support. You may want locale support, but not
necessarily NLS support. Therefore, this commit introduces
BR2_SYSTEM_ENABLE_NLS, which allows to enable/disable NLS support
globally. When this option is enabled, we pass --enable-nls to
packages, otherwise we pass --disable-nls.

In addition, when this option is enabled and the C library doesn't
provide a full-blown implementation of gettext, we select the gettext
package, which will provide the full blown implementation.

It is worth mentioning that this commit has a visible impact for users:

 - Prior to this commit, as soon as BR2_ENABLE_LOCALE=y, packages
   *could* provide NLS support. It was up to each package to decide
   whether they wanted to provide NLS support or not (we were not
   passing --enable-nls nor --disable-nls).

 - After this commit, it's BR2_SYSTEM_ENABLE_NLS that controls whether
   NLS is enabled or disabled, and this option is disabled by default.

Bottom line: with the default of BR2_SYSTEM_ENABLE_NLS disabled, some
packages may lose NLS support that they used to provide. But we
believe it's a reasonable default behavior for Buildroot, where
generally NLS support is not necessary.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/Makefile.in       |  4 ++--
 package/gettext/Config.in |  1 +
 system/Config.in          | 19 +++++++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 4a5b3af..462b7ca 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -359,8 +359,8 @@ TARGET_CONFIGURE_ARGS = \
 
 ################################################################################
 
-ifeq ($(BR2_ENABLE_LOCALE),y)
-NLS_OPTS =
+ifeq ($(BR2_SYSTEM_ENABLE_NLS),y)
+NLS_OPTS = --enable-nls
 else
 NLS_OPTS = --disable-nls
 endif
diff --git a/package/gettext/Config.in b/package/gettext/Config.in
index 18bfda6..0dea03d 100644
--- a/package/gettext/Config.in
+++ b/package/gettext/Config.in
@@ -17,6 +17,7 @@ if BR2_PACKAGE_GETTEXT
 config BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL
 	bool
 	depends on !BR2_TOOLCHAIN_HAS_FULL_GETTEXT
+	default y if BR2_SYSTEM_ENABLE_NLS
 
 endif
 
diff --git a/system/Config.in b/system/Config.in
index 8588839..828df42 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -420,6 +420,25 @@ config BR2_GENERATE_LOCALE
 	  specified, UTF-8 is assumed. Examples of locales: en_US,
 	  fr_FR.UTF-8.
 
+config BR2_SYSTEM_ENABLE_NLS
+	bool "Enable Native Language Support (NLS)"
+	depends on BR2_USE_WCHAR
+	#  - glibc has built-in NLS support, but anyway doesn't
+	#    support static linking
+	#  - musl and uclibc support static linking, but they don't
+	#    have built-in NLS support, which is provided by the
+	#    libintl library from gettext. The fact that it is a
+	#    separate library causes too many problems for static
+	#    linking.
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_GETTEXT if !BR2_TOOLCHAIN_HAS_FULL_GETTEXT
+	help
+	  This option will enable Native Language Support, which will
+	  allow software packages to support translations.
+
+comment "NLS support needs a toolchain w/ wchar, dynamic library"
+	depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS
+
 config BR2_TARGET_TZ_INFO
 	bool "Install timezone info"
 	select BR2_PACKAGE_TZDATA if BR2_TOOLCHAIN_USES_GLIBC
-- 
2.9.4

  parent reply	other threads:[~2017-07-04 14:47 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 14:47 [Buildroot] [PATCH 000/100] Rework of the gettext handling Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 001/100] libglib2: disable compiler warnings Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 002/100] flex: remove bogus comment Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 003/100] lvm2: force disable NLS support Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 004/100] ushare: do not use the DISABLE_NLS variable Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 005/100] uclibc: enable libintl stubs Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 006/100] toolchain: introduce BR2_TOOLCHAIN_HAS_FULL_GETTEXT Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 007/100] gettext: force build libintl if needed Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 008/100] package: rename DISABLE_NLS to NLS_OPTS Thomas Petazzoni
2017-07-04 14:47 ` Thomas Petazzoni [this message]
2017-07-04 14:47 ` [Buildroot] [PATCH 010/100] package/Makefile.in: introduce TARGET_NLS_{DEPENDENCIES, LIBS} Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 011/100] package/Makefile.in: fix musl handling Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 012/100] alsa-utils: use new gettext logic Thomas Petazzoni
2017-07-04 15:23   ` Arnout Vandecappelle
2017-07-04 14:47 ` [Buildroot] [PATCH 013/100] avahi: " Thomas Petazzoni
2017-07-04 15:33   ` Arnout Vandecappelle
2017-07-04 14:47 ` [Buildroot] [PATCH 014/100] axel: use the " Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 015/100] binutils: " Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 016/100] clamav: use " Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 017/100] coreutils: use the " Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 018/100] cryptsetup: use " Thomas Petazzoni
2017-07-04 14:47 ` [Buildroot] [PATCH 019/100] curlftpfs: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 020/100] diffutils: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 021/100] ding-libs: use the " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 022/100] dnsmasq: use " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 023/100] dos2unix: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 024/100] dropwatch: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 025/100] efibootmgr: use the " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 026/100] elfutils: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 027/100] exiv2: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 028/100] fetchmail: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 029/100] flex: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 030/100] gdbm: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 031/100] git: " Thomas Petazzoni
2017-07-04 21:59   ` Arnout Vandecappelle
2017-07-04 23:28     ` Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 032/100] glib-networking: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 033/100] gmpc: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 034/100] gnuchess: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 035/100] grep: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 036/100] httping: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 037/100] json-glib: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 038/100] kbd: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 039/100] lbreakout2: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 040/100] libconfuse: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 041/100] libftdi1: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 042/100] libglib2: " Thomas Petazzoni
2017-07-04 15:44   ` Arnout Vandecappelle
2017-07-04 14:48 ` [Buildroot] [PATCH 043/100] libgpg-error: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 044/100] libidn: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 045/100] libuio: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 046/100] libv4l: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 047/100] libvips: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 048/100] lightning: remove -lintl linking Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 049/100] linux-pam: use the new gettext logic Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 050/100] linux-tools: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 051/100] lshw: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 052/100] ltris: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 053/100] madplay: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 054/100] make: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 055/100] mcrypt: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 056/100] midori: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 057/100] minidlna: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 058/100] ndisc6: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 059/100] net-tools: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 060/100] newt: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 061/100] nftables: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 062/100] pango: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 063/100] php: " Thomas Petazzoni
2017-07-04 17:05   ` Arnout Vandecappelle
2017-07-04 14:48 ` [Buildroot] [PATCH 064/100] popt: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 065/100] powertop: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 066/100] procps-ng: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 067/100] psmisc: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 068/100] pv: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 069/100] python: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 070/100] quota: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 071/100] rhash: " Thomas Petazzoni
2017-07-04 16:06   ` Arnout Vandecappelle
2017-07-04 14:48 ` [Buildroot] [PATCH 072/100] rpm: " Thomas Petazzoni
2017-07-04 16:09   ` Arnout Vandecappelle
2017-07-04 14:48 ` [Buildroot] [PATCH 073/100] rrdtool: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 074/100] samba4: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 075/100] sshfs: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 076/100] sysstat: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 077/100] tpm-tools: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 078/100] ushare: " Thomas Petazzoni
2017-07-04 14:48 ` [Buildroot] [PATCH 079/100] util-linux: " Thomas Petazzoni
2017-07-04 17:03   ` Carlos Santos
2017-07-04 14:49 ` [Buildroot] [PATCH 080/100] vdr: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 081/100] vim: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 082/100] whois: " Thomas Petazzoni
2017-07-04 16:19   ` Arnout Vandecappelle
2017-07-04 14:49 ` [Buildroot] [PATCH 083/100] xlib_libXpm: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 084/100] xscreensaver: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 085/100] e2fsprogs: remove libintl static linking handling Thomas Petazzoni
2017-07-04 16:21   ` Arnout Vandecappelle
2017-07-04 14:49 ` [Buildroot] [PATCH 086/100] gnuchess: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 087/100] gptfdisk: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 088/100] iputils: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 089/100] net-tools: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 090/100] oprofile: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 091/100] parted: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 092/100] perl: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 093/100] popt: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 094/100] qt: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 095/100] util-linux: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 096/100] xfsprogs: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 097/100] xmlstarlet: " Thomas Petazzoni
2017-07-04 14:49 ` [Buildroot] [PATCH 098/100] toolchain: drop BR2_NEEDS_GETTEXT{, _IF_LOCALE} Thomas Petazzoni
2017-07-04 16:22   ` Arnout Vandecappelle
2017-07-04 14:49 ` [Buildroot] [PATCH 099/100] docs/manual: update gettext details Thomas Petazzoni
2017-07-04 16:49   ` Arnout Vandecappelle
2017-07-04 14:49 ` [Buildroot] [PATCH 100/100] CHANGES: add details on the gettext revamp Thomas Petazzoni
2017-07-04 16:50   ` Arnout Vandecappelle
2017-07-04 17:22 ` [Buildroot] [PATCH 000/100] Rework of the gettext handling Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170704144920.12318-10-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.