Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 1 | // |
| 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 Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 17 | liblog_sources = [ |
Mark Salyzyn | 45d2825 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 18 | "config_read.c", |
Mark Salyzyn | 7ad9192 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 19 | "config_write.c", |
Mark Salyzyn | 45d2825 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 20 | "local_logger.c", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 21 | "log_event_list.c", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 22 | "log_event_write.c", |
Mark Salyzyn | eaece25 | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 23 | "log_ratelimit.cpp", |
Mark Salyzyn | 7ad9192 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 24 | "logger_lock.c", |
| 25 | "logger_name.c", |
Mark Salyzyn | 45d2825 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 26 | "logger_read.c", |
Mark Salyzyn | 7ad9192 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 27 | "logger_write.c", |
| 28 | "logprint.c", |
Mark Salyzyn | cf83b74 | 2017-02-28 12:59:01 -0800 | [diff] [blame] | 29 | "stderr_write.c", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 30 | ] |
| 31 | liblog_host_sources = [ |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 32 | "fake_log_device.c", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 33 | "fake_writer.c", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 34 | ] |
| 35 | liblog_target_sources = [ |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 36 | "event_tag_map.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 37 | "log_time.cpp", |
Mark Salyzyn | 21bc9ad | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 38 | "properties.c", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 39 | "pmsg_reader.c", |
| 40 | "pmsg_writer.c", |
| 41 | "logd_reader.c", |
| 42 | "logd_writer.c", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 43 | ] |
| 44 | |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 45 | cc_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 Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 63 | // Shared and static library for host and device |
| 64 | // ======================================================== |
| 65 | cc_library { |
| 66 | name: "liblog", |
| 67 | host_supported: true, |
| 68 | |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 69 | srcs: liblog_sources, |
| 70 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 71 | 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 Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 79 | sanitize: { |
Evgenii Stepanov | 3711561 | 2016-11-29 15:02:30 -0800 | [diff] [blame] | 80 | address: false, |
Colin Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 81 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 82 | }, |
| 83 | android_arm: { |
Dmitriy Ivanov | 35cea27 | 2015-09-28 10:40:35 -0700 | [diff] [blame] | 84 | // TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 85 | ldflags: ["-Wl,--hash-style=both"], |
| 86 | }, |
| 87 | windows: { |
| 88 | srcs: ["uio.c"], |
Dan Willemsen | 34a3d49 | 2015-11-30 15:35:09 -0800 | [diff] [blame] | 89 | enabled: true, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 90 | }, |
| 91 | not_windows: { |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 92 | srcs: ["event_tag_map.cpp"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 93 | }, |
Dan Willemsen | a00f44a | 2016-11-29 13:39:55 -0800 | [diff] [blame] | 94 | linux_bionic: { |
| 95 | enabled: true, |
| 96 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 97 | }, |
| 98 | |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 99 | header_libs: ["liblog_headers"], |
| 100 | export_header_lib_headers: ["liblog_headers"], |
Vijay Venkatraman | d2cead5 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 101 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 102 | cflags: [ |
| 103 | "-Werror", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 104 | "-fvisibility=hidden", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 105 | // 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 Salyzyn | 74e408e | 2016-09-12 14:51:48 -0700 | [diff] [blame] | 111 | "-DLIBLOG_LOG_TAG=1006", |
Mark Salyzyn | 509c142 | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 112 | "-DSNET_EVENT_LOG_TAG=1397638484", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 113 | ], |
Dan Willemsen | 1fdb20d | 2016-06-01 15:32:35 -0700 | [diff] [blame] | 114 | logtags: ["event.logtags"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 115 | compile_multilib: "both", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 116 | } |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 117 | |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 118 | ndk_headers { |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 119 | name: "liblog_ndk_headers", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 120 | from: "include/android", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 121 | to: "android", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 122 | srcs: ["include/android/log.h"], |
Dan Albert | 17587a1 | 2016-10-20 10:18:27 -0700 | [diff] [blame] | 123 | license: "NOTICE", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 124 | } |
| 125 | |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 126 | ndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 127 | name: "liblog", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 128 | symbol_file: "liblog.map.txt", |
| 129 | first_version: "9", |
Dan Albert | 89ebcb7 | 2017-01-05 15:55:49 -0800 | [diff] [blame] | 130 | unversioned_until: "current", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 131 | } |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 132 | |
| 133 | llndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 134 | name: "liblog", |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 135 | symbol_file: "liblog.map.txt", |
| 136 | unversioned: true, |
| 137 | export_include_dirs: ["include_vndk"], |
| 138 | } |