adding-packages-gettext.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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, deserves 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. Therefore, packages that unconditionally need gettext should:
  23. * Use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT+
  24. * Use +$(if $(BR2_NEEDS_GETTEXT),gettext)+ in the package
  25. +DEPENDENCIES+ variable
  26. Packages that need gettext only when locale support is enabled should:
  27. * Use +select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE+
  28. * Use +$(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)+ in the package
  29. +DEPENDENCIES+ variable