From 573169e24d56da833e6553dc59fbc719ea402805 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 6 Mar 2012 14:13:55 +0000 Subject: [PATCH 01/10] Split library into main, dbus and core Eventually, the dbus part will contain all the generated code, core will contain enough of TpProxy to support that, and the main part will contain all the high-level API. At the moment, circular dependencies mean that we have to keep almost everything in the main part. The core part contains the error quark for TpError and the generated enums, and the dbus part contains the quarks for interface names. --- configure.ac | 16 +++ docs/reference/Makefile.am | 2 + examples/client/Makefile.am | 2 + examples/client/stream-tubes/Makefile.am | 7 +- examples/cm/call/Makefile.am | 2 + examples/cm/channelspecific/Makefile.am | 2 + examples/cm/contactlist/Makefile.am | 2 + examples/cm/echo-message-parts/Makefile.am | 2 + examples/cm/extended/Makefile.am | 2 + examples/cm/no-protocols/Makefile.am | 2 + examples/extensions/Makefile.am | 5 +- telepathy-glib/Makefile.am | 87 +++++++++++--- telepathy-glib/TelepathyGLibDBus-1.metadata | 1 + telepathy-glib/abi.am | 121 ++++++++++++++++---- telepathy-glib/codegen.am | 22 +++- telepathy-glib/introspection.am | 39 ++++++- .../telepathy-glib-1-dbus-uninstalled.pc.in | 12 ++ telepathy-glib/telepathy-glib-1-dbus.pc.in | 12 ++ telepathy-glib/telepathy-glib-1.pc.in | 3 +- telepathy-glib/versions/1.0.0.abi | 6 - telepathy-glib/versions/core-1.0.0.abi | 6 + telepathy-glib/versions/dbus-1.0.0.abi | 6 + telepathy-glib/versions/main-1.0.0.abi | 6 + tests/Makefile.am | 20 +++- tests/dbus/Makefile.am | 10 ++- tests/lib/Makefile.am | 17 ++- 26 files changed, 341 insertions(+), 71 deletions(-) create mode 100644 telepathy-glib/TelepathyGLibDBus-1.metadata create mode 100644 telepathy-glib/telepathy-glib-1-dbus-uninstalled.pc.in create mode 100644 telepathy-glib/telepathy-glib-1-dbus.pc.in delete mode 100644 telepathy-glib/versions/1.0.0.abi create mode 100644 telepathy-glib/versions/core-1.0.0.abi create mode 100644 telepathy-glib/versions/dbus-1.0.0.abi create mode 100644 telepathy-glib/versions/main-1.0.0.abi diff --git a/configure.ac b/configure.ac index 90afb7f..d19f30a 100644 --- a/configure.ac +++ b/configure.ac @@ -26,10 +26,17 @@ m4_define([tp_glib_nano_version], [1]) # (we don't guarantee that we won't add ABI then remove it again, if it was # never seen in a release). +# These are shared by libtelepathy-glib-1 and libtelepathy-glib-1-core m4_define([tp_glib_lt_current], [0]) m4_define([tp_glib_lt_revision], [0]) m4_define([tp_glib_lt_age], [0]) +# The same, but for the generated code in libtelepathy-glib-1-dbus; this +# breaks ABI more often +m4_define([tp_glib_lt_dbus_current], [0]) +m4_define([tp_glib_lt_dbus_revision], [0]) +m4_define([tp_glib_lt_dbus_age], [0]) + # Some magic m4_define([tp_glib_base_version], [tp_glib_major_version.tp_glib_minor_version.tp_glib_micro_version]) @@ -68,6 +75,13 @@ AC_SUBST([LT_CURRENT]) AC_SUBST([LT_REVISION]) AC_SUBST([LT_AGE]) +LT_DBUS_CURRENT=tp_glib_lt_dbus_current +LT_DBUS_REVISION=tp_glib_lt_dbus_revision +LT_DBUS_AGE=tp_glib_lt_dbus_age +AC_SUBST([LT_DBUS_CURRENT]) +AC_SUBST([LT_DBUS_REVISION]) +AC_SUBST([LT_DBUS_AGE]) + # Disable GLib deprecation warnings for now; GValueArray is deprecated but we # need it for dbus-glib. AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated]) @@ -329,6 +343,8 @@ AC_OUTPUT( Makefile \ examples/extensions/Makefile \ spec/Makefile \ telepathy-glib/Makefile \ + telepathy-glib/telepathy-glib-1-dbus.pc \ + telepathy-glib/telepathy-glib-1-dbus-uninstalled.pc \ telepathy-glib/telepathy-glib-1.pc \ telepathy-glib/telepathy-glib-1-uninstalled.pc \ tests/Makefile \ diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index a6b1bab..e399843 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -112,6 +112,8 @@ expand_content_files= GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) @DBUS_CFLAGS@ @GLIB_CFLAGS@ GTKDOC_LIBS = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(NULL) diff --git a/examples/client/Makefile.am b/examples/client/Makefile.am index ebc200a..1f73801 100644 --- a/examples/client/Makefile.am +++ b/examples/client/Makefile.am @@ -51,6 +51,8 @@ endif # AM_CPPFLAGS. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/client/stream-tubes/Makefile.am b/examples/client/stream-tubes/Makefile.am index 3bb7cb7..dd648ed 100644 --- a/examples/client/stream-tubes/Makefile.am +++ b/examples/client/stream-tubes/Makefile.am @@ -7,11 +7,14 @@ offerer_SOURCES = offerer.c accepter_SOURCES = accepter.c # In an external project you'd use $(TP_GLIB_LIBS) (obtained from -# pkg-config via autoconf) instead of the .la path +# pkg-config via autoconf) instead of these .la paths LDADD = \ @DBUS_LIBS@ \ @GLIB_LIBS@ \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ diff --git a/examples/cm/call/Makefile.am b/examples/cm/call/Makefile.am index 462352a..c07aa99 100644 --- a/examples/cm/call/Makefile.am +++ b/examples/cm/call/Makefile.am @@ -55,6 +55,8 @@ clean-local: # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/cm/channelspecific/Makefile.am b/examples/cm/channelspecific/Makefile.am index 2d83b32..a32b514 100644 --- a/examples/cm/channelspecific/Makefile.am +++ b/examples/cm/channelspecific/Makefile.am @@ -52,6 +52,8 @@ clean-local: # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/cm/contactlist/Makefile.am b/examples/cm/contactlist/Makefile.am index 5e7b5a2..8e6472d 100644 --- a/examples/cm/contactlist/Makefile.am +++ b/examples/cm/contactlist/Makefile.am @@ -48,6 +48,8 @@ clean-local: # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/cm/echo-message-parts/Makefile.am b/examples/cm/echo-message-parts/Makefile.am index fbcfddb..be32c8c 100644 --- a/examples/cm/echo-message-parts/Makefile.am +++ b/examples/cm/echo-message-parts/Makefile.am @@ -48,6 +48,8 @@ clean-local: # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/cm/extended/Makefile.am b/examples/cm/extended/Makefile.am index 981da35..98e6c7a 100644 --- a/examples/cm/extended/Makefile.am +++ b/examples/cm/extended/Makefile.am @@ -37,6 +37,8 @@ clean-local: LDADD = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/cm/no-protocols/Makefile.am b/examples/cm/no-protocols/Makefile.am index 8a4d67a..e3f5418 100644 --- a/examples/cm/no-protocols/Makefile.am +++ b/examples/cm/no-protocols/Makefile.am @@ -32,6 +32,8 @@ clean-local: # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/examples/extensions/Makefile.am b/examples/extensions/Makefile.am index aee74ec..51f36cd 100644 --- a/examples/extensions/Makefile.am +++ b/examples/extensions/Makefile.am @@ -30,7 +30,10 @@ noinst_LTLIBRARIES = libexample-extensions.la libexample_extensions_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) # The client-specific parts are built into a separate .o file, so the linker # can discard them when linking services. The service-specific parts are diff --git a/telepathy-glib/Makefile.am b/telepathy-glib/Makefile.am index 56f5513..162afdd 100644 --- a/telepathy-glib/Makefile.am +++ b/telepathy-glib/Makefile.am @@ -2,9 +2,11 @@ include $(top_srcdir)/tools/flymake.mk tpgincludedir=$(includedir)/telepathy-glib-1/telepathy-glib genincludedir=$(tpgincludedir)/_gen +tpgdbusincludedir=$(includedir)/telepathy-glib-1-dbus/telepathy-glib +gendbusincludedir=$(tpgdbusincludedir)/_gen pkgconfigdir = ${libdir}/pkgconfig -pkgconfig_DATA = telepathy-glib-1.pc +pkgconfig_DATA = telepathy-glib-1.pc telepathy-glib-1-dbus.pc EXTRA_DIST = \ $(ABI_LISTS) \ @@ -12,15 +14,27 @@ EXTRA_DIST = \ $(introspection_extra_dist) \ extra-gtkdoc.h -# libtelepathy-glib is just a shared version of libtelepathy-glib-internal, -# produced by abi.am. +# libtelepathy-glib-1 is just a shared version of +# libtelepathy-glib-main-internal, produced by abi.am. Similarly, +# libtelepathy-glib-1-core and libtelepathy-glib-1-dbus are shared versions of +# libtelepathy-glib-core-internal and -dbus-internal. # # The static version is necessary because one of the tests wants to use -# internal symbols (_tp_log) which are made invisible by GNU ld. +# internal symbols (_tp_log) which are made invisible by GNU ld, and it +# makes checking consistency of the ABI easier. -lib_LTLIBRARIES = libtelepathy-glib-1.la -noinst_LTLIBRARIES = libtelepathy-glib-internal.la \ - libtelepathy-glib-reentrants.la +lib_LTLIBRARIES = \ + libtelepathy-glib-1.la \ + libtelepathy-glib-1-dbus.la \ + libtelepathy-glib-1-core.la \ + $(NULL) + +noinst_LTLIBRARIES = \ + libtelepathy-glib-main-internal.la \ + libtelepathy-glib-dbus-internal.la \ + libtelepathy-glib-core-internal.la \ + libtelepathy-glib-reentrants.la \ + $(NULL) # headers that are subject to coding-style checks our_headers = \ @@ -145,13 +159,33 @@ clean-local: check_c_sources = \ $(our_headers) \ - $(libtelepathy_glib_internal_la_SOURCES) + $(libtelepathy_glib_core_internal_la_SOURCES) \ + $(libtelepathy_glib_dbus_internal_la_SOURCES) \ + $(libtelepathy_glib_main_internal_la_SOURCES) \ + $(NULL) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style -libtelepathy_glib_internal_la_LIBADD = $(ALL_LIBS) -libtelepathy_glib_internal_la_SOURCES = \ +libtelepathy_glib_core_internal_la_LIBADD = $(ALL_LIBS) +libtelepathy_glib_core_internal_la_SOURCES = \ + errors.c \ + $(NULL) + +libtelepathy_glib_dbus_internal_la_LIBADD = \ + $(ALL_LIBS) \ + libtelepathy-glib-1-core.la \ + $(NULL) +libtelepathy_glib_dbus_internal_la_SOURCES = \ + interfaces.c \ + $(NULL) + +libtelepathy_glib_main_internal_la_LIBADD = \ + $(ALL_LIBS) \ + libtelepathy-glib-1-dbus.la \ + $(NULL) + +libtelepathy_glib_main_internal_la_SOURCES = \ account.c \ account-channel-request.c \ account-channel-request-internal.h \ @@ -230,9 +264,7 @@ libtelepathy_glib_internal_la_SOURCES = \ debug-sender.c \ deprecated-internal.h \ dtmf.c \ - interfaces.c \ debug-internal.h \ - errors.c \ exportable-channel.c \ file-transfer-channel.c \ gnio-util.c \ @@ -301,12 +333,33 @@ include codegen.am include introspection.am Android.mk: Makefile.am - androgenizer -:PROJECT telepathy-glib -:SHARED libtelepathy-glib -:TAGS eng debug \ + androgenizer -:PROJECT telepathy-glib \ + \ + -:SHARED libtelepathy-glib-1-core -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libtelepathy_glib_core_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_core_internal_la_SOURCES) \ + -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(GIO_UNIX_CFLAGS) $(DBUS_CFLAGS) $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ + -:LDFLAGS $(ALL_LIBS) \ + $(libtelepathy_glib_core_internal_la_LDFLAGS) \ + \ + -:SHARED libtelepathy-glib-1-dbus -:TAGS eng debug \ + -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ + -:SOURCES $(libtelepathy_glib_dbus_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_dbus_internal_la_SOURCES) \ + -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(GIO_UNIX_CFLAGS) $(DBUS_CFLAGS) $(AM_CFLAGS) \ + -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ + -:LDFLAGS $(ALL_LIBS) -ltelepathy-glib-1-core \ + $(libtelepathy_glib_dbus_internal_la_LDFLAGS) \ + \ + -:SHARED libtelepathy-glib-1 -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ - -:SOURCES $(libtelepathy_glib_internal_la_SOURCES) \ - $(nodist_libtelepathy_glib_internal_la_SOURCES) \ + -:SOURCES $(libtelepathy_glib_main_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_main_internal_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(GIO_UNIX_CFLAGS) $(DBUS_CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ - -:LDFLAGS $(libtelepathy_glib_internal_la_LIBADD) \ - $(libtelepathy_glib_internal_la_LDFLAGS) \ + -:LDFLAGS $(ALL_LIBS) -ltelepathy-glib-1-dbus -ltelepathy-glib-1-core \ + $(libtelepathy_glib_main_internal_la_LDFLAGS) \ + \ > $@ diff --git a/telepathy-glib/TelepathyGLibDBus-1.metadata b/telepathy-glib/TelepathyGLibDBus-1.metadata new file mode 100644 index 0000000..a262192 --- /dev/null +++ b/telepathy-glib/TelepathyGLibDBus-1.metadata @@ -0,0 +1 @@ +TelepathyGLibDBus name="TelepathyGLibDBus" diff --git a/telepathy-glib/abi.am b/telepathy-glib/abi.am index 3624c18..465ea30 100644 --- a/telepathy-glib/abi.am +++ b/telepathy-glib/abi.am @@ -1,23 +1,76 @@ # To be included by Makefile.am. ABI_LISTS = \ - versions/1.0.0.abi \ + versions/core-1.0.0.abi \ + versions/dbus-1.0.0.abi \ + versions/main-1.0.0.abi \ $(NULL) # The quoting here is unnecessary but harmless, and has the useful side-effect # that vim quickfix mode (:make) doesn't interpret the libtool --mode=link # command as an error message in a bizarrely named file +# +# libtelepathy-glib-core shares its Libtool versioning with libtelepathy-glib: +# they are intended to be upgraded in lockstep, and always break ABI at the +# same time. +libtelepathy_glib_1_core_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -no-undefined \ + -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" \ + $(NULL) +libtelepathy_glib_1_core_la_LIBADD = libtelepathy-glib-core-internal.la +nodist_libtelepathy_glib_1_core_la_SOURCES = +libtelepathy_glib_1_core_la_DEPENDENCIES = \ + libtelepathy-glib-core-internal.la \ + abi.am \ + $(NULL) + +libtelepathy_glib_1_dbus_la_LDFLAGS = \ + $(AM_LDFLAGS) \ + -no-undefined \ + -version-info "$(LT_DBUS_CURRENT)":"$(LT_DBUS_REVISION)":"$(LT_DBUS_AGE)" \ + $(NULL) +libtelepathy_glib_1_dbus_la_LIBADD = libtelepathy-glib-dbus-internal.la +nodist_libtelepathy_glib_1_dbus_la_SOURCES = +libtelepathy_glib_1_dbus_la_DEPENDENCIES = \ + libtelepathy-glib-dbus-internal.la \ + abi.am \ + $(NULL) + libtelepathy_glib_1_la_LDFLAGS = \ $(AM_LDFLAGS) \ -no-undefined \ - -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" -libtelepathy_glib_1_la_LIBADD = libtelepathy-glib-internal.la + -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" \ + $(NULL) +libtelepathy_glib_1_la_LIBADD = libtelepathy-glib-main-internal.la nodist_libtelepathy_glib_1_la_SOURCES = -libtelepathy_glib_1_la_DEPENDENCIES = libtelepathy-glib-internal.la abi.am +libtelepathy_glib_1_la_DEPENDENCIES = \ + libtelepathy-glib-main-internal.la \ + abi.am \ + $(NULL) if HAVE_LD_VERSION_SCRIPT -nodist_libtelepathy_glib_1_la_SOURCES += _gen/version-script.txt -libtelepathy_glib_1_la_DEPENDENCIES += _gen/version-script.txt _gen/abi.txt +nodist_libtelepathy_glib_1_la_SOURCES += \ + _gen/main-version-script.txt \ + $(NULL) +nodist_libtelepathy_glib_1_dbus_la_SOURCES += \ + _gen/dbus-version-script.txt \ + $(NULL) +nodist_libtelepathy_glib_1_core_la_SOURCES += \ + _gen/core-version-script.txt \ + $(NULL) +libtelepathy_glib_1_la_DEPENDENCIES += \ + _gen/main-version-script.txt \ + _gen/main-abi.txt \ + $(NULL) +libtelepathy_glib_1_dbus_la_DEPENDENCIES += \ + _gen/dbus-version-script.txt \ + _gen/dbus-abi.txt \ + $(NULL) +libtelepathy_glib_1_core_la_DEPENDENCIES += \ + _gen/core-version-script.txt \ + _gen/core-abi.txt \ + $(NULL) if OFFICIAL_RELEASE # don't allow undocumented ABI @@ -26,36 +79,56 @@ else # allow new ABI, and silently put it in a dummy version (which can be used to # check whether binaries have been linked against unguaranteed ABI) MAKE_VERSION_SCRIPT_FLAGS = \ - --unreleased-version=TELEPATHY_GLIB_@VERSION@_UNRELEASED + --unreleased-version=TELEPATHY_GLIB$${SUFFIX}_@VERSION@_UNRELEASED endif -_gen/version-script.txt: $(ABI_LISTS) _gen/abi.txt abi.am \ - $(top_srcdir)/tools/make-version-script.py - $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/make-version-script.py \ - --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ - $(ABI_LISTS:%=$(srcdir)/%) > $@ +_gen/%-version-script.txt: \ + $(ABI_LISTS) \ + _gen/%-abi.txt \ + abi.am \ + $(top_srcdir)/tools/make-version-script.py \ + $(NULL) + $(AM_V_GEN)set -e; \ + if test "$*" = main; then SUFFIX=""; else SUFFIX="_$*"; fi; \ + $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ + --symbols=_gen/$*-abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ + $(patsubst %,$(srcdir)/%,$(filter versions/$*-%,$(ABI_LISTS))) > $@ + $(AM_V_GEN)set -e; \ + if test "$*" = main; then suffix=""; else suffix="-$*"; fi; \ + if test "$*" = main; then SUFFIX=""; else SUFFIX="_$*"; fi; \ + if test "$${suffix}" = ""; then binpkg="libtelepathy-glib-1-0"; \ + else binpkg="libtelepathy-glib-1$${suffix}0"; fi; \ $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ - --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ - --dpkg "libtelepathy-glib.so.0 libtelepathy-glib0 #MINVER#" \ - --dpkg-build-depends-package "libtelepathy-glib-dev" \ - $(ABI_LISTS:%=$(srcdir)/%) > _gen/libtelepathy-glib0.symbols - sed -n -e "s/^[ ]*\\(tp_.*\\);/\\1/p" < $@ > _gen/versioned-abi.tmp - sort -u < _gen/versioned-abi.tmp > _gen/versioned-abi.txt + --symbols=_gen/$*-abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ + --dpkg "libtelepathy-glib-1$${suffix}.so.0 $${binpkg} #MINVER#" \ + --dpkg-build-depends-package "libtelepathy-glib-1-dev" \ + $(patsubst %,$(srcdir)/%,$(filter versions/$*-%,$(ABI_LISTS))) \ + > _gen/$${binpkg}.symbols + sed -n -e "s/^[ ]*\\(tp_.*\\);/\\1/p" < $@ > _gen/$*-versioned-abi.tmp + sort -u < _gen/$*-versioned-abi.tmp > _gen/$*-versioned-abi.txt : # the versioned API should always match the ^tp API - diff -c _gen/versioned-abi.txt _gen/abi.txt + diff -c _gen/$*-versioned-abi.txt _gen/$*-abi.txt -_gen/abi.txt: libtelepathy-glib-internal.la abi.am - $(NM) .libs/libtelepathy-glib-internal.a > _gen/abi.nm - grep " [DT] " < _gen/abi.nm > _gen/abi.funcs +_gen/%-abi.txt: libtelepathy-glib-%-internal.la abi.am + $(NM) .libs/libtelepathy-glib-$*-internal.a > _gen/abi.nm + grep " [DT] " < _gen/abi.nm > _gen/abi.funcs || test $$? = 1 cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames - grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames + grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames || test $$? = 1 $(AM_V_GEN)sort -u < _gen/abi.tpfuncnames > $@ libtelepathy_glib_1_la_LDFLAGS += \ - $(VERSION_SCRIPT_ARG)=_gen/version-script.txt + $(VERSION_SCRIPT_ARG)=_gen/main-version-script.txt + +libtelepathy_glib_1_dbus_la_LDFLAGS += \ + $(VERSION_SCRIPT_ARG)=_gen/dbus-version-script.txt + +libtelepathy_glib_1_core_la_LDFLAGS += \ + $(VERSION_SCRIPT_ARG)=_gen/core-version-script.txt else # !HAVE_LD_VERSION_SCRIPT +libtelepathy_glib_1_core_la_LDFLAGS += -export-symbols-regex '^tp' +libtelepathy_glib_1_dbus_la_LDFLAGS += -export-symbols-regex '^tp' libtelepathy_glib_1_la_LDFLAGS += -export-symbols-regex '^tp' endif # !HAVE_LD_VERSION_SCRIPT diff --git a/telepathy-glib/codegen.am b/telepathy-glib/codegen.am index 55d3971..c613906 100644 --- a/telepathy-glib/codegen.am +++ b/telepathy-glib/codegen.am @@ -27,17 +27,23 @@ codegen_extra_dist = \ tls-cert.xml codegen_sources = \ - $(nodist_libtelepathy_glib_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_core_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_dbus_internal_la_SOURCES) \ + $(nodist_libtelepathy_glib_main_internal_la_SOURCES) \ $(nodist_geninclude_HEADERS) \ + $(nodist_gendbusinclude_HEADERS) \ _gen/stable-spec.xml \ _gen/spec-stamp \ _gen/stable-stamp \ $(NULL) +nodist_gendbusinclude_HEADERS = \ + _gen/telepathy-interfaces.h \ + $(NULL) + nodist_geninclude_HEADERS = \ _gen/error-str.h \ _gen/telepathy-enums.h \ - _gen/telepathy-interfaces.h \ _gen/genums.h \ _gen/gtypes.h \ _gen/tp-cli-account.h \ @@ -74,10 +80,16 @@ nodist_geninclude_HEADERS = \ _gen/tp-svc-protocol.h \ _gen/tp-svc-tls-cert.h -nodist_libtelepathy_glib_internal_la_SOURCES = \ - _gen/error-str.c \ - _gen/interfaces-body.h \ +nodist_libtelepathy_glib_core_internal_la_SOURCES = \ _gen/genums.c \ + $(NULL) + +nodist_libtelepathy_glib_dbus_internal_la_SOURCES = \ + _gen/interfaces-body.h \ + $(NULL) + +nodist_libtelepathy_glib_main_internal_la_SOURCES = \ + _gen/error-str.c \ _gen/gtypes-body.h \ _gen/register-dbus-glib-marshallers-body.h \ _gen/tp-cli-account-body.h \ diff --git a/telepathy-glib/introspection.am b/telepathy-glib/introspection.am index dfbc7cc..987aebb 100644 --- a/telepathy-glib/introspection.am +++ b/telepathy-glib/introspection.am @@ -2,15 +2,16 @@ introspection_extra_dist = \ TelepathyGLib-1.metadata \ + TelepathyGLibDBus-1.metadata \ $(NULL) if HAVE_INTROSPECTION include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = TelepathyGLib-1.gir +INTROSPECTION_GIRS = TelepathyGLib-1.gir TelepathyGLibDBus-1.gir -TelepathyGLib-1.gir: libtelepathy-glib-1.la +TelepathyGLib-1.gir: libtelepathy-glib-1.la libtelepathy-glib-1-core.la # /!\ Order matters, see https://bugzilla.gnome.org/show_bug.cgi?id=660629 TelepathyGLib_1_gir_FILES = \ $(srcdir)/proxy.c _gen/proxy-introspectable.h \ @@ -73,12 +74,19 @@ TelepathyGLib_1_gir_FILES = \ $(srcdir)/channel-dispatcher.c $(srcdir)/channel-dispatcher.h \ $(srcdir)/errors.c $(srcdir)/errors.h \ _gen/telepathy-enums.h _gen/telepathy-enums-gtk-doc.h \ + $(NULL) + +TelepathyGLibDBus-1.gir: libtelepathy-glib-1-dbus.la TelepathyGLib-1.gir +TelepathyGLibDBus_1_gir_FILES = \ _gen/telepathy-interfaces.h \ $(NULL) TelepathyGLib_1_gir_NAMESPACE = TelepathyGLib TelepathyGLib_1_gir_VERSION = 1 -TelepathyGLib_1_gir_LIBS = libtelepathy-glib-1.la +TelepathyGLib_1_gir_LIBS = \ + libtelepathy-glib-1.la \ + libtelepathy-glib-1-core.la \ + $(NULL) TelepathyGLib_1_gir_EXPORT_PACKAGES = telepathy-glib-1 TelepathyGLib_1_gir_SCANNERFLAGS = \ @@ -99,12 +107,35 @@ TelepathyGLib_1_gir_PACKAGES = \ dbus-glib-1 \ $(NULL) +TelepathyGLibDBus_1_gir_NAMESPACE = TelepathyGLibDBus +TelepathyGLibDBus_1_gir_VERSION = 1 +TelepathyGLibDBus_1_gir_LIBS = \ + libtelepathy-glib-1-dbus.la \ + $(NULL) +TelepathyGLibDBus_1_gir_EXPORT_PACKAGES = telepathy-glib-1-dbus +TelepathyGLibDBus_1_gir_SCANNERFLAGS = \ + --identifier-prefix=Tp \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + --c-include="telepathy-glib/telepathy-glib.h" \ + --warn-all \ + --include-uninstalled=TelepathyGLib-1.gir \ + $(NULL) +TelepathyGLibDBus_1_gir_INCLUDES = \ + GLib-2.0 \ + Gio-2.0 \ + $(NULL) +TelepathyGLibDBus_1_gir_PACKAGES = \ + gio-2.0 \ + dbus-glib-1 \ + $(NULL) + _gen/proxy-introspectable.h: proxy.h introspection.am @$(mkdir_p) _gen $(AM_V_GEN)sed -e 's/gpointer self/TpProxy *self/' < $< > $@ girdir = $(datadir)/gir-1.0 -dist_gir_DATA = TelepathyGLib-1.gir +dist_gir_DATA = TelepathyGLib-1.gir TelepathyGLibDBus-1.gir typelibsdir = $(libdir)/girepository-1.0/ typelibs_DATA = $(dist_gir_DATA:.gir=.typelib) diff --git a/telepathy-glib/telepathy-glib-1-dbus-uninstalled.pc.in b/telepathy-glib/telepathy-glib-1-dbus-uninstalled.pc.in new file mode 100644 index 0000000..83bf20e --- /dev/null +++ b/telepathy-glib/telepathy-glib-1-dbus-uninstalled.pc.in @@ -0,0 +1,12 @@ +prefix= +exec_prefix= +abs_top_srcdir=@abs_top_srcdir@ +abs_top_builddir=@abs_top_builddir@ + +Name: Telepathy-GLib-DBus (uninstalled copy) +Description: D-Bus interfaces from the Telepathy framework +Version: @VERSION@ +Requires: pkg-config >= 0.21 +Requires.private: dbus-glib-1 >= 0.82, glib-2.0 >= 2.30, gobject-2.0 >= 2.30, gio-2.0 >= 2.30 +Libs: ${abs_top_builddir}/telepathy-glib/libtelepathy-glib-1-dbus.la +Cflags: -I${abs_top_srcdir} -I${abs_top_builddir} diff --git a/telepathy-glib/telepathy-glib-1-dbus.pc.in b/telepathy-glib/telepathy-glib-1-dbus.pc.in new file mode 100644 index 0000000..7e97e90 --- /dev/null +++ b/telepathy-glib/telepathy-glib-1-dbus.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Telepathy-GLib-DBus +Description: D-Bus interfaces from the Telepathy framework +Version: @VERSION@ +Requires: pkg-config >= 0.21 +Requires.private: dbus-glib-1 >= 0.82, glib-2.0 >= 2.30, gobject-2.0 >= 2.30, gio-2.0 >= 2.30 +Libs: -L${libdir} -ltelepathy-glib-1-dbus -ltelepathy-glib-1-core +Cflags: -I${includedir}/telepathy-glib-1-dbus -I${includedir}/telepathy-glib-1 diff --git a/telepathy-glib/telepathy-glib-1.pc.in b/telepathy-glib/telepathy-glib-1.pc.in index a115d90..f3bb34c 100644 --- a/telepathy-glib/telepathy-glib-1.pc.in +++ b/telepathy-glib/telepathy-glib-1.pc.in @@ -8,5 +8,6 @@ Description: GLib utility library for the Telepathy framework Version: @VERSION@ Requires: pkg-config >= 0.21 Requires.private: dbus-glib-1 >= 0.82, glib-2.0 >= 2.30, gobject-2.0 >= 2.30, gio-2.0 >= 2.30 -Libs: -L${libdir} -ltelepathy-glib-1 +Libs: -L${libdir} -ltelepathy-glib-1 -ltelepathy-glib-1-core +Libs.private: -ltelepathy-glib-1-dbus Cflags: -I${includedir}/telepathy-glib-1 diff --git a/telepathy-glib/versions/1.0.0.abi b/telepathy-glib/versions/1.0.0.abi deleted file mode 100644 index daef347..0000000 --- a/telepathy-glib/versions/1.0.0.abi +++ /dev/null @@ -1,6 +0,0 @@ -Version: TELEPATHY_GLIB_1.0.0 -Extends: - -Release: 1.0.0 - -# just to have something in this file -tp_account_get_type diff --git a/telepathy-glib/versions/core-1.0.0.abi b/telepathy-glib/versions/core-1.0.0.abi new file mode 100644 index 0000000..60a381f --- /dev/null +++ b/telepathy-glib/versions/core-1.0.0.abi @@ -0,0 +1,6 @@ +Version: TELEPATHY_GLIB_CORE_1.0.0 +Extends: - +Release: 1.0.0 + +# just to have something in this file +tp_error_quark diff --git a/telepathy-glib/versions/dbus-1.0.0.abi b/telepathy-glib/versions/dbus-1.0.0.abi new file mode 100644 index 0000000..b1ce61a --- /dev/null +++ b/telepathy-glib/versions/dbus-1.0.0.abi @@ -0,0 +1,6 @@ +Version: TELEPATHY_GLIB_DBUS_1.0.0 +Extends: - +Release: 1.0.0 + +# just to have something in this file +tp_iface_quark_connection_manager diff --git a/telepathy-glib/versions/main-1.0.0.abi b/telepathy-glib/versions/main-1.0.0.abi new file mode 100644 index 0000000..daef347 --- /dev/null +++ b/telepathy-glib/versions/main-1.0.0.abi @@ -0,0 +1,6 @@ +Version: TELEPATHY_GLIB_1.0.0 +Extends: - +Release: 1.0.0 + +# just to have something in this file +tp_account_get_type diff --git a/tests/Makefile.am b/tests/Makefile.am index d687111..ed1fd80 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -77,7 +77,9 @@ test_capabilities_SOURCES = \ capabilities.c test_capabilities_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) # this one uses internal ABI @@ -85,7 +87,9 @@ test_contact_search_result_SOURCES = \ contact-search-result.c test_contact_search_result_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) test_dtmf_player_SOURCES = dtmf-player.c @@ -126,9 +130,15 @@ test_signal_connect_object_LDADD = \ # this needs to link against the static convenience library so that # _tp_log is still visible test_debug_domain_LDADD = \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) test_internal_debug_LDADD = \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) check_c_sources = *.c include $(top_srcdir)/tools/check-coding-style.mk @@ -136,6 +146,8 @@ check-local: check-coding-style LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) diff --git a/tests/dbus/Makefile.am b/tests/dbus/Makefile.am index 1aec2e2..fcdd8c9 100644 --- a/tests/dbus/Makefile.am +++ b/tests/dbus/Makefile.am @@ -81,6 +81,8 @@ LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-reentrants.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) @@ -91,7 +93,9 @@ test_account_SOURCES = account.c test_account_channel_request_SOURCES = account-channel-request.c test_account_channel_request_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) test_account_manager_SOURCES = account-manager.c @@ -230,7 +234,9 @@ test_cm_message_SOURCES = \ cm-message.c test_cm_message_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ $(GLIB_LIBS) test_text_channel_SOURCES = text-channel.c diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index 1126dc0..310ebdf 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -1,10 +1,11 @@ # It's necessary to distinguish between modules that link to # libtelepathy-glib-1.la (normally a shared library, containing a copy of -# libtelepathy-glib-internal.la) and libtelepathy-glib-internal.la (a static -# convenience library). Under -Bsymbolic, you can't safely link both. +# libtelepathy-glib-main-internal.la) and libtelepathy-glib-main-internal.la +# itself (a static convenience library). Under -Bsymbolic, you can't safely +# link both. # # You can either link to libtp-glib-tests.la and libtelepathy-glib-1.la, -# or to libtp-glib-tests-internal.la and libtelepathy-glib-internal.la. +# or to libtp-glib-tests-internal.la and libtelepathy-glib-main-internal.la. # Do not mix the versions. # # See https://bugs.freedesktop.org/show_bug.cgi?id=39183 @@ -86,9 +87,15 @@ AM_LDFLAGS = \ libtp_glib_tests_internal_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-main-internal.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) libtp_glib_tests_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ - $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la + $(top_builddir)/telepathy-glib/libtelepathy-glib-1.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-dbus.la \ + $(top_builddir)/telepathy-glib/libtelepathy-glib-1-core.la \ + $(NULL) -- 1.7.9.1