]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | # SPDX-License-Identifier: LGPL-2.1-or-later |
3a726fcd | 2 | |
386b8026 ZJS |
3 | libcore_sources = files( |
4 | 'apparmor-setup.c', | |
386b8026 | 5 | 'audit-fd.c', |
386b8026 | 6 | 'automount.c', |
386b8026 | 7 | 'bpf-devices.c', |
386b8026 | 8 | 'bpf-firewall.c', |
386b8026 | 9 | 'bpf-foreign.c', |
169b5675 | 10 | 'bpf-restrict-fs.c', |
62e22490 | 11 | 'bpf-restrict-ifaces.c', |
386b8026 | 12 | 'bpf-socket-bind.c', |
386b8026 | 13 | 'cgroup.c', |
386b8026 | 14 | 'core-varlink.c', |
386b8026 | 15 | 'dbus-automount.c', |
386b8026 | 16 | 'dbus-cgroup.c', |
386b8026 | 17 | 'dbus-device.c', |
386b8026 | 18 | 'dbus-execute.c', |
386b8026 | 19 | 'dbus-job.c', |
386b8026 | 20 | 'dbus-kill.c', |
386b8026 | 21 | 'dbus-manager.c', |
386b8026 | 22 | 'dbus-mount.c', |
386b8026 | 23 | 'dbus-path.c', |
386b8026 | 24 | 'dbus-scope.c', |
386b8026 | 25 | 'dbus-service.c', |
386b8026 | 26 | 'dbus-slice.c', |
386b8026 | 27 | 'dbus-socket.c', |
386b8026 | 28 | 'dbus-swap.c', |
386b8026 | 29 | 'dbus-target.c', |
386b8026 | 30 | 'dbus-timer.c', |
386b8026 | 31 | 'dbus-unit.c', |
386b8026 | 32 | 'dbus-util.c', |
386b8026 | 33 | 'dbus.c', |
386b8026 | 34 | 'device.c', |
386b8026 | 35 | 'dynamic-user.c', |
386b8026 | 36 | 'efi-random.c', |
386b8026 | 37 | 'emergency-action.c', |
43962c30 | 38 | 'exec-credential.c', |
386b8026 | 39 | 'execute.c', |
5699a168 | 40 | 'execute-serialize.c', |
386b8026 | 41 | 'generator-setup.c', |
386b8026 | 42 | 'ima-setup.c', |
386b8026 | 43 | 'import-creds.c', |
386b8026 | 44 | 'job.c', |
386b8026 | 45 | 'kill.c', |
386b8026 | 46 | 'kmod-setup.c', |
386b8026 | 47 | 'load-dropin.c', |
386b8026 | 48 | 'load-fragment.c', |
386b8026 | 49 | 'manager-dump.c', |
386b8026 | 50 | 'manager-serialize.c', |
386b8026 | 51 | 'manager.c', |
386b8026 | 52 | 'mount.c', |
386b8026 | 53 | 'namespace.c', |
386b8026 | 54 | 'path.c', |
386b8026 | 55 | 'scope.c', |
386b8026 | 56 | 'selinux-access.c', |
386b8026 | 57 | 'selinux-setup.c', |
386b8026 | 58 | 'service.c', |
386b8026 | 59 | 'show-status.c', |
386b8026 | 60 | 'slice.c', |
386b8026 | 61 | 'smack-setup.c', |
386b8026 | 62 | 'socket.c', |
386b8026 | 63 | 'swap.c', |
386b8026 | 64 | 'target.c', |
386b8026 | 65 | 'timer.c', |
386b8026 | 66 | 'transaction.c', |
386b8026 | 67 | 'unit-dependency-atom.c', |
386b8026 | 68 | 'unit-printf.c', |
386b8026 | 69 | 'unit-serialize.c', |
386b8026 | 70 | 'unit.c', |
386b8026 | 71 | ) |
5c23128d | 72 | |
bb0b01ed ZJS |
73 | if conf.get('BPF_FRAMEWORK') == 1 |
74 | libcore_sources += files( | |
75 | 'bpf-util.c', | |
bb0b01ed ZJS |
76 | ) |
77 | endif | |
78 | ||
09fc220c | 79 | subdir('bpf/socket_bind') |
906dff81 | 80 | subdir('bpf/restrict_fs') |
dc83b840 | 81 | subdir('bpf/restrict_ifaces') |
906dff81 | 82 | |
dc83b840 | 83 | if conf.get('BPF_FRAMEWORK') == 1 |
906dff81 LP |
84 | libcore_sources += [ |
85 | socket_bind_skel_h, | |
86 | restrict_fs_skel_h, | |
87 | restrict_ifaces_skel_h] | |
dc83b840 MV |
88 | endif |
89 | ||
5c23128d | 90 | load_fragment_gperf_gperf = custom_target( |
37efbbd8 | 91 | 'load-fragment-gperf.gperf', |
997f52a5 | 92 | input : 'load-fragment-gperf.gperf.in', |
37efbbd8 | 93 | output: 'load-fragment-gperf.gperf', |
8f04a1ca | 94 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@']) |
5c23128d ZJS |
95 | |
96 | load_fragment_gperf_c = custom_target( | |
37efbbd8 ZJS |
97 | 'load-fragment-gperf.c', |
98 | input : load_fragment_gperf_gperf, | |
99 | output : 'load-fragment-gperf.c', | |
100 | command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@']) | |
5c23128d ZJS |
101 | |
102 | awkscript = 'load-fragment-gperf-nulstr.awk' | |
103 | load_fragment_gperf_nulstr_c = custom_target( | |
37efbbd8 ZJS |
104 | 'load-fragment-gperf-nulstr.c', |
105 | input : [awkscript, load_fragment_gperf_gperf], | |
106 | output : 'load-fragment-gperf-nulstr.c', | |
107 | command : [awk, '-f', '@INPUT0@', '@INPUT1@'], | |
108 | capture : true) | |
5c23128d | 109 | |
a2b0cd3f | 110 | libcore_name = 'systemd-core-@0@'.format(shared_lib_tag) |
4287c855 ZJS |
111 | |
112 | libcore = shared_library( | |
113 | libcore_name, | |
68d923d0 | 114 | libcore_sources, |
37efbbd8 ZJS |
115 | load_fragment_gperf_c, |
116 | load_fragment_gperf_nulstr_c, | |
117 | include_directories : includes, | |
4287c855 ZJS |
118 | c_args : ['-fvisibility=default'], |
119 | link_args : ['-shared', | |
120 | '-Wl,--version-script=' + libshared_sym_path], | |
90461ef5 | 121 | link_depends : libshared_sym_path, |
4287c855 | 122 | link_with : libshared, |
92148283 JJ |
123 | dependencies : [libacl, |
124 | libapparmor, | |
125 | libaudit, | |
126 | libblkid, | |
c5fd89ad | 127 | libdl, |
92148283 | 128 | libkmod, |
be1adc27 | 129 | libm, |
92148283 JJ |
130 | libmount, |
131 | libpam, | |
22ce84de | 132 | librt, |
849c09c4 | 133 | libseccomp, |
22ce84de | 134 | libselinux, |
92148283 | 135 | threads, |
40c7d3c7 | 136 | userspace], |
4287c855 | 137 | install : true, |
b0d3095f | 138 | install_dir : pkglibdir) |
5c23128d | 139 | |
8d40961c YW |
140 | core_includes = [includes, include_directories('.')] |
141 | ||
898c9a6f LP |
142 | systemd_sources = files( |
143 | 'main.c', | |
898c9a6f | 144 | 'crash-handler.c', |
898c9a6f | 145 | ) |
5c23128d | 146 | |
bb5232b6 LB |
147 | systemd_executor_sources = files( |
148 | 'executor.c', | |
75689fb2 | 149 | 'exec-invoke.c', |
bb5232b6 LB |
150 | ) |
151 | ||
6d06af80 YW |
152 | executables += [ |
153 | libexec_template + { | |
154 | 'name' : 'systemd', | |
155 | 'dbus' : true, | |
156 | 'public' : true, | |
157 | 'sources' : systemd_sources, | |
158 | 'link_with' : [ | |
159 | libcore, | |
160 | libshared, | |
161 | ], | |
162 | 'dependencies' : libseccomp, | |
163 | }, | |
bb5232b6 LB |
164 | libexec_template + { |
165 | 'name' : 'systemd-executor', | |
166 | 'public' : true, | |
167 | 'sources' : systemd_executor_sources, | |
168 | 'include_directories' : core_includes, | |
169 | 'link_with' : [ | |
170 | libcore, | |
171 | libshared, | |
172 | ], | |
75689fb2 LB |
173 | 'dependencies' : [ |
174 | libapparmor, | |
175 | libpam, | |
176 | libseccomp, | |
177 | libselinux, | |
178 | ], | |
bb5232b6 | 179 | }, |
cbc55c4c YW |
180 | fuzz_template + { |
181 | 'sources' : files('fuzz-unit-file.c'), | |
182 | 'link_with' : [ | |
183 | libcore, | |
184 | libshared | |
185 | ], | |
186 | 'dependencies' : libmount, | |
187 | }, | |
188 | fuzz_template + { | |
189 | 'sources' : files('fuzz-manager-serialize.c'), | |
190 | 'link_with' : [ | |
81c4be64 FS |
191 | libcore, |
192 | libshared | |
193 | ], | |
194 | }, | |
195 | fuzz_template + { | |
196 | 'sources' : files('fuzz-execute-serialize.c'), | |
197 | 'link_with' : [ | |
cbc55c4c YW |
198 | libcore, |
199 | libshared | |
200 | ], | |
201 | }, | |
6d06af80 YW |
202 | ] |
203 | ||
6495361c FB |
204 | in_files = [['system.conf', pkgconfigfiledir], |
205 | ['user.conf', pkgconfigfiledir], | |
e11a25ca | 206 | ['org.freedesktop.systemd1.policy', polkitpolicydir]] |
5c23128d ZJS |
207 | |
208 | foreach item : in_files | |
37efbbd8 ZJS |
209 | file = item[0] |
210 | dir = item[1] | |
5c23128d | 211 | |
e11a25ca ZJS |
212 | custom_target( |
213 | file, | |
214 | input : file + '.in', | |
215 | output: file, | |
8f04a1ca | 216 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], |
6495361c | 217 | install : (dir == pkgconfigfiledir) ? install_sysconfdir_samples : (dir != 'no'), |
e11a25ca | 218 | install_dir : dir) |
5c23128d ZJS |
219 | endforeach |
220 | ||
d30d9bf0 LB |
221 | systemd_pc = custom_target( |
222 | 'systemd.pc', | |
223 | input : 'systemd.pc.in', | |
224 | output : 'systemd.pc', | |
225 | command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'], | |
226 | install : pkgconfigdatadir != 'no', | |
227 | install_tag : 'devel', | |
228 | install_dir : pkgconfigdatadir) | |
229 | ||
5c23128d ZJS |
230 | install_data('org.freedesktop.systemd1.conf', |
231 | install_dir : dbuspolicydir) | |
b895fa08 LP |
232 | install_data('org.freedesktop.systemd1.service', |
233 | install_dir : dbussystemservicedir) | |
5c23128d | 234 | |
9289e093 YW |
235 | install_emptydir(systemshutdowndir) |
236 | install_emptydir(systemsleepdir) | |
237 | install_emptydir(systemgeneratordir) | |
238 | install_emptydir(usergeneratordir) | |
94e75a54 | 239 | |
d7aa78c3 | 240 | if install_sysconfdir |
9289e093 YW |
241 | install_emptydir(pkgsysconfdir / 'system') |
242 | install_emptydir(pkgsysconfdir / 'user') | |
243 | install_emptydir(sysconfdir / 'xdg/systemd') | |
244 | meson.add_install_script(sh, '-c', ln_s.format(pkgsysconfdir / 'user', | |
245 | sysconfdir / 'xdg/systemd/user')) | |
d7aa78c3 | 246 | endif |
e025c9df | 247 | |
9289e093 YW |
248 | install_emptydir(sbindir) |
249 | meson.add_install_script(sh, '-c', ln_s.format(libexecdir / 'systemd', sbindir / 'init')) | |
6d06af80 | 250 | |
e025c9df YW |
251 | ############################################################ |
252 | ||
130c87b1 YW |
253 | core_test_template = test_template + { |
254 | 'link_with' : [ | |
255 | libcore, | |
256 | libshared, | |
257 | ], | |
258 | 'include_directories' : core_includes, | |
259 | 'suite' : 'core', | |
822cd3ff | 260 | } |