Copyright (C) 2000-2012 |
GNU Info (automake.info)A Shared LibraryBuilding a Shared Library ========================= Building shared libraries is a relatively complex matter. For this reason, GNU Libtool (Note: Introduction.) 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. Note: Using Automake with Libtool, for more information. automatically generated by info2www version 1.2.2.9 |