[sheepdog] [PATCH] configure: disable sheepfs automatically if libfuse-dev isn't found

Liu Yuan namei.unix at gmail.com
Thu May 24 12:53:08 CEST 2012


From: Liu Yuan <tailai.ly at taobao.com>

V2:
 - check the header if user explictly ./configure --enable-sheepfs
------------------------------------------------ >8

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 configure.ac |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index d3bd0eb..feec067 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,9 +209,10 @@ AC_ARG_ENABLE([trace],
 	[ enable_trace="no" ],)
 AM_CONDITIONAL(BUILD_TRACE, test x$enable_trace = xyes)
 
+PKG_CHECK_MODULES([fuse],[fuse], HAVE_FUSE="yes", HAVE_FUSE="no")
 AC_ARG_ENABLE([sheepfs],
 	[  --enable-sheepfs         : enable sheepfs],,
-	[ enable_sheepfs="yes" ],)
+	[ enable_sheepfs=$HAVE_FUSE ],)
 AM_CONDITIONAL(BUILD_SHEEPFS, test x$enable_sheepfs = xyes)
 
 CP=cp
@@ -292,7 +293,9 @@ if test "x${enable_trace}" = xyes; then
 fi
 
 if test "x${enable_sheepfs}" = xyes; then
-	PKG_CHECK_MODULES([fuse],[fuse])
+	AC_CHECK_HEADERS([fuse.h],,
+		AC_MSG_ERROR(fuse.h header missing),
+		[#define _FILE_OFFSET_BITS 64])
 	AC_DEFINE_UNQUOTED([HAVE_SHEEPFS], 1, [have sheepfs])
 	PACKAGE_FEATURES="$PACKAGE_FEATURES sheepfs"
 fi
-- 
1.7.10.2




More information about the sheepdog mailing list