tree-wide: Mark linux and sys includes as system includes

Even though these are in our tree, we should still treat them as
system includes which helps various tools (clangd, iwyu, ...) understand
that these are system includes and <> should be used instead of "".
This commit is contained in:
Daan De Meyer
2025-04-12 19:36:48 +02:00
parent 9fea5b4250
commit 44c2c9a036
91 changed files with 23 additions and 16 deletions

View File

@@ -32,23 +32,23 @@ The following exceptions apply:
* some sources under src/udev/ are licensed under **GPL-2.0-or-later**,
so all udev programs (`systemd-udevd`, `udevadm`, and the udev builtins
and test programs) are also distributed under **GPL-2.0-or-later**.
* the header files contained in src/basic/linux/ are copied
* the header files contained in src/basic/include/linux are copied
verbatim from the Linux kernel source tree and are licensed under **GPL-2.0 WITH
Linux-syscall-note** and are used within the scope of the Linux-syscall-note
exception provisions
* the following sources are licensed under the **LGPL-2.0-or-later** license:
- src/basic/utf8.c
- src/shared/initreq.h
* the src/basic/linux/bpf_insn.h header is copied from the Linux kernel
* the src/basic/include/linux/bpf_insn.h header is copied from the Linux kernel
source tree and is licensed under either **BSD-2-Clause** or **GPL-2.0-only**,
and thus is included in the systemd build under the BSD-2-Clause license.
* The src/basic/linux/wireguard.h header is copied from the Linux kernel
* The src/basic/include/linux/wireguard.h header is copied from the Linux kernel
source tree and is licensed under either **MIT** or **GPL-2.0 WITH Linux-syscall-note**,
and thus is included in the systemd build under the MIT license.
* the following sources are licensed under the **MIT** license (in case of our
scripts, to facilitate copying and reuse of those helpers to other projects):
- hwdb.d/parse_hwdb.py
- src/basic/linux/batman_adv.h
- src/basic/include/linux/batman_adv.h
- src/basic/sparse-endian.h
- tools/catalog-report.py
* the following sources are licensed under the **CC0-1.0** license:

View File

@@ -5,7 +5,7 @@ set -e
# Exclude following paths from the Coccinelle transformations
EXCLUDED_PATHS=(
"src/boot/efi/*"
"src/basic/linux/*"
"src/basic/include/linux/*"
# Symlinked to test-bus-vtable-cc.cc, which causes issues with the IN_SET macro
"src/libsystemd/sd-bus/test-bus-vtable.c"
"src/libsystemd/sd-journal/lookup3.c"

View File

@@ -2053,11 +2053,18 @@ boot_stubs = []
build_dir_include = include_directories('.')
basic_includes = include_directories(
'src/basic',
'src/fundamental',
'src/systemd',
'.')
basic_includes = [
include_directories(
'src/basic',
'src/fundamental',
'src/systemd',
'.',
),
include_directories(
'src/basic/include',
is_system : true,
),
]
libsystemd_includes = [basic_includes, include_directories(
'src/libsystemd/sd-bus',

View File

@@ -133,14 +133,14 @@ generate_arphrd_list = find_program('generate-arphrd-list.sh')
arphrd_list_txt = custom_target(
'arphrd-list.txt',
output : 'arphrd-list.txt',
command : [generate_arphrd_list, cpp, files('linux/if_arp.h'), config_h],
command : [generate_arphrd_list, cpp, files('include/linux/if_arp.h'), config_h],
capture : true)
generate_cap_list = find_program('generate-cap-list.sh')
cap_list_txt = custom_target(
'cap-list.txt',
output : 'cap-list.txt',
command : [generate_cap_list, cpp, files('linux/capability.h')],
command : [generate_cap_list, cpp, files('include/linux/capability.h')],
capture : true)
generate_errno_list = find_program('generate-errno-list.sh')
@@ -238,7 +238,7 @@ run_target(
############################################################
filesystem_includes = files(
'linux/magic.h',
'include/linux/magic.h',
'missing_magic.h',
)

View File

@@ -307,7 +307,7 @@ shared_sources += shared_generated_gperf_headers
fname = 'ethtool-link-mode.h'
ethtool_link_mode_h = custom_target(
fname,
input : ['ethtool-link-mode.py', '../basic/linux/ethtool.h'],
input : ['ethtool-link-mode.py', '../basic/include/linux/ethtool.h'],
output : fname,
command : [python, '@INPUT0@', '--header', cpp, '@INPUT1@'],
capture : true)
@@ -316,7 +316,7 @@ shared_sources += ethtool_link_mode_h
fname = 'ethtool-link-mode.xml'
ethtool_link_mode_xml = custom_target(
fname,
input : ['ethtool-link-mode.py', '../basic/linux/ethtool.h'],
input : ['ethtool-link-mode.py', '../basic/include/linux/ethtool.h'],
output : fname,
command : [python, '@INPUT0@', '--xml', cpp, '@INPUT1@'],
capture : true)

View File

@@ -65,7 +65,7 @@ endif
generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh')
keyboard_keys_list_txt = custom_target(
'keyboard-keys-list.txt',
input : files('../basic/linux/input.h'),
input : files('../basic/include/linux/input.h'),
output : 'keyboard-keys-list.txt',
command : [generate_keyboard_keys_list, cpp, '@INPUT@'],
capture : true)