adding-packages-gettext.txt 1.7 KB

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