]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: refuse when prefix is not a child of rootprefix
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 24 Feb 2021 17:02:36 +0000 (18:02 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Feb 2021 07:34:03 +0000 (16:34 +0900)
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

index dc7cbc1c3ac817801c9ca80cbfcea48791b9dfcd..2c5150bfc18de93202af055d835c8f30336ad45c 100644 (file)
@@ -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'))