diff options
-rw-r--r-- | meson.build | 12 | ||||
-rw-r--r-- | meson_options.txt | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/meson.build b/meson.build index dc169b5d..75c225a2 100644 --- a/meson.build +++ b/meson.build @@ -66,10 +66,16 @@ else pkg_prefix = option_pkg_prefix endif -rootprefix = get_option('rootprefix') -if rootprefix == '' - rootprefix = '/' +if get_option('split-usr') == 'auto' + split_usr = run_command('test', '-L', '/bin').returncode() != 0 +else + split_usr = get_option('split-usr') == 'true' endif + +rootprefix_default = split_usr ? '/' : '/usr'A +rootprefix_path = get_option('rootprefix') +rootprefix = rootprefix_path != '' ? rootprefix_path : rootprefix_default + bindir = rootprefix / get_option('bindir') libdir = rootprefix / get_option('libdir') libexecdir = rootprefix / get_option('libexecdir') diff --git a/meson_options.txt b/meson_options.txt index ce1b8dda..cd922a21 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,9 @@ option('selinux', type : 'feature', value : 'auto', description : 'enable SELinux support') option('shell', type : 'string', value : '/bin/sh', description : 'Default posix compatible shell') +option('split-usr', type : 'combo', + choices : ['auto', 'true', 'false'], + description : '''/bin, /sbin aren't symlinks into /usr''') option('sysvinit', type : 'boolean', value : false, description : 'enable SysVinit compatibility (linux only)') option('termcap', type : 'combo', |