Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 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. |
Emilian Peev | 4b3e0a1 | 2019-01-29 08:59:28 -0800 | [diff] [blame] | 34 | cc_defaults { |
| 35 | name: "libxml2-defaults", |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 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 | ], |
Vijay Venkatraman | cdef69c | 2017-04-24 21:51:06 +0000 | [diff] [blame] | 78 | export_include_dirs: ["include"], |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 79 | cflags: [ |
| 80 | "-DLIBXML_THREAD_ENABLED=1", |
| 81 | |
Elliott Hughes | 7fbecab | 2019-01-10 16:42:03 -0800 | [diff] [blame] | 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 | |
Chih-Hung Hsieh | 2e086d2 | 2017-09-28 15:01:29 -0700 | [diff] [blame] | 93 | "-Wall", |
| 94 | "-Werror", |
| 95 | "-Wno-error=ignored-attributes", |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 96 | "-Wno-missing-field-initializers", |
| 97 | "-Wno-self-assign", |
| 98 | "-Wno-sign-compare", |
| 99 | "-Wno-tautological-pointer-compare", |
Chih-Hung Hsieh | 2e086d2 | 2017-09-28 15:01:29 -0700 | [diff] [blame] | 100 | "-Wno-unused-function", |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 101 | "-Wno-unused-parameter", |
| 102 | ], |
| 103 | static: { |
Victor Chang | 3a647d2 | 2019-01-11 13:43:43 +0000 | [diff] [blame] | 104 | cflags: [ |
| 105 | "-fvisibility=hidden", |
| 106 | "-DSTATIC_LIBXML=1", |
| 107 | ], |
| 108 | }, |
| 109 | shared: { |
| 110 | shared_libs: ["libandroidicu"], |
| 111 | export_shared_lib_headers: ["libandroidicu"], |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 112 | }, |
Emilian Peev | 4b3e0a1 | 2019-01-29 08:59:28 -0800 | [diff] [blame] | 113 | } |
| 114 | |
| 115 | cc_library { |
| 116 | name: "libxml2", |
| 117 | defaults: ["libxml2-defaults"], |
| 118 | vendor_available: true, |
| 119 | vndk: { |
| 120 | enabled: true, |
| 121 | }, |
| 122 | host_supported: true, |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 123 | target: { |
Jiyong Park | 10be88e | 2017-08-09 20:13:58 +0900 | [diff] [blame] | 124 | vendor: { |
Victor Chang | eceabb1 | 2018-11-20 19:00:59 +0000 | [diff] [blame] | 125 | exclude_shared_libs: ["libandroidicu"], |
Jiyong Park | 10be88e | 2017-08-09 20:13:58 +0900 | [diff] [blame] | 126 | }, |
Victor Chang | 3a647d2 | 2019-01-11 13:43:43 +0000 | [diff] [blame] | 127 | host: { |
| 128 | shared_libs: ["libandroidicu"], |
| 129 | }, |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 130 | }, |
Colin Cross | f788932 | 2017-04-20 13:43:31 -0700 | [diff] [blame] | 131 | } |
Dan Willemsen | 3dd6a4b | 2018-02-26 18:22:30 -0800 | [diff] [blame] | 132 | |
Emilian Peev | 4b3e0a1 | 2019-01-29 08:59:28 -0800 | [diff] [blame] | 133 | cc_library_static { |
| 134 | name: "libxml2_ndk", |
| 135 | defaults: ["libxml2-defaults"], |
| 136 | sdk_version: "current", |
| 137 | } |
| 138 | |
Dan Willemsen | 3dd6a4b | 2018-02-26 18:22:30 -0800 | [diff] [blame] | 139 | cc_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 | } |