[PATCHv2,6/8] configure.ac: make SO (shared object) version unique

Message ID 1421327732-28123-1-git-send-email-anders.roxell@linaro.org
State New
Headers show

Commit Message

Anders Roxell Jan. 15, 2015, 1:15 p.m.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 configure.ac           |  9 +++++++++
 platform/Makefile.inc  |  2 ++
 scripts/odp_version.sh | 10 +++++++++-
 3 files changed, 20 insertions(+), 1 deletion(-)

Patch

diff --git a/configure.ac b/configure.ac
index d5808ec..abad5b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,13 @@  AC_TYPE_UINT32_T
 AC_TYPE_UINT64_T
 
 ##########################################################################
+# Set correct platform library version
+##########################################################################
+ODP_LIBSO_AGE=0
+ODP_LIBSO_VERSION=$(./scripts/odp_version.sh ${ODP_LIBSO_AGE})
+AC_SUBST(ODP_LIBSO_VERSION)
+
+##########################################################################
 # Determine which platform to build for
 ##########################################################################
 AC_ARG_WITH([platform],
@@ -232,6 +239,8 @@  AC_MSG_RESULT([
 	$PACKAGE $VERSION
 	========
 
+	Library version:	${ODP_LIBSO_VERSION}
+
 	with_platform:		${with_platform}
 	prefix:			${prefix}
 	sysconfdir:		${sysconfdir}
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 6ffa2ad..9e73fc4 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -9,3 +9,5 @@  pkgconfig_DATA = $(top_builddir)/pkgconfig/libodp.pc
 
 VPATH = $(srcdir) $(builddir)
 lib_LTLIBRARIES = $(LIB)/libodp.la
+
+AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
diff --git a/scripts/odp_version.sh b/scripts/odp_version.sh
index 72ae404..fed2a6b 100755
--- a/scripts/odp_version.sh
+++ b/scripts/odp_version.sh
@@ -6,4 +6,12 @@  GEN=`grep "define ODP_VERSION_API_GENERATION"	${VFILE} | cut -d ' ' -f 3`
 MAJ=`grep "define ODP_VERSION_API_MAJOR"	${VFILE} | cut -d ' ' -f 3`
 MIN=`grep "define ODP_VERSION_API_MINOR"	${VFILE} | cut -d ' ' -f 3`
 
-echo -n $GEN.$MAJ.$MIN
+if [[ -n $1 ]]; then
+	# Set library version
+	CURRENT=$((${GEN}*100 + ${MAJ}))
+	REVISION=$MIN
+	AGE=$1
+	echo -n "${CURRENT}:${REVISION}:${AGE}"
+else
+	echo -n $GEN.$MAJ.$MIN
+fi