10.2 The Libtool Library

back: creating libtool
forward: position independent code
 
fastback: linking an executable
up: introducing gnu libtool
fastforward: linking an executable
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

A Libtool library is built from Libtool objects in the same way that a native (non-Libtool) library is built from native objects. Building a Libtool library with libtool is as easy as building an old style static archive. Generally, each of the sources is compiled to a Libtool object , and then these objects are combined to create the library.

If you want to try this to see what libtool does on your machine, put the following code in a file `hello.c' , in a directory of its own, and run the example shell commands from there:
 
 #include <stdio.h> void hello (char *who) {   printf ("Hello, %s!\n", who); } 

The traditional way to make a (native) static library is as follows :

 
 $ gcc -c hello.c $ ls hello.c  hello.o $ ar cru libhello.a hello.o $ ranlib libhello.a $ ls hello.c   hello.o   libhello.a 

Notice that even when I just want to build an old static archive, I need to know that, in common with most Unices, I have to bless (14) my library with ranlib to make it work optimally on HP-UX.

Essentially, Libtool supports the building of three types of library: shared libraries; static libraries; and convenience libraries. In the following sections I will talk about each in turn , but first you will need to understand how to create and use position independent code, as explained in the next section.


This document was generated by Gary V. Vaughan on May, 24 2001 using texi2html


GNU Autoconf, Automake and Libtool
GNU Autoconf, Automake, and Libtool
ISBN: 1578701902
EAN: 2147483647
Year: 2002
Pages: 290

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net