blob: 708549f9f7251c4be058947cddab99d81765ce4e [file] [log] [blame]
Colin Crossf7889322017-04-20 13:43:31 -07001//
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 Peev4b3e0a12019-01-29 08:59:28 -080034cc_defaults {
35 name: "libxml2-defaults",
Colin Crossf7889322017-04-20 13:43:31 -070036 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 Venkatramancdef69c2017-04-24 21:51:06 +000078 export_include_dirs: ["include"],
Colin Crossf7889322017-04-20 13:43:31 -070079 cflags: [
80 "-DLIBXML_THREAD_ENABLED=1",
81
Elliott Hughes7fbecab2019-01-10 16:42:03 -080082 // 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 Hsieh2e086d22017-09-28 15:01:29 -070093 "-Wall",
94 "-Werror",
95 "-Wno-error=ignored-attributes",
Colin Crossf7889322017-04-20 13:43:31 -070096 "-Wno-missing-field-initializers",
97 "-Wno-self-assign",
98 "-Wno-sign-compare",
99 "-Wno-tautological-pointer-compare",
Chih-Hung Hsieh2e086d22017-09-28 15:01:29 -0700100 "-Wno-unused-function",
Colin Crossf7889322017-04-20 13:43:31 -0700101 "-Wno-unused-parameter",
102 ],
103 static: {
Victor Chang3a647d22019-01-11 13:43:43 +0000104 cflags: [
105 "-fvisibility=hidden",
106 "-DSTATIC_LIBXML=1",
107 ],
108 },
Emilian Peev4b3e0a12019-01-29 08:59:28 -0800109}
110
111cc_library {
112 name: "libxml2",
113 defaults: ["libxml2-defaults"],
114 vendor_available: true,
115 vndk: {
116 enabled: true,
117 },
118 host_supported: true,
Colin Crossf7889322017-04-20 13:43:31 -0700119 target: {
Neil Fuller5b6b2702019-05-07 20:53:41 +0100120 android: {
121 shared_libs: ["libandroidicu"],
122 export_shared_lib_headers: ["libandroidicu"],
123 },
124 host: {
125 shared_libs: [
126 "libicui18n",
127 "libicuuc",
128 ],
129 export_shared_lib_headers: [
130 "libicui18n",
131 "libicuuc",
132 ],
133 },
134 vendor: {
135 exclude_shared_libs: ["libandroidicu"],
136 },
Colin Crossf7889322017-04-20 13:43:31 -0700137 },
Colin Crossf7889322017-04-20 13:43:31 -0700138}
Dan Willemsen3dd6a4b2018-02-26 18:22:30 -0800139
Emilian Peev4b3e0a12019-01-29 08:59:28 -0800140cc_library_static {
141 name: "libxml2_ndk",
142 defaults: ["libxml2-defaults"],
143 sdk_version: "current",
144}
145
Dan Willemsen3dd6a4b2018-02-26 18:22:30 -0800146cc_binary_host {
147 name: "xmllint",
148 srcs: ["xmllint.c"],
149 cflags: [
150 "-DLIBXML_THREAD_ENABLED=1",
151
152 "-Wall",
153 "-Werror",
154 ],
155 shared_libs: ["libxml2"],
156}