]>
Commit | Line | Data |
---|---|---|
5c23128d ZJS |
1 | # -*- mode: meson -*- |
2 | ||
3 | basic_dns_sources = files(''' | |
4 | resolved-dns-dnssec.c | |
5 | resolved-dns-dnssec.h | |
6 | resolved-dns-packet.c | |
7 | resolved-dns-packet.h | |
8 | resolved-dns-rr.c | |
9 | resolved-dns-rr.h | |
10 | resolved-dns-answer.c | |
11 | resolved-dns-answer.h | |
12 | resolved-dns-question.c | |
13 | resolved-dns-question.h | |
14 | dns-type.c | |
15 | '''.split()) | |
16 | ||
17 | dns_type_h = files('dns-type.h')[0] | |
18 | ||
19 | systemd_resolved_only_sources = files(''' | |
20 | resolved.c | |
21 | resolved-manager.c | |
22 | resolved-manager.h | |
23 | resolved-conf.c | |
24 | resolved-conf.h | |
25 | resolved-resolv-conf.c | |
26 | resolved-resolv-conf.h | |
27 | resolved-bus.c | |
28 | resolved-bus.h | |
29 | resolved-link.h | |
30 | resolved-link.c | |
31 | resolved-link-bus.c | |
32 | resolved-link-bus.h | |
33 | resolved-llmnr.h | |
34 | resolved-llmnr.c | |
35 | resolved-mdns.h | |
36 | resolved-mdns.c | |
37 | resolved-def.h | |
38 | resolved-dns-query.h | |
39 | resolved-dns-query.c | |
40 | resolved-dns-synthesize.h | |
41 | resolved-dns-synthesize.c | |
42 | resolved-dns-transaction.h | |
43 | resolved-dns-transaction.c | |
44 | resolved-dns-scope.h | |
45 | resolved-dns-scope.c | |
46 | resolved-dns-server.h | |
47 | resolved-dns-server.c | |
48 | resolved-dns-search-domain.h | |
49 | resolved-dns-search-domain.c | |
50 | resolved-dns-cache.h | |
51 | resolved-dns-cache.c | |
52 | resolved-dns-zone.h | |
53 | resolved-dns-zone.c | |
54 | resolved-dns-stream.h | |
55 | resolved-dns-stream.c | |
56 | resolved-dns-trust-anchor.h | |
57 | resolved-dns-trust-anchor.c | |
58 | resolved-dns-stub.h | |
59 | resolved-dns-stub.c | |
60 | resolved-etc-hosts.h | |
61 | resolved-etc-hosts.c | |
62 | '''.split()) | |
63 | ||
64 | systemd_resolve_only_sources = files('resolve-tool.c') | |
65 | ||
66 | ############################################################ | |
67 | ||
68 | dns_type_list_txt = custom_target( | |
69 | 'dns_type-list.txt', | |
70 | input : ['generate-dns_type-list.sed', dns_type_h], | |
71 | output : 'dns_type-list.txt', | |
72 | command : [sed, '-n', '-r', '-f', '@INPUT0@', '@INPUT1@'], | |
73 | capture : true) | |
74 | ||
75 | generate_dns_type_gperf = find_program('generate-dns_type-gperf.py') | |
76 | ||
77 | dns_type_headers = [dns_type_h] | |
78 | foreach item : [['dns_type', dns_type_list_txt, 'dns_type', 'DNS_TYPE_']] | |
79 | ||
80 | fname = '@0@-from-name.gperf'.format(item[0]) | |
81 | gperf_file = custom_target( | |
82 | fname, | |
83 | input : item[1], | |
84 | output : fname, | |
85 | command : [generate_dns_type_gperf, item[2], item[3], '@INPUT@'], | |
86 | capture : true) | |
87 | ||
88 | fname = '@0@-from-name.h'.format(item[0]) | |
89 | target1 = custom_target( | |
90 | fname, | |
91 | input : gperf_file, | |
92 | output : fname, | |
93 | command : [gperf, | |
94 | '-L', 'ANSI-C', '-t', '--ignore-case', | |
95 | '-N', 'lookup_@0@'.format(item[2]), | |
96 | '-H', 'hash_@0@_name'.format(item[2]), | |
97 | '-p', '-C', | |
98 | '@INPUT@'], | |
99 | capture : true) | |
100 | ||
101 | fname = '@0@-to-name.h'.format(item[0]) | |
102 | awkscript = '@0@-to-name.awk'.format(item[0]) | |
103 | target2 = custom_target( | |
104 | fname, | |
105 | input : [awkscript, item[1]], | |
106 | output : fname, | |
107 | command : [awk, '-f', '@INPUT0@', '@INPUT1@'], | |
108 | capture : true) | |
109 | ||
110 | dns_type_headers += [target1, target2] | |
111 | endforeach | |
112 | ||
113 | resolved_gperf_c = custom_target( | |
114 | 'resolved_gperf.c', | |
115 | input : 'resolved-gperf.gperf', | |
116 | output : 'resolved-gperf.c', | |
117 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
118 | ||
119 | systemd_resolved_sources = ( | |
120 | basic_dns_sources + | |
121 | [resolved_gperf_c] + | |
122 | systemd_resolved_only_sources + | |
123 | dns_type_headers) | |
124 | ||
125 | systemd_resolve_sources = ( | |
126 | basic_dns_sources + | |
127 | systemd_resolve_only_sources + | |
128 | dns_type_headers) | |
129 | ||
130 | if conf.get('ENABLE_RESOLVED', 0) == 1 | |
131 | install_data('org.freedesktop.resolve1.conf', | |
132 | install_dir : dbuspolicydir) | |
133 | install_data('org.freedesktop.resolve1.service', | |
134 | install_dir : dbussystemservicedir) | |
135 | ||
136 | resolved_conf = configure_file( | |
137 | input : 'resolved.conf.in', | |
138 | output : 'resolved.conf', | |
139 | configuration : substs) | |
140 | install_data(resolved_conf, | |
141 | install_dir : pkgsysconfdir) | |
142 | endif | |
143 | ||
144 | install_data('resolv.conf', | |
145 | install_dir : rootlibexecdir) |