[next] telepathy-glib: telepathy-farstream: use versioned symbols

Simon McVittie smcv at kemper.freedesktop.org
Tue Mar 25 07:21:11 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 1657f3becb26db72242861ba0f3c08208752a5e7
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=1657f3becb26db72242861ba0f3c08208752a5e7

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Mar 21 17:28:08 2014 +0000

telepathy-farstream: use versioned symbols

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76462
Reviewed-by: Xavier Claessens

---

 telepathy-farstream/1.0.abi     |   16 +++++++
 telepathy-farstream/Makefile.am |   87 ++++++++++++++++++++++++++++++++++++---
 2 files changed, 98 insertions(+), 5 deletions(-)

diff --git a/telepathy-farstream/1.0.abi b/telepathy-farstream/1.0.abi
new file mode 100644
index 0000000..0765e20
--- /dev/null
+++ b/telepathy-farstream/1.0.abi
@@ -0,0 +1,16 @@
+Version: TELEPATHY_FARSTREAM_1.0
+Extends: -
+Release: 1.0
+
+tf_channel_bus_message
+tf_channel_get_type
+tf_channel_new_async
+tf_channel_new_finish
+tf_content_error
+tf_content_error_literal
+tf_content_get_type
+tf_content_iterate_src_pads
+tf_content_receiving_failed
+tf_content_receiving_failed_literal
+tf_content_sending_failed
+tf_content_sending_failed_literal
diff --git a/telepathy-farstream/Makefile.am b/telepathy-farstream/Makefile.am
index 06d3392..abe4e33 100644
--- a/telepathy-farstream/Makefile.am
+++ b/telepathy-farstream/Makefile.am
@@ -8,7 +8,7 @@ apisources = \
 	content.c \
 	channel.c
 
-libtelepathy_farstream_1_la_SOURCES = \
+libtelepathy_farstream_internal_la_SOURCES = \
 	$(tfinclude_HEADERS) \
 	$(apisources) \
 	content-priv.h \
@@ -22,9 +22,10 @@ libtelepathy_farstream_1_la_SOURCES = \
 	call-priv.h \
 	utils.h
 
-nodist_libtelepathy_farstream_1_la_SOURCES = $(BUILT_SOURCES)
+nodist_libtelepathy_farstream_internal_la_SOURCES = $(BUILT_SOURCES)
 
 lib_LTLIBRARIES = libtelepathy-farstream-1.la
+noinst_LTLIBRARIES = libtelepathy-farstream-internal.la
 
 pkgconfigdir = ${libdir}/pkgconfig
 pkgconfig_DATA = telepathy-farstream-1.pc
@@ -42,7 +43,7 @@ AM_CFLAGS = \
 	-DG_LOG_DOMAIN=\"tp-fs\" \
 	$(ERROR_CFLAGS)
 
-libtelepathy_farstream_1_la_LIBADD = \
+libtelepathy_farstream_internal_la_LIBADD = \
 	$(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 \
@@ -52,10 +53,86 @@ libtelepathy_farstream_1_la_LIBADD = \
 	$(FARSTREAM_LIBS) \
 	$(NULL)
 
-libtelepathy_farstream_1_la_LDFLAGS =  -no-undefined \
-	-export-symbols-regex "^tf_(init|content_|channel_).*" \
+libtelepathy_farstream_internal_la_LDFLAGS = \
+	-no-undefined \
+	$(NULL)
+
+libtelepathy_farstream_1_la_SOURCES =
+nodist_libtelepathy_farstream_1_la_SOURCES =
+libtelepathy_farstream_1_la_LIBADD = libtelepathy-farstream-internal.la
+libtelepathy_farstream_1_la_LDFLAGS = \
 	-version-info "$(TPFS_LT_CURRENT)":"$(TPFS_LT_REVISION)":"$(TPFS_LT_AGE)"
 
+libtelepathy_farstream_1_la_DEPENDENCIES = \
+	libtelepathy-farstream-internal.la \
+	Makefile.am \
+	$(NULL)
+
+if HAVE_LD_VERSION_SCRIPT
+
+libtelepathy_farstream_1_la_LDFLAGS += \
+	$(VERSION_SCRIPT_ARG)=_gen/version-script.txt \
+	$(NULL)
+
+libtelepathy_farstream_1_la_DEPENDENCIES += \
+	_gen/version-script.txt \
+	$(NULL)
+
+else
+
+libtelepathy_farstream_1_la_LDFLAGS +=
+	-export-symbols-regex "^tf_.*" \
+	$(NULL)
+
+endif
+
+# Must put oldest versions first
+ABI_LISTS = \
+	1.0.abi \
+	$(NULL)
+
+_gen/abi.txt: libtelepathy-farstream-internal.la Makefile.am
+	$(MKDIR_P) _gen
+	$(NM) .libs/libtelepathy-farstream-internal.a > _gen/abi.nm
+	grep " [DT] " < _gen/abi.nm > _gen/abi.funcs
+	cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames
+	grep "^tf_" < _gen/abi.funcnames > _gen/abi.tpfuncnames
+	$(AM_V_GEN)sort -u < _gen/abi.tpfuncnames > $@
+
+MAKE_VERSION_SCRIPT_FLAGS =
+
+if !OFFICIAL_RELEASE
+# 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_FARSTREAM_ at VERSION@_UNRELEASED \
+	$(NULL)
+endif
+
+_gen/version-script.txt: \
+    $(ABI_LISTS) \
+    _gen/abi.txt \
+    Makefile.am \
+    $(top_srcdir)/tools/make-version-script.py \
+    $(NULL)
+	$(AM_V_GEN)set -e; \
+	$(PYTHON) $(top_srcdir)/tools/make-version-script.py \
+		 --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \
+		 $(patsubst %,$(srcdir)/%,$(ABI_LISTS)) > $@
+	$(AM_V_GEN)set -e; \
+	$(PYTHON) $(top_srcdir)/tools/make-version-script.py \
+		 --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \
+		 --dpkg "libtelepathy-farstream-1.so.0 #PACKAGE# #MINVER#" \
+		 --dpkg-build-depends-package "libtelepathy-farstream-1-dev" \
+		 $(patsubst %,$(srcdir)/%,$(ABI_LISTS)) \
+		 > _gen/libtelepathy-farstream-1-0.symbols
+	sed -n -e "s/^[	 ]*\\(tf_.*\\);/\\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
+
+# vim:ft=automake:
+
 -include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
 INTROSPECTION_SCANNER_ARGS = \



More information about the telepathy-commits mailing list