ossp-adm/autotools/libtool.html
<HTML>
<HEAD>
<!-- Created by texi2html 1.56k from libtool.texi on 10 July 2002 -->
<TITLE>Libtool</TITLE>
</HEAD>
<BODY>
<H1>GNU Libtool</H1>
<H2>For version 1.4.2, 10 September 2001</H2>
<ADDRESS>Gordon Matzigkeit</ADDRESS>
<ADDRESS>Alexandre Oliva</ADDRESS>
<ADDRESS>Thomas Tanner</ADDRESS>
<ADDRESS>Gary V. Vaughan</ADDRESS>
<P>
<P><HR><P>
<P>
@dircategory GNU programming tools
* Libtool: (libtool). Generic shared library support script.
<P>
@dircategory Individual utilities
* libtoolize: (libtool)Invoking libtoolize. Adding libtool support.
<P>
Copyright (C) 1996-2000 Free Software Foundation, Inc.
<P>
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the no Invariant Sections, with no Front-Cover Texts,
and with no Back-Cover Texts. A copy of the license is included in
the section entitled "GNU Free Documentation License".
<H1><A NAME="SEC1" HREF="libtool_toc.html#TOC1">Introduction</A></H1>
<P>
In the past, if a source code package developer wanted to take advantage
of the power of shared libraries, he needed to write custom support code
for each platform on which his package ran. He also had to design a
configuration interface so that the package installer could choose what sort of
libraries were built.
<P>
GNU Libtool simplifies the developer's job by encapsulating both the
platform-specific dependencies, and the user interface, in a single
script. GNU Libtool is designed so that the complete functionality of
each host type is available via a generic interface, but nasty quirks
are hidden from the programmer.
<P>
GNU Libtool's consistent interface is reassuring... users don't need
to read obscure documentation in order to have their favorite source
package build shared libraries. They just run your package
<CODE>configure</CODE> script (or equivalent), and libtool does all the dirty
work.
<P>
There are several examples throughout this document. All assume the
same environment: we want to build a library, <TT>`libhello'</TT>, in a
generic way.
<P>
<TT>`libhello'</TT> could be a shared library, a static library, or
both... whatever is available on the host system, as long as libtool
has been ported to it.
<P>
This chapter explains the original design philosophy of libtool. Feel
free to skip to the next chapter, unless you are interested in history,
or want to write code to extend libtool in a consistent way.
<H2><A NAME="SEC2" HREF="libtool_toc.html#TOC2">Motivation for writing libtool</A></H2>
<P>
<A NAME="IDX1"></A>
<A NAME="IDX2"></A>
Since early 1995, several different GNU developers have recognized the
importance of having shared library support for their packages. The
primary motivation for such a change is to encourage modularity and
reuse of code (both conceptually and physically) in GNU programs.
<P>
Such a demand means that the way libraries are built in GNU packages
needs to be general, to allow for any library type the package installer
might want. The problem is compounded by the absence of a standard
procedure for creating shared libraries on different platforms.
<P>
The following sections outline the major issues facing shared library
support in GNU, and how shared library support could be standardized
with libtool.
<P>
<A NAME="IDX3"></A>
<A NAME="IDX4"></A>
The following specifications were used in developing and evaluating this
system:
<OL>
<LI>
The system must be as elegant as possible.
<LI>
The system must be fully integrated with the GNU Autoconf and Automake
utilities, so that it will be easy for GNU maintainers to use. However,
the system must not require these tools, so that it can be used by
non-GNU packages.
<LI>
Portability to other (non-GNU) architectures and tools is desirable.
</OL>
<H2><A NAME="SEC3" HREF="libtool_toc.html#TOC3">Implementation issues</A></H2>
<P>
<A NAME="IDX5"></A>
<A NAME="IDX6"></A>
The following issues need to be addressed in any reusable shared library
system, specifically libtool:
<OL>
<LI>
The package installer should be able to control what sort of libraries
are built.
<LI>
It can be tricky to run dynamically linked programs whose libraries have
not yet been installed. <CODE>LD_LIBRARY_PATH</CODE> must be set properly (if
it is supported), or programs fail to run.
<LI>
The system must operate consistently even on hosts which don't support
shared libraries.
<LI>
The commands required to build shared libraries may differ wildly from
host to host. These need to be determined at configure time in
a consistent way.
<LI>
It is not always obvious with which suffix a shared library should be
installed. This makes it difficult for <TT>`Makefile'</TT> rules, since they
generally assume that file names are the same from host to host.
<LI>
The system needs a simple library version number abstraction, so that
shared libraries can be upgraded in place. The programmer should be
informed how to design the interfaces to the library to maximize binary
compatibility.
<LI>
The install <TT>`Makefile'</TT> target should warn the package installer to set
the proper environment variables (<CODE>LD_LIBRARY_PATH</CODE> or equivalent),
or run <CODE>ldconfig</CODE>.
</OL>
<H2><A NAME="SEC4" HREF="libtool_toc.html#TOC4">Other implementations</A></H2>
<P>
Even before libtool was developed, many free software packages built and
installed their own shared libraries. At first, these packages were
examined to avoid reinventing existing features.
<P>
Now it is clear that none of these packages have documented the details
of shared library systems that libtool requires. So, other packages
have been more or less abandoned as influences.
<H2><A NAME="SEC5" HREF="libtool_toc.html#TOC5">A postmortem analysis of other implementations</A></H2>
<P>
<A NAME="IDX7"></A>
<A NAME="IDX8"></A>
In all fairness, each of the implementations that were examined do the
job that they were intended to do, for a number of different host
systems. However, none of these solutions seem to function well as a
generalized, reusable component.
<P>
<A NAME="IDX9"></A>
Most were too complex to use (much less modify) without understanding
exactly what the implementation does, and they were generally not
documented.
<P>
The main difficulty is that different vendors have different views of
what libraries are, and none of the packages which were examined seemed
to be confident enough to settle on a single paradigm that just
<EM>works</EM>.
<P>
Ideally, libtool would be a standard that would be implemented as series
of extensions and modifications to existing library systems to make them
work consistently. However, it is not an easy task to convince
operating system developers to mend their evil ways, and people want to
build shared libraries right now, even on buggy, broken, confused
operating systems.
<P>
For this reason, libtool was designed as an independent shell script.
It isolates the problems and inconsistencies in library building that
plague <TT>`Makefile'</TT> writers by wrapping the compiler suite on
different platforms with a consistent, powerful interface.
<P>
With luck, libtool will be useful to and used by the GNU community, and
that the lessons that were learned in writing it will be taken up by
designers of future library systems.
<H1><A NAME="SEC6" HREF="libtool_toc.html#TOC6">The libtool paradigm</A></H1>
<P>
At first, libtool was designed to support an arbitrary number of library
object types. After libtool was ported to more platforms, a new
paradigm gradually developed for describing the relationship between
libraries and programs.
<P>
<A NAME="IDX10"></A>
<A NAME="IDX11"></A>
In summary, "libraries are programs with multiple entry points, and
more formally defined interfaces."
<P>
Version 0.7 of libtool was a complete redesign and rewrite of libtool to
reflect this new paradigm. So far, it has proved to be successful:
libtool is simpler and more useful than before.
<P>
The best way to introduce the libtool paradigm is to contrast it with
the paradigm of existing library systems, with examples from each. It
is a new way of thinking, so it may take a little time to absorb, but
when you understand it, the world becomes simpler.
<H1><A NAME="SEC7" HREF="libtool_toc.html#TOC7">Using libtool</A></H1>
<P>
<A NAME="IDX12"></A>
<A NAME="IDX13"></A>
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:
<DL COMPACT>
<DT><SAMP>`a23'</SAMP>
<DD>
An Ultrix 4.2 platform with only static libraries.
<DT><SAMP>`burger'</SAMP>
<DD>
A NetBSD/i386 1.2 platform with shared libraries.
</DL>
<P>
You can follow these examples on your own platform, using the
preconfigured libtool script that was installed with libtool
(see section <A HREF="libtool.html#SEC26">Configuring libtool</A>).
<P>
Source files for the following examples are taken from the <TT>`demo'</TT>
subdirectory of the libtool distribution. Assume that we are building a
library, <TT>`libhello'</TT>, out of the files <TT>`foo.c'</TT> and
<TT>`hello.c'</TT>.
<P>
Note that the <TT>`foo.c'</TT> source file uses the <CODE>cos</CODE> math library
function, which is usually found in the standalone math library, and not
the C library (see section `Trigonometric Functions' in <CITE>The GNU C Library Reference Manual</CITE>). So, we need to add <KBD>-lm</KBD> to
the end of the link line whenever we link <TT>`foo.o'</TT> or <TT>`foo.lo'</TT>
into an executable or a library (see section <A HREF="libtool.html#SEC39">Inter-library dependencies</A>).
<P>
The same rule applies whenever you use functions that don't appear in
the standard C library... you need to add the appropriate
<KBD>-l<VAR>name</VAR></KBD> flag to the end of the link line when you link
against those objects.
<P>
After we have built that library, we want to create a program by linking
<TT>`main.o'</TT> against <TT>`libhello'</TT>.
<H2><A NAME="SEC8" HREF="libtool_toc.html#TOC8">Creating object files</A></H2>
<P>
<A NAME="IDX14"></A>
<A NAME="IDX15"></A>
To create an object file from a source file, the compiler is invoked
with the `-c' flag (and any other desired flags):
<PRE>
burger$ <KBD>gcc -g -O -c main.c</KBD>
burger$
</PRE>
<P>
The above compiler command produces an object file, <TT>`main.o'</TT>, from
the source file <TT>`main.c'</TT>.
<P>
For most library systems, creating object files that become part of a
static library is as simple as creating object files that are linked to
form an executable:
<PRE>
burger$ <KBD>gcc -g -O -c foo.c</KBD>
burger$ <KBD>gcc -g -O -c hello.c</KBD>
burger$
</PRE>
<P>
<A NAME="IDX16"></A>
<A NAME="IDX17"></A>
Shared libraries, however, may only be built from
<EM>position-independent code</EM> (PIC). So, special flags must be passed
to the compiler to tell it to generate PIC rather than the standard
position-dependent code.
<P>
<A NAME="IDX18"></A>
<A NAME="IDX19"></A>
<A NAME="IDX20"></A>
Since this is a library implementation detail, libtool hides the
complexity of PIC compiler flags by using separate library object files
(which end in <SAMP>`.lo'</SAMP> instead of <SAMP>`.o'</SAMP>). On systems without shared
libraries (or without special PIC compiler flags), these library object
files are identical to "standard" object files.
<P>
To create library object files for <TT>`foo.c'</TT> and <TT>`hello.c'</TT>,
simply invoke libtool with the standard compilation command as
arguments (see section <A HREF="libtool.html#SEC16">Compile mode</A>):
<PRE>
a23$ <KBD>libtool gcc -g -O -c foo.c</KBD>
gcc -g -O -c foo.c
echo timestamp > foo.lo
a23$ <KBD>libtool gcc -g -O -c hello.c</KBD>
gcc -g -O -c hello.c
echo timestamp > hello.lo
a23$
</PRE>
<P>
Note that libtool creates two files for each invocation. The <SAMP>`.lo'</SAMP>
file is a library object, which may be built into a shared library, and
the <SAMP>`.o'</SAMP> file is a standard object file. On <SAMP>`a23'</SAMP>, the
library objects are just timestamps, because only static libraries are
supported.
<P>
On shared library systems, libtool automatically inserts the PIC
generation flags into the compilation command, so that the library
object and the standard object differ:
<PRE>
burger$ <KBD>libtool gcc -g -O -c foo.c</KBD>
gcc -g -O -c -fPIC -DPIC foo.c
mv -f foo.o foo.lo
gcc -g -O -c foo.c >/dev/null 2>&1
burger$ <KBD>libtool gcc -g -O -c hello.c</KBD>
gcc -g -O -c -fPIC -DPIC hello.c
mv -f hello.o hello.lo
gcc -g -O -c hello.c >/dev/null 2>&1
burger$
</PRE>
<P>
Notice that the second run of GCC has its output discarded. This is
done so that compiler warnings aren't annoyingly duplicated.
<H2><A NAME="SEC9" HREF="libtool_toc.html#TOC9">Linking libraries</A></H2>
<P>
<A NAME="IDX21"></A>
Without libtool, the programmer would invoke the <CODE>ar</CODE> command to
create a static library:
<PRE>
burger$ <KBD>ar cru libhello.a hello.o foo.o</KBD>
burger$
</PRE>
<P>
<A NAME="IDX22"></A>
But of course, that would be too simple, so many systems require that
you run the <CODE>ranlib</CODE> command on the resulting library (to give it
better karma, or something):
<PRE>
burger$ <KBD>ranlib libhello.a</KBD>
burger$
</PRE>
<P>
It seems more natural to use the C compiler for this task, given
libtool's "libraries are programs" approach. So, on platforms without
shared libraries, libtool simply acts as a wrapper for the system
<CODE>ar</CODE> (and possibly <CODE>ranlib</CODE>) commands.
<P>
<A NAME="IDX23"></A>
<A NAME="IDX24"></A>
Again, the libtool library name differs from the standard name (it has a
<SAMP>`.la'</SAMP> suffix instead of a <SAMP>`.a'</SAMP> suffix). The arguments to libtool are
the same ones you would use to produce an executable named
<TT>`libhello.la'</TT> with your compiler (see section <A HREF="libtool.html#SEC17">Link mode</A>):
<PRE>
a23$ <KBD>libtool gcc -g -O -o libhello.la foo.o hello.o</KBD>
libtool: cannot build libtool library `libhello.la' from non-libtool \
objects
a23$
</PRE>
<P>
Aha! Libtool caught a common error... trying to build a library
from standard objects instead of library objects. This doesn't matter
for static libraries, but on shared library systems, it is of great
importance.
<P>
So, let's try again, this time with the library object files. Remember
also that we need to add <KBD>-lm</KBD> to the link command line because
<TT>`foo.c'</TT> uses the <CODE>cos</CODE> math library function (see section <A HREF="libtool.html#SEC7">Using libtool</A>).
<P>
Another complication in building shared libraries is that we need to
specify the path to the directory in which they (eventually) will be
installed (in this case, <TT>`/usr/local/lib'</TT>)<A NAME="DOCF1" HREF="libtool_foot.html#FOOT1">(1)</A>:
<PRE>
a23$ <KBD>libtool gcc -g -O -o libhello.la foo.lo hello.lo \
-rpath /usr/local/lib -lm</KBD>
mkdir .libs
ar cru .libs/libhello.a foo.o hello.o
ranlib .libs/libhello.a
creating libhello.la
a23$
</PRE>
<P>
Now, let's try the same trick on the shared library platform:
<PRE>
burger$ <KBD>libtool gcc -g -O -o libhello.la foo.lo hello.lo \
-rpath /usr/local/lib -lm</KBD>
mkdir .libs
ld -Bshareable -o .libs/libhello.so.0.0 foo.lo hello.lo -lm
ar cru .libs/libhello.a foo.o hello.o
ranlib .libs/libhello.a
creating libhello.la
burger$
</PRE>
<P>
Now that's significantly cooler... libtool just ran an obscure
<CODE>ld</CODE> command to create a shared library, as well as the static
library.
<P>
<A NAME="IDX25"></A>
Note how libtool creates extra files in the <TT>`.libs'</TT>
subdirectory, rather than the current directory. This feature is to
make it easier to clean up the build directory, and to help ensure that
other programs fail horribly if you accidentally forget to use libtool
when you should.
<H2><A NAME="SEC10" HREF="libtool_toc.html#TOC10">Linking executables</A></H2>
<P>
<A NAME="IDX26"></A>
If you choose at this point to <EM>install</EM> the library (put it in a
permanent location) before linking executables against it, then you
don't need to use libtool to do the linking. Simply use the appropriate
<SAMP>`-L'</SAMP> and <SAMP>`-l'</SAMP> flags to specify the library's location.
<P>
<A NAME="IDX27"></A>
Some system linkers insist on encoding the full directory name of each
shared library in the resulting executable. Libtool has to work around
this misfeature by special magic to ensure that only permanent directory
names are put into installed executables.
<P>
<A NAME="IDX28"></A>
<A NAME="IDX29"></A>
The importance of this bug must not be overlooked: it won't cause
programs to crash in obvious ways. It creates a security hole,
and possibly even worse, if you are modifying the library source code
after you have installed the package, you will change the behaviour of
the installed programs!
<P>
So, if you want to link programs against the library before you install
it, you must use libtool to do the linking.
<P>
<A NAME="IDX30"></A>
Here's the old way of linking against an uninstalled library:
<PRE>
burger$ <KBD>gcc -g -O -o hell.old main.o libhello.a -lm</KBD>
burger$
</PRE>
<P>
Libtool's way is almost the same<A NAME="DOCF2" HREF="libtool_foot.html#FOOT2">(2)</A>
(see section <A HREF="libtool.html#SEC17">Link mode</A>):
<PRE>
a23$ <KBD>libtool gcc -g -O -o hell main.o libhello.la -lm</KBD>
gcc -g -O -o hell main.o ./.libs/libhello.a -lm
a23$
</PRE>
<P>
That looks too simple to be true. All libtool did was transform
<TT>`libhello.la'</TT> to <TT>`./.libs/libhello.a'</TT>, but remember
that <SAMP>`a23'</SAMP> has no shared libraries.
<P>
On <SAMP>`burger'</SAMP> the situation is different:
<PRE>
burger$ <KBD>libtool gcc -g -O -o hell main.o libhello.la -lm</KBD>
gcc -g -O -o .libs/hell main.o -L./.libs -R/usr/local/lib -lhello -lm
creating hell
burger$
</PRE>
<P>
<A NAME="IDX31"></A>
<P>
Now assume <TT>`libhello.la'</TT> had already been installed, and you want
to link a new program with it. You could figure out where it lives by
yourself, then run:
<PRE>
burger$ <KBD>gcc -g -O -o test test.o -L/usr/local/lib -lhello</KBD>
</PRE>
<P>
However, unless <TT>`/usr/local/lib'</TT> is in the standard library search
path, you won't be able to run <CODE>test</CODE>. However, if you use libtool
to link the already-installed libtool library, it will do The Right
Thing (TM) for you:
<PRE>
burger$ <KBD>libtool gcc -g -O -o test test.o /usr/local/lib/libhello.la</KBD>
gcc -g -O -o .libs/test test.o -Wl,--rpath
-Wl,/usr/local/lib /usr/local/lib/libhello.a -lm
creating test
burger$
</PRE>
<P>
Note that libtool added the necessary run-time path flag, as well as
<SAMP>`-lm'</SAMP>, the library libhello.la depended upon. Nice, huh?
<P>
Since libtool created a wrapper script, you should use libtool to
install it and debug it too. However, since the program does not depend
on any uninstalled libtool library, it is probably usable even without
the wrapper script. Libtool could probably be made smarter to avoid the
creation of the wrapper script in this case, but this is left as an
exercise for the reader.
<P>
<A NAME="IDX32"></A>
<A NAME="IDX33"></A>
Notice that the executable, <CODE>hell</CODE>, was actually created in the
<TT>`.libs'</TT> subdirectory. Then, a wrapper script was created
in the current directory.
<P>
On NetBSD 1.2, libtool encodes the installation directory of
<TT>`libhello'</TT>, by using the <SAMP>`-R/usr/local/lib'</SAMP> compiler flag.
Then, the wrapper script guarantees that the executable finds the
correct shared library (the one in <TT>`./.libs'</TT>) until it is
properly installed.
<P>
Let's compare the two different programs:
<PRE>
burger$ <KBD>time ./hell.old</KBD>
Welcome to GNU Hell!
** This is not GNU Hello. There is no built-in mail reader. **
0.21 real 0.02 user 0.08 sys
burger$ <KBD>time ./hell</KBD>
Welcome to GNU Hell!
** This is not GNU Hello. There is no built-in mail reader. **
0.63 real 0.09 user 0.59 sys
burger$
</PRE>
<P>
The wrapper script takes significantly longer to execute, but at least
the results are correct, even though the shared library hasn't been
installed yet.
<P>
So, what about all the space savings that shared libraries are supposed
to yield?
<PRE>
burger$ <KBD>ls -l hell.old libhello.a</KBD>
-rwxr-xr-x 1 gord gord 15481 Nov 14 12:11 hell.old
-rw-r--r-- 1 gord gord 4274 Nov 13 18:02 libhello.a
burger$ <KBD>ls -l .libs/hell .libs/libhello.*</KBD>
-rwxr-xr-x 1 gord gord 11647 Nov 14 12:10 .libs/hell
-rw-r--r-- 1 gord gord 4274 Nov 13 18:44 .libs/libhello.a
-rwxr-xr-x 1 gord gord 12205 Nov 13 18:44 .libs/libhello.so.0.0
burger$
</PRE>
<P>
Well, that sucks. Maybe I should just scrap this project and take up
basket weaving.
<P>
Actually, it just proves an important point: shared libraries incur
overhead because of their (relative) complexity. In this situation, the
price of being dynamic is eight kilobytes, and the payoff is about four
kilobytes. So, having a shared <TT>`libhello'</TT> won't be an advantage
until we link it against at least a few more programs.
<H2><A NAME="SEC11" HREF="libtool_toc.html#TOC11">Debugging executables</A></H2>
<P>
If <TT>`hell'</TT> was a complicated program, you would certainly want to
test and debug it before installing it on your system. In the above
section, you saw how the libtool wrapper script makes it possible to run
the program directly, but unfortunately, this mechanism interferes with
the debugger:
<PRE>
burger$ <KBD>gdb hell</KBD>
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
"hell": not in executable format: File format not recognized
(gdb) <KBD>quit</KBD>
burger$
</PRE>
<P>
Sad. It doesn't work because GDB doesn't know where the executable
lives. So, let's try again, by invoking GDB directly on the executable:
<PRE>
burger$ <KBD>gdb .libs/hell</KBD>
trick:/home/src/libtool/demo$ gdb .libs/hell
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
(gdb) <KBD>break main</KBD>
Breakpoint 1 at 0x8048547: file main.c, line 29.
(gdb) <KBD>run</KBD>
Starting program: /home/src/libtool/demo/.libs/hell
/home/src/libtool/demo/.libs/hell: can't load library 'libhello.so.2'
Program exited with code 020.
(gdb) <KBD>quit</KBD>
burger$
</PRE>
<P>
Argh. Now GDB complains because it cannot find the shared library that
<TT>`hell'</TT> is linked against. So, we must use libtool in order to
properly set the library path and run the debugger. Fortunately, we can
forget all about the <TT>`.libs'</TT> directory, and just run it on
the executable wrapper (see section <A HREF="libtool.html#SEC18">Execute mode</A>):
<PRE>
burger$ <KBD>libtool gdb hell</KBD>
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
(gdb) <KBD>break main</KBD>
Breakpoint 1 at 0x8048547: file main.c, line 29.
(gdb) <KBD>run</KBD>
Starting program: /home/src/libtool/demo/.libs/hell
Breakpoint 1, main (argc=1, argv=0xbffffc40) at main.c:29
29 printf ("Welcome to GNU Hell!\n");
(gdb) <KBD>quit</KBD>
The program is running. Quit anyway (and kill it)? (y or n) <KBD>y</KBD>
burger$
</PRE>
<H2><A NAME="SEC12" HREF="libtool_toc.html#TOC12">Installing libraries</A></H2>
<P>
<A NAME="IDX34"></A>
Installing libraries on a non-libtool system is quite
straightforward... just copy them into place:<A NAME="DOCF3" HREF="libtool_foot.html#FOOT3">(3)</A>
<P>
<A NAME="IDX35"></A>
<PRE>
burger$ <KBD>su</KBD>
Password: <KBD>********</KBD>
burger# <KBD>cp libhello.a /usr/local/lib/libhello.a</KBD>
burger#
</PRE>
<P>
Oops, don't forget the <CODE>ranlib</CODE> command:
<PRE>
burger# <KBD>ranlib /usr/local/lib/libhello.a</KBD>
burger#
</PRE>
<P>
<A NAME="IDX36"></A>
Libtool installation is quite simple, as well. Just use the
<CODE>install</CODE> or <CODE>cp</CODE> command that you normally would
(see section <A HREF="libtool.html#SEC19">Install mode</A>):
<PRE>
a23# <KBD>libtool cp libhello.la /usr/local/lib/libhello.la</KBD>
cp libhello.la /usr/local/lib/libhello.la
cp .libs/libhello.a /usr/local/lib/libhello.a
ranlib /usr/local/lib/libhello.a
a23#
</PRE>
<P>
Note that the libtool library <TT>`libhello.la'</TT> is also installed, to
help libtool with uninstallation (see section <A HREF="libtool.html#SEC21">Uninstall mode</A>) and linking
(see section <A HREF="libtool.html#SEC10">Linking executables</A>) and to help programs with dlopening
(see section <A HREF="libtool.html#SEC40">Dlopened modules</A>).
<P>
Here is the shared library example:
<PRE>
burger# <KBD>libtool install -c libhello.la /usr/local/lib/libhello.la</KBD>
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#
</PRE>
<P>
<A NAME="IDX37"></A>
<A NAME="IDX38"></A>
It is safe to specify the <SAMP>`-s'</SAMP> (strip symbols) flag if you use a
BSD-compatible install program when installing libraries.
Libtool will either ignore the <SAMP>`-s'</SAMP> flag, or will run a program
that will strip only debugging and compiler symbols from the library.
<P>
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
<SAMP>`-rpath'</SAMP> flag you used to build it.
<P>
<A NAME="IDX39"></A>
<A NAME="IDX40"></A>
<A NAME="IDX41"></A>
Then, running <SAMP>`libtool -n --finish <VAR>libdir</VAR>'</SAMP> can give you
further hints on what to do (see section <A HREF="libtool.html#SEC20">Finish mode</A>):
<PRE>
burger# <KBD>libtool -n --finish /usr/local/lib</KBD>
PATH="$PATH:/sbin" ldconfig -m /usr/local/lib
-----------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
To link against installed libraries in a given directory, LIBDIR,
you must use the `-LLIBDIR' flag during linking.
You will also need to do one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-RLIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld and ld.so manual pages.
-----------------------------------------------------------------
burger#
</PRE>
<P>
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.
<H2><A NAME="SEC13" HREF="libtool_toc.html#TOC13">Installing executables</A></H2>
<P>
If you used libtool to link any executables against uninstalled libtool
libraries (see section <A HREF="libtool.html#SEC10">Linking executables</A>), you need to use libtool to
install the executables after the libraries have been installed
(see section <A HREF="libtool.html#SEC12">Installing libraries</A>).
<P>
So, for our Ultrix example, we would run:
<PRE>
a23# libtool install -c hell /usr/local/bin/hell
install -c hell /usr/local/bin/hell
a23#
</PRE>
<P>
On shared library systems, libtool just ignores the wrapper script and
installs the correct binary:
<PRE>
burger# libtool install -c hell /usr/local/bin/hell
install -c .libs/hell /usr/local/bin/hell
burger#
</PRE>
<H2><A NAME="SEC14" HREF="libtool_toc.html#TOC14">Linking static libraries</A></H2>
<P>
<A NAME="IDX42"></A>
<A NAME="IDX43"></A>
Why return to <CODE>ar</CODE> and <CODE>ranlib</CODE> silliness when you've had a
taste of libtool? Well, sometimes it is desirable to create a static
archive that can never be shared. The most frequent case is when you
have a set of object files that you use to build several different
programs. You can create a "convenience library" out of those
objects, and link programs with the library, instead of listing all
object files for every program. This technique is often used to
overcome GNU automake's lack of support for linking object files built
from sources in other directories, because it supports linking with
libraries from other directories. This limitation applies to GNU
automake up to release 1.4; newer releases should support sources in
other directories.
<P>
If you just want to link this convenience library into programs, then
you could just ignore libtool entirely, and use the old <CODE>ar</CODE> and
<CODE>ranlib</CODE> commands (or the corresponding GNU automake
<SAMP>`_LIBRARIES'</SAMP> rules). You can even install a convenience library
(but you probably don't want to) using libtool:
<PRE>
burger$ <KBD>libtool ./install-sh -c libhello.a /local/lib/libhello.a</KBD>
./install-sh -c libhello.a /local/lib/libhello.a
ranlib /local/lib/libhello.a
burger$
</PRE>
<P>
Using libtool for static library installation protects your library from
being accidentally stripped (if the installer used the <SAMP>`-s'</SAMP> flag),
as well as automatically running the correct <CODE>ranlib</CODE> command.
<P>
But libtool libraries are more than just collections of object files:
they can also carry library dependency information, which old archives
do not. If you want to create a libtool static convenience library, you
can omit the <SAMP>`-rpath'</SAMP> flag and use <SAMP>`-static'</SAMP> to indicate that
you're only interested in a static library. When you link a program
with such a library, libtool will actually link all object files and
dependency libraries into the program.
<P>
If you omit both <SAMP>`-rpath'</SAMP> and <SAMP>`-static'</SAMP>, libtool will create a
convenience library that can be used to create other libtool
libraries, even shared ones. Just like in the static case, the library
behaves as an alias to a set of object files and dependency libraries,
but in this case the object files are suitable for inclusion in shared
libraries. But be careful not to link a single convenience library,
directly or indirectly, into a single program or library, otherwise you
may get errors about symbol redefinitions.
<P>
When GNU automake is used, you should use <CODE>noinst_LTLIBRARIES</CODE>
instead of <CODE>lib_LTLIBRARIES</CODE> for convenience libraries, so that
the <SAMP>`-rpath'</SAMP> option is not passed when they are linked.
<P>
As a rule of thumb, link a libtool convenience library into at most one
libtool library, and never into a program, and link libtool static
convenience libraries only into programs, and only if you need to carry
library dependency information to the user of the static convenience
library.
<P>
<A NAME="IDX44"></A>
Another common situation where static linking is desirable is in
creating a standalone binary. Use libtool to do the linking and add the
<SAMP>`-all-static'</SAMP> flag.
<H1><A NAME="SEC15" HREF="libtool_toc.html#TOC15">Invoking <CODE>libtool</CODE></A></H1>
<P>
<A NAME="IDX45"></A>
<A NAME="IDX46"></A>
<A NAME="IDX47"></A>
<A NAME="IDX48"></A>
<P>
The <CODE>libtool</CODE> program has the following synopsis:
<PRE>
libtool [<VAR>option</VAR>]... [<VAR>mode-arg</VAR>]...
</PRE>
<P>
and accepts the following options:
<DL COMPACT>
<DT><SAMP>`--config'</SAMP>
<DD>
Display libtool configuration variables and exit.
<DT><SAMP>`--debug'</SAMP>
<DD>
Dump a trace of shell script execution to standard output. This
produces a lot of output, so you may wish to pipe it to <CODE>less</CODE> (or
<CODE>more</CODE>) or redirect to a file.
<DT><SAMP>`-n'</SAMP>
<DD>
<DT><SAMP>`--dry-run'</SAMP>
<DD>
Don't create, modify, or delete any files, just show what commands would
be executed by libtool.
<DT><SAMP>`--features'</SAMP>
<DD>
Display basic configuration options. This provides a way for packages
to determine whether shared or static libraries will be built.
<DT><SAMP>`--finish'</SAMP>
<DD>
Same as <SAMP>`--mode=finish'</SAMP>.
<DT><SAMP>`--help'</SAMP>
<DD>
Display a help message and exit. If <SAMP>`--mode=<VAR>mode</VAR>'</SAMP> is
specified, then detailed help for <VAR>mode</VAR> is
displayed.
<DT><SAMP>`--mode=<VAR>mode</VAR>'</SAMP>
<DD>
Use <VAR>mode</VAR> as the operation mode. By default, the operation mode is
inferred from the <VAR>mode-args</VAR>.
If <VAR>mode</VAR> is specified, it must be one of the following:
<DL COMPACT>
<DT><SAMP>`compile'</SAMP>
<DD>
Compile a source file into a libtool object.
<DT><SAMP>`execute'</SAMP>
<DD>
Automatically set the library path so that another program can use
uninstalled libtool-generated programs or libraries.
<DT><SAMP>`finish'</SAMP>
<DD>
Complete the installation of libtool libraries on the system.
<DT><SAMP>`install'</SAMP>
<DD>
Install libraries or executables.
<DT><SAMP>`link'</SAMP>
<DD>
Create a library or an executable.
<DT><SAMP>`uninstall'</SAMP>
<DD>
Delete installed libraries or executables.
<DT><SAMP>`clean'</SAMP>
<DD>
Delete uninstalled libraries or executables.
</DL>
<DT><SAMP>`--version'</SAMP>
<DD>
Print libtool version information and exit.
</DL>
<P>
The <VAR>mode-args</VAR> are a variable number of arguments, depending on the
selected operation mode. In general, each <VAR>mode-arg</VAR> is interpreted
by programs libtool invokes, rather than libtool itself.
<H2><A NAME="SEC16" HREF="libtool_toc.html#TOC16">Compile mode</A></H2>
<P>
<A NAME="IDX49"></A>
<A NAME="IDX50"></A>
<P>
For <EM>compile</EM> mode, <VAR>mode-args</VAR> is a compiler command to be used
in creating a `standard' object file. These arguments should begin with
the name of the C compiler, and contain the <SAMP>`-c'</SAMP> compiler flag so
that only an object file is created.
<P>
Libtool determines the name of the output file by removing the directory
component from the source file name, then substituting the source code
suffix (e.g. <SAMP>`.c'</SAMP> for C source code) with the library object suffix,
<SAMP>`.lo'</SAMP>.
<P>
If shared libraries are being built, any necessary PIC generation flags
are substituted into the compilation command.
You can pass compiler and linker specific flags using <SAMP>`-Wc,<VAR>flag</VAR>'</SAMP>
and <SAMP>`-Xcompiler <VAR>flag</VAR>'</SAMP> or <SAMP>`-Wl,<VAR>flag</VAR>'</SAMP> and
<SAMP>`-Xlinker <VAR>flag</VAR>'</SAMP>, respectively.
<P>
If the <SAMP>`-static'</SAMP> option is given, then a <SAMP>`.o'</SAMP> file is built,
even if libtool was configured with <SAMP>`--disable-static'</SAMP>.
<P>
Note that the <SAMP>`-o'</SAMP> option is now fully supported. It is emulated
on the platforms that don't support it (by locking and moving the
objects), so it is really easy to use libtool, just with minor
modifications to your Makefiles. Typing for example
<PRE>
libtool gcc -c foo/x.c -o foo/x.lo
</PRE>
<P>
will do what you expect.
<P>
Note, however, that, if the compiler does not support <SAMP>`-c'</SAMP> and
<SAMP>`-o'</SAMP>, it is impossible to compile <TT>`foo/x.c'</TT> without
overwriting an existing <TT>`./x.o'</TT>. Therefore, if you do have a
source file <TT>`./x.c'</TT>, make sure you introduce dependencies in your
<TT>`Makefile'</TT> to make sure <TT>`./x.o'</TT> (or <TT>`./x.lo'</TT>) is
re-created after any sub-directory's <TT>`x.lo'</TT>:
<PRE>
x.o x.lo: foo/x.lo bar/x.lo
</PRE>
<P>
This will also ensure that make won't try to use a temporarily corrupted
<TT>`x.o'</TT> to create a program or library. It may cause needless
recompilation on platforms that support <SAMP>`-c'</SAMP> and <SAMP>`-o'</SAMP>
together, but it's the only way to make it safe for those that don't.
<H2><A NAME="SEC17" HREF="libtool_toc.html#TOC17">Link mode</A></H2>
<P>
<A NAME="IDX51"></A>
<A NAME="IDX52"></A>
<P>
<EM>Link</EM> mode links together object files (including library
objects) to form another library or to create an executable program.
<P>
<VAR>mode-args</VAR> consist of a command using the C compiler to create an
output file (with the <SAMP>`-o'</SAMP> flag) from several object files.
<P>
The following components of <VAR>mode-args</VAR> are treated specially:
<DL COMPACT>
<DT><SAMP>`-all-static'</SAMP>
<DD>
<A NAME="IDX53"></A>
<A NAME="IDX54"></A>
If <VAR>output-file</VAR> is a program, then do not link it against any
shared libraries at all. If <VAR>output-file</VAR> is a library, then only
create a static library.
<DT><SAMP>`-avoid-version'</SAMP>
<DD>
Tries to avoid versioning (see section <A HREF="libtool.html#SEC32">Library interface versions</A>) for libraries and modules,
i.e. no version information is stored and no symbolic links are created.
If the platform requires versioning, this option has no effect.
<DT><SAMP>`-dlopen <VAR>file</VAR>'</SAMP>
<DD>
Same as <SAMP>`-dlpreopen <VAR>file</VAR>'</SAMP>, if native dlopening is not
supported on the host platform (see section <A HREF="libtool.html#SEC40">Dlopened modules</A>) or if
the program is linked with <SAMP>`-static'</SAMP> or <SAMP>`-all-static'</SAMP>.
Otherwise, no effect. If <VAR>file</VAR> is <CODE>self</CODE> libtool will make
sure that the program can <CODE>dlopen</CODE> itself, either by enabling
<CODE>-export-dynamic</CODE> or by falling back to <SAMP>`-dlpreopen self'</SAMP>.
<DT><SAMP>`-dlpreopen <VAR>file</VAR>'</SAMP>
<DD>
Link <VAR>file</VAR> into the output program, and add its symbols to
<VAR>lt_preloaded_symbols</VAR> (see section <A HREF="libtool.html#SEC42">Dlpreopening</A>). If <VAR>file</VAR> is
<CODE>self</CODE>, the symbols of the program itself will be added to
<VAR>lt_preloaded_symbols</VAR>.
If <VAR>file</VAR> is <CODE>force</CODE> libtool will make sure that
<VAR>lt_preloaded_symbols</VAR> is always <EM>defined</EM>, regardless of whether
it's empty or not.
<DT><SAMP>`-export-dynamic'</SAMP>
<DD>
Allow symbols from <VAR>output-file</VAR> to be resolved with <CODE>dlsym</CODE>
(see section <A HREF="libtool.html#SEC40">Dlopened modules</A>).
<DT><SAMP>`-export-symbols <VAR>symfile</VAR>'</SAMP>
<DD>
Tells the linker to export only the symbols listed in <VAR>symfile</VAR>.
The symbol file should end in <SAMP>`.sym'</SAMP> and must contain the name of one
symbol per line. This option has no effect on some platforms.
By default all symbols are exported.
<DT><SAMP>`-export-symbols-regex <VAR>regex</VAR>'</SAMP>
<DD>
Same as <SAMP>`-export-symbols'</SAMP>, except that only symbols matching
the regular expression <VAR>regex</VAR> are exported.
By default all symbols are exported.
<DT><SAMP>`-L<VAR>libdir</VAR>'</SAMP>
<DD>
Search <VAR>libdir</VAR> for required libraries that have already been
installed.
<DT><SAMP>`-l<VAR>name</VAR>'</SAMP>
<DD>
<VAR>output-file</VAR> requires the installed library <TT>`lib<VAR>name</VAR>'</TT>.
This option is required even when <VAR>output-file</VAR> is not an
executable.
<DT><SAMP>`-module'</SAMP>
<DD>
Creates a library that can be dlopened (see section <A HREF="libtool.html#SEC40">Dlopened modules</A>).
This option doesn't work for programs.
Module names don't need to be prefixed with 'lib'.
In order to prevent name clashes, however, 'libname' and 'name'
must not be used at the same time in your package.
<DT><SAMP>`-no-fast-install'</SAMP>
<DD>
Disable fast-install mode for the executable <VAR>output-file</VAR>. Useful
if the program won't be necessarily installed.
<DT><SAMP>`-no-install'</SAMP>
<DD>
Link an executable <VAR>output-file</VAR> that can't be installed and
therefore doesn't need a wrapper script. Useful if the program is only
used in the build tree, e.g., for testing or generating other files.
<DT><SAMP>`-no-undefined'</SAMP>
<DD>
Declare that <VAR>output-file</VAR> does not depend on any other libraries.
Some platforms cannot create shared libraries that depend on other
libraries (see section <A HREF="libtool.html#SEC39">Inter-library dependencies</A>).
<DT><SAMP>`-o <VAR>output-file</VAR>'</SAMP>
<DD>
Create <VAR>output-file</VAR> from the specified objects and libraries.
<DT><SAMP>`-release <VAR>release</VAR>'</SAMP>
<DD>
Specify that the library was generated by release <VAR>release</VAR> of your
package, so that users can easily tell which versions are newer than
others. Be warned that no two releases of your package will be binary
compatible if you use this flag. If you want binary compatibility, use
the <SAMP>`-version-info'</SAMP> flag instead (see section <A HREF="libtool.html#SEC32">Library interface versions</A>).
<DT><SAMP>`-rpath <VAR>libdir</VAR>'</SAMP>
<DD>
If <VAR>output-file</VAR> is a library, it will eventually be installed in
<VAR>libdir</VAR>. If <VAR>output-file</VAR> is a program, add <VAR>libdir</VAR> to
the run-time path of the program.
<DT><SAMP>`-R <VAR>libdir</VAR>'</SAMP>
<DD>
If <VAR>output-file</VAR> is a program, add <VAR>libdir</VAR> to its run-time
path. If <VAR>output-file</VAR> is a library, add -R<VAR>libdir</VAR> to its
<VAR>dependency_libs</VAR>, so that, whenever the library is linked into a
program, <VAR>libdir</VAR> will be added to its run-time path.
<DT><SAMP>`-static'</SAMP>
<DD>
If <VAR>output-file</VAR> is a program, then do not link it against any
uninstalled shared libtool libraries. If <VAR>output-file</VAR> is a
library, then only create a static library.
<DT><SAMP>`-version-info <VAR>current</VAR>[:<VAR>revision</VAR>[:<VAR>age</VAR>]]'</SAMP>
<DD>
If <VAR>output-file</VAR> is a libtool library, use interface version
information <VAR>current</VAR>, <VAR>revision</VAR>, and <VAR>age</VAR> to build it
(see section <A HREF="libtool.html#SEC32">Library interface versions</A>). Do <STRONG>not</STRONG> use this flag to specify package
release information, rather see the <SAMP>`-release'</SAMP> flag.
<DT><SAMP>`-Wl,<VAR>flag</VAR>'</SAMP>
<DD>
<DT><SAMP>`-Xlinker <VAR>flag</VAR>'</SAMP>
<DD>
Pass a linker specific flag directly to the linker.
</DL>
<P>
If the <VAR>output-file</VAR> ends in <SAMP>`.la'</SAMP>, then a libtool library is
created, which must be built only from library objects (<SAMP>`.lo'</SAMP> files).
The <SAMP>`-rpath'</SAMP> option is required. In the current implementation,
libtool libraries may not depend on other uninstalled libtool libraries
(see section <A HREF="libtool.html#SEC39">Inter-library dependencies</A>).
<P>
If the <VAR>output-file</VAR> ends in <SAMP>`.a'</SAMP>, then a standard library is
created using <CODE>ar</CODE> and possibly <CODE>ranlib</CODE>.
<P>
<A NAME="IDX55"></A>
<A NAME="IDX56"></A>
If <VAR>output-file</VAR> ends in <SAMP>`.o'</SAMP> or <SAMP>`.lo'</SAMP>, then a reloadable object
file is created from the input files (generally using <SAMP>`ld -r'</SAMP>).
This method is often called <EM>partial linking</EM>.
<P>
Otherwise, an executable program is created.
<H2><A NAME="SEC18" HREF="libtool_toc.html#TOC18">Execute mode</A></H2>
<P>
<A NAME="IDX57"></A>
<A NAME="IDX58"></A>
<P>
For <EM>execute</EM> mode, the library path is automatically set, then a
program is executed.
<P>
The first of the <VAR>mode-args</VAR> is treated as a program name, with the
rest as arguments to that program.
<P>
The following components of <VAR>mode-args</VAR> are treated specially:
<DL COMPACT>
<DT><SAMP>`-dlopen <VAR>file</VAR>'</SAMP>
<DD>
Add the directory containing <VAR>file</VAR> to the library path.
</DL>
<P>
This mode sets the library path environment variable according to any
<SAMP>`-dlopen'</SAMP> flags.
<P>
If any of the <VAR>args</VAR> are libtool executable wrappers, then they are
translated into the name of their corresponding uninstalled binary, and
any of their required library directories are added to the library path.
<H2><A NAME="SEC19" HREF="libtool_toc.html#TOC19">Install mode</A></H2>
<P>
<A NAME="IDX59"></A>
<A NAME="IDX60"></A>
<P>
In <EM>install</EM> mode, libtool interprets <VAR>mode-args</VAR> as an
installation command beginning with <CODE>cp</CODE>, or a BSD-compatible
<CODE>install</CODE> program.
<P>
The rest of the <VAR>mode-args</VAR> are interpreted as arguments to that
command.
<P>
The command is run, and any necessary unprivileged post-installation
commands are also completed.
<H2><A NAME="SEC20" HREF="libtool_toc.html#TOC20">Finish mode</A></H2>
<P>
<A NAME="IDX61"></A>
<A NAME="IDX62"></A>
<P>
<EM>Finish</EM> mode helps system administrators install libtool libraries
so that they can be located and linked into user programs.
<P>
Each <VAR>mode-arg</VAR> is interpreted as the name of a library directory.
Running this command may require superuser privileges, so the
<SAMP>`--dry-run'</SAMP> option may be useful.
<H2><A NAME="SEC21" HREF="libtool_toc.html#TOC21">Uninstall mode</A></H2>
<P>
<A NAME="IDX63"></A>
<A NAME="IDX64"></A>
<P>
<EM>Uninstall</EM> mode deletes installed libraries, executables and objects.
<P>
The first <VAR>mode-arg</VAR> is the name of the program to use to delete
files (typically <TT>`/bin/rm'</TT>).
<P>
The remaining <VAR>mode-args</VAR> are either flags for the deletion program
(beginning with a `-'), or the names of files to delete.
<H2><A NAME="SEC22" HREF="libtool_toc.html#TOC22">Clean mode</A></H2>
<P>
<A NAME="IDX65"></A>
<A NAME="IDX66"></A>
<P>
<EM>Clean</EM> mode deletes uninstalled libraries, executables, objects
and libtool's temporary files associated with them.
<P>
The first <VAR>mode-arg</VAR> is the name of the program to use to delete
files (typically <TT>`/bin/rm'</TT>).
<P>
The remaining <VAR>mode-args</VAR> are either flags for the deletion program
(beginning with a `-'), or the names of files to delete.
<H1><A NAME="SEC23" HREF="libtool_toc.html#TOC23">Integrating libtool with your package</A></H1>
<P>
This chapter describes how to integrate libtool with your packages so
that your users can install hassle-free shared libraries.
<H2><A NAME="SEC24" HREF="libtool_toc.html#TOC24">Writing <TT>`Makefile'</TT> rules for libtool</A></H2>
<P>
<A NAME="IDX67"></A>
<A NAME="IDX68"></A>
<A NAME="IDX69"></A>
<P>
Libtool is fully integrated with Automake (see section `Introduction' in <CITE>The Automake Manual</CITE>), starting with Automake version 1.2.
<P>
If you want to use libtool in a regular <TT>`Makefile'</TT> (or
<TT>`Makefile.in'</TT>), you are on your own. If you're not using Automake
1.2, and you don't know how to incorporate libtool into your package you
need to do one of the following:
<OL>
<LI>
Download Automake (version 1.2 or later) from your nearest GNU mirror,
install it, and start using it.
<LI>
Learn how to write <TT>`Makefile'</TT> rules by hand. They're sometimes complex,
but if you're clever enough to write rules for compiling your old
libraries, then you should be able to figure out new rules for libtool
libraries (hint: examine the <TT>`Makefile.in'</TT> in the <TT>`demo'</TT>
subdirectory of the libtool distribution... note especially that it
was automatically generated from the <TT>`Makefile.am'</TT> by Automake).
</OL>
<H2><A NAME="SEC25" HREF="libtool_toc.html#TOC25">Using Automake with libtool</A></H2>
<P>
<A NAME="IDX70"></A>
Libtool library support is implemented under the <SAMP>`LTLIBRARIES'</SAMP>
primary.
<P>
Here are some samples from the Automake <TT>`Makefile.am'</TT> in the
libtool distribution's <TT>`demo'</TT> subdirectory.
<P>
First, to link a program against a libtool library, just use the
<SAMP>`program_LDADD'</SAMP> variable:
<PRE>
bin_PROGRAMS = hell hell.debug
# Build hell from main.c and libhello.la
hell_SOURCES = main.c
hell_LDADD = libhello.la
# Create an easier-to-debug version of hell.
hell_debug_SOURCES = main.c
hell_debug_LDADD = libhello.la
hell_debug_LDFLAGS = -static
</PRE>
<P>
The flags <SAMP>`-dlopen'</SAMP> or <SAMP>`-dlpreopen'</SAMP> (see section <A HREF="libtool.html#SEC17">Link mode</A>) would
fit better in the <VAR>program_LDADD</VAR> variable. Unfortunately, GNU
automake, up to release 1.4, doesn't accept these flags in a
<VAR>program_LDADD</VAR> variable, so you have the following alternatives:
<UL>
<LI>
add them to <VAR>program_LDFLAGS</VAR>, and list the libraries in
<VAR>program_DEPENDENCIES</VAR>, then wait for a release of GNU automake that
accepts these flags where they belong;
<LI>
surround the flags between quotes, but then you must set
<VAR>program_DEPENDENCIES</VAR> too:
<PRE>
program_LDADD = "-dlopen" libfoo.la
program_DEPENDENCIES = libfoo.la
</PRE>
<LI>
set and <SAMP>`AC_SUBST'</SAMP> variables <VAR>DLOPEN</VAR> and <VAR>DLPREOPEN</VAR> in
<TT>`configure.in'</TT> and use <SAMP>`@DLOPEN@'</SAMP> and <SAMP>`@DLPREOPEN@'</SAMP>
as replacements for the explicit flags <SAMP>`-dlopen'</SAMP> and
<SAMP>`-dlpreopen'</SAMP> in <SAMP>`program_LDADD'</SAMP>. Automake will discard
<SAMP>`AC_SUBST'</SAMP>ed variables from dependencies, so it will behave exactly
as we expect it to behave when it accepts these flags in
<SAMP>`program_LDADD'</SAMP>. But hey!, this is ugly!
</UL>
<P>
You may use the <SAMP>`program_LDFLAGS'</SAMP> variable to stuff in any flags
you want to pass to libtool while linking <SAMP>`program'</SAMP> (such as
<SAMP>`-static'</SAMP> to avoid linking uninstalled shared libtool libraries).
<P>
Building a libtool library is almost as trivial... note the use of
<SAMP>`libhello_la_LDFLAGS'</SAMP> to pass the <SAMP>`-version-info'</SAMP>
(see section <A HREF="libtool.html#SEC32">Library interface versions</A>) option to libtool:
<PRE>
# Build a libtool library, libhello.la for installation in libdir.
lib_LTLIBRARIES = libhello.la
libhello_la_SOURCES = hello.c foo.c
libhello_la_LDFLAGS = -version-info 3:12:1
</PRE>
<P>
The <SAMP>`-rpath'</SAMP> option is passed automatically by Automake (except for
libraries listed as <CODE>noinst_LTLIBRARIES</CODE>), so you
should not specify it.
<P>
See section `The Automake Manual' in <CITE>The Automake Manual</CITE>, for more information.
<H2><A NAME="SEC26" HREF="libtool_toc.html#TOC26">Configuring libtool</A></H2>
<P>
<A NAME="IDX71"></A>
<P>
Libtool requires intimate knowledge of your compiler suite and operating
system in order to be able to create shared libraries and link against
them properly. When you install the libtool distribution, a
system-specific libtool script is installed into your binary directory.
<P>
However, when you distribute libtool with your own packages
(see section <A HREF="libtool.html#SEC28">Including libtool in your package</A>), you do not always know which compiler suite and
operating system are used to compile your package.
<P>
For this reason, libtool must be <EM>configured</EM> before it can be
used. This idea should be familiar to anybody who has used a GNU
<CODE>configure</CODE> script. <CODE>configure</CODE> runs a number of tests for
system features, then generates the <TT>`Makefiles'</TT> (and possibly a
<TT>`config.h'</TT> header file), after which you can run <CODE>make</CODE> and
build the package.
<P>
Libtool adds its own tests to your <CODE>configure</CODE> script in order to
generate a libtool script for the installer's host machine.
<H3><A NAME="SEC27" HREF="libtool_toc.html#TOC27">The <CODE>AC_PROG_LIBTOOL</CODE> macro</A></H3>
<P>
If you are using GNU Autoconf (or Automake), you should add a call to
<CODE>AC_PROG_LIBTOOL</CODE> to your <TT>`configure.in'</TT> file. This macro
adds many new tests to the <CODE>configure</CODE> script so that the generated
libtool script will understand the characteristics of the host:
<P>
<DL>
<DT><U>Macro:</U> <B>AC_PROG_LIBTOOL</B>
<DD><A NAME="IDX72"></A>
<DT><U>Macro:</U> <B>AM_PROG_LIBTOOL</B>
<DD><A NAME="IDX73"></A>
Add support for the <SAMP>`--enable-shared'</SAMP> and <SAMP>`--disable-shared'</SAMP>
<CODE>configure</CODE> flags.<A NAME="DOCF4" HREF="libtool_foot.html#FOOT4">(4)</A> <CODE>AM_PROG_LIBTOOL</CODE> was the
old name for this macro, and although supported at the moment is
deprecated.
<P>
By default, this macro turns on shared libraries if they are available,
and also enables static libraries if they don't conflict with the shared
libraries. You can modify these defaults by calling either the
<CODE>AC_DISABLE_SHARED</CODE> or <CODE>AC_DISABLE_STATIC</CODE> macros:
<PRE>
# Turn off shared libraries during beta-testing, since they
# make the build process take too long.
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
</PRE>
<P>
The user may specify modified forms of the configure flags
<SAMP>`--enable-shared'</SAMP> and <SAMP>`--enable-static'</SAMP> to choose whether
shared or static libraries are built based on the name of the package.
For example, to have shared <SAMP>`bfd'</SAMP> and <SAMP>`gdb'</SAMP> libraries built,
but not shared <SAMP>`libg++'</SAMP>, you can run all three <CODE>configure</CODE>
scripts as follows:
<PRE>
trick$ ./configure --enable-shared=bfd,gdb
</PRE>
<P>
In general, specifying <SAMP>`--enable-shared=<VAR>pkgs</VAR>'</SAMP> is the same as
configuring with <SAMP>`--enable-shared'</SAMP> every package named in the
comma-separated <VAR>pkgs</VAR> list, and every other package with
<SAMP>`--disable-shared'</SAMP>. The <SAMP>`--enable-static=<VAR>pkgs</VAR>'</SAMP> flag
behaves similarly, but it uses <SAMP>`--enable-static'</SAMP> and
<SAMP>`--disable-static'</SAMP>. The same applies to the
<SAMP>`--enable-fast-install=<VAR>pkgs</VAR>'</SAMP> flag, which uses
<SAMP>`--enable-fast-install'</SAMP> and <SAMP>`--disable-fast-install'</SAMP>.
<P>
The package name <SAMP>`default'</SAMP> matches any packages which have not set
their name in the <CODE>PACKAGE</CODE> environment variable.
<P>
This macro also sets the shell variable <VAR>LIBTOOL_DEPS</VAR>, that you can
use to automatically update the libtool script if it becomes
out-of-date. In order to do that, add to your <TT>`configure.in'</TT>:
<PRE>
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
</PRE>
<P>
and, to <TT>`Makefile.in'</TT> or <TT>`Makefile.am'</TT>:
<PRE>
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
</PRE>
<P>
If you are using GNU automake, you can omit the assignment, as automake
will take care of it. You'll obviously have to create some dependency
on <TT>`libtool'</TT>.
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>AC_LIBTOOL_DLOPEN</B>
<DD><A NAME="IDX74"></A>
Enable checking for dlopen support. This macro should be used if
the package makes use of the <SAMP>`-dlopen'</SAMP> and <SAMP>`-dlpreopen'</SAMP> flags,
otherwise libtool will assume that the system does not support dlopening.
The macro must be called <STRONG>before</STRONG> <CODE>AC_PROG_LIBTOOL</CODE>.
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>AC_LIBTOOL_WIN32_DLL</B>
<DD><A NAME="IDX75"></A>
This macro should be used if the package has been ported to build clean
dlls on win32 platforms. Usually this means that any library data items
are exported with <CODE>__declspec(dllexport)</CODE> and imported with
<CODE>__declspec(dllimport)</CODE>. If this macro is not used, libtool will
assume that the package libraries are not dll clean and will build only
static libraries on win32 hosts.
<P>
This macro must be called <STRONG>before</STRONG> <CODE>AC_PROG_LIBTOOL</CODE>, and
provision must be made to pass <SAMP>`-no-undefined'</SAMP> to <CODE>libtool</CODE>
in link mode from the package <CODE>Makefile</CODE>. Naturally, if you pass
<SAMP>`-no-undefined'</SAMP>, you must ensure that all the library symbols
<STRONG>really are</STRONG> defined at link time!
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>AC_DISABLE_FAST_INSTALL</B>
<DD><A NAME="IDX76"></A>
Change the default behaviour for <CODE>AC_PROG_LIBTOOL</CODE> to disable
optimization for fast installation. The user may still override this
default, depending on platform support, by specifying
<SAMP>`--enable-fast-install'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>AC_DISABLE_SHARED</B>
<DD><A NAME="IDX77"></A>
<DT><U>Macro:</U> <B>AM_DISABLE_SHARED</B>
<DD><A NAME="IDX78"></A>
Change the default behaviour for <CODE>AC_PROG_LIBTOOL</CODE> to disable
shared libraries. The user may still override this default by
specifying <SAMP>`--enable-shared'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>AC_DISABLE_STATIC</B>
<DD><A NAME="IDX79"></A>
<DT><U>Macro:</U> <B>AM_DISABLE_STATIC</B>
<DD><A NAME="IDX80"></A>
Change the default behaviour for <CODE>AC_PROG_LIBTOOL</CODE> to disable
static libraries. The user may still override this default by
specifying <SAMP>`--enable-static'</SAMP>.
</DL>
<P>
The tests in <CODE>AC_PROG_LIBTOOL</CODE> also recognize the following
environment variables:
<P>
<DL>
<DT><U>Variable:</U> <B>CC</B>
<DD><A NAME="IDX81"></A>
The C compiler that will be used by the generated <CODE>libtool</CODE>. If
this is not set, <CODE>AC_PROG_LIBTOOL</CODE> will look for <CODE>gcc</CODE> or
<CODE>cc</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>CFLAGS</B>
<DD><A NAME="IDX82"></A>
Compiler flags used to generate standard object files. If this is not
set, <CODE>AC_PROG_LIBTOOL</CODE> will not use any such flags. It affects
only the way <CODE>AC_PROG_LIBTOOL</CODE> runs tests, not the produced
<CODE>libtool</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>CPPFLAGS</B>
<DD><A NAME="IDX83"></A>
C preprocessor flags. If this is not set, <CODE>AC_PROG_LIBTOOL</CODE> will
not use any such flags. It affects only the way <CODE>AC_PROG_LIBTOOL</CODE>
runs tests, not the produced <CODE>libtool</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LD</B>
<DD><A NAME="IDX84"></A>
The system linker to use (if the generated <CODE>libtool</CODE> requires one).
If this is not set, <CODE>AC_PROG_LIBTOOL</CODE> will try to find out what is
the linker used by <VAR>CC</VAR>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LDFLAGS</B>
<DD><A NAME="IDX85"></A>
The flags to be used by <CODE>libtool</CODE> when it links a program. If
this is not set, <CODE>AC_PROG_LIBTOOL</CODE> will not use any such flags. It
affects only the way <CODE>AC_PROG_LIBTOOL</CODE> runs tests, not the produced
<CODE>libtool</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LIBS</B>
<DD><A NAME="IDX86"></A>
The libraries to be used by <CODE>AC_PROG_LIBTOOL</CODE> when it links a
program. If this is not set, <CODE>AC_PROG_LIBTOOL</CODE> will not use any
such flags. It affects only the way <CODE>AC_PROG_LIBTOOL</CODE> runs tests,
not the produced <CODE>libtool</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>NM</B>
<DD><A NAME="IDX87"></A>
Program to use rather than checking for <CODE>nm</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>RANLIB</B>
<DD><A NAME="IDX88"></A>
Program to use rather than checking for <CODE>ranlib</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LN_S</B>
<DD><A NAME="IDX89"></A>
A command that creates a link of a program, a soft-link if possible, a
hard-link otherwise. <CODE>AC_PROG_LIBTOOL</CODE> will check for a suitable
program if this variable is not set.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>DLLTOOL</B>
<DD><A NAME="IDX90"></A>
Program to use rather than checking for <CODE>dlltool</CODE>. Only meaningful
for Cygwin/MS-Windows.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>OBJDUMP</B>
<DD><A NAME="IDX91"></A>
Program to use rather than checking for <CODE>objdump</CODE>. Only meaningful
for Cygwin/MS-Windows.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>AS</B>
<DD><A NAME="IDX92"></A>
Program to use rather than checking for <CODE>as</CODE>. Only used on
Cygwin/MS-Windows at the moment.
</DL>
<P>
<A NAME="IDX93"></A>
When you invoke the <CODE>libtoolize</CODE> program (see section <A HREF="libtool.html#SEC29">Invoking <CODE>libtoolize</CODE></A>), it will tell you where to find a definition of
<CODE>AC_PROG_LIBTOOL</CODE>. If you use Automake, the <CODE>aclocal</CODE> program
will automatically add <CODE>AC_PROG_LIBTOOL</CODE> support to your
<CODE>configure</CODE> script.
<P>
Nevertheless, it is advisable to include a copy of <TT>`libtool.m4'</TT> in
<TT>`acinclude.m4'</TT>, so that, even if <TT>`aclocal.m4'</TT> and
<TT>`configure'</TT> are rebuilt for any reason, the appropriate libtool
macros will be used. The alternative is to hope the user will have a
compatible version of <TT>`libtool.m4'</TT> installed and accessible for
<CODE>aclocal</CODE>. This may lead to weird errors when versions don't
match.
<H2><A NAME="SEC28" HREF="libtool_toc.html#TOC28">Including libtool in your package</A></H2>
<P>
In order to use libtool, you need to include the following files with
your package:
<DL COMPACT>
<DT><TT>`config.guess'</TT>
<DD>
<A NAME="IDX94"></A>
Attempt to guess a canonical system name.
<DT><TT>`config.sub'</TT>
<DD>
<A NAME="IDX95"></A>
Canonical system name validation subroutine script.
<DT><TT>`ltmain.sh'</TT>
<DD>
<A NAME="IDX96"></A>
A generic script implementing basic libtool functionality.
</DL>
<P>
Note that the libtool script itself should <EM>not</EM> be included with
your package. See section <A HREF="libtool.html#SEC26">Configuring libtool</A>.
<P>
You should use the <CODE>libtoolize</CODE> program, rather than manually
copying these files into your package.
<H3><A NAME="SEC29" HREF="libtool_toc.html#TOC29">Invoking <CODE>libtoolize</CODE></A></H3>
<P>
<A NAME="IDX97"></A>
<A NAME="IDX98"></A>
<A NAME="IDX99"></A>
<A NAME="IDX100"></A>
<P>
The <CODE>libtoolize</CODE> program provides a standard way to add libtool
support to your package. In the future, it may implement better usage
checking, or other features to make libtool even easier to use.
<P>
The <CODE>libtoolize</CODE> program has the following synopsis:
<PRE>
libtoolize [<VAR>option</VAR>]...
</PRE>
<P>
and accepts the following options:
<DL COMPACT>
<DT><SAMP>`--automake'</SAMP>
<DD>
Work silently, and assume that Automake libtool support is used.
<SAMP>`libtoolize --automake'</SAMP> is used by Automake to add libtool files to
your package, when <CODE>AC_PROG_LIBTOOL</CODE> appears in your
<TT>`configure.in'</TT>.
<DT><SAMP>`--copy'</SAMP>
<DD>
<DT><SAMP>`-c'</SAMP>
<DD>
Copy files from the libtool data directory rather than creating
symlinks.
<DT><SAMP>`--debug'</SAMP>
<DD>
Dump a trace of shell script execution to standard output. This
produces a lot of output, so you may wish to pipe it to <CODE>less</CODE> (or
<CODE>more</CODE>) or redirect to a file.
<DT><SAMP>`--dry-run'</SAMP>
<DD>
<DT><SAMP>`-n'</SAMP>
<DD>
Don't run any commands that modify the file system, just print them
out.
<DT><SAMP>`--force'</SAMP>
<DD>
<DT><SAMP>`-f'</SAMP>
<DD>
Replace existing libtool files. By default, <CODE>libtoolize</CODE> won't
overwrite existing files.
<DT><SAMP>`--help'</SAMP>
<DD>
Display a help message and exit.
<DT><SAMP>`--ltdl'</SAMP>
<DD>
Install libltdl in a subdirectory of your package.
<DT><SAMP>`--ltdl-tar'</SAMP>
<DD>
Add the file libltdl.tar.gz to your package.
<DT><SAMP>`--version'</SAMP>
<DD>
Print <CODE>libtoolize</CODE> version information and exit.
</DL>
<P>
<A NAME="IDX101"></A>
If <CODE>libtoolize</CODE> detects an explicit call to
<CODE>AC_CONFIG_AUX_DIR</CODE> (see section `The Autoconf Manual' in <CITE>The Autoconf Manual</CITE>) in your <TT>`configure.in'</TT>, it
will put the files in the specified directory.
<P>
<CODE>libtoolize</CODE> displays hints for adding libtool support to your
package, as well.
<H3><A NAME="SEC30" HREF="libtool_toc.html#TOC30">Autoconf <SAMP>`.o'</SAMP> macros</A></H3>
<P>
The Autoconf package comes with a few macros that run tests, then set a
variable corresponding to the name of an object file. Sometimes it is
necessary to use corresponding names for libtool objects.
<P>
Here are the names of variables that list libtool objects:
<P>
<DL>
<DT><U>Variable:</U> <B>LTALLOCA</B>
<DD><A NAME="IDX102"></A>
<A NAME="IDX103"></A>
Substituted by <CODE>AC_FUNC_ALLOCA</CODE> (see section `The Autoconf Manual' in <CITE>The Autoconf Manual</CITE>). Is either empty, or contains <SAMP>`alloca.lo'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LTLIBOBJS</B>
<DD><A NAME="IDX104"></A>
<A NAME="IDX105"></A>
Substituted by <CODE>AC_REPLACE_FUNCS</CODE> (see section `The Autoconf Manual' in <CITE>The Autoconf Manual</CITE>), and a few other functions.
</DL>
<P>
Unfortunately, the stable release of Autoconf (2.13, at the time of
this writing) does not have any way for libtool to provide support for
these variables. So, if you depend on them, use the following code
immediately before the call to <CODE>AC_OUTPUT</CODE> in your
<TT>`configure.in'</TT>:
<PRE>
LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
AC_SUBST(LTLIBOBJS)
LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
AC_SUBST(LTALLOCA)
AC_OUTPUT(...)
</PRE>
<H2><A NAME="SEC31" HREF="libtool_toc.html#TOC31">Static-only libraries</A></H2>
<P>
<A NAME="IDX106"></A>
<A NAME="IDX107"></A>
<A NAME="IDX108"></A>
<A NAME="IDX109"></A>
<A NAME="IDX110"></A>
<A NAME="IDX111"></A>
<A NAME="IDX112"></A>
<A NAME="IDX113"></A>
<A NAME="IDX114"></A>
<P>
When you are developing a package, it is often worthwhile to configure
your package with the <SAMP>`--disable-shared'</SAMP> flag, or to override the
defaults for <CODE>AC_PROG_LIBTOOL</CODE> by using the
<CODE>AC_DISABLE_SHARED</CODE> Autoconf macro (see section <A HREF="libtool.html#SEC27">The <CODE>AC_PROG_LIBTOOL</CODE> macro</A>). This prevents libtool from building
shared libraries, which has several advantages:
<UL>
<LI>
compilation is twice as fast, which can speed up your development cycle,
<LI>
debugging is easier because you don't need to deal with any complexities
added by shared libraries, and
<LI>
you can see how libtool behaves on static-only platforms.
</UL>
<P>
You may want to put a small note in your package <TT>`README'</TT> to let
other developers know that <SAMP>`--disable-shared'</SAMP> can save them time.
The following example note is taken from the GIMP<A NAME="DOCF5" HREF="libtool_foot.html#FOOT5">(5)</A> distribution <TT>`README'</TT>:
<PRE>
The GIMP uses GNU Libtool in order to build shared libraries on a
variety of systems. While this is very nice for making usable
binaries, it can be a pain when trying to debug a program. For that
reason, compilation of shared libraries can be turned off by
specifying the <SAMP>`--disable-shared'</SAMP> option to <TT>`configure'</TT>.
</PRE>
<H1><A NAME="SEC32" HREF="libtool_toc.html#TOC32">Library interface versions</A></H1>
<P>
<A NAME="IDX115"></A>
<A NAME="IDX116"></A>
<A NAME="IDX117"></A>
<P>
The most difficult issue introduced by shared libraries is that of
creating and resolving runtime dependencies. Dependencies on programs
and libraries are often described in terms of a single name, such as
<CODE>sed</CODE>. So, one may say "libtool depends on sed," and that is
good enough for most purposes.
<P>
However, when an interface changes regularly, we need to be more
specific: "Gnus 5.1 requires Emacs 19.28 or above." Here, the
description of an interface consists of a name, and a "version
number."
<P>
Even that sort of description is not accurate enough for some purposes.
What if Emacs 20 changes enough to break Gnus 5.1?
<P>
The same problem exists in shared libraries: we require a formal version
system to describe the sorts of dependencies that programs have on
shared libraries, so that the dynamic linker can guarantee that programs
are linked only against libraries that provide the interface they
require.
<H2><A NAME="SEC33" HREF="libtool_toc.html#TOC33">What are library interfaces?</A></H2>
<P>
<A NAME="IDX118"></A>
<P>
Interfaces for libraries may be any of the following (and more):
<UL>
<LI>
global variables: both names and types
<LI>
global functions: argument types and number, return types, and function names
<LI>
standard input, standard output, standard error, and file formats
<LI>
sockets, pipes, and other inter-process communication protocol formats
</UL>
<P>
Note that static functions do not count as interfaces, because they are
not directly available to the user of the library.
<H2><A NAME="SEC34" HREF="libtool_toc.html#TOC34">Libtool's versioning system</A></H2>
<P>
<A NAME="IDX119"></A>
<A NAME="IDX120"></A>
<A NAME="IDX121"></A>
<P>
Libtool has its own formal versioning system. It is not as flexible as
some, but it is definitely the simplest of the more powerful versioning
systems.
<P>
Think of a library as exporting several sets of interfaces, arbitrarily
represented by integers. When a program is linked against a library, it
may use any subset of those interfaces.
<P>
Libtool's description of the interfaces that a program uses is simple:
it encodes the least and the greatest interface numbers in the resulting
binary (<VAR>first-interface</VAR>, <VAR>last-interface</VAR>).
<P>
The dynamic linker is guaranteed that if a library supports <EM>every</EM>
interface number between <VAR>first-interface</VAR> and <VAR>last-interface</VAR>,
then the program can be relinked against that library.
<P>
Note that this can cause problems because libtool's compatibility
requirements are actually stricter than is necessary.
<P>
Say <TT>`libhello'</TT> supports interfaces 5, 16, 17, 18, and 19, and that
libtool is used to link <TT>`test'</TT> against <TT>`libhello'</TT>.
<P>
Libtool encodes the numbers 5 and 19 in <TT>`test'</TT>, and the dynamic
linker will only link <TT>`test'</TT> against libraries that support
<EM>every</EM> interface between 5 and 19. So, the dynamic linker refuses
to link <TT>`test'</TT> against <TT>`libhello'</TT>!
<P>
In order to eliminate this problem, libtool only allows libraries to
declare consecutive interface numbers. So, <TT>`libhello'</TT> can declare at
most that it supports interfaces 16 through 19. Then, the dynamic
linker will link <TT>`test'</TT> against <TT>`libhello'</TT>.
<P>
So, libtool library versions are described by three integers:
<DL COMPACT>
<DT><VAR>current</VAR>
<DD>
The most recent interface number that this library implements.
<DT><VAR>revision</VAR>
<DD>
The implementation number of the <VAR>current</VAR> interface.
<DT><VAR>age</VAR>
<DD>
The difference between the newest and oldest interfaces that this
library implements. In other words, the library implements all the
interface numbers in the range from number <CODE><VAR>current</VAR> -
<VAR>age</VAR></CODE> to <CODE><VAR>current</VAR></CODE>.
</DL>
<P>
If two libraries have identical <VAR>current</VAR> and <VAR>age</VAR> numbers,
then the dynamic linker chooses the library with the greater
<VAR>revision</VAR> number.
<H2><A NAME="SEC35" HREF="libtool_toc.html#TOC35">Updating library version information</A></H2>
<P>
If you want to use libtool's versioning system, then you must specify
the version information to libtool using the <SAMP>`-version-info'</SAMP> flag
during link mode (see section <A HREF="libtool.html#SEC17">Link mode</A>).
<P>
This flag accepts an argument of the form
<SAMP>`<VAR>current</VAR>[:<VAR>revision</VAR>[:<VAR>age</VAR>]]'</SAMP>. So, passing
<SAMP>`-version-info 3:12:1'</SAMP> sets <VAR>current</VAR> to 3, <VAR>revision</VAR> to
12, and <VAR>age</VAR> to 1.
<P>
If either <VAR>revision</VAR> or <VAR>age</VAR> are omitted, they default to 0.
Also note that <VAR>age</VAR> must be less than or equal to the <VAR>current</VAR>
interface number.
<P>
Here are a set of rules to help you update your library version
information:
<OL>
<LI>
Start with version information of <SAMP>`0:0:0'</SAMP> for each libtool library.
<LI>
Update the version information only immediately before a public release
of your software. More frequent updates are unnecessary, and only
guarantee that the current interface number gets larger faster.
<LI>
If the library source code has changed at all since the last update,
then increment <VAR>revision</VAR> (<SAMP>`<VAR>c</VAR>:<VAR>r</VAR>:<VAR>a</VAR>'</SAMP> becomes
<SAMP>`<VAR>c</VAR>:<EM>r+1</EM>:<VAR>a</VAR>'</SAMP>).
<LI>
If any interfaces have been added, removed, or changed since the last
update, increment <VAR>current</VAR>, and set <VAR>revision</VAR> to 0.
<LI>
If any interfaces have been added since the last public release, then
increment <VAR>age</VAR>.
<LI>
If any interfaces have been removed since the last public release, then
set <VAR>age</VAR> to 0.
</OL>
<P>
<STRONG><EM>Never</EM></STRONG> try to set the interface numbers so that they
correspond to the release number of your package. This is an abuse that
only fosters misunderstanding of the purpose of library versions.
Instead, use the <SAMP>`-release'</SAMP> flag (see section <A HREF="libtool.html#SEC36">Managing release information</A>), but be
warned that every release of your package will not be binary compatible
with any other release.
<H2><A NAME="SEC36" HREF="libtool_toc.html#TOC36">Managing release information</A></H2>
<P>
Often, people want to encode the name of the package release into the
shared library so that it is obvious to the user which package their
programs are linked against. This convention is used especially on
GNU/Linux:
<PRE>
trick$ <KBD>ls /usr/lib/libbfd*</KBD>
/usr/lib/libbfd.a /usr/lib/libbfd.so.2.7.0.2
/usr/lib/libbfd.so
trick$
</PRE>
<P>
On <SAMP>`trick'</SAMP>, <TT>`/usr/lib/libbfd.so'</TT> is a symbolic link to
<TT>`libbfd.so.2.7.0.2'</TT>, which was distributed as a part of
<SAMP>`binutils-2.7.0.2'</SAMP>.
<P>
Unfortunately, this convention conflicts directly with libtool's idea of
library interface versions, because the library interface rarely changes
at the same time that the release number does, and the library suffix is
never the same across all platforms.
<P>
So, in order to accommodate both views, you can use the <SAMP>`-release'</SAMP>
flag in order to set release information for libraries which you do not
want to use <SAMP>`-version-info'</SAMP>. For the <TT>`libbfd'</TT> example, the
next release which uses libtool should be built with <SAMP>`-release
2.9.0'</SAMP>, which will produce the following files on GNU/Linux:
<PRE>
trick$ <KBD>ls /usr/lib/libbfd*</KBD>
/usr/lib/libbfd-2.9.0.so /usr/lib/libbfd.a
/usr/lib/libbfd.so
trick$
</PRE>
<P>
In this case, <TT>`/usr/lib/libbfd.so'</TT> is a symbolic link to
<TT>`libbfd-2.9.0.so'</TT>. This makes it obvious that the user is dealing
with <SAMP>`binutils-2.9.0'</SAMP>, without compromising libtool's idea of
interface versions.
<P>
Note that this option causes a modification of the library name, so do
not use it unless you want to break binary compatibility with any past
library releases. In general, you should only use <SAMP>`-release'</SAMP> for
package-internal libraries or for ones whose interfaces change very
frequently.
<H1><A NAME="SEC37" HREF="libtool_toc.html#TOC37">Tips for interface design</A></H1>
<P>
<A NAME="IDX122"></A>
<A NAME="IDX123"></A>
<P>
Writing a good library interface takes a lot of practice and thorough
understanding of the problem that the library is intended to solve.
<P>
If you design a good interface, it won't have to change often, you won't
have to keep updating documentation, and users won't have to keep
relearning how to use the library.
<P>
Here is a brief list of tips for library interface design, which may
help you in your exploits:
<DL COMPACT>
<DT>Plan ahead
<DD>
Try to make every interface truly minimal, so that you won't need to
delete entry points very often.
<DT>Avoid interface changes
<DD>
<A NAME="IDX124"></A>
Some people love redesigning and changing entry points just for the heck
of it (note: <EM>renaming</EM> a function is considered changing an entry
point). Don't be one of those people. If you must redesign an
interface, then try to leave compatibility functions behind so that
users don't need to rewrite their existing code.
<DT>Use opaque data types
<DD>
<A NAME="IDX125"></A>
The fewer data type definitions a library user has access to, the
better. If possible, design your functions to accept a generic pointer
(which you can cast to an internal data type), and provide access
functions rather than allowing the library user to directly manipulate
the data.
That way, you have the freedom to change the data structures without
changing the interface.
This is essentially the same thing as using abstract data types and
inheritance in an object-oriented system.
<DT>Use header files
<DD>
<A NAME="IDX126"></A>
If you are careful to document each of your library's global functions
and variables in header files, and include them in your library source
files, then the compiler will let you know if you make any interface
changes by accident (see section <A HREF="libtool.html#SEC38">Writing C header files</A>).
<DT>Use the <CODE>static</CODE> keyword (or equivalent) whenever possible
<DD>
<A NAME="IDX127"></A>
The fewer global functions your library has, the more flexibility you'll
have in changing them. Static functions and variables may change forms
as often as you like... your users cannot access them, so they
aren't interface changes.
</DL>
<H2><A NAME="SEC38" HREF="libtool_toc.html#TOC38">Writing C header files</A></H2>
<P>
<A NAME="IDX128"></A>
<A NAME="IDX129"></A>
<A NAME="IDX130"></A>
<P>
Writing portable C header files can be difficult, since they may be read
by different types of compilers:
<DL COMPACT>
<DT>C++ compilers
<DD>
C++ compilers require that functions be declared with full prototypes,
since C++ is more strongly typed than C. C functions and variables also
need to be declared with the <CODE>extern "C"</CODE> directive, so that the
names aren't mangled. See section <A HREF="libtool.html#SEC54">Writing libraries for C++</A>, for other issues relevant
to using C++ with libtool.
<DT>ANSI C compilers
<DD>
ANSI C compilers are not as strict as C++ compilers, but functions
should be prototyped to avoid unnecessary warnings when the header file
is <CODE>#include</CODE>d.
<DT>non-ANSI C compilers
<DD>
Non-ANSI compilers will report errors if functions are prototyped.
</DL>
<P>
These complications mean that your library interface headers must use
some C preprocessor magic in order to be usable by each of the above
compilers.
<P>
<TT>`foo.h'</TT> in the <TT>`demo'</TT> subdirectory of the libtool distribution
serves as an example for how to write a header file that can be
safely installed in a system directory.
<P>
Here are the relevant portions of that file:
<PRE>
/* BEGIN_C_DECLS should be used at the beginning of your declarations,
so that C++ compilers don't mangle their names. Use END_C_DECLS at
the end of C declarations. */
#undef BEGIN_C_DECLS
#undef END_C_DECLS
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else
# define BEGIN_C_DECLS /* empty */
# define END_C_DECLS /* empty */
#endif
/* PARAMS is a macro used to wrap function prototypes, so that
compilers that don't understand ANSI C prototypes still work,
and ANSI C compilers can issue warnings about type mismatches. */
#undef PARAMS
#if defined (__STDC__) || defined (_AIX) \
|| (defined (__mips) && defined (_SYSTYPE_SVR4)) \
|| defined(WIN32) || defined(__cplusplus)
# define PARAMS(protos) protos
#else
# define PARAMS(protos) ()
#endif
</PRE>
<P>
These macros are used in <TT>`foo.h'</TT> as follows:
<PRE>
#ifndef FOO_H
#define FOO_H 1
/* The above macro definitions. */
#include "..."
BEGIN_C_DECLS
int foo PARAMS((void));
int hello PARAMS((void));
END_C_DECLS
#endif /* !FOO_H */
</PRE>
<P>
Note that the <TT>`#ifndef FOO_H'</TT> prevents the body of <TT>`foo.h'</TT>
from being read more than once in a given compilation.
<P>
Also the only thing that must go outside the
<CODE>BEGIN_C_DECLS</CODE>/<CODE>END_C_DECLS</CODE> pair are <CODE>#include</CODE> lines.
Strictly speaking it is only C symbol names that need to be protected,
but your header files will be more maintainable if you have a single
pair of of these macros around the majority of the header contents.
<P>
You should use these definitions of <CODE>PARAMS</CODE>, <CODE>BEGIN_C_DECLS</CODE>,
and <CODE>END_C_DECLS</CODE> into your own headers. Then, you may use them to
create header files that are valid for C++, ANSI, and non-ANSI
compilers<A NAME="DOCF6" HREF="libtool_foot.html#FOOT6">(6)</A>.
<P>
Do not be naive about writing portable code. Following the tips given
above will help you miss the most obvious problems, but there are
definitely other subtle portability issues. You may need to cope with
some of the following issues:
<UL>
<LI>
Pre-ANSI compilers do not always support the <CODE>void *</CODE> generic
pointer type, and so need to use <CODE>char *</CODE> in its place.
<LI>
The <CODE>const</CODE>, <CODE>inline</CODE> and <CODE>signed</CODE> keywords are not
supported by some compilers, especially pre-ANSI compilers.
<LI>
The <CODE>long double</CODE> type is not supported by many compilers.
</UL>
<H1><A NAME="SEC39" HREF="libtool_toc.html#TOC39">Inter-library dependencies</A></H1>
<P>
<A NAME="IDX131"></A>
<A NAME="IDX132"></A>
<P>
By definition, every shared library system provides a way for
executables to depend on libraries, so that symbol resolution is
deferred until runtime.
<P>
An <EM>inter-library dependency</EM> is one in which a library depends on
other libraries. For example, if the libtool library <TT>`libhello'</TT>
uses the <CODE>cos</CODE> function, then it has an inter-library dependency
on <TT>`libm'</TT>, the math library that implements <CODE>cos</CODE>.
<P>
Some shared library systems provide this feature in an
internally-consistent way: these systems allow chains of dependencies of
potentially infinite length.
<P>
However, most shared library systems are restricted in that they only
allow a single level of dependencies. In these systems, programs may
depend on shared libraries, but shared libraries may not depend on other
shared libraries.
<P>
In any event, libtool provides a simple mechanism for you to declare
inter-library dependencies: for every library <TT>`lib<VAR>name</VAR>'</TT> that
your own library depends on, simply add a corresponding
<CODE>-l<VAR>name</VAR></CODE> option to the link line when you create your
library. To make an example of our
<TT>`libhello'</TT> that depends on <TT>`libm'</TT>:
<PRE>
burger$ <KBD>libtool gcc -g -O -o libhello.la foo.lo hello.lo \
-rpath /usr/local/lib -lm</KBD>
burger$
</PRE>
<P>
When you link a program against <TT>`libhello'</TT>, you don't need to
specify the same <SAMP>`-l'</SAMP> options again: libtool will do that for you,
in order to guarantee that all the required libraries are found. This
restriction is only necessary to preserve compatibility with static
library systems and simple dynamic library systems.
<P>
Some platforms, such as AIX, do not even allow you this
flexibility. In order to build a shared library, it must be entirely
self-contained (that is, have references only to symbols that are found
in the <SAMP>`.lo'</SAMP> files or the specified <SAMP>`-l'</SAMP> libraries), and you
need to specify the <VAR>-no-undefined</VAR> flag. By default, libtool
builds only static libraries on these kinds of platforms.
<P>
The simple-minded inter-library dependency tracking code of libtool
releases prior to 1.2 was disabled because it was not clear when it was
possible to link one library with another, and complex failures would
occur. A more complex implementation of this concept was re-introduced
before release 1.3, but it has not been ported to all platforms that
libtool supports. The default, conservative behavior is to avoid
linking one library with another, introducing their inter-dependencies
only when a program is linked with them.
<H1><A NAME="SEC40" HREF="libtool_toc.html#TOC40">Dlopened modules</A></H1>
<P>
<A NAME="IDX133"></A>
<A NAME="IDX134"></A>
<A NAME="IDX135"></A>
<A NAME="IDX136"></A>
<A NAME="IDX137"></A>
<A NAME="IDX138"></A>
<A NAME="IDX139"></A>
<A NAME="IDX140"></A>
<P>
It can sometimes be confusing to discuss <EM>dynamic linking</EM>, because
the term is used to refer to two different concepts:
<OL>
<LI>
Compiling and linking a program against a shared library, which is
resolved automatically at run time by the dynamic linker. In this
process, dynamic linking is transparent to the application.
<LI>
The application calling functions such as <CODE>dlopen</CODE>,<A NAME="DOCF7" HREF="libtool_foot.html#FOOT7">(7)</A> which load
arbitrary, user-specified modules at runtime. This type of dynamic
linking is explicitly controlled by the application.
</OL>
<P>
To mitigate confusion, this manual refers to the second type of dynamic
linking as <EM>dlopening</EM> a module.
<P>
The main benefit to dlopening object modules is the ability to access
compiled object code to extend your program, rather than using an
interpreted language. In fact, dlopen calls are frequently used in
language interpreters to provide an efficient way to extend the
language.
<P>
As of version 1.4.2, libtool provides support for dlopened
modules. However, you should indicate that your package is willing to
use such support, by using the macro <SAMP>`AC_LIBTOOL_DLOPEN'</SAMP> in
<TT>`configure.in'</TT>. If this macro is not used (or it is used
<EM>after</EM> <SAMP>`AC_PROG_LIBTOOL'</SAMP>), libtool will assume no dlopening
mechanism is available, and will try to simulate it.
<P>
This chapter discusses how you as a dlopen application developer might
use libtool to generate dlopen-accessible modules.
<H2><A NAME="SEC41" HREF="libtool_toc.html#TOC41">Building modules to dlopen</A></H2>
<P>
On some operating systems, a program symbol must be specially declared
in order to be dynamically resolved with the <CODE>dlsym</CODE> (or
equivalent) function.
<P>
Libtool provides the <SAMP>`-export-dynamic'</SAMP> and <SAMP>`-module'</SAMP>
link flags (see section <A HREF="libtool.html#SEC17">Link mode</A>), which do this declaration.
You need to use these flags if you are linking an application program that
dlopens other modules or a libtool library that will also be dlopened.
<P>
For example, if we wanted to build a shared library, <TT>`libhello'</TT>,
that would later be dlopened by an application, we would add
<SAMP>`-module'</SAMP> to the other link flags:
<PRE>
burger$ <KBD>libtool gcc -module -o libhello.la foo.lo \
hello.lo -rpath /usr/local/lib -lm</KBD>
burger$
</PRE>
<P>
If symbols from your <EM>executable</EM> are needed to satisfy unresolved
references in a library you want to dlopen you will have to use the flag
<SAMP>`-export-dynamic'</SAMP>.
You should use <SAMP>`-export-dynamic'</SAMP> while linking the executable that calls
dlopen:
<PRE>
burger$ <KBD>libtool gcc -export-dynamic -o hell-dlopener main.o</KBD>
burger$
</PRE>
<H2><A NAME="SEC42" HREF="libtool_toc.html#TOC42">Dlpreopening</A></H2>
<P>
Libtool provides special support for dlopening libtool object and
libtool library files, so that their symbols can be resolved <EM>even
on platforms without any <CODE>dlopen</CODE> and <CODE>dlsym</CODE>
functions</EM>.
<P>
Consider the following alternative ways of loading code into your
program, in order of increasing "laziness":
<OL>
<LI>
Linking against object files that become part of the program executable,
whether or not they are referenced. If an object file cannot be found,
then the linker refuses to create the executable.
<LI>
Declaring a static library to the linker, so that it is searched at link
time in order to satisfy any undefined references in the above object
files. If the static library cannot be found, then the linker refuses
to link the executable.
<LI>
Declaring a shared library to the runtime linker, so that it is searched
at runtime in order to satisfy any undefined references in the above
files. If the shared library cannot be found, then the dynamic linker
aborts the program before it runs.
<LI>
Dlopening a module, so that the application can resolve its own,
dynamically-computed references. If there is an error opening the
module, or the module is not found, then the application can recover
without crashing.
</OL>
<P>
Libtool emulates <SAMP>`-dlopen'</SAMP> on static platforms by linking objects
into the program at compile time, and creating data structures that
represent the program's symbol table.
<P>
In order to use this feature, you must declare the objects you want your
application to dlopen by using the <SAMP>`-dlopen'</SAMP> or <SAMP>`-dlpreopen'</SAMP>
flags when you link your program (see section <A HREF="libtool.html#SEC17">Link mode</A>).
<P>
<DL>
<DT><U>Structure:</U> struct <B>lt_dlsymlist</B> <I>{ const char *<VAR>name</VAR>; lt_ptr <VAR>address</VAR>; }</I>
<DD><A NAME="IDX141"></A>
The <VAR>name</VAR> attribute is a null-terminated character string of the
symbol name, such as <CODE>"fprintf"</CODE>. The <VAR>address</VAR> attribute is a
generic pointer to the appropriate object, such as <CODE>&fprintf</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> const lt_dlsymlist * <B>lt_preloaded_symbols</B>
<DD><A NAME="IDX142"></A>
An array of <VAR>lt_symbol</VAR> structures, representing all the preloaded
symbols linked into the program. For each <SAMP>`-dlpreloaded'</SAMP> file
there is an element with the <VAR>name</VAR> of the file and a <VAR>address</VAR>
of <CODE>0</CODE>, followed by all symbols exported from this file.
For the executable itself the special name @PROGRAM@ is used.
The last element has a <VAR>name</VAR> and <VAR>address</VAR> of <CODE>0</CODE>.
</DL>
<P>
Some compilers may allow identifiers which are not valid in ANSI C, such
as dollar signs. Libtool only recognizes valid ANSI C symbols (an
initial ASCII letter or underscore, followed by zero or more ASCII
letters, digits, and underscores), so non-ANSI symbols will not appear
in <VAR>lt_preloaded_symbols</VAR>.
<H2><A NAME="SEC43" HREF="libtool_toc.html#TOC43">Finding the correct name to dlopen</A></H2>
<P>
<A NAME="IDX143"></A>
<A NAME="IDX144"></A>
<P>
After a library has been linked with <SAMP>`-module'</SAMP>, it can be dlopened.
Unfortunately, because of the variation in library names,
your package needs to determine the correct file to dlopen.
<P>
The most straightforward and flexible implementation is to determine the
name at runtime, by finding the installed <SAMP>`.la'</SAMP> file, and searching
it for the following lines:
<PRE>
# The name that we can <CODE>dlopen</CODE>.
dlname='<VAR>dlname</VAR>'
</PRE>
<P>
If <VAR>dlname</VAR> is empty, then the library cannot be dlopened.
Otherwise, it gives the dlname of the library. So, if the library was
installed as <TT>`/usr/local/lib/libhello.la'</TT>, and the <VAR>dlname</VAR> was
<TT>`libhello.so.3'</TT>, then <TT>`/usr/local/lib/libhello.so.3'</TT> should be
dlopened.
<P>
If your program uses this approach, then it should search the
directories listed in the <CODE>LD_LIBRARY_PATH</CODE><A NAME="DOCF8" HREF="libtool_foot.html#FOOT8">(8)</A> environment variable, as well as
the directory where libraries will eventually be installed. Searching
this variable (or equivalent) will guarantee that your program can find
its dlopened modules, even before installation, provided you have linked
them using libtool.
<H2><A NAME="SEC44" HREF="libtool_toc.html#TOC44">Unresolved dlopen issues</A></H2>
<P>
<A NAME="IDX145"></A>
<A NAME="IDX146"></A>
<A NAME="IDX147"></A>
<P>
The following problems are not solved by using libtool's dlopen support:
<UL>
<LI>
Dlopen functions are generally only available on shared library
platforms. If you want your package to be portable to static platforms,
you have to use either libltdl (see section <A HREF="libtool.html#SEC45">Using libltdl</A>) or develop your
own alternatives to dlopening dynamic code.
Most reasonable solutions involve writing wrapper functions for the
<CODE>dlopen</CODE> family, which do package-specific tricks when dlopening
is unsupported or not available on a given platform.
<LI>
There are major differences in implementations of the <CODE>dlopen</CODE>
family of functions. Some platforms do not even use the same function
names (notably HP-UX, with its <CODE>shl_load</CODE> family).
<LI>
The application developer must write a custom search function in order
to discover the correct module filename to supply to <CODE>dlopen</CODE>.
</UL>
<H1><A NAME="SEC45" HREF="libtool_toc.html#TOC45">Using libltdl</A></H1>
<P>
<A NAME="IDX148"></A>
<A NAME="IDX149"></A>
<A NAME="IDX150"></A>
<A NAME="IDX151"></A>
<A NAME="IDX152"></A>
<A NAME="IDX153"></A>
<A NAME="IDX154"></A>
<A NAME="IDX155"></A>
<A NAME="IDX156"></A>
<A NAME="IDX157"></A>
<P>
Libtool provides a small library, called <TT>`libltdl'</TT>, that aims at
hiding the various difficulties of dlopening libraries from programmers.
It consists of a header-file and a small C source file that can be
distributed with applications that need dlopening functionality. On
some platforms, whose dynamic linkers are too limited for a simple
implementation of <TT>`libltdl'</TT> services, it requires GNU DLD, or it
will only emulate dynamic linking with libtool's dlpreopening mechanism.
<P>
libltdl supports currently the following dynamic linking mechanisms:
<UL>
<LI>
<CODE>dlopen</CODE> (Solaris, Linux and various BSD flavors)
<LI>
<CODE>shl_load</CODE> (HP-UX)
<LI>
<CODE>LoadLibrary</CODE> (Win16 and Win32)
<LI>
<CODE>load_add_on</CODE> (BeOS)
<LI>
GNU DLD (emulates dynamic linking for static libraries)
<LI>
libtool's dlpreopen (see see section <A HREF="libtool.html#SEC42">Dlpreopening</A>)
</UL>
<P>
libltdl is licensed under the terms of the GNU Library General Public License,
with the following exception:
<BLOCKQUOTE>
<P>
As a special exception to the GNU Lesser General Public License,
if you distribute this file as part of a program or library that
is built using GNU libtool, you may include it under the same
distribution terms that you use for the rest of that program.
</BLOCKQUOTE>
<H2><A NAME="SEC46" HREF="libtool_toc.html#TOC46">How to use libltdl in your programs</A></H2>
<P>
The libltdl API is similar to the dlopen interface of Solaris and Linux,
which is very simple but powerful.
<P>
To use libltdl in your program you have to include the header file <TT>`ltdl.h'</TT>:
<PRE>
#include <ltdl.h>
</PRE>
<P>
The last release of libltdl used some symbols that violated the
POSIX namespace conventions. These symbols are now deprecated,
and have been replaced by those described here. If you have code that
relies on the old deprecated symbol names, defining
<SAMP>`LT_NON_POSIX_NAMESPACE'</SAMP> before you include <TT>`ltdl.h'</TT> provides
conversion macros. Whichever set of symbols you use, the new api is
not binary compatible with the last, so you will need to recompile
your application in order to use this version of libltdl.
<P>
Note that libltdl is not threadsafe, i.e. a multithreaded application
has to use a mutex for libltdl. It was reported that GNU/Linux's glibc
2.0's <CODE>dlopen</CODE> with <SAMP>`RTLD_LAZY'</SAMP> (which libltdl uses by
default) is not thread-safe, but this problem is supposed to be fixed in
glibc 2.1. On the other hand, <SAMP>`RTLD_NOW'</SAMP> was reported to introduce
problems in multi-threaded applications on FreeBSD. Working around
these problems is left as an exercise for the reader; contributions are
certainly welcome.
<P>
The following types are defined in <TT>`ltdl.h'</TT>:
<P>
<DL>
<DT><U>Type:</U> <B>lt_ptr</B>
<DD><A NAME="IDX158"></A>
<CODE>lt_ptr</CODE> is a generic pointer.
</DL>
<P>
<DL>
<DT><U>Type:</U> <B>lt_dlhandle</B>
<DD><A NAME="IDX159"></A>
<CODE>lt_dlhandle</CODE> is a module "handle".
Every lt_dlopened module has a handle associated with it.
</DL>
<P>
<DL>
<DT><U>Type:</U> <B>lt_dlsymlist</B>
<DD><A NAME="IDX160"></A>
<CODE>lt_dlsymlist</CODE> is a symbol list for dlpreopened modules.
This structure is described in see section <A HREF="libtool.html#SEC42">Dlpreopening</A>.
</DL>
<P>
libltdl provides the following functions:
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlinit</B> <I>(void)</I>
<DD><A NAME="IDX161"></A>
Initialize libltdl.
This function must be called before using libltdl
and may be called several times.
Return 0 on success, otherwise the number of errors.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlexit</B> <I>(void)</I>
<DD><A NAME="IDX162"></A>
Shut down libltdl and close all modules.
This function will only then shut down libltdl when it was called as
many times as <CODE>lt_dlinit</CODE> has been successfully called.
Return 0 on success, otherwise the number of errors.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_dlhandle <B>lt_dlopen</B> <I>(const char *<VAR>filename</VAR>)</I>
<DD><A NAME="IDX163"></A>
Open the module with the file name <VAR>filename</VAR> and return a
handle for it. <CODE>lt_dlopen</CODE> is able to open libtool dynamic
modules, preloaded static modules, the program itself and
native dynamic libraries.
<P>
Unresolved symbols in the module are resolved using its dependency
libraries (not implemented yet) and previously dlopened modules. If the
executable using this module was linked with the <CODE>-export-dynamic</CODE>
flag, then the global symbols in the executable will also be used to
resolve references in the module.
<P>
If <VAR>filename</VAR> is <CODE>NULL</CODE> and the program was linked with
<CODE>-export-dynamic</CODE> or <CODE>-dlopen self</CODE>, <CODE>lt_dlopen</CODE> will
return a handle for the program itself, which can be used to access its
symbols.
<P>
If libltdl cannot find the library and the file name <VAR>filename</VAR> does
not have a directory component it will additionally search in the
following search paths for the module (in the order as follows):
<OL>
<LI>user-defined search path:
This search path can be set by the program using the
functions <CODE>lt_dlsetsearchpath</CODE> and <CODE>lt_dladdsearchdir</CODE>.
<LI>libltdl's search path:
This search path is the value of the environment variable
<VAR>LTDL_LIBRARY_PATH</VAR>.
<LI>system library search path:
The system dependent library search path
(e.g. on Linux it is <VAR>LD_LIBRARY_PATH</VAR>).
</OL>
<P>
Each search path must be a colon-separated list of absolute directories,
for example, <CODE>"/usr/lib/mypkg:/lib/foo"</CODE>.
<P>
If the same module is loaded several times, the same handle is returned.
If <CODE>lt_dlopen</CODE> fails for any reason, it returns <CODE>NULL</CODE>.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_dlhandle <B>lt_dlopenext</B> <I>(const char *<VAR>filename</VAR>)</I>
<DD><A NAME="IDX164"></A>
The same as <CODE>lt_dlopen</CODE>, except that it tries to append
different file name extensions to the file name.
If the file with the file name <VAR>filename</VAR> cannot be found
libltdl tries to append the following extensions:
<OL>
<LI>the libtool archive extension <SAMP>`.la'</SAMP>
<LI>the extension used for native dynamic libraries on the host platform,
e.g., <SAMP>`.so'</SAMP>, <SAMP>`.sl'</SAMP>, etc.
</OL>
<P>
This lookup strategy was designed to allow programs that don't
have knowledge about native dynamic libraries naming conventions
to be able to <CODE>dlopen</CODE> such libraries as well as libtool modules
transparently.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlclose</B> <I>(lt_dlhandle <VAR>handle</VAR>)</I>
<DD><A NAME="IDX165"></A>
Decrement the reference count on the module <VAR>handle</VAR>.
If it drops to zero and no other module depends on this module,
then the module is unloaded.
Return 0 on success.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_ptr <B>lt_dlsym</B> <I>(lt_dlhandle <VAR>handle</VAR>, const char *<VAR>name</VAR>)</I>
<DD><A NAME="IDX166"></A>
Return the address in the module <VAR>handle</VAR>, where the symbol given
by the null-terminated string <VAR>name</VAR> is loaded.
If the symbol cannot be found, <CODE>NULL</CODE> is returned.
</DL>
<P>
<DL>
<DT><U>Function:</U> {const char *}lt_dlerror <B>(void)</B>
<DD><A NAME="IDX167"></A>
Return a human readable string describing the most
recent error that occurred from any of libltdl's functions.
Return <CODE>NULL</CODE> if no errors have occurred since initialization
or since it was last called.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlpreload</B> <I>(const lt_dlsymlist *<VAR>preloaded</VAR>)</I>
<DD><A NAME="IDX168"></A>
Register the list of preloaded modules <VAR>preloaded</VAR>.
If <VAR>preloaded</VAR> is <CODE>NULL</CODE>, then all previously registered
symbol lists, except the list set by <CODE>lt_dlpreload_default</CODE>,
are deleted. Return 0 on success.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlpreload_default</B> <I>(const lt_dlsymlist *<VAR>preloaded</VAR>)</I>
<DD><A NAME="IDX169"></A>
Set the default list of preloaded modules to <VAR>preloaded</VAR>, which
won't be deleted by <CODE>lt_dlpreload</CODE>. Note that this function does
<EM>not</EM> require libltdl to be initialized using <CODE>lt_dlinit</CODE> and
can be used in the program to register the default preloaded modules.
Instead of calling this function directly, most programs will use the
macro <CODE>LTDL_SET_PRELOADED_SYMBOLS</CODE>.
<P>
Return 0 on success.
</DL>
<P>
<DL>
<DT><U>Macro:</U> <B>LTDL_SET_PRELOADED_SYMBOLS()</B>
<DD><A NAME="IDX170"></A>
Set the default list of preloaded symbols.
Should be used in your program to initialize libltdl's
list of preloaded modules.
<PRE>
#include <ltdl.h>
int main() {
/* ... */
LTDL_SET_PRELOADED_SYMBOLS();
/* ... */
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dladdsearchdir</B> <I>(const char *<VAR>search_dir</VAR>)</I>
<DD><A NAME="IDX171"></A>
Add the search directory <VAR>search_dir</VAR> to the user-defined library
search path. Return 0 on success.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlsetsearchpath</B> <I>(const char *<VAR>search_path</VAR>)</I>
<DD><A NAME="IDX172"></A>
Replace the current user-defined library search path with
<VAR>search_path</VAR>, which must be a colon-separated list of absolute
directories. Return 0 on success.
</DL>
<P>
<DL>
<DT><U>Function:</U> {const char *}lt_dlgetsearchpath <B>(void)</B>
<DD><A NAME="IDX173"></A>
Return the current user-defined library search path.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlmakeresident</B> <I>(lt_dlhandle <VAR>handle</VAR>)</I>
<DD><A NAME="IDX174"></A>
Mark a module so that it cannot be <SAMP>`lt_dlclose'</SAMP>d. This can be
useful if a module implements some core functionality in your project,
which would cause your code to crash if removed. Return 0 on success.
<P>
If you use <SAMP>`lt_dlopen (NULL)'</SAMP> to get a <VAR>handle</VAR> for the running
binary, that handle will always be marked as resident, and consequently
cannot be successfully <SAMP>`lt_dlclose'</SAMP>d.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlisresident</B> <I>(lt_dlhandle <VAR>handle</VAR>)</I>
<DD><A NAME="IDX175"></A>
Check whether a particular module has been marked as resident, returning 1
if it has or 0 otherwise. If there is an error while executing this
function, return -1 and set an error message for retrieval with
<CODE>lt_dlerror</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> lt_ptr (*) (size_t <VAR>size</VAR>) <B>lt_dlmalloc</B>
<DD><A NAME="IDX176"></A>
<DT><U>Variable:</U> void (*) (lt_ptr <VAR>ptr</VAR>) <B>lt_dlfree</B>
<DD><A NAME="IDX177"></A>
These variables are set to <CODE>malloc</CODE> and <CODE>free</CODE>, by default,
but you can set them to any other functions that provides equivalent
functionality. However, you must not modify their values after calling
any libltdl function other than <CODE>lt_dlpreopen_default</CODE> or the macro
<CODE>LTDL_SET_PRELOADED_SYMBOLS</CODE>.
</DL>
<H2><A NAME="SEC47" HREF="libtool_toc.html#TOC47">Creating modules that can be <CODE>dlopen</CODE>ed</A></H2>
<P>
Libtool modules are like normal libtool libraries with a few exceptions:
<P>
You have to link the module with libtool's <SAMP>`-module'</SAMP> switch,
and you should link any program that is intended to dlopen the module with
<SAMP>`-dlopen modulename.la'</SAMP> so that libtool can dlpreopen the module
on platforms which don't support dlopening. If the module depends on any
other libraries, make sure you specify them either when you link the module
or when you link programs that dlopen it.
If you want to disable see section <A HREF="libtool.html#SEC32">Library interface versions</A> for a specific module
you should link it with the <SAMP>`-avoid-version'</SAMP> switch.
Note that libtool modules don't need to have a "lib" prefix.
However, automake 1.4 or higher is required to build such modules.
<P>
Usually a set of modules provide the same interface, i.e, exports the same
symbols, so that a program can dlopen them without having to know more
about their internals.
In order to avoid symbol conflicts all exported symbols must be prefixed
with "modulename_LTX_" (<SAMP>`modulename'</SAMP> is the name of the module).
Internal symbols must be named in such a way that they won't conflict
with other modules, for example, by prefixing them with "_modulename_".
Although some platforms support having the same symbols defined more than
once it is generally not portable and it makes it impossible to dlpreopen
such modules. libltdl will automatically cut the prefix off to get
the real name of the symbol. Additionally, it supports modules which
don't use a prefix so that you can also dlopen non-libtool modules.
<P>
<TT>`foo1.c'</TT> gives an example of a portable libtool module.
Exported symbols are prefixed with "foo1_LTX_", internal symbols
with "_foo1_". Aliases are defined at the beginning so that the code
is more readable.
<PRE>
/* aliases for the exported symbols */
#define foo foo1_LTX_foo
#define bar foo1_LTX_bar
/* a global variable definition */
int bar = 1;
/* a private function */
int _foo1_helper() {
return bar;
}
/* an exported function */
int foo() {
return _foo1_helper();
}
</PRE>
<P>
The <TT>`Makefile.am'</TT> contains the necessary rules to build the
module <TT>`foo1.la'</TT>:
<PRE>
...
lib_LTLIBRARIES = foo1.la
foo1_la_SOURCES = foo1.c
foo1_la_LDFLAGS = -module
...
</PRE>
<H2><A NAME="SEC48" HREF="libtool_toc.html#TOC48">Using libtldl in a multi threaded environment</A></H2>
<P>
Using the <CODE>lt_dlmutex_register()</CODE> function, and by providing some
appropriate callback function definitions, libltdl can be used in a
multi-threaded environment.
<P>
<DL>
<DT><U>Type:</U> void <B>lt_dlmutex_lock</B> <I>(void)</I>
<DD><A NAME="IDX178"></A>
This is the type of a function pointer holding the address of a function
which will be called at the start of parts of the libltdl implementation
code which require a mutex lock.
<P>
Because libltdl is inherantly recursive, it is important that the
locking mechanism employed by these callback functions are reentrant, or
else strange problems will occur.
</DL>
<P>
<DL>
<DT><U>Type:</U> void <B>lt_dlmutex_unlock</B> <I>(void)</I>
<DD><A NAME="IDX179"></A>
The type of a matching unlock function.
</DL>
<P>
<DL>
<DT><U>Type:</U> void <B>lt_dlmutex_seterror</B> <I>(const char *<VAR>error</VAR>);</I>
<DD><A NAME="IDX180"></A>
Many of the functions in the libltdl API have a special return
value to indicate to the client that an error has occured. Normally (in
single threaded applications) a string describing that error can be
retrieved from internal storage with <CODE>lt_dlerror()</CODE>.
<P>
A function of this type must be registered with the library in order for
it to work in a multi-threaded context. The function should store any
error message passed in thread local storage.
</DL>
<P>
<DL>
<DT><U>Type:</U> const char * <B>lt_dlmutex_geterror</B> <I>(void)</I>
<DD><A NAME="IDX181"></A>
The type of a matching callback function to retrieve the last stored
error message from thread local storage.
<P>
When regeistered correctly this function will be used by
<CODE>lt_dlerror())</CODE> from all threads to retrieve error messages for the
client.
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlmutex_register</B> <I>(lt_dlmutex_lock *<VAR>lock</VAR>, lt_dlmutex_unlock *<VAR>unlock</VAR>, lt_dlmutex_set_error *<VAR>seterror</VAR>, lt_dlmutex_geterror *<VAR>geterror</VAR>)</I>
<DD><A NAME="IDX182"></A>
Use this function to register one of each of function ttypes described
above in preparation for multi-threaded use of libltdl. All arguments
must be valid non-<CODE>NULL</CODE> function addresses, or else all
<CODE>NULL</CODE> to return to single threaded operation.
</DL>
<H2><A NAME="SEC49" HREF="libtool_toc.html#TOC49">Data associated with loaded modules</A></H2>
<P>
Some of the internal information about each loaded module that is
maintained by libltdl is available to the user, in the form of this
structure:
<P>
<DL>
<DT><U>Type:</U> struct <B>lt_dlinfo</B> <I>{ char *<VAR>filename</VAR>; char *<VAR>name</VAR>; int <VAR>ref_count</VAR>; }</I>
<DD><A NAME="IDX183"></A>
<CODE>lt_dlinfo</CODE> is used to store information about a module.
The <VAR>filename</VAR> attribute is a null-terminated character string of
the real module file name. If the module is a libtool module then
<VAR>name</VAR> is its module name (e.g. <CODE>"libfoo"</CODE> for
<CODE>"dir/libfoo.la"</CODE>), otherwise it is set to <CODE>NULL</CODE>. The
<VAR>ref_count</VAR> attribute is a reference counter that describes how
often the same module is currently loaded.
</DL>
<P>
The following function will return a pointer to libltdl's internal copy
of this structure for the given <VAR>handle</VAR>:
<P>
<DL>
<DT><U>Function:</U> const lt_dlinfo * <B>lt_dlgetinfo</B> <I>(lt_dlhandle <VAR>handle</VAR>)</I>
<DD><A NAME="IDX184"></A>
Return a pointer to a struct that contains some information about
the module <VAR>handle</VAR>. The contents of the struct must not be modified.
Return <CODE>NULL</CODE> on failure.
</DL>
<P>
Furthermore, in order to save you from having to keep a list of the
handles of all the modules you have loaded, these functions allow you to
iterate over libltdl's list of loaded modules:
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlforeach</B> <I>(int (*<VAR>func</VAR>) (lt_dlhandle <VAR>handle</VAR>, lt_ptr <VAR>data</VAR>), lt_ptr <VAR>data</VAR>)</I>
<DD><A NAME="IDX185"></A>
For each loaded module call the function <VAR>func</VAR>. The argument
<VAR>handle</VAR> is the handle of one of the loaded modules, <VAR>data</VAR> is
the <VAR>data</VAR> argument passed to <CODE>lt_dlforeach</CODE>.
As soon as <VAR>func</VAR> returns a non-zero value for one of the handles,
<CODE>lt_dlforeach</CODE> will stop calling <VAR>func</VAR> and immediately return 1.
Otherwise 0 is returned.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_dlhandle <B>lt_dlhandle_next</B> <I>(lt_dlhandle place)</I>
<DD><A NAME="IDX186"></A>
Iterate over the loaded module handles, returning the first handle in the
list if <VAR>place</VAR> is <CODE>NULL</CODE>, and the next one on subsequent calls.
If <VAR>place</VAR> is the last element in the list of loaded modules, this
function returns <CODE>NULL</CODE>.
</DL>
<P>
Of course, you would still need to maintain your own list of loaded
module handles to parallel the list maintained by libltdl if there are
any other data that you need to associate with each handle for the
purposes of your application. However, if you use the following
API calls to associate your application data with individual module
handles as they are loaded there is actually no need to do that. You
must first obtain a unique caller id from libltdl which you subsequently
use to retrieve the data you stored earlier. This allows for different
libraries that each wish to store their own data against loaded modules
to do so without interfering with one another's data.
<P>
<DL>
<DT><U>Type:</U> <B>lt_dlcaller_id</B>
<DD><A NAME="IDX187"></A>
The opaque type used to hold individual data set keys.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_dlcaller_id <B>lt_dlcaller_register</B> <I>(void)</I>
<DD><A NAME="IDX188"></A>
Use this to obtain a unique key to store and retrieve individual sets of
per module data.
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_ptr <B>lt_dlcaller_set_data</B> <I>(lt_dlcaller_id <VAR>key</VAR>, lt_dlhandle <VAR>handle</VAR>, lt_ptr <VAR>data</VAR>)</I>
<DD><A NAME="IDX189"></A>
Set <VAR>data</VAR> as the set of data uniquely associated with <VAR>key</VAR> and
<VAR>handle</VAR> for later retrieval. This function returns the <VAR>data</VAR>
previously associated with <VAR>key</VAR> and <VAR>handle</VAR> if any. A result of
0, may indicate that a diagnostic for the last error (if any) is available
from <CODE>lt_dlerror()</CODE>.
<P>
For example, to correctly remove some associated data:
<PRE>
lt_ptr stale = lt_dlcaller_set_data (key, handle, 0);
if (stale == NULL)
{
char *error_msg = lt_dlerror ();
if (error_msg != NULL)
{
my_error_handler (error_msg);
return STATUS_FAILED;
}
}
else
{
free (stale);
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> lt_ptr <B>lt_dlcaller_get_data</B> <I>(lt_dlcaller_id <VAR>key</VAR>, lt_dlhandle <VAR>handle</VAR>)</I>
<DD><A NAME="IDX190"></A>
Return the address of the data associated with <VAR>key</VAR> and
<VAR>handle</VAR>, or else <CODE>NULL</CODE> if there is none.
</DL>
<P>
The preceding functions can be combined with <CODE>lt_dlforeach</CODE> to
implement search and apply operations without the need for your
application to track the modules that have been loaded and unloaded:
<PRE>
int
my_dlcaller_callback (lt_dlhandle handle, lt_ptr key_ptr)
{
struct my_module_data *my_data;
my_data = lt_dlcaller_get_data (handle, (lt_dlcaller_id) *key_ptr);
return process (my_data);
}
int
my_dlcaller_foreach (lt_dlcaller_id key)
{
lt_dlforeach (my_dlcaller_callback, (lt_ptr) &key);
}
</PRE>
<H2><A NAME="SEC50" HREF="libtool_toc.html#TOC50">How to create and register new module loaders</A></H2>
<P>
Sometimes libltdl's many ways of gaining access to modules are not
sufficient for the purposes of a project. You can write your own
loader, and register it with libltdl so that <CODE>lt_dlopen</CODE> will be
able to use it.
<P>
Writing a loader involves writing at least three functions which can be
called by <CODE>lt_dlopen</CODE>, <CODE>lt_dlsym</CODE> and <CODE>lt_dlclose</CODE>.
Optionally, you can provide a finalisation function to perform any
cleanup operations when <CODE>lt_dlexit</CODE> executes, and a symbol prefix
string which will be prepended to any symbols passed to <CODE>lt_dlsym</CODE>.
These functions must match the function pointer types below, after
which they can be allocated to an instance of <CODE>lt_user_dlloader</CODE>
and registered.
<P>
Registering the loader requires that you choose a name for it, so that it
can be recognised by <CODE>lt_dlloader_find</CODE> and removed with
<CODE>lt_dlloader_remove</CODE>. The name you choose must be unique, and not
already in use by libltdl's builtin loaders:
<DL COMPACT>
<DT>"dlopen"
<DD>
The system dynamic library loader, if one exists.
<DT>"dld"
<DD>
The GNU dld loader, if <TT>`libdld'</TT> was installed when libltdl was
built.
<DT>"dlpreload"
<DD>
The loader for <CODE>lt_dlopen</CODE>ing of preloaded static modules.
</DL>
<P>
The prefix "dl" is reserved for loaders supplied with future versions of
libltdl, so you should not use that for your own loader names.
<P>
The following types are defined in <TT>`ltdl.h'</TT>:
<P>
<DL>
<DT><U>Type:</U> <B>lt_module</B>
<DD><A NAME="IDX191"></A>
<CODE>lt_module</CODE> is a dlloader dependent module.
The dynamic module loader extensions communicate using these low
level types.
</DL>
<P>
<DL>
<DT><U>Type:</U> <B>lt_dlloader</B>
<DD><A NAME="IDX192"></A>
<CODE>lt_dlloader</CODE> is a handle for module loader types.
</DL>
<P>
<DL>
<DT><U>Type:</U> <B>lt_dlloader_data</B>
<DD><A NAME="IDX193"></A>
<CODE>lt_dlloader_data</CODE> is used for specifying loader instance data.
</DL>
<P>
<DL>
<DT><U>Type:</U> struct <B>lt_user_dlloader</B> <I>{const char *<VAR>sym_prefix</VAR>; lt_module_open *<VAR>module_open</VAR>;lt_module_close *<VAR>module_close</VAR>; lt_find_sym *<VAR>find_sym</VAR>; lt_dlloader_exit *<VAR>dlloader_exit</VAR>; lt_dlloader_data <VAR>dlloader_data</VAR>; }</I>
<DD><A NAME="IDX194"></A>
If you want to define a new way to open dynamic modules, and have the
<CODE>lt_dlopen</CODE> API use it, you need to instantiate one of these
structures and pass it to <CODE>lt_dlloader_add</CODE>. You can pass whatever
you like in the <VAR>dlloader_data</VAR> field, and it will be passed back as
the value of the first parameter to each of the functions specified in
the function pointer fields.
</DL>
<P>
<DL>
<DT><U>Type:</U> lt_module <B>lt_module_open</B> <I>(lt_user_data <VAR>loader_data</VAR>, const char *<VAR>filename</VAR>)</I>
<DD><A NAME="IDX195"></A>
The type of the loader function for an <CODE>lt_dlloader</CODE> module
loader. The value set in the dlloader_data field of the <CODE>struct
lt_user_dlloader</CODE> structure will be passed into this function in the
<VAR>loader_data</VAR> parameter. Implementation of such a function should
attempt to load the named module, and return an <CODE>lt_module</CODE>
suitable for passing in to the associated <CODE>lt_module_close</CODE> and
<CODE>lt_sym_find</CODE> function pointers. If the function fails it should
return <CODE>NULL</CODE>, and set the error message with <CODE>lt_dlseterror</CODE>.
</DL>
<P>
<DL>
<DT><U>Type:</U> int <B>lt_module_close</B> <I>(lt_dlloader_data <VAR>loader_data</VAR>, lt_module <VAR>module</VAR>)</I>
<DD><A NAME="IDX196"></A>
The type of the unloader function for a user defined module loader.
Implementatation of such a function should attempt to release
any resources tied up by the <VAR>module</VAR> module, and then unload it
from memory. If the function fails for some reason, set the error
message with <CODE>lt_dlseterror</CODE> and return non-zero.
</DL>
<P>
<DL>
<DT><U>Type:</U> lt_ptr <B>lt_find_sym</B> <I>(lt_user_data <VAR>loader_data</VAR>, lt_module <VAR>module</VAR>, const char *<VAR>symbol</VAR>)</I>
<DD><A NAME="IDX197"></A>
The type of the symbol lookup function for a user defined module loader.
Implementation of such a function should return the address of the named
<VAR>symbol</VAR> in the module <VAR>module</VAR>, or else set the error message
with <CODE>lt_dlseterror</CODE> and return <CODE>NULL</CODE> if lookup fails.
</DL>
<P>
<DL>
<DT><U>Type:</U> int <B>lt_dlloader_exit</B> <I>(lt_user_data <VAR>loader_data</VAR>)</I>
<DD><A NAME="IDX198"></A>
The type of the finalisation function for a user defined module loader.
Implementation of such a function should free any resources associated
with the loader, including any user specified data in the
<CODE>dlloader_data</CODE> field of the <CODE>lt_user_dlloader</CODE>. If non-<CODE>NULL</CODE>,
the function will be called by <CODE>lt_dlexit</CODE>, and
<CODE>lt_dlloader_remove</CODE>.
</DL>
<P>
For example:
<PRE>
int
register_myloader (void)
{
lt_user_dlloader dlloader;
/* User modules are responsible for their own initialisation. */
if (myloader_init () != 0)
return MYLOADER_INIT_ERROR;
dlloader.sym_prefix = NULL;
dlloader.module_open = myloader_open;
dlloader.module_close = myloader_close;
dlloader.find_sym = myloader_find_sym.
dlloader.dlloader_exit = myloader_exit;
dlloader.dlloader_data = (lt_user_data)myloader_function;
/* Add my loader as the default module loader. */
if (lt_dlloader_add (lt_dlloader_next (NULL), &dlloader, "myloader") != 0)
return ERROR;
return OK;
}
</PRE>
<P>
Note that if there is any initialisation required for the loader,
it must be performed manually before the loader is registered --
libltdl doesn't handle user loader initialisation.
<P>
Finalisation <EM>is</EM> handled by libltdl however, and it is important
to ensure the <CODE>dlloader_exit</CODE> callback releases any resources claimed
during the initialisation phase.
<P>
libltdl provides the following functions for writing your own module
loaders:
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlloader_add</B> <I>(lt_dlloader *<VAR>place</VAR>, lt_user_dlloader *<VAR>dlloader</VAR>, const char *<VAR>loader_name</VAR>)</I>
<DD><A NAME="IDX199"></A>
Add a new module loader to the list of all loaders, either as the
last loader (if <VAR>place</VAR> is <CODE>NULL</CODE>), else immediately before the
loader passed as <VAR>place</VAR>. <VAR>loader_name</VAR> will be returned by
<CODE>lt_dlloader_name</CODE> if it is subsequently passed a newly
registered loader. These <VAR>loader_name</VAR>s must be unique, or
<CODE>lt_dlloader_remove</CODE> and <CODE>lt_dlloader_find</CODE> cannot
work. Returns 0 for success.
<PRE>
{
/* Make myloader be the last one. */
if (lt_dlloader_add (NULL, myloader) != 0)
perror (lt_dlerror ());
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlloader_remove</B> <I>(const char *<VAR>loader_name</VAR>)</I>
<DD><A NAME="IDX200"></A>
Remove the loader identified by the unique name, <VAR>loader_name</VAR>.
Before this can succeed, all modules opened by the named loader must
have been closed. Returns 0 for success, otherwise an error message can
be obtained from <CODE>lt_dlerror</CODE>.
<PRE>
{
/* Remove myloader. */
if (lt_dlloader_remove ("myloader") != 0)
perror (lt_dlerror ());
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> {lt_dlloader *}lt_dlloader_next <B>(lt_dlloader *<VAR>place</VAR>)</B>
<DD><A NAME="IDX201"></A>
Iterate over the module loaders, returning the first loader if <VAR>place</VAR> is
<CODE>NULL</CODE>, and the next one on subsequent calls. The handle is for use with
<CODE>lt_dlloader_add</CODE>.
<PRE>
{
/* Make myloader be the first one. */
if (lt_dlloader_add (lt_dlloader_next (NULL), myloader) != 0)
return ERROR;
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> {lt_dlloader *}lt_dlloader_find <B>(const char *<VAR>loader_name</VAR>)</B>
<DD><A NAME="IDX202"></A>
Return the first loader with a matching <VAR>loader_name</VAR> identifier, or else
<CODE>NULL</CODE>, if the identifier is not found.
<P>
The identifiers which may be used by libltdl itself, if the host
architecture supports them are <EM>dlopen</EM><A NAME="DOCF9" HREF="libtool_foot.html#FOOT9">(9)</A>, <EM>dld</EM> and <EM>dlpreload</EM>.
<PRE>
{
/* Add a user loader as the next module loader to be tried if
the standard dlopen loader were to fail when lt_dlopening. */
if (lt_dlloader_add (lt_dlloader_find ("dlopen"), myloader) != 0)
return ERROR;
}
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> {const char *}lt_dlloader_name <B>(lt_dlloader *<VAR>place</VAR>)</B>
<DD><A NAME="IDX203"></A>
Return the identifying name of <VAR>PLACE</VAR>, as obtained from
<CODE>lt_dlloader_next</CODE> or <CODE>lt_dlloader_find</CODE>. If this function fails,
it will return <CODE>NULL</CODE> and set an error for retrieval with
<CODE>lt_dlerror</CODE>.
</DL>
<P>
<DL>
<DT><U>Function:</U> {lt_user_data *}lt_dlloader_data <B>(lt_dlloader *<VAR>place</VAR>)</B>
<DD><A NAME="IDX204"></A>
Return the address of the <CODE>dlloader_data</CODE> of <VAR>PLACE</VAR>, as
obtained from <CODE>lt_dlloader_next</CODE> or <CODE>lt_dlloader_find</CODE>. If
this function fails, it will return <CODE>NULL</CODE> and set an error for
retrieval with <CODE>lt_dlerror</CODE>.
</DL>
<H3><A NAME="SEC51" HREF="libtool_toc.html#TOC51">Error handling within user module loaders</A></H3>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dladderror</B> <I>(const char *<VAR>diagnostic</VAR>)</I>
<DD><A NAME="IDX205"></A>
This function allows you to integrate your own error messages into
<CODE>lt_dlerror</CODE>. Pass in a suitable diagnostic message for return by
<CODE>lt_dlerror</CODE>, and an error identifier for use with
<CODE>lt_dlseterror</CODE> is returned.
<P>
If the allocation of an identifier fails, this function returns -1.
<PRE>
int myerror = lt_dladderror ("Doh!");
if (myerror < 0)
perror (lt_dlerror ());
</PRE>
</DL>
<P>
<DL>
<DT><U>Function:</U> int <B>lt_dlseterror</B> <I>(int <VAR>errorcode</VAR>)</I>
<DD><A NAME="IDX206"></A>
When writing your own module loaders, you should use this function to
raise errors so that they are propogated through the <CODE>lt_dlerror</CODE>
interface. All of the standard errors used by libltdl are declared in
<TT>`ltdl.h'</TT>, or you can add more of your own with
<CODE>lt_dladderror</CODE>. This function returns 0 on success.
<PRE>
if (lt_dlseterror (LTDL_ERROR_NO_MEMORY) != 0)
perror (lt_dlerror ());
</PRE>
</DL>
<H2><A NAME="SEC52" HREF="libtool_toc.html#TOC52">How to distribute libltdl with your package</A></H2>
<P>
Even though libltdl is installed together with libtool, you may wish to
include libltdl in the distribution of your package, for the convenience
of users of your package that don't have libtool or libltdl installed.
In this case, you must decide whether to manually add the <CODE>ltdl</CODE>
objects to your package, or else which flavor of libltdl you want to use:
a convenience library or an installable libtool library.
<P>
The most simplistic way to add <CODE>libltdl</CODE> to your package is to copy
the source files, <TT>`ltdl.c'</TT> and <TT>`ltdl.h'</TT>, to a source directory
withing your package and to build and link them along with the rest of
your sources. To help you do this, the m4 macros for autoconf are
available in <TT>`ltdl.m4'</TT>. You must ensure that they are available in
<TT>`aclocal.m4'</TT> before you run autoconf -- by appending the contents
of <TT>`ltdl.m4'</TT> to <TT>`acinclude.m4'</TT>, if you are using automake, or
to <TT>`aclocal.m4'</TT> if you are not. Having made the macros available,
you must add a call to the <SAMP>`AC_LIB_LTDL'</SAMP> macro to your package's
<TT>`configure.in'</TT> to perform the configure time checks required to
build <TT>`ltdl.o'</TT> correctly. This method has problems if you then try
to link the package binaries with an installed libltdl, or a library
which depends on libltdl: you may have problems with duplicate symbol
definitions.
<P>
One advantage of the convenience library is that it is not installed, so
the fact that you use libltdl will not be apparent to the user, and it
will not overwrite a pre-installed version of libltdl a user might have.
On the other hand, if you want to upgrade libltdl for any reason
(e.g. a bugfix) you'll have to recompile your package instead of just
replacing an installed version of libltdl.
However, if your programs or libraries are linked with other libraries
that use such a pre-installed version of libltdl, you may get linker
errors or run-time crashes. Another problem is that you cannot link the
convenience library into more than one libtool library, then link a
single program with these libraries, because you may get duplicate
symbols. In general you can safely use the convenience library in programs
which don't depend on other libraries that might use libltdl too.
In order to enable this flavor of libltdl, you should add the
line <SAMP>`AC_LIBLTDL_CONVENIENCE'</SAMP> to your <TT>`configure.in'</TT>,
<EM>before</EM> <SAMP>`AC_PROG_LIBTOOL'</SAMP>.
<P>
In order to select the installable version of libltdl, you should add a
call of the macro <SAMP>`AC_LIBLTDL_INSTALLABLE'</SAMP> to your
<TT>`configure.in'</TT> <EM>before</EM> <SAMP>`AC_PROG_LIBTOOL'</SAMP>. This macro
will check whether libltdl is already installed and, if not, request the
libltdl embedded in your package to be built and installed. Note,
however, that no version checking is performed. The user may override
the test and determine that the libltdl embedded must be installed,
regardless of the existence of another version, using the configure
switch <SAMP>`--enable-ltdl-install'</SAMP>.
<P>
In order to embed libltdl into your package, just add <SAMP>`--ltdl'</SAMP> to
the <CODE>libtoolize</CODE> command line. It will copy the libltdl sources
to a subdirectory <SAMP>`libltdl'</SAMP> in your package.
Both macros accept an optional argument to specify the location
of the <SAMP>`libltdl'</SAMP> directory. By the default both macros assume that it
is <SAMP>`${top_srcdir}/libltdl'</SAMP>.
<P>
Whatever macro you use, it is up to you to ensure that your
<TT>`configure.in'</TT> will configure libltdl, using
<SAMP>`AC_CONFIG_SUBDIRS'</SAMP>, and that your <TT>`Makefile'</TT>s will start
sub-makes within libltdl's directory, using automake's <VAR>SUBDIRS</VAR>,
for example. Both macros define the shell variables <VAR>LIBLTDL</VAR>, to
the link flag that you should use to link with libltdl, and
<VAR>INCLTDL</VAR>, to the preprocessor flag that you should use to compile
with programs that include <TT>`ltdl.h'</TT>. It is up to you to use
<SAMP>`AC_SUBST'</SAMP> to ensure that this variable will be available in
<TT>`Makefile'</TT>s, or add them to variables that are <SAMP>`AC_SUBST'</SAMP>ed by
default, such as <VAR>LIBS</VAR> and <VAR>CPPFLAGS</VAR>.
<P>
If you're using the convenience libltdl, <VAR>LIBLTDL</VAR> will be the
pathname for the convenience version of libltdl and <VAR>INCLTDL</VAR> will be
<SAMP>`-I'</SAMP> followed by the directory that contains libltdl, both starting
with <SAMP>`${top_builddir}/'</SAMP> or <SAMP>`${top_srcdir}/'</SAMP>, respectively.
<P>
If you request an installed version of libltdl and one is
found<A NAME="DOCF10" HREF="libtool_foot.html#FOOT10">(10)</A>, <VAR>LIBLTDL</VAR> will
be set to <SAMP>`-lltdl'</SAMP> and <VAR>INCLTDL</VAR> will be empty (which is just a
blind assumption that <TT>`ltdl.h'</TT> is somewhere in the include path if
libltdl is in the library path). If an installable version of libltdl
must be built, its pathname, starting with <SAMP>`${top_builddir}/'</SAMP>,
will be stored in <VAR>LIBLTDL</VAR>, and <VAR>INCLTDL</VAR> will be set just like
in the case of convenience library.
<P>
So, when you want to link a program with libltdl, be it a convenience,
installed or installable library, just compile with <SAMP>`$(INCLTDL)'</SAMP>
and link it with <SAMP>`$(LIBLTDL)'</SAMP>, using libtool.
<P>
You should probably also add <SAMP>`AC_LIBTOOL_DLOPEN'</SAMP> to your
<TT>`configure.in'</TT> <EM>before</EM> <SAMP>`AC_PROG_LIBTOOL'</SAMP>, otherwise
libtool will assume no dlopening mechanism is supported, and revert to
dlpreopening, which is probably not what you want.
<P>
Avoid using the <CODE>-static</CODE> or <CODE>-all-static</CODE> switches when
linking programs with libltdl. This will not work on all platforms,
because the dlopening functions may not be available for static linking.
<P>
The following example shows you how to embed the convenience libltdl in
your package. In order to use the installable variant just replace
<SAMP>`AC_LIBLTDL_CONVENIENCE'</SAMP> with <SAMP>`AC_LIBLTDL_INSTALLABLE'</SAMP>. We
assume that libltdl was embedded using <SAMP>`libtoolize --ltdl'</SAMP>.
<P>
configure.in:
<PRE>
...
dnl Enable building of the convenience library
dnl and set LIBLTDL accordingly
AC_LIBLTDL_CONVENIENCE
dnl Substitute INCLTDL and LIBLTDL in the Makefiles
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
dnl Check for dlopen support
AC_LIBTOOL_DLOPEN
dnl Configure libtool
AC_PROG_LIBTOOL
dnl Configure libltdl
AC_CONFIG_SUBDIRS(libltdl)
...
</PRE>
<P>
Makefile.am:
<PRE>
...
SUBDIRS = libltdl
INCLUDES = $(INCLTDL)
myprog_LDFLAGS = -export-dynamic
# The quotes around -dlopen below fool automake <= 1.4 into accepting it
myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la
myprog_DEPENDENCIES = $(LIBLTDL) foo1.la
...
</PRE>
<H1><A NAME="SEC53" HREF="libtool_toc.html#TOC53">Using libtool with other languages</A></H1>
<P>
<A NAME="IDX207"></A>
<A NAME="IDX208"></A>
<A NAME="IDX209"></A>
<P>
Libtool was first implemented in order to add support for writing shared
libraries in the C language. However, over time, libtool is being
integrated with other languages, so that programmers are free to reap
the benefits of shared libraries in their favorite programming language.
<P>
This chapter describes how libtool interacts with other languages,
and what special considerations you need to make if you do not use C.
<H2><A NAME="SEC54" HREF="libtool_toc.html#TOC54">Writing libraries for C++</A></H2>
<P>
<A NAME="IDX210"></A>
<A NAME="IDX211"></A>
<A NAME="IDX212"></A>
<P>
Creating libraries of C++ code should be a fairly straightforward
process, because its object files differ from C ones in only three ways:
<OL>
<LI>
Because of name mangling, C++ libraries are only usable by the C++
compiler that created them. This decision was made by the designers of
C++ in order to protect users from conflicting implementations of
features such as constructors, exception handling, and RTTI.
<LI>
On some systems, the C++ compiler must take special actions for the
dynamic linker to run dynamic (i.e., run-time) initializers. This means
that we should not call <TT>`ld'</TT> directly to link such libraries, and
we should use the C++ compiler instead.
<LI>
C++ compilers will link some Standard C++ library in by default, but
libtool does not know which are these libraries, so it cannot even run
the inter-library dependence analyzer to check how to link it in.
Therefore, running <TT>`ld'</TT> to link a C++ program or library is deemed
to fail. However, running the C++ compiler directly may lead to
problems related with inter-library dependencies.
</OL>
<P>
The conclusion is that libtool is not ready for general use for C++
libraries. You should avoid any global or static variable
initializations that would cause an "initializer element is not
constant" error if you compiled them with a standard C compiler.
<P>
There are other ways of working around this problem, but they are beyond
the scope of this manual.
<P>
Furthermore, you'd better find out, at configure time, what are the C++
Standard libraries that the C++ compiler will link in by default, and
explicitly list them in the link command line. Hopefully, in the
future, libtool will be able to do this job by itself.
<H1><A NAME="SEC55" HREF="libtool_toc.html#TOC55">Troubleshooting</A></H1>
<P>
<A NAME="IDX213"></A>
<A NAME="IDX214"></A>
<A NAME="IDX215"></A>
<A NAME="IDX216"></A>
<P>
Libtool is under constant development, changing to remain up-to-date
with modern operating systems. If libtool doesn't work the way you
think it should on your platform, you should read this chapter to help
determine what the problem is, and how to resolve it.
<H2><A NAME="SEC56" HREF="libtool_toc.html#TOC56">The libtool test suite</A></H2>
<P>
<A NAME="IDX217"></A>
<P>
Libtool comes with its own set of programs that test its capabilities,
and report obvious bugs in the libtool program. These tests, too, are
constantly evolving, based on past problems with libtool, and known
deficiencies in other operating systems.
<P>
As described in the <TT>`INSTALL'</TT> file, you may run <KBD>make check</KBD>
after you have built libtool (possibly before you install it) in order
to make sure that it meets basic functional requirements.
<H3><A NAME="SEC57" HREF="libtool_toc.html#TOC57">Description of test suite</A></H3>
<P>
Here is a list of the current programs in the test suite, and what they
test for:
<DL COMPACT>
<DT><TT>`cdemo-conf.test'</TT>
<DD>
<DT><TT>`cdemo-exec.test'</TT>
<DD>
<DT><TT>`cdemo-make.test'</TT>
<DD>
<DT><TT>`cdemo-static.test'</TT>
<DD>
<DT><TT>`cdemo-shared.test'</TT>
<DD>
<A NAME="IDX218"></A>
<A NAME="IDX219"></A>
<A NAME="IDX220"></A>
<A NAME="IDX221"></A>
<A NAME="IDX222"></A>
These programs check to see that the <TT>`cdemo'</TT> subdirectory of the
libtool distribution can be configured and built correctly.
The <TT>`cdemo'</TT> subdirectory contains a demonstration of libtool
convenience libraries, a mechanism that allows build-time static
libraries to be created, in a way that their components can be later
linked into programs or other libraries, even shared ones.
The tests <TT>`cdemo-make.test'</TT> and <TT>`cdemo-exec.test'</TT> are executed
three times, under three different libtool configurations:
<TT>`cdemo-conf.test'</TT> configures <TT>`cdemo/libtool'</TT> to build both
static and shared libraries (the default for platforms that support
both), <TT>`cdemo-static.test'</TT> builds only static libraries
(<SAMP>`--disable-shared'</SAMP>), and <TT>`cdemo-shared.test'</TT> builds only
shared libraries (<SAMP>`--disable-static'</SAMP>).
<DT><TT>`demo-conf.test'</TT>
<DD>
<DT><TT>`demo-exec.test'</TT>
<DD>
<DT><TT>`demo-inst.test'</TT>
<DD>
<DT><TT>`demo-make.test'</TT>
<DD>
<DT><TT>`demo-unst.test'</TT>
<DD>
<DT><TT>`demo-static.test'</TT>
<DD>
<DT><TT>`demo-shared.test'</TT>
<DD>
<DT><TT>`demo-nofast.test'</TT>
<DD>
<DT><TT>`demo-pic.test'</TT>
<DD>
<DT><TT>`demo-nopic.test'</TT>
<DD>
<A NAME="IDX223"></A>
<A NAME="IDX224"></A>
<A NAME="IDX225"></A>
<A NAME="IDX226"></A>
<A NAME="IDX227"></A>
<A NAME="IDX228"></A>
<A NAME="IDX229"></A>
<A NAME="IDX230"></A>
<A NAME="IDX231"></A>
<A NAME="IDX232"></A>
These programs check to see that the <TT>`demo'</TT> subdirectory of the
libtool distribution can be configured, built, installed, and
uninstalled correctly.
The <TT>`demo'</TT> subdirectory contains a demonstration of a trivial
package that uses libtool. The tests <TT>`demo-make.test'</TT>,
<TT>`demo-exec.test'</TT>, <TT>`demo-inst.test'</TT> and
<TT>`demo-unst.test'</TT> are executed four times, under four different
libtool configurations: <TT>`demo-conf.test'</TT> configures
<TT>`demo/libtool'</TT> to build both static and shared libraries,
<TT>`demo-static.test'</TT> builds only static libraries
(<SAMP>`--disable-shared'</SAMP>), and <TT>`demo-shared.test'</TT> builds only
shared libraries (<SAMP>`--disable-static'</SAMP>).
<TT>`demo-nofast.test'</TT> configures <TT>`demo/libtool'</TT> to
disable the fast-install mode (<SAMP>`--enable-fast-install=no'</SAMP>).
<TT>`demo-pic.test'</TT> configures <TT>`demo/libtool'</TT> to
prefer building PIC code (<SAMP>`--with-pic'</SAMP>), <TT>`demo-nopic.test'</TT>
to prefer non-PIC code (<SAMP>`--without-pic'</SAMP>).
<DT><TT>`deplibs.test'</TT>
<DD>
<A NAME="IDX233"></A>
Many systems cannot link static libraries into shared libraries.
libtool uses a <CODE>deplibs_check_method</CODE> to prevent such cases.
This tests checks whether libtool's <CODE>deplibs_check_method</CODE>
works properly.
<DT><TT>`hardcode.test'</TT>
<DD>
<A NAME="IDX234"></A>
On all systems with shared libraries, the location of the library can be
encoded in executables that are linked against it see section <A HREF="libtool.html#SEC10">Linking executables</A>. This test checks the conditions under which your system
linker hardcodes the library location, and guarantees that they
correspond to libtool's own notion of how your linker behaves.
<DT><TT>`build-relink.test'</TT>
<DD>
<A NAME="IDX235"></A>
Checks whether variable <VAR>shlibpath_overrides_runpath</VAR> is properly
set. If the test fails and <VAR>VERBOSE</VAR> is set, it will indicate what
the variable should have been set to.
<DT><TT>`noinst-link.test'</TT>
<DD>
<A NAME="IDX236"></A>
Checks whether libtool will not try to link with a previously installed
version of a library when it should be linking with a just-built one.
<DT><TT>`depdemo-conf.test'</TT>
<DD>
<DT><TT>`depdemo-exec.test'</TT>
<DD>
<DT><TT>`depdemo-inst.test'</TT>
<DD>
<DT><TT>`depdemo-make.test'</TT>
<DD>
<DT><TT>`depdemo-unst.test'</TT>
<DD>
<DT><TT>`depdemo-static.test'</TT>
<DD>
<DT><TT>`depdemo-shared.test'</TT>
<DD>
<DT><TT>`depdemo-nofast.test'</TT>
<DD>
<A NAME="IDX237"></A>
<A NAME="IDX238"></A>
<A NAME="IDX239"></A>
<A NAME="IDX240"></A>
<A NAME="IDX241"></A>
<A NAME="IDX242"></A>
<A NAME="IDX243"></A>
<A NAME="IDX244"></A>
These programs check to see that the <TT>`depdemo'</TT> subdirectory of the
libtool distribution can be configured, built, installed, and
uninstalled correctly.
The <TT>`depdemo'</TT> subdirectory contains a demonstration of inter-library
dependencies with libtool. The test programs link some interdependent
libraries.
The tests <TT>`depdemo-make.test'</TT>, <TT>`depdemo-exec.test'</TT>,
<TT>`depdemo-inst.test'</TT> and <TT>`depdemo-unst.test'</TT> are executed
four times, under four different libtool configurations:
<TT>`depdemo-conf.test'</TT> configures <TT>`depdemo/libtool'</TT> to build both
static and shared libraries, <TT>`depdemo-static.test'</TT> builds only static
libraries (<SAMP>`--disable-shared'</SAMP>), and <TT>`depdemo-shared.test'</TT> builds
only shared libraries (<SAMP>`--disable-static'</SAMP>).
<TT>`depdemo-nofast.test'</TT> configures <TT>`depdemo/libtool'</TT> to
disable the fast-install mode (<SAMP>`--enable-fast-install=no'</SAMP>.
<DT><TT>`mdemo-conf.test'</TT>
<DD>
<DT><TT>`mdemo-exec.test'</TT>
<DD>
<DT><TT>`mdemo-inst.test'</TT>
<DD>
<DT><TT>`mdemo-make.test'</TT>
<DD>
<DT><TT>`mdemo-unst.test'</TT>
<DD>
<DT><TT>`mdemo-static.test'</TT>
<DD>
<DT><TT>`mdemo-shared.test'</TT>
<DD>
<A NAME="IDX245"></A>
<A NAME="IDX246"></A>
<A NAME="IDX247"></A>
<A NAME="IDX248"></A>
<A NAME="IDX249"></A>
<A NAME="IDX250"></A>
<A NAME="IDX251"></A>
These programs check to see that the <TT>`mdemo'</TT> subdirectory of the
libtool distribution can be configured, built, installed, and
uninstalled correctly.
The <TT>`mdemo'</TT> subdirectory contains a demonstration of a package that
uses libtool and the system independent dlopen wrapper <TT>`libltdl'</TT> to
load modules. The library <TT>`libltdl'</TT> provides a dlopen wrapper for
various platforms (Linux, Solaris, HP/UX etc.) including support for
dlpreopened modules (see section <A HREF="libtool.html#SEC42">Dlpreopening</A>).
The tests <TT>`mdemo-make.test'</TT>, <TT>`mdemo-exec.test'</TT>,
<TT>`mdemo-inst.test'</TT> and <TT>`mdemo-unst.test'</TT> are executed
three times, under three different libtool configurations:
<TT>`mdemo-conf.test'</TT> configures <TT>`mdemo/libtool'</TT> to build both
static and shared libraries, <TT>`mdemo-static.test'</TT> builds only static
libraries (<SAMP>`--disable-shared'</SAMP>), and <TT>`mdemo-shared.test'</TT> builds
only shared libraries (<SAMP>`--disable-static'</SAMP>).
<DT><TT>`dryrun.test'</TT>
<DD>
<A NAME="IDX252"></A>
This test checks whether libtool's <CODE>--dry-run</CODE> mode works properly.
<DT><TT>`assign.test'</TT>
<DD>
<A NAME="IDX253"></A>
Checks whether we don't put break or continue on the same
line as an assignment in the libtool script.
<DT><TT>`link.test'</TT>
<DD>
<A NAME="IDX254"></A>
This test guarantees that linking directly against a non-libtool static
library works properly.
<DT><TT>`link-2.test'</TT>
<DD>
<A NAME="IDX255"></A>
This test makes sure that files ending in <SAMP>`.lo'</SAMP> are never linked
directly into a program file.
<DT><TT>`nomode.test'</TT>
<DD>
<A NAME="IDX256"></A>
Check whether we can actually get help for libtool.
<DT><TT>`quote.test'</TT>
<DD>
<A NAME="IDX257"></A>
This program checks libtool's metacharacter quoting.
<DT><TT>`sh.test'</TT>
<DD>
<A NAME="IDX258"></A>
Checks whether a `test' command was forgotten in libtool.
<DT><TT>`suffix.test'</TT>
<DD>
<A NAME="IDX259"></A>
When other programming languages are used with libtool (see section <A HREF="libtool.html#SEC53">Using libtool with other languages</A>), the source files may end in suffixes other than <SAMP>`.c'</SAMP>.
This test validates that libtool can handle suffixes for all the file
types that it supports, and that it fails when the suffix is invalid.
</DL>
<H3><A NAME="SEC58" HREF="libtool_toc.html#TOC58">When tests fail</A></H3>
<P>
<A NAME="IDX260"></A>
<A NAME="IDX261"></A>
<P>
Each of the above tests are designed to produce no output when they are
run via <KBD>make check</KBD>. The exit status of each program tells the
<TT>`Makefile'</TT> whether or not the test succeeded.
<P>
If a test fails, it means that there is either a programming error in
libtool, or in the test program itself.
<P>
To investigate a particular test, you may run it directly, as you would
a normal program. When the test is invoked in this way, it produces
output which may be useful in determining what the problem is.
<P>
Another way to have the test programs produce output is to set the
<VAR>VERBOSE</VAR> environment variable to <SAMP>`yes'</SAMP> before running them.
For example, <KBD>env VERBOSE=yes make check</KBD> runs all the tests, and
has each of them display debugging information.
<H2><A NAME="SEC59" HREF="libtool_toc.html#TOC59">Reporting bugs</A></H2>
<P>
<A NAME="IDX262"></A>
<A NAME="IDX263"></A>
<A NAME="IDX264"></A>
<P>
If you think you have discovered a bug in libtool, you should think
twice: the libtool maintainer is notorious for passing the buck (or
maybe that should be "passing the bug"). Libtool was invented to fix
known deficiencies in shared library implementations, so, in a way, most
of the bugs in libtool are actually bugs in other operating systems.
However, the libtool maintainer would definitely be happy to add support
for somebody else's buggy operating system. [I wish there was a good
way to do winking smiley-faces in Texinfo.]
<P>
Genuine bugs in libtool include problems with shell script portability,
documentation errors, and failures in the test suite (see section <A HREF="libtool.html#SEC56">The libtool test suite</A>).
<P>
First, check the documentation and help screens to make sure that the
behaviour you think is a problem is not already mentioned as a feature.
<P>
Then, you should read the Emacs guide to reporting bugs (see section `Reporting Bugs' in <CITE>The Emacs Manual</CITE>). Some of the details
listed there are specific to Emacs, but the principle behind them is a
general one.
<P>
Finally, send a bug report to the libtool bug reporting address <A HREF="mailto:bug-libtool@gnu.org">bug-libtool@gnu.org</A> with any appropriate
<EM>facts</EM>, such as test suite output (see section <A HREF="libtool.html#SEC58">When tests fail</A>), all
the details needed to reproduce the bug, and a brief description of why
you think the behaviour is a bug. Be sure to include the word
"libtool" in the subject line, as well as the version number you are
using (which can be found by typing <KBD>libtool --version</KBD>).
<H1><A NAME="SEC60" HREF="libtool_toc.html#TOC60">Maintenance notes for libtool</A></H1>
<P>
This chapter contains information that the libtool maintainer finds
important. It will be of no use to you unless you are considering
porting libtool to new systems, or writing your own libtool.
<H2><A NAME="SEC61" HREF="libtool_toc.html#TOC61">Porting libtool to new systems</A></H2>
<P>
Before you embark on porting libtool to an unsupported system, it is
worthwhile to send e-mail to the libtool mailing list <A HREF="mailto:libtool@gnu.org">libtool@gnu.org</A>, to make sure that you are
not duplicating existing work.
<P>
If you find that any porting documentation is missing, please complain!
Complaints with patches and improvements to the documentation, or to
libtool itself, are more than welcome.
<H3><A NAME="SEC62" HREF="libtool_toc.html#TOC62">Information sources</A></H3>
<P>
Once it is clear that a new port is necessary, you'll generally need the
following information:
<DL COMPACT>
<DT>canonical system name
<DD>
You need the output of <CODE>config.guess</CODE> for this system, so that you
can make changes to the libtool configuration process without affecting
other systems.
<DT>man pages for <CODE>ld</CODE> and <CODE>cc</CODE>
<DD>
These generally describe what flags are used to generate PIC, to create
shared libraries, and to link against only static libraries. You may
need to follow some cross references to find the information that is
required.
<DT>man pages for <CODE>ld.so</CODE>, <CODE>rtld</CODE>, or equivalent
<DD>
These are a valuable resource for understanding how shared libraries are
loaded on the system.
<DT>man page for <CODE>ldconfig</CODE>, or equivalent
<DD>
This page usually describes how to install shared libraries.
<DT>output from <KBD>ls -l /lib /usr/lib</KBD>
<DD>
This shows the naming convention for shared libraries on the system,
including which names should be symbolic links.
<DT>any additional documentation
<DD>
Some systems have special documentation on how to build and install
shared libraries.
</DL>
<P>
If you know how to program the Bourne shell, then you can complete the
port yourself; otherwise, you'll have to find somebody with the relevant
skills who will do the work. People on the libtool mailing list are
usually willing to volunteer to help you with new ports, so you can send
the information to them.
<P>
To do the port yourself, you'll definitely need to modify the
<CODE>libtool.m4</CODE> macros in order to make platform-specific changes to
the configuration process. You should search that file for the
<CODE>PORTME</CODE> keyword, which will give you some hints on what you'll
need to change. In general, all that is involved is modifying the
appropriate configuration variables (see section <A HREF="libtool.html#SEC71"><CODE>libtool</CODE> script contents</A>).
<P>
Your best bet is to find an already-supported system that is similar to
yours, and make your changes based on that. In some cases, however,
your system will differ significantly from every other supported system,
and it may be necessary to add new configuration variables, and modify
the <CODE>ltmain.in</CODE> script accordingly. Be sure to write to the
mailing list before you make changes to <CODE>ltmain.in</CODE>, since they may
have advice on the most effective way of accomplishing what you want.
<H3><A NAME="SEC63" HREF="libtool_toc.html#TOC63">Porting inter-library dependencies support</A></H3>
<P>
<A NAME="IDX265"></A>
<A NAME="IDX266"></A>
<P>
Since version 1.2c, libtool has re-introduced the ability to do
inter-library dependency on some platforms, thanks to a patch by Toshio
Kuratomi <A HREF="mailto:badger@prtr-13.ucsc.edu">badger@prtr-13.ucsc.edu</A>. Here's a shortened version
of the message that contained his patch:
<P>
The basic architecture is this: in <TT>`libtool.m4'</TT>, the person who
writes libtool makes sure <SAMP>`$deplibs'</SAMP> is included in
<SAMP>`$archive_cmds'</SAMP> somewhere and also sets the variable
<SAMP>`$deplibs_check_method'</SAMP>, and maybe <SAMP>`$file_magic_cmd'</SAMP> when
<SAMP>`deplibs_check_method'</SAMP> is file_magic.
<P>
<SAMP>`deplibs_check_method'</SAMP> can be one of five things:
<DL COMPACT>
<DT><SAMP>`file_magic [<VAR>regex</VAR>]'</SAMP>
<DD>
<A NAME="IDX267"></A>
<A NAME="IDX268"></A>
<A NAME="IDX269"></A>
looks in the library link path for libraries that have the right
libname. Then it runs <SAMP>`$file_magic_cmd'</SAMP> on the library and checks
for a match against <VAR>regex</VAR> using <CODE>egrep</CODE>. When
<VAR>file_magic_test_file</VAR> is set by <TT>`libtool.m4'</TT>, it is used as an
argument to <SAMP>`$file_magic_cmd'</SAMP> in order to verify whether the
regular expression matches its output, and warn the user otherwise.
<DT><SAMP>`test_compile'</SAMP>
<DD>
<A NAME="IDX270"></A>
just checks whether it is possible to link a program out of a list of
libraries, and checks which of those are listed in the output of
<CODE>ldd</CODE>. It is currently unused, and will probably be dropped in the
future.
<DT><SAMP>`pass_all'</SAMP>
<DD>
<A NAME="IDX271"></A>
will pass everything without any checking. This may work on platforms
in which code is position-independent by default and inter-library
dependencies are properly supported by the dynamic linker, for example,
on DEC OSF/1 3 and 4.
<DT><SAMP>`none'</SAMP>
<DD>
<A NAME="IDX272"></A>
It causes deplibs to be reassigned deplibs="". That way
<SAMP>`archive_cmds'</SAMP> can contain deplibs on all platforms, but not have
deplibs used unless needed.
<DT><SAMP>`unknown'</SAMP>
<DD>
<A NAME="IDX273"></A>
is the default for all systems unless overridden in <TT>`libtool.m4'</TT>.
It is the same as <SAMP>`none'</SAMP>, but it documents that we really don't
know what the correct value should be, and we welcome patches that
improve it.
</DL>
<P>
Then in <TT>`ltmain.in'</TT> we have the real workhorse: a little
initialization and postprocessing (to setup/release variables for use
with eval echo libname_spec etc.) and a case statement that decides
which method is being used. This is the real code... I wish I could
condense it a little more, but I don't think I can without function
calls. I've mostly optimized it (moved things out of loops, etc) but
there is probably some fat left. I thought I should stop while I was
ahead, work on whatever bugs you discover, etc before thinking about
more than obvious optimizations.
<H2><A NAME="SEC64" HREF="libtool_toc.html#TOC64">Tested platforms</A></H2>
<P>
This table describes when libtool was last known to be tested on
platforms where it claims to support shared libraries:
<PRE>
-------------------------------------------------------
canonical host name compiler libtool results
(tools versions) release
-------------------------------------------------------
alpha-dec-osf5.1 cc 1.3e ok (1.910)
alpha-dec-osf4.0f gcc 1.3e ok (1.910)
alpha-dec-osf4.0f cc 1.3e ok (1.910)
alpha-dec-osf3.2 gcc 0.8 ok
alpha-dec-osf3.2 cc 0.8 ok
alpha-dec-osf2.1 gcc 1.2f NS
alpha*-unknown-linux-gnu gcc 1.3b ok
(egcs-1.1.2, GNU ld 2.9.1.0.23)
hppa2.0w-hp-hpux11.00 cc 1.2f ok
hppa2.0-hp-hpux10.20 cc 1.3.2 ok
hppa1.1-hp-hpux10.20 gcc 1.2f ok
hppa1.1-hp-hpux10.20 cc 1.3c ok (1.821)
hppa1.1-hp-hpux10.10 gcc 1.2f ok
hppa1.1-hp-hpux10.10 cc 1.2f ok
hppa1.1-hp-hpux9.07 gcc 1.2f ok
hppa1.1-hp-hpux9.07 cc 1.2f ok
hppa1.1-hp-hpux9.05 gcc 1.2f ok
hppa1.1-hp-hpux9.05 cc 1.2f ok
hppa1.1-hp-hpux9.01 gcc 1.2f ok
hppa1.1-hp-hpux9.01 cc 1.2f ok
i*86-*-beos gcc 1.2f ok
i*86-*-bsdi4.0.1 gcc 1.3c ok
(gcc-2.7.2.1)
i*86-*-bsdi4.0 gcc 1.2f ok
i*86-*-bsdi3.1 gcc 1.2e NS
i*86-*-bsdi3.0 gcc 1.2e NS
i*86-*-bsdi2.1 gcc 1.2e NS
i*86-pc-cygwin gcc 1.3b NS
(egcs-1.1 stock b20.1 compiler)
i*86-*-dguxR4.20MU01 gcc 1.2 ok
i*86-*-freebsd4.3 gcc 1.3e ok (1.912)
i*86-*-freebsdelf4.0 gcc 1.3c ok
(egcs-1.1.2)
i*86-*-freebsdelf3.2 gcc 1.3c ok
(gcc-2.7.2.1)
i*86-*-freebsdelf3.1 gcc 1.3c ok
(gcc-2.7.2.1)
i*86-*-freebsdelf3.0 gcc 1.3c ok
i*86-*-freebsd3.0 gcc 1.2e ok
i*86-*-freebsd2.2.8 gcc 1.3c ok
(gcc-2.7.2.1)
i*86-*-freebsd2.2.6 gcc 1.3b ok
(egcs-1.1 & gcc-2.7.2.1, native ld)
i*86-*-freebsd2.1.5 gcc 0.5 ok
i*86-*-netbsd1.5 gcc 1.3e ok (1.901)
(egcs-1.1.2)
i*86-*-netbsd1.4 gcc 1.3c ok
(egcs-1.1.1)
i*86-*-netbsd1.4.3A gcc 1.3e ok (1.901)
i*86-*-netbsd1.3.3 gcc 1.3c ok
(gcc-2.7.2.2+myc2)
i*86-*-netbsd1.3.2 gcc 1.2e ok
i*86-*-netbsd1.3I gcc 1.2e ok
(egcs 1.1?)
i*86-*-netbsd1.2 gcc 0.9g ok
i*86-*-linux-gnu gcc 1.3e ok (1.901)
(Red Hat 7.0, gcc "2.96")
i*86-*-linux-gnu gcc 1.4.2 ok
(SuSE 7.0, gcc 2.95.2)
i*86-*-linux-gnulibc1 gcc 1.2f ok
i*86-*-openbsd2.5 gcc 1.3c ok
(gcc-2.8.1)
i*86-*-openbsd2.4 gcc 1.3c ok
(gcc-2.8.1)
i*86-*-solaris2.7 gcc 1.3b ok
(egcs-1.1.2, native ld)
i*86-*-solaris2.6 gcc 1.2f ok
i*86-*-solaris2.5.1 gcc 1.2f ok
i*86-ncr-sysv4.3.03 gcc 1.2f ok
i*86-ncr-sysv4.3.03 cc 1.2e ok
(cc -Hnocopyr)
i*86-pc-sco3.2v5.0.5 cc 1.3c ok
i*86-pc-sco3.2v5.0.5 gcc 1.3c ok
(gcc 95q4c)
i*86-pc-sco3.2v5.0.5 gcc 1.3c ok
(egcs-1.1.2)
i*86-sco-sysv5uw7.1.1 gcc 1.3e ok (1.901)
(gcc-2.95.2, SCO linker)
i*86-UnixWare7.1.0-sysv5 cc 1.3c ok
i*86-UnixWare7.1.0-sysv5 gcc 1.3c ok
(egcs-1.1.1)
m68k-next-nextstep3 gcc 1.2f NS
m68k-sun-sunos4.1.1 gcc 1.2f NS
(gcc-2.5.7)
m88k-dg-dguxR4.12TMU01 gcc 1.2 ok
m88k-motorola-sysv4 gcc 1.3 ok
(egcs-1.1.2)
mips-sgi-irix6.5 gcc 1.2f ok
(gcc-2.8.1)
mips-sgi-irix6.4 gcc 1.2f ok
mips-sgi-irix6.3 gcc 1.3b ok
(egcs-1.1.2, native ld)
mips-sgi-irix6.3 cc 1.3b ok
(cc 7.0)
mips-sgi-irix6.2 gcc 1.2f ok
mips-sgi-irix6.2 cc 0.9 ok
mips-sgi-irix5.3 gcc 1.2f ok
(egcs-1.1.1)
mips-sgi-irix5.3 gcc 1.2f NS
(gcc-2.6.3)
mips-sgi-irix5.3 cc 0.8 ok
mips-sgi-irix5.2 gcc 1.3b ok
(egcs-1.1.2, native ld)
mips-sgi-irix5.2 cc 1.3b ok
(cc 3.18)
mips-sni-sysv4 cc 1.3.5 ok
(Siemens C-compiler)
mips-sni-sysv4 gcc 1.3.5 ok
(gcc-2.7.2.3, GNU assembler 2.8.1, native ld)
mipsel-unknown-openbsd2.1 gcc 1.0 ok
powerpc-ibm-aix4.3.1.0 gcc 1.2f ok
(egcs-1.1.1)
powerpc-ibm-aix4.2.1.0 gcc 1.2f ok
(egcs-1.1.1)
powerpc-ibm-aix4.1.5.0 gcc 1.2f ok
(egcs-1.1.1)
powerpc-ibm-aix4.1.5.0 gcc 1.2f NS
(gcc-2.8.1)
powerpc-ibm-aix4.1.4.0 gcc 1.0 ok
powerpc-ibm-aix4.1.4.0 xlc 1.0i ok
rs6000-ibm-aix4.1.5.0 gcc 1.2f ok
(gcc-2.7.2)
rs6000-ibm-aix4.1.4.0 gcc 1.2f ok
(gcc-2.7.2)
rs6000-ibm-aix3.2.5 gcc 1.0i ok
rs6000-ibm-aix3.2.5 xlc 1.0i ok
sparc-sun-solaris2.8 gcc 1.4.2 ok
(gcc-2.95.2 & native ld)
sparc-sun-solaris2.8 gcc 1.4.2 ok
(gcc-3.0.1 & GNU ld 2.11.2)
sparc-sun-solaris2.7 gcc 1.3e ok (1.913)
(gcc-2.95.3 & native ld)
sparc-sun-solaris2.6 gcc 1.3e ok (1.913)
(gcc-2.95.3 & native ld)
sparc-sun-solaris2.5.1 gcc 1.4.2 ok
(gcc-2.95.1 & GNU ld 2.9.1)
sparc-sun-solaris2.5 gcc 1.3b ok
(egcs-1.1.2, GNU ld 2.9.1 & native ld)
sparc-sun-solaris2.5 cc 1.3b ok
(SC 3.0.1)
sparc-sun-solaris2.4 gcc 1.0a ok
sparc-sun-solaris2.4 cc 1.0a ok
sparc-sun-solaris2.3 gcc 1.2f ok
sparc-sun-sunos4.1.4 gcc 1.2f ok
sparc-sun-sunos4.1.4 cc 1.0f ok
sparc-sun-sunos4.1.3_U1 gcc 1.2f ok
sparc-sun-sunos4.1.3C gcc 1.2f ok
sparc-sun-sunos4.1.3 gcc 1.3b ok
(egcs-1.1.2, GNU ld 2.9.1 & native ld)
sparc-sun-sunos4.1.3 cc 1.3b ok
sparc-unknown-bsdi4.0 gcc 1.2c ok
sparc-unknown-linux-gnulibc1 gcc 1.2f ok
sparc-unknown-linux-gnu gcc 1.3b ok
(egcs-1.1.2, GNU ld 2.9.1.0.23)
sparc64-unknown-linux-gnu gcc 1.2f ok
Notes:
- "ok" means "all tests passed".
- "NS" means "Not Shared", but OK for static libraries
</PRE>
<P>
Note: The vendor-distributed HP-UX <CODE>sed</CODE>(1) programs are horribly
broken, and cannot handle libtool's requirements, so users may report
unusual problems. There is no workaround except to install a working
<CODE>sed</CODE> (such as GNU <CODE>sed</CODE>) on these systems.
<P>
Note: The vendor-distributed NCR MP-RAS <CODE>cc</CODE> programs emits
copyright on standard error that confuse tests on size of
<TT>`conftest.err'</TT>. The workaround is to specify <CODE>CC</CODE>
when run <CODE>configure</CODE> with <KBD>CC='cc -Hnocopyr'</KBD>.
<H2><A NAME="SEC65" HREF="libtool_toc.html#TOC65">Platform quirks</A></H2>
<P>
This section is dedicated to the sanity of the libtool maintainers. It
describes the programs that libtool uses, how they vary from system to
system, and how to test for them.
<P>
Because libtool is a shell script, it can be difficult to understand
just by reading it from top to bottom. This section helps show why
libtool does things a certain way. Combined with the scripts
themselves, you should have a better sense of how to improve libtool, or
write your own.
<H3><A NAME="SEC66" HREF="libtool_toc.html#TOC66">References</A></H3>
<P>
The following is a list of valuable documentation references:
<UL>
<LI>
SGI's IRIX Manual Pages, which can be found at
<A HREF="http://techpubs.sgi.com/cgi-bin/infosrch.cgi?cmd=browse&db=man">http://techpubs.sgi.com/cgi-bin/infosrch.cgi?cmd=browse&db=man</A>.
<LI>
Sun's free service area
(<A HREF="http://www.sun.com/service/online/free.html">http://www.sun.com/service/online/free.html</A>) and documentation
server (<A HREF="http://docs.sun.com/">http://docs.sun.com/</A>).
<LI>
Compaq's Tru64 UNIX online documentation is at
(<A HREF="http://tru64unix.compaq.com/faqs/publications/pub_page/doc_list.html">http://tru64unix.compaq.com/faqs/publications/pub_page/doc_list.html</A>)
with C++ documentation at
(<A HREF="http://tru64unix.compaq.com/cplus/docs/index.htm">http://tru64unix.compaq.com/cplus/docs/index.htm</A>).
<LI>
Hewlett-Packard has online documentation at
(<A HREF="http://docs.hp.com/index.html">http://docs.hp.com/index.html</A>).
<LI>
IBM has online documentation at
(<A HREF="http://www.rs6000.ibm.com/resource/aix_resource/Pubs/">http://www.rs6000.ibm.com/resource/aix_resource/Pubs/</A>).
</UL>
<H3><A NAME="SEC67" HREF="libtool_toc.html#TOC67">Compilers</A></H3>
<P>
The only compiler characteristics that affect libtool are the flags
needed (if any) to generate PIC objects. In general, if a C compiler
supports certain PIC flags, then any derivative compilers support the
same flags. Until there are some noteworthy exceptions to this rule,
this section will document only C compilers.
<P>
The following C compilers have standard command line options, regardless
of the platform:
<DL COMPACT>
<DT><CODE>gcc</CODE>
<DD>
This is the GNU C compiler, which is also the system compiler for many
free operating systems (FreeBSD, GNU/Hurd, GNU/Linux, Lites, NetBSD, and
OpenBSD, to name a few).
The <SAMP>`-fpic'</SAMP> or <SAMP>`-fPIC'</SAMP> flags can be used to generate
position-independent code. <SAMP>`-fPIC'</SAMP> is guaranteed to generate
working code, but the code is slower on m68k, m88k, and Sparc chips.
However, using <SAMP>`-fpic'</SAMP> on those chips imposes arbitrary size limits
on the shared libraries.
</DL>
<P>
The rest of this subsection lists compilers by the operating system that
they are bundled with:
<DL COMPACT>
<DT><CODE>aix3*</CODE>
<DD>
<DT><CODE>aix4*</CODE>
<DD>
AIX compilers have no PIC flags, since AIX has been ported only to
PowerPC and RS/6000 chips. <A NAME="DOCF11" HREF="libtool_foot.html#FOOT11">(11)</A>
<DT><CODE>hpux10*</CODE>
<DD>
Use <SAMP>`+Z'</SAMP> to generate PIC.
<DT><CODE>osf3*</CODE>
<DD>
Digital/UNIX 3.x does not have PIC flags, at least not on the PowerPC
platform.
<DT><CODE>solaris2*</CODE>
<DD>
Use <SAMP>`-KPIC'</SAMP> to generate PIC.
<DT><CODE>sunos4*</CODE>
<DD>
Use <SAMP>`-PIC'</SAMP> to generate PIC.
</DL>
<H3><A NAME="SEC68" HREF="libtool_toc.html#TOC68">Reloadable objects</A></H3>
<P>
On all known systems, a reloadable object can be created by running
<KBD>ld -r -o <VAR>output</VAR>.o <VAR>input1</VAR>.o <VAR>input2</VAR>.o</KBD>. This
reloadable object may be treated as exactly equivalent to other
objects.
<H3><A NAME="SEC69" HREF="libtool_toc.html#TOC69">Multiple dependencies</A></H3>
<P>
On most modern platforms the order that dependent libraries are listed
has no effect on object generation. In theory, there are platforms
which require libraries which provide missing symbols to other libraries
to listed after those libraries whose symbols they provide.
<P>
Particularly, if a pair of static archives each resolve some of the
other's symbols, it might be necessary to list one of those archives
both before and after the other one. Libtool does not currently cope
with this situation well, since dupicate libraries are removed from
thr link line.
<P>
If you find yourself developing on a host that requires you to list
libraries multiple times in order for it to generate correctly linked
objects, you can defeat libtool's removal algorithm like this:
<PRE>
$ libtool ... -lfoo -lbar -Wl,-lfoo
</PRE>
<H3><A NAME="SEC70" HREF="libtool_toc.html#TOC70">Archivers</A></H3>
<P>
On all known systems, building a static library can be accomplished by
running <KBD>ar cru lib<VAR>name</VAR>.a <VAR>obj1</VAR>.o <VAR>obj2</VAR>.o ...</KBD>,
where the <SAMP>`.a'</SAMP> file is the output library, and each <SAMP>`.o'</SAMP> file is an
object file.
<P>
On all known systems, if there is a program named <CODE>ranlib</CODE>, then it
must be used to "bless" the created library before linking against it,
with the <KBD>ranlib lib<VAR>name</VAR>.a</KBD> command. Some systems, like Irix,
use the <CODE>ar ts</CODE> command, instead.
<H2><A NAME="SEC71" HREF="libtool_toc.html#TOC71"><CODE>libtool</CODE> script contents</A></H2>
<P>
<A NAME="IDX274"></A>
<A NAME="IDX275"></A>
<P>
Since version 1.4, the <CODE>libtool</CODE> script is generated by
<CODE>configure</CODE> (see section <A HREF="libtool.html#SEC26">Configuring libtool</A>). In earlier versions,
<CODE>configure</CODE> achieved this by calling a helper script called
<TT>`ltconfig'</TT>. From libtool version 0.7 to 1.0, this script
simply set shell variables, then sourced the libtool backend,
<CODE>ltmain.sh</CODE>. <CODE>ltconfig</CODE> from libtool version 1.1 through 1.3
inlined the contents of <CODE>ltmain.sh</CODE> into the generated
<CODE>libtool</CODE>, which improved performance on many systems. The tests
that <TT>`ltconfig'</TT> used to perform are now kept in <TT>`libtool.m4'</TT>
where thay can be written using Autoconf. This has the runtime
performance benefits of inlined <CODE>ltmain.sh</CODE>, <EM>and</EM> improves
the build time a little while considerably easing the amount of raw
shell code that used to need maintaining.
<P>
The convention used for naming variables which hold shell commands for
delayed evaluation, is to use the suffix <CODE>_cmd</CODE> where a single
line of valid shell script is needed, and the suffix <CODE>_cmds</CODE> where
multiple lines of shell script <STRONG>may</STRONG> be delayed for later
evaluation. By convention, <CODE>_cmds</CODE> variables delimit the
evaluation units with the <CODE>~</CODE> character where necessary.
<P>
Here is a listing of each of the configuration variables, and how they
are used within <CODE>ltmain.sh</CODE> (see section <A HREF="libtool.html#SEC26">Configuring libtool</A>):
<P>
<DL>
<DT><U>Variable:</U> <B>AR</B>
<DD><A NAME="IDX276"></A>
The name of the system library archiver.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>CC</B>
<DD><A NAME="IDX277"></A>
The name of the C compiler used to configure libtool.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>LD</B>
<DD><A NAME="IDX278"></A>
The name of the linker that libtool should use internally for reloadable
linking and possibly shared libraries.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>NM</B>
<DD><A NAME="IDX279"></A>
The name of a BSD-compatible <CODE>nm</CODE> program, which produces listings
of global symbols in one the following formats:
<PRE>
<VAR>address</VAR> C <VAR>global-variable-name</VAR>
<VAR>address</VAR> D <VAR>global-variable-name</VAR>
<VAR>address</VAR> T <VAR>global-function-name</VAR>
</PRE>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>RANLIB</B>
<DD><A NAME="IDX280"></A>
Set to the name of the ranlib program, if any.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>allow_undefined_flag</B>
<DD><A NAME="IDX281"></A>
The flag that is used by <SAMP>`archive_cmds'</SAMP> in order to declare that
there will be unresolved symbols in the resulting shared library.
Empty, if no such flag is required. Set to <SAMP>`unsupported'</SAMP> if there
is no way to generate a shared library with references to symbols that
aren't defined in that library.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>always_export_symbols</B>
<DD><A NAME="IDX282"></A>
Whether libtool should automatically generate a list of exported symbols
using <VAR>export_symbols_cmds</VAR> before linking an archive.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>. Default is <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>archive_cmds</B>
<DD><A NAME="IDX283"></A>
<DT><U>Variable:</U> <B>archive_expsym_cmds</B>
<DD><A NAME="IDX284"></A>
<DT><U>Variable:</U> <B>old_archive_cmds</B>
<DD><A NAME="IDX285"></A>
Commands used to create shared libraries, shared libraries with
<SAMP>`-export-symbols'</SAMP> and static libraries, respectively.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>old_archive_from_new_cmds</B>
<DD><A NAME="IDX286"></A>
If the shared library depends on a static library,
<SAMP>`old_archive_from_new_cmds'</SAMP> contains the commands used to create that
static library. If this variable is not empty, <SAMP>`old_archive_cmds'</SAMP> is
not used.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>old_archive_from_expsyms_cmds</B>
<DD><A NAME="IDX287"></A>
If a static library must be created from the export symbol list in order to
correctly link with a shared library, <SAMP>`old_archive_from_expsyms_cmds'</SAMP>
contains the commands needed to create that static library. When these
commands are executed, the variable <VAR>soname</VAR> contains the name of the
shared library in question, and the <VAR>$objdir/$newlib</VAR> contains the
path of the static library these commands should build. After executing
these commands, libtool will proceed to link against <VAR>$objdir/$newlib</VAR>
instead of <VAR>soname</VAR>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>build_libtool_libs</B>
<DD><A NAME="IDX288"></A>
Whether libtool should build shared libraries on this system. Set to
<SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>build_old_libs</B>
<DD><A NAME="IDX289"></A>
Whether libtool should build static libraries on this system. Set to
<SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>compiler_c_o</B>
<DD><A NAME="IDX290"></A>
Whether the compiler supports the <CODE>-c</CODE> and <CODE>-o</CODE> options
simultaneously. Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>compiler_o_lo</B>
<DD><A NAME="IDX291"></A>
Whether the compiler supports compiling directly to a ".lo" file,
i.e whether object files do not have to have the suffix ".o".
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>dlopen_support</B>
<DD><A NAME="IDX292"></A>
Whether <CODE>dlopen</CODE> is supported on the platform.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>dlopen_self</B>
<DD><A NAME="IDX293"></A>
Whether it is possible to <CODE>dlopen</CODE> the executable itself.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>dlopen_self_static</B>
<DD><A NAME="IDX294"></A>
Whether it is possible to <CODE>dlopen</CODE> the executable itself, when it
is linked statically (<SAMP>`-all-static'</SAMP>). Set to <SAMP>`yes'</SAMP> or
<SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>echo</B>
<DD><A NAME="IDX295"></A>
An <CODE>echo</CODE> program which does not interpret backslashes as an
escape character.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>exclude_expsyms</B>
<DD><A NAME="IDX296"></A>
List of symbols that should not be listed in the preloaded symbols.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>export_dynamic_flag_spec</B>
<DD><A NAME="IDX297"></A>
Compiler link flag that allows a dlopened shared library to reference
symbols that are defined in the program.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>export_symbols_cmds</B>
<DD><A NAME="IDX298"></A>
Commands to extract exported symbols from <VAR>libobjs</VAR> to the
file <VAR>export_symbols</VAR>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>extract_expsyms_cmds</B>
<DD><A NAME="IDX299"></A>
Commands to extract the exported symbols list from a shared library.
These commands are executed if there is no file <VAR>$objdir/$soname-def</VAR>,
and should write the names of the exported symbols to that file, for
the use of <SAMP>`old_archive_from_expsyms_cmds'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>fast_install</B>
<DD><A NAME="IDX300"></A>
Determines whether libtool will privilege the installer or the
developer. The assumption is that installers will seldom run programs
in the build tree, and the developer will seldom install. This is only
meaningful on platforms in which <VAR>shlibpath_overrides_runpath</VAR> is
not <SAMP>`yes'</SAMP>, so <VAR>fast_install</VAR> will be set to <SAMP>`needless'</SAMP> in
this case. If <VAR>fast_install</VAR> set to <SAMP>`yes'</SAMP>, libtool will create
programs that search for installed libraries, and, if a program is run
in the build tree, a new copy will be linked on-demand to use the
yet-to-be-installed libraries. If set to <SAMP>`no'</SAMP>, libtool will create
programs that use the yet-to-be-installed libraries, and will link
a new copy of the program at install time. The default value is
<SAMP>`yes'</SAMP> or <SAMP>`needless'</SAMP>, depending on platform and configuration
flags, and it can be turned from <SAMP>`yes'</SAMP> to <SAMP>`no'</SAMP> with the
configure flag <SAMP>`--disable-fast-install'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>finish_cmds</B>
<DD><A NAME="IDX301"></A>
Commands to tell the dynamic linker how to find shared libraries in a
specific directory.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>finish_eval</B>
<DD><A NAME="IDX302"></A>
Same as <VAR>finish_cmds</VAR>, except the commands are not displayed.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>fix_srcfile_path</B>
<DD><A NAME="IDX303"></A>
Expression to fix the shell variable $srcfile for the compiler.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>global_symbol_pipe</B>
<DD><A NAME="IDX304"></A>
A pipeline that takes the output of <VAR>NM</VAR>, and produces a listing of
raw symbols followed by their C names. For example:
<PRE>
$ <KBD>eval "$NM progname | $global_symbol_pipe"</KBD>
D <VAR>symbol1</VAR> <VAR>C-symbol1</VAR>
T <VAR>symbol2</VAR> <VAR>C-symbol2</VAR>
C <VAR>symbol3</VAR> <VAR>C-symbol3</VAR>
...
$
</PRE>
<P>
The first column contains the symbol type (used to tell data from code
on some platforms), but its meaning is system dependent.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>global_symbol_to_cdecl</B>
<DD><A NAME="IDX305"></A>
A pipeline that translates the output of <VAR>global_symbol_pipe</VAR> into
proper C declarations. On platforms whose linkers differentiate code
from data, such as HP/UX, data symbols will be declared as such, and
code symbols will be declared as functions. On platforms that don't
care, everything is assumed to be data.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_action</B>
<DD><A NAME="IDX306"></A>
Either <SAMP>`immediate'</SAMP> or <SAMP>`relink'</SAMP>, depending on whether shared
library paths can be hardcoded into executables before they are installed,
or if they need to be relinked.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_direct</B>
<DD><A NAME="IDX307"></A>
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>, depending on whether the linker
hardcodes directories if a library is directly specified on the command
line (such as <SAMP>`<VAR>dir</VAR>/lib<VAR>name</VAR>.a'</SAMP>) when
<VAR>hardcode_libdir_flag_spec</VAR> is specified.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_into_libs</B>
<DD><A NAME="IDX308"></A>
Whether the platform supports hardcoding of run-paths into libraries.
If enabled, linking of programs will be much simpler but libraries will
need to be relinked during installation. Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_libdir_flag_spec</B>
<DD><A NAME="IDX309"></A>
Flag to hardcode a <VAR>libdir</VAR> variable into a binary, so that the
dynamic linker searches <VAR>libdir</VAR> for shared libraries at runtime.
If it is empty, libtool will try to use some other hardcoding mechanism.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_libdir_separator</B>
<DD><A NAME="IDX310"></A>
If the compiler only accepts a single <VAR>hardcode_libdir_flag</VAR>, then
this variable contains the string that should separate multiple
arguments to that flag.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_minus_L</B>
<DD><A NAME="IDX311"></A>
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>, depending on whether the linker
hardcodes directories specified by <SAMP>`-L'</SAMP> flags into the resulting
executable when <VAR>hardcode_libdir_flag_spec</VAR> is specified.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>hardcode_shlibpath_var</B>
<DD><A NAME="IDX312"></A>
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>, depending on whether the linker
hardcodes directories by writing the contents of <SAMP>`$shlibpath_var'</SAMP>
into the resulting executable when <VAR>hardcode_libdir_flag_spec</VAR> is
specified. Set to <SAMP>`unsupported'</SAMP> if directories specified by
<SAMP>`$shlibpath_var'</SAMP> are searched at run time, but not at link time.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>host</B>
<DD><A NAME="IDX313"></A>
<DT><U>Variable:</U> <B>host_alias</B>
<DD><A NAME="IDX314"></A>
For information purposes, set to the specified and canonical names of
the system that libtool was configured for.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>include_expsyms</B>
<DD><A NAME="IDX315"></A>
List of symbols that must always be exported when using <VAR>export_symbols</VAR>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>libext</B>
<DD><A NAME="IDX316"></A>
The standard old archive suffix (normally "a").
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>libname_spec</B>
<DD><A NAME="IDX317"></A>
The format of a library name prefix. On all Unix systems, static
libraries are called <SAMP>`lib<VAR>name</VAR>.a'</SAMP>, but on some systems (such
as OS/2 or MS-DOS), the library is just called <SAMP>`<VAR>name</VAR>.a'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>library_names_spec</B>
<DD><A NAME="IDX318"></A>
A list of shared library names. The first is the name of the file,
the rest are symbolic links to the file. The name in the list is
the file name that the linker finds when given <SAMP>`-l<VAR>name</VAR>'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>link_all_deplibs</B>
<DD><A NAME="IDX319"></A>
Whether libtool must link a program against all its dependency libraries.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>. Default is <SAMP>`unknown'</SAMP>, which is
a synonym for <SAMP>`yes'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>link_static_flag</B>
<DD><A NAME="IDX320"></A>
Linker flag (passed through the C compiler) used to prevent dynamic
linking.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>need_lib_prefix</B>
<DD><A NAME="IDX321"></A>
Whether libtool should automatically prefix module names with 'lib'.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>. By default, it is <SAMP>`unknown'</SAMP>, which
means the same as <SAMP>`yes'</SAMP>, but documents that we are not really sure
about it.
<SAMP>`yes'</SAMP> means that it is possible both to <CODE>dlopen</CODE> and to
link against a library without 'lib' prefix,
i.e. it requires <VAR>hardcode_direct</VAR> to be <SAMP>`yes'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>need_version</B>
<DD><A NAME="IDX322"></A>
Whether versioning is required for libraries, i.e. whether the
dynamic linker requires a version suffix for all libraries.
Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>. By default, it is <SAMP>`unknown'</SAMP>, which
means the same as <SAMP>`yes'</SAMP>, but documents that we are not really sure
about it.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>need_locks</B>
<DD><A NAME="IDX323"></A>
Whether files must be locked to prevent conflicts when compiling
simultaneously. Set to <SAMP>`yes'</SAMP> or <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>no_builtin_flag</B>
<DD><A NAME="IDX324"></A>
Compiler flag to disable builtin functions that conflict with declaring
external global symbols as <CODE>char</CODE>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>no_undefined_flag</B>
<DD><A NAME="IDX325"></A>
The flag that is used by <SAMP>`archive_cmds'</SAMP> in order to declare that
there will be no unresolved symbols in the resulting shared library.
Empty, if no such flag is required.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>objdir</B>
<DD><A NAME="IDX326"></A>
The name of the directory that contains temporary libtool files.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>objext</B>
<DD><A NAME="IDX327"></A>
The standard object file suffix (normally "o").
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>pic_flag</B>
<DD><A NAME="IDX328"></A>
Any additional compiler flags for building library object files.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>postinstall_cmds</B>
<DD><A NAME="IDX329"></A>
<DT><U>Variable:</U> <B>old_postinstall_cmds</B>
<DD><A NAME="IDX330"></A>
Commands run after installing a shared or static library, respectively.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>postuninstall_cmds</B>
<DD><A NAME="IDX331"></A>
<DT><U>Variable:</U> <B>old_postuninstall_cmds</B>
<DD><A NAME="IDX332"></A>
Commands run after uninstalling a shared or static library, respectively.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>reload_cmds</B>
<DD><A NAME="IDX333"></A>
<DT><U>Variable:</U> <B>reload_flag</B>
<DD><A NAME="IDX334"></A>
Commands to create a reloadable object.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>runpath_var</B>
<DD><A NAME="IDX335"></A>
The environment variable that tells the linker which directories to
hardcode in the resulting executable.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>shlibpath_overrides_runpath</B>
<DD><A NAME="IDX336"></A>
Indicates whether it is possible to override the hard-coded library
search path of a program with an environment variable. If this is set
to no, libtool may have to create two copies of a program in the build
tree, one to be installed and one to be run in the build tree only.
When each of these copies is created depends on the value of
<CODE>fast_install</CODE>. The default value is <SAMP>`unknown'</SAMP>, which is
equivalent to <SAMP>`no'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>shlibpath_var</B>
<DD><A NAME="IDX337"></A>
The environment variable that tells the dynamic linker where to find
shared libraries.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>soname_spec</B>
<DD><A NAME="IDX338"></A>
The name coded into shared libraries, if different from the real name of
the file.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>striplib</B>
<DD><A NAME="IDX339"></A>
<DT><U>Variable:</U> <B>old_striplib</B>
<DD><A NAME="IDX340"></A>
Command to strip a shared (<CODE>striplib</CODE>) or static (<CODE>old_striplib</CODE>)
library, respectively. If these variables are empty, the strip flag
in the install mode will be ignored for libraries (see section <A HREF="libtool.html#SEC19">Install mode</A>).
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>sys_lib_dlsearch_path_spec</B>
<DD><A NAME="IDX341"></A>
Expression to get the run-time system library search path. Directories
that appear in this list are never hard-coded into executables.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>sys_lib_search_path_spec</B>
<DD><A NAME="IDX342"></A>
Expression to get the compile-time system library search path. This
variable is used by libtool when it has to test whether a certain
library is shared or static. The directories listed in
<VAR>shlibpath_var</VAR> are automatically appended to this list, every time
libtool runs (i.e., not at configuration time), because some linkers use
this variable to extend the library search path. Linker switches such
as <CODE>-L</CODE> also augment the search path.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>thread_safe_flag_spec</B>
<DD><A NAME="IDX343"></A>
Linker flag (passed through the C compiler) used to generate thread-safe
libraries.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>version_type</B>
<DD><A NAME="IDX344"></A>
The library version numbering type. One of <SAMP>`libtool'</SAMP>,
<SAMP>`freebsd-aout'</SAMP>, <SAMP>`freebsd-elf'</SAMP>, <SAMP>`irix'</SAMP>, <SAMP>`linux'</SAMP>,
<SAMP>`osf'</SAMP>, <SAMP>`sunos'</SAMP>, <SAMP>`windows'</SAMP>, or <SAMP>`none'</SAMP>.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>whole_archive_flag_spec</B>
<DD><A NAME="IDX345"></A>
Compiler flag to generate shared objects from convenience archives.
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>wl</B>
<DD><A NAME="IDX346"></A>
The C compiler flag that allows libtool to pass a flag directly to the
linker. Used as: <CODE>${wl}<VAR>some-flag</VAR></CODE>.
</DL>
<P>
Variables ending in <SAMP>`_cmds'</SAMP> or <SAMP>`_eval'</SAMP> contain a
<SAMP>`~'</SAMP>-separated list of commands that are <CODE>eval</CODE>ed one after
another. If any of the commands return a nonzero exit status, libtool
generally exits with an error message.
<P>
Variables ending in <SAMP>`_spec'</SAMP> are <CODE>eval</CODE>ed before being used by
libtool.
<H2><A NAME="SEC72" HREF="libtool_toc.html#TOC72">Cheap tricks</A></H2>
<P>
Here are a few tricks that you can use in order to make maintainership
easier:
<UL>
<LI>
When people report bugs, ask them to use the <SAMP>`--config'</SAMP>,
<SAMP>`--debug'</SAMP>, or <SAMP>`--features'</SAMP> flags, if you think they will help
you. These flags are there to help you get information directly, rather
than having to trust second-hand observation.
<LI>
Rather than reconfiguring libtool every time I make a change to
<CODE>ltmain.in</CODE>, I keep a permanent <CODE>libtool</CODE> script in my
<VAR>PATH</VAR>, which sources <CODE>ltmain.in</CODE> directly.
The following steps describe how to create such a script, where
<CODE>/home/src/libtool</CODE> is the directory containing the libtool source
tree, <CODE>/home/src/libtool/libtool</CODE> is a libtool script that has been
configured for your platform, and <CODE>~/bin</CODE> is a directory in your
<VAR>PATH</VAR>:
<PRE>
trick$ cd ~/bin
trick$ sed '/^# ltmain\.sh/q' /home/src/libtool/libtool > libtool
trick$ echo '. /home/src/libtool/ltmain.in' >> libtool
trick$ chmod +x libtool
trick$ libtool --version
ltmain.sh (GNU @PACKAGE@) @VERSION@@TIMESTAMP@
trick$
</PRE>
</UL>
<P>
The output of the final <SAMP>`libtool --version'</SAMP> command shows that the
<CODE>ltmain.in</CODE> script is being used directly. Now, modify
<CODE>~/bin/libtool</CODE> or <CODE>/home/src/libtool/ltmain.in</CODE> directly in
order to test new changes without having to rerun <CODE>configure</CODE>.
<H1><A NAME="SEC73" HREF="libtool_toc.html#TOC73">GNU Free Documentation License</A></H1>
<P>
Version 1.1, March 2000
<PRE>
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</PRE>
<H2><A NAME="SEC74" HREF="libtool_toc.html#TOC74">Preamble</A></H2>
<P>
The purpose of this License is to make a manual, textbook, or other
written document "free" in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
<P>
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
<P>
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
<H2><A NAME="SEC75" HREF="libtool_toc.html#TOC75">APPLICABILITY AND DEFINITIONS</A></H2>
<P>
This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The "Document", below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as "you".
<P>
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
<P>
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
<P>
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.
<P>
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.
<P>
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not "Transparent" is called "Opaque".
<P>
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.
<P>
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
<H2><A NAME="SEC76" HREF="libtool_toc.html#TOC76">VERBATIM COPYING</A></H2>
<P>
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
<P>
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
<H2><A NAME="SEC77" HREF="libtool_toc.html#TOC77">COPYING IN QUANTITY</A></H2>
<P>
If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
<P>
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
<P>
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.
<P>
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
<H2><A NAME="SEC78" HREF="libtool_toc.html#TOC78">MODIFICATIONS</A></H2>
<P>
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
<OL>
<LI>
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
<LI>
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).
<LI>
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
<LI>
Preserve all the copyright notices of the Document.
<LI>
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
<LI>
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
<LI>
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
<LI>
Include an unaltered copy of this License.
<LI>
Preserve the section entitled "History", and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
<LI>
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
<LI>
In any section entitled "Acknowledgements" or "Dedications",
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
<LI>
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
<LI>
Delete any section entitled "Endorsements". Such a section
may not be included in the Modified Version.
<LI>
Do not retitle any existing section as "Endorsements"
or to conflict in title with any Invariant Section.
</OL>
<P>
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
<P>
You may add a section entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
<P>
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
<P>
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
<H2><A NAME="SEC79" HREF="libtool_toc.html#TOC79">COMBINING DOCUMENTS</A></H2>
<P>
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.
<P>
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
<P>
In the combination, you must combine any sections entitled "History"
in the various original documents, forming one section entitled
"History"; likewise combine any sections entitled "Acknowledgements",
and any sections entitled "Dedications". You must delete all sections
entitled "Endorsements."
<H2><A NAME="SEC80" HREF="libtool_toc.html#TOC80">COLLECTIONS OF DOCUMENTS</A></H2>
<P>
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
<P>
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
<H2><A NAME="SEC81" HREF="libtool_toc.html#TOC81">AGGREGATION WITH INDEPENDENT WORKS</A></H2>
<P>
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an "aggregate", and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.
<P>
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.
<H2><A NAME="SEC82" HREF="libtool_toc.html#TOC82">TRANSLATION</A></H2>
<P>
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.
<H2><A NAME="SEC83" HREF="libtool_toc.html#TOC83">TERMINATION</A></H2>
<P>
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
<H2><A NAME="SEC84" HREF="libtool_toc.html#TOC84">FUTURE REVISIONS OF THIS LICENSE</A></H2>
<P>
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
<P>
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
<H2><A NAME="SEC85" HREF="libtool_toc.html#TOC85">ADDENDUM: How to use this License for your documents</A></H2>
<P>
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
<PRE>
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
</PRE>
<P>
If you have no Invariant Sections, write "with no Invariant Sections"
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write "no Front-Cover Texts" instead of
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
<P>
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
<H1><A NAME="SEC86" HREF="libtool_toc.html#TOC86">Index</A></H1>
<P>
Jump to:
<A HREF="#cindex_(">(</A>
-
<A HREF="#cindex_.">.</A>
-
<A HREF="#cindex_a">a</A>
-
<A HREF="#cindex_b">b</A>
-
<A HREF="#cindex_c">c</A>
-
<A HREF="#cindex_d">d</A>
-
<A HREF="#cindex_e">e</A>
-
<A HREF="#cindex_f">f</A>
-
<A HREF="#cindex_g">g</A>
-
<A HREF="#cindex_h">h</A>
-
<A HREF="#cindex_i">i</A>
-
<A HREF="#cindex_l">l</A>
-
<A HREF="#cindex_m">m</A>
-
<A HREF="#cindex_n">n</A>
-
<A HREF="#cindex_o">o</A>
-
<A HREF="#cindex_p">p</A>
-
<A HREF="#cindex_q">q</A>
-
<A HREF="#cindex_r">r</A>
-
<A HREF="#cindex_s">s</A>
-
<A HREF="#cindex_t">t</A>
-
<A HREF="#cindex_u">u</A>
-
<A HREF="#cindex_v">v</A>
-
<A HREF="#cindex_w">w</A>
<P>
<H2><A NAME="cindex_(">(</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX202">(const char *<VAR>loader_name</VAR>)</A>
<LI><A HREF="libtool.html#IDX201">(lt_dlloader *<VAR>place</VAR>)</A>, <A HREF="libtool.html#IDX203">(lt_dlloader *<VAR>place</VAR>)</A>, <A HREF="libtool.html#IDX204">(lt_dlloader *<VAR>place</VAR>)</A>
<LI><A HREF="libtool.html#IDX167">(void)</A>, <A HREF="libtool.html#IDX173">(void)</A>
</DIR>
<H2><A NAME="cindex_.">.</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX24"><SAMP>`.la'</SAMP> files</A>
<LI><A HREF="libtool.html#IDX25"><TT>`.libs'</TT> subdirectory</A>
<LI><A HREF="libtool.html#IDX19"><SAMP>`.lo'</SAMP> files</A>
</DIR>
<H2><A NAME="cindex_a">a</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX101">AC_CONFIG_AUX_DIR</A>
<LI><A HREF="libtool.html#IDX76">AC_DISABLE_FAST_INSTALL</A>
<LI><A HREF="libtool.html#IDX77">AC_DISABLE_SHARED</A>
<LI><A HREF="libtool.html#IDX79">AC_DISABLE_STATIC</A>
<LI><A HREF="libtool.html#IDX103">AC_FUNC_ALLOCA</A>
<LI><A HREF="libtool.html#IDX74">AC_LIBTOOL_DLOPEN</A>
<LI><A HREF="libtool.html#IDX75">AC_LIBTOOL_WIN32_DLL</A>
<LI><A HREF="libtool.html#IDX72">AC_PROG_LIBTOOL</A>
<LI><A HREF="libtool.html#IDX105">AC_REPLACE_FUNCS</A>
<LI><A HREF="libtool.html#IDX93">aclocal</A>
<LI><A HREF="libtool.html#IDX281">allow_undefined_flag</A>
<LI><A HREF="libtool.html#IDX282">always_export_symbols</A>
<LI><A HREF="libtool.html#IDX78">AM_DISABLE_SHARED</A>
<LI><A HREF="libtool.html#IDX80">AM_DISABLE_STATIC</A>
<LI><A HREF="libtool.html#IDX73">AM_PROG_LIBTOOL</A>
<LI><A HREF="libtool.html#IDX140">application-level dynamic linking</A>, <A HREF="libtool.html#IDX157">application-level dynamic linking</A>
<LI><A HREF="libtool.html#IDX21">ar</A>
<LI><A HREF="libtool.html#IDX276">AR</A>
<LI><A HREF="libtool.html#IDX283">archive_cmds</A>
<LI><A HREF="libtool.html#IDX284">archive_expsym_cmds</A>
<LI><A HREF="libtool.html#IDX92">AS</A>
<LI><A HREF="libtool.html#IDX253">assign.test</A>
<LI><A HREF="libtool.html#IDX109">avoiding shared libraries</A>
</DIR>
<H2><A NAME="cindex_b">b</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX262">bug reports</A>
<LI><A HREF="libtool.html#IDX27">buggy system linkers</A>
<LI><A HREF="libtool.html#IDX29">bugs, subtle ones caused by buggy linkers</A>
<LI><A HREF="libtool.html#IDX235">build-relink.test</A>
<LI><A HREF="libtool.html#IDX288">build_libtool_libs</A>
<LI><A HREF="libtool.html#IDX289">build_old_libs</A>
</DIR>
<H2><A NAME="cindex_c">c</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX129">C header files, portable</A>
<LI><A HREF="libtool.html#IDX212">C++, pitfalls</A>
<LI><A HREF="libtool.html#IDX209">C++, using</A>
<LI><A HREF="libtool.html#IDX207">C, not using</A>
<LI><A HREF="libtool.html#IDX81">CC</A>, <A HREF="libtool.html#IDX277">CC</A>
<LI><A HREF="libtool.html#IDX218">cdemo-conf.test</A>
<LI><A HREF="libtool.html#IDX219">cdemo-exec.test</A>
<LI><A HREF="libtool.html#IDX220">cdemo-make.test</A>
<LI><A HREF="libtool.html#IDX222">cdemo-shared.test</A>
<LI><A HREF="libtool.html#IDX221">cdemo-static.test</A>
<LI><A HREF="libtool.html#IDX82">CFLAGS</A>
<LI><A HREF="libtool.html#IDX65">clean mode</A>
<LI><A HREF="libtool.html#IDX48">command options, libtool</A>
<LI><A HREF="libtool.html#IDX99">command options, libtoolize</A>
<LI><A HREF="libtool.html#IDX50">compile mode</A>
<LI><A HREF="libtool.html#IDX290">compiler_c_o</A>
<LI><A HREF="libtool.html#IDX291">compiler_o_lo</A>
<LI><A HREF="libtool.html#IDX14">compiling object files</A>
<LI><A HREF="libtool.html#IDX9">complexity of library systems</A>
<LI><A HREF="libtool.html#IDX94">config.guess</A>
<LI><A HREF="libtool.html#IDX95">config.sub</A>
<LI><A HREF="libtool.html#IDX71">configuring libtool</A>
<LI><A HREF="libtool.html#IDX43">convenience libraries</A>
<LI><A HREF="libtool.html#IDX83">CPPFLAGS</A>
</DIR>
<H2><A NAME="cindex_d">d</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX106">debugging libraries</A>
<LI><A HREF="libtool.html#IDX10">definition of libraries</A>
<LI><A HREF="libtool.html#IDX223">demo-conf.test</A>
<LI><A HREF="libtool.html#IDX224">demo-exec.test</A>
<LI><A HREF="libtool.html#IDX225">demo-inst.test</A>
<LI><A HREF="libtool.html#IDX226">demo-make.test</A>
<LI><A HREF="libtool.html#IDX230">demo-nofast.test</A>
<LI><A HREF="libtool.html#IDX232">demo-nopic.test</A>
<LI><A HREF="libtool.html#IDX231">demo-pic.test</A>
<LI><A HREF="libtool.html#IDX229">demo-shared.test</A>
<LI><A HREF="libtool.html#IDX228">demo-static.test</A>
<LI><A HREF="libtool.html#IDX227">demo-unst.test</A>
<LI><A HREF="libtool.html#IDX237">depdemo-conf.test</A>
<LI><A HREF="libtool.html#IDX238">depdemo-exec.test</A>
<LI><A HREF="libtool.html#IDX239">depdemo-inst.test</A>
<LI><A HREF="libtool.html#IDX240">depdemo-make.test</A>
<LI><A HREF="libtool.html#IDX244">depdemo-nofast.test</A>
<LI><A HREF="libtool.html#IDX243">depdemo-shared.test</A>
<LI><A HREF="libtool.html#IDX242">depdemo-static.test</A>
<LI><A HREF="libtool.html#IDX241">depdemo-unst.test</A>
<LI><A HREF="libtool.html#IDX131">dependencies between libraries</A>
<LI><A HREF="libtool.html#IDX116">dependency versioning</A>
<LI><A HREF="libtool.html#IDX233">deplibs.test</A>
<LI><A HREF="libtool.html#IDX266">deplibs_check_method</A>
<LI><A HREF="libtool.html#IDX6">design issues</A>
<LI><A HREF="libtool.html#IDX123">design of library interfaces</A>
<LI><A HREF="libtool.html#IDX2">design philosophy</A>
<LI><A HREF="libtool.html#IDX107">developing libraries</A>
<LI><A HREF="libtool.html#IDX135">dlclose</A>, <A HREF="libtool.html#IDX151">dlclose</A>
<LI><A HREF="libtool.html#IDX152">dlerror</A>
<LI><A HREF="libtool.html#IDX90">DLLTOOL</A>
<LI><A HREF="libtool.html#IDX133">dlopen</A>, <A HREF="libtool.html#IDX149">dlopen</A>
<LI><A HREF="libtool.html#IDX293">dlopen_self</A>
<LI><A HREF="libtool.html#IDX294">dlopen_self_static</A>
<LI><A HREF="libtool.html#IDX292">dlopen_support</A>
<LI><A HREF="libtool.html#IDX138">dlopening modules</A>, <A HREF="libtool.html#IDX155">dlopening modules</A>
<LI><A HREF="libtool.html#IDX146">dlopening, pitfalls</A>
<LI><A HREF="libtool.html#IDX134">dlsym</A>, <A HREF="libtool.html#IDX150">dlsym</A>
<LI><A HREF="libtool.html#IDX108">double-compilation, avoiding</A>
<LI><A HREF="libtool.html#IDX252">dryrun.test</A>
<LI><A HREF="libtool.html#IDX115">dynamic dependencies</A>
<LI><A HREF="libtool.html#IDX137">dynamic linking, applications</A>, <A HREF="libtool.html#IDX154">dynamic linking, applications</A>
<LI><A HREF="libtool.html#IDX144">dynamic modules, names</A>
</DIR>
<H2><A NAME="cindex_e">e</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX295">echo</A>
<LI><A HREF="libtool.html#IDX110">eliding shared libraries</A>
<LI><A HREF="libtool.html#IDX12">examples of using libtool</A>
<LI><A HREF="libtool.html#IDX296">exclude_expsyms</A>
<LI><A HREF="libtool.html#IDX57">execute mode</A>
<LI><A HREF="libtool.html#IDX297">export_dynamic_flag_spec</A>
<LI><A HREF="libtool.html#IDX298">export_symbols_cmds</A>
<LI><A HREF="libtool.html#IDX299">extract_expsyms_cmds</A>
</DIR>
<H2><A NAME="cindex_f">f</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX260">failed tests</A>
<LI><A HREF="libtool.html#IDX300">fast_install</A>
<LI><A HREF="libtool.html#IDX267">file_magic</A>
<LI><A HREF="libtool.html#IDX268">file_magic_cmd</A>
<LI><A HREF="libtool.html#IDX269">file_magic_test_file</A>
<LI><A HREF="libtool.html#IDX61">finish mode</A>
<LI><A HREF="libtool.html#IDX301">finish_cmds</A>
<LI><A HREF="libtool.html#IDX302">finish_eval</A>
<LI><A HREF="libtool.html#IDX303">fix_srcfile_path</A>
<LI><A HREF="libtool.html#IDX120">formal versioning</A>
</DIR>
<H2><A NAME="cindex_g">g</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX127">global functions</A>
<LI><A HREF="libtool.html#IDX304">global_symbol_pipe</A>
<LI><A HREF="libtool.html#IDX305">global_symbol_to_cdecl</A>
</DIR>
<H2><A NAME="cindex_h">h</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX234">hardcode.test</A>
<LI><A HREF="libtool.html#IDX306">hardcode_action</A>
<LI><A HREF="libtool.html#IDX307">hardcode_direct</A>
<LI><A HREF="libtool.html#IDX308">hardcode_into_libs</A>
<LI><A HREF="libtool.html#IDX309">hardcode_libdir_flag_spec</A>
<LI><A HREF="libtool.html#IDX310">hardcode_libdir_separator</A>
<LI><A HREF="libtool.html#IDX311">hardcode_minus_L</A>
<LI><A HREF="libtool.html#IDX312">hardcode_shlibpath_var</A>
<LI><A HREF="libtool.html#IDX126">header files</A>
<LI><A HREF="libtool.html#IDX313">host</A>
<LI><A HREF="libtool.html#IDX314">host_alias</A>
</DIR>
<H2><A NAME="cindex_i">i</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX274">implementation of libtool</A>
<LI><A HREF="libtool.html#IDX130">include files, portable</A>
<LI><A HREF="libtool.html#IDX315">include_expsyms</A>
<LI><A HREF="libtool.html#IDX36">install</A>
<LI><A HREF="libtool.html#IDX59">install mode</A>
<LI><A HREF="libtool.html#IDX40">installation, finishing</A>
<LI><A HREF="libtool.html#IDX132">inter-library dependencies</A>
<LI><A HREF="libtool.html#IDX265">inter-library dependency</A>
</DIR>
<H2><A NAME="cindex_l">l</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX208">languages, non-C</A>
<LI><A HREF="libtool.html#IDX84">LD</A>, <A HREF="libtool.html#IDX278">LD</A>
<LI><A HREF="libtool.html#IDX85">LDFLAGS</A>
<LI><A HREF="libtool.html#IDX316">libext</A>
<LI><A HREF="libtool.html#IDX148">libltdl</A>
<LI><A HREF="libtool.html#IDX317">libname_spec</A>
<LI><A HREF="libtool.html#IDX11">libraries, definition of</A>
<LI><A HREF="libtool.html#IDX41">libraries, finishing installation</A>
<LI><A HREF="libtool.html#IDX38">libraries, stripping</A>
<LI><A HREF="libtool.html#IDX118">library interfaces</A>
<LI><A HREF="libtool.html#IDX122">library interfaces, design</A>
<LI><A HREF="libtool.html#IDX18">library object file</A>
<LI><A HREF="libtool.html#IDX318">library_names_spec</A>
<LI><A HREF="libtool.html#IDX86">LIBS</A>
<LI><A HREF="libtool.html#IDX45">libtool</A>
<LI><A HREF="libtool.html#IDX46">libtool command options</A>
<LI><A HREF="libtool.html#IDX13">libtool examples</A>
<LI><A HREF="libtool.html#IDX275">libtool implementation</A>
<LI><A HREF="libtool.html#IDX23">libtool libraries</A>
<LI><A HREF="libtool.html#IDX119">libtool library versions</A>
<LI><A HREF="libtool.html#IDX4">libtool specifications</A>
<LI><A HREF="libtool.html#IDX97">libtoolize</A>
<LI><A HREF="libtool.html#IDX98">libtoolize command options</A>
<LI><A HREF="libtool.html#IDX51">link mode</A>
<LI><A HREF="libtool.html#IDX255">link-2.test</A>
<LI><A HREF="libtool.html#IDX254">link.test</A>
<LI><A HREF="libtool.html#IDX319">link_all_deplibs</A>
<LI><A HREF="libtool.html#IDX320">link_static_flag</A>
<LI><A HREF="libtool.html#IDX26">linking against installed libraries</A>
<LI><A HREF="libtool.html#IDX30">linking against uninstalled libraries</A>
<LI><A HREF="libtool.html#IDX31">linking with installed libtool libraries</A>
<LI><A HREF="libtool.html#IDX56">linking, partial</A>
<LI><A HREF="libtool.html#IDX89">LN_S</A>
<LI><A HREF="libtool.html#IDX205">lt_dladderror</A>
<LI><A HREF="libtool.html#IDX171">lt_dladdsearchdir</A>
<LI><A HREF="libtool.html#IDX190">lt_dlcaller_get_data</A>
<LI><A HREF="libtool.html#IDX187">lt_dlcaller_id</A>
<LI><A HREF="libtool.html#IDX188">lt_dlcaller_register</A>
<LI><A HREF="libtool.html#IDX189">lt_dlcaller_set_data</A>
<LI><A HREF="libtool.html#IDX165">lt_dlclose</A>
<LI><A HREF="libtool.html#IDX162">lt_dlexit</A>
<LI><A HREF="libtool.html#IDX185">lt_dlforeach</A>
<LI><A HREF="libtool.html#IDX177">lt_dlfree</A>
<LI><A HREF="libtool.html#IDX184">lt_dlgetinfo</A>
<LI><A HREF="libtool.html#IDX159">lt_dlhandle</A>
<LI><A HREF="libtool.html#IDX186">lt_dlhandle_next</A>
<LI><A HREF="libtool.html#IDX183">lt_dlinfo</A>
<LI><A HREF="libtool.html#IDX161">lt_dlinit</A>
<LI><A HREF="libtool.html#IDX175">lt_dlisresident</A>
<LI><A HREF="libtool.html#IDX192">lt_dlloader</A>
<LI><A HREF="libtool.html#IDX199">lt_dlloader_add</A>
<LI><A HREF="libtool.html#IDX193">lt_dlloader_data</A>
<LI><A HREF="libtool.html#IDX198">lt_dlloader_exit</A>
<LI><A HREF="libtool.html#IDX200">lt_dlloader_remove</A>
<LI><A HREF="libtool.html#IDX174">lt_dlmakeresident</A>
<LI><A HREF="libtool.html#IDX176">lt_dlmalloc</A>
<LI><A HREF="libtool.html#IDX181">lt_dlmutex_geterror</A>
<LI><A HREF="libtool.html#IDX178">lt_dlmutex_lock</A>
<LI><A HREF="libtool.html#IDX182">lt_dlmutex_register</A>
<LI><A HREF="libtool.html#IDX180">lt_dlmutex_seterror</A>
<LI><A HREF="libtool.html#IDX179">lt_dlmutex_unlock</A>
<LI><A HREF="libtool.html#IDX163">lt_dlopen</A>
<LI><A HREF="libtool.html#IDX164">lt_dlopenext</A>
<LI><A HREF="libtool.html#IDX168">lt_dlpreload</A>
<LI><A HREF="libtool.html#IDX169">lt_dlpreload_default</A>
<LI><A HREF="libtool.html#IDX206">lt_dlseterror</A>
<LI><A HREF="libtool.html#IDX172">lt_dlsetsearchpath</A>
<LI><A HREF="libtool.html#IDX166">lt_dlsym</A>
<LI><A HREF="libtool.html#IDX141">lt_dlsymlist</A>, <A HREF="libtool.html#IDX160">lt_dlsymlist</A>
<LI><A HREF="libtool.html#IDX197">lt_find_sym</A>
<LI><A HREF="libtool.html#IDX191">lt_module</A>
<LI><A HREF="libtool.html#IDX196">lt_module_close</A>
<LI><A HREF="libtool.html#IDX195">lt_module_open</A>
<LI><A HREF="libtool.html#IDX142">lt_preloaded_symbols</A>
<LI><A HREF="libtool.html#IDX158">lt_ptr</A>
<LI><A HREF="libtool.html#IDX194">lt_user_dlloader</A>
<LI><A HREF="libtool.html#IDX102">LTALLOCA</A>
<LI><A HREF="libtool.html#IDX170">LTDL_SET_PRELOADED_SYMBOLS()</A>
<LI><A HREF="libtool.html#IDX104">LTLIBOBJS</A>
<LI><A HREF="libtool.html#IDX70">LTLIBRARIES</A>
<LI><A HREF="libtool.html#IDX96">ltmain.sh</A>
</DIR>
<H2><A NAME="cindex_m">m</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX67">Makefile</A>
<LI><A HREF="libtool.html#IDX68">Makefile.am</A>
<LI><A HREF="libtool.html#IDX69">Makefile.in</A>
<LI><A HREF="libtool.html#IDX245">mdemo-conf.test</A>
<LI><A HREF="libtool.html#IDX246">mdemo-exec.test</A>
<LI><A HREF="libtool.html#IDX247">mdemo-inst.test</A>
<LI><A HREF="libtool.html#IDX248">mdemo-make.test</A>
<LI><A HREF="libtool.html#IDX251">mdemo-shared.test</A>
<LI><A HREF="libtool.html#IDX250">mdemo-static.test</A>
<LI><A HREF="libtool.html#IDX249">mdemo-unst.test</A>
<LI><A HREF="libtool.html#IDX66">mode, clean</A>
<LI><A HREF="libtool.html#IDX49">mode, compile</A>
<LI><A HREF="libtool.html#IDX58">mode, execute</A>
<LI><A HREF="libtool.html#IDX62">mode, finish</A>
<LI><A HREF="libtool.html#IDX60">mode, install</A>
<LI><A HREF="libtool.html#IDX52">mode, link</A>
<LI><A HREF="libtool.html#IDX64">mode, uninstall</A>
<LI><A HREF="libtool.html#IDX139">modules, dynamic</A>, <A HREF="libtool.html#IDX156">modules, dynamic</A>
<LI><A HREF="libtool.html#IDX1">motivation for writing libtool</A>
</DIR>
<H2><A NAME="cindex_n">n</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX143">names of dynamic modules</A>
<LI><A HREF="libtool.html#IDX321">need_lib_prefix</A>
<LI><A HREF="libtool.html#IDX323">need_locks</A>
<LI><A HREF="libtool.html#IDX322">need_version</A>
<LI><A HREF="libtool.html#IDX87">NM</A>, <A HREF="libtool.html#IDX279">NM</A>
<LI><A HREF="libtool.html#IDX324">no_builtin_flag</A>
<LI><A HREF="libtool.html#IDX325">no_undefined_flag</A>
<LI><A HREF="libtool.html#IDX236">noinst-link.test</A>
<LI><A HREF="libtool.html#IDX256">nomode.test</A>
<LI><A HREF="libtool.html#IDX272">none</A>
</DIR>
<H2><A NAME="cindex_o">o</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX326">objdir</A>
<LI><A HREF="libtool.html#IDX91">OBJDUMP</A>
<LI><A HREF="libtool.html#IDX15">object files, compiling</A>
<LI><A HREF="libtool.html#IDX20">object files, library</A>
<LI><A HREF="libtool.html#IDX327">objext</A>
<LI><A HREF="libtool.html#IDX285">old_archive_cmds</A>
<LI><A HREF="libtool.html#IDX287">old_archive_from_expsyms_cmds</A>
<LI><A HREF="libtool.html#IDX286">old_archive_from_new_cmds</A>
<LI><A HREF="libtool.html#IDX330">old_postinstall_cmds</A>
<LI><A HREF="libtool.html#IDX332">old_postuninstall_cmds</A>
<LI><A HREF="libtool.html#IDX340">old_striplib</A>
<LI><A HREF="libtool.html#IDX125">opaque data types</A>
<LI><A HREF="libtool.html#IDX47">options, libtool command</A>
<LI><A HREF="libtool.html#IDX100">options, libtoolize command</A>
<LI><A HREF="libtool.html#IDX7">other implementations, flaws in</A>
</DIR>
<H2><A NAME="cindex_p">p</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX55">partial linking</A>
<LI><A HREF="libtool.html#IDX271">pass_all</A>
<LI><A HREF="libtool.html#IDX17">PIC (position-independent code)</A>
<LI><A HREF="libtool.html#IDX328">pic_flag</A>
<LI><A HREF="libtool.html#IDX211">pitfalls using C++</A>
<LI><A HREF="libtool.html#IDX145">pitfalls with dlopen</A>
<LI><A HREF="libtool.html#IDX128">portable C headers</A>
<LI><A HREF="libtool.html#IDX16">position-independent code</A>
<LI><A HREF="libtool.html#IDX329">postinstall_cmds</A>
<LI><A HREF="libtool.html#IDX39">postinstallation</A>
<LI><A HREF="libtool.html#IDX331">postuninstall_cmds</A>
<LI><A HREF="libtool.html#IDX264">problem reports</A>
<LI><A HREF="libtool.html#IDX216">problems, blaming somebody else for</A>
<LI><A HREF="libtool.html#IDX214">problems, solving</A>
<LI><A HREF="libtool.html#IDX33">program wrapper scripts</A>
</DIR>
<H2><A NAME="cindex_q">q</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX257">quote.test</A>
</DIR>
<H2><A NAME="cindex_r">r</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX88">RANLIB</A>, <A HREF="libtool.html#IDX280">RANLIB</A>
<LI><A HREF="libtool.html#IDX22">ranlib</A>
<LI><A HREF="libtool.html#IDX333">reload_cmds</A>
<LI><A HREF="libtool.html#IDX334">reload_flag</A>
<LI><A HREF="libtool.html#IDX124">renaming interface functions</A>
<LI><A HREF="libtool.html#IDX263">reporting bugs</A>
<LI><A HREF="libtool.html#IDX8">reusability of library systems</A>
<LI><A HREF="libtool.html#IDX335">runpath_var</A>
</DIR>
<H2><A NAME="cindex_s">s</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX114">saving time</A>
<LI><A HREF="libtool.html#IDX28">security problems with buggy linkers</A>
<LI><A HREF="libtool.html#IDX258">sh.test</A>
<LI><A HREF="libtool.html#IDX112">shared libraries, not using</A>
<LI><A HREF="libtool.html#IDX117">shared library versions</A>
<LI><A HREF="libtool.html#IDX136">shl_load</A>, <A HREF="libtool.html#IDX153">shl_load</A>
<LI><A HREF="libtool.html#IDX336">shlibpath_overrides_runpath</A>
<LI><A HREF="libtool.html#IDX337">shlibpath_var</A>
<LI><A HREF="libtool.html#IDX215">solving problems</A>
<LI><A HREF="libtool.html#IDX338">soname_spec</A>
<LI><A HREF="libtool.html#IDX3">specifications for libtool</A>
<LI><A HREF="libtool.html#IDX44">standalone binaries</A>
<LI><A HREF="libtool.html#IDX42">static linking</A>
<LI><A HREF="libtool.html#IDX34">strip</A>
<LI><A HREF="libtool.html#IDX339">striplib</A>
<LI><A HREF="libtool.html#IDX37">stripping libraries</A>
<LI><A HREF="libtool.html#IDX35">su</A>
<LI><A HREF="libtool.html#IDX259">suffix.test</A>
<LI><A HREF="libtool.html#IDX341">sys_lib_dlsearch_path_spec</A>
<LI><A HREF="libtool.html#IDX342">sys_lib_search_path_spec</A>
</DIR>
<H2><A NAME="cindex_t">t</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX217">test suite</A>
<LI><A HREF="libtool.html#IDX270">test_compile</A>
<LI><A HREF="libtool.html#IDX261">tests, failed</A>
<LI><A HREF="libtool.html#IDX343">thread_safe_flag_spec</A>
<LI><A HREF="libtool.html#IDX113">time, saving</A>
<LI><A HREF="libtool.html#IDX5">tricky design issues</A>
<LI><A HREF="libtool.html#IDX210">trouble with C++</A>
<LI><A HREF="libtool.html#IDX147">trouble with dlopen</A>
<LI><A HREF="libtool.html#IDX213">troubleshooting</A>
</DIR>
<H2><A NAME="cindex_u">u</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX53">undefined symbols, allowing</A>
<LI><A HREF="libtool.html#IDX63">uninstall mode</A>
<LI><A HREF="libtool.html#IDX273">unknown</A>
<LI><A HREF="libtool.html#IDX54">unresolved symbols, allowing</A>
<LI><A HREF="libtool.html#IDX111">using shared libraries, not</A>
</DIR>
<H2><A NAME="cindex_v">v</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX344">version_type</A>
<LI><A HREF="libtool.html#IDX121">versioning, formal</A>
</DIR>
<H2><A NAME="cindex_w">w</A></H2>
<DIR>
<LI><A HREF="libtool.html#IDX345">whole_archive_flag_spec</A>
<LI><A HREF="libtool.html#IDX346">wl</A>
<LI><A HREF="libtool.html#IDX32">wrapper scripts for programs</A>
</DIR>
<P><HR><P>
This document was generated on 10 July 2002 using
<A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A> 1.56k.
</BODY>
</HTML>