Skip to content

Commit 53a90d8

Browse files
Niklas Casseldamien-lemoal
authored andcommitted
build: use libtool option -version-number
By default, libtool -version-info does not produce a .so file that contains the library release version number in the file name. Better library file naming with backward compatibility for applications can be achieved in a simple manner by using the libtool option -version-number. Fix configure.ac and the library makefile to use this option. Fixes: e5ae91a ("build: fix library versioning") Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent d3e3532 commit 53a90d8

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

configure.ac

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ PACKAGE_VERSION_MAJOR=$(echo $PACKAGE_VERSION | awk -F. '{print $1}')
1313
PACKAGE_VERSION_MINOR=$(echo $PACKAGE_VERSION | awk -F. '{print $2}')
1414
PACKAGE_VERSION_RELEASE=$(echo $PACKAGE_VERSION | awk -F. '{print $3}')
1515

16-
# libzbc library version
17-
LIBZBC_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE"
18-
LIBZBC_LT_MAJOR=$PACKAGE_VERSION_MAJOR
19-
LIBZBC_LT_MINOR=$PACKAGE_VERSION_MINOR
20-
LIBZBC_LT_RELEASE=0
21-
LIBZBC_VERSION_INFO=$(( LIBZBC_LT_MAJOR + LIBZBC_LT_MINOR )):$LIBZBC_LT_RELEASE:$LIBZBC_LT_MINOR
22-
23-
AC_SUBST([LIBZBC_VERSION])
24-
AC_SUBST([LIBZBC_VERSION_INFO])
16+
# libtool friendly library version format
17+
LIBZBC_VERSION_LT=$PACKAGE_VERSION_MAJOR:$PACKAGE_VERSION_MINOR:$PACKAGE_VERSION_RELEASE
18+
AC_SUBST([LIBZBC_VERSION_LT])
2519

2620
AC_CONFIG_AUX_DIR([build-aux])
2721
AC_CONFIG_MACRO_DIR([m4])

lib/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ libzbc_la_SOURCES = $(CFILES) $(HFILES)
3838
libzbc_la_CFLAGS = $(AM_CFLAGS) -fPIC
3939
libzbc_la_LDFLAGS = \
4040
-Wl,--version-script,${srcdir}/exports \
41-
-version-info @LIBZBC_VERSION_INFO@
41+
-version-number @LIBZBC_VERSION_LT@

lib/libzbc.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ includedir=@includedir@
1010

1111
Name: libzbc
1212
Description: A library for accessing and managing ZBC/ZAC devices
13-
Version: @LIBZBC_VERSION@
13+
Version: @PACKAGE_VERSION@
1414
Cflags: -I${includedir}
1515
Libs: -L${libdir} -lzbc
1616

0 commit comments

Comments
 (0)