• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cc_defaults {
2    name: "zlib_defaults",
3
4    cflags: [
5        "-O3",
6        "-DUSE_MMAP",
7        "-DZLIB_CONST",
8    ],
9    stl: "none",
10    export_include_dirs: ["."],
11    srcs: [
12        "src/adler32.c",
13        "src/compress.c",
14        "src/crc32.c",
15        "src/deflate.c",
16        "src/gzclose.c",
17        "src/gzlib.c",
18        "src/gzread.c",
19        "src/gzwrite.c",
20        "src/infback.c",
21        "src/inflate.c",
22        "src/inftrees.c",
23        "src/inffast.c",
24        "src/trees.c",
25        "src/uncompr.c",
26        "src/zutil.c",
27    ],
28
29    arch: {
30        arm: {
31            // measurements show that the ARM version of ZLib is about x1.17 faster
32            // than the thumb one...
33            instruction_set: "arm",
34
35            // TODO: This is to work around b/24465209. Remove after root cause is fixed
36            ldflags: ["-Wl,--hash-style=both"],
37        },
38    },
39
40    target: {
41        linux_bionic: {
42            enabled: true,
43        },
44        windows: {
45            enabled: true,
46        },
47    },
48}
49
50cc_library {
51    name: "libz",
52    defaults: ["zlib_defaults"],
53
54    host_supported: true,
55    vendor_available: true,
56    vndk: {
57        enabled: true,
58        support_system_process: true,
59    },
60
61    target: {
62        host: {
63            shared: {
64                // The host shared library is built as libz-host
65                enabled: false,
66            },
67        },
68    },
69}
70
71// Separate host shared library definition, since we don't want to conflict
72// with the host-supplied libz
73cc_library_host_shared {
74    name: "libz-host",
75    defaults: ["zlib_defaults"],
76}
77
78cc_binary_host {
79    name: "minigzip",
80    srcs: ["src/test/minigzip.c"],
81    static_libs: ["libz"],
82    stl: "none",
83}
84
85cc_binary {
86    name: "zlib_example",
87    srcs: ["src/test/example.c"],
88    shared_libs: ["libz"],
89    stl: "none",
90}
91
92cc_binary_host {
93    name: "zlib_example_host",
94    srcs: ["src/test/example.c"],
95    static_libs: ["libz"],
96    stl: "none",
97}
98
99// This module is defined in development/ndk/Android.bp. Updating these headers
100// to be usable for any API level is going to be some work (at the very least,
101// there's a ZLIB_VERNUM that will need to be handled since early versions of
102// Android did not have all the APIs that calling code will use if this is set
103// to the current value.
104//
105// The NDK never updated the zlib headers when the platform updated, so until we
106// solve this the NDK will continue shipping the old headers.
107//
108// ndk_headers {
109//     name: "libz_headers",
110//     from: "src",
111//     to: "",
112//     srcs: [
113//         "src/zconf.h",
114//         "src/zlib.h",
115//     ],
116//     license: "NOTICE",
117// }
118
119ndk_library {
120    name: "libz",
121    symbol_file: "libz.map.txt",
122    first_version: "9",
123    unversioned_until: "current",
124}
125