]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/meson.build
meson: Use dicts for test definitions
[thirdparty/systemd.git] / src / core / meson.build
CommitLineData
db9ecf05 1# SPDX-License-Identifier: LGPL-2.1-or-later
3a726fcd 2
386b8026
ZJS
3libcore_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',
386b8026 10 'bpf-lsm.c',
386b8026 11 'bpf-socket-bind.c',
386b8026 12 'cgroup.c',
386b8026 13 'core-varlink.c',
386b8026 14 'dbus-automount.c',
386b8026 15 'dbus-cgroup.c',
386b8026 16 'dbus-device.c',
386b8026 17 'dbus-execute.c',
386b8026 18 'dbus-job.c',
386b8026 19 'dbus-kill.c',
386b8026 20 'dbus-manager.c',
386b8026 21 'dbus-mount.c',
386b8026 22 'dbus-path.c',
386b8026 23 'dbus-scope.c',
386b8026 24 'dbus-service.c',
386b8026 25 'dbus-slice.c',
386b8026 26 'dbus-socket.c',
386b8026 27 'dbus-swap.c',
386b8026 28 'dbus-target.c',
386b8026 29 'dbus-timer.c',
386b8026 30 'dbus-unit.c',
386b8026 31 'dbus-util.c',
386b8026 32 'dbus.c',
386b8026 33 'device.c',
386b8026 34 'dynamic-user.c',
386b8026 35 'efi-random.c',
386b8026 36 'emergency-action.c',
386b8026 37 'execute.c',
386b8026 38 'generator-setup.c',
386b8026 39 'ima-setup.c',
386b8026 40 'import-creds.c',
386b8026 41 'job.c',
386b8026 42 'kill.c',
386b8026 43 'kmod-setup.c',
386b8026 44 'load-dropin.c',
386b8026 45 'load-fragment.c',
386b8026 46 'manager-dump.c',
386b8026 47 'manager-serialize.c',
386b8026 48 'manager.c',
386b8026 49 'mount.c',
386b8026 50 'namespace.c',
386b8026 51 'path.c',
386b8026 52 'restrict-ifaces.c',
386b8026 53 'scope.c',
386b8026 54 'selinux-access.c',
386b8026 55 'selinux-setup.c',
386b8026 56 'service.c',
386b8026 57 'show-status.c',
386b8026 58 'slice.c',
386b8026 59 'smack-setup.c',
386b8026 60 'socket.c',
386b8026 61 'swap.c',
386b8026 62 'target.c',
386b8026 63 'timer.c',
386b8026 64 'transaction.c',
386b8026 65 'unit-dependency-atom.c',
386b8026 66 'unit-printf.c',
386b8026 67 'unit-serialize.c',
386b8026 68 'unit.c',
386b8026 69)
5c23128d 70
bb0b01ed
ZJS
71if conf.get('BPF_FRAMEWORK') == 1
72 libcore_sources += files(
73 'bpf-util.c',
bb0b01ed
ZJS
74 )
75endif
76
d40ce018
JH
77subdir('bpf')
78
09fc220c
JK
79subdir('bpf/socket_bind')
80if conf.get('BPF_FRAMEWORK') == 1
81 libcore_sources += [socket_bind_skel_h]
021d1e96
ILG
82 subdir('bpf/restrict_fs')
83 libcore_sources += [restrict_fs_skel_h]
09fc220c
JK
84endif
85
dc83b840
MV
86subdir('bpf/restrict_ifaces')
87if conf.get('BPF_FRAMEWORK') == 1
88 libcore_sources += [restrict_ifaces_skel_h]
89endif
90
5c23128d 91load_fragment_gperf_gperf = custom_target(
37efbbd8 92 'load-fragment-gperf.gperf',
997f52a5 93 input : 'load-fragment-gperf.gperf.in',
37efbbd8 94 output: 'load-fragment-gperf.gperf',
8f04a1ca 95 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'])
5c23128d
ZJS
96
97load_fragment_gperf_c = custom_target(
37efbbd8
ZJS
98 'load-fragment-gperf.c',
99 input : load_fragment_gperf_gperf,
100 output : 'load-fragment-gperf.c',
101 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
5c23128d
ZJS
102
103awkscript = 'load-fragment-gperf-nulstr.awk'
104load_fragment_gperf_nulstr_c = custom_target(
37efbbd8
ZJS
105 'load-fragment-gperf-nulstr.c',
106 input : [awkscript, load_fragment_gperf_gperf],
107 output : 'load-fragment-gperf-nulstr.c',
108 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
109 capture : true)
5c23128d 110
a2b0cd3f 111libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
4287c855
ZJS
112
113libcore = shared_library(
114 libcore_name,
68d923d0 115 libcore_sources,
37efbbd8
ZJS
116 load_fragment_gperf_c,
117 load_fragment_gperf_nulstr_c,
118 include_directories : includes,
4287c855
ZJS
119 c_args : ['-fvisibility=default'],
120 link_args : ['-shared',
121 '-Wl,--version-script=' + libshared_sym_path],
122 link_with : libshared,
60722ad7
ZJS
123 dependencies : [versiondep,
124 threads,
c5fd89ad 125 libdl,
22ce84de 126 librt,
849c09c4 127 libseccomp,
37efbbd8
ZJS
128 libpam,
129 libaudit,
130 libkmod,
131 libapparmor,
22ce84de 132 libselinux,
bb0c0d6f 133 libmount,
4287c855 134 libblkid,
03f7ddf0 135 libacl],
4287c855 136 install : true,
5fb22561 137 install_dir : rootpkglibdir)
5c23128d 138
8d40961c
YW
139core_includes = [includes, include_directories('.')]
140
898c9a6f
LP
141systemd_sources = files(
142 'main.c',
898c9a6f 143 'crash-handler.c',
898c9a6f 144)
5c23128d 145
e11a25ca
ZJS
146in_files = [['system.conf', pkgsysconfdir],
147 ['user.conf', pkgsysconfdir],
148 ['systemd.pc', pkgconfigdatadir],
149 ['org.freedesktop.systemd1.policy', polkitpolicydir]]
5c23128d
ZJS
150
151foreach item : in_files
37efbbd8
ZJS
152 file = item[0]
153 dir = item[1]
5c23128d 154
e11a25ca
ZJS
155 custom_target(
156 file,
157 input : file + '.in',
158 output: file,
8f04a1ca 159 command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
679de141 160 install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
e11a25ca 161 install_dir : dir)
5c23128d
ZJS
162endforeach
163
164install_data('org.freedesktop.systemd1.conf',
165 install_dir : dbuspolicydir)
b895fa08
LP
166install_data('org.freedesktop.systemd1.service',
167 install_dir : dbussystemservicedir)
5c23128d 168
94e75a54
ZJS
169meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
170meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
171meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))
172meson.add_install_script('sh', '-c', mkdir_p.format(usergeneratordir))
173
d7aa78c3 174if install_sysconfdir
fce9abb2
ZJS
175 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'system'))
176 meson.add_install_script('sh', '-c', mkdir_p.format(pkgsysconfdir / 'user'))
177 meson.add_install_script('sh', '-c', mkdir_p.format(sysconfdir / 'xdg/systemd'))
d7aa78c3 178endif
e025c9df
YW
179
180############################################################
181
822cd3ff
JJ
182test_core_base = {
183 'link_with' : [libcore, libshared],
184 'includes' : core_includes,
185}
186
e025c9df 187fuzzers += [
bbec46c8 188 [files('fuzz-unit-file.c'),
e025c9df
YW
189 [libcore,
190 libshared],
191 [libmount]],
192]