• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2008 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16LOCAL_PATH:= $(call my-dir)
17
18#
19# Common definitions.
20#
21
22src_files := \
23	cmemory.c \
24	cstring.c \
25	cstr.cpp \
26	cwchar.c \
27	filteredbrk.cpp \
28	icuplug.cpp \
29	loadednormalizer2impl.cpp \
30	locmap.c \
31	pluralmap.cpp \
32	propsvec.c \
33	punycode.cpp \
34	putil.cpp \
35	resource.cpp \
36	sharedobject.cpp \
37	simplepatternformatter.cpp \
38	uarrsort.c \
39	ubidi.c \
40	ubidiln.c \
41	ubidi_props.c \
42	ubidiwrt.c \
43	ucase.cpp \
44	ucasemap.cpp \
45	ucat.c \
46	uchar.c \
47	ucln_cmn.cpp \
48	ucmndata.c \
49	ucnv2022.cpp \
50	ucnv_bld.cpp \
51	ucnvbocu.cpp \
52	ucnv.c \
53	ucnv_cb.c \
54	ucnv_cnv.c \
55	ucnv_ct.c \
56	ucnvdisp.c \
57	ucnv_err.c \
58	ucnv_ext.cpp \
59	ucnvhz.c \
60	ucnv_io.cpp \
61	ucnvisci.c \
62	ucnvlat1.c \
63	ucnv_lmb.c \
64	ucnvmbcs.cpp \
65	ucnvscsu.c \
66	ucnv_set.c \
67	ucnv_u16.c \
68	ucnv_u32.c \
69	ucnv_u7.c \
70	ucnv_u8.c \
71	udatamem.c \
72	udataswp.c \
73	uenum.c \
74	uhash.c \
75	uinit.cpp \
76	uinvchar.c \
77	ulist.c \
78	ulistformatter.cpp \
79	uloc.cpp \
80	uloc_keytype.cpp \
81	uloc_tag.c \
82	umapfile.c \
83	umath.c \
84	umutex.cpp \
85	unames.cpp \
86	uresbund.cpp \
87	ures_cnv.c \
88	uresdata.cpp \
89	usc_impl.c \
90	uscript.c \
91	uscript_props.cpp \
92	ushape.cpp \
93	ustrcase.cpp \
94	ustr_cnv.cpp \
95	ustrfmt.c \
96	ustring.cpp \
97	ustrtrns.cpp \
98	ustr_wcs.cpp \
99	utf_impl.c \
100	utrace.c \
101	utrie2_builder.cpp \
102	utrie.cpp \
103	utypes.c \
104	wintz.c
105
106src_files += \
107	appendable.cpp \
108	bmpset.cpp \
109	brkeng.cpp \
110	brkiter.cpp \
111	bytestream.cpp \
112	bytestriebuilder.cpp \
113	bytestrie.cpp \
114	bytestrieiterator.cpp \
115	caniter.cpp \
116	chariter.cpp \
117	charstr.cpp \
118	dictbe.cpp \
119	dictionarydata.cpp \
120	dtintrv.cpp \
121	errorcode.cpp \
122	filterednormalizer2.cpp \
123	listformatter.cpp \
124	locavailable.cpp \
125	locbased.cpp \
126	locdispnames.cpp \
127	locid.cpp \
128	loclikely.cpp \
129	locresdata.cpp \
130	locutil.cpp \
131	messagepattern.cpp \
132	normalizer2.cpp \
133	normalizer2impl.cpp \
134	normlzr.cpp \
135	parsepos.cpp \
136	patternprops.cpp \
137	propname.cpp \
138	rbbi.cpp \
139	rbbidata.cpp \
140	rbbinode.cpp \
141	rbbirb.cpp \
142	rbbiscan.cpp \
143	rbbisetb.cpp \
144	rbbistbl.cpp \
145	rbbitblb.cpp \
146	resbund_cnv.cpp \
147	resbund.cpp \
148	ruleiter.cpp \
149	schriter.cpp \
150	serv.cpp \
151	servlk.cpp \
152	servlkf.cpp \
153	servls.cpp \
154	servnotf.cpp \
155	servrbf.cpp \
156	servslkf.cpp \
157	stringpiece.cpp \
158	stringtriebuilder.cpp \
159	ubrk.cpp \
160	ucasemap_titlecase_brkiter.cpp \
161	ucharstriebuilder.cpp \
162	ucharstrie.cpp \
163	ucharstrieiterator.cpp \
164	uchriter.cpp \
165	ucnvsel.cpp \
166	ucol_swp.cpp \
167	udata.cpp \
168	uhash_us.cpp \
169	uidna.cpp \
170	uiter.cpp \
171	unifiedcache.cpp \
172	unifilt.cpp \
173	unifunct.cpp \
174	uniset_closure.cpp \
175	uniset.cpp \
176	uniset_props.cpp \
177	unisetspan.cpp \
178	unistr_case.cpp \
179	unistr_case_locale.cpp \
180	unistr_cnv.cpp \
181	unistr.cpp \
182	unistr_props.cpp \
183	unistr_titlecase_brkiter.cpp \
184	unormcmp.cpp \
185	unorm.cpp \
186	uobject.cpp \
187	uprops.cpp \
188	uset.cpp \
189	usetiter.cpp \
190	uset_props.cpp \
191	usprep.cpp \
192	ustack.cpp \
193	ustrcase_locale.cpp \
194	ustrenum.cpp \
195	ustr_titlecase_brkiter.cpp \
196	utext.cpp \
197	util.cpp \
198	util_props.cpp \
199	utrie2.cpp \
200	uts46.cpp \
201	uvector.cpp \
202	uvectr32.cpp \
203	uvectr64.cpp
204
205# This is the empty compiled-in icu data structure
206# that we need to satisfy the linker.
207src_files += ../stubdata/stubdata.c
208
209c_includes := \
210	$(LOCAL_PATH) \
211	$(LOCAL_PATH)/../i18n
212
213# We deliberately do not set -DICU_DATA_DIR: ICU4C is configured on Android
214# using udata_setCommonData.
215
216local_cflags += -D_REENTRANT
217local_cflags += -DU_COMMON_IMPLEMENTATION
218
219local_cflags += -O3 -fvisibility=hidden
220
221local_cflags += -Wno-unused-parameter \
222                -Wno-missing-field-initializers \
223                -Wno-sign-compare \
224                -Wno-deprecated-declarations
225
226#
227# Build for the target (device).
228#
229
230include $(CLEAR_VARS)
231LOCAL_SRC_FILES += $(src_files)
232LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
233LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
234LOCAL_SHARED_LIBRARIES += libdl $(optional_android_logging_libraries)
235LOCAL_MODULE_TAGS := optional
236LOCAL_MODULE := libicuuc
237LOCAL_RTTI_FLAG := -frtti
238LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
239ifndef BRILLO
240LOCAL_REQUIRED_MODULES += icu-data
241endif
242LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
243ifneq ($(TARGET_ARCH),mips64)
244LOCAL_CLANG := true
245endif
246include $(BUILD_SHARED_LIBRARY)
247
248#
249# Build for the host.
250#
251
252include $(CLEAR_VARS)
253LOCAL_SRC_FILES += $(src_files)
254LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
255LOCAL_CFLAGS += $(local_cflags)
256LOCAL_SHARED_LIBRARIES += $(optional_android_logging_libraries)
257LOCAL_LDLIBS += -ldl -lm -lpthread
258LOCAL_MODULE_TAGS := optional
259LOCAL_MODULE := libicuuc-host
260LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
261LOCAL_REQUIRED_MODULES += icu-data-host
262LOCAL_MULTILIB := both
263LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
264LOCAL_CLANG := true
265include $(BUILD_HOST_SHARED_LIBRARY)
266
267#
268# Build as a static library against the NDK
269#
270
271include $(CLEAR_VARS)
272LOCAL_SDK_VERSION := 9
273LOCAL_NDK_STL_VARIANT := stlport_static
274LOCAL_C_INCLUDES += $(c_includes)
275LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
276LOCAL_RTTI_FLAG := -frtti
277LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
278# Using -Os over -O3 actually cuts down the final executable size by a few dozen kilobytes
279LOCAL_CFLAGS += -Os
280LOCAL_EXPORT_CFLAGS += -DU_STATIC_IMPLEMENTATION=1
281LOCAL_MODULE_TAGS := optional
282LOCAL_MODULE := libicuuc_static
283LOCAL_SRC_FILES += $(src_files)
284ifndef BRILLO
285LOCAL_REQUIRED_MODULES += icu-data
286endif
287ifneq ($(TARGET_ARCH),mips64)
288LOCAL_CLANG := true
289endif
290include $(BUILD_STATIC_LIBRARY)
291