libtool: Installing libraries

1 
1 3.5 Installing libraries
1 ========================
1 
1 Installing libraries on a non-libtool system is quite straightforward...
1 just copy them into place:(1)
1 
1      burger$ su
1      Password: ********
1      burger# cp libhello.a /usr/local/lib/libhello.a
1      burger#
1 
1    Oops, don't forget the 'ranlib' command:
1 
1      burger# ranlib /usr/local/lib/libhello.a
1      burger#
1 
1    Libtool installation is quite simple, as well.  Just use the
1 mode::):
1 
1      a23# libtool --mode=install cp libhello.la /usr/local/lib/libhello.la
1      cp libhello.la /usr/local/lib/libhello.la
1      cp .libs/libhello.a /usr/local/lib/libhello.a
1      ranlib /usr/local/lib/libhello.a
1      a23#
1 
1    Note that the libtool library 'libhello.la' is also installed, to
1 help libtool with uninstallation (⇒Uninstall mode) and linking
DONTPRINTYET 1 (⇒Linking executables) and to help programs with dlopening (*note1DONTPRINTYET 1 (⇒Linking executables) and to help programs with dlopening (⇒
 Dlopened modules).
1 
1    Here is the shared library example:
1 
1      burger# libtool --mode=install install -c libhello.la \
1                      /usr/local/lib/libhello.la
1      install -c .libs/libhello.so.0.0 /usr/local/lib/libhello.so.0.0
1      install -c libhello.la /usr/local/lib/libhello.la
1      install -c .libs/libhello.a /usr/local/lib/libhello.a
1      ranlib /usr/local/lib/libhello.a
1      burger#
1 
1    It is safe to specify the '-s' (strip symbols) flag if you use a
1 BSD-compatible install program when installing libraries.  Libtool will
1 either ignore the '-s' flag, or will run a program that will strip only
1 debugging and compiler symbols from the library.
1 
1    Once the libraries have been put in place, there may be some
1 additional configuration that you need to do before using them.  First,
1 you must make sure that where the library is installed actually agrees
1 with the '-rpath' flag you used to build it.
1 
1    Then, running 'libtool -n finish LIBDIR' can give you further hints
1 on what to do (⇒Finish mode):
1 
1      burger# libtool -n finish /usr/local/lib
1      PATH="$PATH:/sbin" ldconfig -m /usr/local/lib
1      -----------------------------------------------------------------
1      Libraries have been installed in:
1         /usr/local/lib
1 
1      To link against installed libraries in a given directory, LIBDIR,
1      you must use the '-LLIBDIR' flag during linking.
1 
1       You will also need to do one of the following:
1         - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
1           during execution
1         - add LIBDIR to the 'LD_RUN_PATH' environment variable
1           during linking
1         - use the '-RLIBDIR' linker flag
1 
1      See any operating system documentation about shared libraries for
1      more information, such as the ld and ld.so manual pages.
1      -----------------------------------------------------------------
1      burger#
1 
1    After you have completed these steps, you can go on to begin using
1 the installed libraries.  You may also install any executables that
1 depend on libraries you created.
1 
1    ---------- Footnotes ----------
1 
1    (1) Don't strip static libraries though, or they will be unusable.
1