gettext-gnu.mk 3.5 KB

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