From e0a9df3b7a5dbd06ad724dae00a1d1585ac0a951 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 31 Oct 2024 13:16:37 +0000 Subject: [PATCH] meson: don't escape module_foo in kmod.pc The kmod.pc file, contains module_signatures and module_compressions space-separated lists, indicating how kmod is built. For the meson generated file, any spaces are escaped where the autotools one does not do that. Update the meson build to be consistent with the original autotools one and omit the escaping that we don't want. Aside: seems like autotools does not escape the directory variables either, so if the path(s) have any spaces in them pkg-config (pkgconf at least) produces rubbish, quite rightfully IMHO. Eg. $ cat .../autotools-file.pc prefix=/usr includedir=${prefix}/include bar Cflags: -I${includedir} ... $ pkg-config --cflags autotools-file.pc bar $ cat .../meson-file.pc prefix=/usr includedir=${prefix}/include\ bar Cflags: -I${includedir} ... $ pkg-config --cflags meson-file.pc -I/usr/include\ bar Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/217 Signed-off-by: Lucas De Marchi --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e1e68805..a315cef8 100644 --- a/meson.build +++ b/meson.build @@ -446,19 +446,25 @@ _kmod_variables = [ 'sysconfdir=' + sysconfdir, 'distconfdir=' + distconfdir, 'module_directory=' + moduledir, +] + +# Don't (space) escape variables with space-separated lists, for consistency +# with the autotools build. +_kmod_unescaped_variables = [ 'module_signatures=' + module_signatures, ] # XXX: Support for empty variables was added in meson v1.4.0. # pkgconf behaves identically on missing and empty variable. if module_compressions != '' - _kmod_variables += ['module_compressions=' + module_compressions] + _kmod_unescaped_variables += ['module_compressions=' + module_compressions] endif pkg.generate( name : 'kmod', description : 'Tools to deal with kernel modules', install_dir : datadir / 'pkgconfig', + unescaped_variables : _kmod_unescaped_variables, variables : _kmod_variables, ) -- 2.47.2