Home | History | Annotate | Download | only in liblog
      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             override_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_bionic: {
     95             enabled: true,
     96         },
     97     },
     98 
     99     header_libs: ["liblog_headers"],
    100     export_header_lib_headers: ["liblog_headers"],
    101 
    102     cflags: [
    103         "-Werror",
    104         "-fvisibility=hidden",
    105         // This is what we want to do:
    106         //  liblog_cflags := $(shell \
    107         //   sed -n \
    108         //       's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
    109         //       $(LOCAL_PATH)/event.logtags)
    110         // so make sure we do not regret hard-coding it as follows:
    111         "-DLIBLOG_LOG_TAG=1006",
    112         "-DSNET_EVENT_LOG_TAG=1397638484",
    113     ],
    114     logtags: ["event.logtags"],
    115     compile_multilib: "both",
    116 }
    117 
    118 ndk_headers {
    119     name: "liblog_ndk_headers",
    120     from: "include/android",
    121     to: "android",
    122     srcs: ["include/android/log.h"],
    123     license: "NOTICE",
    124 }
    125 
    126 ndk_library {
    127     name: "liblog",
    128     symbol_file: "liblog.map.txt",
    129     first_version: "9",
    130     unversioned_until: "current",
    131 }
    132 
    133 llndk_library {
    134     name: "liblog",
    135     symbol_file: "liblog.map.txt",
    136     unversioned: true,
    137     export_include_dirs: ["include_vndk"],
    138 }
    139