Merge "Make it easy to link icu4c against the logging libraries for easier debugging."
diff --git a/Android.mk b/Android.mk
index 8abefc6..61595ff 100644
--- a/Android.mk
+++ b/Android.mk
@@ -15,6 +15,10 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
+# Uncomment to be able to use ALOG* with #include "cutils/log.h".
+#optional_android_logging_includes := system/core/include
+#optional_android_logging_libraries := liblog
+
 subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
 		common   \
 		i18n     \
diff --git a/common/Android.mk b/common/Android.mk
index ae6a0be..8e4b5d0 100644
--- a/common/Android.mk
+++ b/common/Android.mk
@@ -143,9 +143,9 @@
 
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES += $(src_files)
-LOCAL_C_INCLUDES += $(c_includes)
+LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
 LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
-LOCAL_SHARED_LIBRARIES += libdl
+LOCAL_SHARED_LIBRARIES += libdl $(optional_android_logging_libraries)
 LOCAL_LDLIBS += $(local_ldlibs)
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := libicuuc
@@ -163,8 +163,9 @@
 ifeq ($(WITH_HOST_DALVIK),true)
     include $(CLEAR_VARS)
     LOCAL_SRC_FILES += $(src_files)
-    LOCAL_C_INCLUDES += $(c_includes)
+    LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
     LOCAL_CFLAGS += $(local_cflags)
+    LOCAL_SHARED_LIBRARIES += $(optional_android_logging_libraries)
     LOCAL_LDLIBS += $(local_ldlibs)
     LOCAL_MODULE_TAGS := optional
     LOCAL_MODULE := libicuuc-host
@@ -191,4 +192,4 @@
 LOCAL_MODULE := libicuuc_static
 LOCAL_SRC_FILES += $(src_files)
 LOCAL_REQUIRED_MODULES += icu-data
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+include $(BUILD_STATIC_LIBRARY)
diff --git a/i18n/Android.mk b/i18n/Android.mk
index 5a15c0e..2297167 100644
--- a/i18n/Android.mk
+++ b/i18n/Android.mk
@@ -103,9 +103,9 @@
 
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES += $(src_files)
-LOCAL_C_INCLUDES += $(c_includes)
+LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
 LOCAL_CFLAGS += $(local_cflags) -DPIC -fPIC
-LOCAL_SHARED_LIBRARIES += libicuuc
+LOCAL_SHARED_LIBRARIES += libicuuc $(optional_android_logging_libraries)
 LOCAL_LDLIBS += $(local_ldlibs)
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := libicui18n
@@ -122,9 +122,9 @@
 ifeq ($(WITH_HOST_DALVIK),true)
     include $(CLEAR_VARS)
     LOCAL_SRC_FILES += $(src_files)
-    LOCAL_C_INCLUDES += $(c_includes)
+    LOCAL_C_INCLUDES += $(c_includes) $(optional_android_logging_includes)
     LOCAL_CFLAGS += $(local_cflags)
-    LOCAL_SHARED_LIBRARIES += libicuuc-host
+    LOCAL_SHARED_LIBRARIES += libicuuc-host $(optional_android_logging_libraries)
     LOCAL_LDLIBS += $(local_ldlibs)
     LOCAL_MODULE_TAGS := optional
     LOCAL_MODULE := libicui18n-host
@@ -150,4 +150,4 @@
 LOCAL_LDLIBS += $(local_ldlibs)
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := libicui18n_static
-include $(BUILD_STATIC_LIBRARY)
\ No newline at end of file
+include $(BUILD_STATIC_LIBRARY)