aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hartman <ghartman@google.com>2017-10-19 18:38:52 -0700
committerGreg Hartman <ghartman@google.com>2017-10-19 18:38:52 -0700
commit4dd7923d6414ac370cf0488676ed01fb81368369 (patch)
tree32e5d9aa22ef26f759655245b718bfb10b8276f4
parentb128e830a2488c966e8a1b5f413a735df41e53a2 (diff)
downloadlibxml2-oreo-cuttlefish-testing.tar.gz
Convert libxml2 host to Android.bporeo-cuttlefish-testing
This is a partial cherry-pick from OC-MR1. It moves the host build to Android.bp. The guest build is unaffected to avoid risk of introducing a fidelity problem. Change-Id: I49e886d5e579019f8e74efb066ac08ec9795270a
-rw-r--r--Android.bp98
-rw-r--r--Android.mk13
2 files changed, 98 insertions, 13 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..a4d0b4c5
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,98 @@
+//
+// Copyright (C) 2014 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+//
+// To update:
+//
+
+// git merge aosp/upstream-master
+// mma -j
+// # (Make any necessary Android.bp changes and test the new libxml2.)
+// git push aosp HEAD:master # Push directly, avoiding gerrit.
+// git push aosp HEAD:refs/for/master # Push to gerrit.
+//
+// # Now commit any necessary Android.bp changes like normal:
+// repo start post-sync .
+// git commit -a
+//
+
+// This comes from the automake-generated Makefile.
+// We deliberately exclude nanoftp.c and nanohttp.c, the trio library, and zlib.
+cc_library_host_static {
+ name: "libxml2",
+ srcs: [
+ "SAX.c",
+ "entities.c",
+ "encoding.c",
+ "error.c",
+ "parserInternals.c",
+ "parser.c",
+ "tree.c",
+ "hash.c",
+ "list.c",
+ "xmlIO.c",
+ "xmlmemory.c",
+ "uri.c",
+ "valid.c",
+ "xlink.c",
+ "debugXML.c",
+ "xpath.c",
+ "xpointer.c",
+ "xinclude.c",
+ "DOCBparser.c",
+ "catalog.c",
+ "globals.c",
+ "threads.c",
+ "c14n.c",
+ "xmlstring.c",
+ "buf.c",
+ "xmlregexp.c",
+ "xmlschemas.c",
+ "xmlschemastypes.c",
+ "xmlunicode.c",
+ "xmlreader.c",
+ "relaxng.c",
+ "dict.c",
+ "SAX2.c",
+ "xmlwriter.c",
+ "legacy.c",
+ "chvalid.c",
+ "pattern.c",
+ "xmlsave.c",
+ "xmlmodule.c",
+ "schematron.c",
+ ],
+ export_include_dirs: ["include"],
+ cflags: [
+ "-DLIBXML_THREAD_ENABLED=1",
+
+ "-Wno-missing-field-initializers",
+ "-Wno-self-assign",
+ "-Wno-sign-compare",
+ "-Wno-tautological-pointer-compare",
+ "-Wno-unused-parameter",
+ ],
+ static: {
+ cflags: ["-fvisibility=hidden"],
+ },
+ target: {
+ host: {
+ host_ldlibs: ["-ldl"],
+ },
+ },
+ shared_libs: ["libicuuc"],
+ export_shared_lib_headers: ["libicuuc"],
+}
diff --git a/Android.mk b/Android.mk
index c1ae8bb4..3ac2da1a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -79,16 +79,3 @@ LOCAL_MODULE:= libxml2
LOCAL_CLANG := true
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
include $(BUILD_SHARED_LIBRARY)
-
-# For the host
-# ========================================================
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_C_INCLUDES += $(common_C_INCLUDES)
-LOCAL_CFLAGS += $(common_CFLAGS) -fvisibility=hidden
-LOCAL_SHARED_LIBRARIES += libicuuc
-LOCAL_MODULE := libxml2
-LOCAL_CLANG := true
-LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
-include $(BUILD_HOST_STATIC_LIBRARY)