blob: 4291212a134e56827e908b2e5220ade190352606 [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",
Elliott Hughes9d127252018-07-13 10:54:49 -070023 "hashmap.cpp",
Jeff Sharkey53d37ba2017-11-09 17:41:09 -070024 "multiuser.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080025 "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 Willemseneee8e7f2016-06-06 22:31:58 -070029 "sockets_unix.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080030 "str_parms.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070031]
32
Vijay Venkatraman651f8382017-01-25 18:52:17 +000033cc_library_headers {
Vijay Venkatraman651f8382017-01-25 18:52:17 +000034 name: "libcutils_headers",
Steven Moreland385fe692017-04-13 14:29:58 -070035 vendor_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090036 recovery_available: true,
Vijay Venkatraman651f8382017-01-25 18:52:17 +000037 host_supported: true,
38 export_include_dirs: ["include"],
39 target: {
Steven Moreland385fe692017-04-13 14:29:58 -070040 vendor: {
Steven Morelande1c834d2018-01-05 14:42:12 -080041 override_export_include_dirs: ["include_vndk"],
Steven Moreland385fe692017-04-13 14:29:58 -070042 },
Dan Willemsene0cd1e02017-03-15 15:23:36 -070043 linux_bionic: {
44 enabled: true,
45 },
46 windows: {
47 enabled: true,
48 },
Vijay Venkatraman651f8382017-01-25 18:52:17 +000049 },
50}
51
Dan Willemseneee8e7f2016-06-06 22:31:58 -070052cc_library {
53 name: "libcutils",
Steven Moreland385fe692017-04-13 14:29:58 -070054 vendor_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090055 vndk: {
56 enabled: true,
57 support_system_process: true,
58 },
Jiyong Park612210c2018-04-27 21:48:43 +090059 recovery_available: true,
Dan Willemseneee8e7f2016-06-06 22:31:58 -070060 host_supported: true,
61 srcs: [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080062 "config_utils.cpp",
Mark Salyzyn163ecc62017-05-02 08:56:15 -070063 "fs_config.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080064 "canned_fs_config.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080065 "iosched_policy.cpp",
66 "load_file.cpp",
67 "native_handle.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080068 "record_stream.cpp",
Isaac Chen795267d2017-02-16 11:47:33 +080069 "sched_policy.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070070 "sockets.cpp",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080071 "strdup16to8.cpp",
72 "strdup8to16.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070073 "strlcpy.c",
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080074 "threads.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070075 ],
76
77 target: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070078 linux_bionic: {
79 enabled: true,
Dan Willemsene0cd1e02017-03-15 15:23:36 -070080 },
Dan Willemseneee8e7f2016-06-06 22:31:58 -070081 not_windows: {
82 srcs: libcutils_nonwindows_sources + [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080083 "ashmem-host.cpp",
84 "trace-host.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070085 ],
86 },
87 windows: {
88 srcs: [
Elliott Hughes8e9aeb92017-11-10 10:22:07 -080089 "socket_inaddr_any_server_windows.cpp",
90 "socket_network_client_windows.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070091 "sockets_windows.cpp",
David Sehreb2dd202018-12-20 12:59:36 -080092 "trace-host.cpp",
Dan Willemseneee8e7f2016-06-06 22:31:58 -070093 ],
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"]