• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17liblog_sources = [
18    "config_read.cpp",
19    "config_write.cpp",
20    "log_event_list.cpp",
21    "log_event_write.cpp",
22    "logger_lock.cpp",
23    "logger_name.cpp",
24    "logger_read.cpp",
25    "logger_write.cpp",
26    "logprint.cpp",
27    "stderr_write.cpp",
28]
29liblog_host_sources = [
30    "fake_log_device.cpp",
31    "fake_writer.cpp",
32]
33liblog_target_sources = [
34    "event_tag_map.cpp",
35    "log_time.cpp",
36    "properties.cpp",
37    "pmsg_reader.cpp",
38    "pmsg_writer.cpp",
39    "logd_reader.cpp",
40    "logd_writer.cpp",
41]
42
43cc_library_headers {
44    name: "liblog_headers",
45    host_supported: true,
46    vendor_available: true,
47    recovery_available: true,
48    export_include_dirs: ["include"],
49    system_shared_libs: [],
50    stl: "none",
51    target: {
52        windows: {
53            enabled: true,
54        },
55        linux_bionic: {
56            enabled: true,
57        },
58        vendor: {
59            override_export_include_dirs: ["include_vndk"],
60        },
61    },
62}
63
64// Shared and static library for host and device
65// ========================================================
66cc_library {
67    name: "liblog",
68    host_supported: true,
69    recovery_available: true,
70    srcs: liblog_sources,
71
72    target: {
73        host: {
74            srcs: liblog_host_sources,
75            cflags: ["-DFAKE_LOG_DEVICE=1"],
76        },
77        android: {
78            version_script: "liblog.map.txt",
79            srcs: liblog_target_sources,
80            // AddressSanitizer runtime library depends on liblog.
81            sanitize: {
82                address: false,
83            },
84        },
85        android_arm: {
86            // TODO: This is to work around b/24465209. Remove after root cause is fixed
87            pack_relocations: false,
88            ldflags: ["-Wl,--hash-style=both"],
89        },
90        windows: {
91            enabled: true,
92        },
93        not_windows: {
94            srcs: ["event_tag_map.cpp"],
95        },
96        linux_bionic: {
97            enabled: true,
98        },
99    },
100
101    header_libs: ["liblog_headers"],
102    export_header_lib_headers: ["liblog_headers"],
103
104    stubs: {
105        symbol_file: "liblog.map.txt",
106        versions: ["10000"],
107    },
108
109    cflags: [
110        "-Werror",
111        // This is what we want to do:
112        //  liblog_cflags := $(shell \
113        //   sed -n \
114        //       's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
115        //       $(LOCAL_PATH)/event.logtags)
116        // so make sure we do not regret hard-coding it as follows:
117        "-DLIBLOG_LOG_TAG=1006",
118        "-DSNET_EVENT_LOG_TAG=1397638484",
119    ],
120    logtags: ["event.logtags"],
121    compile_multilib: "both",
122}
123
124ndk_headers {
125    name: "liblog_ndk_headers",
126    from: "include/android",
127    to: "android",
128    srcs: ["include/android/log.h"],
129    license: "NOTICE",
130}
131
132ndk_library {
133    name: "liblog",
134    symbol_file: "liblog.map.txt",
135    first_version: "9",
136    unversioned_until: "current",
137}
138
139llndk_library {
140    name: "liblog",
141    symbol_file: "liblog.map.txt",
142    export_include_dirs: ["include_vndk"],
143}
144