xref: /OK3568_Linux_fs/buildroot/package/icu/icu.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# icu
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# Git tags (and therefore versions on release-monitoring.org) use the
8*4882a593Smuzhiyun# XX-Y format, but the tarballs are named XX_Y and the containing
9*4882a593Smuzhiyun# directories XX.Y.
10*4882a593SmuzhiyunICU_VERSION = 70-1
11*4882a593SmuzhiyunICU_SOURCE = icu4c-$(subst -,_,$(ICU_VERSION))-src.tgz
12*4882a593SmuzhiyunICU_SITE = \
13*4882a593Smuzhiyun	https://github.com/unicode-org/icu/releases/download/release-$(ICU_VERSION)
14*4882a593SmuzhiyunICU_LICENSE = ICU License
15*4882a593SmuzhiyunICU_LICENSE_FILES = LICENSE
16*4882a593SmuzhiyunICU_CPE_ID_VENDOR = icu-project
17*4882a593SmuzhiyunICU_CPE_ID_PRODUCT = international_components_for_unicode
18*4882a593SmuzhiyunICU_CPE_ID_VERSION = $(subst -,.,$(ICU_VERSION))
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun# 0005-ICU-21587-Fix-memory-bug-w-baseName.patch
21*4882a593SmuzhiyunICU_IGNORE_CVES += CVE-2021-30535
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunICU_DEPENDENCIES = host-icu
24*4882a593SmuzhiyunICU_INSTALL_STAGING = YES
25*4882a593SmuzhiyunICU_CONFIG_SCRIPTS = icu-config
26*4882a593SmuzhiyunICU_CONF_OPTS = \
27*4882a593Smuzhiyun	--with-cross-build=$(HOST_ICU_DIR)/source \
28*4882a593Smuzhiyun	--disable-samples \
29*4882a593Smuzhiyun	--disable-tests
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun# When available, icu prefers to use C++11 atomics, which rely on the
32*4882a593Smuzhiyun# __atomic builtins. On certain architectures, this requires linking
33*4882a593Smuzhiyun# with libatomic starting from gcc 4.8.
34*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
35*4882a593SmuzhiyunICU_CONF_ENV += LIBS="-latomic"
36*4882a593Smuzhiyunendif
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun# strtod_l() is not supported by musl; also xlocale.h is missing
39*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
40*4882a593SmuzhiyunICU_CONF_ENV += ac_cv_func_strtod_l=no
41*4882a593Smuzhiyunendif
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunHOST_ICU_CONF_OPTS = \
44*4882a593Smuzhiyun	--disable-samples \
45*4882a593Smuzhiyun	--disable-tests \
46*4882a593Smuzhiyun	--disable-extras \
47*4882a593Smuzhiyun	--disable-icuio \
48*4882a593Smuzhiyun	--disable-layout
49*4882a593SmuzhiyunICU_SUBDIR = source
50*4882a593SmuzhiyunHOST_ICU_SUBDIR = source
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun# ICU build scripting adds paths to LD_LIBRARY_PATH using
53*4882a593Smuzhiyun#   LD_LIBRARY_PATH="custom-path:${LD_LIBRARY_PATH}"
54*4882a593Smuzhiyun# which, if LD_LIBRARY_PATH was empty, causes the last search directory
55*4882a593Smuzhiyun# to be the working directory, causing the build to try to load target
56*4882a593Smuzhiyun# libraries, possibly crashing the build due to ABI mismatches.
57*4882a593Smuzhiyun# Workaround by ensuring LD_LIBRARY_PATH is never empty.
58*4882a593Smuzhiyun# https://unicode-org.atlassian.net/browse/ICU-21417
59*4882a593Smuzhiyunifeq ($(LD_LIBRARY_PATH),)
60*4882a593SmuzhiyunICU_MAKE_ENV += LD_LIBRARY_PATH=/dev/null
61*4882a593Smuzhiyunendif
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunICU_CUSTOM_DATA_PATH = $(call qstrip,$(BR2_PACKAGE_ICU_CUSTOM_DATA_PATH))
64*4882a593Smuzhiyun
65*4882a593Smuzhiyunifneq ($(ICU_CUSTOM_DATA_PATH),)
66*4882a593Smuzhiyundefine ICU_COPY_CUSTOM_DATA
67*4882a593Smuzhiyun	cp $(ICU_CUSTOM_DATA_PATH) $(@D)/source/data/in/
68*4882a593Smuzhiyunendef
69*4882a593SmuzhiyunICU_POST_PATCH_HOOKS += ICU_COPY_CUSTOM_DATA
70*4882a593Smuzhiyunendif
71*4882a593Smuzhiyun
72*4882a593Smuzhiyundefine ICU_REMOVE_DEV_FILES
73*4882a593Smuzhiyun	rm -f $(addprefix $(TARGET_DIR)/usr/bin/,derb genbrk gencfu gencnval gendict genrb icuinfo makeconv uconv)
74*4882a593Smuzhiyun	rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,genccode gencmn gennorm2 gensprep icupkg)
75*4882a593Smuzhiyun	rm -rf $(TARGET_DIR)/usr/share/icu
76*4882a593Smuzhiyunendef
77*4882a593SmuzhiyunICU_POST_INSTALL_TARGET_HOOKS += ICU_REMOVE_DEV_FILES
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun$(eval $(autotools-package))
80*4882a593Smuzhiyun$(eval $(host-autotools-package))
81