DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(libtool.info.gz) Using libtool

Info Catalog (libtool.info.gz) Libtool paradigm (libtool.info.gz) Top (libtool.info.gz) Invoking libtool
 
 Using libtool
 *************
 
    It makes little sense to talk about using libtool in your own
 packages until you have seen how it makes your life simpler.  The
 examples in this chapter introduce the main features of libtool by
 comparing the standard library building procedure to libtool's
 operation on two different platforms:
 
 `a23'
      An Ultrix 4.2 platform with only static libraries.
 
 `burger'
      A NetBSD/i386 1.2 platform with shared libraries.
 
    You can follow these examples on your own platform, using the
 preconfigured libtool script that was installed with libtool (
 Configuring).
 
    Source files for the following examples are taken from the `demo'
 subdirectory of the libtool distribution.  Assume that we are building a
 library, `libhello', out of the files `foo.c' and `hello.c'.
 
    Note that the `foo.c' source file uses the `cos' math library
 function, which is usually found in the standalone math library, and not
 the C library ( Trigonometric Functions (libc)Trig Functions.).
 So, we need to add `-lm' to the end of the link line whenever we link
 `foo.o' or `foo.lo' into an executable or a library (
 Inter-library dependencies).
 
    The same rule applies whenever you use functions that don't appear in
 the standard C library... you need to add the appropriate `-lNAME' flag
 to the end of the link line when you link against those objects.
 
    After we have built that library, we want to create a program by
 linking `main.o' against `libhello'.
 

Menu

 
* Creating object files       Compiling object files for libraries.
* Linking libraries           Creating libraries from object files.
* Linking executables         Linking object files against libtool libraries.
* Debugging executables       Running GDB on libtool-generated programs.
* Installing libraries        Making libraries available to users.
* Installing executables      Making programs available to users.
* Static libraries            When shared libraries are not wanted.
 
Info Catalog (libtool.info.gz) Libtool paradigm (libtool.info.gz) Top (libtool.info.gz) Invoking libtool
automatically generated byinfo2html