Integrating libtool with your package

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 that 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 autoconfadds 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值