Go to the first, previous, next, last section, table of contents.
libtool
The libtool
program has the following synopsis:
libtool [option]... [mode-arg]...
and accepts the following options:
less
(or
more
) or redirect to a file.
The mode-args are a variable number of arguments, depending on the selected operation mode. In general, each mode-arg is interpreted by programs libtool invokes, rather than libtool itself.
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 source code suffix (e.g. `.c' for C source code) with the library object suffix, `.lo'.
If shared libraries are being built, any necessary PIC generation flags are substituted into the compilation command. You can pass compiler and linker specific flags using `-Wc,flag' and `-Xcompiler flag' or `-Wl,flag' and `-Xlinker flag', respectively.
If the `-static' option is given, then a `.o' file is built, even if libtool was configured with `--disable-static'.
Note that the `-o' option is now fully supported. It is emulated on the platforms that don't support it (by locking and moving the objects), so it is really easy to use libtool, just with minor modifications to your Makefiles. Typing for example
libtool gcc -c foo/x.c -o foo/x.lo
will do what you expect.
Note, however, that, if the compiler does not support `-c' and `-o', it is impossible to compile `foo/x.c' without overwriting an existing `./x.o'. Therefore, if you do have a source file `./x.c', make sure you introduce dependencies in your `Makefile' to make sure `./x.o' (or `./x.lo') is re-created after any sub-directory's `x.lo':
x.o x.lo: foo/x.lo bar/x.lo
This will also ensure that make won't try to use a temporarily corrupted `x.o' to create a program or library. It may cause needless recompilation on platforms that support `-c' and `-o' together, but it's the only way to make it safe for those that don't.
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:
self
libtool will make
sure that the program can dlopen
itself, either by enabling
-export-dynamic
or by falling back to `-dlpreopen self'.
self
, the symbols of the program itself will be added to
lt_preloaded_symbols.
If file is force
libtool will make sure that
lt_preloaded_symbols is always defined, regardless of whether
it's empty or not.
dlsym
(see section 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 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.
Uninstall mode deletes installed libraries, executables and objects.
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.
Clean mode deletes uninstalled libraries, executables, objects and libtool's temporary files associated with them.
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.