]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/meson.build
Move mount-util.c to shared/
[thirdparty/systemd.git] / src / shared / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2
3 shared_sources = files('''
4 acl-util.h
5 acpi-fpdt.c
6 acpi-fpdt.h
7 apparmor-util.c
8 apparmor-util.h
9 ask-password-api.c
10 ask-password-api.h
11 barrier.c
12 barrier.h
13 base-filesystem.c
14 base-filesystem.h
15 bitmap.c
16 bitmap.h
17 blkid-util.h
18 boot-timestamps.c
19 boot-timestamps.h
20 bootspec.c
21 bootspec.h
22 bpf-program.c
23 bpf-program.h
24 bus-unit-util.c
25 bus-unit-util.h
26 bus-util.c
27 bus-util.h
28 calendarspec.c
29 calendarspec.h
30 cgroup-show.c
31 cgroup-show.h
32 clean-ipc.c
33 clean-ipc.h
34 clock-util.c
35 clock-util.h
36 condition.c
37 condition.h
38 conf-parser.c
39 conf-parser.h
40 cpu-set-util.c
41 cpu-set-util.h
42 crypt-util.c
43 crypt-util.h
44 dev-setup.c
45 dev-setup.h
46 dissect-image.c
47 dissect-image.h
48 dns-domain.c
49 dns-domain.h
50 dropin.c
51 dropin.h
52 efivars.c
53 efivars.h
54 enable-mempool.c
55 exec-util.c
56 exec-util.h
57 exit-status.c
58 exit-status.h
59 fdset.c
60 fdset.h
61 fileio-label.c
62 fileio-label.h
63 firewall-util.h
64 format-table.c
65 format-table.h
66 fstab-util.c
67 fstab-util.h
68 generator.c
69 generator.h
70 gpt.h
71 id128-print.c
72 id128-print.h
73 ima-util.c
74 ima-util.h
75 import-util.c
76 import-util.h
77 initreq.h
78 install-printf.c
79 install-printf.h
80 install.c
81 install.h
82 journal-importer.c
83 journal-importer.h
84 journal-util.c
85 journal-util.h
86 json-internal.h
87 json.c
88 json.h
89 lockfile-util.c
90 lockfile-util.h
91 logs-show.c
92 logs-show.h
93 loop-util.c
94 loop-util.h
95 machine-image.c
96 machine-image.h
97 machine-pool.c
98 machine-pool.h
99 main-func.h
100 module-util.h
101 mount-util.c
102 mount-util.h
103 nsflags.c
104 nsflags.h
105 os-util.c
106 os-util.h
107 output-mode.c
108 output-mode.h
109 pager.c
110 pager.h
111 path-lookup.c
112 path-lookup.h
113 pretty-print.c
114 pretty-print.h
115 ptyfwd.c
116 ptyfwd.h
117 reboot-util.c
118 reboot-util.h
119 resolve-util.c
120 resolve-util.h
121 rlimit-util.c
122 rlimit-util.h
123 seccomp-util.h
124 securebits-util.c
125 securebits-util.h
126 serialize.c
127 serialize.h
128 sleep-config.c
129 sleep-config.h
130 socket-protocol-list.c
131 socket-protocol-list.h
132 spawn-ask-password-agent.c
133 spawn-ask-password-agent.h
134 spawn-polkit-agent.c
135 spawn-polkit-agent.h
136 specifier.c
137 specifier.h
138 switch-root.c
139 switch-root.h
140 sysctl-util.c
141 sysctl-util.h
142 tomoyo-util.c
143 tomoyo-util.h
144 udev-util.c
145 udev-util.h
146 uid-range.c
147 uid-range.h
148 utmp-wtmp.h
149 verbs.c
150 verbs.h
151 vlan-util.c
152 vlan-util.h
153 volatile-util.c
154 volatile-util.h
155 watchdog.c
156 watchdog.h
157 web-util.c
158 web-util.h
159 wireguard-netlink.h
160 xml.c
161 xml.h
162 '''.split())
163
164 if get_option('tests') != 'false'
165 shared_sources += files('tests.c', 'tests.h')
166 endif
167
168 test_tables_h = files('test-tables.h')
169 shared_sources += test_tables_h
170
171 if conf.get('HAVE_ACL') == 1
172 shared_sources += files('acl-util.c')
173 endif
174
175 if conf.get('ENABLE_UTMP') == 1
176 shared_sources += files('utmp-wtmp.c')
177 endif
178
179 if conf.get('HAVE_SECCOMP') == 1
180 shared_sources += files('seccomp-util.c')
181 endif
182
183 if conf.get('HAVE_LIBIPTC') == 1
184 shared_sources += files('firewall-util.c')
185 endif
186
187 if conf.get('HAVE_KMOD') == 1
188 shared_sources += files('module-util.c')
189 endif
190
191 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
192 socket_protocol_list_txt = custom_target(
193 'socket-protocol-list.txt',
194 output : 'socket-protocol-list.txt',
195 command : [generate_socket_protocol_list, cpp],
196 capture : true)
197
198 fname = 'socket-protocol-from-name.gperf'
199 gperf_file = custom_target(
200 fname,
201 input : socket_protocol_list_txt,
202 output : fname,
203 command : [generate_gperfs, 'socket_protocol', 'IPPROTO_', '@INPUT@'],
204 capture : true)
205
206 fname = 'socket-protocol-from-name.h'
207 target1 = custom_target(
208 fname,
209 input : gperf_file,
210 output : fname,
211 command : [gperf,
212 '-L', 'ANSI-C', '-t', '--ignore-case',
213 '-N', 'lookup_socket_protocol',
214 '-H', 'hash_socket_protocol_name',
215 '-p', '-C',
216 '@INPUT@'],
217 capture : true)
218
219 fname = 'socket-protocol-to-name.h'
220 awkscript = 'socket-protocol-to-name.awk'
221 target2 = custom_target(
222 fname,
223 input : [awkscript, socket_protocol_list_txt],
224 output : fname,
225 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
226 capture : true)
227
228 shared_sources += [target1, target2]
229
230 libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
231
232 libshared_deps = [threads,
233 librt,
234 libcap,
235 libacl,
236 libcryptsetup,
237 libgcrypt,
238 libiptc,
239 libkmod,
240 libmount,
241 libseccomp,
242 libselinux,
243 libidn,
244 libxz,
245 liblz4,
246 libblkid]
247
248 libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
249
250 libshared_static = static_library(
251 libshared_name,
252 shared_sources,
253 include_directories : includes,
254 dependencies : libshared_deps,
255 c_args : ['-fvisibility=default'])
256
257 libshared = shared_library(
258 libshared_name,
259 libudev_sources,
260 include_directories : includes,
261 link_args : ['-shared',
262 '-Wl,--version-script=' + libshared_sym_path],
263 link_whole : [libshared_static,
264 libbasic,
265 libbasic_gcrypt,
266 libsystemd_static,
267 libjournal_client],
268 c_args : ['-fvisibility=default'],
269 dependencies : libshared_deps,
270 install : true,
271 install_dir : rootlibexecdir)