1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
18 basic_dns_sources = files('''
27 resolved-dns-question.c
28 resolved-dns-question.h
32 dns_type_h = files('dns-type.h')[0]
34 systemd_resolved_sources = files('''
44 resolved-resolv-conf.c
45 resolved-resolv-conf.h
59 resolved-dns-synthesize.h
60 resolved-dns-synthesize.c
61 resolved-dns-transaction.h
62 resolved-dns-transaction.c
67 resolved-dns-search-domain.h
68 resolved-dns-search-domain.c
75 resolved-dns-trust-anchor.h
76 resolved-dns-trust-anchor.c
83 systemd_resolve_sources = files('resolve-tool.c')
85 ############################################################
87 dns_type_list_txt = custom_target(
89 input : ['generate-dns_type-list.sed', dns_type_h],
90 output : 'dns_type-list.txt',
91 command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'],
94 generate_dns_type_gperf = find_program('generate-dns_type-gperf.py')
96 dns_type_headers = [dns_type_h]
97 foreach item : [['dns_type', dns_type_list_txt, 'dns_type', 'DNS_TYPE_']]
99 fname = '@0@-from-name.gperf'.format(item[0])
100 gperf_file = custom_target(
104 command : [generate_dns_type_gperf, item[2], item[3], '@INPUT@'],
107 fname = '@0@-from-name.h'.format(item[0])
108 target1 = custom_target(
113 '-L', 'ANSI-C', '-t', '--ignore-case',
114 '-N', 'lookup_@0@'.format(item[2]),
115 '-H', 'hash_@0@_name'.format(item[2]),
120 fname = '@0@-to-name.h'.format(item[0])
121 awkscript = '@0@-to-name.awk'.format(item[0])
122 target2 = custom_target(
124 input : [awkscript, item[1]],
126 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
129 dns_type_headers += [target1, target2]
132 resolved_gperf_c = custom_target(
134 input : 'resolved-gperf.gperf',
135 output : 'resolved-gperf.c',
136 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
138 resolved_dnssd_gperf_c = custom_target(
139 'resolved_dnssd_gperf.c',
140 input : 'resolved-dnssd-gperf.gperf',
141 output : 'resolved-dnssd-gperf.c',
142 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
144 libsystemd_resolve_core = static_library(
145 'systemd-resolve-core',
148 include_directories : includes)
150 systemd_resolved_sources += [resolved_gperf_c, resolved_dnssd_gperf_c]
152 if conf.get('ENABLE_RESOLVE') == 1
153 install_data('org.freedesktop.resolve1.conf',
154 install_dir : dbuspolicydir)
155 install_data('org.freedesktop.resolve1.service',
156 install_dir : dbussystemservicedir)
158 resolved_conf = configure_file(
159 input : 'resolved.conf.in',
160 output : 'resolved.conf',
161 configuration : substs)
162 install_data(resolved_conf,
163 install_dir : pkgsysconfdir)
165 install_data('resolv.conf',
166 install_dir : rootlibexecdir)
168 policy = configure_file(
169 input : 'org.freedesktop.resolve1.policy.in',
170 output : 'org.freedesktop.resolve1.policy',
171 configuration : substs)
173 install_dir : polkitpolicydir)
177 [['src/resolve/test-resolve-tables.c',
179 'src/shared/test-tables.h'],
180 [libsystemd_resolve_core,
187 [['src/resolve/test-dns-packet.c',
189 [libsystemd_resolve_core,
196 [['src/resolve/test-resolved-packet.c',
198 [libsystemd_resolve_core,
205 [['src/resolve/test-dnssec.c',
207 [libsystemd_resolve_core,
214 [['src/resolve/test-dnssec-complex.c',
215 'src/resolve/dns-type.c',
219 'ENABLE_RESOLVE', 'manual'],