From: Bartosz Golaszewski Date: Tue, 13 Mar 2018 17:14:48 +0000 (+0100) Subject: build: use separate versioning schemes for API & ABI X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e8f582ff71f8af895eb9ec7fc3b55b79becde14;p=qemu-gpiodev%2Flibgpiod.git build: use separate versioning schemes for API & ABI Commit 783ff2e3c707 ("API: start certain enums from 1") broke the ABI compatibility (while keeping the source compatibility). We need to indicate that to the users by changing the SONAME string. Up until now the SONAME would correspond with the major release number. We now need to have a separate versioning schemes for API and ABI. Keep using the same MAJOR.MINOR.RELEASE scheme for the API, but switch to using the libtool versioning - CURRENT.REVISION.AGE - for ABI. Start the ABI version from 2.0.0 to indicate that it changed since 1.0.0. Define a separate ABI version for the C++ bindings, but start with 0.0.0 since it was not a part of any release yet. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/Makefile.am b/bindings/cxx/Makefile.am index f7b3f17..16a2a2c 100644 --- a/bindings/cxx/Makefile.am +++ b/bindings/cxx/Makefile.am @@ -10,7 +10,7 @@ lib_LTLIBRARIES = libgpiodcxx.la libgpiodcxx_la_SOURCES = chip.cpp iter.cpp line.cpp line_bulk.cpp libgpiodcxx_la_CPPFLAGS = -Wall -Wextra -g -std=gnu++11 libgpiodcxx_la_CPPFLAGS += -fvisibility=hidden -I$(top_srcdir)/include/ -libgpiodcxx_la_LDFLAGS = -version-number $(subst .,:,$(PACKAGE_VERSION)) +libgpiodcxx_la_LDFLAGS = -version-info $(subst .,:,$(ABI_CXX_VERSION)) libgpiodcxx_la_LDFLAGS += -lgpiod -L$(top_builddir)/src/lib include_HEADERS = gpiod.hpp diff --git a/configure.ac b/configure.ac index 10048cc..d318a0e 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,23 @@ AC_DEFINE_UNQUOTED([GPIOD_VERSION_STR], [Full library version string.]) AC_SUBST(VERSION_STR, [$PACKAGE_VERSION$EXTRA_VERSION]) +# From the libtool manual: +# +# (...) +# 3. If the library source code has changed at all since the last update, then +# increment revision (‘c:r:a’ becomes ‘c:r+1:a’). +# 4. If any interfaces have been added, removed, or changed since the last +# update, increment current, and set revision to 0. +# 5. If any interfaces have been added since the last public release, then +# increment age. +# 6. If any interfaces have been removed or changed since the last public +# release, then set age to 0. +# +# Define the libtool version as (C.R.A): +AC_SUBST(ABI_VERSION, [2.0.0]) +# Have a separate ABI version for C++ bindings: +AC_SUBST(ABI_CXX_VERSION, [0.0.0]) + AC_CONFIG_AUX_DIR([autostuff]) AC_CONFIG_MACRO_DIRS([m4]) AM_INIT_AUTOMAKE([foreign subdir-objects]) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 94c2a84..3f797c4 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -11,4 +11,4 @@ libgpiod_la_SOURCES = core.c ctxless.c helpers.c iter.c misc.c libgpiod_la_CFLAGS = -Wall -Wextra -g libgpiod_la_CFLAGS += -fvisibility=hidden -I$(top_srcdir)/include/ libgpiod_la_CFLAGS += -include $(top_builddir)/config.h -libgpiod_la_LDFLAGS = -version-number $(subst .,:,$(PACKAGE_VERSION)) +libgpiod_la_LDFLAGS = -version-info $(subst .,:,$(ABI_VERSION))