libtool
The libtool
program has the following synopsis:
libtool [option]... [mode-arg]...
and accepts the following options:
more(1)
or redirect to a file.
For `compile' mode, mode-args is a compiler command to be used in creating a `standard' object file. These arguments should begin with the name of the C compiler, and contain the `-c' compiler flag so that only an object file is created.
Libtool determines the name of the output file by removing the directory component from the source file name, then substituting the C source code suffix `.c' with the library object suffix, `.lo'.
If shared libraries are being built, any necessary PIC generation flags are substituted into the compilation command.
Note that the `-o' option is not supported for compile mode, because it cannot be implemented properly for all platforms. It is far easier just to change your Makefiles to create all the output files in the current working directory.
`link' mode links together object files (including library objects) to form another library or to create an executable program.
mode-args consist of a command using the C compiler to create an output file (with the `-o' flag) from several object files.
The following components of mode-args are treated specially:
dlsym(3)
(see section 9. Dlopened modules).
If the output-file ends in `.la', then a libtool library is created, which must be built only from library objects (`.lo' files). The `-rpath' option is required. In the current implementation, libtool libraries may not depend on other uninstalled libtool libraries (see section 8. Inter-library dependencies).
If the output-file ends in `.a', then a standard library is
created using ar
and possibly ranlib
.
If output-file ends in `.o' or `.lo', then a reloadable object file is created from the input files (generally using `ld -r'). This method is often called partial linking.
Otherwise, an executable program is created.
For `execute' mode, the library path is automatically set, then a program is executed.
The first of the mode-args is treated as a program name, with the rest as arguments to that program.
The following components of mode-args are treated specially:
This mode sets the library path environment variable according to any `-dlopen' flags.
If any of the args are libtool executable wrappers, then they are translated into the name of their corresponding uninstalled binary, and any of their required library directories are added to the library path.
In `install' mode, libtool interprets mode-args as an
installation command beginning with cp
, or a BSD-compatible
install
program.
The rest of the mode-args are interpreted as arguments to that command.
The command is run, and any necessary unprivileged post-installation commands are also completed.
`finish' mode helps system administrators install libtool libraries so that they can be located and linked into user programs.
Each mode-arg is interpreted as the name of a library directory. Running this command may require superuser privileges, so the `--dry-run' option may be useful.
This mode deletes installed libraries (and other files).
The first mode-arg is the name of the program to use to delete files (typically `/bin/rm').
The remaining mode-args are either flags for the deletion program (beginning with a `-'), or the names of files to delete.
Go to the first, previous, next, last section, table of contents.