How to determine the main version of a shared library in autoconf?

I use autoconf / automake / libtool to create a shared library. I want to transfer a large number of library versions for library sharing.

I have the following declaration in the configure.ac file:

AC_INIT([libabc], [1.1.0])

And the following Makefile.am:

AM_CPPFLAGS              = -I$(top_srcdir)/include -Wall -Wextra
LDADD                    = libabc.la

lib_LTLIBRARIES          = libabc.la
nodist_libabc_la_SOURCES = $(top_srcdir)/config.h
libabc_la_SOURCES        = $(top_srcdir)/src/abc.c

I am fine to have the same version for the configuration of the script, sources and sonata for the shared library. I can use VERSION or PACKAGE_VERSION defined in auto-generated config.h in the sources, but this does not affect soname, which is always libabc.so.0.

Is there a way to force libtool to use my main version from the AC_INIT directive? If not, what is the preferred way to determine the primary / minor number?

+4
2

. MAJOR.MINOR.MICRO , .

a MICRO revision bump , - , , . , . MINOR , - API. MAJOR- API, .

libtool , current:revision:age, libfoo_la_LDFLAGS -version-info. : libfoo_la_LDFLAGS = -release-info. "" , .

configure.ac Makefile.am , "" , GTK +, GLib; , ​​.


, ABI . , , libc (glibc), , ELF ABI .. autotools...


AC_INIT 'version' . MAJOR.MINOR.MICRO - , .

+6

, x.y.z, . , x.y.z .

-Wl,-soname,libXXX.so.1.0.

0

All Articles