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