blob: 310dbf4c3f06c05f74f989d88c34229efba27e5d [file] [log] [blame]
Dan Willemsen63aa47a2015-09-16 15:54:14 -07001//
2// Copyright (C) 2008-2014 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
Mark Salyzyn93101be2016-03-01 13:45:42 -080017liblog_sources = [
Mark Salyzyn71002882016-03-08 16:18:26 -080018 "config_read.c",
Mark Salyzyn62d0d2d2016-03-08 16:18:26 -080019 "config_write.c",
Mark Salyzyn71002882016-03-08 16:18:26 -080020 "local_logger.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080021 "log_event_list.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070022 "log_event_write.c",
Mark Salyzynfc148f72016-12-14 12:52:50 -080023 "log_ratelimit.cpp",
Mark Salyzyn62d0d2d2016-03-08 16:18:26 -080024 "logger_lock.c",
25 "logger_name.c",
Mark Salyzyn71002882016-03-08 16:18:26 -080026 "logger_read.c",
Mark Salyzyn62d0d2d2016-03-08 16:18:26 -080027 "logger_write.c",
28 "logprint.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080029]
30liblog_host_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070031 "fake_log_device.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080032 "fake_writer.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070033]
34liblog_target_sources = [
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080035 "event_tag_map.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070036 "log_time.cpp",
Mark Salyzyn774e04f2016-12-14 12:52:50 -080037 "properties.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080038 "pmsg_reader.c",
39 "pmsg_writer.c",
40 "logd_reader.c",
41 "logd_writer.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070042]
43
44// Shared and static library for host and device
45// ========================================================
46cc_library {
47 name: "liblog",
48 host_supported: true,
49
Mark Salyzyn93101be2016-03-01 13:45:42 -080050 srcs: liblog_sources,
51
Dan Willemsen63aa47a2015-09-16 15:54:14 -070052 target: {
53 host: {
54 srcs: liblog_host_sources,
55 cflags: ["-DFAKE_LOG_DEVICE=1"],
56 },
57 android: {
58 srcs: liblog_target_sources,
59 // AddressSanitizer runtime library depends on liblog.
Colin Cross5d35ce62016-04-07 13:30:22 -070060 sanitize: {
Evgenii Stepanovffdabdc2016-11-29 15:02:30 -080061 address: false,
Colin Cross5d35ce62016-04-07 13:30:22 -070062 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070063 },
64 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070065 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070066 ldflags: ["-Wl,--hash-style=both"],
67 },
68 windows: {
69 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080070 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070071 },
72 not_windows: {
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080073 srcs: ["event_tag_map.cpp"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070074 },
75 linux: {
76 host_ldlibs: ["-lrt"],
77 },
Dan Willemsen0910d2d2016-11-29 13:39:55 -080078 linux_bionic: {
79 enabled: true,
80 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070081 },
82
Vijay Venkatraman651f8382017-01-25 18:52:17 +000083 export_include_dirs: ["include"],
84
Dan Willemsen63aa47a2015-09-16 15:54:14 -070085 cflags: [
86 "-Werror",
Mark Salyzyn93101be2016-03-01 13:45:42 -080087 "-fvisibility=hidden",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070088 // This is what we want to do:
89 // liblog_cflags := $(shell \
90 // sed -n \
91 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
92 // $(LOCAL_PATH)/event.logtags)
93 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn9633b912016-09-12 14:51:48 -070094 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn7ef52492016-03-25 15:50:46 -070095 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070096 ],
Dan Willemsend1191012016-06-01 15:32:35 -070097 logtags: ["event.logtags"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070098 compile_multilib: "both",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070099}
Dan Albertddce8c72016-09-23 15:43:23 -0700100
Dan Albertb7c39962016-10-05 13:47:31 -0700101ndk_headers {
102 name: "liblog_headers",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000103 from: "include/android",
Dan Albertb7c39962016-10-05 13:47:31 -0700104 to: "android",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000105 srcs: ["include/android/log.h"],
Dan Albert286b2ea2016-10-20 10:18:27 -0700106 license: "NOTICE",
Dan Albertb7c39962016-10-05 13:47:31 -0700107}
108
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000109cc_library_headers {
110 name: "liblog_vndk_headers",
111 export_include_dirs: ["include_vndk"],
112}
113
Dan Albertddce8c72016-09-23 15:43:23 -0700114ndk_library {
115 name: "liblog.ndk",
116 symbol_file: "liblog.map.txt",
117 first_version: "9",
Dan Albert9a41bce2017-01-05 15:55:49 -0800118 unversioned_until: "current",
Dan Albertddce8c72016-09-23 15:43:23 -0700119}