1cc_defaults { 2 name: "mdnsresponder_default_cflags", 3 4 cflags: [ 5 "-O2", 6 "-g", 7 "-fno-strict-aliasing", 8 "-fwrapv", 9 "-D_GNU_SOURCE", 10 "-DHAVE_IPV6", 11 "-DNOT_HAVE_SA_LEN", 12 "-DPLATFORM_NO_RLIMIT", 13 "-DMDNS_DEBUGMSGS=0", 14 "-DMDNS_UDS_SERVERPATH=\"/dev/socket/mdnsd\"", 15 "-DMDNS_USERNAME=\"mdnsr\"", 16 "-W", 17 "-Wall", 18 "-Wextra", 19 "-Wno-address-of-packed-member", 20 "-Wno-array-bounds", 21 "-Wno-pointer-sign", 22 "-Wno-unused", 23 "-Wno-unused-but-set-variable", 24 "-Wno-unused-parameter", 25 "-Werror=implicit-function-declaration", 26 ], 27 target: { 28 linux: { 29 cflags: [ 30 "-DTARGET_OS_LINUX", 31 "-DHAVE_LINUX", 32 "-DUSES_NETLINK", 33 "-Werror", 34 ], 35 }, 36 darwin: { 37 cflags: [ 38 "-DTARGET_OS_MAC", 39 "-DMDNS_UDS_SERVERPATH=\"/var/run/mDNSResponder\"", 40 "-Wno-error", 41 ], 42 }, 43 windows: { 44 enabled: true, 45 cflags: [ 46 "-DTARGET_OS_WINDOWS", 47 "-DWIN32", 48 "-DNDEBUG", 49 "-D_WIN32_LEAN_AND_MEAN", 50 "-DUSE_TCP_LOOPBACK", 51 "-D_CRT_SECURE_NO_DEPRECATE", 52 "-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1", 53 "-Wno-error", 54 "-Wno-sign-compare", 55 "-include stdint.h", 56 "-include winsock2.h", 57 "-include ws2ipdef.h", 58 "-include wincrypt.h", 59 "-include netioapi.h", 60 ], 61 local_include_dirs: [ 62 "mDNSWindows", 63 "android/caseMapping", 64 ], 65 }, 66 }, 67} 68 69cc_binary { 70 name: "mdnsd", 71 defaults: ["mdnsresponder_default_cflags"], 72 host_supported: true, 73 srcs: [ 74 "mDNSCore/mDNS.c", 75 "mDNSCore/DNSDigest.c", 76 "mDNSCore/uDNS.c", 77 "mDNSCore/DNSCommon.c", 78 "mDNSShared/uds_daemon.c", 79 "mDNSShared/mDNSDebug.c", 80 "mDNSShared/dnssd_ipc.c", 81 "mDNSShared/GenLinkedList.c", 82 ], 83 84 local_include_dirs: [ 85 "mDNSCore", 86 "mDNSShared", 87 ], 88 init_rc: ["mdnsd.rc"], 89 90 cflags: ["-DMDNS_VERSIONSTR_NODTS=1"], 91 92 target: { 93 android: { 94 static_executable: true, 95 local_include_dirs: ["mDNSPosix"], 96 srcs: [ 97 "mDNSShared/PlatformCommon.c", 98 "mDNSPosix/PosixDaemon.c", 99 "mDNSPosix/mDNSPosix.c", 100 "mDNSPosix/mDNSUNP.c", 101 ], 102 }, 103 not_windows: { 104 local_include_dirs: ["mDNSPosix"], 105 srcs: [ 106 "mDNSShared/PlatformCommon.c", 107 "mDNSPosix/PosixDaemon.c", 108 "mDNSPosix/mDNSPosix.c", 109 "mDNSPosix/mDNSUNP.c", 110 ], 111 }, 112 windows: { 113 cflags: [ 114 "-DTARGET_OS_WIN32", 115 "-D_CONSOLE", 116 "-DPLATFORM_NO_STRSEP", 117 "-DPLATFORM_NO_EPIPE", 118 "-DPLATFORM_NO_RLIMIT", 119 "-DPID_FILE=\"\"", 120 "-DUNICODE", 121 "-D_UNICODE", 122 "-D_LEGACY_NAT_TRAVERSAL", 123 "-Wno-empty-body", 124 ], 125 126 ldflags: ["-municode"], 127 host_ldlibs: [ 128 "-lws2_32", 129 "-liphlpapi", 130 "-lpowrprof", 131 "-lnetapi32", 132 ], 133 134 srcs: [ 135 "mDNSWindows/SystemService/main.c", 136 "mDNSWindows/SystemService/Service.c", 137 "mDNSWindows/SystemService/EventLog.mc", 138 "mDNSWindows/Secret.c", 139 "mDNSWindows/mDNSWin32.c", 140 "mDNSShared/DebugServices.c", 141 "android/windows_firewall_dummy.c", 142 ], 143 144 local_include_dirs: [ 145 "mDNSWindows/SystemService", 146 ], 147 }, 148 }, 149 150 static_libs: [ 151 "libcutils", 152 "liblog", 153 ], 154} 155 156//######################### 157 158cc_library { 159 name: "libmdnssd", 160 defaults: ["mdnsresponder_default_cflags"], 161 host_supported: true, 162 recovery_available: true, 163 srcs: [ 164 "mDNSShared/dnssd_clientlib.c", 165 "mDNSShared/dnssd_clientstub.c", 166 "mDNSShared/dnssd_ipc.c", 167 ], 168 169 target: { 170 host: { 171 shared: { 172 enabled: false, 173 }, 174 }, 175 windows: { 176 srcs: ["mDNSWindows/DLL/dllmain.c"], 177 178 cflags: [ 179 "-D_WINDOWS", 180 "-D_USERDLL", 181 "-D_MDNS_DEBUGMSGS=0", 182 "-D_SSIZE_T", 183 "-DNOT_HAVE_SA_LENGTH", 184 "-Wno-unknown-pragmas", 185 "-Wno-overflow", 186 "-Wno-pragma-pack", 187 "-include iphlpapi.h", 188 "-include stdlib.h", 189 "-include stdio.h", 190 ], 191 }, 192 }, 193 194 export_include_dirs: ["mDNSShared"], 195 196 static_libs: ["libcutils"], 197 shared_libs: ["liblog"], 198 199 apex_available: [ 200 "//apex_available:platform", 201 "com.android.adbd", 202 ], 203} 204 205//########################### 206 207cc_binary { 208 name: "dnssd", 209 defaults: ["mdnsresponder_default_cflags"], 210 srcs: [ 211 "Clients/dns-sd.c", 212 "Clients/ClientCommon.c", 213 ], 214 215 system_shared_libs: ["libc", "libdl"], 216 shared_libs: [ 217 "libmdnssd", 218 "libcutils", 219 "liblog", 220 ], 221} 222