blob: d5bb29ed0fab063704af16cff9d99e8ac113679b [file] [log] [blame]
Dan Willemsen489ca272015-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 Salyzyn6cdd5312016-03-01 13:45:42 -080017liblog_sources = [
Mark Salyzyn45d28252016-03-08 16:18:26 -080018 "config_read.c",
Mark Salyzyn7ad91922016-03-08 16:18:26 -080019 "config_write.c",
Mark Salyzyn45d28252016-03-08 16:18:26 -080020 "local_logger.c",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080021 "log_event_list.c",
Dan Willemsen489ca272015-09-16 15:54:14 -070022 "log_event_write.c",
Mark Salyzyneaece252016-12-14 12:52:50 -080023 "log_ratelimit.cpp",
Mark Salyzyn7ad91922016-03-08 16:18:26 -080024 "logger_lock.c",
25 "logger_name.c",
Mark Salyzyn45d28252016-03-08 16:18:26 -080026 "logger_read.c",
Mark Salyzyn7ad91922016-03-08 16:18:26 -080027 "logger_write.c",
28 "logprint.c",
Mark Salyzyncf83b742017-02-28 12:59:01 -080029 "stderr_write.c",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080030]
31liblog_host_sources = [
Dan Willemsen489ca272015-09-16 15:54:14 -070032 "fake_log_device.c",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080033 "fake_writer.c",
Dan Willemsen489ca272015-09-16 15:54:14 -070034]
35liblog_target_sources = [
Mark Salyzyna4097592016-11-21 12:00:03 -080036 "event_tag_map.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070037 "log_time.cpp",
Mark Salyzyn21bc9ad2016-12-14 12:52:50 -080038 "properties.c",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080039 "pmsg_reader.c",
40 "pmsg_writer.c",
41 "logd_reader.c",
42 "logd_writer.c",
Dan Willemsen489ca272015-09-16 15:54:14 -070043]
44
Steven Moreland5a5d2632017-07-10 16:40:36 -070045cc_library_headers {
46 name: "liblog_headers",
47 host_supported: true,
48 vendor_available: true,
49 export_include_dirs: ["include"],
50 target: {
51 windows: {
52 enabled: true,
53 },
54 linux_bionic: {
55 enabled: true,
56 },
57 vendor: {
58 export_include_dirs: ["include_vndk"],
59 },
60 },
61}
62
Dan Willemsen489ca272015-09-16 15:54:14 -070063// Shared and static library for host and device
64// ========================================================
65cc_library {
66 name: "liblog",
67 host_supported: true,
68
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080069 srcs: liblog_sources,
70
Dan Willemsen489ca272015-09-16 15:54:14 -070071 target: {
72 host: {
73 srcs: liblog_host_sources,
74 cflags: ["-DFAKE_LOG_DEVICE=1"],
75 },
76 android: {
77 srcs: liblog_target_sources,
78 // AddressSanitizer runtime library depends on liblog.
Colin Crossd7b701c2016-04-07 13:30:22 -070079 sanitize: {
Evgenii Stepanov37115612016-11-29 15:02:30 -080080 address: false,
Colin Crossd7b701c2016-04-07 13:30:22 -070081 },
Dan Willemsen489ca272015-09-16 15:54:14 -070082 },
83 android_arm: {
Dmitriy Ivanov35cea272015-09-28 10:40:35 -070084 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen489ca272015-09-16 15:54:14 -070085 ldflags: ["-Wl,--hash-style=both"],
86 },
87 windows: {
88 srcs: ["uio.c"],
Dan Willemsen34a3d492015-11-30 15:35:09 -080089 enabled: true,
Dan Willemsen489ca272015-09-16 15:54:14 -070090 },
91 not_windows: {
Mark Salyzyna4097592016-11-21 12:00:03 -080092 srcs: ["event_tag_map.cpp"],
Dan Willemsen489ca272015-09-16 15:54:14 -070093 },
Dan Willemsena00f44a2016-11-29 13:39:55 -080094 linux_bionic: {
95 enabled: true,
96 },
Dan Willemsen489ca272015-09-16 15:54:14 -070097 },
98
Steven Moreland5a5d2632017-07-10 16:40:36 -070099 header_libs: ["liblog_headers"],
100 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramand2cead52017-01-25 18:52:17 +0000101
Dan Willemsen489ca272015-09-16 15:54:14 -0700102 cflags: [
103 "-Werror",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -0800104 "-fvisibility=hidden",
Dan Willemsen489ca272015-09-16 15:54:14 -0700105 // This is what we want to do:
106 // liblog_cflags := $(shell \
107 // sed -n \
108 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
109 // $(LOCAL_PATH)/event.logtags)
110 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn74e408e2016-09-12 14:51:48 -0700111 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn509c1422016-03-25 15:50:46 -0700112 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen489ca272015-09-16 15:54:14 -0700113 ],
Dan Willemsen1fdb20d2016-06-01 15:32:35 -0700114 logtags: ["event.logtags"],
Dan Willemsen489ca272015-09-16 15:54:14 -0700115 compile_multilib: "both",
Dan Willemsen489ca272015-09-16 15:54:14 -0700116}
Dan Albert0eb04bf2016-09-23 15:43:23 -0700117
Dan Albert6de176a2016-10-05 13:47:31 -0700118ndk_headers {
Steven Moreland5a5d2632017-07-10 16:40:36 -0700119 name: "liblog_ndk_headers",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000120 from: "include/android",
Dan Albert6de176a2016-10-05 13:47:31 -0700121 to: "android",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000122 srcs: ["include/android/log.h"],
Dan Albert17587a12016-10-20 10:18:27 -0700123 license: "NOTICE",
Dan Albert6de176a2016-10-05 13:47:31 -0700124}
125
Dan Albert0eb04bf2016-09-23 15:43:23 -0700126ndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700127 name: "liblog",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700128 symbol_file: "liblog.map.txt",
129 first_version: "9",
Dan Albert89ebcb72017-01-05 15:55:49 -0800130 unversioned_until: "current",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700131}
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700132
133llndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700134 name: "liblog",
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700135 symbol_file: "liblog.map.txt",
136 unversioned: true,
137 export_include_dirs: ["include_vndk"],
138}