LinuxCommandLibrary

libtoolize

Prepare a package to use libtool

TLDR

Initialize a project for libtool by copying necessary files (avoiding symbolic links) and overwriting existing files if needed

$ libtoolize [[-cf|--copy --force]]
copy

SYNOPSIS

libtoolize [OPTION]...

PARAMETERS

-c, --copy
    Copy files even if they already exist, rather than attempting to synchronize them.

-f, --force
    Overwrite existing files without asking for confirmation. This option implies --copy.

-i, --install
    Install the libtool.m4 macro into aclocal.m4.

-n, --dry-run
    Perform a trial run with no changes made; print what would be done.

-q, --quiet, --silent
    Suppress all normal output messages.

-v, --verbose
    Print verbose messages during execution.

--automake
    This option is deprecated and does nothing; it is accepted for compatibility reasons.

--debug
    Enable shell debugging output.

--ltdl
    Copy the libltdl support files to the package's source directory.

--ltdl-silent
    Same as --ltdl, but suppresses output related to libltdl installation.

--ltdl-warn
    Warn if libltdl is not already installed (implies --ltdl).

--macrodir=DIR
    Look for the libtool.m4 macro in the specified directory DIR.

--no-warn
    Suppress all warning messages.

--recursive
    Process subdirectories recursively.

--sync
    Synchronize timestamps of files; this is the default behavior for existing files.

--version
    Print version information for libtoolize and exit.

--help
    Display a help message and exit.

DESCRIPTION

libtoolize is a utility program distributed with GNU Libtool, designed to copy or synchronize the necessary Libtool support files into a package's source directory. Its primary function is to prepare a project for the GNU Autotools build system when shared libraries are involved. By ensuring that the libtool.m4 macro and other essential helper scripts and definitions are present and up-to-date within the project's source tree, libtoolize enables autoconf to generate a configure script capable of correctly handling shared library creation and linking across diverse operating systems. This process saves developers from distributing the entire Libtool package with their source code, providing only the crucial files for a clean build.

Typically, libtoolize is run early in the Autotools setup, often after aclocal and before autoconf or automake, to ensure all required build infrastructure files are in place. For existing projects, it can also synchronize these files if the underlying Libtool version has been updated.

CAVEATS

libtoolize is primarily used within the GNU Autotools build system; its functionality is specific to preparing projects for shared library compilation with GNU Libtool.
It is not a general-purpose file copy utility.
Typically run once during project setup, or when updating GNU Libtool versions, rather than with every build.

TYPICAL USAGE WORKFLOW

libtoolize is usually invoked as part of the overall Autotools setup process, often within a bootstrapping script like bootstrap or autogen.sh. The common sequence of commands for setting up a project is often:
1. aclocal
2. libtoolize
3. autoconf
4. automake
This ensures that Libtool's M4 macros are available for autoconf to generate the configure script, which then correctly handles shared library building and linking on the target system.

HISTORY

The libtoolize command is an integral part of the GNU Libtool project, which was initiated to abstract away the complexities of creating and using shared libraries across various Unix-like operating systems. Libtool, and by extension libtoolize, emerged to provide a consistent interface for managing shared library archives, static archives, and dynamic loading modules, thereby simplifying cross-platform software development. Its development has mirrored the evolution of the GNU Autotools build system, becoming an essential step in setting up projects that leverage shared libraries compiled with Autotools.

SEE ALSO

libtool(1), autoconf(1), automake(1), aclocal(1)

Copied to clipboard