[blam/blam-1.8: 10/11] configure: Allow the user to disable building with D-Bus



commit 682da6a4e5ab111186e5383b32443056875c0791
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date:   Sat May 12 21:08:57 2012 +0200

    configure: Allow the user to disable building with D-Bus

 configure.in       |   23 ++++++++++-------------
 src/Application.cs |    2 ++
 2 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/configure.in b/configure.in
index 5a925cd..c14fdc5 100644
--- a/configure.in
+++ b/configure.in
@@ -54,21 +54,18 @@ AC_SUBST(BLAM_LIBS)
 # Use DBus# to export our remote control if available and the user wants it
 #
 AC_ARG_WITH([dbus],
-	AC_HELP_STRING([--with-dbus], [Support D-Bus @<:@default=auto:>@]),
-	[],
-	with_dbus=auto
-)
+	AC_HELP_STRING([--without-dbus], [Remove D-Bus support]))
 
+AS_IF([test "x$with_dbus" != "xno"],
+      [PKG_CHECK_EXISTS([dbus-sharp-glib-1.0], [have_dbus=yes], [have_dbus=no])],
+      [have_dbus=no])
 
-PKG_CHECK_MODULES(DBUS, dbus-sharp-glib-1.0, ENABLE_DBUS="yes", ENABLE_DBUS="no")
-AM_CONDITIONAL(ENABLE_DBUS, test "x$ENABLE_DBUS" = "xyes")
-AC_SUBST(DBUS_LIBS)
+AS_IF([test "x$have_dbus" = "xyes"],
+      [PKG_CHECK_MODULES(DBUS, dbus-sharp-glib-1.0, ENABLE_DBUS="yes", ENABLE_DBUS="no")
+       AC_SUBST(DBUS_LIBS)],
+       [])
 
-# If we found a package or the user told us
-if test "x$with_dbus" = "xyes"; then
-   PKG_CHECK_MODULES(DBUS_SHARP, dbus-sharp-glib-1.0, ENABLE_DBUS_SHARP="yes", ENABLE_DBUS_SHARP="no")
-fi
-# Tell the code that we're using dbus
+AM_CONDITIONAL(ENABLE_DBUS, test "x$have_dbus" = "xyes")
 
 #
 # Use libnotify is available
@@ -111,6 +108,6 @@ themes/planet/Makefile
 echo
 echo "Installing in prefix: $prefix"
 echo 
-echo "Enable D-Bus: $ENABLE_DBUS"
+echo "Enable D-Bus: $have_dbus"
 echo "Enable notifications: $ENABLE_NOTIFY"
 echo
diff --git a/src/Application.cs b/src/Application.cs
index eff8f47..fb3f63a 100644
--- a/src/Application.cs
+++ b/src/Application.cs
@@ -18,8 +18,10 @@ using System.IO;
 using System.Text;
 using System.Runtime.InteropServices;
 using WebKit;
+#if ENABLE_DBUS
 using DBus;
 using org.freedesktop.DBus;
+#endif
 
 namespace Imendio.Blam {
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]