blob: 747fcc8dc73d7fbe9e8991ba620029e27ee060d9 [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 = [
18 "log_event_list.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070019 "log_event_write.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080020 "logger_write.c",
21 "config_write.c",
22 "logger_name.c",
23 "logger_lock.c",
Mark Salyzynfc148f72016-12-14 12:52:50 -080024 "log_ratelimit.cpp",
Mark Salyzyn93101be2016-03-01 13:45:42 -080025]
26liblog_host_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070027 "fake_log_device.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080028 "fake_writer.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070029]
30liblog_target_sources = [
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080031 "event_tag_map.cpp",
Mark Salyzyn93101be2016-03-01 13:45:42 -080032 "config_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070033 "log_time.cpp",
Mark Salyzyn774e04f2016-12-14 12:52:50 -080034 "properties.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070035 "logprint.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080036 "pmsg_reader.c",
37 "pmsg_writer.c",
38 "logd_reader.c",
39 "logd_writer.c",
40 "logger_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070041]
42
43// Shared and static library for host and device
44// ========================================================
45cc_library {
46 name: "liblog",
47 host_supported: true,
48
Mark Salyzyn93101be2016-03-01 13:45:42 -080049 srcs: liblog_sources,
50
Dan Willemsen63aa47a2015-09-16 15:54:14 -070051 target: {
52 host: {
53 srcs: liblog_host_sources,
54 cflags: ["-DFAKE_LOG_DEVICE=1"],
55 },
56 android: {
57 srcs: liblog_target_sources,
58 // AddressSanitizer runtime library depends on liblog.
Colin Cross5d35ce62016-04-07 13:30:22 -070059 sanitize: {
Evgenii Stepanovffdabdc2016-11-29 15:02:30 -080060 address: false,
Colin Cross5d35ce62016-04-07 13:30:22 -070061 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070062 },
63 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070064 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070065 ldflags: ["-Wl,--hash-style=both"],
66 },
67 windows: {
68 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080069 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070070 },
71 not_windows: {
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080072 srcs: ["event_tag_map.cpp"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070073 },
74 linux: {
75 host_ldlibs: ["-lrt"],
76 },
Dan Willemsen0910d2d2016-11-29 13:39:55 -080077 linux_bionic: {
78 enabled: true,
79 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070080 },
81
Vijay Venkatraman651f8382017-01-25 18:52:17 +000082 export_include_dirs: ["include"],
83
Dan Willemsen63aa47a2015-09-16 15:54:14 -070084 cflags: [
85 "-Werror",
Mark Salyzyn93101be2016-03-01 13:45:42 -080086 "-fvisibility=hidden",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070087 // This is what we want to do:
88 // liblog_cflags := $(shell \
89 // sed -n \
90 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
91 // $(LOCAL_PATH)/event.logtags)
92 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn9633b912016-09-12 14:51:48 -070093 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn7ef52492016-03-25 15:50:46 -070094 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070095 ],
Dan Willemsend1191012016-06-01 15:32:35 -070096 logtags: ["event.logtags"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070097 compile_multilib: "both",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070098}
Dan Albertddce8c72016-09-23 15:43:23 -070099
Dan Albertb7c39962016-10-05 13:47:31 -0700100ndk_headers {
101 name: "liblog_headers",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000102 from: "include/android",
Dan Albertb7c39962016-10-05 13:47:31 -0700103 to: "android",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000104 srcs: ["include/android/log.h"],
Dan Albert286b2ea2016-10-20 10:18:27 -0700105 license: "NOTICE",
Dan Albertb7c39962016-10-05 13:47:31 -0700106}
107
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000108cc_library_headers {
109 name: "liblog_vndk_headers",
110 export_include_dirs: ["include_vndk"],
111}
112
Dan Albertddce8c72016-09-23 15:43:23 -0700113ndk_library {
114 name: "liblog.ndk",
115 symbol_file: "liblog.map.txt",
116 first_version: "9",
Dan Albert9a41bce2017-01-05 15:55:49 -0800117 unversioned_until: "current",
Dan Albertddce8c72016-09-23 15:43:23 -0700118}