(automk14.info.gz) A Shared Library
Info Catalog
(automk14.info.gz) LIBOBJS
(automk14.info.gz) Programs
(automk14.info.gz) Program variables
7.4 Building a Shared Library
=============================
Building shared libraries is a relatively complex matter. For this
reason, GNU Libtool ( Introduction (libtool)Top.) was created to
help build shared libraries in a platform-independent way.
Automake uses Libtool to build libraries declared with the
`LTLIBRARIES' primary. Each `_LTLIBRARIES' variable is a list of
shared libraries to build. For instance, to create a library named
`libgettext.a' and its corresponding shared libraries, and install them
in `libdir', write:
lib_LTLIBRARIES = libgettext.la
Note that shared libraries _must_ be installed, so
`check_LTLIBRARIES' is not allowed. However, `noinst_LTLIBRARIES' is
allowed. This feature should be used for libtool "convenience
libraries".
For each library, the `LIBRARY_LIBADD' variable contains the names
of extra libtool objects (`.lo' files) to add to the shared library.
The `LIBRARY_LDFLAGS' variable contains any additional libtool flags,
such as `-version-info' or `-static'.
Where an ordinary library might include `@LIBOBJS@', a libtool
library must use `@LTLIBOBJS@'. This is required because the object
files that libtool operates on do not necessarily end in `.o'. The
libtool manual contains more details on this topic.
For libraries installed in some directory, Automake will
automatically supply the appropriate `-rpath' option. However, for
libraries determined at configure time (and thus mentioned in
`EXTRA_LTLIBRARIES'), Automake does not know the eventual installation
directory; for such libraries you must add the `-rpath' option to the
appropriate `_LDFLAGS' variable by hand.
Using Automake with Libtool (libtool)Using Automake, for more
information.
Info Catalog
(automk14.info.gz) LIBOBJS
(automk14.info.gz) Programs
(automk14.info.gz) Program variables
automatically generated byinfo2html