xref: /OK3568_Linux_fs/buildroot/package/gettext-gnu/gettext-gnu.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# gettext-gnu
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# Please keep in sync with package/libtextstyle/libtextstyle.mk
8*4882a593SmuzhiyunGETTEXT_GNU_VERSION = 0.20.1
9*4882a593SmuzhiyunGETTEXT_GNU_SITE = $(BR2_GNU_MIRROR)/gettext
10*4882a593SmuzhiyunGETTEXT_GNU_SOURCE = gettext-$(GETTEXT_GNU_VERSION).tar.xz
11*4882a593SmuzhiyunGETTEXT_GNU_INSTALL_STAGING = YES
12*4882a593SmuzhiyunGETTEXT_GNU_LICENSE = LGPL-2.1+ (libintl), GPL-3.0+ (the rest)
13*4882a593SmuzhiyunGETTEXT_GNU_LICENSE_FILES = COPYING gettext-runtime/intl/COPYING.LIB
14*4882a593SmuzhiyunGETTEXT_GNU_CPE_ID_VENDOR = gnu
15*4882a593SmuzhiyunGETTEXT_GNU_CPE_ID_PRODUCT = gettext
16*4882a593Smuzhiyun# 0002-restore-the-ability-to-buld-gettext-tools-seperately-part1.patch
17*4882a593SmuzhiyunGETTEXT_GNU_AUTORECONF = YES
18*4882a593SmuzhiyunGETTEXT_GNU_PROVIDES = gettext
19*4882a593SmuzhiyunGETTEXT_GNU_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun# Avoid using the bundled subset of libxml2
22*4882a593SmuzhiyunHOST_GETTEXT_GNU_DEPENDENCIES = host-libxml2 host-libtextstyle
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunGETTEXT_GNU_CONF_OPTS += \
25*4882a593Smuzhiyun	--disable-libasprintf \
26*4882a593Smuzhiyun	--disable-acl \
27*4882a593Smuzhiyun	--disable-openmp \
28*4882a593Smuzhiyun	--disable-rpath \
29*4882a593Smuzhiyun	--disable-java \
30*4882a593Smuzhiyun	--disable-native-java \
31*4882a593Smuzhiyun	--disable-csharp \
32*4882a593Smuzhiyun	--disable-relocatable \
33*4882a593Smuzhiyun	--without-emacs
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunHOST_GETTEXT_GNU_CONF_OPTS = \
36*4882a593Smuzhiyun	--disable-libasprintf \
37*4882a593Smuzhiyun	--disable-acl \
38*4882a593Smuzhiyun	--disable-openmp \
39*4882a593Smuzhiyun	--disable-rpath \
40*4882a593Smuzhiyun	--disable-java \
41*4882a593Smuzhiyun	--disable-native-java \
42*4882a593Smuzhiyun	--disable-csharp \
43*4882a593Smuzhiyun	--disable-relocatable \
44*4882a593Smuzhiyun	--without-emacs \
45*4882a593Smuzhiyun	--with-installed-libtextstyle
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun# Force the build of libintl, even if the C library provides a stub
48*4882a593Smuzhiyun# gettext implementation
49*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
50*4882a593SmuzhiyunGETTEXT_GNU_CONF_OPTS += --with-included-gettext
51*4882a593Smuzhiyunelse
52*4882a593SmuzhiyunGETTEXT_GNU_CONF_OPTS += --without-included-gettext
53*4882a593Smuzhiyunendif
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun# For the target version, we only need the runtime, and for the host
56*4882a593Smuzhiyun# version, we only need the tools.
57*4882a593SmuzhiyunGETTEXT_GNU_SUBDIR = gettext-runtime
58*4882a593SmuzhiyunHOST_GETTEXT_GNU_SUBDIR = gettext-tools
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun# Disable the build of documentation and examples of gettext-tools,
61*4882a593Smuzhiyun# and the build of documentation and tests of gettext-runtime.
62*4882a593Smuzhiyundefine HOST_GETTEXT_GNU_DISABLE_UNNEEDED
63*4882a593Smuzhiyun	$(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/examples$$//' $(@D)/gettext-tools/Makefile.in
64*4882a593Smuzhiyun	$(SED) '/^SUBDIRS/s/ doc //;/^SUBDIRS/s/tests$$//' $(@D)/gettext-runtime/Makefile.in
65*4882a593Smuzhiyunendef
66*4882a593Smuzhiyun
67*4882a593SmuzhiyunGETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
68*4882a593SmuzhiyunHOST_GETTEXT_GNU_POST_PATCH_HOOKS += HOST_GETTEXT_GNU_DISABLE_UNNEEDED
69*4882a593Smuzhiyun
70*4882a593Smuzhiyundefine GETTEXT_GNU_REMOVE_UNNEEDED
71*4882a593Smuzhiyun	$(RM) -rf $(TARGET_DIR)/usr/share/gettext/ABOUT-NLS
72*4882a593Smuzhiyun	rmdir --ignore-fail-on-non-empty $(TARGET_DIR)/usr/share/gettext
73*4882a593Smuzhiyunendef
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunGETTEXT_GNU_POST_INSTALL_TARGET_HOOKS += GETTEXT_GNU_REMOVE_UNNEEDED
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun# Force build with NLS support, otherwise libintl is not built
78*4882a593Smuzhiyun# This is needed because some packages (eg. libglib2) requires
79*4882a593Smuzhiyun# locales, but do not properly depend on BR2_ENABLE_LOCALE, and
80*4882a593Smuzhiyun# instead select BR2_PACKAGE_GETTEXT_GNU. Those packages need to be
81*4882a593Smuzhiyun# fixed before we can remove the following 3 lines... :-(
82*4882a593Smuzhiyunifeq ($(BR2_ENABLE_LOCALE),)
83*4882a593SmuzhiyunGETTEXT_GNU_CONF_OPTS += --enable-nls
84*4882a593Smuzhiyunendif
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun# Disable interactive confirmation in host gettextize for package fixups
87*4882a593Smuzhiyundefine HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
88*4882a593Smuzhiyun	$(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize
89*4882a593Smuzhiyunendef
90*4882a593SmuzhiyunHOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun# autoreconf expects gettextize to install ABOUT-NLS, but it only gets
93*4882a593Smuzhiyun# installed by gettext-runtime which we don't build/install for the
94*4882a593Smuzhiyun# host, so do it manually
95*4882a593Smuzhiyundefine HOST_GETTEXT_GNU_ADD_ABOUT_NLS
96*4882a593Smuzhiyun	$(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_GNU_SUBDIR)/ABOUT-NLS \
97*4882a593Smuzhiyun		$(HOST_DIR)/share/gettext/ABOUT-NLS
98*4882a593Smuzhiyunendef
99*4882a593Smuzhiyun
100*4882a593SmuzhiyunHOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_ADD_ABOUT_NLS
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun$(eval $(autotools-package))
103*4882a593Smuzhiyun$(eval $(host-autotools-package))
104