1 # SPDX-License-Identifier: LGPL-2.1-or-later
3 resolve_includes = [includes, include_directories('.')]
5 basic_dns_sources = files(
6 'resolved-dns-dnssec.c',
7 'resolved-dns-dnssec.h',
8 'resolved-dns-packet.c',
9 'resolved-dns-packet.h',
12 'resolved-dns-answer.c',
13 'resolved-dns-answer.h',
14 'resolved-dns-question.c',
15 'resolved-dns-question.h',
22 systemd_resolved_sources = files(
28 'resolved-dns-cache.c',
29 'resolved-dns-cache.h',
30 'resolved-dns-query.c',
31 'resolved-dns-query.h',
32 'resolved-dns-scope.c',
33 'resolved-dns-scope.h',
34 'resolved-dns-search-domain.c',
35 'resolved-dns-search-domain.h',
36 'resolved-dns-server.c',
37 'resolved-dns-server.h',
38 'resolved-dns-stream.c',
39 'resolved-dns-stream.h',
40 'resolved-dns-stub.c',
41 'resolved-dns-stub.h',
42 'resolved-dns-synthesize.c',
43 'resolved-dns-synthesize.h',
44 'resolved-dns-transaction.c',
45 'resolved-dns-transaction.h',
46 'resolved-dns-trust-anchor.c',
47 'resolved-dns-trust-anchor.h',
48 'resolved-dns-zone.c',
49 'resolved-dns-zone.h',
50 'resolved-dnssd-bus.c',
51 'resolved-dnssd-bus.h',
55 'resolved-etc-hosts.c',
56 'resolved-etc-hosts.h',
57 'resolved-link-bus.c',
58 'resolved-link-bus.h',
67 'resolved-resolv-conf.c',
68 'resolved-resolv-conf.h',
69 'resolved-socket-graveyard.c',
70 'resolved-socket-graveyard.h',
75 resolvectl_sources = files(
76 'resolvconf-compat.c',
77 'resolvconf-compat.h',
82 ############################################################
84 dns_type_list_txt = custom_target(
86 input : ['generate-dns_type-list.sed', 'dns-type.h'],
87 output : 'dns_type-list.txt',
88 command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'],
91 generate_dns_type_gperf = find_program('generate-dns_type-gperf.py')
93 gperf_file = custom_target(
94 'dns_type-from-name.gperf',
95 input : dns_type_list_txt,
96 output : 'dns_type-from-name.gperf',
97 command : [generate_dns_type_gperf, 'dns_type', 'DNS_TYPE_', '@INPUT@'],
100 basic_dns_sources += custom_target(
101 'dns_type-from-name.h',
103 output : 'dns_type-from-name.h',
105 '-L', 'ANSI-C', '-t', '--ignore-case',
106 '-N', 'lookup_dns_type',
107 '-H', 'hash_dns_type_name',
112 basic_dns_sources += custom_target(
113 'dns_type-to-name.h',
114 input : ['dns_type-to-name.awk', dns_type_list_txt],
115 output : 'dns_type-to-name.h',
116 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
119 libsystemd_resolve_core = static_library(
120 'systemd-resolve-core',
122 include_directories : includes,
123 build_by_default : false)
125 systemd_resolved_sources += custom_target(
127 input : 'resolved-gperf.gperf',
128 output : 'resolved-gperf.c',
129 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
131 systemd_resolved_sources += custom_target(
132 'resolved_dnssd_gperf.c',
133 input : 'resolved-dnssd-gperf.gperf',
134 output : 'resolved-dnssd-gperf.c',
135 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
137 systemd_resolved_dependencies = [threads, libm] + [lib_openssl_or_gcrypt]
138 if conf.get('ENABLE_DNS_OVER_TLS') == 1
139 if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
140 systemd_resolved_sources += files(
141 'resolved-dnstls-gnutls.c',
142 'resolved-dnstls-gnutls.h',
144 systemd_resolved_dependencies += libgnutls
145 elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1
146 systemd_resolved_sources += files(
147 'resolved-dnstls-openssl.c',
148 'resolved-dnstls-openssl.h',
150 systemd_resolved_dependencies += libopenssl
152 error('unknown dependency for supporting DNS-over-TLS')
156 if conf.get('ENABLE_RESOLVE') == 1
157 install_data('org.freedesktop.resolve1.conf',
158 install_dir : dbuspolicydir)
159 install_data('org.freedesktop.resolve1.service',
160 install_dir : dbussystemservicedir)
161 install_data('org.freedesktop.resolve1.policy',
162 install_dir : polkitpolicydir)
163 install_data('resolv.conf',
164 install_dir : rootlibexecdir)
169 input : 'resolved.conf.in',
170 output : 'resolved.conf',
171 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
172 install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
173 install_dir : pkgsysconfdir)
175 ############################################################
178 [files('test-resolve-tables.c'),
179 [libsystemd_resolve_core,
181 [lib_openssl_or_gcrypt,
184 [files('test-dns-packet.c'),
185 [libsystemd_resolve_core,
187 [lib_openssl_or_gcrypt,
190 [files('test-resolved-etc-hosts.c',
191 'resolved-etc-hosts.c',
192 'resolved-etc-hosts.h'),
193 [libsystemd_resolve_core,
195 [lib_openssl_or_gcrypt,
198 [files('test-resolved-packet.c'),
199 [libsystemd_resolve_core,
201 [lib_openssl_or_gcrypt,
204 [files('test-resolved-stream.c')
205 + basic_dns_sources + systemd_resolved_sources,
207 [lib_openssl_or_gcrypt,
209 + systemd_resolved_dependencies,
212 [files('test-dnssec.c'),
213 [libsystemd_resolve_core,
215 [lib_openssl_or_gcrypt,
217 [], 'HAVE_OPENSSL_OR_GCRYPT'],
219 [files('test-dnssec-complex.c'),
220 [libsystemd_resolve_core,
222 [lib_openssl_or_gcrypt,
228 [files('fuzz-dns-packet.c'),
229 [libsystemd_resolve_core,
231 [lib_openssl_or_gcrypt,
233 [files('fuzz-etc-hosts.c',
234 'resolved-etc-hosts.c',
235 'resolved-etc-hosts.h'),
236 [libsystemd_resolve_core,
238 [lib_openssl_or_gcrypt,
242 systemd_resolved_sources += files('resolved.c')