1# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2# vim: set filetype=python:
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7with Files("**"):
8    BUG_COMPONENT = ("Core", "Networking: DNS")
9
10DIRS += ["mdns", "tests"]
11
12XPIDL_SOURCES += [
13    "nsIDNSByTypeRecord.idl",
14    "nsIDNSListener.idl",
15    "nsIDNSRecord.idl",
16    "nsIDNSResolverInfo.idl",
17    "nsIDNSService.idl",
18    "nsIEffectiveTLDService.idl",
19    "nsIIDNService.idl",
20    "nsINativeDNSResolverOverride.idl",
21    "nsPIDNSService.idl",
22]
23
24XPIDL_MODULE = "necko_dns"
25
26EXTRA_JS_MODULES["netwerk-dns"] += [
27    "PublicSuffixList.jsm",
28]
29
30XPCSHELL_TESTS_MANIFESTS += ["tests/unit/xpcshell.ini"]
31
32EXPORTS += [
33    "nsEffectiveTLDService.h",
34]
35
36EXPORTS.mozilla.net += [
37    "ChildDNSService.h",
38    "DNS.h",
39    "DNSByTypeRecord.h",
40    "DNSListenerProxy.h",
41    "DNSRequestBase.h",
42    "DNSRequestChild.h",
43    "DNSRequestParent.h",
44    "HTTPSSVC.h",
45    "IDNBlocklistUtils.h",
46    "NativeDNSResolverOverrideChild.h",
47    "NativeDNSResolverOverrideParent.h",
48    "TRRService.h",
49    "TRRServiceBase.h",
50    "TRRServiceChild.h",
51    "TRRServiceParent.h",
52]
53
54SOURCES += [
55    "GetAddrInfo.cpp",  # Undefines UNICODE
56    "nsEffectiveTLDService.cpp",  # Excluded from UNIFIED_SOURCES due to special build flags.
57]
58
59UNIFIED_SOURCES += [
60    "ChildDNSService.cpp",
61    "DNS.cpp",
62    "DNSListenerProxy.cpp",
63    "DNSPacket.cpp",
64    "DNSRequestChild.cpp",
65    "DNSRequestParent.cpp",
66    "DNSResolverInfo.cpp",
67    "DNSUtils.cpp",
68    "HostRecordQueue.cpp",
69    "HTTPSSVC.cpp",
70    "IDNBlocklistUtils.cpp",
71    "NativeDNSResolverOverrideChild.cpp",
72    "NativeDNSResolverOverrideParent.cpp",
73    "nsDNSService2.cpp",
74    "nsHostRecord.cpp",
75    "nsHostResolver.cpp",
76    "nsIDNService.cpp",
77    "ODoH.cpp",
78    "ODoHService.cpp",
79    "punycode.c",
80    "TRR.cpp",
81    "TRRQuery.cpp",
82    "TRRService.cpp",
83    "TRRServiceBase.cpp",
84    "TRRServiceChild.cpp",
85    "TRRServiceParent.cpp",
86]
87
88IPDL_SOURCES = [
89    "PDNSRequest.ipdl",
90    "PDNSRequestParams.ipdlh",
91    "PNativeDNSResolverOverride.ipdl",
92    "PTRRService.ipdl",
93]
94
95include("/ipc/chromium/chromium-config.mozbuild")
96
97FINAL_LIBRARY = "xul"
98
99GeneratedFile(
100    "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"]
101)
102
103# need to include etld_data.inc
104LOCAL_INCLUDES += [
105    "/netwerk/base",
106    "/netwerk/protocol/http",
107]
108
109USE_LIBS += ["icu"]
110
111if CONFIG["CC_TYPE"] in ("clang", "gcc"):
112    CXXFLAGS += ["-Wno-error=shadow"]
113
114if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
115    CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
116