• 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# ######################################################################
16# To get your own ICU userdata:
17#
18# Go to http://apps.icu-project.org/datacustom/ and configure yourself
19# a data file.  Unzip the file it gives you, and save that somewhere,
20# Set the icu_var_name variable to the location of that file in the tree.
21#
22# Make sure to choose ICU4C at the bottom.  You should also
23# make sure to pick all of the following options, as they are required
24# by the system.  Things will fail quietly if you don't have them:
25#
26# >>> base list goes here once we have it <<<
27#
28# ######################################################################
29LOCAL_PATH:= $(call my-dir)
30
31
32# This sets LOCAL_PRELINK_MODULE := false because the prelink map requires
33# a unique address for each shared library, but I think all the variants
34# of libicudata.so actually need to be mapped at the same address so they
35# can be interchangable.
36
37##
38
39# Build configuration:
40#
41# "Large" includes all the supported locales.
42# Japanese includes US and Japan.
43# US-Euro is needed for IT or PL builds
44# Default is suitable for CS, DE, EN, ES, FR, NL
45# US has only EN and ES
46
47
48config := $(word 1, \
49            $(if $(findstring ar,$(PRODUCT_LOCALES)),large) \
50            $(if $(findstring da,$(PRODUCT_LOCALES)),large) \
51            $(if $(findstring el,$(PRODUCT_LOCALES)),large) \
52            $(if $(findstring fi,$(PRODUCT_LOCALES)),large) \
53            $(if $(findstring he,$(PRODUCT_LOCALES)),large) \
54            $(if $(findstring hr,$(PRODUCT_LOCALES)),large) \
55            $(if $(findstring hu,$(PRODUCT_LOCALES)),large) \
56            $(if $(findstring id,$(PRODUCT_LOCALES)),large) \
57            $(if $(findstring ko,$(PRODUCT_LOCALES)),large) \
58            $(if $(findstring nb,$(PRODUCT_LOCALES)),large) \
59            $(if $(findstring pt,$(PRODUCT_LOCALES)),large) \
60            $(if $(findstring ro,$(PRODUCT_LOCALES)),large) \
61            $(if $(findstring ru,$(PRODUCT_LOCALES)),large) \
62            $(if $(findstring sk,$(PRODUCT_LOCALES)),large) \
63            $(if $(findstring sr,$(PRODUCT_LOCALES)),large) \
64            $(if $(findstring sv,$(PRODUCT_LOCALES)),large) \
65            $(if $(findstring th,$(PRODUCT_LOCALES)),large) \
66            $(if $(findstring tr,$(PRODUCT_LOCALES)),large) \
67            $(if $(findstring uk,$(PRODUCT_LOCALES)),large) \
68            $(if $(findstring zh,$(PRODUCT_LOCALES)),large) \
69            $(if $(findstring ja,$(PRODUCT_LOCALES)),us-japan) \
70            $(if $(findstring it,$(PRODUCT_LOCALES)),us-euro) \
71            $(if $(findstring pl,$(PRODUCT_LOCALES)),us-euro) \
72            $(if $(findstring cs,$(PRODUCT_LOCALES)),default) \
73            $(if $(findstring de,$(PRODUCT_LOCALES)),default) \
74            $(if $(findstring fr,$(PRODUCT_LOCALES)),default) \
75            $(if $(findstring nl,$(PRODUCT_LOCALES)),default) \
76            us)
77
78icu_var_name := icudt38_dat
79##
80
81
82###### Japanese
83
84include $(CLEAR_VARS)
85LOCAL_MODULE := libicudata-jp
86LOCAL_MODULE_CLASS := SHARED_LIBRARIES
87LOCAL_PRELINK_MODULE := false
88
89ifeq ($(config),us-japan)
90	LOCAL_MODULE_STEM := libicudata
91	LOCAL_MODULE_TAGS := user
92else
93	LOCAL_MODULE_TAGS := optional
94endif
95
96intermediates := $(call local-intermediates-dir)
97icu_data_file := $(LOCAL_PATH)/icudt38l-us-japan.dat
98
99asm_file := $(intermediates)/icu_data_jp.S
100LOCAL_GENERATED_SOURCES += $(asm_file)
101$(asm_file): PRIVATE_VAR_NAME := $(icu_var_name)
102$(asm_file): $(icu_data_file) $(ICUDATA)
103	@echo icudata: $@
104	$(hide) mkdir -p $(dir $@)
105	$(hide) $(ICUDATA) $(PRIVATE_VAR_NAME) < $< > $@
106
107LOCAL_CFLAGS  += -D_REENTRANT -DPIC -fPIC
108LOCAL_CFLAGS  += -O3 -nodefaultlibs -nostdlib
109
110include $(BUILD_SHARED_LIBRARY)
111
112###### Large
113
114include $(CLEAR_VARS)
115LOCAL_MODULE := libicudata-large
116LOCAL_MODULE_CLASS := SHARED_LIBRARIES
117LOCAL_PRELINK_MODULE := false
118
119ifeq ($(config),large)
120	LOCAL_MODULE_STEM := libicudata
121	LOCAL_MODULE_TAGS := user
122else
123	LOCAL_MODULE_TAGS := optional
124endif
125
126intermediates := $(call local-intermediates-dir)
127icu_data_file := $(LOCAL_PATH)/icudt38l-large.dat
128
129asm_file := $(intermediates)/icu_data_large.S
130LOCAL_GENERATED_SOURCES += $(asm_file)
131$(asm_file): PRIVATE_VAR_NAME := $(icu_var_name)
132$(asm_file): $(icu_data_file) $(ICUDATA)
133	@echo icudata: $@
134	$(hide) mkdir -p $(dir $@)
135	$(hide) $(ICUDATA) $(PRIVATE_VAR_NAME) < $< > $@
136
137LOCAL_CFLAGS  += -D_REENTRANT -DPIC -fPIC
138LOCAL_CFLAGS  += -O3 -nodefaultlibs -nostdlib
139
140include $(BUILD_SHARED_LIBRARY)
141
142###### Euro
143
144include $(CLEAR_VARS)
145LOCAL_MODULE := libicudata-eu
146LOCAL_MODULE_CLASS := SHARED_LIBRARIES
147LOCAL_PRELINK_MODULE := false
148
149ifeq ($(config),us-euro)
150	LOCAL_MODULE_STEM := libicudata
151	LOCAL_MODULE_TAGS := user
152else
153	LOCAL_MODULE_TAGS := optional
154endif
155
156intermediates := $(call local-intermediates-dir)
157icu_data_file := $(LOCAL_PATH)/icudt38l-us-euro.dat
158
159asm_file := $(intermediates)/icu_data_eu.S
160LOCAL_GENERATED_SOURCES += $(asm_file)
161$(asm_file): PRIVATE_VAR_NAME := $(icu_var_name)
162$(asm_file): $(icu_data_file) $(ICUDATA)
163	@echo icudata: $@
164	$(hide) mkdir -p $(dir $@)
165	$(hide) $(ICUDATA) $(PRIVATE_VAR_NAME) < $< > $@
166
167LOCAL_CFLAGS  += -D_REENTRANT -DPIC -fPIC
168LOCAL_CFLAGS  += -O3 -nodefaultlibs -nostdlib
169
170include $(BUILD_SHARED_LIBRARY)
171
172###### Default
173
174include $(CLEAR_VARS)
175LOCAL_MODULE := libicudata-default
176LOCAL_MODULE_CLASS := SHARED_LIBRARIES
177LOCAL_PRELINK_MODULE := false
178
179ifeq ($(config),default)
180	LOCAL_MODULE_STEM := libicudata
181	LOCAL_MODULE_TAGS := user
182else
183	LOCAL_MODULE_TAGS := optional
184endif
185
186intermediates := $(call local-intermediates-dir)
187icu_data_file := $(LOCAL_PATH)/icudt38l-default.dat
188
189asm_file := $(intermediates)/icu_data_default.S
190LOCAL_GENERATED_SOURCES += $(asm_file)
191$(asm_file): PRIVATE_VAR_NAME := $(icu_var_name)
192$(asm_file): $(icu_data_file) $(ICUDATA)
193	@echo icudata: $@
194	$(hide) mkdir -p $(dir $@)
195	$(hide) $(ICUDATA) $(PRIVATE_VAR_NAME) < $< > $@
196
197LOCAL_CFLAGS  += -D_REENTRANT -DPIC -fPIC
198LOCAL_CFLAGS  += -O3 -nodefaultlibs -nostdlib
199
200include $(BUILD_SHARED_LIBRARY)
201
202###### US
203
204include $(CLEAR_VARS)
205LOCAL_MODULE := libicudata-us
206LOCAL_MODULE_CLASS := SHARED_LIBRARIES
207LOCAL_PRELINK_MODULE := false
208
209ifeq ($(config),us)
210	LOCAL_MODULE_STEM := libicudata
211	LOCAL_MODULE_TAGS := user
212else
213	LOCAL_MODULE_TAGS := optional
214endif
215
216intermediates := $(call local-intermediates-dir)
217icu_data_file := $(LOCAL_PATH)/icudt38l-us.dat
218
219asm_file := $(intermediates)/icu_data_us.S
220LOCAL_GENERATED_SOURCES += $(asm_file)
221$(asm_file): PRIVATE_VAR_NAME := $(icu_var_name)
222$(asm_file): $(icu_data_file) $(ICUDATA)
223	@echo icudata: $@
224	$(hide) mkdir -p $(dir $@)
225	$(hide) $(ICUDATA) $(PRIVATE_VAR_NAME) < $< > $@
226
227LOCAL_CFLAGS  += -D_REENTRANT -DPIC -fPIC
228LOCAL_CFLAGS  += -O3 -nodefaultlibs -nostdlib
229
230include $(BUILD_SHARED_LIBRARY)
231######
232