• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1package {
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
34cc_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: {
61        linux: {
62            cflags: [
63                "-DTARGET_OS_LINUX",
64                "-DHAVE_LINUX",
65                "-DUSES_NETLINK",
66                "-Werror",
67            ],
68        },
69        darwin: {
70            cflags: [
71                "-DTARGET_OS_MAC",
72                "-DMDNS_UDS_SERVERPATH=\"/var/run/mDNSResponder\"",
73                "-Wno-error",
74            ],
75        },
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",
86                "-Wno-error",
87                "-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"],
105    srcs: [
106        "mDNSCore/DNSCommon.c",
107        "mDNSCore/DNSDigest.c",
108        "mDNSCore/mDNS.c",
109        "mDNSCore/uDNS.c",
110        "mDNSPosix/mDNSPosix.c",
111        "mDNSPosix/mDNSUNP.c",
112        "mDNSPosix/PosixDaemon.c",
113        "mDNSShared/dnssd_ipc.c",
114        "mDNSShared/GenLinkedList.c",
115        "mDNSShared/mDNSDebug.c",
116        "mDNSShared/PlatformCommon.c",
117        "mDNSShared/uds_daemon.c",
118    ],
119
120    local_include_dirs: [
121        "mDNSCore",
122        "mDNSPosix",
123        "mDNSShared",
124    ],
125    init_rc: ["mdnsd.rc"],
126
127    cflags: ["-DMDNS_VERSIONSTR_NODTS=1"],
128
129    shared_libs: [
130        "libcutils",
131        "liblog",
132    ],
133}
134
135//#########################
136
137cc_library {
138    name: "libmdnssd",
139    defaults: ["mdnsresponder_default_cflags"],
140    host_supported: true,
141    recovery_available: true,
142    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",
165                "-Wno-pragma-pack",
166                "-include iphlpapi.h",
167                "-include stdlib.h",
168                "-include stdio.h",
169            ],
170        },
171    },
172
173    export_include_dirs: ["mDNSShared"],
174
175    static_libs: ["libcutils"],
176    shared_libs: ["liblog"],
177
178    apex_available: [
179        "//apex_available:platform",
180        "com.android.adbd",
181    ],
182}
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
194    system_shared_libs: ["libc", "libdl"],
195    shared_libs: [
196        "libmdnssd",
197        "libcutils",
198        "liblog",
199    ],
200}
201