]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/meson.build
meson: also allow setting GIT_VERSION via templates
[thirdparty/systemd.git] / src / core / meson.build
CommitLineData
db9ecf05 1# SPDX-License-Identifier: LGPL-2.1-or-later
3a726fcd 2
68d923d0 3libcore_sources = '''
2ffadd3c
Y
4 apparmor-setup.c
5 apparmor-setup.h
b36672e0
DM
6 audit-fd.c
7 audit-fd.h
37efbbd8
ZJS
8 automount.c
9 automount.h
084c7007
RG
10 bpf-devices.c
11 bpf-devices.h
1988a9d1
DM
12 bpf-firewall.c
13 bpf-firewall.h
5f8ba20d
JK
14 bpf-foreign.c
15 bpf-foreign.h
184b4f78
ILG
16 bpf-lsm.c
17 bpf-lsm.h
cd09a5f3
LP
18 bpf-socket-bind.c
19 bpf-socket-bind.h
b36672e0
DM
20 cgroup.c
21 cgroup.h
19d22d43
LP
22 core-varlink.c
23 core-varlink.h
b36672e0
DM
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
37efbbd8
ZJS
32 dbus-job.c
33 dbus-job.h
b36672e0
DM
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
37efbbd8
ZJS
44 dbus-service.c
45 dbus-service.h
b36672e0
DM
46 dbus-slice.c
47 dbus-slice.h
37efbbd8
ZJS
48 dbus-socket.c
49 dbus-socket.h
37efbbd8
ZJS
50 dbus-swap.c
51 dbus-swap.h
b36672e0
DM
52 dbus-target.c
53 dbus-target.h
37efbbd8
ZJS
54 dbus-timer.c
55 dbus-timer.h
b36672e0
DM
56 dbus-unit.c
57 dbus-unit.h
77019691
YW
58 dbus-util.c
59 dbus-util.h
b36672e0
DM
60 dbus.c
61 dbus.h
62 device.c
63 device.h
64 dynamic-user.c
65 dynamic-user.h
c18ecf03
LP
66 efi-random.c
67 efi-random.h
b36672e0
DM
68 emergency-action.c
69 emergency-action.h
70 execute.c
71 execute.h
385093b7
ZJS
72 generator-setup.c
73 generator-setup.h
37efbbd8
ZJS
74 ima-setup.c
75 ima-setup.h
b36672e0
DM
76 job.c
77 job.h
78 kill.c
79 kill.h
b36672e0
DM
80 kmod-setup.c
81 kmod-setup.h
82 load-dropin.c
83 load-dropin.h
84 load-fragment.c
85 load-fragment.h
37efbbd8 86 locale-setup.c
b36672e0 87 locale-setup.h
2a341bb9
ZJS
88 manager-dump.c
89 manager-dump.h
a01ba4b2
ZJS
90 manager-serialize.c
91 manager-serialize.h
cd09a5f3
LP
92 manager.c
93 manager.h
b36672e0
DM
94 mount.c
95 mount.h
37efbbd8
ZJS
96 namespace.c
97 namespace.h
b36672e0
DM
98 path.c
99 path.h
6f50d4f7
MV
100 restrict-ifaces.c
101 restrict-ifaces.h
b36672e0
DM
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
37efbbd8
ZJS
110 show-status.c
111 show-status.h
b36672e0
DM
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
15ed3c3a
LP
126 unit-dependency-atom.c
127 unit-dependency-atom.h
b36672e0
DM
128 unit-printf.c
129 unit-printf.h
2d3b784d
ZJS
130 unit-serialize.c
131 unit-serialize.h
b36672e0
DM
132 unit.c
133 unit.h
5c23128d
ZJS
134'''.split()
135
d40ce018
JH
136subdir('bpf')
137
09fc220c
JK
138subdir('bpf/socket_bind')
139if conf.get('BPF_FRAMEWORK') == 1
140 libcore_sources += [socket_bind_skel_h]
021d1e96
ILG
141 subdir('bpf/restrict_fs')
142 libcore_sources += [restrict_fs_skel_h]
09fc220c
JK
143endif
144
dc83b840
MV
145subdir('bpf/restrict_ifaces')
146if conf.get('BPF_FRAMEWORK') == 1
147 libcore_sources += [restrict_ifaces_skel_h]
148endif
149
5c23128d 150load_fragment_gperf_gperf = custom_target(
37efbbd8 151 'load-fragment-gperf.gperf',
997f52a5 152 input : 'load-fragment-gperf.gperf.in',
37efbbd8 153 output: 'load-fragment-gperf.gperf',
8f04a1ca 154 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'])
5c23128d
ZJS
155
156load_fragment_gperf_c = custom_target(
37efbbd8
ZJS
157 'load-fragment-gperf.c',
158 input : load_fragment_gperf_gperf,
159 output : 'load-fragment-gperf.c',
160 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
5c23128d
ZJS
161
162awkscript = 'load-fragment-gperf-nulstr.awk'
163load_fragment_gperf_nulstr_c = custom_target(
37efbbd8
ZJS
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)
5c23128d 169
a2b0cd3f 170libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
4287c855
ZJS
171
172libcore = shared_library(
173 libcore_name,
68d923d0 174 libcore_sources,
37efbbd8
ZJS
175 load_fragment_gperf_c,
176 load_fragment_gperf_nulstr_c,
177 include_directories : includes,
4287c855
ZJS
178 c_args : ['-fvisibility=default'],
179 link_args : ['-shared',
180 '-Wl,--version-script=' + libshared_sym_path],
181 link_with : libshared,
60722ad7
ZJS
182 dependencies : [versiondep,
183 threads,
c5fd89ad 184 libdl,
22ce84de 185 librt,
849c09c4 186 libseccomp,
37efbbd8
ZJS
187 libpam,
188 libaudit,
189 libkmod,
190 libapparmor,
22ce84de 191 libselinux,
bb0c0d6f 192 libmount,
4287c855 193 libblkid,
03f7ddf0 194 libacl],
4287c855
ZJS
195 install : true,
196 install_dir : rootlibexecdir)
5c23128d 197
8d40961c
YW
198core_includes = [includes, include_directories('.')]
199
898c9a6f
LP
200systemd_sources = files(
201 'main.c',
202 'main.h',
203 'crash-handler.c',
204 'crash-handler.h',
205)
5c23128d 206
e11a25ca
ZJS
207in_files = [['system.conf', pkgsysconfdir],
208 ['user.conf', pkgsysconfdir],
209 ['systemd.pc', pkgconfigdatadir],
210 ['org.freedesktop.systemd1.policy', polkitpolicydir]]
5c23128d
ZJS
211
212foreach item : in_files
37efbbd8
ZJS
213 file = item[0]
214 dir = item[1]
5c23128d 215
e11a25ca
ZJS
216 custom_target(
217 file,
218 input : file + '.in',
219 output: file,
8f04a1ca 220 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
679de141 221 install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
e11a25ca 222 install_dir : dir)
5c23128d
ZJS
223endforeach
224
225install_data('org.freedesktop.systemd1.conf',
226 install_dir : dbuspolicydir)
b895fa08
LP
227install_data('org.freedesktop.systemd1.service',
228 install_dir : dbussystemservicedir)
5c23128d 229
94e75a54
ZJS
230meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
231meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
232meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
233meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
234
d7aa78c3 235if install_sysconfdir
fce9abb2
ZJS
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'))
d7aa78c3 239endif
e025c9df
YW
240
241############################################################
242
243fuzzers += [
bbec46c8 244 [files('fuzz-unit-file.c'),
e025c9df
YW
245 [libcore,
246 libshared],
247 [libmount]],
248]