gettext-gnu.mk 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ################################################################################
  2. #
  3. # gettext-gnu
  4. #
  5. ################################################################################
  6. # Please keep in sync with GETTEXT_TINY_ARCHIVE_VERSION in
  7. # gettext-tiny/gettext-tiny.mk
  8. GETTEXT_GNU_VERSION = 0.22
  9. GETTEXT_GNU_SITE = $(BR2_GNU_MIRROR)/gettext
  10. GETTEXT_GNU_SOURCE = gettext-$(GETTEXT_GNU_VERSION).tar.xz
  11. GETTEXT_GNU_INSTALL_STAGING = YES
  12. GETTEXT_GNU_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest)
  13. GETTEXT_GNU_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB
  14. GETTEXT_GNU_CPE_ID_VENDOR = gnu
  15. GETTEXT_GNU_CPE_ID_PRODUCT = gettext
  16. GETTEXT_GNU_PROVIDES = gettext
  17. GETTEXT_GNU_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
  18. # Avoid using the bundled subset of libxml2
  19. HOST_GETTEXT_GNU_DEPENDENCIES = host-libxml2
  20. GETTEXT_GNU_CONF_OPTS += \
  21. --disable-libasprintf \
  22. --disable-acl \
  23. --disable-openmp \
  24. --disable-rpath \
  25. --disable-java \
  26. --disable-native-java \
  27. --disable-csharp \
  28. --disable-relocatable \
  29. --without-emacs
  30. HOST_GETTEXT_GNU_CONF_OPTS = \
  31. --disable-libasprintf \
  32. --disable-acl \
  33. --disable-openmp \
  34. --disable-rpath \
  35. --disable-java \
  36. --disable-native-java \
  37. --disable-csharp \
  38. --disable-relocatable \
  39. --without-emacs
  40. # Force the build of libintl, even if the C library provides a stub
  41. # gettext implementation
  42. ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
  43. GETTEXT_GNU_CONF_OPTS += --with-included-gettext
  44. else
  45. GETTEXT_GNU_CONF_OPTS += --without-included-gettext
  46. endif
  47. # For the target version, we only need the runtime.
  48. GETTEXT_GNU_SUBDIR = gettext-runtime
  49. # For the host variant, we only need the tools, but those need the
  50. # runtime, so it is much simpler to build the whole package. _SUBDIR
  51. # for the host is inherited from the target if not set or empty, so
  52. # we need to explicitly set it to build the whole package.
  53. HOST_GETTEXT_GNU_SUBDIR = .
  54. # Disable the build of documentation and examples of gettext-tools,
  55. # and the build of documentation and tests of gettext-runtime.
  56. define HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  57. $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in
  58. $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in
  59. endef
  60. GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  61. HOST_GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  62. define GETTEXT_GNU_REMOVE_UNNEEDED
  63. $(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS
  64. rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext
  65. endef
  66. GETTEXT_GNU_POST_INSTALL_TARGET_HOOKS += GETTEXT_GNU_REMOVE_UNNEEDED
  67. # Force build with NLS support, otherwise libintl is not built
  68. # This is needed because some packages (eg. libglib2) requires
  69. # locales, but do not properly depend on BR2_ENABLE_LOCALE, and
  70. # instead select BR2_PACKAGE_GETTEXT_GNU. Those packages need to be
  71. # fixed before we can remove the following 3 lines... :-(
  72. ifeq ($(BR2_ENABLE_LOCALE),)
  73. GETTEXT_GNU_CONF_OPTS += --enable-nls
  74. endif
  75. # Disable interactive confirmation in host gettextize for package fixups
  76. define HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
  77. $(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize
  78. endef
  79. HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
  80. $(eval $(autotools-package))
  81. $(eval $(host-autotools-package))