aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvichang <vichang@google.com>2019-01-31 03:25:49 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-31 03:25:49 -0800
commit4a047489d72d98b7f88ef3a939c7498350bbcd60 (patch)
tree5bfb212c867a47150fc2f602b51f4a46ae1a16d6
parente0f82b5895243f0236b5e6b3a51a98a843ddbf1a (diff)
parentf91ce81d03dbdf9f4a12799eacaa07a438cedbdf (diff)
downloadplatform_external_libxml2-4a047489d72d98b7f88ef3a939c7498350bbcd60.tar.gz
platform_external_libxml2-4a047489d72d98b7f88ef3a939c7498350bbcd60.tar.bz2
platform_external_libxml2-4a047489d72d98b7f88ef3a939c7498350bbcd60.zip
Merge "Disable ICU in static libxml2 on Android" am: 87730f4fc6 am: d7e4db2dd4
am: f91ce81d03 Change-Id: Ie9bcce538e88e0edfef9220de3c9857b387c3230
-rw-r--r--Android.bp14
-rw-r--r--include/libxml/xmlversion.h12
2 files changed, 22 insertions, 4 deletions
diff --git a/Android.bp b/Android.bp
index a09eeb45..fde421fa 100644
--- a/Android.bp
+++ b/Android.bp
@@ -106,15 +106,23 @@ cc_library {
"-Wno-unused-parameter",
],
static: {
- cflags: ["-fvisibility=hidden"],
+ cflags: [
+ "-fvisibility=hidden",
+ "-DSTATIC_LIBXML=1",
+ ],
+ },
+ shared: {
+ shared_libs: ["libandroidicu"],
+ export_shared_lib_headers: ["libandroidicu"],
},
target: {
vendor: {
exclude_shared_libs: ["libandroidicu"],
},
+ host: {
+ shared_libs: ["libandroidicu"],
+ },
},
- shared_libs: ["libandroidicu"],
- export_shared_lib_headers: ["libandroidicu"],
}
cc_binary_host {
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index af022db2..9f8978db 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -281,9 +281,19 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* LIBXML_ICU_ENABLED:
*
* Whether icu support is available
+ *
+ * This is disabled when libxml2 is
+ * 1. built for the VNDK.
+ * libicuuc.so isn't available in the VNDK.
+ * 2. built as an static library on Android
+ * libicuuc.so isn't available for static linking.
*/
#undef LIBXML_ICU_ENABLED
-#ifndef __ANDROID_VNDK__
+#ifdef __ANDROID_VNDK__
+#undef LIBXML_ICU_ENABLED
+#elif defined(__ANDROID__) && defined(STATIC_LIBXML)
+#undef LIBXML_ICU_ENABLED
+#else
#define LIBXML_ICU_ENABLED
#endif