adding-packages-gettext.txt 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. Gettext integration and interaction with packages
  4. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. Many packages that support internationalization use the gettext
  6. library. Dependencies for this library are fairly complicated and
  7. therefore, deserve some explanation.
  8. The 'uClibc' C library doesn't implement gettext functionality;
  9. therefore with this C library, a separate gettext must be compiled. On
  10. the other hand, the 'glibc' C library does integrate its own gettext,
  11. and in this case the separate gettext library should not be compiled,
  12. because it creates various kinds of build failures.
  13. Additionally, some packages (such as +libglib2+) do require gettext
  14. unconditionally, while other packages (those who support
  15. +--disable-nls+ in general) only require gettext when locale support
  16. is enabled.
  17. Therefore, Buildroot defines two configuration options:
  18. * +BR2_NEEDS_GETTEXT+, which is true as soon as the toolchain doesn't
  19. provide its own gettext implementation
  20. * +BR2_NEEDS_GETTEXT_IF_LOCALE+, which is true if the toolchain
  21. doesn't provide its own gettext implementation and if locale support
  22. is enabled
  23. Packages that need gettext only when locale support is enabled should:
  24. * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+ in the
  25. +Config.in+ file;
  26. * use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
  27. +DEPENDENCIES+ variable in the +.mk+ file.
  28. Packages that unconditionally need gettext (which should be very rare)
  29. should:
  30. * use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+ in the +Config.in+
  31. file;
  32. * use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
  33. +DEPENDENCIES+ variable in the +.mk+ file.