From ec83a6c130bdfc869d28f9bce8ce100167861266 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 28 Aug 2010 15:10:43 +0300
Subject: [PATCH] configure.in: allow user to explicitly enable/disable gnome-keyring support

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 configure.in |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/configure.in b/configure.in
index 4738bb6..8dab68e 100644
--- a/configure.in
+++ b/configure.in
@@ -87,12 +87,24 @@ CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DFUSE_USE_VERSION=26 $FUSE_CFLAGS"
 dnl *******************************
 dnl *** Tests for gnome-keyring ***
 dnl *******************************
-PKG_CHECK_MODULES(GNOME_KEYRING, [gnome-keyring-1 >= 2.28],
-	[AC_DEFINE([HAVE_GNOME_KEYRING], [], 
-		[use gnome-keyring as password storage])])
-LIBS="$LIBS $GNOME_KEYRING_LIBS"
-CFLAGS="$CFLAGS $GNOME_KEYRING_CFLAGS"
 
+AC_ARG_WITH(gnome-keyring,
+	[AS_HELP_STRING(--with-gnome-keyring=@<:@no/yes@:>@,
+		use gnome-keyring as password storage @<:@default=auto@:>@)],
+	,
+	[with_gnome_keyring=maybe])
+
+if test x"$with_gnome_keyring" != xno; then
+	PKG_CHECK_MODULES(GNOME_KEYRING, [gnome-keyring-1 >= 2.28],
+		[AC_DEFINE([HAVE_GNOME_KEYRING], [],
+			[use gnome-keyring as password storage])],
+		[# mandatory depend
+		if test x"$with_gnome_keyring" = xyes; then
+			AC_MSG_ERROR([unable to find usable gnome-keyring])
+		fi])
+	LIBS="$LIBS $GNOME_KEYRING_LIBS"
+	CFLAGS="$CFLAGS $GNOME_KEYRING_CFLAGS"
+fi
 
 dnl ******************************
 dnl *** Tests for libsmbclient ***
-- 
1.7.1

