[PATCH weston v3 2/3] libweston: use new versioning scheme

Emil Velikov emil.l.velikov at gmail.com
Fri Jul 22 13:51:51 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

Use the documented libweston-$major.so.0.$minor.$patch scheme.

An (almost) identical one is used by GLIB, GDK{2,3}, QT5, json-glib and
others.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
I kind of agree with Quentin that the revision log isn't too helpful
in the commit message in this case. Pekka feel free to move it if you
prefer.

v2:
 - Use shorter variable names LIBWESTON_{MAJOR,MINOR...}
 - Correctly use -version-info.
 - Drop unneeded @LIBWESTON_VERSION_MAJOR@ additions.
v3:
 - Elaborate/comment LT_VERSION_INFO (Quentin)
 - Add a missing underscore in libweston_la _ SOURCES, which led to the
earlier build/link issues.
---
 Makefile.am             | 24 ++++++++++++------------
 compositor/weston.pc.in |  2 +-
 configure.ac            | 14 +++++++++++---
 3 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b050c60..73ce22c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ noinst_PROGRAMS =
 libexec_PROGRAMS =
 moduledir = $(libdir)/weston
 module_LTLIBRARIES =
-libweston_moduledir = $(libdir)/libweston-${LIBWESTON_ABI_VERSION}
+libweston_moduledir = $(libdir)/libweston-$(LIBWESTON_MAJOR)
 libweston_module_LTLIBRARIES =
 noinst_LTLIBRARIES =
 BUILT_SOURCES =
@@ -61,15 +61,15 @@ CLEANFILES = weston.ini				\
 	internal-screenshot-00.png		\
 	$(BUILT_SOURCES)
 
-lib_LTLIBRARIES = libweston.la
-libweston_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
-libweston_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
-libweston_la_LIBADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
+lib_LTLIBRARIES = libweston- at LIBWESTON_MAJOR@.la
+libweston_ at LIBWESTON_MAJOR@_la_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON
+libweston_ at LIBWESTON_MAJOR@_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
+libweston_ at LIBWESTON_MAJOR@_la_LIBADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
 	$(DLOPEN_LIBS) -lm $(CLOCK_GETTIME_LIBS) \
 	$(LIBINPUT_BACKEND_LIBS) libshared.la
-libweston_la_LDFLAGS = -release ${LIBWESTON_ABI_VERSION}
+libweston_ at LIBWESTON_MAJOR@_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
 
-libweston_la_SOURCES =					\
+libweston_ at LIBWESTON_MAJOR@_la_SOURCES =			\
 	libweston/git-version.h				\
 	libweston/log.c					\
 	libweston/compositor.c				\
@@ -121,7 +121,7 @@ systemd_notify_la_SOURCES =			\
 	libweston/compositor.h
 endif
 
-nodist_libweston_la_SOURCES =					\
+nodist_libweston_ at LIBWESTON_MAJOR@_la_SOURCES =				\
 	protocol/weston-screenshooter-protocol.c			\
 	protocol/weston-screenshooter-server-protocol.h			\
 	protocol/text-cursor-position-protocol.c	\
@@ -137,7 +137,7 @@ nodist_libweston_la_SOURCES =					\
 	protocol/linux-dmabuf-unstable-v1-protocol.c	\
 	protocol/linux-dmabuf-unstable-v1-server-protocol.h
 
-BUILT_SOURCES += $(nodist_libweston_la_SOURCES)
+BUILT_SOURCES += $(nodist_libweston_ at LIBWESTON_MAJOR@_la_SOURCES)
 
 bin_PROGRAMS += weston
 
@@ -148,7 +148,7 @@ weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON 		\
 weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
 weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
 	$(DLOPEN_LIBS) $(LIBINPUT_BACKEND_LIBS) \
-	-lm libshared.la libweston.la
+	-lm libshared.la libweston- at LIBWESTON_MAJOR@.la
 
 weston_SOURCES = 					\
 	compositor/main.c				\
@@ -225,12 +225,12 @@ endif
 endif # BUILD_WESTON_LAUNCH
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = compositor/weston.pc libweston/libweston-${LIBWESTON_ABI_VERSION}.pc
+pkgconfig_DATA = compositor/weston.pc libweston/libweston-${LIBWESTON_MAJOR}.pc
 
 wayland_sessiondir = $(datadir)/wayland-sessions
 dist_wayland_session_DATA = compositor/weston.desktop
 
-libwestonincludedir = $(includedir)/libweston-${LIBWESTON_ABI_VERSION}
+libwestonincludedir = $(includedir)/libweston-${LIBWESTON_MAJOR}
 libwestoninclude_HEADERS =			\
 	libweston/version.h			\
 	libweston/compositor.h			\
diff --git a/compositor/weston.pc.in b/compositor/weston.pc.in
index 09e8580..6890a77 100644
--- a/compositor/weston.pc.in
+++ b/compositor/weston.pc.in
@@ -8,5 +8,5 @@ pkglibexecdir=${libexecdir}/@PACKAGE@
 Name: Weston Plugin API
 Description: Header files for Weston plugin development
 Version: @WESTON_VERSION@
-Requires.private: libweston- at LIBWESTON_ABI_VERSION@
+Requires.private: libweston- at LIBWESTON_MAJOR@
 Cflags: -I${includedir}/weston
diff --git a/configure.ac b/configure.ac
index 85a475a..74f931d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,9 @@ m4_define([weston_minor_version], [11])
 m4_define([weston_micro_version], [90])
 m4_define([weston_version],
           [weston_major_version.weston_minor_version.weston_micro_version])
-m4_define([libweston_abi_version], [0])
+m4_define([libweston_major_version], [0])
+m4_define([libweston_minor_version], [0])
+m4_define([libweston_patch_version], [0])
 
 AC_PREREQ([2.64])
 AC_INIT([weston],
@@ -18,7 +20,13 @@ AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version])
 AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version])
 AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version])
 AC_SUBST([WESTON_VERSION], [weston_version])
-AC_SUBST([LIBWESTON_ABI_VERSION], [libweston_abi_version])
+AC_SUBST([LIBWESTON_MAJOR], [libweston_major_version])
+# We use minor as current and age since on ABI/API break/removal we bump major
+# so minor will be reset to 0.
+m4_define([lt_current], [libweston_minor_version])
+m4_define([lt_revision], [libweston_patch_version])
+m4_define([lt_age], [libweston_minor_version])
+AC_SUBST([LT_VERSION_INFO], [lt_current:lt_revision:lt_age])
 
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
@@ -637,7 +645,7 @@ AC_CONFIG_FILES([Makefile libweston/version.h compositor/weston.pc])
 
 # AC_CONFIG_FILES needs the full name when running autoconf, so we need to use
 # libweston_abi_version here, and outside [] because of m4 quoting rules
-AC_CONFIG_FILES([libweston/libweston-]libweston_abi_version[.pc:libweston/libweston.pc.in])
+AC_CONFIG_FILES([libweston/libweston-]libweston_major_version[.pc:libweston/libweston.pc.in])
 
 AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
 
-- 
2.9.0



More information about the wayland-devel mailing list