From 959bf59516b6d1a95ea6da2bb36aa9ab2437590e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 26 Sep 2023 11:21:40 +0200 Subject: [PATCH] Add soname for libcomposefs This starts at 1.0.0 to signal incompatibilty with all previous (unstable) releases. At this point we strive to be ABI compat, and update the soname micro for non-api changes, and the minor for api additions. Signed-off-by: Alexander Larsson --- configure.ac | 29 +++++++++++++++++++++++++++++ libcomposefs/Makefile-lib.am | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2ac8ef31..16187a3a 100644 --- a/configure.ac +++ b/configure.ac @@ -4,11 +4,40 @@ AC_CONFIG_SRCDIR([tools/mkcomposefs.c]) AC_CONFIG_HEADERS([config.h]) AC_SYS_LARGEFILE +# Library soname versioning: +# +# Note that this is different from the package version, as the package +# version is more of a human-oriented version for the tools, and does +# not encode library compatibility. +# +# Making releases: +# If library added functions or features: +# LIBCOMPOSEFS_VERSION_MICRO = 0; +# LIBCOMPOSEFS_VERSION_MINOR += 1; +# else, if library code changes: +# LIBCOMPOSEFS_VERSION_MICRO += 1; +# +# Only touch LIBCOMPOSEFS_VERSION_MAJOR if breaking ABI. +# (And never do that lightly) + +m4_define([LIBCOMPOSEFS_VERSION_MAJOR], [1]) +m4_define([LIBCOMPOSEFS_VERSION_MINOR], [0]) +m4_define([LIBCOMPOSEFS_VERSION_MICRO], [0]) + LT_PREREQ([2.2.6]) LT_INIT() AM_INIT_AUTOMAKE([1.11.2 -Wno-portability foreign tar-ustar no-dist-gzip dist-xz subdir-objects]) +m4_define([lt_current], [m4_eval(LIBCOMPOSEFS_VERSION_MINOR + LIBCOMPOSEFS_VERSION_MAJOR)]) +m4_define([lt_revision], [LIBCOMPOSEFS_VERSION_MICRO]) +m4_define([lt_age], [LIBCOMPOSEFS_VERSION_MINOR]) +LT_VERSION_INFO="lt_current:lt_revision:lt_age" +AC_SUBST(LT_VERSION_INFO) + +LIBCOMPOSEFS_RELEASE_ARGS="-version-info $LT_VERSION_INFO" +AC_SUBST([LIBCOMPOSEFS_RELEASE_ARGS]) + AC_PROG_CC PKG_PROG_PKG_CONFIG m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig)) diff --git a/libcomposefs/Makefile-lib.am b/libcomposefs/Makefile-lib.am index 4b4d4010..deb9dc90 100644 --- a/libcomposefs/Makefile-lib.am +++ b/libcomposefs/Makefile-lib.am @@ -19,4 +19,4 @@ libcomposefs_la_SOURCES = \ $(COMPOSEFSDIR)/lcfs-mount.h \ $(COMPOSEFSDIR)/xalloc-oversized.h libcomposefs_la_CFLAGS = $(WARN_CFLAGS) $(COMPOSEFS_HASH_CFLAGS) $(LCFS_DEP_CRYPTO_CFLAGS) $(HIDDEN_VISIBILITY_CFLAGS) -libcomposefs_la_LIBADD = $(LCFS_DEP_CRYPTO_LIBS) +libcomposefs_la_LIBADD = $(LCFS_DEP_CRYPTO_LIBS) $(LIBCOMPOSEFS_RELEASE_ARGS)