From f3c1536865463514a734f4d6cf6df41c807ab21c Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 1 Nov 2016 15:53:25 +0100 Subject: [PATCH] configure.ac, src/Makefile.am, add libtool versioning for shared library --- configure.ac | 19 +++++++++++++++++++ src/Makefile.am | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 40dfcf25a..696b091d5 100644 --- a/configure.ac +++ b/configure.ac @@ -14,6 +14,17 @@ # Initialisation of configure AC_INIT([ngspice], [26], [http://ngspice.sourceforge.net/bugrep.html]) +# libtool versioning for shared libraries current:revision:age +# 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 numbers (current - age) to current. +# libtool in msys2 generates a single version number (current-age) +# libtool in LINUX generates the numbers as: (current-age).age.revision +# LIBRARY_VERSION may be overridden by external LIB_VERSION +LIBRARY_VERSION="0:0:0" + # Unique file in the source directory AC_CONFIG_SRCDIR([src/ngspice.c]) @@ -300,6 +311,12 @@ else dprefix=$prefix fi +# external LIB_VERSION ? +ext_LIB_VERSION=${LIB_VERSION+yes} +if test "x$ext_LIB_VERSION" != xyes; then + LIB_VERSION=$LIBRARY_VERSION +fi + ########################################################################## # # ngspice as shared library (ngspice.so or ngspice.dll) @@ -482,6 +499,7 @@ else TCL_PACKAGE_PATH="" TCL_LIB_SPEC="" AC_SUBST([STATIC], [-static]) + LIB_VERSION="" fi @@ -494,6 +512,7 @@ AM_CONDITIONAL([TCLCYG], [test "x$has_tclcyg" = xtrue]) AC_SUBST([TCL_PACKAGE_PATH]) AC_SUBST([TCL_LIB_SPEC]) +AC_SUBST([LIB_VERSION]) ################################################################## # # diff --git a/src/Makefile.am b/src/Makefile.am index eec46cd59..627882894 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -541,7 +541,7 @@ libngspice_la_LIBADD += \ libngspice_la_CFLAGS = -shared -libngspice_la_LDFLAGS = -shared +libngspice_la_LDFLAGS = -shared -version-info @LIB_VERSION@ if SHWIN libngspice_la_LDFLAGS += -Wl,--output-def=ngspice.def -Wl,--out-implib=ngspice.dll.a