X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=meson.build;h=ae989e12e5440c1647324feb8f2e5796a2321889;hb=5cd33ccc2c67ff8d271d367510821bb2582840eb;hp=b4d5964bf127889678e93a8c7973cdf909c96eee;hpb=476a8618fce23db11676342d44d7b53d55b05673;p=thirdparty%2Fsystemd.git diff --git a/meson.build b/meson.build index b4d5964bf12..ae989e12e54 100644 --- a/meson.build +++ b/meson.build @@ -54,13 +54,26 @@ endif ##################################################################### -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 @@ -87,6 +100,7 @@ datadir = join_paths(prefixdir, get_option('datadir')) 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') @@ -181,6 +195,9 @@ conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) 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')) @@ -353,7 +370,7 @@ foreach arg : ['unused-parameter', endif endforeach -if cc.compiles(' +if cc.compiles(''' #include #include typedef uint64_t usec_t; @@ -362,7 +379,7 @@ if cc.compiles(' struct timespec now; return 0; } -', name : '-Werror=shadow with local shadowing') +''', name : '-Werror=shadow with local shadowing') add_project_arguments('-Werror=shadow', language : 'c') endif @@ -449,6 +466,8 @@ decl_headers = ''' #include #include #include +#include +#include ''' # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail @@ -457,6 +476,7 @@ foreach decl : ['char16_t', 'key_serial_t', 'struct ethtool_link_settings', 'struct fib_rule_uid_range', + 'struct statx', ] # We get -1 if the size cannot be determined @@ -518,7 +538,11 @@ foreach ident : [ #include '''], ['bpf', '''#include #include '''], + ['statx', '''#include + #include + #include '''], ['explicit_bzero' , '''#include '''], + ['reallocarray', '''#include '''], ] have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') @@ -656,8 +680,11 @@ system_uid_max = get_option('system-uid-max') if system_uid_max == '' system_uid_max = run_command( awk, - 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', - '/etc/login.defs').stdout() + '/^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }', + '/etc/login.defs').stdout().strip() + if system_uid_max == '' + system_uid_max = '999' + endif endif system_uid_max = system_uid_max.to_int() conf.set('SYSTEM_UID_MAX', system_uid_max) @@ -668,8 +695,11 @@ system_gid_max = get_option('system-gid-max') if system_gid_max == '' system_gid_max = run_command( awk, - 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', - '/etc/login.defs').stdout() + '/^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }', + '/etc/login.defs').stdout().strip() + if system_gid_max == '' + system_gid_max = '999' + endif endif system_gid_max = system_gid_max.to_int() conf.set('SYSTEM_GID_MAX', system_gid_max) @@ -1440,6 +1470,10 @@ executable('systemd', 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, @@ -1699,6 +1733,12 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c', 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', @@ -2583,15 +2623,17 @@ install_data('xorg/50-systemd-user.sh', 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) @@ -2712,6 +2754,8 @@ run_target( 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), @@ -2848,7 +2892,6 @@ foreach tuple : [ ['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'],