build: set rootprefix_default to /usr if on a /usr merged system

This requires at leaste meson 0.53.0 since it uses the fs module.

This is for #474.
This commit is contained in:
William Hubbs 2021-11-28 12:35:29 -06:00
parent 2ba16135cb
commit cc0037e9ca

View File

@ -6,9 +6,10 @@ project('OpenRC', 'c',
'prefix=/usr',
'warning_level=3',
],
meson_version : '>=0.49.0')
meson_version : '>=0.53.0')
cc = meson.get_compiler('c')
fs = import('fs')
audit_dep = dependency('audit', required : get_option('audit'))
if audit_dep.found()
@ -76,7 +77,7 @@ else
endif
rootprefix = get_option('rootprefix')
rootprefix_default = '/'
rootprefix_default = fs.is_symlink('/bin') ? '/usr' : '/'
if rootprefix == ''
rootprefix = rootprefix_default
endif