]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | # SPDX-License-Identifier: LGPL-2.1-or-later |
3a726fcd | 2 | |
8d40961c YW |
3 | resolve_includes = [includes, include_directories('.')] |
4 | ||
f1b98127 ZJS |
5 | basic_dns_sources = files( |
6 | 'resolved-dns-dnssec.c', | |
f1b98127 | 7 | 'resolved-dns-packet.c', |
f1b98127 | 8 | 'resolved-dns-rr.c', |
f1b98127 | 9 | 'resolved-dns-answer.c', |
f1b98127 | 10 | 'resolved-dns-question.c', |
f1b98127 | 11 | 'resolved-util.c', |
f1b98127 | 12 | 'dns-type.c', |
2f492a73 | 13 | ) |
5c23128d | 14 | |
f1b98127 ZJS |
15 | systemd_resolved_sources = files( |
16 | 'resolved-bus.c', | |
f1b98127 | 17 | 'resolved-conf.c', |
f1b98127 | 18 | 'resolved-dns-cache.c', |
f1b98127 | 19 | 'resolved-dns-query.c', |
f1b98127 | 20 | 'resolved-dns-scope.c', |
f1b98127 | 21 | 'resolved-dns-search-domain.c', |
f1b98127 | 22 | 'resolved-dns-server.c', |
f1b98127 | 23 | 'resolved-dns-stream.c', |
f1b98127 | 24 | 'resolved-dns-stub.c', |
f1b98127 | 25 | 'resolved-dns-synthesize.c', |
f1b98127 | 26 | 'resolved-dns-transaction.c', |
f1b98127 | 27 | 'resolved-dns-trust-anchor.c', |
f1b98127 | 28 | 'resolved-dns-zone.c', |
f1b98127 | 29 | 'resolved-dnssd-bus.c', |
f1b98127 | 30 | 'resolved-dnssd.c', |
f1b98127 | 31 | 'resolved-etc-hosts.c', |
f1b98127 | 32 | 'resolved-link-bus.c', |
f1b98127 | 33 | 'resolved-link.c', |
f1b98127 | 34 | 'resolved-llmnr.c', |
f1b98127 | 35 | 'resolved-manager.c', |
f1b98127 | 36 | 'resolved-mdns.c', |
f1b98127 | 37 | 'resolved-resolv-conf.c', |
f1b98127 | 38 | 'resolved-socket-graveyard.c', |
f1b98127 | 39 | 'resolved-varlink.c', |
2f492a73 | 40 | ) |
5c23128d | 41 | |
f1b98127 | 42 | resolvectl_sources = files( |
4a7ee0a5 JJ |
43 | 'resolvconf-compat.c', |
44 | 'resolvectl.c', | |
2f492a73 | 45 | ) |
5c23128d ZJS |
46 | |
47 | ############################################################ | |
48 | ||
49 | dns_type_list_txt = custom_target( | |
37efbbd8 | 50 | 'dns_type-list.txt', |
7087e472 | 51 | input : ['generate-dns_type-list.sed', 'dns-type.h'], |
37efbbd8 ZJS |
52 | output : 'dns_type-list.txt', |
53 | command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'], | |
54 | capture : true) | |
5c23128d ZJS |
55 | |
56 | generate_dns_type_gperf = find_program('generate-dns_type-gperf.py') | |
57 | ||
7087e472 YW |
58 | gperf_file = custom_target( |
59 | 'dns_type-from-name.gperf', | |
60 | input : dns_type_list_txt, | |
61 | output : 'dns_type-from-name.gperf', | |
62 | command : [generate_dns_type_gperf, 'dns_type', 'DNS_TYPE_', '@INPUT@'], | |
63 | capture : true) | |
64 | ||
65 | basic_dns_sources += custom_target( | |
66 | 'dns_type-from-name.h', | |
67 | input : gperf_file, | |
68 | output : 'dns_type-from-name.h', | |
69 | command : [gperf, | |
70 | '-L', 'ANSI-C', '-t', '--ignore-case', | |
71 | '-N', 'lookup_dns_type', | |
72 | '-H', 'hash_dns_type_name', | |
73 | '-p', '-C', | |
74 | '@INPUT@'], | |
75 | capture : true) | |
76 | ||
77 | basic_dns_sources += custom_target( | |
78 | 'dns_type-to-name.h', | |
79 | input : ['dns_type-to-name.awk', dns_type_list_txt], | |
80 | output : 'dns_type-to-name.h', | |
81 | command : [awk, '-f', '@INPUT0@', '@INPUT1@'], | |
82 | capture : true) | |
83 | ||
84 | libsystemd_resolve_core = static_library( | |
85 | 'systemd-resolve-core', | |
86 | basic_dns_sources, | |
03f7ddf0 | 87 | include_directories : includes, |
92148283 | 88 | dependencies : userspace, |
03f7ddf0 | 89 | build_by_default : false) |
5c23128d | 90 | |
4fc47fa8 | 91 | systemd_resolved_sources += custom_target( |
37efbbd8 ZJS |
92 | 'resolved_gperf.c', |
93 | input : 'resolved-gperf.gperf', | |
94 | output : 'resolved-gperf.c', | |
95 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
96 | ||
4fc47fa8 | 97 | systemd_resolved_sources += custom_target( |
6501dd31 DR |
98 | 'resolved_dnssd_gperf.c', |
99 | input : 'resolved-dnssd-gperf.gperf', | |
100 | output : 'resolved-dnssd-gperf.c', | |
101 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
102 | ||
9bcf483b | 103 | systemd_resolved_dependencies = [threads, libm] + [lib_openssl_or_gcrypt] |
56ddbf10 | 104 | if conf.get('ENABLE_DNS_OVER_TLS') == 1 |
096cbdce | 105 | if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1 |
a28c0617 YW |
106 | systemd_resolved_sources += files( |
107 | 'resolved-dnstls-gnutls.c', | |
2f492a73 | 108 | ) |
5a8b1640 | 109 | systemd_resolved_dependencies += libgnutls |
096cbdce | 110 | elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1 |
a28c0617 YW |
111 | systemd_resolved_sources += files( |
112 | 'resolved-dnstls-openssl.c', | |
2f492a73 | 113 | ) |
5a8b1640 | 114 | systemd_resolved_dependencies += libopenssl |
096cbdce IT |
115 | else |
116 | error('unknown dependency for supporting DNS-over-TLS') | |
117 | endif | |
56ddbf10 YW |
118 | endif |
119 | ||
c19cd865 YW |
120 | link_with = [ |
121 | libbasic_gcrypt, | |
122 | libshared, | |
123 | libsystemd_resolve_core, | |
124 | ] | |
125 | ||
130c87b1 YW |
126 | resolve_common_template = { |
127 | 'link_with' : [ | |
128 | libshared, | |
129 | libsystemd_resolve_core, | |
130 | ], | |
131 | 'dependencies' : [ | |
132 | lib_openssl_or_gcrypt, | |
133 | libm, | |
134 | ], | |
135 | } | |
136 | resolve_test_template = test_template + resolve_common_template | |
cbc55c4c | 137 | resolve_fuzz_template = fuzz_template + resolve_common_template |
130c87b1 | 138 | |
c19cd865 YW |
139 | executables += [ |
140 | libexec_template + { | |
141 | 'name' : 'systemd-resolved', | |
142 | 'dbus' : true, | |
143 | 'conditions' : ['ENABLE_RESOLVE'], | |
144 | 'sources' : systemd_resolved_sources + | |
145 | files('resolved.c'), | |
146 | 'include_directories' : resolve_includes, | |
147 | 'link_with' : link_with, | |
148 | 'dependencies' : systemd_resolved_dependencies, | |
149 | }, | |
150 | executable_template + { | |
151 | 'name' : 'resolvectl', | |
152 | 'public' : true, | |
153 | 'conditions' : ['ENABLE_RESOLVE'], | |
154 | 'sources' : resolvectl_sources, | |
155 | 'link_with' : link_with, | |
156 | 'dependencies' : [ | |
157 | lib_openssl_or_gcrypt, | |
158 | libidn, | |
159 | libm, | |
160 | threads, | |
161 | ], | |
162 | }, | |
130c87b1 YW |
163 | resolve_test_template + { |
164 | 'sources' : files('test-resolve-tables.c'), | |
165 | }, | |
166 | resolve_test_template + { | |
167 | 'sources' : files('test-dns-packet.c'), | |
168 | }, | |
169 | resolve_test_template + { | |
170 | 'sources' : files( | |
171 | 'test-resolved-etc-hosts.c', | |
172 | 'resolved-etc-hosts.c', | |
173 | ), | |
174 | }, | |
175 | resolve_test_template + { | |
176 | 'sources' : files('test-resolved-packet.c'), | |
177 | }, | |
178 | resolve_test_template + { | |
179 | 'sources' : files('test-dnssec.c'), | |
180 | 'conditions' : ['HAVE_OPENSSL_OR_GCRYPT'], | |
181 | }, | |
182 | resolve_test_template + { | |
183 | 'sources' : files('test-dnssec-complex.c'), | |
184 | 'type' : 'manual', | |
185 | }, | |
186 | test_template + { | |
187 | 'sources' : [ | |
188 | files('test-resolved-stream.c'), | |
189 | basic_dns_sources, | |
190 | systemd_resolved_sources, | |
191 | ], | |
192 | 'dependencies' : [ | |
193 | lib_openssl_or_gcrypt, | |
194 | libm, | |
195 | systemd_resolved_dependencies, | |
196 | ], | |
197 | 'include_directories' : resolve_includes, | |
198 | }, | |
cbc55c4c YW |
199 | resolve_fuzz_template + { |
200 | 'sources' : files('fuzz-dns-packet.c'), | |
201 | }, | |
202 | resolve_fuzz_template + { | |
203 | 'sources' : files( | |
204 | 'fuzz-etc-hosts.c', | |
205 | 'resolved-etc-hosts.c', | |
206 | ), | |
207 | }, | |
208 | resolve_fuzz_template + { | |
209 | 'sources' : files('fuzz-resource-record.c'), | |
210 | }, | |
c19cd865 YW |
211 | ] |
212 | ||
1ec57f33 | 213 | if conf.get('ENABLE_RESOLVE') == 1 |
37efbbd8 ZJS |
214 | install_data('org.freedesktop.resolve1.conf', |
215 | install_dir : dbuspolicydir) | |
216 | install_data('org.freedesktop.resolve1.service', | |
217 | install_dir : dbussystemservicedir) | |
9b3cff19 ZJS |
218 | install_data('org.freedesktop.resolve1.policy', |
219 | install_dir : polkitpolicydir) | |
d8431fc3 | 220 | install_data('resolv.conf', |
b0d3095f | 221 | install_dir : libexecdir) |
c19cd865 | 222 | |
9289e093 YW |
223 | install_emptydir(sbindir) |
224 | meson.add_install_script(sh, '-c', | |
225 | ln_s.format(bindir / 'resolvectl', | |
226 | sbindir / 'resolvconf')) | |
227 | ||
a1ca52c2 | 228 | # symlink for backwards compatibility after rename |
9289e093 YW |
229 | meson.add_install_script(sh, '-c', |
230 | ln_s.format(bindir / 'resolvectl', | |
231 | bindir / 'systemd-resolve')) | |
d8431fc3 | 232 | endif |
69e96427 | 233 | |
411d1f4c ZJS |
234 | custom_target( |
235 | 'resolved.conf', | |
236 | input : 'resolved.conf.in', | |
237 | output : 'resolved.conf', | |
8f04a1ca | 238 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], |
411d1f4c | 239 | install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples, |
6495361c | 240 | install_dir : pkgconfigfiledir) |