gettext-gnu.mk 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ################################################################################
  2. #
  3. # gettext-gnu
  4. #
  5. ################################################################################
  6. # Please keep in sync with package/libtextstyle/libtextstyle.mk
  7. GETTEXT_GNU_VERSION = 0.20.1
  8. GETTEXT_GNU_SITE = $(BR2_GNU_MIRROR)/gettext
  9. GETTEXT_GNU_SOURCE = gettext-$(GETTEXT_GNU_VERSION).tar.xz
  10. GETTEXT_GNU_INSTALL_STAGING = YES
  11. GETTEXT_GNU_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest)
  12. GETTEXT_GNU_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB
  13. # 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
  14. GETTEXT_GNU_AUTORECONF = YES
  15. GETTEXT_GNU_PROVIDES = gettext
  16. GETTEXT_GNU_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
  17. # Avoid using the bundled subset of libxml2
  18. HOST_GETTEXT_GNU_DEPENDENCIES = host-libxml2 host-libtextstyle
  19. GETTEXT_GNU_CONF_OPTS += \
  20. --disable-libasprintf \
  21. --disable-acl \
  22. --disable-openmp \
  23. --disable-rpath \
  24. --disable-java \
  25. --disable-native-java \
  26. --disable-csharp \
  27. --disable-relocatable \
  28. --without-emacs
  29. HOST_GETTEXT_GNU_CONF_OPTS = \
  30. --disable-libasprintf \
  31. --disable-acl \
  32. --disable-openmp \
  33. --disable-rpath \
  34. --disable-java \
  35. --disable-native-java \
  36. --disable-csharp \
  37. --disable-relocatable \
  38. --without-emacs \
  39. --with-installed-libtextstyle
  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, and for the host
  48. # version, we only need the tools.
  49. GETTEXT_GNU_SUBDIR = gettext-runtime
  50. HOST_GETTEXT_GNU_SUBDIR = gettext-tools
  51. # Disable the build of documentation and examples of gettext-tools,
  52. # and the build of documentation and tests of gettext-runtime.
  53. define HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  54. $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in
  55. $(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in
  56. endef
  57. GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  58. HOST_GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
  59. define GETTEXT_GNU_REMOVE_UNNEEDED
  60. $(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS
  61. rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext
  62. endef
  63. GETTEXT_GNU_POST_INSTALL_TARGET_HOOKS += GETTEXT_GNU_REMOVE_UNNEEDED
  64. # Force build with NLS support, otherwise libintl is not built
  65. # This is needed because some packages (eg. libglib2) requires
  66. # locales, but do not properly depend on BR2_ENABLE_LOCALE, and
  67. # instead select BR2_PACKAGE_GETTEXT_GNU. Those packages need to be
  68. # fixed before we can remove the following 3 lines... :-(
  69. ifeq ($(BR2_ENABLE_LOCALE),)
  70. GETTEXT_GNU_CONF_OPTS += --enable-nls
  71. endif
  72. # Disable interactive confirmation in host gettextize for package fixups
  73. define HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
  74. $(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize
  75. endef
  76. HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
  77. # autoreconf expects gettextize to install ABOUT-NLS, but it only gets
  78. # installed by gettext-runtime which we don't build/install for the
  79. # host, so do it manually
  80. define HOST_GETTEXT_GNU_ADD_ABOUT_NLS
  81. $(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_GNU_SUBDIR)/ABOUT-NLS \
  82. $(HOST_DIR)/share/gettext/ABOUT-NLS
  83. endef
  84. HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_ADD_ABOUT_NLS
  85. $(eval $(autotools-package))
  86. $(eval $(host-autotools-package))