[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH designer] Adapt saner libtool versioning scheme from libvirt



From: "Daniel P. Berrange" <berrange redhat com>

The current way libtool versioning is calculated has a timebomb
when the package version number changes to 1.0.0, which will
cause the library soname to change. Adapt to the latest libvirt
macros for libtool versioning, which use an explicit variable
LIBVIRT_DESIGNER_SONUM setting for changing soname.
---
 configure.ac | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index c999826..2a55f75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,9 +19,47 @@ LIBVIRT_DESIGNER_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
 LIBVIRT_DESIGNER_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'`
 LIBVIRT_DESIGNER_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'`
 LIBVIRT_DESIGNER_VERSION=$LIBVIRT_DESIGNER_MAJOR_VERSION.$LIBVIRT_DESIGNER_MINOR_VERSION.$LIBVIRT_DESIGNER_MICRO_VERSION$LIBVIRT_DESIGNER_MICRO_VERSION_SUFFIX
-LIBVIRT_DESIGNER_VERSION_INFO=`expr $LIBVIRT_DESIGNER_MAJOR_VERSION + $LIBVIRT_DESIGNER_MINOR_VERSION`:$LIBVIRT_DESIGNER_MICRO_VERSION:$LIBVIRT_DESIGNER_MINOR_VERSION
 LIBVIRT_DESIGNER_VERSION_NUMBER=`expr $LIBVIRT_DESIGNER_MAJOR_VERSION \* 1000000 + $LIBVIRT_DESIGNER_MINOR_VERSION \* 1000 + $LIBVIRT_DESIGNER_MICRO_VERSION`
 
+# In libtool terminology we need to figure out:
+#
+# CURRENT
+#     The most recent interface number that this library implements.
+#
+# REVISION
+#     The implementation number of the CURRENT interface.
+#
+# AGE
+#     The difference between the newest and oldest interfaces that this
+#     library implements.
+#
+# In other words, the library implements all the interface numbers
+# in the range from number `CURRENT - AGE' to `CURRENT'.
+#
+# Libtool assigns the soname version from `CURRENT - AGE', and we
+# don't want that to ever change in libvirt. ie it must always be
+# zero, to produce libvirt.so.0.
+#
+# We would, however, like the libvirt-designer version number reflected
+# in the so version'd symlinks, and this is based on AGE.REVISION
+# eg  libvirt-designer.so.0.AGE.REVISION
+#
+# Assuming we do ever want to break soname version, this can
+# toggled. But seriously, don't touch this, unless we explicitly
+# agree to break ABI on the mailing list.
+LIBVIRT_DESIGNER_SONUM=0
+
+# The following examples show what libtool will do
+#
+# Input: 0.9.14 ->   libvirt-designer.so.0.9.14
+# Input: 1.0.0  ->   libvirt-designer.so.0.1000.0
+# Input: 2.5.8  ->   libvirt-designer.so.0.2005.8
+#
+AGE=`expr $LIBVIRT_DESIGNER_MAJOR_VERSION '*' 1000 + $LIBVIRT_DESIGNER_MINOR_VERSION`
+REVISION=$LIBVIRT_DESIGNER_MICRO_VERSION
+CURRENT=`expr $LIBVIRT_DESIGNER_SONUM + $AGE`
+LIBVIRT_DESIGNER_VERSION_INFO=$CURRENT:$REVISION:$AGE
+
 AC_SUBST([LIBVIRT_DESIGNER_MAJOR_VERSION])
 AC_SUBST([LIBVIRT_DESIGNER_MINOR_VERSION])
 AC_SUBST([LIBVIRT_DESIGNER_MICRO_VERSION])
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]