Dan Albert | ca7b415 | 2019-06-11 16:32:07 -0700 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "libz_defaults", |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 3 | |
| 4 | cflags: [ |
Elliott Hughes | 22dd291 | 2019-08-14 18:01:48 +0000 | [diff] [blame] | 5 | "-O3", |
Elliott Hughes | 35329cd | 2019-04-10 14:56:06 -0700 | [diff] [blame] | 6 | "-DHAVE_HIDDEN", |
Tao Bao | 5604dec | 2016-12-19 13:29:53 -0800 | [diff] [blame] | 7 | "-DZLIB_CONST", |
Chih-Hung Hsieh | 3e5deb4 | 2017-09-29 11:41:33 -0700 | [diff] [blame] | 8 | "-Wall", |
| 9 | "-Werror", |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 10 | "-Wno-unused", |
| 11 | "-Wno-unused-parameter", |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 12 | ], |
| 13 | stl: "none", |
| 14 | export_include_dirs: ["."], |
| 15 | srcs: [ |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 16 | "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 Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 33 | ], |
| 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 Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 39 | // TODO: re-test with zlib_bench after SIMD is enabled. |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 40 | instruction_set: "arm", |
Ian Pedowitz | cca7bd4 | 2018-01-18 16:22:54 -0800 | [diff] [blame] | 41 | |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 42 | // TODO: This is to work around b/24465209. Remove after root cause |
| 43 | // is fixed. |
Chih-Hung Hsieh | 19b536b | 2018-05-23 18:52:18 -0700 | [diff] [blame] | 44 | pack_relocations: false, |
Ian Pedowitz | cca7bd4 | 2018-01-18 16:22:54 -0800 | [diff] [blame] | 45 | ldflags: ["-Wl,--hash-style=both"], |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 46 | }, |
| 47 | }, |
Dan Albert | ca7b415 | 2019-06-11 16:32:07 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | cc_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 Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 65 | |
| 66 | target: { |
Dan Willemsen | 0bb579c | 2016-11-04 12:27:30 -0700 | [diff] [blame] | 67 | linux_bionic: { |
| 68 | enabled: true, |
| 69 | }, |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 70 | windows: { |
| 71 | enabled: true, |
| 72 | }, |
| 73 | }, |
| 74 | } |
| 75 | |
Dan Albert | ca7b415 | 2019-06-11 16:32:07 -0700 | [diff] [blame] | 76 | cc_library_static { |
| 77 | name: "libz_current", |
| 78 | defaults: ["libz_defaults"], |
| 79 | sdk_version: "current", |
| 80 | } |
| 81 | |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 82 | cc_binary_host { |
| 83 | name: "minigzip", |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 84 | srcs: ["contrib/minigzip/minigzip.c"], |
| 85 | cflags: ["-Wall", "-Werror", "-DUSE_MMAP"], |
Dan Willemsen | c1b393b | 2016-07-06 19:05:32 -0700 | [diff] [blame] | 86 | static_libs: ["libz"], |
| 87 | stl: "none", |
| 88 | } |
Dan Albert | e405a26 | 2016-09-15 16:24:19 -0700 | [diff] [blame] | 89 | |
Narayan Kamath | 1a14eb3 | 2017-01-06 12:49:24 +0000 | [diff] [blame] | 90 | cc_binary { |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 91 | name: "zlib_bench", |
| 92 | srcs: ["contrib/bench/zlib_bench.cc"], |
Chih-Hung Hsieh | 3e5deb4 | 2017-09-29 11:41:33 -0700 | [diff] [blame] | 93 | cflags: ["-Wall", "-Werror"], |
Elliott Hughes | e7091dd | 2019-06-06 12:47:16 -0700 | [diff] [blame] | 94 | host_supported: true, |
Narayan Kamath | 1a14eb3 | 2017-01-06 12:49:24 +0000 | [diff] [blame] | 95 | shared_libs: ["libz"], |
Narayan Kamath | 1a14eb3 | 2017-01-06 12:49:24 +0000 | [diff] [blame] | 96 | } |
| 97 | |
Dan Albert | b0dca83 | 2016-11-08 11:46:09 -0800 | [diff] [blame] | 98 | // 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 Albert | b0dca83 | 2016-11-08 11:46:09 -0800 | [diff] [blame] | 114 | // ], |
| 115 | // license: "NOTICE", |
| 116 | // } |
Dan Albert | e405a26 | 2016-09-15 16:24:19 -0700 | [diff] [blame] | 117 | |
| 118 | ndk_library { |
Dan Willemsen | 67ce327 | 2017-04-07 15:34:26 -0700 | [diff] [blame] | 119 | name: "libz", |
Dan Albert | e405a26 | 2016-09-15 16:24:19 -0700 | [diff] [blame] | 120 | symbol_file: "libz.map.txt", |
| 121 | first_version: "9", |
Dan Albert | 40f22ad | 2017-01-05 15:55:02 -0800 | [diff] [blame] | 122 | unversioned_until: "current", |
Dan Albert | e405a26 | 2016-09-15 16:24:19 -0700 | [diff] [blame] | 123 | } |