summaryrefslogtreecommitdiffstats
path: root/docs/manual/adding-packages-gettext.txt
blob: 1ed834e152a60fecee94615685fdbed682b0b0fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Gettext integration and interaction with packages
-------------------------------------------------

Many packages that support internationalization use the gettext
library. Dependencies for this library are fairly complicated and
therefore, deserves some explanation.

The 'uClibc' C library doesn't implement gettext functionality,
therefore with this C library, a separate gettext must be compiled. On
the other hand, the 'glibc' C library does integrate its own gettext,
and in this case, the separate gettext library should not be compiled,
because it creates various kinds of build failures.

Additionally, some packages (such as +libglib2+) do require gettext
unconditionally, while other packages (those who support
+--disable-nls+ in general) only require gettext 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

Therefore, packages that unconditionally need gettext should:

* Use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+ and possibly
  +select BR2_PACKAGE_LIBINTL if BR2_NEEDS_GETTEXT+, if libintl is
  also needed

* Use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
  +DEPENDENCIES+ variable

Packages that need gettext only when locale support is enabled should:

* Use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+ and
  possibly +select BR2_PACKAGE_LIBINTL if
  BR2_NEEDS_GETTEXT_IF_LOCALE+, if libintl is also needed

* Use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
  +DEPENDENCIES+ variable