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 "log_event_list.c", 19 "log_event_write.c", 20 "logger_write.c", 21 "config_write.c", 22 "logger_name.c", 23 "logger_lock.c", 24 ] 25 liblog_host_sources = [ 26 "fake_log_device.c", 27 //"event.logtags", 28 "fake_writer.c", 29 ] 30 liblog_target_sources = [ 31 "event_tag_map.c", 32 "config_read.c", 33 "log_time.cpp", 34 "log_is_loggable.c", 35 "logprint.c", 36 "pmsg_reader.c", 37 "pmsg_writer.c", 38 "logd_reader.c", 39 "logd_writer.c", 40 "logger_read.c", 41 ] 42 43 // Shared and static library for host and device 44 // ======================================================== 45 cc_library { 46 name: "liblog", 47 host_supported: true, 48 49 srcs: liblog_sources, 50 51 target: { 52 host: { 53 srcs: liblog_host_sources, 54 cflags: ["-DFAKE_LOG_DEVICE=1"], 55 }, 56 android: { 57 srcs: liblog_target_sources, 58 // AddressSanitizer runtime library depends on liblog. 59 sanitize: ["never"], 60 }, 61 android_arm: { 62 // TODO: This is to work around b/24465209. Remove after root cause is fixed 63 ldflags: ["-Wl,--hash-style=both"], 64 }, 65 windows: { 66 srcs: ["uio.c"], 67 enabled: true, 68 }, 69 not_windows: { 70 srcs: ["event_tag_map.c"], 71 }, 72 linux: { 73 host_ldlibs: ["-lrt"], 74 }, 75 }, 76 77 cflags: [ 78 "-Werror", 79 "-fvisibility=hidden", 80 // This is what we want to do: 81 // liblog_cflags := $(shell \ 82 // sed -n \ 83 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ 84 // $(LOCAL_PATH)/event.logtags) 85 // so make sure we do not regret hard-coding it as follows: 86 "-DLIBLOG_LOG_TAG=1005", 87 "-DSNET_EVENT_LOG_TAG=1397638484", 88 ], 89 compile_multilib: "both", 90 stl: "none", 91 } 92