]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add a configure option for fuse support in LXC driver
authorGao feng <gaofeng@cn.fujitsu.com>
Mon, 12 Nov 2012 07:02:23 +0000 (15:02 +0800)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 28 Nov 2012 10:28:49 +0000 (10:28 +0000)
Add a configure option --with-fuse to prepare introduction
of fuse support for libvirt lxc.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
configure.ac
libvirt.spec.in

index 849d78719817551b8fbc1caaf4a5f048f19c82a2..c888eb8b16be6728d2d84f08f25fdc13c98c7b96 100644 (file)
@@ -115,6 +115,7 @@ LIBSSH2_REQUIRED="1.0"
 LIBSSH2_TRANSPORT_REQUIRED="1.3"
 LIBBLKID_REQUIRED="2.17"
 DBUS_REQUIRED="1.0.0"
+FUSE_REQUIRED="2.8.6"
 
 dnl Checks for C compiler.
 AC_PROG_CC
@@ -1866,6 +1867,29 @@ AC_SUBST([CAPNG_CFLAGS])
 AC_SUBST([CAPNG_LIBS])
 
 
+dnl libfuse
+AC_ARG_WITH([fuse],
+  AC_HELP_STRING([--with-fuse], [use libfuse to proivde fuse filesystem support for libvirt lxc]),
+  [],
+  [with_fuse=check])
+dnl
+dnl This check looks for 'fuse'
+dnl
+AS_IF([test "x$with_fuse" != "xno"],
+        [PKG_CHECK_MODULES([FUSE], [fuse >= $FUSE_REQUIRED],
+          [with_fuse=yes
+           AC_SUBST([FUSE_CFLAGS])
+           AC_SUBST([FUSE_LIBS])
+           AC_DEFINE_UNQUOTED([HAVE_FUSE], 1, [whether fuse is available for libvirt lxc])
+          ],
+          [if test "x$with_fuse" = "xyes" ; then
+             AC_MSG_ERROR([You must install fuse library to compile libvirt])
+           else
+             with_fuse=no
+           fi
+          ])
+        ])
+AM_CONDITIONAL([HAVE_FUSE], [test "x$with_fuse" = "xyes"])
 
 dnl virsh libraries
 AC_CHECK_HEADERS([readline/readline.h])
@@ -3170,6 +3194,11 @@ AC_MSG_NOTICE([   capng: $CAPNG_CFLAGS $CAPNG_LIBS])
 else
 AC_MSG_NOTICE([   capng: no])
 fi
+if test "$with_fuse" = "yes" ; then
+AC_MSG_NOTICE([    fuse: $FUSE_CFLAGS $FUSE_LIBS])
+else
+AC_MSG_NOTICE([    fuse: no])
+fi
 if test "$with_xen" = "yes" ; then
 AC_MSG_NOTICE([     xen: $XEN_CFLAGS $XEN_LIBS])
 else
index 35c103b4ee939d21895bd8e5c3380f85fd957275..5b3f4e47756ee39671e2f85db971bbf7da15058d 100644 (file)
@@ -99,6 +99,7 @@
 # A few optional bits off by default, we enable later
 %define with_polkit        0%{!?_without_polkit:0}
 %define with_capng         0%{!?_without_capng:0}
+%define with_fuse          0%{!?_without_fuse:0}
 %define with_netcf         0%{!?_without_netcf:0}
 %define with_udev          0%{!?_without_udev:0}
 %define with_hal           0%{!?_without_hal:0}
 %define with_capng     0%{!?_without_capng:1}
 %endif
 
+# fuse is used to provide virtualized /proc for LXC
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
+%define with_fuse      0%{!?_without_fuse:1}
+%endif
+
 # netcf is used to manage network interfaces in Fedora 12 / RHEL-6 or newer
 %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
 %define with_netcf     0%{!?_without_netcf:%{server_drivers}}
@@ -516,6 +522,9 @@ BuildRequires: numactl-devel
 %if %{with_capng}
 BuildRequires: libcap-ng-devel >= 0.5.0
 %endif
+%if %{with_fuse}
+BuildRequires: fuse-devel >= 2.8.6
+%endif
 %if %{with_phyp} || %{with_libssh2_transport}
 %if %{with_libssh2_transport}
 BuildRequires: libssh2-devel >= 1.3.0
@@ -1199,6 +1208,10 @@ of recent versions of Linux (and other OSes).
 %define _without_capng --without-capng
 %endif
 
+%if ! %{with_fuse}
+%define _without_fuse --without-fuse
+%endif
+
 %if ! %{with_netcf}
 %define _without_netcf --without-netcf
 %endif
@@ -1302,6 +1315,7 @@ autoreconf -if
            %{?_without_numactl} \
            %{?_without_numad} \
            %{?_without_capng} \
+           %{?_without_fuse} \
            %{?_without_netcf} \
            %{?_without_selinux} \
            %{?_with_selinux_mount} \