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