xref: /aosp_15_r20/external/libnl/Android.bp (revision 4dc78e53d49367fa8e61b07018507c90983a077d)
1package {
2    default_applicable_licenses: ["external_libnl_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "external_libnl_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-BSD",
24        "SPDX-license-identifier-GPL",
25        "SPDX-license-identifier-GPL-2.0",
26        "SPDX-license-identifier-GPL-3.0",
27        "SPDX-license-identifier-LGPL",
28        "SPDX-license-identifier-LGPL-2.1",
29        "SPDX-license-identifier-LGPL-3.0",
30        "legacy_unencumbered",
31    ],
32    license_text: [
33        "COPYING",
34    ],
35}
36
37cc_library {
38    name: "libnl",
39    host_supported: true,
40    vendor_available: true,
41    product_available: true,
42    recovery_available: true,
43
44    target: {
45        darwin: {
46            enabled: false,
47        },
48        linux_glibc: {
49            local_include_dirs: [
50                "include/linux-private",
51            ],
52        },
53        host: {
54            srcs: [
55                "lib/route/link/macvlan.c",
56            ],
57        },
58    },
59
60    srcs: [
61        "lib/*.c",
62        "lib/fib_lookup/lookup.c",
63        "lib/fib_lookup/request.c",
64        "lib/genl/ctrl.c",
65        "lib/genl/family.c",
66        "lib/genl/genl.c",
67        "lib/genl/mngt.c",
68        "lib/netfilter/nfnl.c",
69        "lib/route/addr.c",
70        "lib/route/link.c",
71        "lib/route/link/api.c",
72        "lib/route/link/macsec.c",
73        "lib/route/link/sriov.c",
74        "lib/route/link/vlan.c",
75        "lib/route/nexthop.c",
76        "lib/route/nexthop_encap.c",
77        "lib/route/nh_encap_mpls.c",
78        "lib/route/route.c",
79        "lib/route/route_obj.c",
80        "lib/route/route_utils.c",
81        "lib/route/rtnl.c",
82    ],
83
84    local_include_dirs: [
85        "include",
86        "lib/route",
87    ],
88    export_include_dirs: ["include"],
89    cflags: [
90        "-D_BSD_SOURCE",
91        "-Wall",
92        "-Werror",
93        "-Wno-unused-parameter",
94        "-Wno-sign-compare",
95        "-Wno-missing-field-initializers",
96        "-Wno-tautological-compare",
97        "-Wno-pointer-arith",
98        "-UNDEBUG",
99        "-D_GNU_SOURCE",
100        "-D_NL_SYSCONFDIR_LIBNL=\"\\\"/etc/libnl\\\"\"",
101    ],
102
103    sanitize: {
104        integer_overflow: true,
105        blocklist: "libnl_blocklist.txt",
106    },
107    apex_available: [
108        "//apex_available:platform",
109        "com.android.virt",
110        "com.android.wifi",
111    ],
112    min_sdk_version: "apex_inherit",
113}
114