summaryrefslogtreecommitdiffstats
path: root/src/journal/meson.build
blob: 9f0e6995018d648583f47632a262d9faa36f170a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# SPDX-License-Identifier: LGPL-2.1-or-later

sources = files(
        'journald-audit.c',
        'journald-client.c',
        'journald-console.c',
        'journald-context.c',
        'journald-kmsg.c',
        'journald-native.c',
        'journald-rate-limit.c',
        'journald-server.c',
        'journald-stream.c',
        'journald-syslog.c',
        'journald-wall.c',
        'journald-socket.c',
)

sources += custom_target(
        'journald-gperf.c',
        input : 'journald-gperf.gperf',
        output : 'journald-gperf.c',
        command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])

libjournal_core = static_library(
        'journal-core',
        sources,
        include_directories : includes,
        dependencies: [threads,
                       userspace],
        build_by_default : false)

journalctl_sources = files(
        'journalctl.c',
        'journalctl-catalog.c',
        'journalctl-filter.c',
        'journalctl-misc.c',
        'journalctl-show.c',
        'journalctl-util.c',
        'journalctl-varlink.c',
)

if conf.get('HAVE_GCRYPT') == 1
        journalctl_sources += files('journalctl-authenticate.c')
endif

if get_option('link-journalctl-shared')
        journalctl_link_with = [libshared]
else
        journalctl_link_with = [
                libshared_static,
                libsystemd_static,
        ]
endif

journal_test_template = test_template + {
        'link_with' : [
                libjournal_core,
                libshared,
        ],
}

journal_fuzz_template = fuzz_template + {
        'link_with' : [
                libjournal_core,
                libshared,
        ],
        'dependencies' : libselinux,
}

executables += [
        libexec_template + {
                'name' : 'systemd-journald',
                'sources' : files('journald.c'),
                'link_with' : [
                        libjournal_core,
                        libshared,
                ],
                'dependencies' : [
                        liblz4_cflags,
                        libselinux,
                        libxz_cflags,
                        libzstd_cflags,
                        threads,
                ],
        },
        libexec_template + {
                'name' : 'systemd-bsod',
                'public' : true,
                'conditions' : ['HAVE_QRENCODE'],
                'sources' : files('bsod.c'),
                'link_with' : libshared,
                'dependencies' : libqrencode,
        },
        executable_template + {
                'name' : 'systemd-cat',
                'public' : true,
                'sources' : files('cat.c'),
                'link_with' : [
                        libjournal_core,
                        libshared,
                ],
                'dependencies' : threads,
        },
        executable_template + {
                'name' : 'journalctl',
                'public' : true,
                'sources' : journalctl_sources,
                'link_with' : journalctl_link_with,
                'dependencies' : [
                        libdl,
                        liblz4_cflags,
                        libxz_cflags,
                        libzstd_cflags,
                        threads,
                ],
        },
        journal_test_template + {
                'sources' : files('test-journald-config.c'),
                'dependencies' : [
                        liblz4_cflags,
                        libselinux,
                        libxz_cflags,
                ],
        },
        test_template + {
                'sources' : files(
                        'test-journald-rate-limit.c',
                        'journald-rate-limit.c',
                ),
        },
        journal_test_template + {
                'sources' : files('test-journald-syslog.c'),
                'dependencies' : [
                        liblz4_cflags,
                        libselinux,
                        libxz_cflags,
                        threads,
                ],
        },
        journal_test_template + {
                'sources' : files('test-journald-tables.c'),
                'dependencies' : [
                        libselinux,
                ],
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-audit.c',
                        'fuzz-journald.c',
                ),
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-kmsg.c',
                        'fuzz-journald.c',
                ),
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-native.c',
                        'fuzz-journald.c',
                ),
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-native-fd.c',
                        'fuzz-journald.c',
                ),
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-stream.c',
                        'fuzz-journald.c',
                ),
        },
        journal_fuzz_template + {
                'sources' : files(
                        'fuzz-journald-syslog.c',
                        'fuzz-journald.c',
                ),
        },
]

if install_sysconfdir_samples
        install_data('journald.conf',
                     install_dir : pkgconfigfiledir)
endif

if get_option('create-log-dirs')
        install_emptydir('/var/log/journal',
                         install_mode : 'rwxr-xr-x')
        if get_option('adm-group')
                meson.add_install_script(
                        sh, '-c',
                        'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
        endif
        if get_option('wheel-group')
                meson.add_install_script(
                        sh, '-c',
                        'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
        endif
endif