adding-packages-gettext.txt 2.2 KB

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