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