]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/meson.build
meson: also allow setting GIT_VERSION via templates
[thirdparty/systemd.git] / src / core / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 libcore_sources = '''
4 apparmor-setup.c
5 apparmor-setup.h
6 audit-fd.c
7 audit-fd.h
8 automount.c
9 automount.h
10 bpf-devices.c
11 bpf-devices.h
12 bpf-firewall.c
13 bpf-firewall.h
14 bpf-foreign.c
15 bpf-foreign.h
16 bpf-lsm.c
17 bpf-lsm.h
18 bpf-socket-bind.c
19 bpf-socket-bind.h
20 cgroup.c
21 cgroup.h
22 core-varlink.c
23 core-varlink.h
24 dbus-automount.c
25 dbus-automount.h
26 dbus-cgroup.c
27 dbus-cgroup.h
28 dbus-device.c
29 dbus-device.h
30 dbus-execute.c
31 dbus-execute.h
32 dbus-job.c
33 dbus-job.h
34 dbus-kill.c
35 dbus-kill.h
36 dbus-manager.c
37 dbus-manager.h
38 dbus-mount.c
39 dbus-mount.h
40 dbus-path.c
41 dbus-path.h
42 dbus-scope.c
43 dbus-scope.h
44 dbus-service.c
45 dbus-service.h
46 dbus-slice.c
47 dbus-slice.h
48 dbus-socket.c
49 dbus-socket.h
50 dbus-swap.c
51 dbus-swap.h
52 dbus-target.c
53 dbus-target.h
54 dbus-timer.c
55 dbus-timer.h
56 dbus-unit.c
57 dbus-unit.h
58 dbus-util.c
59 dbus-util.h
60 dbus.c
61 dbus.h
62 device.c
63 device.h
64 dynamic-user.c
65 dynamic-user.h
66 efi-random.c
67 efi-random.h
68 emergency-action.c
69 emergency-action.h
70 execute.c
71 execute.h
72 generator-setup.c
73 generator-setup.h
74 ima-setup.c
75 ima-setup.h
76 job.c
77 job.h
78 kill.c
79 kill.h
80 kmod-setup.c
81 kmod-setup.h
82 load-dropin.c
83 load-dropin.h
84 load-fragment.c
85 load-fragment.h
86 locale-setup.c
87 locale-setup.h
88 manager-dump.c
89 manager-dump.h
90 manager-serialize.c
91 manager-serialize.h
92 manager.c
93 manager.h
94 mount.c
95 mount.h
96 namespace.c
97 namespace.h
98 path.c
99 path.h
100 restrict-ifaces.c
101 restrict-ifaces.h
102 scope.c
103 scope.h
104 selinux-access.c
105 selinux-access.h
106 selinux-setup.c
107 selinux-setup.h
108 service.c
109 service.h
110 show-status.c
111 show-status.h
112 slice.c
113 slice.h
114 smack-setup.c
115 smack-setup.h
116 socket.c
117 socket.h
118 swap.c
119 swap.h
120 target.c
121 target.h
122 timer.c
123 timer.h
124 transaction.c
125 transaction.h
126 unit-dependency-atom.c
127 unit-dependency-atom.h
128 unit-printf.c
129 unit-printf.h
130 unit-serialize.c
131 unit-serialize.h
132 unit.c
133 unit.h
134 '''.split()
135
136 subdir('bpf')
137
138 subdir('bpf/socket_bind')
139 if conf.get('BPF_FRAMEWORK') == 1
140 libcore_sources += [socket_bind_skel_h]
141 subdir('bpf/restrict_fs')
142 libcore_sources += [restrict_fs_skel_h]
143 endif
144
145 subdir('bpf/restrict_ifaces')
146 if conf.get('BPF_FRAMEWORK') == 1
147 libcore_sources += [restrict_ifaces_skel_h]
148 endif
149
150 load_fragment_gperf_gperf = custom_target(
151 'load-fragment-gperf.gperf',
152 input : 'load-fragment-gperf.gperf.in',
153 output: 'load-fragment-gperf.gperf',
154 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'])
155
156 load_fragment_gperf_c = custom_target(
157 'load-fragment-gperf.c',
158 input : load_fragment_gperf_gperf,
159 output : 'load-fragment-gperf.c',
160 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
161
162 awkscript = 'load-fragment-gperf-nulstr.awk'
163 load_fragment_gperf_nulstr_c = custom_target(
164 'load-fragment-gperf-nulstr.c',
165 input : [awkscript, load_fragment_gperf_gperf],
166 output : 'load-fragment-gperf-nulstr.c',
167 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
168 capture : true)
169
170 libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
171
172 libcore = shared_library(
173 libcore_name,
174 libcore_sources,
175 load_fragment_gperf_c,
176 load_fragment_gperf_nulstr_c,
177 include_directories : includes,
178 c_args : ['-fvisibility=default'],
179 link_args : ['-shared',
180 '-Wl,--version-script=' + libshared_sym_path],
181 link_with : libshared,
182 dependencies : [versiondep,
183 threads,
184 libdl,
185 librt,
186 libseccomp,
187 libpam,
188 libaudit,
189 libkmod,
190 libapparmor,
191 libselinux,
192 libmount,
193 libblkid,
194 libacl],
195 install : true,
196 install_dir : rootlibexecdir)
197
198 core_includes = [includes, include_directories('.')]
199
200 systemd_sources = files(
201 'main.c',
202 'main.h',
203 'crash-handler.c',
204 'crash-handler.h',
205 )
206
207 in_files = [['system.conf', pkgsysconfdir],
208 ['user.conf', pkgsysconfdir],
209 ['systemd.pc', pkgconfigdatadir],
210 ['org.freedesktop.systemd1.policy', polkitpolicydir]]
211
212 foreach item : in_files
213 file = item[0]
214 dir = item[1]
215
216 custom_target(
217 file,
218 input : file + '.in',
219 output: file,
220 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
221 install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
222 install_dir : dir)
223 endforeach
224
225 install_data('org.freedesktop.systemd1.conf',
226 install_dir : dbuspolicydir)
227 install_data('org.freedesktop.systemd1.service',
228 install_dir : dbussystemservicedir)
229
230 meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
231 meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
232 meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
233 meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
234
235 if install_sysconfdir
236 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'system'))
237 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'user'))
238 meson.add_install_script('sh', '-c', mkdir_p.format(sysconfdir / 'xdg/systemd'))
239 endif
240
241 ############################################################
242
243 fuzzers += [
244 [files('fuzz-unit-file.c'),
245 [libcore,
246 libshared],
247 [libmount]],
248 ]