]> git.proxmox.com Git - mirror_lxcfs.git/blobdiff - meson.build
Merge pull request #530 from Blub/2022-01-17/optional-fuse-2
[mirror_lxcfs.git] / meson.build
index 2881defde8d4eedab4d3c0801bafaeb5dcbe6133..57d2ec29474c37938fc496ebe871f0114bab0e00 100644 (file)
@@ -146,18 +146,33 @@ foreach ident: [
     conf.set10('HAVE_' + ident[0].to_upper(), have)
 endforeach
 
-libfuse = dependency('fuse3', required: false)
-if libfuse.found()
-    conf.set10('HAVE_FUSE3', true)
-    conf.set('FUSE_USE_VERSION', 35)
-else
+fuse_version = get_option('fuse-version')
+if fuse_version == '3' or fuse_version == 'auto'
+    libfuse = dependency('fuse3', required: false)
+    if libfuse.found()
+        conf.set10('HAVE_FUSE3', true)
+        conf.set('FUSE_USE_VERSION', 35)
+        if libfuse.version().version_compare('>=3.10.3')
+            conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', true)
+        else
+            conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', false)
+        endif
+    endif
+endif
+
+if fuse_version == '2' or (not libfuse.found() and fuse_version == 'auto')
     libfuse = dependency('fuse', version: '>= 2.6')
     if libfuse.found()
         conf.set10('HAVE_FUSE', true)
         conf.set('FUSE_USE_VERSION', 26)
+        conf.set10('HAVE_FUSE_RETURNS_DT_TYPE', true)
     endif
 endif
 
+if not libfuse.found()
+       error('no usable fuse version found')
+endif
+
 libdl = cc.find_library('dl')
 threads = dependency('threads')