xref: /aosp_15_r20/external/libevent/Android.bp (revision 663afb9b963571284e0f0a60f257164ab54f64bf)
1// Copyright (C) 2015 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
15package {
16    default_applicable_licenses: ["external_libevent_license"],
17}
18
19// Added automatically by a large-scale-change that took the approach of
20// 'apply every license found to every target'. While this makes sure we respect
21// every license restriction, it may not be entirely correct.
22//
23// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24//
25// Please consider splitting the single license below into multiple licenses,
26// taking care not to lose any license_kind information, and overriding the
27// default license using the 'licenses: [...]' property on targets as needed.
28//
29// For unused files, consider creating a 'fileGroup' with "//visibility:private"
30// to attach the license to, and including a comment whether the files may be
31// used in the current project.
32// See: http://go/android-license-faq
33license {
34    name: "external_libevent_license",
35    visibility: [":__subpackages__"],
36    license_kinds: [
37        "SPDX-license-identifier-BSD",
38        "SPDX-license-identifier-BSL-1.0",
39        "SPDX-license-identifier-ISC",
40        "SPDX-license-identifier-MIT",
41        "legacy_notice",
42        "legacy_unencumbered",
43    ],
44    license_text: [
45        "LICENSE",
46    ],
47}
48
49cc_library {
50    name: "libevent",
51    host_supported: true,
52    ramdisk_available: true,
53    recovery_available: true,
54    vendor_available: true,
55    product_available: true,
56    unique_host_soname: true,
57
58    arch: {
59        arm: {
60            instruction_set: "arm",
61        },
62    },
63    cflags: [
64        "-D_BSD_SOURCE",
65        "-O3",
66        "-Wno-strict-aliasing",
67        "-Wno-unused-parameter",
68        "-Werror",
69    ],
70    export_include_dirs: ["include"],
71
72    local_include_dirs: ["compat"],
73
74    srcs: [
75        // core
76        "buffer.c",
77        "bufferevent.c",
78        "bufferevent_filter.c",
79        "bufferevent_pair.c",
80        "bufferevent_ratelim.c",
81        "bufferevent_sock.c",
82        "event.c",
83        "evmap.c",
84        "evthread.c",
85        "evthread_pthread.c",
86        "evutil.c",
87        "evutil_rand.c",
88        "evutil_time.c",
89        "listener.c",
90        "log.c",
91        "signal.c",
92        "strlcpy.c",
93
94        // extra
95        "evdns.c",
96        "event_tagging.c",
97        "evrpc.c",
98        "http.c",
99
100        "poll.c",
101        "select.c",
102    ],
103
104    target: {
105        linux: {
106            srcs: ["epoll.c"],
107            cflags: ["-D_GNU_SOURCE=1"],
108        },
109        linux_bionic: {
110            enabled: true,
111        },
112        darwin: {
113            srcs: ["kqueue.c"],
114        },
115    },
116    min_sdk_version: "30",
117    apex_available: [
118        "//apex_available:platform",
119        "com.android.btservices",
120        "com.android.nfcservices",
121    ],
122}
123