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 cstring.c \ 24 cwchar.c locmap.c \ 25 punycode.c putil.c \ 26 uarrsort.c ubidi.c \ 27 ubidiln.c ubidi_props.c \ 28 ubidiwrt.c ucase.c \ 29 ucasemap.c ucat.c \ 30 uchar.c ucln_cmn.c \ 31 ucmndata.c \ 32 ucnv2022.c ucnv_bld.c \ 33 ucnvbocu.c ucnv.c \ 34 ucnv_cb.c ucnv_cnv.c \ 35 ucnvdisp.c ucnv_err.c \ 36 ucnv_ext.c ucnvhz.c \ 37 ucnv_io.c ucnvisci.c \ 38 ucnvlat1.c ucnv_lmb.c \ 39 ucnvmbcs.c ucnvscsu.c \ 40 ucnv_set.c ucnv_u16.c \ 41 ucnv_u32.c ucnv_u7.c \ 42 ucnv_u8.c \ 43 udatamem.c \ 44 udataswp.c uenum.c \ 45 uhash.c uinit.c \ 46 uinvchar.c uloc.c \ 47 umapfile.c umath.c \ 48 umutex.c unames.c \ 49 unorm_it.c uresbund.c \ 50 ures_cnv.c uresdata.c \ 51 usc_impl.c uscript.c \ 52 ushape.c ustrcase.c \ 53 ustr_cnv.c ustrfmt.c \ 54 ustring.c ustrtrns.c \ 55 ustr_wcs.c utf_impl.c \ 56 utrace.c utrie.c \ 57 utypes.c wintz.c \ 58 utrie2_builder.c icuplug.c \ 59 propsvec.c ulist.c \ 60 uloc_tag.c ucnv_ct.c 61 62src_files += \ 63 bmpset.cpp unisetspan.cpp \ 64 brkeng.cpp brkiter.cpp \ 65 caniter.cpp chariter.cpp \ 66 dictbe.cpp locbased.cpp \ 67 locid.cpp locutil.cpp \ 68 normlzr.cpp parsepos.cpp \ 69 propname.cpp rbbi.cpp \ 70 rbbidata.cpp rbbinode.cpp \ 71 rbbirb.cpp rbbiscan.cpp \ 72 rbbisetb.cpp rbbistbl.cpp \ 73 rbbitblb.cpp resbund_cnv.cpp \ 74 resbund.cpp ruleiter.cpp \ 75 schriter.cpp serv.cpp \ 76 servlk.cpp servlkf.cpp \ 77 servls.cpp servnotf.cpp \ 78 servrbf.cpp servslkf.cpp \ 79 triedict.cpp ubrk.cpp \ 80 uchriter.cpp uhash_us.cpp \ 81 uidna.cpp uiter.cpp \ 82 unifilt.cpp unifunct.cpp \ 83 uniset.cpp uniset_props.cpp \ 84 unistr_case.cpp unistr_cnv.cpp \ 85 unistr.cpp unistr_props.cpp \ 86 unormcmp.cpp unorm.cpp \ 87 uobject.cpp uset.cpp \ 88 usetiter.cpp uset_props.cpp \ 89 usprep.cpp ustack.cpp \ 90 ustrenum.cpp utext.cpp \ 91 util.cpp util_props.cpp \ 92 uvector.cpp uvectr32.cpp \ 93 errorcode.cpp \ 94 bytestream.cpp stringpiece.cpp \ 95 mutex.cpp dtintrv.cpp \ 96 ucnvsel.cpp uvectr64.cpp \ 97 locavailable.cpp locdispnames.cpp \ 98 loclikely.cpp locresdata.cpp \ 99 normalizer2impl.cpp normalizer2.cpp \ 100 filterednormalizer2.cpp ucol_swp.cpp \ 101 uprops.cpp utrie2.cpp \ 102 charstr.cpp uts46.cpp \ 103 udata.cpp appendable.cpp bytestrie.cpp \ 104 bytestriebuilder.cpp bytestrieiterator.cpp \ 105 messagepattern.cpp patternprops.cpp stringtriebuilder.cpp \ 106 ucharstrie.cpp ucharstriebuilder.cpp ucharstrieiterator.cpp 107 108# This is the empty compiled-in icu data structure 109# that we need to satisfy the linker. 110src_files += ../stubdata/stubdata.c 111 112c_includes := \ 113 $(LOCAL_PATH) \ 114 $(LOCAL_PATH)/../i18n 115 116# We make the ICU data directory relative to $ANDROID_ROOT on Android, so both 117# device and sim builds can use the same codepath, and it's hard to break one 118# without noticing because the other still works. 119local_cflags := '-DICU_DATA_DIR_PREFIX_ENV_VAR="ANDROID_ROOT"' 120local_cflags += '-DICU_DATA_DIR="/usr/icu"' 121 122local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -fvisibility=hidden 123local_ldlibs := -lpthread -lm 124 125 126# 127# Build for the target (device). 128# 129 130include $(CLEAR_VARS) 131LOCAL_SRC_FILES := $(src_files) 132LOCAL_C_INCLUDES := $(c_includes) \ 133 abi/cpp/include 134LOCAL_CFLAGS := $(local_cflags) -DPIC -fPIC 135LOCAL_RTTI_FLAG := -frtti 136LOCAL_SHARED_LIBRARIES += libgabi++ 137LOCAL_LDLIBS += $(local_ldlibs) 138LOCAL_MODULE_TAGS := optional 139LOCAL_MODULE := libicuuc 140include $(BUILD_SHARED_LIBRARY) 141 142 143# 144# Build for the host. 145# 146 147ifeq ($(WITH_HOST_DALVIK),true) 148 include $(CLEAR_VARS) 149 include $(LOCAL_PATH)/../stubdata/root.mk 150 LOCAL_SRC_FILES := $(src_files) 151 LOCAL_C_INCLUDES := $(c_includes) 152 LOCAL_CFLAGS := $(local_cflags) 153 LOCAL_LDLIBS += $(local_ldlibs) 154 LOCAL_ADDITIONAL_DEPENDENCIES += $(HOST_OUT)/usr/icu/$(root).dat 155 LOCAL_MODULE_TAGS := optional 156 LOCAL_MODULE := libicuuc 157 include $(BUILD_HOST_SHARED_LIBRARY) 158endif 159