Automated and standard shared libraries

How can I get automake to create a standard shared library rather than libtoolized? Usually I created abc.so , which is referenced by the full path and loaded into the main program. Is there a way to get AM to do the same? If I listed it as _LIBRARY, automake complains: 'abc.so' is not a standard library name; did you mean 'libabc.a' '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 my own file name.

+7
shared-libraries automake
source share
4 answers

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

+6
source share

libtool is the way to go. If you want to create your own name, add the -module parameter to _LDFLAGS, for example:

 plugindir= /some/where plugin_LTLIBRARIES= abc.la abc_la_LDFLAGS= -module 
+7
source share

The 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 a file called libabc.so.

+1
source share

IIRC, there is nothing special about libraries created with libtool unless you reference libltdl. If you do not want to use libtool, you have the option to choose and not care about portability, then you can use automake without libtool. I would recommend using the power of libtool instead.

Actually, I don’t even know what the LIBRARY is suitable for; I did not find it in the section β€œGuide / Linking” .

0
source share

All Articles