xref: /aosp_15_r20/external/iproute2/tc/Android.bp (revision de1e4e894b0c224df933550f0afdecc354b238c4)
1package {
2    default_applicable_licenses: ["external_iproute2_tc_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_iproute2_tc_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    ],
29    license_text: [
30        "NOTICE",
31    ],
32}
33
34genrule {
35    name: "static-syms.h",
36    out: ["static-syms.h"],
37    srcs: ["*.c"],
38    tool_files: ["make-static-syms.sh"],
39    cmd: "$(location make-static-syms.sh) $(in) > $(out)",
40}
41
42genrule {
43    name: "emp_ematch.yacc.c",
44    cmd: "M4=$(location m4) $(location bison) -y --output=$(genDir)/emp_ematch.yacc.c $(in)",
45    out: ["emp_ematch.yacc.c"],
46    srcs: ["emp_ematch.y"],
47    tools: [
48        "bison",
49        "m4",
50    ],
51}
52
53genrule {
54    name: "emp_ematch.yacc.h",
55    cmd: "M4=$(location m4) $(location bison) -y --defines=$(genDir)/emp_ematch.yacc.h --output=$(genDir)/emp_ematch.yacc.c $(in)",
56    out: ["emp_ematch.yacc.h"],
57    srcs: ["emp_ematch.y"],
58    tools: [
59        "bison",
60        "m4",
61    ],
62}
63
64cc_binary {
65    name: "tc",
66    defaults: ["iproute2_defaults"],
67
68    generated_headers: [
69        "emp_ematch.yacc.h",
70        "static-syms.h",
71    ],
72
73    // ordering affects link order, so cannot be quite fully sorted
74    srcs: [
75        "emp_ematch.l",
76        ":emp_ematch.yacc.c",
77        "m_action.c",
78        "m_bpf.c",
79        "m_connmark.c",
80        "m_csum.c",
81        "m_ematch.c",
82        "m_estimator.c",
83        "m_gact.c",
84        "m_ife.c",
85        "m_mirred.c",
86        "m_pedit.c",
87        "m_police.c",
88        "m_sample.c",
89        "m_simple.c",
90        "m_skbedit.c",
91        "m_skbmod.c",
92        "m_tunnel_key.c",
93        "m_vlan.c",
94        "f_basic.c",
95        "f_bpf.c",
96        "f_cgroup.c",
97        "f_flow.c",
98        "f_flower.c",
99        "f_fw.c",
100        "f_matchall.c",
101        "f_route.c",
102        "f_u32.c",
103        "q_clsact.c",
104        "q_codel.c",
105        "q_drr.c",
106        "q_fifo.c",
107        "q_fq.c",
108        "q_fq_codel.c",
109        "q_hfsc.c",
110        "q_hhf.c",
111        "q_htb.c",
112        "q_ingress.c",
113        "q_mqprio.c",
114        "q_multiq.c",
115        "q_netem.c",
116        "q_pie.c",
117        "q_prio.c",
118        "q_qfq.c",
119        "q_rr.c",
120        "q_sfb.c",
121        "q_tbf.c",
122        "static-syms.c",
123        "tc.c",
124        "tc_cbq.c",
125        "tc_class.c",
126        "tc_core.c",
127        "tc_estimator.c",
128        "tc_exec.c",
129        "tc_filter.c",
130        "tc_monitor.c",
131        "tc_qdisc.c",
132        "tc_red.c",
133        "tc_stab.c",
134        "tc_util.c",
135        "q_choke.c",
136        "q_gred.c",
137        "q_red.c",
138        "q_sfq.c",
139    ],
140
141    shared_libs: [
142        "libiprouteutil",
143        "libnetlink",
144    ],
145
146    cflags: [
147        "-Wno-missing-field-initializers",
148        "-Wno-unneeded-internal-declaration",
149        "-Wno-gnu-variable-sized-type-not-at-end",
150    ],
151
152    // This is a work around for b/18403920
153    ldflags: ["-Wl,--no-gc-sections"],
154}
155