viraptor
viraptor

Reputation: 34155

Automake and standard shared libraries

How can I force automake to create a standard shared library, instead of a libtoolized one? Normally, I'd create the abc.so which is referenced with a full path and loaded into the main program. Is there a way to force AM to do the same? If I list it as _LIBRARY, automake complains: 'abc.so' is not a standard library name; did you mean 'libabc.a'

Just to clarify: Yes, I only need .so support - no statics. And yes, I want a custom file name.

Upvotes: 7

Views: 4340

Answers (4)

ntd
ntd

Reputation: 7434

libtool is the way to go. If you want a custom name, add the -module option to _LDFLAGS, for example:

plugindir= /some/where  
plugin_LTLIBRARIES= abc.la
abc_la_LDFLAGS= -module

Upvotes: 7

Cl'ude
Cl'ude

Reputation: 11

A libtoolized library is a wrapper around one or more standard libraries. You can find these libraries in ".libs" after running "make", or in "$prefix/lib" after running "make install".

On a Linux machine, you should find eventually a file called "libabc.so".

Upvotes: 1

adl
adl

Reputation: 16044

Automake does not know how to build a shared library because there is no portable way to do so. If you want a shared library with Automake, you have to use Automake+Libtool. Note that you can easily configure libtool not to build any static library (with LT_INIT([disable-static]) in your configure.ac) by default.

Upvotes: 6

andi5
andi5

Reputation: 1616

IIRC, there is nothing special about libraries created with the help of libtool, unless you link against libltdl. If you do not want to use libtool, you have the power to choose and do not care too much about portability, then you are free to use automake without libtool. I would recommend to use the power of libtool instead.

Actually, I do not even know what _LIBRARY is good for, did not found it in the the manual/Linking section.

Upvotes: 0

Related Questions