From 09bb46991dbb017cf1cf5c49c0c5db85777cf5c5 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 22 Feb 2022 15:21:49 +0100 Subject: [PATCH] meson: Detect newer fuse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we have support for fuse-3 we can detect it during the configure phase. Even better, we can detect fuse-3 first and fallback to old fuse only if the newer version doesn't exist. Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- meson.build | 12 +++++++++--- src/lxc/lxc_fuse.c | 6 +++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 519a928c9a..f6259e59a4 100644 --- a/meson.build +++ b/meson.build @@ -947,10 +947,16 @@ if dlopen_dep.found() conf.set('WITH_DLFCN_H', 1) endif -fuse_version = '2.8.6' -fuse_dep = dependency('fuse', version: '>=' + fuse_version, required: get_option('fuse')) +fuse_version = '3.1.0' +fuse_dep = dependency('fuse3', version: '>=' + fuse_version, required: false) if fuse_dep.found() - conf.set('WITH_FUSE', 1) + conf.set('WITH_FUSE', 3) +else + fuse_version = '2.8.6' + fuse_dep = dependency('fuse', version: '>=' + fuse_version, required: get_option('fuse')) + if fuse_dep.found() + conf.set('WITH_FUSE', 1) + endif endif glib_version = '2.56.0' diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index 802b2f5a1b..5e48206c39 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -26,7 +26,11 @@ #include #if WITH_FUSE -# define FUSE_USE_VERSION 26 +# if WITH_FUSE == 3 +# define FUSE_USE_VERSION 31 +# else +# define FUSE_USE_VERSION 26 +# endif # include # if FUSE_USE_VERSION >= 31 # include