[unique] Make it possible to build with just the D-Bus backend



commit 74eca2a31da13ddea7257b8791b0f31562855466
Author: Tor Lillqvist <tml iki fi>
Date:   Mon Nov 9 01:21:11 2009 +0200

    Make it possible to build with just the D-Bus backend
    
    Reviewed-by: Emmanuele Bassi <ebassi gnome org>

 configure.ac           |    6 ++++++
 unique/Makefile.am     |    9 ++++++++-
 unique/uniquebackend.c |    6 +++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 65585fa..9b39d4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,6 +140,12 @@ AS_IF([test "x$enable_bacon" = "xyes"],
       [have_bacon=no]
 )
 
+AS_IF([test "x$have_bacon" = "xyes"],
+      [
+        AC_DEFINE([HAVE_BACON], [1], [Building with Unix domain socket support])
+      ]
+)
+
 AM_CONDITIONAL([HAVE_BACON], [test "x$have_bacon" = "xyes"])
 
 dnl Choose the default backend
diff --git a/unique/Makefile.am b/unique/Makefile.am
index bce4019..e4f933f 100644
--- a/unique/Makefile.am
+++ b/unique/Makefile.am
@@ -69,7 +69,11 @@ glib_marshal_list = uniquemarshal.list
 glib_marshal_prefix = unique_marshal
 include $(top_srcdir)/build/autotools/Makefile.am.marshal
 
-unique_backend_libs = $(top_builddir)/unique/bacon/libunique-bacon.la
+unique_backend_libs =
+
+if HAVE_BACON
+unique_backend_libs += $(top_builddir)/unique/bacon/libunique-bacon.la
+endif
 
 if HAVE_DBUS
 unique_backend_libs += $(top_builddir)/unique/dbus/libunique-dbus.la
@@ -95,6 +99,9 @@ libunique_1_0_la_LIBADD = 		\
 	$(UNIQUE_LIBS)			\
 	$(DBUS_LIBS)
 
+libunique_1_0_la_LDFLAGS = 		\
+	-no-undefined
+
 DISTCLEANFILES += uniqueversion.h
 
 EXTRA_DIST += uniqueversion.h.in
diff --git a/unique/uniquebackend.c b/unique/uniquebackend.c
index 6719685..18a0c45 100644
--- a/unique/uniquebackend.c
+++ b/unique/uniquebackend.c
@@ -321,13 +321,17 @@ unique_backend_create (void)
 
   if (backend_name && backend_name[0] != '\0')
     {
+#ifdef HAVE_BACON
       if (strcmp (backend_name, "bacon") == 0)
         backend_gtype = unique_backend_bacon_get_type ();
-
+#endif
 #ifdef HAVE_DBUS
       if (strcmp (backend_name, "dbus") == 0)
         backend_gtype = unique_backend_dbus_get_type ();
 #endif /* HAVE_DBUS */
+#if !defined(HAVE_BACON) && !defined(HAVE_DBUS)
+#error Need either bacon or dbus
+#endif 
     }
 
   return g_object_new (backend_gtype, NULL);



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