]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/journal/meson.build
io.systemd.Unit.List fix context/runtime split (#38172)
[thirdparty/systemd.git] / src / journal / meson.build
1 # SPDX-License-Identifier: LGPL-2.1-or-later
2
3 systemd_journald_sources = files(
4 'journald.c',
5 )
6 systemd_journald_extract_sources = files(
7 'journald-audit.c',
8 'journald-client.c',
9 'journald-console.c',
10 'journald-context.c',
11 'journald-kmsg.c',
12 'journald-manager.c',
13 'journald-native.c',
14 'journald-rate-limit.c',
15 'journald-socket.c',
16 'journald-stream.c',
17 'journald-sync.c',
18 'journald-syslog.c',
19 'journald-varlink.c',
20 'journald-wall.c',
21 # Build fuzz-journald.c as part of systemd-journald so we only compile it once instead of once per
22 # fuzz test.
23 'fuzz-journald.c',
24 )
25
26 journald_gperf_c = custom_target(
27 input : 'journald-gperf.gperf',
28 output : 'journald-gperf.c',
29 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
30
31 generated_sources += journald_gperf_c
32 systemd_journald_extract_sources += journald_gperf_c
33
34 journalctl_sources = files(
35 'journalctl.c',
36 'journalctl-authenticate.c',
37 'journalctl-catalog.c',
38 'journalctl-filter.c',
39 'journalctl-misc.c',
40 'journalctl-show.c',
41 'journalctl-util.c',
42 'journalctl-varlink.c',
43 )
44
45 if get_option('link-journalctl-shared')
46 journalctl_link_with = [libshared]
47 else
48 journalctl_link_with = [
49 libshared_static,
50 libsystemd_static,
51 ]
52 endif
53
54 journal_test_template = test_template + {
55 'objects' : ['systemd-journald'],
56 }
57
58 journal_fuzz_template = fuzz_template + {
59 'objects' : ['systemd-journald'],
60 'dependencies' : libselinux,
61 }
62
63 executables += [
64 libexec_template + {
65 'name' : 'systemd-journald',
66 'sources' : systemd_journald_sources + systemd_journald_extract_sources,
67 'include_directories' : [libexec_template['include_directories'], include_directories('.')],
68 'extract' : systemd_journald_extract_sources,
69 'dependencies' : [
70 liblz4_cflags,
71 libselinux,
72 libxz_cflags,
73 libzstd_cflags,
74 threads,
75 ],
76 },
77 libexec_template + {
78 'name' : 'systemd-bsod',
79 'public' : true,
80 'conditions' : ['HAVE_QRENCODE'],
81 'sources' : files('bsod.c'),
82 'dependencies' : libqrencode,
83 },
84 executable_template + {
85 'name' : 'systemd-cat',
86 'public' : true,
87 'sources' : files('cat.c'),
88 'objects' : ['systemd-journald'],
89 'dependencies' : [libselinux, threads],
90 },
91 executable_template + {
92 'name' : 'journalctl',
93 'public' : true,
94 'sources' : journalctl_sources,
95 'link_with' : journalctl_link_with,
96 'dependencies' : [
97 libdl,
98 liblz4_cflags,
99 libxz_cflags,
100 libzstd_cflags,
101 threads,
102 ],
103 },
104 journal_test_template + {
105 'sources' : files('test-journald-config.c'),
106 'dependencies' : [
107 liblz4_cflags,
108 libselinux,
109 libxz_cflags,
110 ],
111 },
112 journal_test_template + {
113 'sources' : files('test-journald-rate-limit.c'),
114 'dependencies' : [
115 liblz4_cflags,
116 libselinux,
117 libxz_cflags,
118 ],
119 },
120 journal_test_template + {
121 'sources' : files('test-journald-syslog.c'),
122 'dependencies' : [
123 liblz4_cflags,
124 libselinux,
125 libxz_cflags,
126 threads,
127 ],
128 },
129 journal_test_template + {
130 'sources' : files('test-journald-tables.c'),
131 'dependencies' : [
132 libselinux,
133 ],
134 },
135 journal_fuzz_template + {
136 'sources' : files('fuzz-journald-audit.c'),
137 },
138 journal_fuzz_template + {
139 'sources' : files('fuzz-journald-kmsg.c'),
140 },
141 journal_fuzz_template + {
142 'sources' : files('fuzz-journald-native.c'),
143 },
144 journal_fuzz_template + {
145 'sources' : files('fuzz-journald-native-fd.c'),
146 },
147 journal_fuzz_template + {
148 'sources' : files('fuzz-journald-stream.c'),
149 },
150 journal_fuzz_template + {
151 'sources' : files('fuzz-journald-syslog.c'),
152 },
153 ]
154
155 if install_sysconfdir_samples
156 install_data('journald.conf',
157 install_dir : pkgconfigfiledir)
158 endif
159
160 if get_option('create-log-dirs')
161 install_emptydir('/var/log/journal',
162 install_mode : 'rwxr-xr-x')
163 if get_option('adm-group')
164 meson.add_install_script(
165 sh, '-c',
166 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
167 endif
168 if get_option('wheel-group')
169 meson.add_install_script(
170 sh, '-c',
171 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
172 endif
173 endif