]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/journal/meson.build
db4d598e720fe14277b49b6fb0666425063b4a86
[thirdparty/systemd.git] / src / journal / meson.build
1 # SPDX-License-Identifier: LGPL-2.1+
2 #
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
4 #
5 # systemd is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9 #
10 # systemd is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
17
18 journal_client_sources = files('''
19 audit-type.c
20 audit-type.h
21 catalog.c
22 catalog.h
23 compress.c
24 compress.h
25 journal-def.h
26 journal-file.c
27 journal-file.h
28 journal-send.c
29 journal-vacuum.c
30 journal-vacuum.h
31 journal-verify.c
32 journal-verify.h
33 lookup3.c
34 lookup3.h
35 mmap-cache.c
36 mmap-cache.h
37 sd-journal.c
38 '''.split())
39
40 if conf.get('HAVE_GCRYPT') == 1
41 journal_client_sources += files('''
42 journal-authenticate.c
43 journal-authenticate.h
44 fsprg.c
45 fsprg.h
46 '''.split())
47 endif
48
49 ############################################################
50
51 audit_type_includes = [config_h,
52 missing_h,
53 'linux/audit.h']
54 if conf.get('HAVE_AUDIT') == 1
55 audit_type_includes += 'libaudit.h'
56 endif
57
58 generate_audit_type_list = find_program('generate-audit_type-list.sh')
59 audit_type_list_txt = custom_target(
60 'audit_type-list.txt',
61 output : 'audit_type-list.txt',
62 command : [generate_audit_type_list, cpp] + audit_type_includes,
63 capture : true)
64
65 audit_type_to_name = custom_target(
66 'audit_type-to-name.h',
67 input : ['audit_type-to-name.awk', audit_type_list_txt],
68 output : 'audit_type-to-name.h',
69 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
70 capture : true)
71
72 journal_client_sources += [audit_type_to_name]
73
74 libjournal_client = static_library(
75 'journal-client',
76 journal_client_sources,
77 include_directories : includes,
78 c_args : ['-fvisibility=default'])
79
80 ############################################################
81
82 libjournal_core_sources = files('''
83 journald-audit.c
84 journald-audit.h
85 journald-console.c
86 journald-console.h
87 journald-context.c
88 journald-context.h
89 journald-kmsg.c
90 journald-kmsg.h
91 journald-native.c
92 journald-native.h
93 journald-rate-limit.c
94 journald-rate-limit.h
95 journald-server.c
96 journald-server.h
97 journald-stream.c
98 journald-stream.h
99 journald-syslog.c
100 journald-syslog.h
101 journald-wall.c
102 journald-wall.h
103 journal-internal.h
104 '''.split())
105
106 systemd_journald_sources = files('''
107 journald.c
108 journald-server.h
109 '''.split())
110
111 journald_gperf_c = custom_target(
112 'journald-gperf.c',
113 input : 'journald-gperf.gperf',
114 output : 'journald-gperf.c',
115 command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
116
117 systemd_cat_sources = files('cat.c')
118
119 journalctl_sources = files('journalctl.c')
120
121 if conf.get('HAVE_QRENCODE') == 1
122 journalctl_sources += files('journal-qrcode.c',
123 'journal-qrcode.h')
124 endif
125
126 install_data('journald.conf',
127 install_dir : pkgsysconfdir)
128
129 meson.add_install_script(
130 'sh', '-c',
131 mkdir_p.format('/var/log/journal'))
132 meson.add_install_script(
133 'sh', '-c',
134 '''chown 0:0 $DESTDIR/var/log/journal &&
135 chmod 755 $DESTDIR/var/log/journal || :''')
136 if get_option('adm-group')
137 meson.add_install_script(
138 'sh', '-c',
139 'setfacl -nm g:adm:rx,d:g:adm:rx $DESTDIR/var/log/journal || :')
140 endif
141 if get_option('wheel-group')
142 meson.add_install_script(
143 'sh', '-c',
144 'setfacl -nm g:wheel:rx,d:g:wheel:rx $DESTDIR/var/log/journal || :')
145 endif