147 lines
3.6 KiB
Plaintext
147 lines
3.6 KiB
Plaintext
cc_defaults {
|
|
name: "libz_defaults",
|
|
|
|
cflags: [
|
|
"-O3",
|
|
"-DHAVE_HIDDEN",
|
|
"-DZLIB_CONST",
|
|
"-Wall",
|
|
"-Werror",
|
|
"-Wno-unused",
|
|
"-Wno-unused-parameter",
|
|
],
|
|
stl: "none",
|
|
export_include_dirs: ["."],
|
|
srcs: [
|
|
"adler32.c",
|
|
"compress.c",
|
|
"cpu_features.c",
|
|
"crc32.c",
|
|
"deflate.c",
|
|
"gzclose.c",
|
|
"gzlib.c",
|
|
"gzread.c",
|
|
"gzwrite.c",
|
|
"infback.c",
|
|
"inflate.c",
|
|
"inftrees.c",
|
|
"inffast.c",
|
|
"trees.c",
|
|
"uncompr.c",
|
|
"zutil.c",
|
|
],
|
|
|
|
arch: {
|
|
arm: {
|
|
// measurements show that the ARM version of ZLib is about x1.17 faster
|
|
// than the thumb one...
|
|
// TODO: re-test with zlib_bench after SIMD is enabled.
|
|
instruction_set: "arm",
|
|
|
|
// TODO: This is to work around b/24465209. Remove after root cause
|
|
// is fixed.
|
|
pack_relocations: false,
|
|
ldflags: ["-Wl,--hash-style=both"],
|
|
},
|
|
},
|
|
}
|
|
|
|
cc_library {
|
|
name: "libz",
|
|
defaults: ["libz_defaults"],
|
|
|
|
host_supported: true,
|
|
unique_host_soname: true,
|
|
static_ndk_lib: true,
|
|
|
|
vendor_available: true,
|
|
vndk: {
|
|
enabled: true,
|
|
support_system_process: true,
|
|
},
|
|
ramdisk_available: true,
|
|
recovery_available: true,
|
|
native_bridge_supported: true,
|
|
|
|
target: {
|
|
linux_bionic: {
|
|
enabled: true,
|
|
},
|
|
windows: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
|
|
// TODO(b/155456180): make libz a stub-providing library by uncommenting below
|
|
// stubs: {
|
|
// versions: ["29", "30"],
|
|
// symbol_file: "libz.map.txt",
|
|
// },
|
|
|
|
apex_available: [
|
|
"//apex_available:platform",
|
|
"com.android.art.debug", // from libdexfile
|
|
"com.android.art.release",
|
|
"com.android.bluetooth.updatable",
|
|
"com.android.runtime",
|
|
],
|
|
}
|
|
|
|
cc_binary_host {
|
|
name: "minigzip",
|
|
srcs: ["contrib/minigzip/minigzip.c"],
|
|
cflags: ["-Wall", "-Werror", "-DUSE_MMAP"],
|
|
static_libs: ["libz"],
|
|
stl: "none",
|
|
}
|
|
|
|
cc_binary {
|
|
name: "zlib_bench",
|
|
srcs: ["contrib/bench/zlib_bench.cc"],
|
|
cflags: ["-Wall", "-Werror"],
|
|
host_supported: true,
|
|
shared_libs: ["libz"],
|
|
}
|
|
|
|
// This module is defined in development/ndk/Android.bp. Updating these headers
|
|
// to be usable for any API level is going to be some work (at the very least,
|
|
// there's a ZLIB_VERNUM that will need to be handled since early versions of
|
|
// Android did not have all the APIs that calling code will use if this is set
|
|
// to the current value.
|
|
//
|
|
// The NDK never updated the zlib headers when the platform updated, so until we
|
|
// solve this the NDK will continue shipping the old headers.
|
|
//
|
|
// ndk_headers {
|
|
// name: "libz_headers",
|
|
// from: "src",
|
|
// to: "",
|
|
// srcs: [
|
|
// "src/zconf.h",
|
|
// "src/zlib.h",
|
|
// ],
|
|
// license: "NOTICE",
|
|
// }
|
|
|
|
// TODO(b/155351357) remove this library and let libtextclassifier to use libz
|
|
// instead.
|
|
// libz_current allows modules building against the NDK to have access to zlib
|
|
// API that's not available from the NDK libz.
|
|
cc_library_static {
|
|
name: "libz_current",
|
|
defaults: ["libz_defaults"],
|
|
sdk_version: "current",
|
|
|
|
apex_available: [
|
|
"//apex_available:platform", // indirectly from GoogleExtServices that gets installed to /system
|
|
"com.android.extservices", // indirectly via libtextclassifier
|
|
],
|
|
}
|
|
|
|
ndk_library {
|
|
name: "libz",
|
|
symbol_file: "libz.map.txt",
|
|
first_version: "9",
|
|
unversioned_until: "current",
|
|
}
|