]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libsframe: add library versioning
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 18:52:43 +0000 (11:52 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 19:01:56 +0000 (12:01 -0700)
lisbframe was first released with Bintuils 2.40.  As the library
evolves, some changes will break the ABI.  Add library versioning for
users to manage these changes.

For the next release of the library (libsframe.so.1), incompatible ABI
changes are planned. These will include:
 - Deprecation of some APIs, like sframe_get_funcdesc_with_addr (), and
 - Change in the contract of some APIs (e.g., return type, behavior).

In libtool-version, set the current to 1 to prepare for the upcoming
release.  Reset revision and age to 0.

Add libtool-version file to EXTRA_DIST.

libsframe/
* Makefile.am: Use libtool versioning.
* Makefile.in: Regenerated.
* libtool-version: New file.

libsframe/Makefile.am
libsframe/Makefile.in
libsframe/libtool-version [new file with mode: 0644]

index 2d736624208e23fce9ad0648637942df28bd2d18..2d1d8fff06369b0b76f61ec5409e6cac76d544b0 100644 (file)
@@ -29,6 +29,7 @@ INCDIR = $(srcdir)/../include
 # include libctf for swap.h
 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../libctf
 AM_CFLAGS = @ac_libsframe_warn_cflags@
+libsframe_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 
 if INSTALL_LIBBFD
 lib_LTLIBRARIES = libsframe.la
@@ -40,6 +41,10 @@ endif
 
 libsframe_la_SOURCES = sframe.c sframe-dump.c sframe-error.c
 libsframe_la_CPPFLAGS = $(AM_CPPFLAGS)
+libsframe_la_LDFLAGS = $(libsframe_version_info)
+
+EXTRA_DIST = libtool-version
+diststuff: $(EXTRA_DIST) info
 
 include doc/local.mk
 
index c6a4cd56a9ee0a0118083fed02d89f91b65965b9..57f912caa13df7d9df0113b8df7e5cb7016fb091 100644 (file)
@@ -180,6 +180,9 @@ AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
+libsframe_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(libsframe_la_LDFLAGS) $(LDFLAGS) -o $@
 @INSTALL_LIBBFD_FALSE@am_libsframe_la_rpath =
 @INSTALL_LIBBFD_TRUE@am_libsframe_la_rpath = -rpath $(libdir)
 @HAVE_COMPAT_DEJAGNU_TRUE@am__EXEEXT_1 = testsuite/libsframe.decode/be-flipping$(EXEEXT) \
@@ -519,12 +522,15 @@ INCDIR = $(srcdir)/../include
 # include libctf for swap.h
 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../libctf
 AM_CFLAGS = @ac_libsframe_warn_cflags@
+libsframe_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 @INSTALL_LIBBFD_TRUE@lib_LTLIBRARIES = libsframe.la
 @INSTALL_LIBBFD_FALSE@include_HEADERS = 
 @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/sframe.h $(INCDIR)/sframe-api.h
 @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libsframe.la
 libsframe_la_SOURCES = sframe.c sframe-dump.c sframe-error.c
 libsframe_la_CPPFLAGS = $(AM_CPPFLAGS)
+libsframe_la_LDFLAGS = $(libsframe_version_info)
+EXTRA_DIST = libtool-version
 @BUILD_INFO_TRUE@AM_MAKEINFOFLAGS = --no-split
 
 # Setup the testing framework
@@ -654,7 +660,7 @@ clean-noinstLTLIBRARIES:
        }
 
 libsframe.la: $(libsframe_la_OBJECTS) $(libsframe_la_DEPENDENCIES) $(EXTRA_libsframe_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(LINK) $(am_libsframe_la_rpath) $(libsframe_la_OBJECTS) $(libsframe_la_LIBADD) $(LIBS)
+       $(AM_V_CCLD)$(libsframe_la_LINK) $(am_libsframe_la_rpath) $(libsframe_la_OBJECTS) $(libsframe_la_LIBADD) $(LIBS)
 
 clean-checkPROGRAMS:
        @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -1568,6 +1574,7 @@ uninstall-am: uninstall-dvi-am uninstall-html-am \
 
 .PRECIOUS: Makefile
 
+diststuff: $(EXTRA_DIST) info
 
 @BUILD_INFO_TRUE@html-local: doc/sframe-spec/index.html
 @BUILD_INFO_TRUE@doc/sframe-spec/index.html: doc/sframe-spec.texi doc/$(am__dirstamp)
diff --git a/libsframe/libtool-version b/libsframe/libtool-version
new file mode 100644 (file)
index 0000000..9dcbe48
--- /dev/null
@@ -0,0 +1,30 @@
+# This file is used to maintain libtool version info for libsframe.  See
+# the libtool manual to understand the meaning of the fields.  This is
+# a separate file so that version updates don't involve re-running
+# automake.
+#
+# Here are a set of rules to help you update your library version
+# information:
+#
+# 1. Start with version information of `0:0:0' for each libtool library.
+#
+# 2. Update the version information only immediately before a public
+#    release of your software. More frequent updates are unnecessary,
+#    and only guarantee that the current interface number gets larger
+#    faster.
+#
+# 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. Increase the age value only if the changes made to the ABI are backward
+#    compatible.
+#    a. If any interfaces have been added since the last public release,
+#       then increment age.
+#    b. If any interfaces have been removed since the last public release,
+#       then set age to 0.
+#
+# CURRENT:REVISION:AGE
+1:0:0