Merge pull request #8319 from keszybz/yet-another-symlink-installation-tweak

meson: fix symlink creation when sbin is symlink to bin
This commit is contained in:
Lennart Poettering 2018-03-01 15:06:02 +01:00 committed by GitHub
commit 7df4b832d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View File

@ -54,9 +54,19 @@ endif
#####################################################################
split_usr = get_option('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)
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
rootprefixdir = get_option('rootprefix')
# Unusual rootprefixdir values are used by some distros
# (see https://github.com/systemd/systemd/pull/7461).
@ -87,7 +97,7 @@ datadir = join_paths(prefixdir, get_option('datadir'))
localstatedir = join_paths('/', get_option('localstatedir'))
rootbindir = join_paths(rootprefixdir, 'bin')
rootsbindir = join_paths(rootprefixdir, 'sbin')
rootsbindir = join_paths(rootprefixdir, split_bin ? 'sbin' : 'bin')
rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
rootlibdir = get_option('rootlibdir')
@ -2738,6 +2748,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),
@ -2874,7 +2886,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'],

View File

@ -16,8 +16,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
option('split-usr', type : 'boolean', value : false,
description : '''assume that /bin, /sbin aren't symlinks into /usr''')
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
description : '''/bin, /sbin aren't symlinks into /usr''')
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
description : '''sbin is not a symlink to bin''')
option('rootlibdir', type : 'string',
description : '''[/usr]/lib/x86_64-linux-gnu or such''')
option('rootprefix', type : 'string',