diff mbox series

[01/18] configure: Detect libfuse

Message ID 20191219143818.1646168-2-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: Allow exporting BDSs via FUSE | expand

Commit Message

Max Reitz Dec. 19, 2019, 2:38 p.m. UTC
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 configure | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff mbox series

Patch

diff --git a/configure b/configure
index 84b413dbfc..ff7d760a0a 100755
--- a/configure
+++ b/configure
@@ -503,6 +503,7 @@  debug_mutex="no"
 libpmem=""
 default_devices="yes"
 plugins="no"
+fuse=""
 
 supported_cpu="no"
 supported_os="no"
@@ -1534,6 +1535,10 @@  for opt do
   ;;
   --disable-plugins) plugins="no"
   ;;
+  --enable-fuse) fuse=yes
+  ;;
+  --disable-fuse) fuse=no
+  ;;
   *)
       echo "ERROR: unknown option $opt"
       echo "Try '$0 --help' for more information"
@@ -1819,6 +1824,7 @@  disabled with --disable-FEATURE, default is enabled if available:
   debug-mutex     mutex debugging support
   libpmem         libpmem support
   xkbcommon       xkbcommon support
+  fuse            fuse block device export
 
 NOTE: The object files are built at the place where configure is launched
 EOF
@@ -6042,6 +6048,28 @@  case "$slirp" in
     ;;
 esac
 
+##########################################
+# FUSE support
+
+if test "$fuse" != "no"; then
+  cat > $TMPC <<EOF
+#define FUSE_USE_VERSION 31
+#include <fuse.h>
+#include <fuse_lowlevel.h>
+int main(void) { return 0; }
+EOF
+  fuse_cflags=$(pkg-config --cflags fuse3)
+  fuse_libs=$(pkg-config --libs fuse3)
+  if compile_prog "$fuse_cflags" "$fuse_libs"; then
+    fuse=yes
+  else
+    if test "$fuse" = "yes"; then
+      feature_not_found "fuse"
+    fi
+    fuse=no
+  fi
+fi
+
 
 ##########################################
 # End of CC checks
@@ -6556,6 +6584,7 @@  echo "libpmem support   $libpmem"
 echo "libudev           $libudev"
 echo "default devices   $default_devices"
 echo "plugin support    $plugins"
+echo "fuse exports      $fuse"
 
 if test "$supported_cpu" = "no"; then
     echo
@@ -7410,6 +7439,12 @@  if test "$plugins" = "yes" ; then
     fi
 fi
 
+if test "$fuse" = "yes"; then
+  echo "CONFIG_FUSE=y" >> $config_host_mak
+  echo "FUSE_CFLAGS=$fuse_cflags" >> $config_host_mak
+  echo "FUSE_LIBS=$fuse_libs" >> $config_host_mak
+fi
+
 if test "$tcg_interpreter" = "yes"; then
   QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
 elif test "$ARCH" = "sparc64" ; then