From: Emil Velikov Date: Thu, 24 Oct 2024 13:27:42 +0000 (+0100) Subject: meson: port moduledir/distconfdir checks from autoconf X-Git-Tag: v34~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa4c4cdd2a99a3343de6b2a17e10e6f0887b2a0d;p=thirdparty%2Fkmod.git meson: port moduledir/distconfdir checks from autoconf Namely, ensure they are absolute paths and any trailing / is stripped. $ meson setup -D moduledir=relative/ build/ ... ERROR: Problem encountered: User provided moduledir, 'relative' is not an absolute path. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/209 [ Fix relative customdir ] Signed-off-by: Lucas De Marchi --- diff --git a/meson.build b/meson.build index 3937901f..37d33d26 100644 --- a/meson.build +++ b/meson.build @@ -213,6 +213,13 @@ foreach tuple : _customdirs customdir = get_variable(dir_option) if customdir == '' customdir = def_path + else + if not customdir.startswith('/') + error('User provided @0@, \'@1@\' is not an absolute path.' + .format(dir_option, customdir)) + endif + # Strip all leading/trailing and re-add only the leading one. + customdir = '' / customdir.strip('/') endif cdata.set_quoted(quoted, customdir) set_variable(dir_option, customdir)