]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: move audit-type.[ch] and related generators to src/journal
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 2 Jul 2026 22:39:24 +0000 (07:39 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 3 Jul 2026 08:07:49 +0000 (17:07 +0900)
It is only used by systemd-journald and own unit test.

src/journal/audit-type.c [moved from src/libsystemd/sd-journal/audit-type.c with 100% similarity]
src/journal/audit-type.h [moved from src/libsystemd/sd-journal/audit-type.h with 100% similarity]
src/journal/audit_type-to-name.awk [moved from src/libsystemd/sd-journal/audit_type-to-name.awk with 100% similarity]
src/journal/generate-audit_type-list.sh [moved from src/libsystemd/sd-journal/generate-audit_type-list.sh with 100% similarity]
src/journal/meson.build
src/journal/test-audit-type.c [moved from src/libsystemd/sd-journal/test-audit-type.c with 100% similarity]
src/libsystemd/meson.build
src/libsystemd/sd-journal/meson.build [deleted file]

index e39381f03f63323924fc460486626ea1cd86e3ed..5ac4ae2cd077f98f46ca15cc5d6f992adb12147a 100644 (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' : [
index d1797722a42da58da7bee284d6237bf8ff2a1019..e393d7e86d860e559e0cf4b771ca45b82f33c5d2 100644 (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',
diff --git a/src/libsystemd/sd-journal/meson.build b/src/libsystemd/sd-journal/meson.build
deleted file mode 100644 (file)
index 61ddf66..0000000
+++ /dev/null
@@ -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)