Home | History | Annotate | Download | only in libutils
      1 // Copyright (C) 2008 The Android Open Source Project
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //      http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 cc_library_headers {
     16     name: "libutils_headers",
     17     vendor_available: true,
     18     host_supported: true,
     19 
     20     header_libs: [
     21         "liblog_headers",
     22         "libsystem_headers",
     23         "libcutils_headers",
     24     ],
     25     export_header_lib_headers: [
     26         "liblog_headers",
     27         "libsystem_headers",
     28         "libcutils_headers",
     29     ],
     30     export_include_dirs: ["include"],
     31 
     32     target: {
     33         android: {
     34             header_libs: ["libbacktrace_headers"],
     35             export_header_lib_headers: ["libbacktrace_headers"],
     36         },
     37         linux_bionic: {
     38             enabled: true,
     39         },
     40         windows: {
     41             enabled: true,
     42         },
     43     },
     44 }
     45 
     46 cc_defaults {
     47     name: "libutils_defaults",
     48     vendor_available: true,
     49     vndk: {
     50         enabled: true,
     51         support_system_process: true,
     52     },
     53     host_supported: true,
     54 
     55     cflags: [
     56         "-Wall",
     57         "-Werror",
     58     ],
     59     include_dirs: ["external/safe-iop/include"],
     60     header_libs: [
     61         "libutils_headers",
     62     ],
     63     export_header_lib_headers: [
     64         "libutils_headers",
     65     ],
     66 
     67     shared_libs: [
     68         "liblog",
     69     ],
     70 
     71     arch: {
     72         mips: {
     73             cflags: ["-DALIGN_DOUBLE"],
     74         },
     75     },
     76 
     77     target: {
     78         android: {
     79             cflags: ["-fvisibility=protected"],
     80 
     81             shared_libs: [
     82                 "libcutils",
     83                 "libdl",
     84                 "libvndksupport",
     85             ],
     86 
     87             sanitize: {
     88                 misc_undefined: ["integer"],
     89             },
     90         },
     91 
     92         host: {
     93             cflags: ["-DLIBUTILS_NATIVE=1"],
     94 
     95             shared: {
     96                 enabled: false,
     97             },
     98         },
     99 
    100         linux_bionic: {
    101             enabled: true,
    102         },
    103 
    104         darwin: {
    105             cflags: ["-Wno-unused-parameter"],
    106         },
    107 
    108         windows: {
    109             cflags: [
    110                 // Under MinGW, ctype.h doesn't need multi-byte support
    111                 "-DMB_CUR_MAX=1",
    112                 "-Wno-unused-private-field",
    113             ],
    114 
    115             enabled: true,
    116         },
    117     },
    118 }
    119 
    120 cc_library {
    121     name: "libutils",
    122     defaults: ["libutils_defaults"],
    123 
    124     srcs: [
    125         "FileMap.cpp",
    126         "JenkinsHash.cpp",
    127         "NativeHandle.cpp",
    128         "Printer.cpp",
    129         "PropertyMap.cpp",
    130         "RefBase.cpp",
    131         "SharedBuffer.cpp",
    132         "Static.cpp",
    133         "StopWatch.cpp",
    134         "String8.cpp",
    135         "String16.cpp",
    136         "StrongPointer.cpp",
    137         "SystemClock.cpp",
    138         "Threads.cpp",
    139         "Timers.cpp",
    140         "Tokenizer.cpp",
    141         "Unicode.cpp",
    142         "VectorImpl.cpp",
    143         "misc.cpp",
    144     ],
    145 
    146     target: {
    147         android: {
    148             srcs: [
    149                 "Trace.cpp",
    150             ],
    151         },
    152         linux: {
    153             srcs: [
    154                 "Looper.cpp",
    155             ],
    156         },
    157     },
    158 }
    159 
    160 cc_library {
    161     name: "libutilscallstack",
    162     defaults: ["libutils_defaults"],
    163 
    164     srcs: [
    165         "CallStack.cpp",
    166     ],
    167 
    168     arch: {
    169         mips: {
    170             cflags: ["-DALIGN_DOUBLE"],
    171         },
    172     },
    173 
    174     target: {
    175         android: {
    176             shared_libs: [
    177                 "libutils",
    178                 "libbacktrace",
    179             ],
    180         },
    181         linux: {
    182             srcs: [
    183                 "ProcessCallStack.cpp",
    184             ],
    185         },
    186     },
    187 }
    188 
    189 // Include subdirectory makefiles
    190 // ============================================================
    191 
    192 cc_test {
    193     name: "SharedBufferTest",
    194     host_supported: true,
    195     static_libs: ["libutils"],
    196     shared_libs: ["liblog"],
    197     srcs: ["SharedBufferTest.cpp"],
    198     cflags: [
    199         "-Wall",
    200         "-Werror",
    201     ],
    202 }
    203