adding-packages-gettext.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // -*- mode:doc; -*-
  2. Gettext integration and interaction with packages
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  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. On
  9. the other hand, the 'glibc' C library does integrate its own gettext,
  10. and in this case the separate gettext library should not be compiled,
  11. because it creates various kinds of build failures.
  12. Additionally, some packages (such as +libglib2+) do require gettext
  13. unconditionally, while other packages (those who support
  14. +--disable-nls+ in general) only require gettext when locale support
  15. is enabled.
  16. Therefore, Buildroot defines two configuration options:
  17. * +BR2_NEEDS_GETTEXT+, which is true as soon as the toolchain doesn't
  18. provide its own gettext implementation
  19. * +BR2_NEEDS_GETTEXT_IF_LOCALE+, which is true if the toolchain
  20. doesn't provide its own gettext implementation and if locale support
  21. is enabled
  22. Packages that need gettext only when locale support is enabled should:
  23. * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+ in the
  24. +Config.in+ file;
  25. * use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
  26. +DEPENDENCIES+ variable in the +.mk+ file.
  27. Packages that unconditionally need gettext (which should be very rare)
  28. should:
  29. * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+ in the +Config.in+
  30. file;
  31. * use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
  32. +DEPENDENCIES+ variable in the +.mk+ file.