blob: 2937ca366e0c22e80b20e09b4de0d3501a6a0269 [file] [log] [blame]
Dan Albertca7b4152019-06-11 16:32:07 -07001cc_defaults {
2 name: "libz_defaults",
Dan Willemsenc1b393b2016-07-06 19:05:32 -07003
4 cflags: [
Elliott Hughes22dd2912019-08-14 18:01:48 +00005 "-O3",
Elliott Hughes35329cd2019-04-10 14:56:06 -07006 "-DHAVE_HIDDEN",
Tao Bao5604dec2016-12-19 13:29:53 -08007 "-DZLIB_CONST",
Chih-Hung Hsieh3e5deb42017-09-29 11:41:33 -07008 "-Wall",
9 "-Werror",
Elliott Hughese7091dd2019-06-06 12:47:16 -070010 "-Wno-unused",
11 "-Wno-unused-parameter",
Dan Willemsenc1b393b2016-07-06 19:05:32 -070012 ],
13 stl: "none",
14 export_include_dirs: ["."],
15 srcs: [
Elliott Hughese7091dd2019-06-06 12:47:16 -070016 "adler32.c",
17 "compress.c",
18 "crc32.c",
19 "deflate.c",
20 "gzclose.c",
21 "gzlib.c",
22 "gzread.c",
23 "gzwrite.c",
24 "infback.c",
25 "inflate.c",
26 "inftrees.c",
27 "inffast.c",
28 "trees.c",
29 "uncompr.c",
30 "zutil.c",
31
32 "simd_stub.c",
Dan Willemsenc1b393b2016-07-06 19:05:32 -070033 ],
34
35 arch: {
36 arm: {
37 // measurements show that the ARM version of ZLib is about x1.17 faster
38 // than the thumb one...
Elliott Hughese7091dd2019-06-06 12:47:16 -070039 // TODO: re-test with zlib_bench after SIMD is enabled.
Dan Willemsenc1b393b2016-07-06 19:05:32 -070040 instruction_set: "arm",
Ian Pedowitzcca7bd42018-01-18 16:22:54 -080041
Elliott Hughese7091dd2019-06-06 12:47:16 -070042 // TODO: This is to work around b/24465209. Remove after root cause
43 // is fixed.
Chih-Hung Hsieh19b536b2018-05-23 18:52:18 -070044 pack_relocations: false,
Ian Pedowitzcca7bd42018-01-18 16:22:54 -080045 ldflags: ["-Wl,--hash-style=both"],
Dan Willemsenc1b393b2016-07-06 19:05:32 -070046 },
47 },
Dan Albertca7b4152019-06-11 16:32:07 -070048}
49
50cc_library {
51 name: "libz",
52 defaults: ["libz_defaults"],
53
54 host_supported: true,
55 unique_host_soname: true,
56 static_ndk_lib: true,
57
58 vendor_available: true,
59 vndk: {
60 enabled: true,
61 support_system_process: true,
62 },
63 recovery_available: true,
64 native_bridge_supported: true,
Dan Willemsenc1b393b2016-07-06 19:05:32 -070065
66 target: {
Dan Willemsen0bb579c2016-11-04 12:27:30 -070067 linux_bionic: {
68 enabled: true,
69 },
Dan Willemsenc1b393b2016-07-06 19:05:32 -070070 windows: {
71 enabled: true,
72 },
73 },
74}
75
Dan Albertca7b4152019-06-11 16:32:07 -070076cc_library_static {
77 name: "libz_current",
78 defaults: ["libz_defaults"],
79 sdk_version: "current",
80}
81
Dan Willemsenc1b393b2016-07-06 19:05:32 -070082cc_binary_host {
83 name: "minigzip",
Elliott Hughese7091dd2019-06-06 12:47:16 -070084 srcs: ["contrib/minigzip/minigzip.c"],
85 cflags: ["-Wall", "-Werror", "-DUSE_MMAP"],
Dan Willemsenc1b393b2016-07-06 19:05:32 -070086 static_libs: ["libz"],
87 stl: "none",
88}
Dan Alberte405a262016-09-15 16:24:19 -070089
Narayan Kamath1a14eb32017-01-06 12:49:24 +000090cc_binary {
Elliott Hughese7091dd2019-06-06 12:47:16 -070091 name: "zlib_bench",
92 srcs: ["contrib/bench/zlib_bench.cc"],
Chih-Hung Hsieh3e5deb42017-09-29 11:41:33 -070093 cflags: ["-Wall", "-Werror"],
Elliott Hughese7091dd2019-06-06 12:47:16 -070094 host_supported: true,
Narayan Kamath1a14eb32017-01-06 12:49:24 +000095 shared_libs: ["libz"],
Narayan Kamath1a14eb32017-01-06 12:49:24 +000096}
97
Dan Albertb0dca832016-11-08 11:46:09 -080098// This module is defined in development/ndk/Android.bp. Updating these headers
99// to be usable for any API level is going to be some work (at the very least,
100// there's a ZLIB_VERNUM that will need to be handled since early versions of
101// Android did not have all the APIs that calling code will use if this is set
102// to the current value.
103//
104// The NDK never updated the zlib headers when the platform updated, so until we
105// solve this the NDK will continue shipping the old headers.
106//
107// ndk_headers {
108// name: "libz_headers",
109// from: "src",
110// to: "",
111// srcs: [
112// "src/zconf.h",
113// "src/zlib.h",
Dan Albertb0dca832016-11-08 11:46:09 -0800114// ],
115// license: "NOTICE",
116// }
Dan Alberte405a262016-09-15 16:24:19 -0700117
118ndk_library {
Dan Willemsen67ce3272017-04-07 15:34:26 -0700119 name: "libz",
Dan Alberte405a262016-09-15 16:24:19 -0700120 symbol_file: "libz.map.txt",
121 first_version: "9",
Dan Albert40f22ad2017-01-05 15:55:02 -0800122 unversioned_until: "current",
Dan Alberte405a262016-09-15 16:24:19 -0700123}