# along with systemd; If not, see <http://www.gnu.org/licenses/>.
project('systemd', 'c',
- version : '237',
+ version : '238',
license : 'LGPLv2+',
default_options: [
'c_std=gnu99',
meson_version : '>= 0.41',
)
-libsystemd_version = '0.21.0'
-libudev_version = '1.6.9'
+libsystemd_version = '0.22.0'
+libudev_version = '1.6.10'
# We need the same data in three different formats, ugh!
# Also, for hysterical reasons, we use different variable
#####################################################################
-split_usr = get_option('split-usr')
-conf.set10('HAVE_SPLIT_USR', split_usr)
+if get_option('split-usr') == 'auto'
+ split_usr = run_command('test', '-L', '/bin').returncode() != 0
+else
+ split_usr = get_option('split-usr') == 'true'
+endif
+conf.set10('HAVE_SPLIT_USR', split_usr,
+ description : '/usr/bin and /bin directories are separate')
+
+if get_option('split-bin') == 'auto'
+ split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
+else
+ split_bin = get_option('split-bin') == 'true'
+endif
+conf.set10('HAVE_SPLIT_BIN', split_bin,
+ description : 'bin and sbin directories are separate')
rootprefixdir = get_option('rootprefix')
# Unusual rootprefixdir values are used by some distros
# (see https://github.com/systemd/systemd/pull/7461).
-rootprefix_default = get_option('split-usr') ? '/' : '/usr'
+rootprefix_default = split_usr ? '/' : '/usr'
if rootprefixdir == ''
rootprefixdir = rootprefix_default
endif
localstatedir = join_paths('/', get_option('localstatedir'))
rootbindir = join_paths(rootprefixdir, 'bin')
+rootsbindir = join_paths(rootprefixdir, split_bin ? 'sbin' : 'bin')
rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
rootlibdir = get_option('rootlibdir')
conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
+
+conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper())
+
conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
conf.set_quoted('USER_DATA_UNIT_PATH', userunitdir)
conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root'))
conf.set_quoted('USER_KEYRING_PATH', join_paths(pkgsysconfdir, 'import-pubring.gpg'))
conf.set_quoted('DOCUMENT_ROOT', join_paths(pkgdatadir, 'gatewayd'))
conf.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'true' : 'false')
-conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_ON_OFF', memory_accounting_default ? 'on' : 'off')
+conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
conf.set_quoted('ABS_SRC_DIR', meson.source_root())
endif
endforeach
-# Check if various sanitizers are supported
-sanitizers = []
-foreach arg : ['address']
-
- have = run_command(check_compilation_sh,
- cc.cmd_array(), '-x', 'c',
- '-fsanitize=@0@'.format(arg),
- '-include', link_test_c).returncode() == 0
- message('@0@ sanitizer supported: @1@'.format(arg, have ? 'yes' : 'no'))
- if have
- sanitizers += arg
- endif
-endforeach
-
if get_option('buildtype') != 'debug'
foreach arg : ['-ffunction-sections',
'-fdata-sections']
#include <unistd.h>'''],
['bpf', '''#include <sys/syscall.h>
#include <unistd.h>'''],
- ['explicit_bzero' , '''#include <string.h>'''],
['statx', '''#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>'''],
+ ['explicit_bzero' , '''#include <string.h>'''],
+ ['reallocarray', '''#include <malloc.h>'''],
]
have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
conf.set_quoted('TELINIT', get_option('telinit-path'))
if run_command('ln', '--relative', '--help').returncode() != 0
- error('ln does not support --relative')
+ error('ln does not support --relative (added in coreutils 8.16)')
endif
############################################################
kill_user_processes = get_option('default-kill-user-processes')
conf.set10('KILL_USER_PROCESSES', kill_user_processes)
+conf.set_quoted('KILL_USER_PROCESSES_YES_NO', kill_user_processes ? 'yes' : 'no')
substs.set('KILL_USER_PROCESSES', kill_user_processes ? 'yes' : 'no')
dns_servers = get_option('dns-servers')
endif
libmount = dependency('mount',
- version : '>= 2.30',
- required : not fuzzer_build)
+ version : fuzzer_build ? '>= 0' : '>= 2.30')
want_seccomp = get_option('seccomp')
if want_seccomp != 'false' and not fuzzer_build
install : true,
install_dir : rootlibexecdir)
+meson.add_install_script(meson_make_symlink,
+ join_paths(rootlibexecdir, 'systemd'),
+ join_paths(rootsbindir, 'init'))
+
exe = executable('systemd-analyze',
systemd_analyze_sources,
include_directories : includes,
install_rpath : rootlibexecdir,
install : true)
public_programs += [exe]
+
+ meson.add_install_script(meson_make_symlink,
+ join_paths(bindir, 'systemd-resolve'),
+ join_paths(rootsbindir, 'resolvconf'))
endif
if conf.get('ENABLE_LOGIND') == 1
install_dir : rootbindir)
public_programs += [exe]
+foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit']
+ meson.add_install_script(meson_make_symlink,
+ join_paths(rootbindir, 'systemctl'),
+ join_paths(rootsbindir, alias))
+endforeach
+
if conf.get('ENABLE_BACKLIGHT') == 1
executable('systemd-backlight',
'src/backlight/backlight.c',
systemd_shutdown_sources,
include_directories : includes,
link_with : [libshared],
+ dependencies : [libmount],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootlibexecdir)
install_dir : xinitrcdir)
install_data('modprobe.d/systemd.conf',
install_dir : modprobedir)
-install_data('README',
- 'NEWS',
- 'CODING_STYLE',
- 'DISTRO_PORTING',
- 'ENVIRONMENT.md',
- 'LICENSE.GPL2',
+install_data('LICENSE.GPL2',
'LICENSE.LGPL2.1',
- 'TRANSIENT-SETTINGS.md',
- 'UIDS-GIDS.md',
+ 'NEWS',
+ 'README',
+ 'doc/CODING_STYLE',
+ 'doc/DISTRO_PORTING',
+ 'doc/ENVIRONMENT.md',
+ 'doc/HACKING',
+ 'doc/TRANSIENT-SETTINGS.md',
+ 'doc/TRANSLATORS',
+ 'doc/UIDS-GIDS.md',
'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION',
install_dir : docdir)
############################################################
-prev = ''
-foreach p : fuzz_regression_tests
- a = p.split('/')[-3]
- b = p.split('/')[-2]
- c = p.split('/')[-1]
-
- if a == 'address'
- build = sanitize_address
- else
- error('unknown sanitizer @0@'.format(a))
- endif
+# Enable tests for all supported sanitizers
+foreach tuple : sanitizers
+ sanitizer = tuple[0]
+ build = tuple[1]
- name = '@1@:@0@'.format(a, b)
-
- if name != prev
- if want_tests == 'false'
- message('Not compiling @0@ because tests is set to false'.format(name))
- elif not sanitizers.contains(a)
- message('Not compiling @0@ because @1@ sanitizer is not available'.format(name, a))
- elif slow_tests
- exe = custom_target(
- name,
- output : name,
- depends : build,
- command : [env, 'ln', '-fs',
- join_paths(build.full_path(), b),
- '@OUTPUT@'],
- build_by_default : true)
- else
- message('Not compiling @0@ because slow-tests is set to false'.format(name))
- endif
- endif
- prev = name
+ have = run_command(check_compilation_sh,
+ cc.cmd_array(), '-x', 'c',
+ '-fsanitize=@0@'.format(sanitizer),
+ '-include', link_test_c).returncode() == 0
+ message('@0@ sanitizer supported: @1@'.format(sanitizer, have ? 'yes' : 'no'))
- if want_tests != 'false' and slow_tests
- test(c, env, args : [exe.full_path(),
- join_paths(meson.source_root(),
- 'test/fuzz-regressions',
- p)])
+ if have
+ prev = ''
+ foreach p : fuzz_regression_tests
+ b = p.split('/')[-2]
+ c = p.split('/')[-1]
+
+ name = '@0@:@1@'.format(b, sanitizer)
+
+ if name != prev
+ if want_tests == 'false'
+ message('Not compiling @0@ because tests is set to false'.format(name))
+ elif slow_tests
+ exe = custom_target(
+ name,
+ output : name,
+ depends : build,
+ command : [env, 'ln', '-fs',
+ join_paths(build.full_path(), b),
+ '@OUTPUT@'],
+ build_by_default : true)
+ else
+ message('Not compiling @0@ because slow-tests is set to false'.format(name))
+ endif
+ endif
+ prev = name
+
+ if want_tests != 'false' and slow_tests
+ test('@0@:@1@:@2@'.format(b, c, sanitizer),
+ env,
+ args : [exe.full_path(),
+ join_paths(meson.source_root(),
+ 'test/fuzz-regressions',
+ p)])
+ endif
+ endforeach
endif
endforeach
+
############################################################
if git.found()
status = [
'@0@ @1@'.format(meson.project_name(), meson.project_version()),
+ 'split /usr: @0@'.format(split_usr),
+ 'split bin-sbin: @0@'.format(split_bin),
'prefix directory: @0@'.format(prefixdir),
'rootprefix directory: @0@'.format(rootprefixdir),
'sysconf directory: @0@'.format(sysconfdir),
['man pages', want_man],
['html pages', want_html],
['man page indices', want_man and have_lxml],
- ['split /usr', conf.get('HAVE_SPLIT_USR') == 1],
['SysV compat'],
['utmp'],
['ldconfig'],
['debug mmap cache'],
]
- cond = tuple.get(1, '')
- if cond == ''
+ if tuple.length() >= 2
+ cond = tuple[1]
+ else
ident1 = 'HAVE_' + tuple[0].underscorify().to_upper()
ident2 = 'ENABLE_' + tuple[0].underscorify().to_upper()
cond = conf.get(ident1, 0) == 1 or conf.get(ident2, 0) == 1