Dan Willemsen | 63aa47a | 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 | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 17 | liblog_sources = [ |
Mark Salyzyn | 7100288 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 18 | "config_read.c", |
Mark Salyzyn | 62d0d2d | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 19 | "config_write.c", |
Mark Salyzyn | 7100288 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 20 | "local_logger.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 21 | "log_event_list.c", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 22 | "log_event_write.c", |
Mark Salyzyn | fc148f7 | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 23 | "log_ratelimit.cpp", |
Mark Salyzyn | 62d0d2d | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 24 | "logger_lock.c", |
| 25 | "logger_name.c", |
Mark Salyzyn | 7100288 | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 26 | "logger_read.c", |
Mark Salyzyn | 62d0d2d | 2016-03-08 16:18:26 -0800 | [diff] [blame] | 27 | "logger_write.c", |
| 28 | "logprint.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 29 | ] |
| 30 | liblog_host_sources = [ |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 31 | "fake_log_device.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 32 | "fake_writer.c", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 33 | ] |
| 34 | liblog_target_sources = [ |
Mark Salyzyn | ed9dc8a | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 35 | "event_tag_map.cpp", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 36 | "log_time.cpp", |
Mark Salyzyn | 774e04f | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 37 | "properties.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 38 | "pmsg_reader.c", |
| 39 | "pmsg_writer.c", |
| 40 | "logd_reader.c", |
| 41 | "logd_writer.c", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 42 | ] |
| 43 | |
| 44 | // Shared and static library for host and device |
| 45 | // ======================================================== |
| 46 | cc_library { |
| 47 | name: "liblog", |
| 48 | host_supported: true, |
| 49 | |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 50 | srcs: liblog_sources, |
| 51 | |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 52 | 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 Cross | 5d35ce6 | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 60 | sanitize: { |
Evgenii Stepanov | ffdabdc | 2016-11-29 15:02:30 -0800 | [diff] [blame] | 61 | address: false, |
Colin Cross | 5d35ce6 | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 62 | }, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 63 | }, |
| 64 | android_arm: { |
Dmitriy Ivanov | 58558a5 | 2015-09-28 10:40:35 -0700 | [diff] [blame] | 65 | // TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 66 | ldflags: ["-Wl,--hash-style=both"], |
| 67 | }, |
| 68 | windows: { |
| 69 | srcs: ["uio.c"], |
Dan Willemsen | a3f41bf | 2015-11-30 15:35:09 -0800 | [diff] [blame] | 70 | enabled: true, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 71 | }, |
| 72 | not_windows: { |
Mark Salyzyn | ed9dc8a | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 73 | srcs: ["event_tag_map.cpp"], |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 74 | }, |
| 75 | linux: { |
| 76 | host_ldlibs: ["-lrt"], |
| 77 | }, |
Dan Willemsen | 0910d2d | 2016-11-29 13:39:55 -0800 | [diff] [blame] | 78 | linux_bionic: { |
| 79 | enabled: true, |
| 80 | }, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 81 | }, |
| 82 | |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 83 | export_include_dirs: ["include"], |
| 84 | |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 85 | cflags: [ |
| 86 | "-Werror", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 87 | "-fvisibility=hidden", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 88 | // 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 Salyzyn | 9633b91 | 2016-09-12 14:51:48 -0700 | [diff] [blame] | 94 | "-DLIBLOG_LOG_TAG=1006", |
Mark Salyzyn | 7ef5249 | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 95 | "-DSNET_EVENT_LOG_TAG=1397638484", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 96 | ], |
Dan Willemsen | d119101 | 2016-06-01 15:32:35 -0700 | [diff] [blame] | 97 | logtags: ["event.logtags"], |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 98 | compile_multilib: "both", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 99 | } |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 100 | |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 101 | ndk_headers { |
| 102 | name: "liblog_headers", |
Mark Salyzyn | bdac221 | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 103 | from: "include/android", |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 104 | to: "android", |
Mark Salyzyn | bdac221 | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 105 | srcs: ["include/android/log.h"], |
Dan Albert | 286b2ea | 2016-10-20 10:18:27 -0700 | [diff] [blame] | 106 | license: "NOTICE", |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 107 | } |
| 108 | |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 109 | cc_library_headers { |
| 110 | name: "liblog_vndk_headers", |
| 111 | export_include_dirs: ["include_vndk"], |
| 112 | } |
| 113 | |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 114 | ndk_library { |
| 115 | name: "liblog.ndk", |
| 116 | symbol_file: "liblog.map.txt", |
| 117 | first_version: "9", |
Dan Albert | 9a41bce | 2017-01-05 15:55:49 -0800 | [diff] [blame] | 118 | unversioned_until: "current", |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 119 | } |