From ef6b3b8daaef62a502c60e0faa22c3a4b10c0399 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 13 Nov 2012 13:32:15 +0100 Subject: Move service .xml into a common directory Both the service (in src/) and the client library (in libmessaging-menu/) need access to the dbus interface description file. Until now, it resided in src, with both Makefiles calling gdbus-codegen on it. This patch moves the file to common/ and builds a convenience library that contains only the generated code. --- Makefile.am | 1 + common/Makefile.am | 22 ++++++++++++++++ .../com.canonical.indicator.messages.service.xml | 24 +++++++++++++++++ configure.ac | 1 + libmessaging-menu/Makefile.am | 24 +++++------------ src/Makefile.am | 30 +++++----------------- src/messages-service.xml | 24 ----------------- test/Makefile.am | 4 +-- 8 files changed, 62 insertions(+), 68 deletions(-) create mode 100644 common/Makefile.am create mode 100644 common/com.canonical.indicator.messages.service.xml delete mode 100644 src/messages-service.xml diff --git a/Makefile.am b/Makefile.am index daeb2b7..f8141a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ + common \ src \ libmessaging-menu \ data \ diff --git a/common/Makefile.am b/common/Makefile.am new file mode 100644 index 0000000..5bd7e20 --- /dev/null +++ b/common/Makefile.am @@ -0,0 +1,22 @@ + +noinst_LTLIBRARIES = libmessaging-common.la + +indicator-messages-service.c: com.canonical.indicator.messages.service.xml + $(AM_V_GEN) gdbus-codegen \ + --interface-prefix com.canonical.indicator.messages. \ + --generate-c-code indicator-messages-service \ + --c-namespace IndicatorMessages \ + $^ +indicator-messages-service.h: indicator-messages-service.c + +BUILT_SOURCES = \ + indicator-messages-service.c \ + indicator-messages-service.h + +libmessaging_common_la_SOURCES = \ + $(BUILT_SOURCES) + +libmessaging_common_la_CFLAGS = $(GIO_CFLAGS) +libmessaging_common_la_LIBADD = $(GIO_LIBS) + +CLEANFILES = $(BUILT_SOURCES) diff --git a/common/com.canonical.indicator.messages.service.xml b/common/com.canonical.indicator.messages.service.xml new file mode 100644 index 0000000..00ae154 --- /dev/null +++ b/common/com.canonical.indicator.messages.service.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configure.ac b/configure.ac index 8aa2e8a..b5af4d1 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,7 @@ AM_GLIB_GNU_GETTEXT AC_OUTPUT([ Makefile src/Makefile +common/Makefile data/Makefile data/icons/Makefile data/icons/16x16/Makefile diff --git a/libmessaging-menu/Makefile.am b/libmessaging-menu/Makefile.am index 15d0c9b..411f7ff 100644 --- a/libmessaging-menu/Makefile.am +++ b/libmessaging-menu/Makefile.am @@ -7,36 +7,24 @@ libmessaging_menu_la_SOURCES = \ messaging-menu-app.c \ messaging-menu-message.c \ gtupleaction.c \ - gtupleaction.h \ - $(BUILT_SOURCES) + gtupleaction.h libmessaging_menu_la_HEADERS = \ messaging-menu-app.h \ messaging-menu.h \ messaging-menu-message.h -libmessaging_menu_la_LIBADD = $(GIO_LIBS) +libmessaging_menu_la_LIBADD = \ + $(GIO_LIBS) \ + $(top_builddir)/common/libmessaging-common.la libmessaging_menu_la_CFLAGS = \ + -I$(top_builddir)/common \ $(GIO_CFLAGS) \ -Wall libmessaging_menu_la_LDFLAGS = -export-symbols-regex "^messaging_menu_.*" -BUILT_SOURCES = \ - indicator-messages-service.c \ - indicator-messages-service.h - -CLEANFILES = $(BUILT_SOURCES) - -indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix com.canonical.indicator.messages. \ - --generate-c-code indicator-messages-service \ - --c-namespace IndicatorMessages \ - $^ -indicator-messages-service.h: indicator-messages-service.c - pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = messaging-menu.pc @@ -69,5 +57,5 @@ gir_DATA = $(INTROSPECTION_GIRS) typelibdir = $(libdir)/girepository-1.0 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) -CLEANFILES +=$(gir_DATA) $(typelib_DATA) +CLEANFILES = $(gir_DATA) $(typelib_DATA) endif diff --git a/src/Makefile.am b/src/Makefile.am index 1df80e5..a7bfe66 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,5 @@ -BUILT_SOURCES = EXTRA_DIST = -CLEANFILES = -DISTCLEANFILES = libexec_PROGRAMS = indicator-messages-service @@ -23,19 +20,20 @@ libmessaging_la_SOURCES = \ im-source-menu-item.h \ ido-detail-label.c \ ido-detail-label.h \ - indicator-messages-service.c \ - indicator-messages-service.h dbus-data.h libmessaging_la_CFLAGS = \ $(APPLET_CFLAGS) \ $(COVERAGE_CFLAGS) \ + -I$(top_builddir)/common \ -Wall \ -Wl,-Bsymbolic-functions \ -Wl,-z,defs \ -Wl,--as-needed \ -Werror \ -DG_LOG_DOMAIN=\"Indicator-Messages\" -libmessaging_la_LIBADD = $(APPLET_LIBS) -lm +libmessaging_la_LIBADD = \ + $(top_builddir)/common/libmessaging-common.la \ + $(APPLET_LIBS) -lm libmessaging_la_LDFLAGS = \ $(COVERAGE_LDFLAGS) \ -module -avoid-version @@ -46,8 +44,6 @@ libmessaging_la_LDFLAGS = \ indicator_messages_service_SOURCES = \ messages-service.c \ - indicator-messages-service.c \ - indicator-messages-service.h \ app-section.c \ app-section.h \ dbus-data.h \ @@ -61,6 +57,7 @@ indicator_messages_service_SOURCES = \ indicator_messages_service_CFLAGS = \ $(APPLET_CFLAGS) \ $(COVERAGE_CFLAGS) \ + -I$(top_builddir)/common \ -Wall \ -Wl,-Bsymbolic-functions \ -Wl,-z,defs \ @@ -69,26 +66,11 @@ indicator_messages_service_CFLAGS = \ -DG_LOG_DOMAIN=\"Indicator-Messages\" indicator_messages_service_LDADD = \ + $(top_builddir)/common/libmessaging-common.la \ $(APPLET_LIBS) indicator_messages_service_LDFLAGS = \ $(COVERAGE_LDFLAGS) -indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml - $(AM_V_GEN) gdbus-codegen \ - --interface-prefix com.canonical.indicator.messages. \ - --generate-c-code indicator-messages-service \ - --c-namespace IndicatorMessages \ - $^ -indicator-messages-service.h: indicator-messages-service.c - -BUILT_SOURCES += \ - indicator-messages-service.c \ - indicator-messages-service.h - EXTRA_DIST += \ messages-service.xml - -CLEANFILES += \ - $(BUILT_SOURCES) - diff --git a/src/messages-service.xml b/src/messages-service.xml deleted file mode 100644 index 00ae154..0000000 --- a/src/messages-service.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Makefile.am b/test/Makefile.am index 4671446..ee7cb3e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -38,8 +38,8 @@ noinst_LTLIBRARIES = \ libindicator-messages-service.la libindicator_messages_service_la_SOURCES = \ - $(top_builddir)/src/indicator-messages-service.c \ - $(top_builddir)/src/indicator-messages-service.h \ + $(top_builddir)/common/indicator-messages-service.c \ + $(top_builddir)/common/indicator-messages-service.h \ $(top_srcdir)/src/app-section.c \ $(top_srcdir)/src/app-section.h \ $(top_srcdir)/src/gactionmuxer.c \ -- cgit v1.2.3