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