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 | 4d99c98 | 2017-02-28 12:59:01 -0800 | [diff] [blame] | 29 | "stderr_write.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 30 | ] |
| 31 | liblog_host_sources = [ |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 32 | "fake_log_device.c", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 33 | "fake_writer.c", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 34 | ] |
| 35 | liblog_target_sources = [ |
Mark Salyzyn | ed9dc8a | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 36 | "event_tag_map.cpp", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 37 | "log_time.cpp", |
Mark Salyzyn | 774e04f | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 38 | "properties.c", |
Mark Salyzyn | 93101be | 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 | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 43 | ] |
| 44 | |
| 45 | // Shared and static library for host and device |
| 46 | // ======================================================== |
| 47 | cc_library { |
| 48 | name: "liblog", |
| 49 | host_supported: true, |
| 50 | |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 51 | srcs: liblog_sources, |
| 52 | |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 53 | target: { |
| 54 | host: { |
| 55 | srcs: liblog_host_sources, |
| 56 | cflags: ["-DFAKE_LOG_DEVICE=1"], |
| 57 | }, |
| 58 | android: { |
| 59 | srcs: liblog_target_sources, |
| 60 | // AddressSanitizer runtime library depends on liblog. |
Colin Cross | 5d35ce6 | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 61 | sanitize: { |
Evgenii Stepanov | ffdabdc | 2016-11-29 15:02:30 -0800 | [diff] [blame] | 62 | address: false, |
Colin Cross | 5d35ce6 | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 63 | }, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 64 | }, |
| 65 | android_arm: { |
Dmitriy Ivanov | 58558a5 | 2015-09-28 10:40:35 -0700 | [diff] [blame] | 66 | // 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] | 67 | ldflags: ["-Wl,--hash-style=both"], |
| 68 | }, |
| 69 | windows: { |
| 70 | srcs: ["uio.c"], |
Dan Willemsen | a3f41bf | 2015-11-30 15:35:09 -0800 | [diff] [blame] | 71 | enabled: true, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 72 | }, |
| 73 | not_windows: { |
Mark Salyzyn | ed9dc8a | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 74 | srcs: ["event_tag_map.cpp"], |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 75 | }, |
| 76 | linux: { |
| 77 | host_ldlibs: ["-lrt"], |
| 78 | }, |
Dan Willemsen | 0910d2d | 2016-11-29 13:39:55 -0800 | [diff] [blame] | 79 | linux_bionic: { |
| 80 | enabled: true, |
| 81 | }, |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 82 | }, |
| 83 | |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 84 | export_include_dirs: ["include"], |
| 85 | |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 86 | cflags: [ |
| 87 | "-Werror", |
Mark Salyzyn | 93101be | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 88 | "-fvisibility=hidden", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 89 | // This is what we want to do: |
| 90 | // liblog_cflags := $(shell \ |
| 91 | // sed -n \ |
| 92 | // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ |
| 93 | // $(LOCAL_PATH)/event.logtags) |
| 94 | // so make sure we do not regret hard-coding it as follows: |
Mark Salyzyn | 9633b91 | 2016-09-12 14:51:48 -0700 | [diff] [blame] | 95 | "-DLIBLOG_LOG_TAG=1006", |
Mark Salyzyn | 7ef5249 | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 96 | "-DSNET_EVENT_LOG_TAG=1397638484", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 97 | ], |
Dan Willemsen | d119101 | 2016-06-01 15:32:35 -0700 | [diff] [blame] | 98 | logtags: ["event.logtags"], |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 99 | compile_multilib: "both", |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 100 | } |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 101 | |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 102 | ndk_headers { |
| 103 | name: "liblog_headers", |
Mark Salyzyn | bdac221 | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 104 | from: "include/android", |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 105 | to: "android", |
Mark Salyzyn | bdac221 | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 106 | srcs: ["include/android/log.h"], |
Dan Albert | 286b2ea | 2016-10-20 10:18:27 -0700 | [diff] [blame] | 107 | license: "NOTICE", |
Dan Albert | b7c3996 | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 108 | } |
| 109 | |
Vijay Venkatraman | 651f838 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 110 | cc_library_headers { |
| 111 | name: "liblog_vndk_headers", |
| 112 | export_include_dirs: ["include_vndk"], |
| 113 | } |
| 114 | |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 115 | ndk_library { |
| 116 | name: "liblog.ndk", |
| 117 | symbol_file: "liblog.map.txt", |
| 118 | first_version: "9", |
Dan Albert | 9a41bce | 2017-01-05 15:55:49 -0800 | [diff] [blame] | 119 | unversioned_until: "current", |
Dan Albert | ddce8c7 | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 120 | } |