1// 2// Copyright (C) 2014 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17// 18// To update: 19// 20 21// git merge aosp/upstream-master 22// mma -j 23// # (Make any necessary Android.bp changes and test the new libxml2.) 24// git push aosp HEAD:master # Push directly, avoiding gerrit. 25// git push aosp HEAD:refs/for/master # Push to gerrit. 26// 27// # Now commit any necessary Android.bp changes like normal: 28// repo start post-sync . 29// git commit -a 30// 31 32// This comes from the automake-generated Makefile. 33// We deliberately exclude nanoftp.c and nanohttp.c, the trio library, and zlib. 34cc_defaults { 35 name: "libxml2-defaults", 36 srcs: [ 37 "SAX.c", 38 "entities.c", 39 "encoding.c", 40 "error.c", 41 "parserInternals.c", 42 "parser.c", 43 "tree.c", 44 "hash.c", 45 "list.c", 46 "xmlIO.c", 47 "xmlmemory.c", 48 "uri.c", 49 "valid.c", 50 "xlink.c", 51 "debugXML.c", 52 "xpath.c", 53 "xpointer.c", 54 "xinclude.c", 55 "DOCBparser.c", 56 "catalog.c", 57 "globals.c", 58 "threads.c", 59 "c14n.c", 60 "xmlstring.c", 61 "buf.c", 62 "xmlregexp.c", 63 "xmlschemas.c", 64 "xmlschemastypes.c", 65 "xmlunicode.c", 66 "xmlreader.c", 67 "relaxng.c", 68 "dict.c", 69 "SAX2.c", 70 "xmlwriter.c", 71 "legacy.c", 72 "chvalid.c", 73 "pattern.c", 74 "xmlsave.c", 75 "xmlmodule.c", 76 "schematron.c", 77 ], 78 export_include_dirs: ["include"], 79 cflags: [ 80 "-DLIBXML_THREAD_ENABLED=1", 81 82 // Poison various things that should not be defined. 83 "-DLIBXML_LEGACY_ENABLED=NO", 84 "-DLIBXML_FTP_ENABLED=NO", 85 "-DLIBXML_HTML_ENABLED=NO", 86 "-DLIBXML_HTTP_ENABLED=NO", 87 "-DLIBXML_ICONV_ENABLED=NO", 88 "-DLIBXML_LZMA_ENABLED=NO", 89 "-DLIBXML_ZLIB_ENABLED=NO", 90 // And this one depends on whether or not we're building for the VNDK. 91 "-DLIBXML_ICU_ENABLED=NO", 92 93 "-Wall", 94 "-Werror", 95 "-Wno-error=ignored-attributes", 96 "-Wno-missing-field-initializers", 97 "-Wno-self-assign", 98 "-Wno-sign-compare", 99 "-Wno-tautological-pointer-compare", 100 "-Wno-unused-function", 101 "-Wno-unused-parameter", 102 ], 103 static: { 104 cflags: [ 105 "-fvisibility=hidden", 106 "-DSTATIC_LIBXML=1", 107 ], 108 }, 109 shared: { 110 shared_libs: ["libandroidicu"], 111 export_shared_lib_headers: ["libandroidicu"], 112 }, 113} 114 115cc_library { 116 name: "libxml2", 117 defaults: ["libxml2-defaults"], 118 vendor_available: true, 119 vndk: { 120 enabled: true, 121 }, 122 host_supported: true, 123 target: { 124 vendor: { 125 exclude_shared_libs: ["libandroidicu"], 126 }, 127 host: { 128 shared_libs: ["libandroidicu"], 129 }, 130 }, 131} 132 133cc_library_static { 134 name: "libxml2_ndk", 135 defaults: ["libxml2-defaults"], 136 sdk_version: "current", 137} 138 139cc_binary_host { 140 name: "xmllint", 141 srcs: ["xmllint.c"], 142 cflags: [ 143 "-DLIBXML_THREAD_ENABLED=1", 144 145 "-Wall", 146 "-Werror", 147 ], 148 shared_libs: ["libxml2"], 149} 150