[telepathy-mission-control/master] fd.o #22585: src: stop generating interfaces and GTypes, fixing static linking

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Jul 1 10:05:06 PDT 2009


All the interfaces and GTypes we need are already in libmcclient, with the
same names and auto-generated implementations, so it's useless to generate
them in libmissioncontrol-server.

When configured with --enable-static --disable-shared (which is what we
want in Debian, I suspect), it becomes actively harmful to have two
implementations: shared library linking can survive colliding symbols
(at least on Linux), but static linking can't.

(If we ever want Mission Control to be independent of libmcclient, then
it should generate its own quark/type functions in the Mcd namespace.)
---
 src/Makefile.am                 |   25 -------------------------
 src/mcd-account-compat.c        |    4 +++-
 src/mcd-account-conditions.c    |    4 +++-
 src/mcd-account-manager-query.c |    5 ++---
 src/mcd-account-manager.c       |    3 ++-
 src/mcd-account-requests.c      |    3 ++-
 src/mcd-account-stats.c         |    6 +++---
 src/mcd-account.c               |    5 +++--
 src/mcd-connection.c            |    4 ++--
 src/mcd-dbusprop.c              |    7 +++----
 10 files changed, 23 insertions(+), 43 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index ed40fb8..75bfe0a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,8 +34,6 @@ mc_headers = \
 mc_gen_headers = \
 	_gen/cli-Connection_Interface_Contact_Capabilities.h \
 	_gen/enums.h \
-	_gen/interfaces.h \
-	_gen/gtypes.h \
 	_gen/svc-Account_Interface_ChannelRequests.h \
 	_gen/svc-Account_Interface_Compat.h \
 	_gen/svc-Account_Interface_Conditions.h \
@@ -45,8 +43,6 @@ mc_gen_headers = \
 
 nodist_libmcd_convenience_la_SOURCES = \
 	_gen/cli-Connection_Interface_Contact_Capabilities-body.h \
-	_gen/gtypes-body.h \
-	_gen/interfaces-body.h \
 	_gen/register-dbus-glib-marshallers-body.h \
 	_gen/signals-marshal.c \
 	_gen/signals-marshal.h \
@@ -231,11 +227,6 @@ _gen/%.xml: $(top_srcdir)/xml/%.xml $(wildcard $(top_srcdir)/xml/*.xml)
 
 # Generated files which can be done for all "classes" at once
 
-_gen/gtypes.h _gen/gtypes-body.h: _gen/mcd.xml \
-	$(top_srcdir)/tools/glib-gtypes-generator.py
-	$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
-		$< _gen/gtypes mc
-
 _gen/signals-marshal.list: _gen/mcd.xml \
 	$(tools_dir)/glib-signals-marshal-gen.py
 	$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@
@@ -259,22 +250,6 @@ _gen/enums.h: _gen/mcd.xml $(tools_dir)/c-constants-generator.xsl
 		$(tools_dir)/c-constants-generator.xsl \
 		$< > $@
 
-_gen/interfaces.h: _gen/mcd.xml \
-	$(tools_dir)/glib-interfaces-generator.xsl \
-	$(tools_dir)/c-interfaces-generator.xsl
-	$(XSLTPROC) $(XSLTPROCFLAGS) \
-		--stringparam mixed-case-prefix mc \
-		$(tools_dir)/glib-interfaces-generator.xsl \
-		$< > $@
-
-_gen/interfaces-body.h: _gen/mcd.xml \
-	$(tools_dir)/glib-interfaces-body-generator.xsl \
-	$(tools_dir)/c-interfaces-generator.xsl
-	$(XSLTPROC) $(XSLTPROCFLAGS) \
-		--stringparam mixed-case-prefix mc \
-		$(tools_dir)/glib-interfaces-body-generator.xsl \
-		$< > $@
-
 
 # Generated files which must be generated per "class".
 # (Currently the only "class" is nmc4, but the new API will need "classes"
diff --git a/src/mcd-account-compat.c b/src/mcd-account-compat.c
index 336f3a9..c7a6e78 100644
--- a/src/mcd-account-compat.c
+++ b/src/mcd-account-compat.c
@@ -35,13 +35,15 @@
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/util.h>
+
+#include <libmcclient/mc-interfaces.h>
+
 #include "mcd-account.h"
 #include "mcd-account-priv.h"
 #include "mcd-account-compat.h"
 #include "mcd-account-manager.h"
 #include "mcd-misc.h"
 #include "mcd-service.h"
-#include "_gen/interfaces.h"
 
 #define COMPAT_REQ_DATA "compat_req"
 
diff --git a/src/mcd-account-conditions.c b/src/mcd-account-conditions.c
index c105a06..fe78262 100644
--- a/src/mcd-account-conditions.c
+++ b/src/mcd-account-conditions.c
@@ -33,11 +33,13 @@
 #include <telepathy-glib/svc-generic.h>
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/util.h>
+
+#include <libmcclient/mc-interfaces.h>
+
 #include "mcd-account.h"
 #include "mcd-account-priv.h"
 #include "mcd-account-conditions.h"
 #include "mcd-account-manager.h"
-#include "_gen/interfaces.h"
 
 
 static void
diff --git a/src/mcd-account-manager-query.c b/src/mcd-account-manager-query.c
index 620fed0..9e37d64 100644
--- a/src/mcd-account-manager-query.c
+++ b/src/mcd-account-manager-query.c
@@ -30,6 +30,8 @@
 #include <glib/gi18n.h>
 #include <config.h>
 
+#include <libmcclient/mc-interfaces.h>
+
 #include <telepathy-glib/svc-generic.h>
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/util.h>
@@ -38,9 +40,6 @@
 #include "mcd-account-manager-priv.h"
 #include "mcd-account-priv.h"
 
-/* auto-generated stubs */
-#include "_gen/interfaces.h"
-
 typedef struct
 {
     const gchar *name;
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 6353de1..49cd97b 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -34,6 +34,8 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #include <dbus/dbus.h>
 
+#include <libmcclient/mc-interfaces.h>
+
 #include <telepathy-glib/dbus.h>
 #include <telepathy-glib/enums.h>
 #include <telepathy-glib/svc-generic.h>
@@ -50,7 +52,6 @@
 #include "mcd-master-priv.h"
 #include "mcd-misc.h"
 
-#include "_gen/interfaces.h"
 #include "_gen/svc-Account_Manager_Interface_Creation.h"
 
 #define WRITE_CONF_DELAY    500
diff --git a/src/mcd-account-requests.c b/src/mcd-account-requests.c
index d375cc1..fda4ab5 100644
--- a/src/mcd-account-requests.c
+++ b/src/mcd-account-requests.c
@@ -31,7 +31,9 @@
 #include <config.h>
 
 #include <dbus/dbus-glib-lowlevel.h>
+
 #include <libmcclient/mc-errors.h>
+#include <libmcclient/mc-interfaces.h>
 
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/svc-channel-request.h>
@@ -44,7 +46,6 @@
 #include "mcd-dispatcher-priv.h"
 #include "mcd-channel-priv.h"
 #include "mcd-misc.h"
-#include "_gen/interfaces.h"
 
 static void
 online_request_cb (McdAccount *account, gpointer userdata, const GError *error)
diff --git a/src/mcd-account-stats.c b/src/mcd-account-stats.c
index 9a3907b..00daf43 100644
--- a/src/mcd-account-stats.c
+++ b/src/mcd-account-stats.c
@@ -27,16 +27,16 @@
 #include <glib.h>
 #include <config.h>
 
+#include <libmcclient/mc-gtypes.h>
+#include <libmcclient/mc-interfaces.h>
+
 #include "mcd-account.h"
 #include "mcd-account-priv.h"
 #include "mcd-account-manager.h"
-#include "_gen/interfaces.h"
-#include "_gen/gtypes.h"
 #include <telepathy-glib/svc-generic.h>
 #include <telepathy-glib/gtypes.h>
 #include <telepathy-glib/util.h>
 
-
 static GHashTable *
 mcd_account_get_channel_count (McdAccount *account)
 {
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 1534167..c7d2878 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -39,6 +39,9 @@
 #include <telepathy-glib/svc-generic.h>
 #include <telepathy-glib/util.h>
 
+#include <libmcclient/mc-gtypes.h>
+#include <libmcclient/mc-interfaces.h>
+
 #include "mcd-account-priv.h"
 #include "mcd-account-compat.h"
 #include "mcd-account-conditions.h"
@@ -51,8 +54,6 @@
 #include "mcd-master.h"
 #include "mcd-master-priv.h"
 #include "mcd-dbusprop.h"
-#include "_gen/interfaces.h"
-#include "_gen/gtypes.h"
 
 #define DELAY_PROPERTY_CHANGED
 
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 25c2178..f6e0711 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -57,6 +57,8 @@
 #include <telepathy-glib/util.h>
 
 #include <libmcclient/mc-errors.h>
+#include <libmcclient/mc-gtypes.h>
+#include <libmcclient/mc-interfaces.h>
 
 #include "mcd-account-priv.h"
 #include "mcd-channel-priv.h"
@@ -68,8 +70,6 @@
 #include "sp_timestamp.h"
 
 #include "mcd-signals-marshal.h"
-#include "_gen/interfaces.h"
-#include "_gen/gtypes.h"
 #include "_gen/cli-Connection_Interface_Contact_Capabilities.h"
 #include "_gen/cli-Connection_Interface_Contact_Capabilities-body.h"
 
diff --git a/src/mcd-dbusprop.c b/src/mcd-dbusprop.c
index d434872..fab36a4 100644
--- a/src/mcd-dbusprop.c
+++ b/src/mcd-dbusprop.c
@@ -28,10 +28,9 @@
 #include <telepathy-glib/errors.h>
 #include "mcd-dbusprop.h"
 #include "mcd-debug.h"
-#include <_gen/interfaces.h>
-#include <_gen/interfaces-body.h>
-#include <_gen/gtypes.h>
-#include <_gen/gtypes-body.h>
+
+#include <libmcclient/mc-interfaces.h>
+#include <libmcclient/mc-gtypes.h>
 
 #define MCD_INTERFACES_QUARK get_interfaces_quark()
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list