journal: move audit-type.[ch] and related generators to src/journal

It is only used by systemd-journald and own unit test.
This commit is contained in:
Yu Watanabe
2026-07-03 17:07:49 +09:00
parent d04fbcf956
commit 193749a52e
8 changed files with 20 additions and 33 deletions
+20
View File
@@ -4,6 +4,7 @@ systemd_journald_sources = files(
'journald.c',
)
systemd_journald_extract_sources = files(
'audit-type.c',
'journald-audit.c',
'journald-client.c',
'journald-config.c',
@@ -29,6 +30,22 @@ journald_gperf_c = custom_target(
generated_sources += journald_gperf_c
systemd_journald_extract_sources += journald_gperf_c
generate_audit_type_list = files('generate-audit_type-list.sh')
audit_type_list_txt = custom_target(
input : [generate_audit_type_list, audit_sources],
output : 'audit_type-list.txt',
command : [env, 'bash', generate_audit_type_list, cpp, system_include_args],
capture : true)
audit_type_to_name = custom_target(
input : ['audit_type-to-name.awk', audit_type_list_txt],
output : 'audit_type-to-name.inc',
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
generated_sources += audit_type_to_name
systemd_journald_extract_sources += audit_type_to_name
journalctl_sources = files(
'journalctl.c',
'journalctl-authenticate.c',
@@ -99,6 +116,9 @@ executables += [
libzstd_cflags,
],
},
journal_test_template + {
'sources' : files('test-audit-type.c'),
},
journal_test_template + {
'sources' : files('test-journald-config.c'),
'dependencies' : [
-7
View File
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
sd_journal_sources = files(
'sd-journal/audit-type.c',
'sd-journal/catalog.c',
'sd-journal/journal-authenticate-internal.c',
'sd-journal/journal-file.c',
@@ -13,11 +12,6 @@ sd_journal_sources = files(
'sd-journal/sd-journal.c',
)
subdir('sd-journal')
generated_sources += audit_type_to_name
sd_journal_sources += audit_type_to_name
############################################################
sd_id128_sources = files(
@@ -197,7 +191,6 @@ simple_tests += files(
'sd-future/test-fiber-ops.c',
'sd-hwdb/test-sd-hwdb.c',
'sd-id128/test-id128.c',
'sd-journal/test-audit-type.c',
'sd-journal/test-catalog.c',
'sd-journal/test-journal-file.c',
'sd-journal/test-journal-flush.c',
-26
View File
@@ -1,26 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# We're generating a header file here intended to be included
# by audit-type.c. To make that work, we have to add the generated
# header file's directory to the include directories for libsystemd.
# In meson, adding include directories is done via include_directories(),
# which always adds two include directories for each argument, one relative to
# the source directory and one relative to the build directory. We don't
# want to add src/libsystemd to the include directories, yet custom_target()
# does not allow path segments in its output argument, so to make sure the
# generated header is written to src/libsystemd/sd-journal in the build directory,
# the custom_target() has to be defined here in src/libsystemd/sd-journal
# in the source directory.
generate_audit_type_list = files('generate-audit_type-list.sh')
audit_type_list_txt = custom_target(
input : [generate_audit_type_list, audit_sources],
output : 'audit_type-list.txt',
command : [env, 'bash', generate_audit_type_list, cpp, system_include_args],
capture : true)
audit_type_to_name = custom_target(
input : ['audit_type-to-name.awk', audit_type_list_txt],
output : 'audit_type-to-name.inc',
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)