Bob Badour | 87f33e5 | 2021-02-12 15:24:53 -0800 | [diff] [blame] | 1 | package { |
| 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 |
| 19 | license { |
| 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 Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 34 | cc_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 Willemsen | ee691b0 | 2017-10-03 14:16:44 -0700 | [diff] [blame] | 61 | linux: { |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 62 | cflags: [ |
| 63 | "-DTARGET_OS_LINUX", |
| 64 | "-DHAVE_LINUX", |
| 65 | "-DUSES_NETLINK", |
Chih-Hung Hsieh | c4dfad2 | 2017-09-28 15:35:05 -0700 | [diff] [blame] | 66 | "-Werror", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 67 | ], |
| 68 | }, |
| 69 | darwin: { |
Chih-Hung Hsieh | 56a3eeb | 2017-11-20 16:20:14 -0800 | [diff] [blame] | 70 | cflags: [ |
| 71 | "-DTARGET_OS_MAC", |
Lingfeng Yang | 9e61521 | 2019-11-25 08:52:31 -0800 | [diff] [blame] | 72 | "-DMDNS_UDS_SERVERPATH=\"/var/run/mDNSResponder\"", |
Chih-Hung Hsieh | 56a3eeb | 2017-11-20 16:20:14 -0800 | [diff] [blame] | 73 | "-Wno-error", |
| 74 | ], |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 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", |
Chih-Hung Hsieh | 56a3eeb | 2017-11-20 16:20:14 -0800 | [diff] [blame] | 86 | "-Wno-error", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 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 | |
| 102 | cc_binary { |
| 103 | name: "mdnsd", |
| 104 | defaults: ["mdnsresponder_default_cflags"], |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 105 | srcs: [ |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 106 | "mDNSCore/DNSCommon.c", |
Elliott Hughes | 5bac434 | 2021-10-26 16:38:01 -0700 | [diff] [blame] | 107 | "mDNSCore/DNSDigest.c", |
| 108 | "mDNSCore/mDNS.c", |
| 109 | "mDNSCore/uDNS.c", |
| 110 | "mDNSPosix/mDNSPosix.c", |
| 111 | "mDNSPosix/mDNSUNP.c", |
| 112 | "mDNSPosix/PosixDaemon.c", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 113 | "mDNSShared/dnssd_ipc.c", |
| 114 | "mDNSShared/GenLinkedList.c", |
Elliott Hughes | 5bac434 | 2021-10-26 16:38:01 -0700 | [diff] [blame] | 115 | "mDNSShared/mDNSDebug.c", |
| 116 | "mDNSShared/PlatformCommon.c", |
| 117 | "mDNSShared/uds_daemon.c", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 118 | ], |
| 119 | |
| 120 | local_include_dirs: [ |
| 121 | "mDNSCore", |
Elliott Hughes | 5bac434 | 2021-10-26 16:38:01 -0700 | [diff] [blame] | 122 | "mDNSPosix", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 123 | "mDNSShared", |
| 124 | ], |
| 125 | init_rc: ["mdnsd.rc"], |
| 126 | |
| 127 | cflags: ["-DMDNS_VERSIONSTR_NODTS=1"], |
| 128 | |
Elliott Hughes | f013286 | 2021-12-03 13:28:46 -0800 | [diff] [blame] | 129 | shared_libs: [ |
Jiyong Park | 1b593ab | 2020-03-09 14:33:34 +0900 | [diff] [blame] | 130 | "libcutils", |
| 131 | "liblog", |
| 132 | ], |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | //######################### |
| 136 | |
| 137 | cc_library { |
| 138 | name: "libmdnssd", |
| 139 | defaults: ["mdnsresponder_default_cflags"], |
| 140 | host_supported: true, |
Jiyong Park | eda53cd | 2018-05-24 14:08:51 +0900 | [diff] [blame] | 141 | recovery_available: true, |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 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", |
Elliott Hughes | 3647103 | 2019-12-04 11:06:59 -0800 | [diff] [blame] | 165 | "-Wno-pragma-pack", |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 166 | "-include iphlpapi.h", |
| 167 | "-include stdlib.h", |
| 168 | "-include stdio.h", |
| 169 | ], |
| 170 | }, |
| 171 | }, |
| 172 | |
| 173 | export_include_dirs: ["mDNSShared"], |
| 174 | |
Jiyong Park | 1b593ab | 2020-03-09 14:33:34 +0900 | [diff] [blame] | 175 | static_libs: ["libcutils"], |
| 176 | shared_libs: ["liblog"], |
Jiyong Park | 1d9676b | 2020-04-08 22:37:12 +0900 | [diff] [blame] | 177 | |
| 178 | apex_available: [ |
| 179 | "//apex_available:platform", |
| 180 | "com.android.adbd", |
| 181 | ], |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | //########################### |
| 185 | |
| 186 | cc_binary { |
| 187 | name: "dnssd", |
| 188 | defaults: ["mdnsresponder_default_cflags"], |
| 189 | srcs: [ |
| 190 | "Clients/dns-sd.c", |
| 191 | "Clients/ClientCommon.c", |
| 192 | ], |
| 193 | |
Dan Willemsen | c58b76f | 2017-09-11 19:30:04 -0700 | [diff] [blame] | 194 | system_shared_libs: ["libc", "libdl"], |
Dan Willemsen | 0554d4e | 2017-09-09 13:04:09 -0700 | [diff] [blame] | 195 | shared_libs: [ |
| 196 | "libmdnssd", |
| 197 | "libcutils", |
| 198 | "liblog", |
| 199 | ], |
| 200 | } |