blob: ff8eec8e492e0fd4d86b49f71dc7ed8522607129 [file] [log] [blame]
Bob Badour87f33e52021-02-12 15:24:53 -08001package {
2 default_applicable_licenses: ["external_mdnsresponder_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_mdnsresponder_license",
21 visibility: [":__subpackages__"],
22 license_kinds: [
23 "SPDX-license-identifier-Apache-2.0",
24 "SPDX-license-identifier-BSD",
25 "SPDX-license-identifier-NCSA",
26 "SPDX-license-identifier-OpenSSL",
27 "legacy_notice",
28 ],
29 license_text: [
30 "LICENSE",
31 ],
32}
33
Dan Willemsen0554d4e2017-09-09 13:04:09 -070034cc_defaults {
35 name: "mdnsresponder_default_cflags",
36
37 cflags: [
38 "-O2",
39 "-g",
40 "-fno-strict-aliasing",
41 "-fwrapv",
42 "-D_GNU_SOURCE",
43 "-DHAVE_IPV6",
44 "-DNOT_HAVE_SA_LEN",
45 "-DPLATFORM_NO_RLIMIT",
46 "-DMDNS_DEBUGMSGS=0",
47 "-DMDNS_UDS_SERVERPATH=\"/dev/socket/mdnsd\"",
48 "-DMDNS_USERNAME=\"mdnsr\"",
49 "-W",
50 "-Wall",
51 "-Wextra",
52 "-Wno-address-of-packed-member",
53 "-Wno-array-bounds",
54 "-Wno-pointer-sign",
55 "-Wno-unused",
56 "-Wno-unused-but-set-variable",
57 "-Wno-unused-parameter",
58 "-Werror=implicit-function-declaration",
59 ],
60 target: {
Dan Willemsenee691b02017-10-03 14:16:44 -070061 linux: {
Dan Willemsen0554d4e2017-09-09 13:04:09 -070062 cflags: [
63 "-DTARGET_OS_LINUX",
64 "-DHAVE_LINUX",
65 "-DUSES_NETLINK",
Chih-Hung Hsiehc4dfad22017-09-28 15:35:05 -070066 "-Werror",
Dan Willemsen0554d4e2017-09-09 13:04:09 -070067 ],
68 },
69 darwin: {
Chih-Hung Hsieh56a3eeb2017-11-20 16:20:14 -080070 cflags: [
71 "-DTARGET_OS_MAC",
Lingfeng Yang9e615212019-11-25 08:52:31 -080072 "-DMDNS_UDS_SERVERPATH=\"/var/run/mDNSResponder\"",
Chih-Hung Hsieh56a3eeb2017-11-20 16:20:14 -080073 "-Wno-error",
74 ],
Dan Willemsen0554d4e2017-09-09 13:04:09 -070075 },
76 windows: {
77 enabled: true,
78 cflags: [
79 "-DTARGET_OS_WINDOWS",
80 "-DWIN32",
81 "-DNDEBUG",
82 "-D_WIN32_LEAN_AND_MEAN",
83 "-DUSE_TCP_LOOPBACK",
84 "-D_CRT_SECURE_NO_DEPRECATE",
85 "-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1",
Chih-Hung Hsieh56a3eeb2017-11-20 16:20:14 -080086 "-Wno-error",
Dan Willemsen0554d4e2017-09-09 13:04:09 -070087 "-Wno-sign-compare",
88 "-include stdint.h",
89 "-include winsock2.h",
90 "-include ws2ipdef.h",
91 "-include wincrypt.h",
92 "-include netioapi.h",
93 ],
94 local_include_dirs: [
95 "mDNSWindows",
96 "android/caseMapping",
97 ],
98 },
99 },
100}
101
102cc_binary {
103 name: "mdnsd",
104 defaults: ["mdnsresponder_default_cflags"],
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700105 srcs: [
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700106 "mDNSCore/DNSCommon.c",
Elliott Hughes5bac4342021-10-26 16:38:01 -0700107 "mDNSCore/DNSDigest.c",
108 "mDNSCore/mDNS.c",
109 "mDNSCore/uDNS.c",
110 "mDNSPosix/mDNSPosix.c",
111 "mDNSPosix/mDNSUNP.c",
112 "mDNSPosix/PosixDaemon.c",
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700113 "mDNSShared/dnssd_ipc.c",
114 "mDNSShared/GenLinkedList.c",
Elliott Hughes5bac4342021-10-26 16:38:01 -0700115 "mDNSShared/mDNSDebug.c",
116 "mDNSShared/PlatformCommon.c",
117 "mDNSShared/uds_daemon.c",
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700118 ],
119
120 local_include_dirs: [
121 "mDNSCore",
Elliott Hughes5bac4342021-10-26 16:38:01 -0700122 "mDNSPosix",
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700123 "mDNSShared",
124 ],
125 init_rc: ["mdnsd.rc"],
126
127 cflags: ["-DMDNS_VERSIONSTR_NODTS=1"],
128
Elliott Hughesf0132862021-12-03 13:28:46 -0800129 shared_libs: [
Jiyong Park1b593ab2020-03-09 14:33:34 +0900130 "libcutils",
131 "liblog",
132 ],
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700133}
134
135//#########################
136
137cc_library {
138 name: "libmdnssd",
139 defaults: ["mdnsresponder_default_cflags"],
140 host_supported: true,
Jiyong Parkeda53cd2018-05-24 14:08:51 +0900141 recovery_available: true,
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700142 srcs: [
143 "mDNSShared/dnssd_clientlib.c",
144 "mDNSShared/dnssd_clientstub.c",
145 "mDNSShared/dnssd_ipc.c",
146 ],
147
148 target: {
149 host: {
150 shared: {
151 enabled: false,
152 },
153 },
154 windows: {
155 srcs: ["mDNSWindows/DLL/dllmain.c"],
156
157 cflags: [
158 "-D_WINDOWS",
159 "-D_USERDLL",
160 "-D_MDNS_DEBUGMSGS=0",
161 "-D_SSIZE_T",
162 "-DNOT_HAVE_SA_LENGTH",
163 "-Wno-unknown-pragmas",
164 "-Wno-overflow",
Elliott Hughes36471032019-12-04 11:06:59 -0800165 "-Wno-pragma-pack",
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700166 "-include iphlpapi.h",
167 "-include stdlib.h",
168 "-include stdio.h",
169 ],
170 },
171 },
172
173 export_include_dirs: ["mDNSShared"],
174
Jiyong Park1b593ab2020-03-09 14:33:34 +0900175 static_libs: ["libcutils"],
176 shared_libs: ["liblog"],
Jiyong Park1d9676b2020-04-08 22:37:12 +0900177
178 apex_available: [
179 "//apex_available:platform",
180 "com.android.adbd",
181 ],
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700182}
183
184//###########################
185
186cc_binary {
187 name: "dnssd",
188 defaults: ["mdnsresponder_default_cflags"],
189 srcs: [
190 "Clients/dns-sd.c",
191 "Clients/ClientCommon.c",
192 ],
193
Dan Willemsenc58b76f2017-09-11 19:30:04 -0700194 system_shared_libs: ["libc", "libdl"],
Dan Willemsen0554d4e2017-09-09 13:04:09 -0700195 shared_libs: [
196 "libmdnssd",
197 "libcutils",
198 "liblog",
199 ],
200}