Soroush Rabiei
Soroush Rabiei

Reputation: 10868

Library versions string in autoconf

What is correct way of specifying a library version for first time in autoconf? The library is in unstable status and I suppose it's gonna be 0.1.0 until it's prepared for the public API which should be 1.0.0. So I put following in configure.ac:

AC_SUBST([FOO_SO_VERSION], [0:1:0])
AC_SUBST([FOO_API_VERSION], [0.1.0])

And also in Makefile.am:

libfoo_la_LDFLAGS = -version-info $(FOO_SO_VERSION)

Though I get this file:

libfoo.so.0.0.1

Upvotes: 1

Views: 1049

Answers (1)

ptomato
ptomato

Reputation: 57870

The .so version should always start at 0:0:0. It should not be tied to your project's software version number.

Libtool version numbers are referred to as current:revision:age and don't necessarily map to the .so file's suffix on any particular platform.

Here is a summary of the explanation given at this link:

  • Increase the revision every time you make a release.
  • Increase the current value and set revision to 0 every time you make a change to the API/ABI.
  • Increase the age when you make a backwards-compatible change to the API/ABI.
  • Set age to 0 when you make a backwards-incompatible change to the API/ABI.

Upvotes: 5

Related Questions