mailarchive of the pengutronix oss-tools mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: oss-tools@pengutronix.de
Cc: rhi@pengutronix.de, "Enrico Jörns" <e.joerns@pengutronix.de>
Subject: [OSS-Tools] [PATCH dt-utils v2] meson: align libdt-utils version with autotools'
Date: Mon,  6 Nov 2023 14:49:07 +0100	[thread overview]
Message-ID: <20231106134907.859194-1-a.fatoum@pengutronix.de> (raw)

Makefile.am has following defines for libtool versioning:

  LIBDT_CURRENT=6
  LIBDT_REVISION=0
  LIBDT_AGE=0

along with a comment on how the values were chosen. Copy the comment and
the values into the meson.build as well, so appropriate symlinks
pointing at the versioned library are created. We forego the extra
complexity of having a common file that's read from both build systems
as we are intent on phasing out autotools anyway, once wrinkles such as
what's fixed here are ironed out.

The translation from libtool versioning to major/minor/revision as
expected by meson is taken from GNOME's gcab[1]. More information
about libtool versioning is available in its documentation[2].

[1]: https://gitlab.gnome.org/GNOME/gcab/-/commit/2c8048f74ec8c088397
[2]: https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html

Reported-by: Enrico Jörns <e.joerns@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

---
v1 -> v2:
  - set library version major as current - age
---
 meson.build | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meson.build b/meson.build
index 9579e712dfea..6489e4c4d52e 100644
--- a/meson.build
+++ b/meson.build
@@ -122,6 +122,18 @@ versiondep = declare_dependency(sources: version_h)
 
 meson.add_dist_script('version-gen', meson.project_version())
 
+# If the library source code has changed at all since the last release,
+#   then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
+# If any interfaces have been added/removed/changed since the last release,
+#   then increment current, and set revision to 0.
+# If any public interfaces have been added since the last public release,
+#   then increment age.
+# If any interfaces have been removed or changed since the last release,
+#   then set age to 0.
+lt_current = 6
+lt_revision = 0
+lt_age = 0
+
 mapfile = 'src/libdt-utils.sym'
 libdt_ld_flags = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
 
@@ -133,6 +145,7 @@ libdt = shared_library('dt-utils',
   c_args : ['-include', meson.current_build_dir() / 'version.h'],
   dependencies : [udevdep, versiondep],
   gnu_symbol_visibility : 'default',
+  version: '@0@.@1@.@2@'.format(lt_current - lt_age, lt_age, lt_revision),
   install : true)
 
 executable('barebox-state',
-- 
2.39.2




             reply	other threads:[~2023-11-06 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 13:49 Ahmad Fatoum [this message]
2023-11-24 11:23 ` Roland Hieber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231106134907.859194-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=e.joerns@pengutronix.de \
    --cc=oss-tools@pengutronix.de \
    --cc=rhi@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox