[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5 Integrating libtool with your package
This chapter describes how to integrate libtool with your packages so that your users can install hassle-free shared libraries.
There are several ways in which Libtool may be integrated in your
package, described in the following sections. Typically, the Libtool
macro files as well as ‘ltmain.sh’ are copied into your package
using libtoolize
and aclocal
after setting up the
‘configure.ac’ and toplevel ‘Makefile.am’, then
autoconf
adds the needed tests to the ‘configure’ script.
These individual steps are often automated with autoreconf
.
Here is a diagram showing how such a typical Libtool configuration works when preparing a package for distribution, assuming that ‘m4’ has been chosen as location for additional Autoconf macros, and ‘build-aux’ as location for auxiliary build tools (see The Autoconf Manual in The Autoconf Manual):
libtool.m4 -----. .--> aclocal.m4 -----. ltoptions.m4 ---+ .-> aclocal* -+ +--> autoconf* ltversion.m4 ---+--+ `--> [copy in m4/] --+ | ltsugar.m4 -----+ | ^ | \/ lt~obsolete.m4 -+ +-> libtoolize* -----' | configure [ltdl.m4] ------+ | | `----------------------------------' ltmain.sh -----------> libtoolize* -> [copy in build-aux/]
During configuration, the ‘libtool’ script is generated either
through config.status
or config.lt
:
.--> config.status* --. configure* --+ +--> libtool `--> [config.lt*] ----' ^ | ltmain.sh --------------------------------'
At make
run time, libtool
is then invoked as needed
as a wrapper around compilers, linkers, install and cleanup programs.
There are alternatives choices to several parts of the setup; for
example, the Libtool macro files can either be copied or symlinked into
the package, or copied into ‘aclocal.m4’. As another example, an
external, pre-configured libtool
script may be used,
by-passing most of the tests and package-specific setup for Libtool.
5.1 Autoconf macros exported by libtool | ||
5.2 Writing ‘Makefile’ rules for libtool | ||
5.3 Using Automake with libtool | Automatically supporting libtool. | |
5.4 Configuring libtool | Configuring libtool for a host system. | |
5.5 Including libtool in your package | What files to distribute with your package. | |
5.6 Static-only libraries | Sometimes shared libraries are just a pain. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 1, 2011 using texi2html 5.0.