blob: db084f62c823bbfea1f726c28874362a1fb25566 [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 },
109 shared: {
110 shared_libs: ["libandroidicu"],
111 export_shared_lib_headers: ["libandroidicu"],
Colin Crossf7889322017-04-20 13:43:31 -0700112 },
Emilian Peev4b3e0a12019-01-29 08:59:28 -0800113}
114
115cc_library {
116 name: "libxml2",
117 defaults: ["libxml2-defaults"],
118 vendor_available: true,
119 vndk: {
120 enabled: true,
121 },
122 host_supported: true,
Colin Crossf7889322017-04-20 13:43:31 -0700123 target: {
Jiyong Park10be88e2017-08-09 20:13:58 +0900124 vendor: {
Victor Changeceabb12018-11-20 19:00:59 +0000125 exclude_shared_libs: ["libandroidicu"],
Jiyong Park10be88e2017-08-09 20:13:58 +0900126 },
Victor Chang3a647d22019-01-11 13:43:43 +0000127 host: {
128 shared_libs: ["libandroidicu"],
129 },
Colin Crossf7889322017-04-20 13:43:31 -0700130 },
Colin Crossf7889322017-04-20 13:43:31 -0700131}
Dan Willemsen3dd6a4b2018-02-26 18:22:30 -0800132
Emilian Peev4b3e0a12019-01-29 08:59:28 -0800133cc_library_static {
134 name: "libxml2_ndk",
135 defaults: ["libxml2-defaults"],
136 sdk_version: "current",
137}
138
Dan Willemsen3dd6a4b2018-02-26 18:22:30 -0800139cc_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}