Skip to content

Commit 8560131

Browse files
rework library versioning
1 parent e20ddc3 commit 8560131

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

CMakeLists.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ else()
4242
endif()
4343

4444
# shared library versioning
45-
# increment if interfaces have been added, removed or changed
46-
set(LIBTOOL_CURRENT 43)
47-
# increment if source code has changed set to zero if current is incremented
48-
set(LIBTOOL_REVISION 0)
49-
# increment if interfaces have been added set to zero if interfaces have been
50-
# removed or changed
51-
set(LIBTOOL_AGE 1)
45+
# increment if interfaces have been removed or changed
46+
set(WOLFSSL_LIBRARY_VERSION_FIRST 42)
5247

53-
math(EXPR LIBTOOL_SO_VERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
54-
set(LIBTOOL_FULL_VERSION ${LIBTOOL_SO_VERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION})
48+
# increment if interfaces have been added
49+
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented
50+
set(WOLFSSL_LIBRARY_VERSION_SECOND 1)
51+
52+
# increment if source code has changed
53+
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented or
54+
# WOLFSSL_LIBRARY_VERSION_SECOND is incremented
55+
set(WOLFSSL_LIBRARY_VERSION_THIRD 0)
56+
57+
set(LIBTOOL_FULL_VERSION ${WOLFSSL_LIBRARY_VERSION_FIRST}.${WOLFSSL_LIBRARY_VERSION_SECOND}.${WOLFSSL_LIBRARY_VERSION_THIRD})
5558

5659
set(WOLFSSL_DEFINITIONS)
5760
set(WOLFSSL_LINK_LIBS)
@@ -2210,7 +2213,7 @@ endif()
22102213

22112214
set_target_properties(wolfssl
22122215
PROPERTIES
2213-
SOVERSION ${LIBTOOL_SO_VERSION}
2216+
SOVERSION ${WOLFSSL_LIBRARY_VERSION_FIRST}
22142217
VERSION ${LIBTOOL_FULL_VERSION}
22152218
)
22162219

configure.ac

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,20 @@ AC_SUBST([WOLFSSL_CONFIG_ARGS])
4545

4646
# shared library versioning
4747
# The three numbers in the libwolfssl.so.*.*.* file name. Unfortunately
48-
# these numbers don't always line up nicely with the library version.
48+
49+
# increment if interfaces have been removed or changed
4950
WOLFSSL_LIBRARY_VERSION_FIRST=42
51+
52+
# increment if interfaces have been added
53+
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented
5054
WOLFSSL_LIBRARY_VERSION_SECOND=1
55+
56+
# increment if source code has changed
57+
# set to zero if WOLFSSL_LIBRARY_VERSION_FIRST is incremented or
58+
# WOLFSSL_LIBRARY_VERSION_SECOND is incremented
5159
WOLFSSL_LIBRARY_VERSION_THIRD=0
52-
WOLFSSL_LIBRARY_VERSION=43:0:1
53-
# | | |
54-
# +------+ | +---+
55-
# | | |
56-
# current:revision:age
57-
# | | |
58-
# | | +- increment if interfaces have been added
59-
# | | set to zero if interfaces have been removed
60-
# | | or changed
61-
# | +- increment if source code has changed
62-
# | set to zero if current is incremented
63-
# +- increment if interfaces have been added, removed or changed
60+
61+
WOLFSSL_LIBRARY_VERSION=${WOLFSSL_LIBRARY_VERSION_FIRST}:${WOLFSSL_LIBRARY_VERSION_SECOND}:${WOLFSSL_LIBRARY_VERSION_THIRD}
6462
AC_SUBST([WOLFSSL_LIBRARY_VERSION_FIRST])
6563
AC_SUBST([WOLFSSL_LIBRARY_VERSION_SECOND])
6664
AC_SUBST([WOLFSSL_LIBRARY_VERSION_THIRD])

src/include.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if !BUILD_NO_LIBRARY
3232
lib_LTLIBRARIES+= src/libwolfssl@LIBSUFFIX@.la
3333
endif
3434
src_libwolfssl@LIBSUFFIX@_la_SOURCES =
35-
src_libwolfssl@LIBSUFFIX@_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined -version-info ${WOLFSSL_LIBRARY_VERSION}
35+
src_libwolfssl@LIBSUFFIX@_la_LDFLAGS = ${AM_LDFLAGS} -no-undefined -version-number ${WOLFSSL_LIBRARY_VERSION}
3636
src_libwolfssl@LIBSUFFIX@_la_LIBADD = $(LIBM) $(LIB_ADD) $(LIB_STATIC_ADD)
3737
src_libwolfssl@LIBSUFFIX@_la_CFLAGS = -DBUILDING_WOLFSSL $(AM_CFLAGS) -DLIBWOLFSSL_GLOBAL_EXTRA_CFLAGS="\" $(EXTRA_CFLAGS)\""
3838
src_libwolfssl@LIBSUFFIX@_la_CPPFLAGS = -DBUILDING_WOLFSSL $(AM_CPPFLAGS)

0 commit comments

Comments
 (0)