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.
Sometimes it can be useful to pass options to libtoolize even
though it is called by another program, such as autoreconf. A
limited number of options are parsed from the environment variable
LIBTOOLIZE_OPTIONS: currently --debug, --no-warn,
--quiet and --verbose. Multiple options passed in
LIBTOOLIZE_OPTIONS must be separated with a space, comma or a
colon.
By default, a warning is issued for unknown options found in
LIBTOOLIZE_OPTIONS unless the first such option is
--no-warn. Where libtoolize has always quit
on receipt of an unknown option at the command line, this and all
previous releases of libtoolize will continue unabated whatever
the content of LIBTOOLIZE_OPTIONS (modulo some possible warning
messages).
trick$ LIBTOOLIZE_OPTIONS=--no-warn,--quiet autoreconf --install
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.
Unless --no-warn is passed, libtoolize displays hints for adding libtool support to your package, as well.