]> xenbits.xensource.com Git - libvirt.git/commitdiff
meson: Detect newer fuse
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 22 Feb 2022 14:21:49 +0000 (15:21 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 7 Mar 2022 13:01:48 +0000 (14:01 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
meson.build
src/lxc/lxc_fuse.c

index 519a928c9a76e6a37abe0402793a22e0c6a6685b..f6259e59a4a439051b349129c98a7ed04464c53e 100644 (file)
@@ -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'
index 802b2f5a1b2a7f8b9cd6d7134d37b06ec8d3a832..5e48206c390303fada0f0e38c1a4875108e9fe09 100644 (file)
 #include <unistd.h>
 
 #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 <fuse.h>
 # if FUSE_USE_VERSION >= 31
 #  include <fuse_lowlevel.h>