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 17 liblog_sources = [ 18 "config_read.c", 19 "config_write.c", 20 "local_logger.c", 21 "log_event_list.c", 22 "log_event_write.c", 23 "log_ratelimit.cpp", 24 "logger_lock.c", 25 "logger_name.c", 26 "logger_read.c", 27 "logger_write.c", 28 "logprint.c", 29 "stderr_write.c", 30 ] 31 liblog_host_sources = [ 32 "fake_log_device.c", 33 "fake_writer.c", 34 ] 35 liblog_target_sources = [ 36 "event_tag_map.cpp", 37 "log_time.cpp", 38 "properties.c", 39 "pmsg_reader.c", 40 "pmsg_writer.c", 41 "logd_reader.c", 42 "logd_writer.c", 43 ] 44 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 63 // Shared and static library for host and device 64 // ======================================================== 65 cc_library { 66 name: "liblog", 67 host_supported: true, 68 69 srcs: liblog_sources, 70 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. 79 sanitize: { 80 address: false, 81 }, 82 }, 83 android_arm: { 84 // TODO: This is to work around b/24465209. Remove after root cause is fixed 85 ldflags: ["-Wl,--hash-style=both"], 86 }, 87 windows: { 88 srcs: ["uio.c"], 89 enabled: true, 90 }, 91 not_windows: { 92 srcs: ["event_tag_map.cpp"], 93 }, 94 linux: { 95 host_ldlibs: ["-lrt"], 96 }, 97 linux_bionic: { 98 enabled: true, 99 }, 100 }, 101 102 header_libs: ["liblog_headers"], 103 export_header_lib_headers: ["liblog_headers"], 104 105 cflags: [ 106 "-Werror", 107 "-fvisibility=hidden", 108 // This is what we want to do: 109 // liblog_cflags := $(shell \ 110 // sed -n \ 111 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ 112 // $(LOCAL_PATH)/event.logtags) 113 // so make sure we do not regret hard-coding it as follows: 114 "-DLIBLOG_LOG_TAG=1006", 115 "-DSNET_EVENT_LOG_TAG=1397638484", 116 ], 117 logtags: ["event.logtags"], 118 compile_multilib: "both", 119 } 120 121 ndk_headers { 122 name: "liblog_ndk_headers", 123 from: "include/android", 124 to: "android", 125 srcs: ["include/android/log.h"], 126 license: "NOTICE", 127 } 128 129 ndk_library { 130 name: "liblog", 131 symbol_file: "liblog.map.txt", 132 first_version: "9", 133 unversioned_until: "current", 134 } 135 136 llndk_library { 137 name: "liblog", 138 symbol_file: "liblog.map.txt", 139 unversioned: true, 140 export_include_dirs: ["include_vndk"], 141 } 142