From d895e10a24f65d2b016d20d5fb5ecf7ac625c698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 24 Feb 2021 18:02:36 +0100 Subject: [PATCH] meson: refuse when prefix is not a child of rootprefix This is most likely to happen when setting one but not the other. Note that we already warn when rootprefixdir != rootprefix_default, at the very end. --- meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index dc7cbc1c3a..2c5150bfc1 100644 --- a/meson.build +++ b/meson.build @@ -115,6 +115,11 @@ prefixdir = get_option('prefix') if not prefixdir.startswith('/') error('Prefix is not absolute: "@0@"'.format(prefixdir)) endif +if prefixdir != rootprefixdir and not prefixdir.startswith(rootprefixdir.strip('/') + '/') + error('Prefix is not below root prefix (now rootprefix=@0@ prefix=@1@)'.format( + rootprefixdir, prefixdir)) +endif + bindir = join_paths(prefixdir, get_option('bindir')) libdir = join_paths(prefixdir, get_option('libdir')) sysconfdir = join_paths(prefixdir, get_option('sysconfdir'))