# SPDX-License-Identifier: LGPL-2.1+
project('systemd', 'c',
- version : '241',
+ version : '242',
license : 'LGPLv2+',
default_options: [
'c_std=gnu99',
meson_version : '>= 0.46',
)
-libsystemd_version = '0.25.0'
-libudev_version = '1.6.13'
+libsystemd_version = '0.26.0'
+libudev_version = '1.6.14'
# We need the same data in two different formats, ugh!
# Also, for hysterical reasons, we use different variable
substs.set('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
substs.set('PROJECT_VERSION', meson.project_version())
+# This is to be used instead of meson.source_root(), as the latter will return
+# the wrong result when systemd is being built as a meson subproject
+project_source_root = meson.current_source_dir()
+
want_ossfuzz = get_option('oss-fuzz')
want_libfuzzer = get_option('llvm-fuzz')
if want_ossfuzz and want_libfuzzer
#####################################################################
# Try to install the git pre-commit hook
-git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
+git_hook = run_command(join_paths(project_source_root, 'tools/add-git-hook.sh'))
if git_hook.returncode() == 0
message(git_hook.stdout().strip())
endif
if rootprefixdir == ''
rootprefixdir = rootprefix_default
endif
+rootprefixdir_noslash = rootprefixdir == '/' ? '' : rootprefixdir
sysvinit_path = get_option('sysvinit-path')
sysvrcnd_path = get_option('sysvrcnd-path')
conf.set10('BUMP_PROC_SYS_FS_NR_OPEN', get_option('bump-proc-sys-fs-nr-open'))
conf.set('HIGH_RLIMIT_NOFILE', 512*1024)
-# join_paths ignore the preceding arguments if an absolute component is
+# join_paths ignores the preceding arguments if an absolute component is
# encountered, so this should canonicalize various paths when they are
# absolute or relative.
prefixdir = get_option('prefix')
systemunitdir = join_paths(rootprefixdir, 'lib/systemd/system')
systempresetdir = join_paths(rootprefixdir, 'lib/systemd/system-preset')
udevlibexecdir = join_paths(rootprefixdir, 'lib/udev')
-udevhomedir = udevlibexecdir
udevrulesdir = join_paths(udevlibexecdir, 'rules.d')
udevhwdbdir = join_paths(udevlibexecdir, 'hwdb.d')
catalogdir = join_paths(prefixdir, 'lib/systemd/catalog')
conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
substs.set('prefix', prefixdir)
+substs.set('rootprefix', rootprefixdir)
+substs.set('rootprefix_noslash', rootprefixdir_noslash)
substs.set('exec_prefix', prefixdir)
substs.set('libdir', libdir)
substs.set('rootlibdir', rootlibdir)
substs.set('includedir', includedir)
-substs.set('pkgsysconfdir', pkgsysconfdir)
+substs.set('sysconfdir', sysconfdir)
substs.set('bindir', bindir)
substs.set('rootbindir', rootbindir)
substs.set('rootlibexecdir', rootlibexecdir)
'-Wno-missing-field-initializers',
'-Wno-unused-result',
'-Wno-format-signedness',
+ '-Wno-error=#warnings', # clang
+ '-Wno-string-plus-int', # clang
# work-around for gcc 7.1 turning this on on its own.
'-Wno-error=nonnull',
possible_link_flags += '-Wl,--gc-sections'
endif
+if get_option('b_ndebug') == 'true'
+ # With asserts disabled with get a bunch of warnings about variables which
+ # are used only in the asserts. This is not useful at all, so let's just silence
+ # those warnings.
+ possible_cc_flags += [
+ '-Wno-unused-variable',
+ '-Wno-unused-but-set-variable',
+ ]
+endif
+
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
decl_headers = '''
#include <uchar.h>
-#include <linux/ethtool.h>
-#include <linux/fib_rules.h>
#include <sys/stat.h>
'''
foreach decl : ['char16_t',
'char32_t',
- 'struct fib_rule_uid_range',
- 'struct fib_rule_port_range',
'struct statx',
]
conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h)
-foreach decl : [['ETHTOOL_LINK_MODE_10baseT_Half_BIT', 'linux/ethtool.h'],
- ['ETHTOOL_LINK_MODE_25000baseCR_Full_BIT', 'linux/ethtool.h'],
- ['ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT', 'linux/ethtool.h'],
- ['ETHTOOL_LINK_MODE_1000baseX_Full_BIT', 'linux/ethtool.h'],
- ['ETHTOOL_LINK_MODE_2500baseT_Full_BIT', 'linux/ethtool.h'],
- ['ETHTOOL_LINK_MODE_FEC_NONE_BIT', 'linux/ethtool.h'],
- ['FRA_TUN_ID', 'linux/fib_rules.h'],
- ['FRA_SUPPRESS_PREFIXLEN', 'linux/fib_rules.h'],
- ['FRA_PAD', 'linux/fib_rules.h'],
- ['FRA_L3MDEV', 'linux/fib_rules.h'],
- ['FRA_UID_RANGE', 'linux/fib_rules.h'],
- ['FRA_DPORT_RANGE', 'linux/fib_rules.h'],
- ['FOU_ATTR_REMCSUM_NOPARTIAL', 'linux/fou.h'],
- ['FOU_CMD_GET', 'linux/fou.h'],
- ['IFA_FLAGS', 'linux/if_addr.h'],
- ['IFLA_BRIDGE_VLAN_TUNNEL_INFO', 'linux/if_bridge.h'],
- ['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
- ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
- ['IN6_ADDR_GEN_MODE_RANDOM', 'linux/if_link.h'],
- ['IFLA_IPVLAN_MODE', 'linux/if_link.h'],
- ['IPVLAN_MODE_L3S', 'linux/if_link.h'],
- ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'],
- ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'],
- ['IFLA_CARRIER_CHANGES', 'linux/if_link.h'],
- ['IFLA_PHYS_SWITCH_ID', 'linux/if_link.h'],
- ['IFLA_LINK_NETNSID', 'linux/if_link.h'],
- ['IFLA_PHYS_PORT_NAME', 'linux/if_link.h'],
- ['IFLA_PROTO_DOWN', 'linux/if_link.h'],
- ['IFLA_GSO_MAX_SIZE', 'linux/if_link.h'],
- ['IFLA_PAD', 'linux/if_link.h'],
- ['IFLA_XDP', 'linux/if_link.h'],
- ['IFLA_EVENT', 'linux/if_link.h'],
- ['IFLA_IF_NETNSID', 'linux/if_link.h'],
- ['IFLA_TARGET_NETNSID', 'linux/if_link.h'],
- ['IFLA_NEW_IFINDEX', 'linux/if_link.h'],
- ['IFLA_MAX_MTU', 'linux/if_link.h'],
- ['IFLA_BOND_MODE', 'linux/if_link.h'],
- ['IFLA_BOND_ACTIVE_SLAVE', 'linux/if_link.h'],
- ['IFLA_BOND_AD_INFO', 'linux/if_link.h'],
- ['IFLA_BOND_AD_ACTOR_SYSTEM', 'linux/if_link.h'],
- ['IFLA_BOND_TLB_DYNAMIC_LB', 'linux/if_link.h'],
- ['IFLA_VXLAN_UDP_ZERO_CSUM6_RX', 'linux/if_link.h'],
- ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'],
- ['IFLA_VXLAN_COLLECT_METADATA', 'linux/if_link.h'],
- ['IFLA_VXLAN_LABEL', 'linux/if_link.h'],
- ['IFLA_VXLAN_GPE', 'linux/if_link.h'],
- ['IFLA_VXLAN_TTL_INHERIT', 'linux/if_link.h'],
- ['IFLA_GENEVE_TOS', 'linux/if_link.h'],
- ['IFLA_GENEVE_COLLECT_METADATA', 'linux/if_link.h'],
- ['IFLA_GENEVE_REMOTE6', 'linux/if_link.h'],
- ['IFLA_GENEVE_UDP_ZERO_CSUM6_RX', 'linux/if_link.h'],
- ['IFLA_GENEVE_LABEL', 'linux/if_link.h'],
- ['IFLA_GENEVE_TTL_INHERIT', 'linux/if_link.h'],
- ['IFLA_BR_MAX_AGE', 'linux/if_link.h'],
- ['IFLA_BR_PRIORITY', 'linux/if_link.h'],
- ['IFLA_BR_VLAN_PROTOCOL', 'linux/if_link.h'],
- ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'],
- ['IFLA_BR_VLAN_STATS_ENABLED', 'linux/if_link.h'],
- ['IFLA_BR_MCAST_STATS_ENABLED', 'linux/if_link.h'],
- ['IFLA_BR_MCAST_MLD_VERSION', 'linux/if_link.h'],
- ['IFLA_BR_VLAN_STATS_PER_PORT', 'linux/if_link.h'],
- ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'],
- ['IFLA_BRPORT_PROXYARP_WIFI', 'linux/if_link.h'],
- ['IFLA_BRPORT_MULTICAST_ROUTER', 'linux/if_link.h'],
- ['IFLA_BRPORT_PAD', 'linux/if_link.h'],
- ['IFLA_BRPORT_MCAST_FLOOD', 'linux/if_link.h'],
- ['IFLA_BRPORT_VLAN_TUNNEL', 'linux/if_link.h'],
- ['IFLA_BRPORT_BCAST_FLOOD', 'linux/if_link.h'],
- ['IFLA_BRPORT_NEIGH_SUPPRESS', 'linux/if_link.h'],
- ['IFLA_BRPORT_ISOLATED', 'linux/if_link.h'],
- ['IFLA_BRPORT_BACKUP_PORT', 'linux/if_link.h'],
- ['IFLA_VRF_TABLE', 'linux/if_link.h'],
- # if_tunnel.h is buggy and cannot be included on its own
- ['IFLA_VTI_FWMARK', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_IPTUN_COLLECT_METADATA', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_IPTUN_FWMARK', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_COLLECT_METADATA', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_IGNORE_DF', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_FWMARK', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_ERSPAN_INDEX', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['IFLA_GRE_ERSPAN_HWID', 'linux/if_tunnel.h', '#include <net/if.h>'],
- ['LO_FLAGS_PARTSCAN', 'linux/loop.h'],
- ]
- prefix = decl.length() > 2 ? decl[2] : ''
- have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix)
- conf.set10('HAVE_' + decl[0], have)
-endforeach
-
foreach ident : ['secure_getenv', '__secure_getenv']
conf.set10('HAVE_' + ident.to_upper(), cc.has_function(ident))
endforeach
#####################################################################
-vcs_tagger = [meson.source_root() + '/tools/meson-vcs-tag.sh',
- meson.source_root(),
+vcs_tagger = [project_source_root + '/tools/meson-vcs-tag.sh',
+ project_source_root,
get_option('version-tag'),
meson.project_version()]
env = find_program('env')
perl = find_program('perl', required : false)
-meson_make_symlink = meson.source_root() + '/tools/meson-make-symlink.sh'
+meson_make_symlink = project_source_root + '/tools/meson-make-symlink.sh'
mkdir_p = 'mkdir -p $DESTDIR/@0@'
test_efi_create_disk_sh = find_program('test/test-efi-create-disk.sh')
splash_bmp = files('test/splash.bmp')
error('POSIX caps headers not found')
endif
foreach header : ['crypt.h',
- 'linux/btrfs_tree.h',
- 'linux/fou.h',
'linux/memfd.h',
'linux/vm_sockets.h',
- 'linux/can/vxcan.h',
'sys/auxv.h',
'valgrind/memcheck.h',
'valgrind/valgrind.h',
dev_kvm_mode = get_option('dev-kvm-mode')
substs.set('DEV_KVM_MODE', dev_kvm_mode)
conf.set10('DEV_KVM_UACCESS', dev_kvm_mode != '0666')
-substs.set('GROUP_RENDER_MODE', get_option('group-render-mode'))
+group_render_mode = get_option('group-render-mode')
+substs.set('GROUP_RENDER_MODE', group_render_mode)
+conf.set10('GROUP_RENDER_UACCESS', group_render_mode != '0666')
kill_user_processes = get_option('default-kill-user-processes')
conf.set10('KILL_USER_PROCESSES', kill_user_processes)
'src/udev',
'src/libudev',
'src/core',
+ 'src/shutdown',
'src/libsystemd/sd-bus',
'src/libsystemd/sd-device',
'src/libsystemd/sd-event',
include_directories : includes,
install : false)
-libsystemd_sym_path = '@0@/@1@'.format(meson.current_source_dir(), libsystemd_sym)
+libsystemd_sym_path = '@0@/@1@'.format(project_source_root, libsystemd_sym)
libsystemd = shared_library(
'systemd',
disable_mempool_c,
subdir('src/libudev')
subdir('src/shared')
subdir('src/core')
+subdir('src/shutdown')
subdir('src/udev')
subdir('src/network')
module = tuple[0]
sym = 'src/nss-@0@/nss-@0@.sym'.format(module)
- version_script_arg = join_paths(meson.source_root(), sym)
+ version_script_arg = join_paths(project_source_root, sym)
nss = shared_library(
'nss_' + module,
# Note that we link NSS modules with '-z nodelete' so that mempools never get orphaned
link_args : ['-Wl,-z,nodelete',
'-shared',
- '-Wl,--version-script=' + version_script_arg,
- '-Wl,--undefined'],
+ '-Wl,--version-script=' + version_script_arg],
link_with : [libsystemd_static,
libbasic],
dependencies : [threads,
include_directories : includes,
link_with : [libcore,
libshared],
- dependencies : [threads,
+ dependencies : [versiondep,
+ threads,
librt,
libseccomp,
libselinux,
include_directories : includes,
link_with : [libcore,
libshared],
- dependencies : [threads,
+ dependencies : [versiondep,
+ threads,
librt,
libseccomp,
libselinux,
executable('systemd-fstab-generator',
'src/fstab-generator/fstab-generator.c',
- 'src/core/mount-setup.c',
include_directories : includes,
- link_with : [libshared],
+ link_with : [libcore_shared,
+ libshared],
install_rpath : rootlibexecdir,
install : true,
install_dir : systemgeneratordir)
public_programs += exe
if conf.get('HAVE_PAM') == 1
- version_script_arg = join_paths(meson.source_root(), pam_systemd_sym)
+ version_script_arg = join_paths(project_source_root, pam_systemd_sym)
pam_systemd = shared_library(
'pam_systemd',
pam_systemd_c,
libbasic_gcrypt]
endif
-exe = executable('systemctl', 'src/systemctl/systemctl.c',
+exe = executable('systemctl',
+ 'src/systemctl/systemctl.c',
+ 'src/systemctl/sysv-compat.h',
+ 'src/systemctl/sysv-compat.c',
include_directories : includes,
link_with : systemctl_link_with,
dependencies : [threads,
systemd_pull_sources,
include_directories : includes,
link_with : [libshared],
- dependencies : [libcurl,
+ dependencies : [versiondep,
+ libcurl,
libz,
libbzip2,
libxz,
systemd_journal_upload_sources,
include_directories : includes,
link_with : [libshared],
- dependencies : [threads,
+ dependencies : [versiondep,
+ threads,
libcurl,
libgnutls,
libxz,
executable('systemd-remount-fs',
'src/remount-fs/remount-fs.c',
- 'src/core/mount-setup.c',
- 'src/core/mount-setup.h',
include_directories : includes,
- link_with : [libshared],
+ link_with : [libcore_shared,
+ libshared],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootlibexecdir)
executable('systemd-machine-id-setup',
'src/machine-id-setup/machine-id-setup-main.c',
- 'src/core/machine-id-setup.c',
- 'src/core/machine-id-setup.h',
include_directories : includes,
- link_with : [libshared],
+ link_with : [libcore_shared,
+ libshared],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootbindir)
'src/stdio-bridge/stdio-bridge.c',
include_directories : includes,
link_with : [libshared],
+ dependencies : [versiondep],
install_rpath : rootlibexecdir,
install : true)
public_programs += exe
link_with : [libudev_core,
libsystemd_network,
libudev_static],
- dependencies : [threads,
+ dependencies : [versiondep,
+ threads,
libkmod,
libidn,
libacl,
link_with : [libudev_core,
libsystemd_network,
libudev_static],
- dependencies : [threads,
+ dependencies : [versiondep,
+ threads,
libkmod,
libidn,
libacl,
executable('systemd-shutdown',
systemd_shutdown_sources,
include_directories : includes,
- link_with : [libshared],
+ link_with : [libcore_shared,
+ libshared],
dependencies : [libmount],
install_rpath : rootlibexecdir,
install : true,
exe = executable('systemd-nspawn',
systemd_nspawn_sources,
- 'src/core/mount-setup.c', # FIXME: use a variable?
- 'src/core/mount-setup.h',
- 'src/core/loopback-setup.c',
- 'src/core/loopback-setup.h',
include_directories : includes,
- link_with : [libnspawn_core,
+ link_with : [libcore_shared,
+ libnspawn_core,
libshared],
- dependencies : [libblkid],
+ dependencies : [libblkid,
+ libseccomp],
install_rpath : rootlibexecdir,
install : true)
public_programs += exe
'systemd-runtest.env',
output : 'systemd-runtest.env',
command : ['sh', '-c', '{ ' +
- 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(meson.current_source_dir(), 'test')) +
+ 'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(project_source_root, 'test')) +
'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(meson.current_build_dir(), 'catalog')) +
'} >@OUTPUT@'],
build_by_default : true)
sources,
include_directories : incs,
link_with : link_with,
- dependencies : dependencies,
+ dependencies : [versiondep,
+ dependencies],
c_args : defs,
build_by_default : want_tests != 'false',
install_rpath : rootlibexecdir,
test('@0@:@1@:@2@'.format(b, c, sanitizer),
env,
args : [exe.full_path(),
- join_paths(meson.source_root(), p)])
+ join_paths(project_source_root, p)])
endif
endforeach
endif
if git.found()
all_files = run_command(
git,
- ['--git-dir=@0@/.git'.format(meson.source_root()),
+ ['--git-dir=@0@/.git'.format(project_source_root),
'ls-files',
':/*.[ch]'])
all_files = files(all_files.stdout().split())
custom_target(
'tags',
output : 'tags',
- command : [env, 'etags', '-o', '@0@/TAGS'.format(meson.source_root())] + all_files)
+ command : [env, 'etags', '-o', '@0@/TAGS'.format(project_source_root)] + all_files)
run_target(
'ctags',
- command : [env, 'ctags', '-o', '@0@/tags'.format(meson.source_root())] + all_files)
+ command : [env, 'ctags', '-o', '@0@/tags'.format(project_source_root)] + all_files)
endif
if git.found()
if git.found()
git_head = run_command(
git,
- ['--git-dir=@0@/.git'.format(meson.source_root()),
+ ['--git-dir=@0@/.git'.format(project_source_root),
'rev-parse', 'HEAD']).stdout().strip()
git_head_short = run_command(
git,
- ['--git-dir=@0@/.git'.format(meson.source_root()),
+ ['--git-dir=@0@/.git'.format(project_source_root),
'rev-parse', '--short=7', 'HEAD']).stdout().strip()
run_target(
'git-snapshot',
command : ['git', 'archive',
- '-o', '@0@/systemd-@1@.tar.gz'.format(meson.source_root(),
+ '-o', '@0@/systemd-@1@.tar.gz'.format(project_source_root,
git_head_short),
'--prefix', 'systemd-@0@/'.format(git_head),
'HEAD'])