| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 1 | // | 
|  | 2 | // Copyright (C) 2008 The Android Open Source Project | 
|  | 3 | // | 
|  | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | // you may not use this file except in compliance with the License. | 
|  | 6 | // You may obtain a copy of the License at | 
|  | 7 | // | 
|  | 8 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | // | 
|  | 10 | // Unless required by applicable law or agreed to in writing, software | 
|  | 11 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | // See the License for the specific language governing permissions and | 
|  | 14 | // limitations under the License. | 
|  | 15 | // | 
|  | 16 |  | 
|  | 17 | // some files must not be compiled when building against Mingw | 
|  | 18 | // they correspond to features not used by our host development tools | 
|  | 19 | // which are also hard or even impossible to port to native Win32 | 
|  | 20 | libcutils_nonwindows_sources = [ | 
| Mark Salyzyn | 52bd37e | 2016-11-07 09:39:30 -0800 | [diff] [blame] | 21 | "android_get_control_file.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 22 | "fs.cpp", | 
| Elliott Hughes | 9d12725 | 2018-07-13 10:54:49 -0700 | [diff] [blame] | 23 | "hashmap.cpp", | 
| Jeff Sharkey | 53d37ba | 2017-11-09 17:41:09 -0700 | [diff] [blame] | 24 | "multiuser.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 25 | "socket_inaddr_any_server_unix.cpp", | 
|  | 26 | "socket_local_client_unix.cpp", | 
|  | 27 | "socket_local_server_unix.cpp", | 
|  | 28 | "socket_network_client_unix.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 29 | "sockets_unix.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 30 | "str_parms.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 31 | ] | 
|  | 32 |  | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 33 | cc_library_headers { | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 34 | name: "libcutils_headers", | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 35 | vendor_available: true, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 36 | recovery_available: true, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 37 | host_supported: true, | 
|  | 38 | export_include_dirs: ["include"], | 
|  | 39 | target: { | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 40 | vendor: { | 
| Steven Moreland | e1c834d | 2018-01-05 14:42:12 -0800 | [diff] [blame] | 41 | override_export_include_dirs: ["include_vndk"], | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 42 | }, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 43 | linux_bionic: { | 
|  | 44 | enabled: true, | 
|  | 45 | }, | 
|  | 46 | windows: { | 
|  | 47 | enabled: true, | 
|  | 48 | }, | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 49 | }, | 
|  | 50 | } | 
|  | 51 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 52 | cc_library { | 
|  | 53 | name: "libcutils", | 
| Steven Moreland | 385fe69 | 2017-04-13 14:29:58 -0700 | [diff] [blame] | 54 | vendor_available: true, | 
| Justin Yun | 9ca9245 | 2017-07-31 15:41:10 +0900 | [diff] [blame] | 55 | vndk: { | 
|  | 56 | enabled: true, | 
|  | 57 | support_system_process: true, | 
|  | 58 | }, | 
| Jiyong Park | 612210c | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 59 | recovery_available: true, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 60 | host_supported: true, | 
|  | 61 | srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 62 | "config_utils.cpp", | 
| Mark Salyzyn | 163ecc6 | 2017-05-02 08:56:15 -0700 | [diff] [blame] | 63 | "fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 64 | "canned_fs_config.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 65 | "iosched_policy.cpp", | 
|  | 66 | "load_file.cpp", | 
|  | 67 | "native_handle.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 68 | "record_stream.cpp", | 
| Isaac Chen | 795267d | 2017-02-16 11:47:33 +0800 | [diff] [blame] | 69 | "sched_policy.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 70 | "sockets.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 71 | "strdup16to8.cpp", | 
|  | 72 | "strdup8to16.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 73 | "strlcpy.c", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 74 | "threads.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 75 | ], | 
|  | 76 |  | 
|  | 77 | target: { | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 78 | linux_bionic: { | 
|  | 79 | enabled: true, | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 80 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 81 | not_windows: { | 
|  | 82 | srcs: libcutils_nonwindows_sources + [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 83 | "ashmem-host.cpp", | 
|  | 84 | "trace-host.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 85 | ], | 
|  | 86 | }, | 
|  | 87 | windows: { | 
|  | 88 | srcs: [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 89 | "socket_inaddr_any_server_windows.cpp", | 
|  | 90 | "socket_network_client_windows.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 91 | "sockets_windows.cpp", | 
|  | 92 | ], | 
|  | 93 |  | 
|  | 94 | enabled: true, | 
|  | 95 | shared: { | 
|  | 96 | enabled: false, | 
|  | 97 | }, | 
| Mark Salyzyn | 163ecc6 | 2017-05-02 08:56:15 -0700 | [diff] [blame] | 98 | cflags: [ | 
|  | 99 | "-D_GNU_SOURCE", | 
|  | 100 | ], | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 101 | }, | 
|  | 102 |  | 
|  | 103 | android: { | 
|  | 104 | srcs: libcutils_nonwindows_sources + [ | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 105 | "android_reboot.cpp", | 
|  | 106 | "ashmem-dev.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 107 | "klog.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 108 | "partition_utils.cpp", | 
| Elliott Hughes | 4eacd70 | 2017-01-26 17:31:40 -0800 | [diff] [blame] | 109 | "properties.cpp", | 
| Chenbo Feng | baede73 | 2017-10-25 12:31:43 -0700 | [diff] [blame] | 110 | "qtaguid.cpp", | 
| Elliott Hughes | 8e9aeb9 | 2017-11-10 10:22:07 -0800 | [diff] [blame] | 111 | "trace-dev.cpp", | 
| Luis Hector Chavez | e97a4b9 | 2017-11-02 14:17:43 -0700 | [diff] [blame] | 112 | "uevent.cpp", | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 113 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 114 | }, | 
|  | 115 |  | 
|  | 116 | android_arm: { | 
|  | 117 | srcs: ["arch-arm/memset32.S"], | 
|  | 118 | sanitize: { | 
|  | 119 | misc_undefined: ["integer"], | 
|  | 120 | }, | 
|  | 121 | }, | 
|  | 122 | android_arm64: { | 
|  | 123 | srcs: ["arch-arm64/android_memset.S"], | 
| Evgenii Stepanov | 54c7886 | 2017-01-31 16:33:53 -0800 | [diff] [blame] | 124 | sanitize: { | 
|  | 125 | misc_undefined: ["integer"], | 
|  | 126 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 127 | }, | 
|  | 128 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 129 | android_mips: { | 
|  | 130 | srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 131 | sanitize: { | 
|  | 132 | misc_undefined: ["integer"], | 
|  | 133 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 134 | }, | 
|  | 135 | android_mips64: { | 
|  | 136 | srcs: ["arch-mips/android_memset.c"], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 137 | sanitize: { | 
|  | 138 | misc_undefined: ["integer"], | 
|  | 139 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 140 | }, | 
|  | 141 |  | 
|  | 142 | android_x86: { | 
|  | 143 | srcs: [ | 
|  | 144 | "arch-x86/android_memset16.S", | 
|  | 145 | "arch-x86/android_memset32.S", | 
|  | 146 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 147 | // TODO: This is to work around b/29412086. | 
|  | 148 | // Remove once __mulodi4 is available and move the "sanitize" block | 
|  | 149 | // to the android target. | 
|  | 150 | sanitize: { | 
|  | 151 | misc_undefined: [], | 
|  | 152 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 153 | }, | 
|  | 154 |  | 
|  | 155 | android_x86_64: { | 
|  | 156 | srcs: [ | 
|  | 157 | "arch-x86_64/android_memset16.S", | 
|  | 158 | "arch-x86_64/android_memset32.S", | 
|  | 159 | ], | 
| Luis Hector Chavez | fae195b | 2017-11-03 16:22:05 -0700 | [diff] [blame] | 160 | sanitize: { | 
|  | 161 | misc_undefined: ["integer"], | 
|  | 162 | }, | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 163 | }, | 
| Logan Chien | 25b742c | 2018-05-08 17:37:29 +0800 | [diff] [blame] | 164 |  | 
|  | 165 | vendor: { | 
|  | 166 | exclude_srcs: [ | 
|  | 167 | // qtaguid.cpp loads libnetd_client.so with dlopen().  Since | 
|  | 168 | // the interface of libnetd_client.so may vary between AOSP | 
|  | 169 | // releases, exclude qtaguid.cpp from the VNDK-SP variant. | 
|  | 170 | "qtaguid.cpp", | 
|  | 171 | ], | 
|  | 172 | } | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 173 | }, | 
|  | 174 |  | 
|  | 175 | shared_libs: ["liblog"], | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 176 | header_libs: [ | 
| Elliott Hughes | 9f49508 | 2018-04-25 14:52:50 -0700 | [diff] [blame] | 177 | "libbase_headers", | 
| Steven Moreland | d73be1b | 2017-04-13 23:48:57 -0700 | [diff] [blame] | 178 | "libcutils_headers", | 
|  | 179 | "libutils_headers", | 
|  | 180 | ], | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 181 | export_header_lib_headers: ["libcutils_headers"], | 
| Yifan Hong | b680712 | 2017-07-25 15:24:04 -0700 | [diff] [blame] | 182 | local_include_dirs: ["include"], | 
| Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 183 |  | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 184 | cflags: [ | 
|  | 185 | "-Werror", | 
|  | 186 | "-Wall", | 
|  | 187 | "-Wextra", | 
|  | 188 | ], | 
| Dan Willemsen | eee8e7f | 2016-06-06 22:31:58 -0700 | [diff] [blame] | 189 | } | 
|  | 190 |  | 
|  | 191 | subdirs = ["tests"] |