2 // vim: set syntax=asciidoc:
4 === Gettext integration and interaction with packages
6 Many packages that support internationalization use the gettext
7 library. Dependencies for this library are fairly complicated and
8 therefore, deserve some explanation.
10 The 'uClibc' C library doesn't implement gettext functionality;
11 therefore with this C library, a separate gettext must be compiled,
12 which is provided by the additional +libintl+ library, part of the
15 On the other hand, the 'glibc' C library does integrate its own
16 gettext library functions, so it is not necessary to build a separate
19 However, certain packages need some gettext utilities on the target,
20 such as the +gettext+ program itself, which allows to retrieve
21 translated strings, from the command line.
23 Additionally, some packages (such as +libglib2+) do require gettext
24 functions unconditionally, while other packages (in general, those who
25 support +--disable-nls+) only require gettext functions when locale
28 Therefore, Buildroot defines two configuration options:
30 * +BR2_NEEDS_GETTEXT+, which is true as soon as the toolchain doesn't
31 provide its own gettext implementation
33 * +BR2_NEEDS_GETTEXT_IF_LOCALE+, which is true if the toolchain
34 doesn't provide its own gettext implementation and if locale support
37 Packages that need gettext only when locale support is enabled should:
39 * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+ in the
42 * use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
43 +DEPENDENCIES+ variable in the +.mk+ file.
45 Packages that unconditionally need gettext (which should be very rare)
48 * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+ in the +Config.in+
51 * use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
52 +DEPENDENCIES+ variable in the +.mk+ file.
54 Packages that need the +gettext+ utilities on the target (should be
57 * use +select BR2_PACKAGE_GETTEXT+ in their +Config.in+ file,
58 indicating in a comment above that it's a runtime dependency only.
60 * not add any +gettext+ dependency in the +DEPENDENCIES+ variable of