xref: /aosp_15_r20/external/dnsmasq/src/Android.bp (revision c2c26c8b25cb2c9c4fe49a734c2305a522f5635e)
1package {
2    default_applicable_licenses: ["external_dnsmasq_src_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_dnsmasq_src_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-LGPL",
27        "SPDX-license-identifier-MIT",
28        "legacy_unencumbered",
29    ],
30    license_text: [
31        "NOTICE",
32    ],
33}
34
35cc_binary {
36    name: "dnsmasq",
37    srcs: [
38        "cache.c",
39        "dhcp.c",
40        "dnsmasq.c",
41        "forward.c",
42        "helper.c",
43        "lease.c",
44        "log.c",
45        "netlink.c",
46        "network.c",
47        "option.c",
48        "rfc1035.c",
49        "rfc2131.c",
50        "util.c",
51    ],
52
53    // This project is massively out of date,
54    // and even upstream 2.90 doesn't compile as C23,
55    // so pin to C17.
56    c_std: "gnu17",
57    cflags: [
58        "-O2",
59        "-g",
60        "-W",
61        "-Wall",
62        "-D__ANDROID__",
63        "-DIPV6",
64        "-DNO_SCRIPT",
65        "-D_BSD_SOURCE",
66        "-Wno-unused-variable",
67        "-Wno-unused-parameter",
68        "-Werror",
69    ],
70    system_shared_libs: ["libc"],
71    shared_libs: [
72        "libcutils",
73        "liblog",
74    ],
75}
76