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 i开发者_如何学编程t 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.
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
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.
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".
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.
精彩评论