Next: Autoconf and LTLIBOBJS, Up: Distributing
The libtoolize program provides a standard way to add libtool support to your package. In the future, it may implement better usage checking, or other features to make libtool even easier to use.
The libtoolize program has the following synopsis:
libtoolize [option]...
and accepts the following options:
LT_CONFIG_LTDL_DIR in configure.ac, though you can
also specify a subdirectory name here if you are not using Autoconf
for example. If libtoolize can't determine the target
directory, ‘libltdl’ is used as the default.
## libltdl/Makefile.inc appends to the following variables ## so we set them here before including it: BUILT_SOURCES = AM_CPPFLAGS = AM_LDFLAGS = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = include libltdl/Makefile.inc
AC_CONFIG_FILES([libltdl/Makefile])
and Makefile.am:
SUBDIRS += libltdl
Previous releases of ‘libltdl’ built exclusively in this mode,
but now it is the default mode both for backwards compatibility and
because, for example, it is suitable for use in projects that wish to
use ‘libltdl’, but not use the Autotools for their own build
process.
If libtoolize detects an explicit call to
AC_CONFIG_MACRO_DIR (see The Autoconf Manual) in your configure.ac, it will
put the Libtool macros in the specified directory.
In the future other Autotools will automatically check the contents of
AC_CONFIG_MACRO_DIR, but at the moment it is more portable to
add the macro directory to ACLOCAL_AMFLAGS in
Makefile.am, which is where the tools currently look. If
libtoolize doesn't see AC_CONFIG_MACRO_DIR, it too
will honour the first ‘-I’ argument in ACLOCAL_AMFLAGS
when choosing a directory to store libtool configuration macros in.
It is perfectly sensible to use both AC_CONFIG_MACRO_DIR and
ACLOCAL_AMFLAGS, as long as they are kept in synchronisation.
ACLOCAL_AMFLAGS = -I m4
When you bootstrap your project with aclocal, then you will need to explicitly pass the same macro directory with aclocal's ‘-I’ flag:
trick$ aclocal -I m4
If libtoolize detects an explicit call to
AC_CONFIG_AUX_DIR (see The Autoconf Manual) in your configure.ac, it
will put the other support files in the specified directory.
Otherwise they too end up in the project root directory.
libtoolize displays hints for adding libtool support to your package, as well.