1BASE_PATH := $(call my-dir) 2LOCAL_PATH:= $(call my-dir) 3 4include $(CLEAR_VARS) 5LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 6 7# We default to release for the Android build system. Developers debugging 8# code can build with "Debug" 9GYP_CONFIGURATION := Release 10 11LOCAL_MODULE_CLASS := STATIC_LIBRARIES 12LOCAL_MODULE := libsfntly 13LOCAL_MODULE_SUFFIX := .a 14LOCAL_MODULE_TAGS := optional 15 16LOCAL_CPP_EXTENSION := .cc 17LOCAL_GENERATED_SOURCES := 18 19LOCAL_SRC_FILES := \ 20 cpp/src/sfntly/data/byte_array.cc \ 21 cpp/src/sfntly/data/font_data.cc \ 22 cpp/src/sfntly/data/font_input_stream.cc \ 23 cpp/src/sfntly/data/font_output_stream.cc \ 24 cpp/src/sfntly/data/growable_memory_byte_array.cc \ 25 cpp/src/sfntly/data/memory_byte_array.cc \ 26 cpp/src/sfntly/data/readable_font_data.cc \ 27 cpp/src/sfntly/data/writable_font_data.cc \ 28 cpp/src/sfntly/font.cc \ 29 cpp/src/sfntly/font_factory.cc \ 30 cpp/src/sfntly/port/file_input_stream.cc \ 31 cpp/src/sfntly/port/lock.cc \ 32 cpp/src/sfntly/port/memory_input_stream.cc \ 33 cpp/src/sfntly/port/memory_output_stream.cc \ 34 cpp/src/sfntly/table/bitmap/big_glyph_metrics.cc \ 35 cpp/src/sfntly/table/bitmap/bitmap_glyph.cc \ 36 cpp/src/sfntly/table/bitmap/bitmap_glyph_info.cc \ 37 cpp/src/sfntly/table/bitmap/bitmap_size_table.cc \ 38 cpp/src/sfntly/table/bitmap/composite_bitmap_glyph.cc \ 39 cpp/src/sfntly/table/bitmap/ebdt_table.cc \ 40 cpp/src/sfntly/table/bitmap/eblc_table.cc \ 41 cpp/src/sfntly/table/bitmap/ebsc_table.cc \ 42 cpp/src/sfntly/table/bitmap/glyph_metrics.cc \ 43 cpp/src/sfntly/table/bitmap/index_sub_table.cc \ 44 cpp/src/sfntly/table/bitmap/index_sub_table_format1.cc \ 45 cpp/src/sfntly/table/bitmap/index_sub_table_format2.cc \ 46 cpp/src/sfntly/table/bitmap/index_sub_table_format3.cc \ 47 cpp/src/sfntly/table/bitmap/index_sub_table_format4.cc \ 48 cpp/src/sfntly/table/bitmap/index_sub_table_format5.cc \ 49 cpp/src/sfntly/table/bitmap/simple_bitmap_glyph.cc \ 50 cpp/src/sfntly/table/bitmap/small_glyph_metrics.cc \ 51 cpp/src/sfntly/table/byte_array_table_builder.cc \ 52 cpp/src/sfntly/table/core/cmap_table.cc \ 53 cpp/src/sfntly/table/core/font_header_table.cc \ 54 cpp/src/sfntly/table/core/horizontal_device_metrics_table.cc \ 55 cpp/src/sfntly/table/core/horizontal_header_table.cc \ 56 cpp/src/sfntly/table/core/horizontal_metrics_table.cc \ 57 cpp/src/sfntly/table/core/maximum_profile_table.cc \ 58 cpp/src/sfntly/table/core/name_table.cc \ 59 cpp/src/sfntly/table/core/os2_table.cc \ 60 cpp/src/sfntly/table/font_data_table.cc \ 61 cpp/src/sfntly/table/generic_table_builder.cc \ 62 cpp/src/sfntly/table/header.cc \ 63 cpp/src/sfntly/table/subtable.cc \ 64 cpp/src/sfntly/table/table.cc \ 65 cpp/src/sfntly/table/table_based_table_builder.cc \ 66 cpp/src/sfntly/table/truetype/glyph_table.cc \ 67 cpp/src/sfntly/table/truetype/loca_table.cc \ 68 cpp/src/sfntly/tag.cc \ 69 cpp/src/sample/chromium/font_subsetter.cc \ 70 cpp/src/sample/chromium/subsetter_impl.cc 71 72 73# Flags passed to both C and C++ files. 74MY_CFLAGS_Debug := \ 75 -fstack-protector \ 76 --param=ssp-buffer-size=4 \ 77 -Werror \ 78 -fno-exceptions \ 79 -fno-strict-aliasing \ 80 -Wall \ 81 -Wno-unused-parameter \ 82 -Wno-missing-field-initializers \ 83 -fvisibility=hidden \ 84 -pipe \ 85 -fPIC \ 86 -fno-tree-sra \ 87 -Wno-psabi \ 88 -ffunction-sections \ 89 -funwind-tables \ 90 -g \ 91 -fstack-protector \ 92 -fno-short-enums \ 93 -finline-limit=64 \ 94 -Wa,--noexecstack \ 95 -U_FORTIFY_SOURCE \ 96 -Wno-extra \ 97 -Wno-ignored-qualifiers \ 98 -Wno-type-limits \ 99 -Os \ 100 -g \ 101 -fomit-frame-pointer \ 102 -fdata-sections \ 103 -ffunction-sections 104 105MY_DEFS_Debug := \ 106 '-DANGLE_DX11' \ 107 '-D_FILE_OFFSET_BITS=64' \ 108 '-DNO_TCMALLOC' \ 109 '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ 110 '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ 111 '-DDISABLE_NACL' \ 112 '-DCHROMIUM_BUILD' \ 113 '-DUSE_LIBJPEG_TURBO=1' \ 114 '-DUSE_PROPRIETARY_CODECS' \ 115 '-DENABLE_CONFIGURATION_POLICY' \ 116 '-DENABLE_GPU=1' \ 117 '-DUSE_OPENSSL=1' \ 118 '-DENABLE_EGLIMAGE=1' \ 119 '-DSFNTLY_NO_EXCEPTION' \ 120 '-DU_USING_ICU_NAMESPACE=0' \ 121 '-D__STDC_CONSTANT_MACROS' \ 122 '-D__STDC_FORMAT_MACROS' \ 123 '-DANDROID' \ 124 '-D__GNU_SOURCE=1' \ 125 '-DUSE_STLPORT=1' \ 126 '-D_STLP_USE_PTR_SPECIALIZATIONS=1' \ 127 '-DCHROME_BUILD_ID=""' \ 128 '-DDYNAMIC_ANNOTATIONS_ENABLED=1' \ 129 '-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \ 130 '-D_DEBUG' 131 132# Include paths placed before CFLAGS/CPPFLAGS 133LOCAL_C_INCLUDES_Debug := \ 134 $(LOCAL_PATH)/cpp/src \ 135 $(LOCAL_PATH) \ 136 frameworks/wilhelm/include \ 137 138 139# Flags passed to only C++ (and not C) files. 140LOCAL_CPPFLAGS_Debug := \ 141 -fno-rtti \ 142 -fno-threadsafe-statics \ 143 -fvisibility-inlines-hidden \ 144 -Wsign-compare \ 145 -Wno-abi \ 146 -Wno-error=c++0x-compat \ 147 -Wno-non-virtual-dtor \ 148 -Wno-sign-promo 149 150 151# Flags passed to both C and C++ files. 152MY_CFLAGS_Release := \ 153 -fstack-protector \ 154 --param=ssp-buffer-size=4 \ 155 -Werror \ 156 -fno-exceptions \ 157 -fno-strict-aliasing \ 158 -Wall \ 159 -Wno-unused-parameter \ 160 -Wno-missing-field-initializers \ 161 -fvisibility=hidden \ 162 -pipe \ 163 -fPIC \ 164 -fno-tree-sra \ 165 -Wno-psabi \ 166 -ffunction-sections \ 167 -funwind-tables \ 168 -g \ 169 -fstack-protector \ 170 -fno-short-enums \ 171 -finline-limit=64 \ 172 -Wa,--noexecstack \ 173 -U_FORTIFY_SOURCE \ 174 -Wno-extra \ 175 -Wno-ignored-qualifiers \ 176 -Wno-type-limits \ 177 -Os \ 178 -fno-ident \ 179 -fdata-sections \ 180 -ffunction-sections \ 181 -fomit-frame-pointer 182 183MY_DEFS_Release := \ 184 '-DANGLE_DX11' \ 185 '-D_FILE_OFFSET_BITS=64' \ 186 '-DNO_TCMALLOC' \ 187 '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ 188 '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ 189 '-DDISABLE_NACL' \ 190 '-DCHROMIUM_BUILD' \ 191 '-DUSE_LIBJPEG_TURBO=1' \ 192 '-DUSE_PROPRIETARY_CODECS' \ 193 '-DENABLE_CONFIGURATION_POLICY' \ 194 '-DENABLE_GPU=1' \ 195 '-DUSE_OPENSSL=1' \ 196 '-DENABLE_EGLIMAGE=1' \ 197 '-DSFNTLY_NO_EXCEPTION' \ 198 '-DU_USING_ICU_NAMESPACE=0' \ 199 '-D__STDC_CONSTANT_MACROS' \ 200 '-D__STDC_FORMAT_MACROS' \ 201 '-DANDROID' \ 202 '-D__GNU_SOURCE=1' \ 203 '-DUSE_STLPORT=1' \ 204 '-D_STLP_USE_PTR_SPECIALIZATIONS=1' \ 205 '-DCHROME_BUILD_ID=""' \ 206 '-DNDEBUG' \ 207 '-DNVALGRIND' \ 208 '-DDYNAMIC_ANNOTATIONS_ENABLED=0' \ 209 '-D_FORTIFY_SOURCE=2' 210 211 212# Include paths placed before CFLAGS/CPPFLAGS 213LOCAL_C_INCLUDES_Release := \ 214 $(LOCAL_PATH)/cpp/src \ 215 $(LOCAL_PATH) \ 216 frameworks/wilhelm/include \ 217 218 219# Flags passed to only C++ (and not C) files. 220LOCAL_CPPFLAGS_Release := \ 221 -fno-rtti \ 222 -fno-threadsafe-statics \ 223 -fvisibility-inlines-hidden \ 224 -Wsign-compare \ 225 -Wno-abi \ 226 -Wno-error=c++0x-compat \ 227 -Wno-non-virtual-dtor \ 228 -Wno-sign-promo 229 230LOCAL_SHARED_LIBRARIES := libicuuc libicui18n 231 232LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION)) 233LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION)) 234LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION)) 235 236include $(BUILD_STATIC_LIBRARY) 237