From 481fe43b653b443ecfa8d4f3aa88d734d17cccd5 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Tue, 2 Nov 2010 23:21:27 +0100
Subject: [PATCH 6/6] fix libxklavier automagic support

libxklavier support is optional, make that fact explicit.
---
 configure.ac |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 71d0247..10dbb72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,17 +129,26 @@ SIMPLE_GREETER_LIBS="$SIMPLE_GREETER_LIBS -lm"
 AC_SUBST(SIMPLE_GREETER_CFLAGS)
 AC_SUBST(SIMPLE_GREETER_LIBS)
 
-PKG_CHECK_MODULES(LIBXKLAVIER,
-        libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION,
-        have_libxklavier=yes,
-        have_libxklavier=no)
-if test "x$have_libxklavier" = "xyes" ; then
-  AC_DEFINE(HAVE_LIBXKLAVIER, [], [Define if we have libxklavier])
+AC_ARG_ENABLE([libxklavier],
+	AS_HELP_STRING([--enable-libxklavier],
+		       [Enable libxklavier support @<:@default=yes@:>@]),
+	enable_libxklavier=$enableval,
+	enable_libxklavier=yes)
+have_libxklavier=no
+if test "x$enable_libxklavier" = "xyes"; then
+   PKG_CHECK_MODULES(LIBXKLAVIER,
+	  libxklavier >= $LIBXKLAVIER_REQUIRED_VERSION,
+          have_libxklavier=yes,
+          have_libxklavier=no)
+   if test "x$have_libxklavier" = "xyes" ; then
+      AC_DEFINE(HAVE_LIBXKLAVIER, [], [Define if we have libxklavier])
+   fi
+   AC_SUBST(HAVE_LIBXKLAVIER)
+   AC_SUBST(LIBXKLAVIER_CFLAGS)
+   AC_SUBST(LIBXKLAVIER_LIBS)
 fi
+
 AM_CONDITIONAL(HAVE_LIBXKLAVIER, test x$have_libxklavier = xyes)
-AC_SUBST(HAVE_LIBXKLAVIER)
-AC_SUBST(LIBXKLAVIER_CFLAGS)
-AC_SUBST(LIBXKLAVIER_LIBS)
 
 PKG_CHECK_MODULES(SIMPLE_CHOOSER,
         dbus-glib-1 >= $DBUS_GLIB_REQUIRED_VERSION
@@ -1467,5 +1476,6 @@ echo \
         SELinux support:          ${with_selinux}
         ConsoleKit support:       ${use_console_kit}
         UPower support:           ${have_upower}
+        Libxklavier support:      ${have_libxklavier}
         Build with RBAC:          ${msg_rbac_shutdown}
 "
-- 
1.7.3.1

