blob: cdbb65f450107fe98560fde731775153b07fe750 [file] [log] [blame]
Dan Willemseneee8e7f2016-06-06 22:31:58 -07001//
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
20libcutils_nonwindows_sources = [
Mark Salyzyn52bd37e2016-11-07 09:39:30 -080021 "android_get_control_file.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080022 "fs.cpp",
Jeff Sharkey53d37ba2017-11-09 17:41:09 -070023 "multiuser.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080024 "socket_inaddr_any_server_unix.cpp",
25 "socket_local_client_unix.cpp",
26 "socket_local_server_unix.cpp",
27 "socket_network_client_unix.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070028 "sockets_unix.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080029 "str_parms.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070030]
31
Vijay Venkatraman651f8382017-01-25 18:52:17 +000032cc_library_headers {
Vijay Venkatraman651f8382017-01-25 18:52:17 +000033 name: "libcutils_headers",
Steven Moreland385fe692017-04-13 14:29:58 -070034 vendor_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090035 recovery_available: true,
Vijay Venkatraman651f8382017-01-25 18:52:17 +000036 host_supported: true,
37 export_include_dirs: ["include"],
38 target: {
Steven Moreland385fe692017-04-13 14:29:58 -070039 vendor: {
Steven Morelande1c834d2018-01-05 14:42:12 -080040 override_export_include_dirs: ["include_vndk"],
Steven Moreland385fe692017-04-13 14:29:58 -070041 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070042 linux_bionic: {
43 enabled: true,
44 },
45 windows: {
46 enabled: true,
47 },
Vijay Venkatraman651f8382017-01-25 18:52:17 +000048 },
49}
50
Dan Willemseneee8e7f2016-06-06 22:31:58 -070051cc_library {
52 name: "libcutils",
Steven Moreland385fe692017-04-13 14:29:58 -070053 vendor_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090054 vndk: {
55 enabled: true,
56 support_system_process: true,
57 },
Jiyong Park612210c2018-04-27 21:48:43 +090058 recovery_available: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -070059 host_supported: true,
60 srcs: [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080061 "config_utils.cpp",
Mark Salyzyn163ecc62017-05-02 08:56:15 -070062 "fs_config.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080063 "canned_fs_config.cpp",
64 "hashmap.cpp",
65 "iosched_policy.cpp",
66 "load_file.cpp",
67 "native_handle.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070068 "open_memstream.c",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080069 "record_stream.cpp",
Isaac Chen795267d2017-02-16 11:47:33 +080070 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070071 "sockets.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080072 "strdup16to8.cpp",
73 "strdup8to16.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070074 "strlcpy.c",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080075 "threads.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070076 ],
77
78 target: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070079 linux_bionic: {
80 enabled: true,
Dan Willemsene0cd1e02017-03-15 15:23:36 -070081 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070082 not_windows: {
83 srcs: libcutils_nonwindows_sources + [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080084 "ashmem-host.cpp",
85 "trace-host.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070086 ],
87 },
88 windows: {
89 srcs: [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080090 "socket_inaddr_any_server_windows.cpp",
91 "socket_network_client_windows.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070092 "sockets_windows.cpp",
93 ],
94
95 enabled: true,
96 shared: {
97 enabled: false,
98 },
Mark Salyzyn163ecc62017-05-02 08:56:15 -070099 cflags: [
100 "-D_GNU_SOURCE",
101 ],
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700102 },
103
104 android: {
105 srcs: libcutils_nonwindows_sources + [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -0800106 "android_reboot.cpp",
107 "ashmem-dev.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700108 "klog.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -0800109 "partition_utils.cpp",
Elliott Hughes4eacd702017-01-26 17:31:40 -0800110 "properties.cpp",
Chenbo Fengbaede732017-10-25 12:31:43 -0700111 "qtaguid.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -0800112 "trace-dev.cpp",
Luis Hector Chaveze97a4b92017-11-02 14:17:43 -0700113 "uevent.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700114 ],
Luis Hector Chavezfae195b2017-11-03 16:22:05 -0700115 },
116
117 android_arm: {
118 srcs: ["arch-arm/memset32.S"],
119 sanitize: {
120 misc_undefined: ["integer"],
121 },
122 },
123 android_arm64: {
124 srcs: ["arch-arm64/android_memset.S"],
Evgenii Stepanov54c78862017-01-31 16:33:53 -0800125 sanitize: {
126 misc_undefined: ["integer"],
127 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700128 },
129
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700130 android_mips: {
131 srcs: ["arch-mips/android_memset.c"],
Luis Hector Chavezfae195b2017-11-03 16:22:05 -0700132 sanitize: {
133 misc_undefined: ["integer"],
134 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700135 },
136 android_mips64: {
137 srcs: ["arch-mips/android_memset.c"],
Luis Hector Chavezfae195b2017-11-03 16:22:05 -0700138 sanitize: {
139 misc_undefined: ["integer"],
140 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700141 },
142
143 android_x86: {
144 srcs: [
145 "arch-x86/android_memset16.S",
146 "arch-x86/android_memset32.S",
147 ],
Luis Hector Chavezfae195b2017-11-03 16:22:05 -0700148 // TODO: This is to work around b/29412086.
149 // Remove once __mulodi4 is available and move the "sanitize" block
150 // to the android target.
151 sanitize: {
152 misc_undefined: [],
153 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700154 },
155
156 android_x86_64: {
157 srcs: [
158 "arch-x86_64/android_memset16.S",
159 "arch-x86_64/android_memset32.S",
160 ],
Luis Hector Chavezfae195b2017-11-03 16:22:05 -0700161 sanitize: {
162 misc_undefined: ["integer"],
163 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700164 },
Logan Chien25b742c2018-05-08 17:37:29 +0800165
166 vendor: {
167 exclude_srcs: [
168 // qtaguid.cpp loads libnetd_client.so with dlopen(). Since
169 // the interface of libnetd_client.so may vary between AOSP
170 // releases, exclude qtaguid.cpp from the VNDK-SP variant.
171 "qtaguid.cpp",
172 ],
173 }
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700174 },
175
176 shared_libs: ["liblog"],
Steven Morelandd73be1b2017-04-13 23:48:57 -0700177 header_libs: [
Elliott Hughes9f495082018-04-25 14:52:50 -0700178 "libbase_headers",
Steven Morelandd73be1b2017-04-13 23:48:57 -0700179 "libcutils_headers",
180 "libutils_headers",
181 ],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000182 export_header_lib_headers: ["libcutils_headers"],
Yifan Hongb6807122017-07-25 15:24:04 -0700183 local_include_dirs: ["include"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000184
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700185 cflags: [
186 "-Werror",
187 "-Wall",
188 "-Wextra",
189 ],
Dan Willemseneee8e7f2016-06-06 22:31:58 -0700190}
191
192subdirs = ["tests"]