]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/meson.build
Merge pull request #17549 from yuwata/tiny-fixes
[thirdparty/systemd.git] / src / core / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 libcore_shared_sources = '''
4 killall.c
5 killall.h
6 loopback-setup.c
7 loopback-setup.h
8 machine-id-setup.c
9 machine-id-setup.h
10 mount-setup.c
11 mount-setup.h
12 '''.split()
13
14 libcore_sources = '''
15 apparmor-setup.c
16 apparmor-setup.h
17 audit-fd.c
18 audit-fd.h
19 automount.c
20 automount.h
21 bpf-devices.c
22 bpf-devices.h
23 bpf-firewall.c
24 bpf-firewall.h
25 cgroup.c
26 cgroup.h
27 core-varlink.c
28 core-varlink.h
29 dbus-automount.c
30 dbus-automount.h
31 dbus-cgroup.c
32 dbus-cgroup.h
33 dbus-device.c
34 dbus-device.h
35 dbus-execute.c
36 dbus-execute.h
37 dbus-job.c
38 dbus-job.h
39 dbus-kill.c
40 dbus-kill.h
41 dbus-manager.c
42 dbus-manager.h
43 dbus-mount.c
44 dbus-mount.h
45 dbus-path.c
46 dbus-path.h
47 dbus-scope.c
48 dbus-scope.h
49 dbus-service.c
50 dbus-service.h
51 dbus-slice.c
52 dbus-slice.h
53 dbus-socket.c
54 dbus-socket.h
55 dbus-swap.c
56 dbus-swap.h
57 dbus-target.c
58 dbus-target.h
59 dbus-timer.c
60 dbus-timer.h
61 dbus-unit.c
62 dbus-unit.h
63 dbus-util.c
64 dbus-util.h
65 dbus.c
66 dbus.h
67 device.c
68 device.h
69 dynamic-user.c
70 dynamic-user.h
71 efi-random.c
72 efi-random.h
73 emergency-action.c
74 emergency-action.h
75 execute.c
76 execute.h
77 generator-setup.c
78 generator-setup.h
79 hostname-setup.c
80 hostname-setup.h
81 ima-setup.c
82 ima-setup.h
83 ip-address-access.c
84 ip-address-access.h
85 job.c
86 job.h
87 kill.c
88 kill.h
89 kmod-setup.c
90 kmod-setup.h
91 load-dropin.c
92 load-dropin.h
93 load-fragment.c
94 load-fragment.h
95 locale-setup.c
96 locale-setup.h
97 manager.c
98 manager.h
99 mount.c
100 mount.h
101 namespace.c
102 namespace.h
103 path.c
104 path.h
105 scope.c
106 scope.h
107 selinux-access.c
108 selinux-access.h
109 selinux-setup.c
110 selinux-setup.h
111 service.c
112 service.h
113 show-status.c
114 show-status.h
115 slice.c
116 slice.h
117 smack-setup.c
118 smack-setup.h
119 socket.c
120 socket.h
121 swap.c
122 swap.h
123 target.c
124 target.h
125 timer.c
126 timer.h
127 transaction.c
128 transaction.h
129 unit-printf.c
130 unit-printf.h
131 unit.c
132 unit.h
133 '''.split()
134
135 load_fragment_gperf_gperf = custom_target(
136 'load-fragment-gperf.gperf',
137 input : 'load-fragment-gperf.gperf.m4',
138 output: 'load-fragment-gperf.gperf',
139 command : [meson_apply_m4, config_h, '@INPUT@'],
140 capture : true)
141
142 load_fragment_gperf_c = custom_target(
143 'load-fragment-gperf.c',
144 input : load_fragment_gperf_gperf,
145 output : 'load-fragment-gperf.c',
146 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
147
148 awkscript = 'load-fragment-gperf-nulstr.awk'
149 load_fragment_gperf_nulstr_c = custom_target(
150 'load-fragment-gperf-nulstr.c',
151 input : [awkscript, load_fragment_gperf_gperf],
152 output : 'load-fragment-gperf-nulstr.c',
153 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
154 capture : true)
155
156 # A convenience library to share code with other binaries:
157 # systemd-shutdown, systemd-remount-fs, systemd-machine-id-setup, …
158 libcore_shared = static_library(
159 'core-shared',
160 libcore_shared_sources,
161 include_directories : includes,
162 dependencies : [versiondep,
163 libmount])
164
165 libcore = static_library(
166 'core',
167 libcore_sources,
168 load_fragment_gperf_c,
169 load_fragment_gperf_nulstr_c,
170 include_directories : includes,
171 link_whole : libcore_shared,
172 dependencies : [versiondep,
173 threads,
174 librt,
175 libseccomp,
176 libpam,
177 libaudit,
178 libkmod,
179 libapparmor,
180 libselinux,
181 libmount,
182 libacl])
183
184 systemd_sources = files('main.c')
185
186 in_files = [['macros.systemd', rpmmacrosdir],
187 ['system.conf', pkgsysconfdir],
188 ['user.conf', pkgsysconfdir],
189 ['systemd.pc', pkgconfigdatadir],
190 ['triggers.systemd', '']]
191
192 foreach item : in_files
193 file = item[0]
194 dir = item[1]
195
196 configure_file(
197 input : file + '.in',
198 output : file,
199 configuration : substs,
200 install_dir : dir == 'no' ? '' : dir)
201 endforeach
202
203 install_data('org.freedesktop.systemd1.conf',
204 install_dir : dbuspolicydir)
205 install_data('org.freedesktop.systemd1.service',
206 install_dir : dbussystemservicedir)
207
208 policy = configure_file(
209 input : 'org.freedesktop.systemd1.policy.in',
210 output : 'org.freedesktop.systemd1.policy',
211 configuration : substs)
212 install_data(policy,
213 install_dir : polkitpolicydir)
214
215 meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
216 meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
217 meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
218 meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
219
220 meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(pkgsysconfdir, 'system')))
221 meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(pkgsysconfdir, 'user')))
222 meson.add_install_script('sh', '-c', mkdir_p.format(join_paths(sysconfdir, 'xdg/systemd')))