Go to the first, previous, next, last section, table of contents.


Installing libraries

Installing libraries on a non-libtool system is quite straightforward... just copy them into place:(3)

burger$ su
Password: ********
burger# cp libhello.a /usr/local/lib/libhello.a
burger#

Oops, don't forget the ranlib command:

burger# ranlib /usr/local/lib/libhello.a
burger#

Libtool installation is quite simple, as well. Just use the install or cp command that you normally would:

a23# libtool cp libhello.la /usr/local/lib/libhello.la
cp libhello.la /usr/local/lib/libhello.la
cp .libs/libhello.a /usr/local/lib/libhello.a
ranlib /usr/local/lib/libhello.a
a23#

Note that the libtool library `libhello.la' is also installed, for informational purposes, and to help libtool with uninstallation (see section Uninstall mode).

Here is the shared library example:

burger# libtool install -c libhello.la /usr/local/lib/libhello.la
install -c .libs/libhello.so.0.0 /usr/local/lib/libhello.so.0.0
install -c libhello.la /usr/local/lib/libhello.la
install -c .libs/libhello.a /usr/local/lib/libhello.a
ranlib /usr/local/lib/libhello.a
burger#

It is safe to specify the `-s' (strip symbols) flag if you use a BSD-compatible install program when installing libraries. Libtool will either ignore the `-s' flag, or will run a program that will strip only debugging and compiler symbols from the library.

Once the libraries have been put in place, there may be some additional configuration that you need to do before using them. First, you must make sure that where the library is installed actually agrees with the `-rpath' flag you used to build it.

Then, running `libtool -n --finish libdir' can give you further hints on what to do:

burger# libtool -n --finish /usr/local/lib
ldconfig -m /usr/local/lib
To link against installed libraries in LIBDIR, users may have to:
   - add LIBDIR to their `LD_LIBRARY_PATH' environment variable
   - use the `-LLIBDIR' linker flag
burger#

After you have completed these steps, you can go on to begin using the installed libraries. You may also install any executables that depend on libraries you created.


Go to the first, previous, next, last section, table of contents.