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 099/100] docs/manual: update gettext details
Date: Tue,  4 Jul 2017 16:49:19 +0200	[thread overview]
Message-ID: <20170704144920.12318-100-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <20170704144920.12318-1-thomas.petazzoni@free-electrons.com>

The way gettext is handled in Buildroot has significantly changed,
with changes visible to packages. This commit updates the relevant
section of the manual to document how packages should now interact
with the gettext support.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 docs/manual/adding-packages-gettext.txt | 83 +++++++++++++++++----------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/docs/manual/adding-packages-gettext.txt b/docs/manual/adding-packages-gettext.txt
index c955b1f..e9c6968 100644
--- a/docs/manual/adding-packages-gettext.txt
+++ b/docs/manual/adding-packages-gettext.txt
@@ -7,53 +7,54 @@ Many packages that support internationalization use the gettext
 library. Dependencies for this library are fairly complicated and
 therefore, deserve some explanation.
 
-The 'uClibc' C library doesn't implement gettext functionality;
-therefore with this C library, a separate gettext must be compiled,
-which is provided by the additional +libintl+ library, part of the
+The 'glibc' C library integrates a full-blown implementation of
+'gettext', supporting translation. Native Language Support is
+therefore built-in in 'glibc'.
+
+On the other hand, the 'uClibc' and 'musl' C libraries only provide a
+stub implementation of the gettext functionality, which allows to
+compile libraries and programs using gettext functions, but without
+providing the translation capabilities of a full-blown gettext
+implementation. With such C libraries, if real Native Language Support
+is necessary, it can be provided by the +libintl+ library of the
 +gettext+ package.
 
-On the other hand, the 'glibc' C library does integrate its own
-gettext library functions, so it is not necessary to build a separate
-+libintl+ library.
+Due to this, and in order to make sure that Native Language Support is
+properly handled, packages in Buildroot that can use NLS support
+should:
 
-However, certain packages need some gettext utilities on the target,
+1. Ensure NLS support is enabled when +BR2_SYSTEM_ENABLE_NLS=y+. This
+   is done automatically for 'autotools' packages and therefore should
+   only be done for packages using other package infrastructures.
+
+1. Add +$(TARGET_NLS_DEPENDENCIES)+ to the package
+   +<pkg>_DEPENDENCIES+ variable. This addition should be done
+   unconditionally: the value of this variable is automatically
+   adjusted by the core infrastructure to contain the relevant list of
+   packages. If NLS support is disabled, this variable is empty. If
+   NLS support is enabled, this variable contains +host-gettext+ so
+   that tools needed to compile translation files are available on the
+   host. In addition, if 'uClibc' or 'musl' are used, this variable
+   also contains +gettext+ in order to get the full-blown 'gettext'
+   implementation.
+
+1. If needed, add +$(TARGET_NLS_LIBS)+ to the linker flags, so that
+   the package gets linked with +libintl+. This is generally not
+   needed with 'autotools' packages as they usually detect
+   automatically that they should link with +libintl+. However,
+   packages using other build systems, or problematic autotools-based
+   packages may need this. +$(TARGET_NLS_LIBS)+ should be added
+   unconditionally to the linker flags, as the core automatically
+   makes it empty or defined to +-lintl+ depending on the
+   configuration.
+
+No changes should be made to the +Config.in+ file to support NLS.
+
+Finally, certain packages need some gettext utilities on the target,
 such as the +gettext+ program itself, which allows to retrieve
-translated strings, from the command line.
-
-Additionally, some packages (such as +libglib2+) do require gettext
-functions unconditionally, while other packages (in general, those who
-support +--disable-nls+) only require gettext functions when locale
-support is enabled.
-
-Therefore, Buildroot defines two configuration options:
-
-* +BR2_NEEDS_GETTEXT+, which is true as soon as the toolchain doesn't
-  provide its own gettext implementation
-
-* +BR2_NEEDS_GETTEXT_IF_LOCALE+, which is true if the toolchain
-  doesn't provide its own gettext implementation and if locale support
-  is enabled
-
-Packages that need gettext only when locale support is enabled should:
-
-* use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+ in the
-  +Config.in+ file;
-
-* use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
-  +DEPENDENCIES+ variable in the +.mk+ file.
-
-Packages that unconditionally need gettext (which should be very rare)
+translated strings, from the command line. In such a case, the package
 should:
 
-* use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+ in the +Config.in+
-  file;
-
-* use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
-  +DEPENDENCIES+ variable in the +.mk+ file.
-
-Packages that need the +gettext+ utilities on the target (should be
-rare) should:
-
 * use +select BR2_PACKAGE_GETTEXT+ in their +Config.in+ file,
   indicating in a comment above that it's a runtime dependency only.
 
-- 
2.9.4

  parent reply	other threads:[~2017-07-04 14:49 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 ` [Buildroot] [PATCH 009/100] system: introduce BR2_SYSTEM_ENABLE_NLS Thomas Petazzoni
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 ` Thomas Petazzoni [this message]
2017-07-04 16:49   ` [Buildroot] [PATCH 099/100] docs/manual: update gettext details 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-100-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.