LinuxCommandLibrary

libtool

A generic library support script that hides the complexity of using shared libraries behind a consistent, portable interface.

TLDR

Compile a source file into a libtool object

$ libtool --mode=compile gcc -c [path/to/source.c] -o [path/to/source.lo]
copy


Create a library or an executable
$ libtool --mode=link gcc -o [path/to/library.lo] [path/to/source.lo]
copy


Automatically set the library path so that another program can use uninstalled libtool generated programs or libraries
$ libtool --mode=execute gdb [path/to/program]
copy


Install a shared library
$ libtool --mode=install cp [path/to/library.la] [path/to/installation_directory]
copy


Complete the installation of libtool libraries on the system
$ libtool --mode=finish [path/to/installation_dir]
copy


Delete installed libraries or executables
$ libtool --mode=uninstall [path/to/installed_library.la]
copy


Delete uninstalled libraries or executables
$ libtool --mode=clean rm [path/to/source.lo] [path/to/library.la]
copy

Copied to clipboard