xref: /aosp_15_r20/external/ethtool/Android.bp (revision 1b481fc3bb1b45d4cf28d1ec12969dc1055f555d)
1package {
2    default_applicable_licenses: ["external_ethtool_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//
19// large-scale-change included anything that looked like it might be a license
20// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
21//
22// Please consider removing redundant or irrelevant files from 'license_text:'.
23// See: http://go/android-license-faq
24license {
25    name: "external_ethtool_license",
26    visibility: [":__subpackages__"],
27    license_kinds: [
28        "SPDX-license-identifier-GPL",
29        "SPDX-license-identifier-GPL-2.0",
30        "SPDX-license-identifier-LGPL",
31    ],
32    license_text: [
33        "COPYING",
34        "LICENSE",
35    ],
36}
37
38cc_binary {
39    name: "ethtool",
40    local_include_dirs: [
41        "uapi",
42        "libmnl",
43        "libmnl/include",
44    ],
45    srcs: [
46        "libmnl/src/*.c",
47        "netlink/*.c",
48        "[a-s]*.c",
49        "t[a-d]*.c",
50        // avoid test-*.c -- note these are shell globs, not regexps
51        "t[f-z]*.c",
52        "[u-z]*.c",
53    ],
54    cflags: [
55        "-Wno-missing-field-initializers",
56        "-Wno-gnu-pointer-arith",
57        "-Wno-gnu-variable-sized-type-not-at-end",
58        "-Wno-unused-parameter",
59        "-DETHTOOL_ENABLE_NETLINK",
60        // causes a fair bit of binary bloat: "-DETHTOOL_ENABLE_PRETTY_DUMP",
61        "-DPACKAGE=\"ethtool\"",
62        "-DVERSION=\"6.5\"",
63    ],
64    apex_available: [
65        "com.android.tethering",
66        "//apex_available:platform",
67    ],
68    installable: false,
69    min_sdk_version: "30",
70}
71