Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GNU Autotools: rebuild without version info

I need to build a lib that is configured with autotools. The usual configure && make && make install steps produce versioned shared lib, something like libfoo.so.x.x Is it possible to modify configure.ac or Makefile.am (and of course follow up with autoreconf ) so that un-versioned lib is build.

Thank you!

like image 582
pic11 Avatar asked Aug 16 '12 14:08

pic11


People also ask

What is an automake file?

Automake is a tool for automatically generating Makefile.in s from files called Makefile.am . Each Makefile.am is basically a series of make variable definitions1, with rules being thrown in occasionally. The generated Makefile.in s are compliant with the GNU Makefile standards.

What is Autogen sh?

The autogen.sh script generates the configure script (from configure.ac , using autoconf) and any files it needs (like creating Makefile.in from Makefile.am using automake).

What is Am_init_automake?

AM_INIT_AUTOMAKE([OPTIONS]) Runs many macros required for proper operation of the generated Makefiles. Today, AM_INIT_AUTOMAKE is called with a single argument: a space-separated list of Automake options that should be applied to every Makefile.am in the tree.


1 Answers

Yes, assuming that the library is built with libtool, you can remove the version information by adding the -avoid-version flag to the library's LDFLAGS.

For example, if before there was libfoo_la_LDFLAGS = -version-info 1:0 you would change it to libfoo_la_LDFLAGS = -avoid-version. After this, you'd regenerate and rerun configure (autoreconf -vfi && ./configure) and rebuild.

Simply removing -version-info ... isn't sufficient, since libtool will then generate a library with version info 0.0.0.

See the libtool manual for more information: http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html

like image 121
mattst88 Avatar answered Oct 02 '22 19:10

mattst88