am fa3b898f: Merge "Add static library build target targetting the NDK version 9"

* commit 'fa3b898f2cc40ec2c093f2a931986c4da80f1d54':
  Add static library build target targetting the NDK version 9
diff --git a/common/Android.mk b/common/Android.mk
index 00761ea..ae6a0be 100644
--- a/common/Android.mk
+++ b/common/Android.mk
@@ -134,8 +134,8 @@
 local_cflags += -DU_COMMON_IMPLEMENTATION
 
 local_cflags += -O3 -fvisibility=hidden
-local_ldlibs := -ldl -lm -lpthread
 
+local_ldlibs := -ldl -lm -lpthread
 
 #
 # Build for the target (device).
@@ -172,3 +172,23 @@
     LOCAL_REQUIRED_MODULES += icu-data-host
     include $(BUILD_HOST_SHARED_LIBRARY)
 endif
+
+#
+# Build as a static library against the NDK
+#
+
+include $(CLEAR_VARS)
+LOCAL_SDK_VERSION := 9
+LOCAL_NDK_STL_VARIANT := stlport_static
+LOCAL_C_INCLUDES += $(c_includes)
+LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
+LOCAL_CPP_FEATURES := rtti
+LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC -frtti
+# Using -Os over -O3 actually cuts down the final executable size by a few dozen kilobytes
+LOCAL_CFLAGS += -Os
+LOCAL_LDLIBS += $(local_ldlibs)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := libicuuc_static
+LOCAL_SRC_FILES += $(src_files)
+LOCAL_REQUIRED_MODULES += icu-data
+include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
diff --git a/i18n/Android.mk b/i18n/Android.mk
index a9b7948..5a15c0e 100644
--- a/i18n/Android.mk
+++ b/i18n/Android.mk
@@ -131,3 +131,23 @@
     LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
     include $(BUILD_HOST_SHARED_LIBRARY)
 endif
+
+#
+# Build as a static library against the NDK
+#
+
+include $(CLEAR_VARS)
+LOCAL_SDK_VERSION := 9
+LOCAL_NDK_STL_VARIANT := stlport_static
+LOCAL_SRC_FILES += $(src_files)
+LOCAL_C_INCLUDES += $(c_includes)
+LOCAL_STATIC_LIBRARIES += libicuuc_static
+LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
+LOCAL_CPP_FEATURES := rtti
+LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC -frtti
+# Using -Os over -O3 actually cuts down the final executable size by a few dozen kilobytes
+LOCAL_CFLAGS += -Os
+LOCAL_LDLIBS += $(local_ldlibs)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := libicui18n_static
+include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file