Build libtool from source.
[msysgit.git] / share / info / libtool.info
bloba765b6f5e892bafcf8e2d5421aa85c17b98bce3d
1 This is libtool.info, produced by makeinfo version 4.8 from
2 libtool.texi.
4 INFO-DIR-SECTION GNU programming tools
5 START-INFO-DIR-ENTRY
6 * Libtool: (libtool).           Generic shared library support script.
7 END-INFO-DIR-ENTRY
9 INFO-DIR-SECTION Individual utilities
10 START-INFO-DIR-ENTRY
11 * libtoolize: (libtool)Invoking libtoolize.     Adding libtool support.
12 END-INFO-DIR-ENTRY
14    This file documents GNU Libtool 1.5.24
16    Copyright (C) 1996-2003, 2005-2007 Free Software Foundation, Inc.
18    Permission is granted to copy, distribute and/or modify this document
19 under the terms of the GNU Free Documentation License, Version 1.1 or
20 any later version published by the Free Software Foundation; with no
21 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
22 Texts.  A copy of the license is included in the section entitled "GNU
23 Free Documentation License".
25 \x1f
26 File: libtool.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
28 Shared library support for GNU
29 ******************************
31 This file documents GNU Libtool, a script that allows package developers
32 to provide generic shared library support.  This edition documents
33 version 1.5.24.
35    *Note Reporting bugs::, for information on how to report problems
36 with libtool.
38 * Menu:
40 * Introduction::                What the heck is libtool?
41 * Libtool paradigm::            How libtool's view of libraries is different.
42 * Using libtool::               Example of using libtool to build libraries.
43 * Invoking libtool::            Running the `libtool' script.
44 * Integrating libtool::         Using libtool in your own packages.
45 * Versioning::                  Using library interface versions.
46 * Library tips::                Tips for library interface design.
47 * Inter-library dependencies::  Libraries that depend on other libraries.
48 * Dlopened modules::            `dlopen'ing libtool-created libraries.
49 * Using libltdl::               Libtool's portable `dlopen' wrapper library.
50 * Other languages::             Using libtool without a C compiler.
51 * Troubleshooting::             When libtool doesn't work as advertised.
52 * Maintaining::                 Information used by the libtool maintainer.
53 * GNU Free Documentation License:: License for this manual.
54 * Index::                       Full index.
57 Introduction
59 * Motivation::                  Why does GNU need a libtool?
60 * Issues::                      The problems that need to be addressed.
61 * Other implementations::       How other people have solved these issues.
62 * Postmortem::                  Learning from past difficulties.
64 Using libtool
66 * Creating object files::       Compiling object files for libraries.
67 * Linking libraries::           Creating libraries from object files.
68 * Linking executables::         Linking object files against libtool libraries.
69 * Debugging executables::       Running GDB on libtool-generated programs.
70 * Installing libraries::        Making libraries available to users.
71 * Installing executables::      Making programs available to users.
72 * Static libraries::            When shared libraries are not wanted.
74 Invoking `libtool'
76 * Compile mode::                Creating library object files.
77 * Link mode::                   Generating executables and libraries.
78 * Execute mode::                Debugging libtool-generated programs.
79 * Install mode::                Making libraries and executables public.
80 * Finish mode::                 Completing a library installation.
81 * Uninstall mode::              Removing installed executables and libraries.
82 * Clean mode::                  Removing uninstalled executables and libraries.
84 Integrating libtool with your package
86 * Makefile rules::              Writing `Makefile' rules for libtool.
87 * Using Automake::              Automatically supporting libtool.
88 * Configuring::                 Configuring libtool for a host system.
89 * Distributing::                What files to distribute with your package.
90 * Static-only libraries::       Sometimes shared libraries are just a pain.
92 Configuring libtool
94 * AC_PROG_LIBTOOL::             Configuring `libtool' in `configure.in'.
96 Including libtool in your package
98 * Invoking libtoolize::         `libtoolize' command line options.
99 * Autoconf .o macros::          Autoconf macros that set object file names.
101 Library interface versions
103 * Interfaces::                  What are library interfaces?
104 * Libtool versioning::          Libtool's versioning system.
105 * Updating version info::       Changing version information before releases.
106 * Release numbers::             Breaking binary compatibility for aesthetics.
108 Tips for interface design
110 * C header files::              How to write portable include files.
112 Dlopened modules
114 * Building modules::            Creating dlopenable objects and libraries.
115 * Dlpreopening::                Dlopening that works on static platforms.
116 * Finding the dlname::          Choosing the right file to `dlopen'.
117 * Dlopen issues::               Unresolved problems that need your attention.
119 Using libltdl
121 * Libltdl interface::           How to use libltdl in your programs.
122 * Modules for libltdl::         Creating modules that can be `dlopen'ed.
123 * Thread Safety in libltdl::    Registering callbacks for multi-thread safety.
124 * User defined module data::    Associating data with loaded modules.
125 * Module loaders for libltdl::  Creating user defined module loaders.
126 * Distributing libltdl::        How to distribute libltdl with your package.
128 Using libtool with other languages
130 * C++ libraries::               Writing libraries for C++
131 * Tags::                        Tags
133 Troubleshooting
135 * Libtool test suite::          Libtool's self-tests.
136 * Reporting bugs::              How to report problems with libtool.
138 The libtool test suite
140 * Test descriptions::           The contents of the test suite.
141 * When tests fail::             What to do when a test fails.
143 Maintenance notes for libtool
145 * New ports::                   How to port libtool to new systems.
146 * Tested platforms::            When libtool was last tested.
147 * Platform quirks::             Information about different library systems.
148 * libtool script contents::     Configuration information that libtool uses.
149 * Cheap tricks::                Making libtool maintainership easier.
151 Porting libtool to new systems
153 * Information sources::         Where to find relevant documentation
154 * Porting inter-library dependencies::  Implementation details explained
156 Platform quirks
158 * References::                  Finding more information.
159 * Compilers::                   Creating object files from source files.
160 * Reloadable objects::          Binding object files together.
161 * Multiple dependencies::       Removing duplicate dependent libraries.
162 * Archivers::                   Programs that create static archives.
164 \x1f
165 File: libtool.info,  Node: Introduction,  Next: Libtool paradigm,  Prev: Top,  Up: Top
167 1 Introduction
168 **************
170 In the past, if a source code package developer wanted to take advantage
171 of the power of shared libraries, he needed to write custom support code
172 for each platform on which his package ran.  He also had to design a
173 configuration interface so that the package installer could choose what
174 sort of libraries were built.
176    GNU Libtool simplifies the developer's job by encapsulating both the
177 platform-specific dependencies, and the user interface, in a single
178 script.  GNU Libtool is designed so that the complete functionality of
179 each host type is available via a generic interface, but nasty quirks
180 are hidden from the programmer.
182    GNU Libtool's consistent interface is reassuring... users don't need
183 to read obscure documentation in order to have their favorite source
184 package build shared libraries.  They just run your package `configure'
185 script (or equivalent), and libtool does all the dirty work.
187    There are several examples throughout this document.  All assume the
188 same environment: we want to build a library, `libhello', in a generic
189 way.
191    `libhello' could be a shared library, a static library, or both...
192 whatever is available on the host system, as long as libtool has been
193 ported to it.
195    This chapter explains the original design philosophy of libtool.
196 Feel free to skip to the next chapter, unless you are interested in
197 history, or want to write code to extend libtool in a consistent way.
199 * Menu:
201 * Motivation::                  Why does GNU need a libtool?
202 * Issues::                      The problems that need to be addressed.
203 * Other implementations::       How other people have solved these issues.
204 * Postmortem::                  Learning from past difficulties.
206 \x1f
207 File: libtool.info,  Node: Motivation,  Next: Issues,  Up: Introduction
209 1.1 Motivation for writing libtool
210 ==================================
212 Since early 1995, several different GNU developers have recognized the
213 importance of having shared library support for their packages.  The
214 primary motivation for such a change is to encourage modularity and
215 reuse of code (both conceptually and physically) in GNU programs.
217    Such a demand means that the way libraries are built in GNU packages
218 needs to be general, to allow for any library type the package installer
219 might want.  The problem is compounded by the absence of a standard
220 procedure for creating shared libraries on different platforms.
222    The following sections outline the major issues facing shared library
223 support in GNU, and how shared library support could be standardized
224 with libtool.
226    The following specifications were used in developing and evaluating
227 this system:
229   1. The system must be as elegant as possible.
231   2. The system must be fully integrated with the GNU Autoconf and
232      Automake utilities, so that it will be easy for GNU maintainers to
233      use.  However, the system must not require these tools, so that it
234      can be used by non-GNU packages.
236   3. Portability to other (non-GNU) architectures and tools is
237      desirable.
239 \x1f
240 File: libtool.info,  Node: Issues,  Next: Other implementations,  Prev: Motivation,  Up: Introduction
242 1.2 Implementation issues
243 =========================
245 The following issues need to be addressed in any reusable shared library
246 system, specifically libtool:
248   1. The package installer should be able to control what sort of
249      libraries are built.
251   2. It can be tricky to run dynamically linked programs whose
252      libraries have not yet been installed.  `LD_LIBRARY_PATH' must be
253      set properly (if it is supported), or programs fail to run.
255   3. The system must operate consistently even on hosts which don't
256      support shared libraries.
258   4. The commands required to build shared libraries may differ wildly
259      from host to host.  These need to be determined at configure time
260      in a consistent way.
262   5. It is not always obvious with which suffix a shared library should
263      be installed.  This makes it difficult for `Makefile' rules, since
264      they generally assume that file names are the same from host to
265      host.
267   6. The system needs a simple library version number abstraction, so
268      that shared libraries can be upgraded in place.  The programmer
269      should be informed how to design the interfaces to the library to
270      maximize binary compatibility.
272   7. The install `Makefile' target should warn the package installer to
273      set the proper environment variables (`LD_LIBRARY_PATH' or
274      equivalent), or run `ldconfig'.
276 \x1f
277 File: libtool.info,  Node: Other implementations,  Next: Postmortem,  Prev: Issues,  Up: Introduction
279 1.3 Other implementations
280 =========================
282 Even before libtool was developed, many free software packages built and
283 installed their own shared libraries.  At first, these packages were
284 examined to avoid reinventing existing features.
286    Now it is clear that none of these packages have documented the
287 details of shared library systems that libtool requires.  So, other
288 packages have been more or less abandoned as influences.
290 \x1f
291 File: libtool.info,  Node: Postmortem,  Prev: Other implementations,  Up: Introduction
293 1.4 A postmortem analysis of other implementations
294 ==================================================
296 In all fairness, each of the implementations that were examined do the
297 job that they were intended to do, for a number of different host
298 systems.  However, none of these solutions seem to function well as a
299 generalized, reusable component.
301    Most were too complex to use (much less modify) without understanding
302 exactly what the implementation does, and they were generally not
303 documented.
305    The main difficulty is that different vendors have different views of
306 what libraries are, and none of the packages which were examined seemed
307 to be confident enough to settle on a single paradigm that just _works_.
309    Ideally, libtool would be a standard that would be implemented as
310 series of extensions and modifications to existing library systems to
311 make them work consistently.  However, it is not an easy task to
312 convince operating system developers to mend their evil ways, and
313 people want to build shared libraries right now, even on buggy, broken,
314 confused operating systems.
316    For this reason, libtool was designed as an independent shell script.
317 It isolates the problems and inconsistencies in library building that
318 plague `Makefile' writers by wrapping the compiler suite on different
319 platforms with a consistent, powerful interface.
321    With luck, libtool will be useful to and used by the GNU community,
322 and that the lessons that were learned in writing it will be taken up by
323 designers of future library systems.
325 \x1f
326 File: libtool.info,  Node: Libtool paradigm,  Next: Using libtool,  Prev: Introduction,  Up: Top
328 2 The libtool paradigm
329 **********************
331 At first, libtool was designed to support an arbitrary number of library
332 object types.  After libtool was ported to more platforms, a new
333 paradigm gradually developed for describing the relationship between
334 libraries and programs.
336    In summary, "libraries are programs with multiple entry points, and
337 more formally defined interfaces."
339    Version 0.7 of libtool was a complete redesign and rewrite of
340 libtool to reflect this new paradigm.  So far, it has proved to be
341 successful: libtool is simpler and more useful than before.
343    The best way to introduce the libtool paradigm is to contrast it with
344 the paradigm of existing library systems, with examples from each.  It
345 is a new way of thinking, so it may take a little time to absorb, but
346 when you understand it, the world becomes simpler.
348 \x1f
349 File: libtool.info,  Node: Using libtool,  Next: Invoking libtool,  Prev: Libtool paradigm,  Up: Top
351 3 Using libtool
352 ***************
354 It makes little sense to talk about using libtool in your own packages
355 until you have seen how it makes your life simpler.  The examples in
356 this chapter introduce the main features of libtool by comparing the
357 standard library building procedure to libtool's operation on two
358 different platforms:
360 `a23'
361      An Ultrix 4.2 platform with only static libraries.
363 `burger'
364      A NetBSD/i386 1.2 platform with shared libraries.
366    You can follow these examples on your own platform, using the
367 preconfigured libtool script that was installed with libtool (*note
368 Configuring::).
370    Source files for the following examples are taken from the `demo'
371 subdirectory of the libtool distribution.  Assume that we are building a
372 library, `libhello', out of the files `foo.c' and `hello.c'.
374    Note that the `foo.c' source file uses the `cos' math library
375 function, which is usually found in the standalone math library, and not
376 the C library (*note Trigonometric Functions: (libc)Trig Functions.).
377 So, we need to add `-lm' to the end of the link line whenever we link
378 `foo.o' or `foo.lo' into an executable or a library (*note
379 Inter-library dependencies::).
381    The same rule applies whenever you use functions that don't appear in
382 the standard C library... you need to add the appropriate `-lNAME' flag
383 to the end of the link line when you link against those objects.
385    After we have built that library, we want to create a program by
386 linking `main.o' against `libhello'.
388 * Menu:
390 * Creating object files::       Compiling object files for libraries.
391 * Linking libraries::           Creating libraries from object files.
392 * Linking executables::         Linking object files against libtool libraries.
393 * Debugging executables::       Running GDB on libtool-generated programs.
394 * Installing libraries::        Making libraries available to users.
395 * Installing executables::      Making programs available to users.
396 * Static libraries::            When shared libraries are not wanted.
398 \x1f
399 File: libtool.info,  Node: Creating object files,  Next: Linking libraries,  Up: Using libtool
401 3.1 Creating object files
402 =========================
404 To create an object file from a source file, the compiler is invoked
405 with the `-c' flag (and any other desired flags):
407      burger$ gcc -g -O -c main.c
408      burger$
410    The above compiler command produces an object file, `main.o', from
411 the source file `main.c'.
413    For most library systems, creating object files that become part of a
414 static library is as simple as creating object files that are linked to
415 form an executable:
417      burger$ gcc -g -O -c foo.c
418      burger$ gcc -g -O -c hello.c
419      burger$
421    Shared libraries, however, may only be built from
422 "position-independent code" (PIC).  So, special flags must be passed to
423 the compiler to tell it to generate PIC rather than the standard
424 position-dependent code.
426    Since this is a library implementation detail, libtool hides the
427 complexity of PIC compiler flags by using separate library object files
428 (which end in `.lo' instead of `.o').  On systems without shared
429 libraries (or without special PIC compiler flags), these library object
430 files are identical to "standard" object files.
432    To create library object files for `foo.c' and `hello.c', simply
433 invoke libtool with the standard compilation command as arguments
434 (*note Compile mode::):
436      a23$ libtool --mode=compile gcc -g -O -c foo.c
437      gcc -g -O -c foo.c
438      echo timestamp > foo.lo
439      a23$ libtool --mode=compile gcc -g -O -c hello.c
440      gcc -g -O -c hello.c
441      echo timestamp > hello.lo
442      a23$
444    Note that libtool creates two files for each invocation.  The `.lo'
445 file is a library object, which may be built into a shared library, and
446 the `.o' file is a standard object file.  On `a23', the library objects
447 are just timestamps, because only static libraries are supported.
449    On shared library systems, libtool automatically inserts the PIC
450 generation flags into the compilation command, so that the library
451 object and the standard object differ:
453      burger$ libtool --mode=compile gcc -g -O -c foo.c
454      gcc -g -O -c -fPIC -DPIC foo.c
455      mv -f foo.o foo.lo
456      gcc -g -O -c foo.c >/dev/null 2>&1
457      burger$ libtool --mode=compile gcc -g -O -c hello.c
458      gcc -g -O -c -fPIC -DPIC hello.c
459      mv -f hello.o hello.lo
460      gcc -g -O -c hello.c >/dev/null 2>&1
461      burger$
463    Notice that the second run of GCC has its output discarded.  This is
464 done so that compiler warnings aren't annoyingly duplicated.
466 \x1f
467 File: libtool.info,  Node: Linking libraries,  Next: Linking executables,  Prev: Creating object files,  Up: Using libtool
469 3.2 Linking libraries
470 =====================
472 Without libtool, the programmer would invoke the `ar' command to create
473 a static library:
475      burger$ ar cru libhello.a hello.o foo.o
476      burger$
478    But of course, that would be too simple, so many systems require that
479 you run the `ranlib' command on the resulting library (to give it
480 better karma, or something):
482      burger$ ranlib libhello.a
483      burger$
485    It seems more natural to use the C compiler for this task, given
486 libtool's "libraries are programs" approach.  So, on platforms without
487 shared libraries, libtool simply acts as a wrapper for the system `ar'
488 (and possibly `ranlib') commands.
490    Again, the libtool library name differs from the standard name (it
491 has a `.la' suffix instead of a `.a' suffix).  The arguments to libtool
492 are the same ones you would use to produce an executable named
493 `libhello.la' with your compiler (*note Link mode::):
495      a23$ libtool --mode=link gcc -g -O -o libhello.la foo.o hello.o
496      libtool: cannot build libtool library `libhello.la' from non-libtool \
497                      objects
498      a23$
500    Aha!  Libtool caught a common error... trying to build a library
501 from standard objects instead of library objects.  This doesn't matter
502 for static libraries, but on shared library systems, it is of great
503 importance.
505    So, let's try again, this time with the library object files.
506 Remember also that we need to add `-lm' to the link command line because
507 `foo.c' uses the `cos' math library function (*note Using libtool::).
509    Another complication in building shared libraries is that we need to
510 specify the path to the directory in which they (eventually) will be
511 installed (in this case, `/usr/local/lib')(1):
513      a23$ libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
514                      -rpath /usr/local/lib -lm
515      mkdir .libs
516      ar cru .libs/libhello.a foo.o hello.o
517      ranlib .libs/libhello.a
518      creating libhello.la
519      a23$
521    Now, let's try the same trick on the shared library platform:
523      burger$ libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
524                      -rpath /usr/local/lib -lm
525      mkdir .libs
526      ld -Bshareable -o .libs/libhello.so.0.0 foo.lo hello.lo -lm
527      ar cru .libs/libhello.a foo.o hello.o
528      ranlib .libs/libhello.a
529      creating libhello.la
530      burger$
532    Now that's significantly cooler... libtool just ran an obscure `ld'
533 command to create a shared library, as well as the static library.
535    Note how libtool creates extra files in the `.libs' subdirectory,
536 rather than the current directory.  This feature is to make it easier
537 to clean up the build directory, and to help ensure that other programs
538 fail horribly if you accidentally forget to use libtool when you should.
540    ---------- Footnotes ----------
542    (1) If you don't specify an `rpath', then libtool builds a libtool
543 convenience archive, not a shared library (*note Static libraries::).
545 \x1f
546 File: libtool.info,  Node: Linking executables,  Next: Debugging executables,  Prev: Linking libraries,  Up: Using libtool
548 3.3 Linking executables
549 =======================
551 If you choose at this point to "install" the library (put it in a
552 permanent location) before linking executables against it, then you
553 don't need to use libtool to do the linking.  Simply use the appropriate
554 `-L' and `-l' flags to specify the library's location.
556    Some system linkers insist on encoding the full directory name of
557 each shared library in the resulting executable.  Libtool has to work
558 around this misfeature by special magic to ensure that only permanent
559 directory names are put into installed executables.
561    The importance of this bug must not be overlooked: it won't cause
562 programs to crash in obvious ways.  It creates a security hole, and
563 possibly even worse, if you are modifying the library source code after
564 you have installed the package, you will change the behaviour of the
565 installed programs!
567    So, if you want to link programs against the library before you
568 install it, you must use libtool to do the linking.
570    Here's the old way of linking against an uninstalled library:
572      burger$ gcc -g -O -o hell.old main.o libhello.a -lm
573      burger$
575    Libtool's way is almost the same(1) (*note Link mode::):
577      a23$ libtool --mode=link gcc -g -O -o hell main.o libhello.la -lm
578      gcc -g -O -o hell main.o ./.libs/libhello.a -lm
579      a23$
581    That looks too simple to be true.  All libtool did was transform
582 `libhello.la' to `./.libs/libhello.a', but remember that `a23' has no
583 shared libraries.
585    On `burger' the situation is different:
587      burger$ libtool --mode=link gcc -g -O -o hell main.o libhello.la -lm
588      gcc -g -O -o .libs/hell main.o -L./.libs -R/usr/local/lib -lhello -lm
589      creating hell
590      burger$
592    Now assume `libhello.la' had already been installed, and you want to
593 link a new program with it.  You could figure out where it lives by
594 yourself, then run:
596      burger$ gcc -g -O -o test test.o -L/usr/local/lib -lhello
598    However, unless `/usr/local/lib' is in the standard library search
599 path, you won't be able to run `test'.  However, if you use libtool to
600 link the already-installed libtool library, it will do The Right Thing
601 (TM) for you:
603      burger$ libtool --mode=link gcc -g -O -o test \
604                      test.o /usr/local/lib/libhello.la
605      gcc -g -O -o .libs/test test.o -Wl,--rpath
606      -Wl,/usr/local/lib /usr/local/lib/libhello.a -lm
607      creating test
608      burger$
610    Note that libtool added the necessary run-time path flag, as well as
611 `-lm', the library libhello.la depended upon.  Nice, huh?
613    Since libtool created a wrapper script, you should use libtool to
614 install it and debug it too.  However, since the program does not depend
615 on any uninstalled libtool library, it is probably usable even without
616 the wrapper script.  Libtool could probably be made smarter to avoid the
617 creation of the wrapper script in this case, but this is left as an
618 exercise for the reader.
620    Notice that the executable, `hell', was actually created in the
621 `.libs' subdirectory.  Then, a wrapper script was created in the
622 current directory.
624    On NetBSD 1.2, libtool encodes the installation directory of
625 `libhello', by using the `-R/usr/local/lib' compiler flag.  Then, the
626 wrapper script guarantees that the executable finds the correct shared
627 library (the one in `./.libs') until it is properly installed.
629    Let's compare the two different programs:
631      burger$ time ./hell.old
632      Welcome to GNU Hell!
633      ** This is not GNU Hello.  There is no built-in mail reader. **
634              0.21 real         0.02 user         0.08 sys
635      burger$ time ./hell
636      Welcome to GNU Hell!
637      ** This is not GNU Hello.  There is no built-in mail reader. **
638              0.63 real         0.09 user         0.59 sys
639      burger$
641    The wrapper script takes significantly longer to execute, but at
642 least the results are correct, even though the shared library hasn't
643 been installed yet.
645    So, what about all the space savings that shared libraries are
646 supposed to yield?
648      burger$ ls -l hell.old libhello.a
649      -rwxr-xr-x  1 gord  gord  15481 Nov 14 12:11 hell.old
650      -rw-r--r--  1 gord  gord   4274 Nov 13 18:02 libhello.a
651      burger$ ls -l .libs/hell .libs/libhello.*
652      -rwxr-xr-x  1 gord  gord  11647 Nov 14 12:10 .libs/hell
653      -rw-r--r--  1 gord  gord   4274 Nov 13 18:44 .libs/libhello.a
654      -rwxr-xr-x  1 gord  gord  12205 Nov 13 18:44 .libs/libhello.so.0.0
655      burger$
657    Well, that sucks.  Maybe I should just scrap this project and take up
658 basket weaving.
660    Actually, it just proves an important point: shared libraries incur
661 overhead because of their (relative) complexity.  In this situation, the
662 price of being dynamic is eight kilobytes, and the payoff is about four
663 kilobytes.  So, having a shared `libhello' won't be an advantage until
664 we link it against at least a few more programs.
666    ---------- Footnotes ----------
668    (1) However, you should avoid using `-L' or `-l' flags to link
669 against an uninstalled libtool library.  Just specify the relative path
670 to the `.la' file, such as `../intl/libintl.la'.  This is a design
671 decision to eliminate any ambiguity when linking against uninstalled
672 shared libraries.
674 \x1f
675 File: libtool.info,  Node: Debugging executables,  Next: Installing libraries,  Prev: Linking executables,  Up: Using libtool
677 3.4 Debugging executables
678 =========================
680 If `hell' was a complicated program, you would certainly want to test
681 and debug it before installing it on your system.  In the above
682 section, you saw how the libtool wrapper script makes it possible to run
683 the program directly, but unfortunately, this mechanism interferes with
684 the debugger:
686      burger$ gdb hell
687      GDB is free software and you are welcome to distribute copies of it
688       under certain conditions; type "show copying" to see the conditions.
689      There is no warranty for GDB; type "show warranty" for details.
690      GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
692      "hell": not in executable format: File format not recognized
694      (gdb) quit
695      burger$
697    Sad.  It doesn't work because GDB doesn't know where the executable
698 lives.  So, let's try again, by invoking GDB directly on the executable:
700      burger$ gdb .libs/hell
701      trick:/home/src/libtool/demo$ gdb .libs/hell
702      GDB is free software and you are welcome to distribute copies of it
703       under certain conditions; type "show copying" to see the conditions.
704      There is no warranty for GDB; type "show warranty" for details.
705      GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
706      (gdb) break main
707      Breakpoint 1 at 0x8048547: file main.c, line 29.
708      (gdb) run
709      Starting program: /home/src/libtool/demo/.libs/hell
710      /home/src/libtool/demo/.libs/hell: can't load library 'libhello.so.2'
712      Program exited with code 020.
713      (gdb) quit
714      burger$
716    Argh.  Now GDB complains because it cannot find the shared library
717 that `hell' is linked against.  So, we must use libtool in order to
718 properly set the library path and run the debugger.  Fortunately, we can
719 forget all about the `.libs' directory, and just run it on the
720 executable wrapper (*note Execute mode::):
722      burger$ libtool --mode=execute gdb hell
723      GDB is free software and you are welcome to distribute copies of it
724       under certain conditions; type "show copying" to see the conditions.
725      There is no warranty for GDB; type "show warranty" for details.
726      GDB 4.16 (i386-unknown-netbsd), (C) 1996 Free Software Foundation, Inc.
727      (gdb) break main
728      Breakpoint 1 at 0x8048547: file main.c, line 29.
729      (gdb) run
730      Starting program: /home/src/libtool/demo/.libs/hell
732      Breakpoint 1, main (argc=1, argv=0xbffffc40) at main.c:29
733      29   printf ("Welcome to GNU Hell!\n");
734      (gdb) quit
735      The program is running.  Quit anyway (and kill it)? (y or n) y
736      burger$
738 \x1f
739 File: libtool.info,  Node: Installing libraries,  Next: Installing executables,  Prev: Debugging executables,  Up: Using libtool
741 3.5 Installing libraries
742 ========================
744 Installing libraries on a non-libtool system is quite
745 straightforward... just copy them into place:(1)
747      burger$ su
748      Password: ********
749      burger# cp libhello.a /usr/local/lib/libhello.a
750      burger#
752    Oops, don't forget the `ranlib' command:
754      burger# ranlib /usr/local/lib/libhello.a
755      burger#
757    Libtool installation is quite simple, as well.  Just use the
758 `install' or `cp' command that you normally would (*note Install
759 mode::):
761      a23# libtool --mode=install cp libhello.la /usr/local/lib/libhello.la
762      cp libhello.la /usr/local/lib/libhello.la
763      cp .libs/libhello.a /usr/local/lib/libhello.a
764      ranlib /usr/local/lib/libhello.a
765      a23#
767    Note that the libtool library `libhello.la' is also installed, to
768 help libtool with uninstallation (*note Uninstall mode::) and linking
769 (*note Linking executables::) and to help programs with dlopening
770 (*note Dlopened modules::).
772    Here is the shared library example:
774      burger# libtool --mode=install install -c libhello.la \
775                      /usr/local/lib/libhello.la
776      install -c .libs/libhello.so.0.0 /usr/local/lib/libhello.so.0.0
777      install -c libhello.la /usr/local/lib/libhello.la
778      install -c .libs/libhello.a /usr/local/lib/libhello.a
779      ranlib /usr/local/lib/libhello.a
780      burger#
782    It is safe to specify the `-s' (strip symbols) flag if you use a
783 BSD-compatible install program when installing libraries.  Libtool will
784 either ignore the `-s' flag, or will run a program that will strip only
785 debugging and compiler symbols from the library.
787    Once the libraries have been put in place, there may be some
788 additional configuration that you need to do before using them.  First,
789 you must make sure that where the library is installed actually agrees
790 with the `-rpath' flag you used to build it.
792    Then, running `libtool -n --mode=finish LIBDIR' can give you further
793 hints on what to do (*note Finish mode::):
795      burger# libtool -n --mode=finish /usr/local/lib
796      PATH="$PATH:/sbin" ldconfig -m /usr/local/lib
797      -----------------------------------------------------------------
798      Libraries have been installed in:
799         /usr/local/lib
801      To link against installed libraries in a given directory, LIBDIR,
802      you must use the `-LLIBDIR' flag during linking.
804       You will also need to do one of the following:
805         - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
806           during execution
807         - add LIBDIR to the `LD_RUN_PATH' environment variable
808           during linking
809         - use the `-RLIBDIR' linker flag
811      See any operating system documentation about shared libraries for
812      more information, such as the ld and ld.so manual pages.
813      -----------------------------------------------------------------
814      burger#
816    After you have completed these steps, you can go on to begin using
817 the installed libraries.  You may also install any executables that
818 depend on libraries you created.
820    ---------- Footnotes ----------
822    (1) Don't accidentally strip the libraries, though, or they will be
823 unusable.
825 \x1f
826 File: libtool.info,  Node: Installing executables,  Next: Static libraries,  Prev: Installing libraries,  Up: Using libtool
828 3.6 Installing executables
829 ==========================
831 If you used libtool to link any executables against uninstalled libtool
832 libraries (*note Linking executables::), you need to use libtool to
833 install the executables after the libraries have been installed (*note
834 Installing libraries::).
836    So, for our Ultrix example, we would run:
838      a23# libtool install -c hell /usr/local/bin/hell
839      install -c hell /usr/local/bin/hell
840      a23#
842    On shared library systems, libtool just ignores the wrapper script
843 and installs the correct binary:
845      burger# libtool install -c hell /usr/local/bin/hell
846      install -c .libs/hell /usr/local/bin/hell
847      burger#
849 \x1f
850 File: libtool.info,  Node: Static libraries,  Prev: Installing executables,  Up: Using libtool
852 3.7 Linking static libraries
853 ============================
855 Why return to `ar' and `ranlib' silliness when you've had a taste of
856 libtool?  Well, sometimes it is desirable to create a static archive
857 that can never be shared.  The most frequent case is when you have a
858 set of object files that you use to build several different programs.
859 You can create a "convenience library" out of those objects, and link
860 programs with the library, instead of listing all object files for
861 every program.  This technique is often used to overcome GNU automake's
862 lack of support for linking object files built from sources in other
863 directories, because it supports linking with libraries from other
864 directories.  This limitation applies to GNU automake up to release
865 1.4; newer releases should support sources in other directories.
867    If you just want to link this convenience library into programs, then
868 you could just ignore libtool entirely, and use the old `ar' and
869 `ranlib' commands (or the corresponding GNU automake `_LIBRARIES'
870 rules).  You can even install a convenience library (but you probably
871 don't want to) using libtool:
873      burger$ libtool --mode=install ./install-sh -c libhello.a \
874                      /local/lib/libhello.a
875      ./install-sh -c libhello.a /local/lib/libhello.a
876      ranlib /local/lib/libhello.a
877      burger$
879    Using libtool for static library installation protects your library
880 from being accidentally stripped (if the installer used the `-s' flag),
881 as well as automatically running the correct `ranlib' command.
883    But libtool libraries are more than just collections of object files:
884 they can also carry library dependency information, which old archives
885 do not.  If you want to create a libtool static convenience library, you
886 can omit the `-rpath' flag and use `-static' to indicate that you're
887 only interested in a static library.  When you link a program with such
888 a library, libtool will actually link all object files and dependency
889 libraries into the program.
891    If you omit both `-rpath' and `-static', libtool will create a
892 convenience library that can be used to create other libtool libraries,
893 even shared ones.  Just like in the static case, the library behaves as
894 an alias to a set of object files and dependency libraries, but in this
895 case the object files are suitable for inclusion in shared libraries.
896 But be careful not to link a single convenience library, directly or
897 indirectly, into a single program or library, otherwise you may get
898 errors about symbol redefinitions.
900    When GNU automake is used, you should use `noinst_LTLIBRARIES'
901 instead of `lib_LTLIBRARIES' for convenience libraries, so that the
902 `-rpath' option is not passed when they are linked.
904    As a rule of thumb, link a libtool convenience library into at most
905 one libtool library, and never into a program, and link libtool static
906 convenience libraries only into programs, and only if you need to carry
907 library dependency information to the user of the static convenience
908 library.
910    Another common situation where static linking is desirable is in
911 creating a standalone binary.  Use libtool to do the linking and add the
912 `-all-static' flag.
914 \x1f
915 File: libtool.info,  Node: Invoking libtool,  Next: Integrating libtool,  Prev: Using libtool,  Up: Top
917 4 Invoking `libtool'
918 ********************
920 The `libtool' program has the following synopsis:
922      libtool [OPTION]... [MODE-ARG]...
924 and accepts the following options:
926 `--config'
927      Display libtool configuration variables and exit.
929 `--debug'
930      Dump a trace of shell script execution to standard output.  This
931      produces a lot of output, so you may wish to pipe it to `less' (or
932      `more') or redirect to a file.
934 `-n'
935 `--dry-run'
936      Don't create, modify, or delete any files, just show what commands
937      would be executed by libtool.
939 `--features'
940      Display basic configuration options.  This provides a way for
941      packages to determine whether shared or static libraries will be
942      built.
944 `--tag=TAG'
945      Use configuration variables from tag TAG (*note Tags::).
947 `--preserve-dup-deps'
948      Do not remove duplicate dependencies in libraries.  When building
949      packages with static libraries, the libraries may depend
950      circularly on each other (shared libs can too, but for those it
951      doesn't matter), so there are situations, where -la -lb -la is
952      required, and the second -la may not be stripped or the link will
953      fail.  In cases where these duplications are required, this option
954      will preserve them, only stripping the libraries that libtool
955      knows it can safely.
957 `--finish'
958      Same as `--mode=finish'.
960 `--help'
961      Display a help message and exit.  If `--mode=MODE' is specified,
962      then detailed help for MODE is displayed.
964 `--mode=MODE'
965      Use MODE as the operation mode.  If not specified, an attempt is
966      made to infer the operation mode from the MODE-ARGS.  Not
967      specifying the MODE is currently deprecated, as there are too many
968      situations where it is not possible to guess.  Future versions of
969      Libtool will require that MODE be explicitly set.
971      MODE must be set to one of the following:
973     `compile'
974           Compile a source file into a libtool object.
976     `execute'
977           Automatically set the library path so that another program
978           can use uninstalled libtool-generated programs or libraries.
980     `finish'
981           Complete the installation of libtool libraries on the system.
983     `install'
984           Install libraries or executables.
986     `link'
987           Create a library or an executable.
989     `uninstall'
990           Delete installed libraries or executables.
992     `clean'
993           Delete uninstalled libraries or executables.
995 `--version'
996      Print libtool version information and exit.
998    The MODE-ARGS are a variable number of arguments, depending on the
999 selected operation mode.  In general, each MODE-ARG is interpreted by
1000 programs libtool invokes, rather than libtool itself.
1002 * Menu:
1004 * Compile mode::                Creating library object files.
1005 * Link mode::                   Generating executables and libraries.
1006 * Execute mode::                Debugging libtool-generated programs.
1007 * Install mode::                Making libraries and executables public.
1008 * Finish mode::                 Completing a library installation.
1009 * Uninstall mode::              Removing installed executables and libraries.
1010 * Clean mode::                  Removing uninstalled executables and libraries.
1012 \x1f
1013 File: libtool.info,  Node: Compile mode,  Next: Link mode,  Up: Invoking libtool
1015 4.1 Compile mode
1016 ================
1018 For "compile" mode, MODE-ARGS is a compiler command to be used in
1019 creating a `standard' object file.  These arguments should begin with
1020 the name of the C compiler, and contain the `-c' compiler flag so that
1021 only an object file is created.
1023    Libtool determines the name of the output file by removing the
1024 directory component from the source file name, then substituting the
1025 source code suffix (e.g. `.c' for C source code) with the library
1026 object suffix, `.lo'.
1028    If shared libraries are being built, any necessary PIC generation
1029 flags are substituted into the compilation command.  You can pass link
1030 specific flags to the compiler driver using `-XCClinker FLAG' or pass
1031 linker flags with `-Wl,FLAG' and `-Xlinker FLAG'.  You can also pass
1032 compile specific flags using `-Wc,FLAG' and `-Xcompiler FLAG'.
1034    If both PIC and non-PIC objects are being built, libtool will
1035 normally suppress the compiler output for the PIC object compilation to
1036 save showing very similar, if not identical duplicate output for each
1037 object.  If the `-no-suppress' option is given in compile mode, libtool
1038 will show the compiler output for both objects.
1040    If the `-static' option is given, then a `.o' file is built, even if
1041 libtool was configured with `--disable-static'.
1043    Note that the `-o' option is now fully supported.  It is emulated on
1044 the platforms that don't support it (by locking and moving the
1045 objects), so it is really easy to use libtool, just with minor
1046 modifications to your Makefiles. Typing for example
1047      libtool gcc -c foo/x.c -o foo/x.lo
1048    will do what you expect.
1050    Note, however, that, if the compiler does not support `-c' and `-o',
1051 it is impossible to compile `foo/x.c' without overwriting an existing
1052 `./x.o'.  Therefore, if you do have a source file `./x.c', make sure
1053 you introduce dependencies in your `Makefile' to make sure `./x.o' (or
1054 `./x.lo') is re-created after any sub-directory's `x.lo':
1055      x.o x.lo: foo/x.lo bar/x.lo
1056    This will also ensure that make won't try to use a temporarily
1057 corrupted `x.o' to create a program or library.  It may cause needless
1058 recompilation on platforms that support `-c' and `-o' together, but
1059 it's the only way to make it safe for those that don't.
1061 \x1f
1062 File: libtool.info,  Node: Link mode,  Next: Execute mode,  Prev: Compile mode,  Up: Invoking libtool
1064 4.2 Link mode
1065 =============
1067 "Link" mode links together object files (including library objects) to
1068 form another library or to create an executable program.
1070    MODE-ARGS consist of a command using the C compiler to create an
1071 output file (with the `-o' flag) from several object files.
1073    The following components of MODE-ARGS are treated specially:
1075 `-all-static'
1076      If OUTPUT-FILE is a program, then do not link it against any
1077      shared libraries at all.  If OUTPUT-FILE is a library, then only
1078      create a static library.
1080 `-avoid-version'
1081      Tries to avoid versioning (*note Versioning::) for libraries and
1082      modules, i.e., no version information is stored and no symbolic
1083      links are created.  If the platform requires versioning, this
1084      option has no effect.
1086 `-dlopen FILE'
1087      Same as `-dlpreopen FILE', if native dlopening is not supported on
1088      the host platform (*note Dlopened modules::) or if the program is
1089      linked with `-static', `-static-libtool-libs', or `-all-static'.
1090      Otherwise, no effect.  If FILE is `self' libtool will make sure
1091      that the program can `dlopen' itself, either by enabling
1092      `-export-dynamic' or by falling back to `-dlpreopen self'.
1094 `-dlpreopen FILE'
1095      Link FILE into the output program, and add its symbols to
1096      LT_PRELOADED_SYMBOLS (*note Dlpreopening::).  If FILE is `self',
1097      the symbols of the program itself will be added to
1098      LT_PRELOADED_SYMBOLS.  If FILE is `force' libtool will make sure
1099      that LT_PRELOADED_SYMBOLS is always _defined_, regardless of
1100      whether it's empty or not.
1102 `-export-dynamic'
1103      Allow symbols from OUTPUT-FILE to be resolved with `dlsym' (*note
1104      Dlopened modules::).
1106 `-export-symbols SYMFILE'
1107      Tells the linker to export only the symbols listed in SYMFILE.
1108      The symbol file should end in `.sym' and must contain the name of
1109      one symbol per line. This option has no effect on some platforms.
1110      By default all symbols are exported.
1112 `-export-symbols-regex REGEX'
1113      Same as `-export-symbols', except that only symbols matching the
1114      regular expression REGEX are exported.  By default all symbols are
1115      exported.
1117 `-LLIBDIR'
1118      Search LIBDIR for required libraries that have already been
1119      installed.
1121 `-lNAME'
1122      OUTPUT-FILE requires the installed library `libNAME'.  This option
1123      is required even when OUTPUT-FILE is not an executable.
1125 `-module'
1126      Creates a library that can be dlopened (*note Dlopened modules::).
1127      This option doesn't work for programs.  Module names don't need to
1128      be prefixed with 'lib'.  In order to prevent name clashes,
1129      however, 'libname' and 'name' must not be used at the same time in
1130      your package.
1132 `-no-fast-install'
1133      Disable fast-install mode for the executable OUTPUT-FILE.  Useful
1134      if the program won't be necessarily installed.
1136 `-no-install'
1137      Link an executable OUTPUT-FILE that can't be installed and
1138      therefore doesn't need a wrapper script on systems that allow
1139      hardcoding of library paths.  Useful if the program is only used
1140      in the build tree, e.g., for testing or generating other files.
1142 `-no-undefined'
1143      Declare that OUTPUT-FILE does not depend on any other libraries.
1144      Some platforms cannot create shared libraries that depend on other
1145      libraries (*note Inter-library dependencies::).
1147 `-o OUTPUT-FILE'
1148      Create OUTPUT-FILE from the specified objects and libraries.
1150 `-objectlist FILE'
1151      Use a list of object files found in FILE to specify objects.
1153 `-precious-files-regex REGEX'
1154      Prevents removal of files from the temporary output directory whose
1155      names match this regular expression.  You might specify `\.bbg?$'
1156      to keep those files created with `gcc -ftest-coverage' for example.
1158 `-release RELEASE'
1159      Specify that the library was generated by release RELEASE of your
1160      package, so that users can easily tell which versions are newer
1161      than others.  Be warned that no two releases of your package will
1162      be binary compatible if you use this flag.  If you want binary
1163      compatibility, use the `-version-info' flag instead (*note
1164      Versioning::).
1166 `-rpath LIBDIR'
1167      If OUTPUT-FILE is a library, it will eventually be installed in
1168      LIBDIR.  If OUTPUT-FILE is a program, add LIBDIR to the run-time
1169      path of the program.
1171 `-shrext SUFFIX'
1172      If OUTPUT-FILE is a libtool library, replace the system's standard
1173      file name extension for shared libraries with SUFFIX (most systems
1174      use `.so' here).  This option is helpful in certain cases where an
1175      application requires that shared libraries (typically modules)
1176      have an extension other than the default one.  Please note you
1177      must supply the full file name extension including any leading dot.
1179 `-R LIBDIR'
1180      If OUTPUT-FILE is a program, add LIBDIR to its run-time path.  If
1181      OUTPUT-FILE is a library, add -RLIBDIR to its DEPENDENCY_LIBS, so
1182      that, whenever the library is linked into a program, LIBDIR will
1183      be added to its run-time path.
1185 `-static'
1186      If OUTPUT-FILE is a program, then do not link it against any
1187      uninstalled shared libtool libraries.  If OUTPUT-FILE is a
1188      library, then only create a static library.
1190 `-static-libtool-libs'
1191      If OUTPUT-FILE is a program, then do not link it against any
1192      shared libtool libraries (`.la' files).  If OUTPUT-FILE is a
1193      library, then only create a static library.
1195 `-version-info CURRENT[:REVISION[:AGE]]'
1196      If OUTPUT-FILE is a libtool library, use interface version
1197      information CURRENT, REVISION, and AGE to build it (*note
1198      Versioning::).  Do *not* use this flag to specify package release
1199      information, rather see the `-release' flag.
1201 `-version-number MAJOR[:MINOR[:REVISION]]'
1202      If OUTPUT-FILE is a libtool library, compute interface version
1203      information so that the resulting library uses the specified
1204      major, minor and revision numbers.  This is designed to permit
1205      libtool to be used with existing projects where identical version
1206      numbers are already used across operating systems.  New projects
1207      should use the `-version-info' flag instead.
1209 `-Wl,FLAG'
1210 `-Xlinker FLAG'
1211      Pass a linker specific flag directly to the linker.
1213 `-XCClinker FLAG'
1214      Pass a link specific flag to the compiler driver (CC) during
1215      linking.
1217    If the OUTPUT-FILE ends in `.la', then a libtool library is created,
1218 which must be built only from library objects (`.lo' files).  The
1219 `-rpath' option is required.  In the current implementation, libtool
1220 libraries may not depend on other uninstalled libtool libraries (*note
1221 Inter-library dependencies::).
1223    If the OUTPUT-FILE ends in `.a', then a standard library is created
1224 using `ar' and possibly `ranlib'.
1226    If OUTPUT-FILE ends in `.o' or `.lo', then a reloadable object file
1227 is created from the input files (generally using `ld -r').  This method
1228 is often called "partial linking".
1230    Otherwise, an executable program is created.
1232 \x1f
1233 File: libtool.info,  Node: Execute mode,  Next: Install mode,  Prev: Link mode,  Up: Invoking libtool
1235 4.3 Execute mode
1236 ================
1238 For "execute" mode, the library path is automatically set, then a
1239 program is executed.
1241    The first of the MODE-ARGS is treated as a program name, with the
1242 rest as arguments to that program.
1244    The following components of MODE-ARGS are treated specially:
1246 `-dlopen FILE'
1247      Add the directory containing FILE to the library path.
1249    This mode sets the library path environment variable according to any
1250 `-dlopen' flags.
1252    If any of the ARGS are libtool executable wrappers, then they are
1253 translated into the name of their corresponding uninstalled binary, and
1254 any of their required library directories are added to the library path.
1256 \x1f
1257 File: libtool.info,  Node: Install mode,  Next: Finish mode,  Prev: Execute mode,  Up: Invoking libtool
1259 4.4 Install mode
1260 ================
1262 In "install" mode, libtool interprets most of the elements of MODE-ARGS
1263 as an installation command beginning with `cp', or a BSD-compatible
1264 `install' program.
1266    The following components of MODE-ARGS are treated specially:
1268 `-inst-prefix INST-PREFIX-DIR'
1269      When installing into a temporary staging area, rather than the
1270      final PREFIX, this argument is used to reflect the temporary path,
1271      in much the same way `automake' uses DESTDIR.  For instance, if
1272      PREFIX is `/usr/local', but INST-PREFIX-DIR is `/tmp', then the
1273      object will be installed under `/tmp/usr/local/'.  If the
1274      installed object is a libtool library, then the internal fields of
1275      that library will reflect only PREFIX, not INST-PREFIX-DIR:
1277           # Directory that this library needs to be installed in:
1278           libdir='/usr/local/lib'
1280      not
1282           # Directory that this library needs to be installed in:
1283           libdir='/tmp/usr/local/lib'
1285      `inst-prefix' is also used to insure that if the installed object
1286      must be relinked upon installation, that it is relinked against
1287      the libraries in INST-PREFIX-DIR/PREFIX, not PREFIX.
1289      In truth, this option is not really intended for use when calling
1290      libtool directly; it is automatically used when `libtool
1291      --mode=install' calls `libtool --mode=relink'.  Libtool does this
1292      by analyzing the destination path given in the original `libtool
1293      --mode=install' command and comparing it to the expected
1294      installation path established during `libtool --mode=link'.
1296      Thus, end-users need change nothing, and `automake'-style `make
1297      install DESTDIR=/tmp' will Just Work(tm).
1299    The rest of the MODE-ARGS are interpreted as arguments to the `cp'
1300 or `install' command.
1302    The command is run, and any necessary unprivileged post-installation
1303 commands are also completed.
1305 \x1f
1306 File: libtool.info,  Node: Finish mode,  Next: Uninstall mode,  Prev: Install mode,  Up: Invoking libtool
1308 4.5 Finish mode
1309 ===============
1311 "Finish" mode helps system administrators install libtool libraries so
1312 that they can be located and linked into user programs.
1314    Each MODE-ARG is interpreted as the name of a library directory.
1315 Running this command may require superuser privileges, so the
1316 `--dry-run' option may be useful.
1318 \x1f
1319 File: libtool.info,  Node: Uninstall mode,  Next: Clean mode,  Prev: Finish mode,  Up: Invoking libtool
1321 4.6 Uninstall mode
1322 ==================
1324 "Uninstall" mode deletes installed libraries, executables and objects.
1326    The first MODE-ARG is the name of the program to use to delete files
1327 (typically `/bin/rm').
1329    The remaining MODE-ARGS are either flags for the deletion program
1330 (beginning with a `-'), or the names of files to delete.
1332 \x1f
1333 File: libtool.info,  Node: Clean mode,  Prev: Uninstall mode,  Up: Invoking libtool
1335 4.7 Clean mode
1336 ==============
1338 "Clean" mode deletes uninstalled libraries, executables, objects and
1339 libtool's temporary files associated with them.
1341    The first MODE-ARG is the name of the program to use to delete files
1342 (typically `/bin/rm').
1344    The remaining MODE-ARGS are either flags for the deletion program
1345 (beginning with a `-'), or the names of files to delete.
1347 \x1f
1348 File: libtool.info,  Node: Integrating libtool,  Next: Versioning,  Prev: Invoking libtool,  Up: Top
1350 5 Integrating libtool with your package
1351 ***************************************
1353 This chapter describes how to integrate libtool with your packages so
1354 that your users can install hassle-free shared libraries.
1356 * Menu:
1358 * Makefile rules::              Writing `Makefile' rules for libtool.
1359 * Using Automake::              Automatically supporting libtool.
1360 * Configuring::                 Configuring libtool for a host system.
1361 * Distributing::                What files to distribute with your package.
1362 * Static-only libraries::       Sometimes shared libraries are just a pain.
1364 \x1f
1365 File: libtool.info,  Node: Makefile rules,  Next: Using Automake,  Up: Integrating libtool
1367 5.1 Writing `Makefile' rules for libtool
1368 ========================================
1370 Libtool is fully integrated with Automake (*note Introduction:
1371 (automake)Top.), starting with Automake version 1.2.
1373    If you want to use libtool in a regular `Makefile' (or
1374 `Makefile.in'), you are on your own.  If you're not using Automake 1.2,
1375 and you don't know how to incorporate libtool into your package you
1376 need to do one of the following:
1378   1. Download Automake (version 1.2 or later) from your nearest GNU
1379      mirror, install it, and start using it.
1381   2. Learn how to write `Makefile' rules by hand.  They're sometimes
1382      complex, but if you're clever enough to write rules for compiling
1383      your old libraries, then you should be able to figure out new
1384      rules for libtool libraries (hint: examine the `Makefile.in' in
1385      the `demo' subdirectory of the libtool distribution... note
1386      especially that it was automatically generated from the
1387      `Makefile.am' by Automake).
1389 \x1f
1390 File: libtool.info,  Node: Using Automake,  Next: Configuring,  Prev: Makefile rules,  Up: Integrating libtool
1392 5.2 Using Automake with libtool
1393 ===============================
1395 Libtool library support is implemented under the `LTLIBRARIES' primary.
1397    Here are some samples from the Automake `Makefile.am' in the libtool
1398 distribution's `demo' subdirectory.
1400    First, to link a program against a libtool library, just use the
1401 `program_LDADD' variable:
1403      bin_PROGRAMS = hell hell.debug
1405      # Build hell from main.c and libhello.la
1406      hell_SOURCES = main.c
1407      hell_LDADD = libhello.la
1409      # Create an easier-to-debug version of hell.
1410      hell_debug_SOURCES = main.c
1411      hell_debug_LDADD = libhello.la
1412      hell_debug_LDFLAGS = -static
1414    The flags `-dlopen' or `-dlpreopen' (*note Link mode::) would fit
1415 better in the PROGRAM_LDADD variable.  Unfortunately, GNU automake, up
1416 to release 1.4, doesn't accept these flags in a PROGRAM_LDADD variable,
1417 so you have the following alternatives:
1419    * add them to PROGRAM_LDFLAGS, and list the libraries in
1420      PROGRAM_DEPENDENCIES, then wait for a release of GNU automake that
1421      accepts these flags where they belong;
1423    * surround the flags between quotes, but then you must set
1424      PROGRAM_DEPENDENCIES too:
1426           program_LDADD = "-dlopen" libfoo.la
1427           program_DEPENDENCIES = libfoo.la
1429    * set and `AC_SUBST' variables DLOPEN and DLPREOPEN in
1430      `configure.in' and use `@DLOPEN@' and `@DLPREOPEN@' as
1431      replacements for the explicit flags `-dlopen' and `-dlpreopen' in
1432      `program_LDADD'.  Automake will discard `AC_SUBST'ed variables
1433      from dependencies, so it will behave exactly as we expect it to
1434      behave when it accepts these flags in `program_LDADD'.  But hey!,
1435      this is ugly!
1437    You may use the `program_LDFLAGS' variable to stuff in any flags you
1438 want to pass to libtool while linking `program' (such as `-static' to
1439 avoid linking uninstalled shared libtool libraries).
1441    Building a libtool library is almost as trivial... note the use of
1442 `libhello_la_LDFLAGS' to pass the `-version-info' (*note Versioning::)
1443 option to libtool:
1445      # Build a libtool library, libhello.la for installation in libdir.
1446      lib_LTLIBRARIES = libhello.la
1447      libhello_la_SOURCES = hello.c foo.c
1448      libhello_la_LDFLAGS = -version-info 3:12:1
1450    The `-rpath' option is passed automatically by Automake (except for
1451 libraries listed as `noinst_LTLIBRARIES'), so you should not specify it.
1453    *Note Building a Shared Library: (automake)A Shared Library, for
1454 more information.
1456 \x1f
1457 File: libtool.info,  Node: Configuring,  Next: Distributing,  Prev: Using Automake,  Up: Integrating libtool
1459 5.3 Configuring libtool
1460 =======================
1462 Libtool requires intimate knowledge of your compiler suite and operating
1463 system in order to be able to create shared libraries and link against
1464 them properly.  When you install the libtool distribution, a
1465 system-specific libtool script is installed into your binary directory.
1467    However, when you distribute libtool with your own packages (*note
1468 Distributing::), you do not always know which compiler suite and
1469 operating system are used to compile your package.
1471    For this reason, libtool must be "configured" before it can be used.
1472 This idea should be familiar to anybody who has used a GNU `configure'
1473 script.  `configure' runs a number of tests for system features, then
1474 generates the `Makefiles' (and possibly a `config.h' header file),
1475 after which you can run `make' and build the package.
1477    Libtool adds its own tests to your `configure' script in order to
1478 generate a libtool script for the installer's host machine.
1480 * Menu:
1482 * AC_PROG_LIBTOOL::             Configuring `libtool' in `configure.in'.
1484 \x1f
1485 File: libtool.info,  Node: AC_PROG_LIBTOOL,  Up: Configuring
1487 5.3.1 The `AC_PROG_LIBTOOL' macro
1488 ---------------------------------
1490 If you are using GNU Autoconf (or Automake), you should add a call to
1491 `AC_PROG_LIBTOOL' to your `configure.in' file.  This macro adds many
1492 new tests to the `configure' script so that the generated libtool
1493 script will understand the characteristics of the host:
1495  -- Macro: AC_PROG_LIBTOOL
1496  -- Macro: AM_PROG_LIBTOOL
1497      Add support for the `--enable-shared' and `--disable-shared'
1498      `configure' flags.(1)  `AM_PROG_LIBTOOL' was the old name for this
1499      macro, and although supported at the moment is deprecated.
1501      By default, this macro turns on shared libraries if they are
1502      available, and also enables static libraries if they don't
1503      conflict with the shared libraries.  You can modify these defaults
1504      by calling either the `AC_DISABLE_SHARED' or `AC_DISABLE_STATIC'
1505      macros:
1507           # Turn off shared libraries during beta-testing, since they
1508           # make the build process take too long.
1509           AC_DISABLE_SHARED
1510           AC_PROG_LIBTOOL
1512      The user may specify modified forms of the configure flags
1513      `--enable-shared' and `--enable-static' to choose whether shared
1514      or static libraries are built based on the name of the package.
1515      For example, to have shared `bfd' and `gdb' libraries built, but
1516      not shared `libg++', you can run all three `configure' scripts as
1517      follows:
1519           trick$ ./configure --enable-shared=bfd,gdb
1521      In general, specifying `--enable-shared=PKGS' is the same as
1522      configuring with `--enable-shared' every package named in the
1523      comma-separated PKGS list, and every other package with
1524      `--disable-shared'.  The `--enable-static=PKGS' flag behaves
1525      similarly, but it uses `--enable-static' and `--disable-static'.
1526      The same applies to the `--enable-fast-install=PKGS' flag, which
1527      uses `--enable-fast-install' and `--disable-fast-install'.
1529      The package name `default' matches any packages which have not set
1530      their name in the `PACKAGE' environment variable.
1532      This macro also sets the shell variable LIBTOOL_DEPS, that you can
1533      use to automatically update the libtool script if it becomes
1534      out-of-date.  In order to do that, add to your `configure.in':
1536           AC_PROG_LIBTOOL
1537           AC_SUBST(LIBTOOL_DEPS)
1539      and, to `Makefile.in' or `Makefile.am':
1541           LIBTOOL_DEPS = @LIBTOOL_DEPS@
1542           libtool: $(LIBTOOL_DEPS)
1543                   $(SHELL) ./config.status --recheck
1545      If you are using GNU automake, you can omit the assignment, as
1546      automake will take care of it.  You'll obviously have to create
1547      some dependency on `libtool'.
1550  -- Macro: AC_LIBTOOL_DLOPEN
1551      Enable checking for dlopen support. This macro should be used if
1552      the package makes use of the `-dlopen' and `-dlpreopen' flags,
1553      otherwise libtool will assume that the system does not support
1554      dlopening.  The macro must be called *before* `AC_PROG_LIBTOOL'.
1556  -- Macro: AC_LIBTOOL_WIN32_DLL
1557      This macro should be used if the package has been ported to build
1558      clean dlls on win32 platforms.  Usually this means that any
1559      library data items are exported with `__declspec(dllexport)' and
1560      imported with `__declspec(dllimport)'.  If this macro is not used,
1561      libtool will assume that the package libraries are not dll clean
1562      and will build only static libraries on win32 hosts.
1564      This macro must be called *before* `AC_PROG_LIBTOOL', and
1565      provision must be made to pass `-no-undefined' to `libtool' in
1566      link mode from the package `Makefile'.  Naturally, if you pass
1567      `-no-undefined', you must ensure that all the library symbols
1568      *really are* defined at link time!
1570  -- Macro: AC_DISABLE_FAST_INSTALL
1571      Change the default behaviour for `AC_PROG_LIBTOOL' to disable
1572      optimization for fast installation.  The user may still override
1573      this default, depending on platform support, by specifying
1574      `--enable-fast-install'.
1576  -- Macro: AC_DISABLE_SHARED
1577  -- Macro: AM_DISABLE_SHARED
1578      Change the default behaviour for `AC_PROG_LIBTOOL' to disable
1579      shared libraries.  The user may still override this default by
1580      specifying `--enable-shared'.
1582  -- Macro: AC_DISABLE_STATIC
1583  -- Macro: AM_DISABLE_STATIC
1584      Change the default behaviour for `AC_PROG_LIBTOOL' to disable
1585      static libraries.  The user may still override this default by
1586      specifying `--enable-static'.
1588    The tests in `AC_PROG_LIBTOOL' also recognize the following
1589 environment variables:
1591  -- Variable: CC
1592      The C compiler that will be used by the generated `libtool'.  If
1593      this is not set, `AC_PROG_LIBTOOL' will look for `gcc' or `cc'.
1595  -- Variable: CFLAGS
1596      Compiler flags used to generate standard object files.  If this is
1597      not set, `AC_PROG_LIBTOOL' will not use any such flags.  It affects
1598      only the way `AC_PROG_LIBTOOL' runs tests, not the produced
1599      `libtool'.
1601  -- Variable: CPPFLAGS
1602      C preprocessor flags.  If this is not set, `AC_PROG_LIBTOOL' will
1603      not use any such flags.  It affects only the way `AC_PROG_LIBTOOL'
1604      runs tests, not the produced `libtool'.
1606  -- Variable: LD
1607      The system linker to use (if the generated `libtool' requires one).
1608      If this is not set, `AC_PROG_LIBTOOL' will try to find out what is
1609      the linker used by CC.
1611  -- Variable: LDFLAGS
1612      The flags to be used by `libtool' when it links a program.  If
1613      this is not set, `AC_PROG_LIBTOOL' will not use any such flags.  It
1614      affects only the way `AC_PROG_LIBTOOL' runs tests, not the produced
1615      `libtool'.
1617  -- Variable: LIBS
1618      The libraries to be used by `AC_PROG_LIBTOOL' when it links a
1619      program.  If this is not set, `AC_PROG_LIBTOOL' will not use any
1620      such flags.  It affects only the way `AC_PROG_LIBTOOL' runs tests,
1621      not the produced `libtool'.
1623  -- Variable: NM
1624      Program to use rather than checking for `nm'.
1626  -- Variable: RANLIB
1627      Program to use rather than checking for `ranlib'.
1629  -- Variable: LN_S
1630      A command that creates a link of a program, a soft-link if
1631      possible, a hard-link otherwise.  `AC_PROG_LIBTOOL' will check for
1632      a suitable program if this variable is not set.
1634  -- Variable: DLLTOOL
1635      Program to use rather than checking for `dlltool'.  Only meaningful
1636      for Cygwin/MS-Windows.
1638  -- Variable: OBJDUMP
1639      Program to use rather than checking for `objdump'.  Only meaningful
1640      for Cygwin/MS-Windows.
1642  -- Variable: AS
1643      Program to use rather than checking for `as'.  Only used on
1644      Cygwin/MS-Windows at the moment.
1646    When you invoke the `libtoolize' program (*note Invoking
1647 libtoolize::), it will tell you where to find a definition of
1648 `AC_PROG_LIBTOOL'.  If you use Automake, the `aclocal' program will
1649 automatically add `AC_PROG_LIBTOOL' support to your `configure' script.
1651    Nevertheless, it is advisable to include a copy of `libtool.m4' in
1652 `acinclude.m4', so that, even if `aclocal.m4' and `configure' are
1653 rebuilt for any reason, the appropriate libtool macros will be used.
1654 The alternative is to hope the user will have a compatible version of
1655 `libtool.m4' installed and accessible for `aclocal'.  This may lead to
1656 weird errors when versions don't match.
1658    ---------- Footnotes ----------
1660    (1) `AC_PROG_LIBTOOL' requires that you define the `Makefile'
1661 variable `top_builddir' in your `Makefile.in'.  Automake does this
1662 automatically, but Autoconf users should set it to the relative path to
1663 the top of your build directory (`../..', for example).
1665 \x1f
1666 File: libtool.info,  Node: Distributing,  Next: Static-only libraries,  Prev: Configuring,  Up: Integrating libtool
1668 5.4 Including libtool in your package
1669 =====================================
1671 In order to use libtool, you need to include the following files with
1672 your package:
1674 `config.guess'
1675      Attempt to guess a canonical system name.
1677 `config.sub'
1678      Canonical system name validation subroutine script.
1680 `install-sh'
1681      BSD-compatible `install' replacement script.
1683 `ltmain.sh'
1684      A generic script implementing basic libtool functionality.
1686    Note that the libtool script itself should _not_ be included with
1687 your package.  *Note Configuring::.
1689    You should use the `libtoolize' program, rather than manually
1690 copying these files into your package.  Note however, that `install-sh'
1691 is not copied by `libtoolize'; if you use Automake, it will take care
1692 of that, otherwise you may obtain a copy from the package data directory
1693 of the installed Libtool.  This may change in a future Libtool version.
1695 * Menu:
1697 * Invoking libtoolize::         `libtoolize' command line options.
1698 * Autoconf .o macros::          Autoconf macros that set object file names.
1700 \x1f
1701 File: libtool.info,  Node: Invoking libtoolize,  Next: Autoconf .o macros,  Up: Distributing
1703 5.4.1 Invoking `libtoolize'
1704 ---------------------------
1706 The `libtoolize' program provides a standard way to add libtool support
1707 to your package.  In the future, it may implement better usage
1708 checking, or other features to make libtool even easier to use.
1710    The `libtoolize' program has the following synopsis:
1712      libtoolize [OPTION]...
1714 and accepts the following options:
1716 `--automake'
1717      Work silently, and assume that Automake libtool support is used.
1719      `libtoolize --automake' is used by Automake to add libtool files to
1720      your package, when `AC_PROG_LIBTOOL' appears in your
1721      `configure.in'.
1723 `--copy'
1724 `-c'
1725      Copy files from the libtool data directory rather than creating
1726      symlinks.
1728 `--debug'
1729      Dump a trace of shell script execution to standard output.  This
1730      produces a lot of output, so you may wish to pipe it to `less' (or
1731      `more') or redirect to a file.
1733 `--dry-run'
1734 `-n'
1735      Don't run any commands that modify the file system, just print them
1736      out.
1738 `--force'
1739 `-f'
1740      Replace existing libtool files.  By default, `libtoolize' won't
1741      overwrite existing files.
1743 `--help'
1744      Display a help message and exit.
1746 `--ltdl'
1747      Install libltdl in a subdirectory of your package.
1749 `--ltdl-tar'
1750      Add the file libltdl.tar.gz to your package.
1752 `--version'
1753      Print `libtoolize' version information and exit.
1755    If `libtoolize' detects an explicit call to `AC_CONFIG_AUX_DIR'
1756 (*note The Autoconf Manual: (autoconf)Input.) in your `configure.in', it
1757 will put the files in the specified directory.
1759    `libtoolize' displays hints for adding libtool support to your
1760 package, as well.
1762 \x1f
1763 File: libtool.info,  Node: Autoconf .o macros,  Prev: Invoking libtoolize,  Up: Distributing
1765 5.4.2 Autoconf `.o' macros
1766 --------------------------
1768 The Autoconf package comes with a few macros that run tests, then set a
1769 variable corresponding to the name of an object file.  Sometimes it is
1770 necessary to use corresponding names for libtool objects.
1772    Here are the names of variables that list libtool objects:
1774  -- Variable: LTALLOCA
1775      Substituted by `AC_FUNC_ALLOCA' (*note Particular Function Checks:
1776      (autoconf)Particular Functions.).  Is either empty, or contains
1777      `alloca.lo'.
1779  -- Variable: LTLIBOBJS
1780      Substituted by `AC_REPLACE_FUNCS' (*note Generic Function Checks:
1781      (autoconf)Generic Functions.), and a few other functions.
1783    Unfortunately, the stable release of Autoconf (2.13, at the time of
1784 this writing) does not have any way for libtool to provide support for
1785 these variables.  So, if you depend on them, use the following code
1786 immediately before the call to `AC_OUTPUT' in your `configure.in':
1788      LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
1789      AC_SUBST(LTLIBOBJS)
1790      LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
1791      AC_SUBST(LTALLOCA)
1792      AC_OUTPUT(...)
1794 \x1f
1795 File: libtool.info,  Node: Static-only libraries,  Prev: Distributing,  Up: Integrating libtool
1797 5.5 Static-only libraries
1798 =========================
1800 When you are developing a package, it is often worthwhile to configure
1801 your package with the `--disable-shared' flag, or to override the
1802 defaults for `AC_PROG_LIBTOOL' by using the `AC_DISABLE_SHARED'
1803 Autoconf macro (*note The `AC_PROG_LIBTOOL' macro: AC_PROG_LIBTOOL.).
1804 This prevents libtool from building shared libraries, which has several
1805 advantages:
1807    * compilation is twice as fast, which can speed up your development
1808      cycle,
1810    * debugging is easier because you don't need to deal with any
1811      complexities added by shared libraries, and
1813    * you can see how libtool behaves on static-only platforms.
1815    You may want to put a small note in your package `README' to let
1816 other developers know that `--disable-shared' can save them time.  The
1817 following example note is taken from the GIMP(1) distribution `README':
1819      The GIMP uses GNU Libtool in order to build shared libraries on a
1820      variety of systems. While this is very nice for making usable
1821      binaries, it can be a pain when trying to debug a program. For that
1822      reason, compilation of shared libraries can be turned off by
1823      specifying the `--disable-shared' option to `configure'.
1825    ---------- Footnotes ----------
1827    (1) GNU Image Manipulation Program, for those who haven't taken the
1828 plunge.  See `http://www.gimp.org/'.
1830 \x1f
1831 File: libtool.info,  Node: Versioning,  Next: Library tips,  Prev: Integrating libtool,  Up: Top
1833 6 Library interface versions
1834 ****************************
1836 The most difficult issue introduced by shared libraries is that of
1837 creating and resolving runtime dependencies.  Dependencies on programs
1838 and libraries are often described in terms of a single name, such as
1839 `sed'.  So, one may say "libtool depends on sed," and that is good
1840 enough for most purposes.
1842    However, when an interface changes regularly, we need to be more
1843 specific: "Gnus 5.1 requires Emacs 19.28 or above."  Here, the
1844 description of an interface consists of a name, and a "version number."
1846    Even that sort of description is not accurate enough for some
1847 purposes.  What if Emacs 20 changes enough to break Gnus 5.1?
1849    The same problem exists in shared libraries: we require a formal
1850 version system to describe the sorts of dependencies that programs have
1851 on shared libraries, so that the dynamic linker can guarantee that
1852 programs are linked only against libraries that provide the interface
1853 they require.
1855 * Menu:
1857 * Interfaces::                  What are library interfaces?
1858 * Libtool versioning::          Libtool's versioning system.
1859 * Updating version info::       Changing version information before releases.
1860 * Release numbers::             Breaking binary compatibility for aesthetics.
1862 \x1f
1863 File: libtool.info,  Node: Interfaces,  Next: Libtool versioning,  Up: Versioning
1865 6.1 What are library interfaces?
1866 ================================
1868 Interfaces for libraries may be any of the following (and more):
1870    * global variables: both names and types
1872    * global functions: argument types and number, return types, and
1873      function names
1875    * standard input, standard output, standard error, and file formats
1877    * sockets, pipes, and other inter-process communication protocol
1878      formats
1880    Note that static functions do not count as interfaces, because they
1881 are not directly available to the user of the library.
1883 \x1f
1884 File: libtool.info,  Node: Libtool versioning,  Next: Updating version info,  Prev: Interfaces,  Up: Versioning
1886 6.2 Libtool's versioning system
1887 ===============================
1889 Libtool has its own formal versioning system.  It is not as flexible as
1890 some, but it is definitely the simplest of the more powerful versioning
1891 systems.
1893    Think of a library as exporting several sets of interfaces,
1894 arbitrarily represented by integers.  When a program is linked against
1895 a library, it may use any subset of those interfaces.
1897    Libtool's description of the interfaces that a program uses is
1898 simple: it encodes the least and the greatest interface numbers in the
1899 resulting binary (FIRST-INTERFACE, LAST-INTERFACE).
1901    The dynamic linker is guaranteed that if a library supports _every_
1902 interface number between FIRST-INTERFACE and LAST-INTERFACE, then the
1903 program can be relinked against that library.
1905    Note that this can cause problems because libtool's compatibility
1906 requirements are actually stricter than is necessary.
1908    Say `libhello' supports interfaces 5, 16, 17, 18, and 19, and that
1909 libtool is used to link `test' against `libhello'.
1911    Libtool encodes the numbers 5 and 19 in `test', and the dynamic
1912 linker will only link `test' against libraries that support _every_
1913 interface between 5 and 19.  So, the dynamic linker refuses to link
1914 `test' against `libhello'!
1916    In order to eliminate this problem, libtool only allows libraries to
1917 declare consecutive interface numbers.  So, `libhello' can declare at
1918 most that it supports interfaces 16 through 19.  Then, the dynamic
1919 linker will link `test' against `libhello'.
1921    So, libtool library versions are described by three integers:
1923 CURRENT
1924      The most recent interface number that this library implements.
1926 REVISION
1927      The implementation number of the CURRENT interface.
1930      The difference between the newest and oldest interfaces that this
1931      library implements.  In other words, the library implements all the
1932      interface numbers in the range from number `CURRENT - AGE' to
1933      `CURRENT'.
1935    If two libraries have identical CURRENT and AGE numbers, then the
1936 dynamic linker chooses the library with the greater REVISION number.
1938 \x1f
1939 File: libtool.info,  Node: Updating version info,  Next: Release numbers,  Prev: Libtool versioning,  Up: Versioning
1941 6.3 Updating library version information
1942 ========================================
1944 If you want to use libtool's versioning system, then you must specify
1945 the version information to libtool using the `-version-info' flag
1946 during link mode (*note Link mode::).
1948    This flag accepts an argument of the form
1949 `CURRENT[:REVISION[:AGE]]'.  So, passing `-version-info 3:12:1' sets
1950 CURRENT to 3, REVISION to 12, and AGE to 1.
1952    If either REVISION or AGE are omitted, they default to 0.  Also note
1953 that AGE must be less than or equal to the CURRENT interface number.
1955    Here are a set of rules to help you update your library version
1956 information:
1958   1. Start with version information of `0:0:0' for each libtool library.
1960   2. Update the version information only immediately before a public
1961      release of your software.  More frequent updates are unnecessary,
1962      and only guarantee that the current interface number gets larger
1963      faster.
1965   3. If the library source code has changed at all since the last
1966      update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
1968   4. If any interfaces have been added, removed, or changed since the
1969      last update, increment CURRENT, and set REVISION to 0.
1971   5. If any interfaces have been added since the last public release,
1972      then increment AGE.
1974   6. If any interfaces have been removed since the last public release,
1975      then set AGE to 0.
1977    *_Never_* try to set the interface numbers so that they correspond
1978 to the release number of your package.  This is an abuse that only
1979 fosters misunderstanding of the purpose of library versions.  Instead,
1980 use the `-release' flag (*note Release numbers::), but be warned that
1981 every release of your package will not be binary compatible with any
1982 other release.
1984 \x1f
1985 File: libtool.info,  Node: Release numbers,  Prev: Updating version info,  Up: Versioning
1987 6.4 Managing release information
1988 ================================
1990 Often, people want to encode the name of the package release into the
1991 shared library so that it is obvious to the user which package their
1992 programs are linked against.  This convention is used especially on
1993 GNU/Linux:
1995      trick$ ls /usr/lib/libbfd*
1996      /usr/lib/libbfd.a      /usr/lib/libbfd.so.2.7.0.2
1997      /usr/lib/libbfd.so
1998      trick$
2000    On `trick', `/usr/lib/libbfd.so' is a symbolic link to
2001 `libbfd.so.2.7.0.2', which was distributed as a part of
2002 `binutils-2.7.0.2'.
2004    Unfortunately, this convention conflicts directly with libtool's
2005 idea of library interface versions, because the library interface
2006 rarely changes at the same time that the release number does, and the
2007 library suffix is never the same across all platforms.
2009    So, in order to accommodate both views, you can use the `-release'
2010 flag in order to set release information for libraries which you do not
2011 want to use `-version-info'.  For the `libbfd' example, the next
2012 release which uses libtool should be built with `-release 2.9.0', which
2013 will produce the following files on GNU/Linux:
2015      trick$ ls /usr/lib/libbfd*
2016      /usr/lib/libbfd-2.9.0.so     /usr/lib/libbfd.a
2017      /usr/lib/libbfd.so
2018      trick$
2020    In this case, `/usr/lib/libbfd.so' is a symbolic link to
2021 `libbfd-2.9.0.so'.  This makes it obvious that the user is dealing with
2022 `binutils-2.9.0', without compromising libtool's idea of interface
2023 versions.
2025    Note that this option causes a modification of the library name, so
2026 do not use it unless you want to break binary compatibility with any
2027 past library releases.  In general, you should only use `-release' for
2028 package-internal libraries or for ones whose interfaces change very
2029 frequently.
2031 \x1f
2032 File: libtool.info,  Node: Library tips,  Next: Inter-library dependencies,  Prev: Versioning,  Up: Top
2034 7 Tips for interface design
2035 ***************************
2037 Writing a good library interface takes a lot of practice and thorough
2038 understanding of the problem that the library is intended to solve.
2040    If you design a good interface, it won't have to change often, you
2041 won't have to keep updating documentation, and users won't have to keep
2042 relearning how to use the library.
2044    Here is a brief list of tips for library interface design, which may
2045 help you in your exploits:
2047 Plan ahead
2048      Try to make every interface truly minimal, so that you won't need
2049      to delete entry points very often.
2051 Avoid interface changes
2052      Some people love redesigning and changing entry points just for
2053      the heck of it (note: _renaming_ a function is considered changing
2054      an entry point).  Don't be one of those people.  If you must
2055      redesign an interface, then try to leave compatibility functions
2056      behind so that users don't need to rewrite their existing code.
2058 Use opaque data types
2059      The fewer data type definitions a library user has access to, the
2060      better.  If possible, design your functions to accept a generic
2061      pointer (which you can cast to an internal data type), and provide
2062      access functions rather than allowing the library user to directly
2063      manipulate the data.  That way, you have the freedom to change the
2064      data structures without changing the interface.
2066      This is essentially the same thing as using abstract data types and
2067      inheritance in an object-oriented system.
2069 Use header files
2070      If you are careful to document each of your library's global
2071      functions and variables in header files, and include them in your
2072      library source files, then the compiler will let you know if you
2073      make any interface changes by accident (*note C header files::).
2075 Use the `static' keyword (or equivalent) whenever possible
2076      The fewer global functions your library has, the more flexibility
2077      you'll have in changing them.  Static functions and variables may
2078      change forms as often as you like... your users cannot access
2079      them, so they aren't interface changes.
2081 Be careful with array dimensions
2082      The number of elements in a global array is part of an interface,
2083      even if the header just declares `extern int foo[];'.  This is
2084      because on i386 and some other SVR4/ELF systems, when an
2085      application references data in a shared library the size of that
2086      data (whatever its type) is included in the application
2087      executable.  If you might want to change the size of an array or
2088      string then provide a pointer not the actual array.
2090 * Menu:
2092 * C header files::              How to write portable include files.
2094 \x1f
2095 File: libtool.info,  Node: C header files,  Up: Library tips
2097 7.1 Writing C header files
2098 ==========================
2100 Writing portable C header files can be difficult, since they may be read
2101 by different types of compilers:
2103 C++ compilers
2104      C++ compilers require that functions be declared with full
2105      prototypes, since C++ is more strongly typed than C.  C functions
2106      and variables also need to be declared with the `extern "C"'
2107      directive, so that the names aren't mangled.  *Note C++
2108      libraries::, for other issues relevant to using C++ with libtool.
2110 ANSI C compilers
2111      ANSI C compilers are not as strict as C++ compilers, but functions
2112      should be prototyped to avoid unnecessary warnings when the header
2113      file is `#include'd.
2115 non-ANSI C compilers
2116      Non-ANSI compilers will report errors if functions are prototyped.
2118    These complications mean that your library interface headers must use
2119 some C preprocessor magic in order to be usable by each of the above
2120 compilers.
2122    `foo.h' in the `demo' subdirectory of the libtool distribution
2123 serves as an example for how to write a header file that can be safely
2124 installed in a system directory.
2126    Here are the relevant portions of that file:
2128      /* BEGIN_C_DECLS should be used at the beginning of your declarations,
2129         so that C++ compilers don't mangle their names.  Use END_C_DECLS at
2130         the end of C declarations. */
2131      #undef BEGIN_C_DECLS
2132      #undef END_C_DECLS
2133      #ifdef __cplusplus
2134      # define BEGIN_C_DECLS extern "C" {
2135      # define END_C_DECLS }
2136      #else
2137      # define BEGIN_C_DECLS /* empty */
2138      # define END_C_DECLS /* empty */
2139      #endif
2141      /* PARAMS is a macro used to wrap function prototypes, so that
2142         compilers that don't understand ANSI C prototypes still work,
2143         and ANSI C compilers can issue warnings about type mismatches. */
2144      #undef PARAMS
2145      #if defined (__STDC__) || defined (_AIX) \
2146              || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
2147              || defined(WIN32) || defined(__cplusplus)
2148      # define PARAMS(protos) protos
2149      #else
2150      # define PARAMS(protos) ()
2151      #endif
2153    These macros are used in `foo.h' as follows:
2155      #ifndef FOO_H
2156      #define FOO_H 1
2158      /* The above macro definitions. */
2159      #include "..."
2161      BEGIN_C_DECLS
2163      int foo PARAMS((void));
2164      int hello PARAMS((void));
2166      END_C_DECLS
2168      #endif /* !FOO_H */
2170    Note that the `#ifndef FOO_H' prevents the body of `foo.h' from
2171 being read more than once in a given compilation.
2173    Also the only thing that must go outside the
2174 `BEGIN_C_DECLS'/`END_C_DECLS' pair are `#include' lines.  Strictly
2175 speaking it is only C symbol names that need to be protected, but your
2176 header files will be more maintainable if you have a single pair of of
2177 these macros around the majority of the header contents.
2179    You should use these definitions of `PARAMS', `BEGIN_C_DECLS', and
2180 `END_C_DECLS' into your own headers.  Then, you may use them to create
2181 header files that are valid for C++, ANSI, and non-ANSI compilers(1).
2183    Do not be naive about writing portable code.  Following the tips
2184 given above will help you miss the most obvious problems, but there are
2185 definitely other subtle portability issues.  You may need to cope with
2186 some of the following issues:
2188    * Pre-ANSI compilers do not always support the `void *' generic
2189      pointer type, and so need to use `char *' in its place.
2191    * The `const', `inline' and `signed' keywords are not supported by
2192      some compilers, especially pre-ANSI compilers.
2194    * The `long double' type is not supported by many compilers.
2196    ---------- Footnotes ----------
2198    (1) We used to recommend `__P', `__BEGIN_DECLS' and `__END_DECLS'.
2199 This was bad advice since symbols (even preprocessor macro names) that
2200 begin with an underscore are reserved for the use of the compiler.
2202 \x1f
2203 File: libtool.info,  Node: Inter-library dependencies,  Next: Dlopened modules,  Prev: Library tips,  Up: Top
2205 8 Inter-library dependencies
2206 ****************************
2208 By definition, every shared library system provides a way for
2209 executables to depend on libraries, so that symbol resolution is
2210 deferred until runtime.
2212    An "inter-library dependency" is one in which a library depends on
2213 other libraries.  For example, if the libtool library `libhello' uses
2214 the `cos' function, then it has an inter-library dependency on `libm',
2215 the math library that implements `cos'.
2217    Some shared library systems provide this feature in an
2218 internally-consistent way: these systems allow chains of dependencies of
2219 potentially infinite length.
2221    However, most shared library systems are restricted in that they only
2222 allow a single level of dependencies.  In these systems, programs may
2223 depend on shared libraries, but shared libraries may not depend on other
2224 shared libraries.
2226    In any event, libtool provides a simple mechanism for you to declare
2227 inter-library dependencies: for every library `libNAME' that your own
2228 library depends on, simply add a corresponding `-lNAME' option to the
2229 link line when you create your library.  To make an example of our
2230 `libhello' that depends on `libm':
2232      burger$ libtool --mode=link gcc -g -O -o libhello.la foo.lo hello.lo \
2233                      -rpath /usr/local/lib -lm
2234      burger$
2236    When you link a program against `libhello', you don't need to
2237 specify the same `-l' options again: libtool will do that for you, in
2238 order to guarantee that all the required libraries are found.  This
2239 restriction is only necessary to preserve compatibility with static
2240 library systems and simple dynamic library systems.
2242    Some platforms, such as AIX, do not even allow you this flexibility.
2243 In order to build a shared library, it must be entirely self-contained
2244 (that is, have references only to symbols that are found in the `.lo'
2245 files or the specified `-l' libraries), and you need to specify the
2246 `-no-undefined' flag.  By default, libtool builds only static libraries
2247 on these kinds of platforms.
2249    The simple-minded inter-library dependency tracking code of libtool
2250 releases prior to 1.2 was disabled because it was not clear when it was
2251 possible to link one library with another, and complex failures would
2252 occur.  A more complex implementation of this concept was re-introduced
2253 before release 1.3, but it has not been ported to all platforms that
2254 libtool supports.  The default, conservative behavior is to avoid
2255 linking one library with another, introducing their inter-dependencies
2256 only when a program is linked with them.
2258 \x1f
2259 File: libtool.info,  Node: Dlopened modules,  Next: Using libltdl,  Prev: Inter-library dependencies,  Up: Top
2261 9 Dlopened modules
2262 ******************
2264 It can sometimes be confusing to discuss "dynamic linking", because the
2265 term is used to refer to two different concepts:
2267   1. Compiling and linking a program against a shared library, which is
2268      resolved automatically at run time by the dynamic linker.  In this
2269      process, dynamic linking is transparent to the application.
2271   2. The application calling functions such as `dlopen',(1) which load
2272      arbitrary, user-specified modules at runtime.  This type of dynamic
2273      linking is explicitly controlled by the application.
2275    To mitigate confusion, this manual refers to the second type of
2276 dynamic linking as "dlopening" a module.
2278    The main benefit to dlopening object modules is the ability to access
2279 compiled object code to extend your program, rather than using an
2280 interpreted language.  In fact, dlopen calls are frequently used in
2281 language interpreters to provide an efficient way to extend the
2282 language.
2284    As of version 1.5.24, libtool provides support for dlopened modules.
2285 However, you should indicate that your package is willing to use such
2286 support, by using the macro `AC_LIBTOOL_DLOPEN' in `configure.in'.  If
2287 this macro is not used (or it is used _after_ `AC_PROG_LIBTOOL'),
2288 libtool will assume no dlopening mechanism is available, and will try
2289 to simulate it.
2291    This chapter discusses how you as a dlopen application developer
2292 might use libtool to generate dlopen-accessible modules.
2294 * Menu:
2296 * Building modules::            Creating dlopenable objects and libraries.
2297 * Dlpreopening::                Dlopening that works on static platforms.
2298 * Finding the dlname::          Choosing the right file to `dlopen'.
2299 * Dlopen issues::               Unresolved problems that need your attention.
2301    ---------- Footnotes ----------
2303    (1) HP-UX, to be different, uses a function named `shl_load'.
2305 \x1f
2306 File: libtool.info,  Node: Building modules,  Next: Dlpreopening,  Up: Dlopened modules
2308 9.1 Building modules to dlopen
2309 ==============================
2311 On some operating systems, a program symbol must be specially declared
2312 in order to be dynamically resolved with the `dlsym' (or equivalent)
2313 function.
2315    Libtool provides the `-export-dynamic' and `-module' link flags
2316 (*note Link mode::), which do this declaration.  You need to use these
2317 flags if you are linking an application program that dlopens other
2318 modules or a libtool library that will also be dlopened.
2320    For example, if we wanted to build a shared library, `libhello',
2321 that would later be dlopened by an application, we would add `-module'
2322 to the other link flags:
2324      burger$ libtool --mode=link gcc -module -o libhello.la foo.lo \
2325                      hello.lo -rpath /usr/local/lib -lm
2326      burger$
2328    If symbols from your _executable_ are needed to satisfy unresolved
2329 references in a library you want to dlopen you will have to use the flag
2330 `-export-dynamic'.  You should use `-export-dynamic' while linking the
2331 executable that calls dlopen:
2333      burger$ libtool --mode=link gcc -export-dynamic -o hell-dlopener main.o
2334      burger$
2336 \x1f
2337 File: libtool.info,  Node: Dlpreopening,  Next: Finding the dlname,  Prev: Building modules,  Up: Dlopened modules
2339 9.2 Dlpreopening
2340 ================
2342 Libtool provides special support for dlopening libtool object and
2343 libtool library files, so that their symbols can be resolved _even on
2344 platforms without any `dlopen' and `dlsym' functions_.
2346    Consider the following alternative ways of loading code into your
2347 program, in order of increasing "laziness":
2349   1. Linking against object files that become part of the program
2350      executable, whether or not they are referenced.  If an object file
2351      cannot be found, then the linker refuses to create the executable.
2353   2. Declaring a static library to the linker, so that it is searched
2354      at link time in order to satisfy any undefined references in the
2355      above object files.  If the static library cannot be found, then
2356      the linker refuses to link the executable.
2358   3. Declaring a shared library to the runtime linker, so that it is
2359      searched at runtime in order to satisfy any undefined references
2360      in the above files.  If the shared library cannot be found, then
2361      the dynamic linker aborts the program before it runs.
2363   4. Dlopening a module, so that the application can resolve its own,
2364      dynamically-computed references.  If there is an error opening the
2365      module, or the module is not found, then the application can
2366      recover without crashing.
2368    Libtool emulates `-dlopen' on static platforms by linking objects
2369 into the program at compile time, and creating data structures that
2370 represent the program's symbol table.
2372    In order to use this feature, you must declare the objects you want
2373 your application to dlopen by using the `-dlopen' or `-dlpreopen' flags
2374 when you link your program (*note Link mode::).
2376  -- Structure: struct lt_dlsymlist { const char *NAME; lt_ptr ADDRESS; }
2377      The NAME attribute is a null-terminated character string of the
2378      symbol name, such as `"fprintf"'.  The ADDRESS attribute is a
2379      generic pointer to the appropriate object, such as `&fprintf'.
2381  -- Variable: const lt_dlsymlist * lt_preloaded_symbols
2382      An array of LT_SYMBOL structures, representing all the preloaded
2383      symbols linked into the program. For each `-dlpreopen'ed file
2384      there is an element with the NAME of the file and a ADDRESS of
2385      `0', followed by all symbols exported from this file.  For the
2386      executable itself the special name @PROGRAM@ is used.  The last
2387      element has a NAME and ADDRESS of `0'.
2389    Some compilers may allow identifiers which are not valid in ANSI C,
2390 such as dollar signs.  Libtool only recognizes valid ANSI C symbols (an
2391 initial ASCII letter or underscore, followed by zero or more ASCII
2392 letters, digits, and underscores), so non-ANSI symbols will not appear
2393 in LT_PRELOADED_SYMBOLS.
2395 \x1f
2396 File: libtool.info,  Node: Finding the dlname,  Next: Dlopen issues,  Prev: Dlpreopening,  Up: Dlopened modules
2398 9.3 Finding the correct name to dlopen
2399 ======================================
2401 After a library has been linked with `-module', it can be dlopened.
2402 Unfortunately, because of the variation in library names, your package
2403 needs to determine the correct file to dlopen.
2405    The most straightforward and flexible implementation is to determine
2406 the name at runtime, by finding the installed `.la' file, and searching
2407 it for the following lines:
2409      # The name that we can `dlopen'.
2410      dlname='DLNAME'
2412    If DLNAME is empty, then the library cannot be dlopened.  Otherwise,
2413 it gives the dlname of the library.  So, if the library was installed
2414 as `/usr/local/lib/libhello.la', and the DLNAME was `libhello.so.3',
2415 then `/usr/local/lib/libhello.so.3' should be dlopened.
2417    If your program uses this approach, then it should search the
2418 directories listed in the `LD_LIBRARY_PATH'(1) environment variable, as
2419 well as the directory where libraries will eventually be installed.
2420 Searching this variable (or equivalent) will guarantee that your
2421 program can find its dlopened modules, even before installation,
2422 provided you have linked them using libtool.
2424    ---------- Footnotes ----------
2426    (1) `LIBPATH' on AIX, and `SHLIB_PATH' on HP-UX.
2428 \x1f
2429 File: libtool.info,  Node: Dlopen issues,  Prev: Finding the dlname,  Up: Dlopened modules
2431 9.4 Unresolved dlopen issues
2432 ============================
2434 The following problems are not solved by using libtool's dlopen support:
2436    * Dlopen functions are generally only available on shared library
2437      platforms.  If you want your package to be portable to static
2438      platforms, you have to use either libltdl (*note Using libltdl::)
2439      or develop your own alternatives to dlopening dynamic code.  Most
2440      reasonable solutions involve writing wrapper functions for the
2441      `dlopen' family, which do package-specific tricks when dlopening
2442      is unsupported or not available on a given platform.
2444    * There are major differences in implementations of the `dlopen'
2445      family of functions.  Some platforms do not even use the same
2446      function names (notably HP-UX, with its `shl_load' family).
2448    * The application developer must write a custom search function in
2449      order to discover the correct module filename to supply to
2450      `dlopen'.
2452 \x1f
2453 File: libtool.info,  Node: Using libltdl,  Next: Other languages,  Prev: Dlopened modules,  Up: Top
2455 10 Using libltdl
2456 ****************
2458 Libtool provides a small library, called `libltdl', that aims at hiding
2459 the various difficulties of dlopening libraries from programmers.  It
2460 consists of a header-file and a small C source file that can be
2461 distributed with applications that need dlopening functionality.  On
2462 some platforms, whose dynamic linkers are too limited for a simple
2463 implementation of `libltdl' services, it requires GNU DLD, or it will
2464 only emulate dynamic linking with libtool's dlpreopening mechanism.
2466 libltdl supports currently the following dynamic linking mechanisms:
2468    * `dlopen' (Solaris, Linux and various BSD flavors)
2470    * `shl_load' (HP-UX)
2472    * `LoadLibrary' (Win16 and Win32)
2474    * `load_add_on' (BeOS)
2476    * GNU DLD (emulates dynamic linking for static libraries)
2478    * libtool's dlpreopen (see *note Dlpreopening::)
2480 libltdl is licensed under the terms of the GNU Library General Public
2481 License, with the following exception:
2483      As a special exception to the GNU Lesser General Public License,
2484      if you distribute this file as part of a program or library that
2485      is built using GNU libtool, you may include it under the same
2486      distribution terms that you use for the rest of that program.
2488 * Menu:
2490 * Libltdl interface::           How to use libltdl in your programs.
2491 * Modules for libltdl::         Creating modules that can be `dlopen'ed.
2492 * Thread Safety in libltdl::    Registering callbacks for multi-thread safety.
2493 * User defined module data::    Associating data with loaded modules.
2494 * Module loaders for libltdl::  Creating user defined module loaders.
2495 * Distributing libltdl::        How to distribute libltdl with your package.
2497 \x1f
2498 File: libtool.info,  Node: Libltdl interface,  Next: Modules for libltdl,  Up: Using libltdl
2500 10.1 How to use libltdl in your programs
2501 ========================================
2503 The libltdl API is similar to the dlopen interface of Solaris and Linux,
2504 which is very simple but powerful.
2506 To use libltdl in your program you have to include the header file
2507 `ltdl.h':
2509      #include <ltdl.h>
2511 The last release of libltdl used some symbols that violated the POSIX
2512 namespace conventions.  These symbols are now deprecated, and have been
2513 replaced by those described here.  If you have code that relies on the
2514 old deprecated symbol names, defining `LT_NON_POSIX_NAMESPACE' before
2515 you include `ltdl.h' provides conversion macros.  Whichever set of
2516 symbols you use, the new api is not binary compatible with the last, so
2517 you will need to recompile your application in order to use this
2518 version of libltdl.
2520 Note that libltdl is not threadsafe, i.e. a multithreaded application
2521 has to use a mutex for libltdl.  It was reported that GNU/Linux's glibc
2522 2.0's `dlopen' with `RTLD_LAZY' (which libltdl uses by default) is not
2523 thread-safe, but this problem is supposed to be fixed in glibc 2.1.  On
2524 the other hand, `RTLD_NOW' was reported to introduce problems in
2525 multi-threaded applications on FreeBSD.  Working around these problems
2526 is left as an exercise for the reader; contributions are certainly
2527 welcome.
2529 The following types are defined in `ltdl.h':
2531  -- Type: lt_ptr
2532      `lt_ptr' is a generic pointer.
2534  -- Type: lt_dlhandle
2535      `lt_dlhandle' is a module "handle".  Every lt_dlopened module has
2536      a handle associated with it.
2538  -- Type: lt_dlsymlist
2539      `lt_dlsymlist' is a symbol list for dlpreopened modules.  This
2540      structure is described in *note Dlpreopening::.
2542 libltdl provides the following functions:
2544  -- Function: int lt_dlinit (void)
2545      Initialize libltdl.  This function must be called before using
2546      libltdl and may be called several times.  Return 0 on success,
2547      otherwise the number of errors.
2549  -- Function: int lt_dlexit (void)
2550      Shut down libltdl and close all modules.  This function will only
2551      then shut down libltdl when it was called as many times as
2552      `lt_dlinit' has been successfully called.  Return 0 on success,
2553      otherwise the number of errors.
2555  -- Function: lt_dlhandle lt_dlopen (const char *FILENAME)
2556      Open the module with the file name FILENAME and return a handle
2557      for it.  `lt_dlopen' is able to open libtool dynamic modules,
2558      preloaded static modules, the program itself and native dynamic
2559      libraries.
2561      Unresolved symbols in the module are resolved using its dependency
2562      libraries (not implemented yet) and previously dlopened modules.
2563      If the executable using this module was linked with the
2564      `-export-dynamic' flag, then the global symbols in the executable
2565      will also be used to resolve references in the module.
2567      If FILENAME is `NULL' and the program was linked with
2568      `-export-dynamic' or `-dlopen self', `lt_dlopen' will return a
2569      handle for the program itself, which can be used to access its
2570      symbols.
2572      If libltdl cannot find the library and the file name FILENAME does
2573      not have a directory component it will additionally search in the
2574      following search paths for the module (in the order as follows):
2576        1. user-defined search path: This search path can be changed by
2577           the program using the functions `lt_dlsetsearchpath',
2578           `lt_dladdsearchdir' and `lt_dlinsertsearchdir'.
2580        2. libltdl's search path: This search path is the value of the
2581           environment variable LTDL_LIBRARY_PATH.
2583        3. system library search path: The system dependent library
2584           search path (e.g. on Linux it is LD_LIBRARY_PATH).
2586      Each search path must be a colon-separated list of absolute
2587      directories, for example, `"/usr/lib/mypkg:/lib/foo"'.
2589      If the same module is loaded several times, the same handle is
2590      returned.  If `lt_dlopen' fails for any reason, it returns `NULL'.
2592  -- Function: lt_dlhandle lt_dlopenext (const char *FILENAME)
2593      The same as `lt_dlopen', except that it tries to append different
2594      file name extensions to the file name.  If the file with the file
2595      name FILENAME cannot be found libltdl tries to append the
2596      following extensions:
2598        1. the libtool archive extension `.la'
2600        2. the extension used for native dynamic libraries on the host
2601           platform, e.g., `.so', `.sl', etc.
2603      This lookup strategy was designed to allow programs that don't
2604      have knowledge about native dynamic libraries naming conventions
2605      to be able to `dlopen' such libraries as well as libtool modules
2606      transparently.
2608  -- Function: int lt_dlclose (lt_dlhandle HANDLE)
2609      Decrement the reference count on the module HANDLE.  If it drops
2610      to zero and no other module depends on this module, then the
2611      module is unloaded.  Return 0 on success.
2613  -- Function: lt_ptr lt_dlsym (lt_dlhandle HANDLE, const char *NAME)
2614      Return the address in the module HANDLE, where the symbol given by
2615      the null-terminated string NAME is loaded.  If the symbol cannot
2616      be found, `NULL' is returned.
2618  -- Function: const char * lt_dlerror (void)
2619      Return a human readable string describing the most recent error
2620      that occurred from any of libltdl's functions.  Return `NULL' if
2621      no errors have occurred since initialization or since it was last
2622      called.
2624  -- Function: int lt_dlpreload (const lt_dlsymlist *PRELOADED)
2625      Register the list of preloaded modules PRELOADED.  If PRELOADED is
2626      `NULL', then all previously registered symbol lists, except the
2627      list set by `lt_dlpreload_default', are deleted. Return 0 on
2628      success.
2630  -- Function: int lt_dlpreload_default (const lt_dlsymlist *PRELOADED)
2631      Set the default list of preloaded modules to PRELOADED, which
2632      won't be deleted by `lt_dlpreload'.  Note that this function does
2633      _not_ require libltdl to be initialized using `lt_dlinit' and can
2634      be used in the program to register the default preloaded modules.
2635      Instead of calling this function directly, most programs will use
2636      the macro `LTDL_SET_PRELOADED_SYMBOLS'.
2638      Return 0 on success.
2640  -- Macro: LTDL_SET_PRELOADED_SYMBOLS
2641      Set the default list of preloaded symbols.  Should be used in your
2642      program to initialize libltdl's list of preloaded modules.
2644           #include <ltdl.h>
2646           int main() {
2647             /* ... */
2648             LTDL_SET_PRELOADED_SYMBOLS();
2649             /* ... */
2650           }
2652  -- Function: int lt_dladdsearchdir (const char *SEARCH_DIR)
2653      Append the search directory SEARCH_DIR to the current user-defined
2654      library search path. Return 0 on success.
2656  -- Function: int lt_dlinsertsearchdir (const char *BEFORE,
2657           const char *SEARCH_DIR)
2658      Insert the search directory SEARCH_DIR into the user-defined
2659      library search path, immediately before the element starting at
2660      address BEFORE.  If BEFORE is `NULL', then SEARCH_DIR is appending
2661      as if `lt_dladdsearchdir' had been called.  Return 0 on success.
2663  -- Function: int lt_dlsetsearchpath (const char *SEARCH_PATH)
2664      Replace the current user-defined library search path with
2665      SEARCH_PATH, which must be a colon-separated list of absolute
2666      directories.  Return 0 on success.
2668  -- Function: const char * lt_dlgetsearchpath (void)
2669      Return the current user-defined library search path.
2671  -- Function: int lt_dlforeachfile (const char *SEARCH_PATH,
2672           int (*FUNC) (const char *FILENAME, lt_ptr DATA), lt_ptr DATA)
2673      In some applications you may not want to load individual modules
2674      with known names, but rather find all of the modules in a set of
2675      directories and load them all during initialisation.  With this
2676      function you can have libltdl scan the colon delimited directory
2677      list in SEARCH_PATH for candidates, and pass them, along with DATA
2678      to your own callback function, FUNC.  If SEARCH_PATH is `NULL',
2679      then search all of the standard locations that `lt_dlopen' would
2680      examine.  This function will continue to make calls to FUNC for
2681      each file that it discovers in SEARCH_PATH until one of these
2682      calls returns non-zero, or until the files are exhausted.
2683      `lt_dlforeachfile' returns the value returned by the last call
2684      made to FUNC.
2686      For example you could define FUNC to build an ordered "argv"-like
2687      vector of files using DATA to hold the address of the start of the
2688      vector.
2690  -- Function: int lt_dlmakeresident (lt_dlhandle HANDLE)
2691      Mark a module so that it cannot be `lt_dlclose'd.  This can be
2692      useful if a module implements some core functionality in your
2693      project, which would cause your code to crash if removed.  Return
2694      0 on success.
2696      If you use `lt_dlopen (NULL)' to get a HANDLE for the running
2697      binary, that handle will always be marked as resident, and
2698      consequently cannot be successfully `lt_dlclose'd.
2700  -- Function: int lt_dlisresident (lt_dlhandle HANDLE)
2701      Check whether a particular module has been marked as resident,
2702      returning 1 if it has or 0 otherwise.  If there is an error while
2703      executing this function, return -1 and set an error message for
2704      retrieval with `lt_dlerror'.
2706  -- Variable: lt_ptr (*) (size_t SIZE) lt_dlmalloc
2707  -- Variable: lt_ptr (*) (lt_ptr PTR, size_t SIZE) lt_dlrealloc
2708  -- Variable: void (*) (lt_ptr PTR) lt_dlfree
2709      These variables are set to `malloc', `realloc' and `free' by
2710      default, but you can set them to any other functions that provide
2711      equivalent functionality.  If you change any of these function
2712      pointers, you will almost certainly need to change all three to
2713      point into the same malloc library.  Strange things will happen if
2714      you allocate memory from one library, and then pass it to an
2715      implementation of `free' that doesn't know what book keeping the
2716      allocator used.
2718      You must not modify any of their values after calling any libltdl
2719      function other than `lt_dlpreopen_default' or the macro
2720      `LTDL_SET_PRELOADED_SYMBOLS'.
2722 \x1f
2723 File: libtool.info,  Node: Modules for libltdl,  Next: Thread Safety in libltdl,  Prev: Libltdl interface,  Up: Using libltdl
2725 10.2 Creating modules that can be `dlopen'ed
2726 ============================================
2728 Libtool modules are like normal libtool libraries with a few exceptions:
2730    You have to link the module with libtool's `-module' switch, and you
2731 should link any program that is intended to dlopen the module with
2732 `-dlopen modulename.la' so that libtool can dlpreopen the module on
2733 platforms which don't support dlopening.  If the module depends on any
2734 other libraries, make sure you specify them either when you link the
2735 module or when you link programs that dlopen it.  If you want to
2736 disable *note Versioning:: for a specific module you should link it
2737 with the `-avoid-version' switch.  Note that libtool modules don't need
2738 to have a "lib" prefix.  However, automake 1.4 or higher is required to
2739 build such modules.
2741    Usually a set of modules provide the same interface, i.e, exports
2742 the same symbols, so that a program can dlopen them without having to
2743 know more about their internals.  In order to avoid symbol conflicts
2744 all exported symbols must be prefixed with "modulename_LTX_"
2745 (`modulename' is the name of the module).  Internal symbols must be
2746 named in such a way that they won't conflict with other modules, for
2747 example, by prefixing them with "_modulename_".  Although some
2748 platforms support having the same symbols defined more than once it is
2749 generally not portable and it makes it impossible to dlpreopen such
2750 modules.  libltdl will automatically cut the prefix off to get the real
2751 name of the symbol.  Additionally, it supports modules which don't use
2752 a prefix so that you can also dlopen non-libtool modules.
2754    `foo1.c' gives an example of a portable libtool module.  Exported
2755 symbols are prefixed with "foo1_LTX_", internal symbols with "_foo1_".
2756 Aliases are defined at the beginning so that the code is more readable.
2758      /* aliases for the exported symbols */
2759      #define foo        foo1_LTX_foo
2760      #define bar        foo1_LTX_bar
2762      /* a global variable definition */
2763      int bar = 1;
2765      /* a private function */
2766      int _foo1_helper() {
2767        return bar;
2768      }
2770      /* an exported function */
2771      int foo() {
2772        return _foo1_helper();
2773      }
2775 The `Makefile.am' contains the necessary rules to build the module
2776 `foo1.la':
2778      ...
2779      lib_LTLIBRARIES = foo1.la
2781      foo1_la_SOURCES = foo1.c
2782      foo1_la_LDFLAGS = -module
2783      ...
2785 \x1f
2786 File: libtool.info,  Node: Thread Safety in libltdl,  Next: User defined module data,  Prev: Modules for libltdl,  Up: Using libltdl
2788 10.3 Using libltdl in a multi threaded environment
2789 ==================================================
2791 Using the `lt_dlmutex_register()' function, and by providing some
2792 appropriate callback function definitions, libltdl can be used in a
2793 multi-threaded environment.
2795  -- Type: void lt_dlmutex_lock (void)
2796      This is the type of a function pointer holding the address of a
2797      function which will be called at the start of parts of the libltdl
2798      implementation code which require a mutex lock.
2800      Because libltdl is inherently recursive, it is important that the
2801      locking mechanism employed by these callback functions are
2802      reentrant, or else strange problems will occur.
2804  -- Type: void lt_dlmutex_unlock (void)
2805      The type of a matching unlock function.
2807  -- Type: void lt_dlmutex_seterror (const char *ERROR);
2808      Many of the functions in the libltdl API have a special return
2809      value to indicate to the client that an error has occurred.
2810      Normally (in single threaded applications) a string describing
2811      that error can be retrieved from internal storage with
2812      `lt_dlerror()'.
2814      A function of this type must be registered with the library in
2815      order for it to work in a multi-threaded context.  The function
2816      should store any error message passed in thread local storage.
2818  -- Type: const char * lt_dlmutex_geterror (void)
2819      The type of a matching callback function to retrieve the last
2820      stored error message from thread local storage.
2822      When registered correctly this function will be used by
2823      `lt_dlerror())' from all threads to retrieve error messages for the
2824      client.
2826  -- Function: int lt_dlmutex_register (lt_dlmutex_lock *LOCK,
2827           lt_dlmutex_unlock *UNLOCK, lt_dlmutex_set_error *SETERROR,
2828           lt_dlmutex_geterror *GETERROR)
2829      Use this function to register one of each of function types
2830      described above in preparation for multi-threaded use of libltdl.
2831      All arguments must be valid non-`NULL' function addresses, or else
2832      all `NULL' to return to single threaded operation.
2834 \x1f
2835 File: libtool.info,  Node: User defined module data,  Next: Module loaders for libltdl,  Prev: Thread Safety in libltdl,  Up: Using libltdl
2837 10.4 Data associated with loaded modules
2838 ========================================
2840 Some of the internal information about each loaded module that is
2841 maintained by libltdl is available to the user, in the form of this
2842 structure:
2844  -- Type: struct lt_dlinfo { char *FILENAME; char *NAME; int REF_COUNT;
2845           }
2846      `lt_dlinfo' is used to store information about a module.  The
2847      FILENAME attribute is a null-terminated character string of the
2848      real module file name.  If the module is a libtool module then
2849      NAME is its module name (e.g. `"libfoo"' for `"dir/libfoo.la"'),
2850      otherwise it is set to `NULL'.  The REF_COUNT attribute is a
2851      reference counter that describes how often the same module is
2852      currently loaded.
2854    The following function will return a pointer to libltdl's internal
2855 copy of this structure for the given HANDLE:
2857  -- Function: const lt_dlinfo * lt_dlgetinfo (lt_dlhandle HANDLE)
2858      Return a pointer to a struct that contains some information about
2859      the module HANDLE.  The contents of the struct must not be
2860      modified.  Return `NULL' on failure.
2862    Furthermore, in order to save you from having to keep a list of the
2863 handles of all the modules you have loaded, these functions allow you to
2864 iterate over libltdl's list of loaded modules:
2866  -- Function: int lt_dlforeach
2867           (int (*FUNC) (lt_dlhandle HANDLE, lt_ptr DATA), lt_ptr DATA)
2868      For each loaded module call the function FUNC.  The argument
2869      HANDLE is the handle of one of the loaded modules, DATA is the
2870      DATA argument passed to `lt_dlforeach'.  As soon as FUNC returns a
2871      non-zero value for one of the handles, `lt_dlforeach' will stop
2872      calling FUNC and immediately return 1.  Otherwise 0 is returned.
2874  -- Function: lt_dlhandle lt_dlhandle_next (lt_dlhandle place)
2875      Iterate over the loaded module handles, returning the first handle
2876      in the list if PLACE is `NULL', and the next one on subsequent
2877      calls.  If PLACE is the last element in the list of loaded
2878      modules, this function returns `NULL'.
2880    Of course, you would still need to maintain your own list of loaded
2881 module handles to parallel the list maintained by libltdl if there are
2882 any other data that you need to associate with each handle for the
2883 purposes of your application.  However, if you use the following API
2884 calls to associate your application data with individual module handles
2885 as they are loaded there is actually no need to do that.  You must
2886 first obtain a unique caller id from libltdl which you subsequently use
2887 to retrieve the data you stored earlier.  This allows for different
2888 libraries that each wish to store their own data against loaded modules
2889 to do so without interfering with one another's data.
2891  -- Type: lt_dlcaller_id
2892      The opaque type used to hold individual data set keys.
2894  -- Function: lt_dlcaller_id lt_dlcaller_register (void)
2895      Use this to obtain a unique key to store and retrieve individual
2896      sets of per module data.
2898  -- Function: lt_ptr lt_dlcaller_set_data (lt_dlcaller_id KEY,
2899           lt_dlhandle HANDLE, lt_ptr DATA)
2900      Set DATA as the set of data uniquely associated with KEY and
2901      HANDLE for later retrieval.  This function returns the DATA
2902      previously associated with KEY and HANDLE if any.  A result of 0,
2903      may indicate that a diagnostic for the last error (if any) is
2904      available from `lt_dlerror()'.
2906      For example, to correctly remove some associated data:
2908               lt_ptr stale = lt_dlcaller_set_data (key, handle, 0);
2909               if (stale == NULL)
2910                 {
2911                   char *error_msg = lt_dlerror ();
2913                   if (error_msg != NULL)
2914                     {
2915                       my_error_handler (error_msg);
2916                       return STATUS_FAILED;
2917                     }
2918                 }
2919               else
2920                 {
2921                   free (stale);
2922                 }
2924  -- Function: lt_ptr lt_dlcaller_get_data (lt_dlcaller_id KEY,
2925           lt_dlhandle HANDLE)
2926      Return the address of the data associated with KEY and HANDLE, or
2927      else `NULL' if there is none.
2929    The preceding functions can be combined with `lt_dlforeach' to
2930 implement search and apply operations without the need for your
2931 application to track the modules that have been loaded and unloaded:
2933      int
2934      my_dlcaller_callback (lt_dlhandle handle, lt_ptr key_ptr)
2935      {
2936        struct my_module_data *my_data;
2938        my_data = lt_dlcaller_get_data (handle, (lt_dlcaller_id) *key_ptr);
2940        return process (my_data);
2941      }
2943      int
2944      my_dlcaller_foreach (lt_dlcaller_id key)
2945      {
2946        lt_dlforeach (my_dlcaller_callback, (lt_ptr) &key);
2947      }
2949 \x1f
2950 File: libtool.info,  Node: Module loaders for libltdl,  Next: Distributing libltdl,  Prev: User defined module data,  Up: Using libltdl
2952 10.5 How to create and register new module loaders
2953 ==================================================
2955 Sometimes libltdl's many ways of gaining access to modules are not
2956 sufficient for the purposes of a project.  You can write your own
2957 loader, and register it with libltdl so that `lt_dlopen' will be able
2958 to use it.
2960    Writing a loader involves writing at least three functions which can
2961 be called  by `lt_dlopen', `lt_dlsym' and `lt_dlclose'.  Optionally,
2962 you can provide a finalisation function to perform any cleanup
2963 operations when `lt_dlexit' executes, and a symbol prefix string which
2964 will be prepended to any symbols passed to `lt_dlsym'.  These functions
2965 must match the function pointer types below, after which they can be
2966 allocated to an instance of `lt_user_dlloader' and registered.
2968    Registering the loader requires that you choose a name for it, so
2969 that it can be recognised by `lt_dlloader_find' and removed with
2970 `lt_dlloader_remove'.  The name you choose must be unique, and not
2971 already in use by libltdl's builtin loaders:
2973 "dlopen"
2974      The system dynamic library loader, if one exists.
2976 "dld"
2977      The GNU dld loader, if `libdld' was installed when libltdl was
2978      built.
2980 "dlpreload"
2981      The loader for `lt_dlopen'ing of preloaded static modules.
2983    The prefix "dl" is reserved for loaders supplied with future
2984 versions of libltdl, so you should not use that for your own loader
2985 names.
2987 The following types are defined in `ltdl.h':
2989  -- Type: lt_module
2990      `lt_module' is a dlloader dependent module.  The dynamic module
2991      loader extensions communicate using these low level types.
2993  -- Type: lt_dlloader
2994      `lt_dlloader' is a handle for module loader types.
2996  -- Type: lt_user_data
2997      `lt_user_data' is used for specifying loader instance data.
2999  -- Type: struct lt_user_dlloader {const char *SYM_PREFIX;
3000           lt_module_open *MODULE_OPEN; lt_module_close *MODULE_CLOSE;
3001           lt_find_sym *FIND_SYM; lt_dlloader_exit *DLLOADER_EXIT; }
3002      If you want to define a new way to open dynamic modules, and have
3003      the `lt_dlopen' API use it, you need to instantiate one of these
3004      structures and pass it to `lt_dlloader_add'.  You can pass whatever
3005      you like in the DLLOADER_DATA field, and it will be passed back as
3006      the value of the first parameter to each of the functions
3007      specified in the function pointer fields.
3009  -- Type: lt_module lt_module_open (const char *FILENAME)
3010      The type of the loader function for an `lt_dlloader' module
3011      loader.  The value set in the dlloader_data field of the `struct
3012      lt_user_dlloader' structure will be passed into this function in
3013      the LOADER_DATA parameter.  Implementation of such a function
3014      should attempt to load the named module, and return an `lt_module'
3015      suitable for passing in to the associated `lt_module_close' and
3016      `lt_sym_find' function pointers.  If the function fails it should
3017      return `NULL', and set the error message with `lt_dlseterror'.
3019  -- Type: int lt_module_close (lt_user_data LOADER_DATA,
3020           lt_module MODULE)
3021      The type of the unloader function for a user defined module loader.
3022      Implementation of such a function should attempt to release any
3023      resources tied up by the MODULE module, and then unload it from
3024      memory.  If the function fails for some reason, set the error
3025      message with `lt_dlseterror' and return non-zero.
3027  -- Type: lt_ptr lt_find_sym (lt_module MODULE, const char *SYMBOL)
3028      The type of the symbol lookup function for a user defined module
3029      loader.  Implementation of such a function should return the
3030      address of the named SYMBOL in the module MODULE, or else set the
3031      error message with `lt_dlseterror' and return `NULL' if lookup
3032      fails.
3034  -- Type: int lt_dlloader_exit (lt_user_data LOADER_DATA)
3035      The type of the finalisation function for a user defined module
3036      loader.  Implementation of such a function should free any
3037      resources associated with the loader, including any user specified
3038      data in the `dlloader_data' field of the `lt_user_dlloader'.  If
3039      non-`NULL', the function will be called by `lt_dlexit', and
3040      `lt_dlloader_remove'.
3042    For example:
3044      int
3045      register_myloader (void)
3046      {
3047        lt_user_dlloader dlloader;
3049        /* User modules are responsible for their own initialisation. */
3050        if (myloader_init () != 0)
3051          return MYLOADER_INIT_ERROR;
3053        dlloader.sym_prefix    = NULL;
3054        dlloader.module_open   = myloader_open;
3055        dlloader.module_close  = myloader_close;
3056        dlloader.find_sym      = myloader_find_sym.
3057        dlloader.dlloader_exit = myloader_exit;
3058        dlloader.dlloader_data = (lt_user_data)myloader_function;
3060        /* Add my loader as the default module loader. */
3061        if (lt_dlloader_add (lt_dlloader_next (NULL), &dlloader, "myloader") \
3062                      != 0)
3063          return ERROR;
3065        return OK;
3066      }
3068    Note that if there is any initialisation required for the loader, it
3069 must be performed manually before the loader is registered - libltdl
3070 doesn't handle user loader initialisation.
3072    Finalisation _is_ handled by libltdl however, and it is important to
3073 ensure the `dlloader_exit' callback releases any resources claimed
3074 during the initialisation phase.
3076 libltdl provides the following functions for writing your own module
3077 loaders:
3079  -- Function: int lt_dlloader_add (lt_dlloader *PLACE,
3080           lt_user_dlloader *DLLOADER, const char *LOADER_NAME)
3081      Add a new module loader to the list of all loaders, either as the
3082      last loader (if PLACE is `NULL'), else immediately before the
3083      loader passed as PLACE.  LOADER_NAME will be returned by
3084      `lt_dlloader_name' if it is subsequently passed a newly registered
3085      loader.  These LOADER_NAMEs must be unique, or
3086      `lt_dlloader_remove' and `lt_dlloader_find' cannot work. Returns 0
3087      for success.
3089           {
3090             /* Make myloader be the last one. */
3091             if (lt_dlloader_add (NULL, myloader) != 0)
3092               perror (lt_dlerror ());
3093           }
3095  -- Function: int lt_dlloader_remove (const char *LOADER_NAME)
3096      Remove the loader identified by the unique name, LOADER_NAME.
3097      Before this can succeed, all modules opened by the named loader
3098      must have been closed.  Returns 0 for success, otherwise an error
3099      message can be obtained from `lt_dlerror'.
3101           {
3102             /* Remove myloader. */
3103             if (lt_dlloader_remove ("myloader") != 0)
3104               perror (lt_dlerror ());
3105           }
3107  -- Function: lt_dlloader * lt_dlloader_next (lt_dlloader *PLACE)
3108      Iterate over the module loaders, returning the first loader if
3109      PLACE is `NULL', and the next one on subsequent calls. The handle
3110      is for use with `lt_dlloader_add'.
3112           {
3113             /* Make myloader be the first one. */
3114             if (lt_dlloader_add (lt_dlloader_next (NULL), myloader) != 0)
3115               return ERROR;
3116           }
3118  -- Function: lt_dlloader * lt_dlloader_find (const char *LOADER_NAME)
3119      Return the first loader with a matching LOADER_NAME identifier, or
3120      else `NULL', if the identifier is not found.
3122      The identifiers which may be used by libltdl itself, if the host
3123      architecture supports them are "dlopen"(1), "dld" and "dlpreload".
3125           {
3126             /* Add a user loader as the next module loader to be tried if
3127                the standard dlopen loader were to fail when lt_dlopening. */
3128             if (lt_dlloader_add (lt_dlloader_find ("dlopen"), myloader) != 0)
3129               return ERROR;
3130           }
3132  -- Function: const char * lt_dlloader_name (lt_dlloader *PLACE)
3133      Return the identifying name of PLACE, as obtained from
3134      `lt_dlloader_next' or `lt_dlloader_find'.  If this function fails,
3135      it will return `NULL' and set an error for retrieval with
3136      `lt_dlerror'.
3138  -- Function: lt_user_data * lt_dlloader_data (lt_dlloader *PLACE)
3139      Return the address of the `dlloader_data' of PLACE, as obtained
3140      from `lt_dlloader_next' or `lt_dlloader_find'.  If this function
3141      fails, it will return `NULL' and set an error for retrieval with
3142      `lt_dlerror'.
3144 10.5.1 Error handling within user module loaders
3145 ------------------------------------------------
3147  -- Function: int lt_dladderror (const char *DIAGNOSTIC)
3148      This function allows you to integrate your own error messages into
3149      `lt_dlerror'.  Pass in a suitable diagnostic message for return by
3150      `lt_dlerror', and an error identifier for use with `lt_dlseterror'
3151      is returned.
3153      If the allocation of an identifier fails, this function returns -1.
3155           int myerror = lt_dladderror ("Doh!");
3156           if (myerror < 0)
3157             perror (lt_dlerror ());
3159  -- Function: int lt_dlseterror (int ERRORCODE)
3160      When writing your own module loaders, you should use this function
3161      to raise errors so that they are propagated through the
3162      `lt_dlerror' interface. All of the standard errors used by libltdl
3163      are declared in `ltdl.h', or you can add more of your own with
3164      `lt_dladderror'.  This function returns 0 on success.
3166           if (lt_dlseterror (LTDL_ERROR_NO_MEMORY) != 0)
3167             perror (lt_dlerror ());
3169 ---------- Footnotes ----------
3171    (1) This is used for the host dependent module loading API -
3172 `shl_load' and `LoadLibrary' for example
3174 \x1f
3175 File: libtool.info,  Node: Distributing libltdl,  Prev: Module loaders for libltdl,  Up: Using libltdl
3177 10.6 How to distribute libltdl with your package
3178 ================================================
3180 Even though libltdl is installed together with libtool, you may wish to
3181 include libltdl in the distribution of your package, for the convenience
3182 of users of your package that don't have libtool or libltdl installed.
3183 In this case, you must decide whether to manually add the `ltdl'
3184 objects to your package, or else which flavor of libltdl you want to
3185 use: a convenience library or an installable libtool library.
3187    The most simplistic way to add `libltdl' to your package is to copy
3188 the source files, `ltdl.c' and `ltdl.h', to a source directory within
3189 your package and to build and link them along with the rest of your
3190 sources.  To help you do this, the m4 macros for autoconf are available
3191 in `ltdl.m4'.  You must ensure that they are available in `aclocal.m4'
3192 before you run Autoconf - by appending the contents of `ltdl.m4' to
3193 `acinclude.m4', if you are using automake, or to `aclocal.m4' if you
3194 are not.  Having made the macros available, you must add a call to the
3195 `AC_LIB_LTDL' macro to your package's `configure.in' to perform the
3196 configure time checks required to build `ltdl.o' correctly.  This
3197 method has problems if you then try to link the package binaries with
3198 an installed libltdl, or a library which depends on libltdl: you may
3199 have problems with duplicate symbol definitions.
3201    One advantage of the convenience library is that it is not
3202 installed, so the fact that you use libltdl will not be apparent to the
3203 user, and it will not overwrite a pre-installed version of libltdl a
3204 user might have.  On the other hand, if you want to upgrade libltdl for
3205 any reason (e.g. a bugfix) you'll have to recompile your package
3206 instead of just replacing an installed version of libltdl.  However, if
3207 your programs or libraries are linked with other libraries that use
3208 such a pre-installed version of libltdl, you may get linker errors or
3209 run-time crashes.  Another problem is that you cannot link the
3210 convenience library into more than one libtool library, then link a
3211 single program with these libraries, because you may get duplicate
3212 symbols. In general you can safely use the convenience library in
3213 programs which don't depend on other libraries that might use libltdl
3214 too.  In order to enable this flavor of libltdl, you should add the
3215 line `AC_LIBLTDL_CONVENIENCE' to your `configure.in', _before_
3216 `AC_PROG_LIBTOOL'.
3218    In order to select the installable version of libltdl, you should
3219 add a call of the macro `AC_LIBLTDL_INSTALLABLE' to your `configure.in'
3220 _before_ `AC_PROG_LIBTOOL'.  This macro will check whether libltdl is
3221 already installed and, if not, request the libltdl embedded in your
3222 package to be built and installed.  Note, however, that no version
3223 checking is performed.  The user may override the test and determine
3224 that the libltdl embedded must be installed, regardless of the
3225 existence of another version, using the configure switch
3226 `--enable-ltdl-install'.
3228    In order to embed libltdl into your package, just add `--ltdl' to
3229 the `libtoolize' command line. It will copy the libltdl sources to a
3230 subdirectory `libltdl' in your package.  Both macros accept an optional
3231 argument to specify the location of the `libltdl' directory. By the
3232 default both macros assume that it is `${top_srcdir}/libltdl'.
3234    Whatever macro you use, it is up to you to ensure that your
3235 `configure.in' will configure libltdl, using `AC_CONFIG_SUBDIRS', and
3236 that your `Makefile's will start sub-makes within libltdl's directory,
3237 using automake's SUBDIRS, for example.  Both macros define the shell
3238 variables LIBLTDL, to the link flag that you should use to link with
3239 libltdl, and LTDLINCL, to the preprocessor flag that you should use to
3240 compile with programs that include `ltdl.h'.  It is up to you to use
3241 `AC_SUBST' to ensure that this variable will be available in
3242 `Makefile's, or add them to variables that are `AC_SUBST'ed by default,
3243 such as LIBS and CPPFLAGS.  Also note that you should not include
3244 `libltdl/Makefile' in the list of files to be configured from your
3245 toplevel `configure.in'; this is done by `libltdl/configure.ac'.
3247    If you're using the convenience libltdl, LIBLTDL will be the
3248 pathname for the convenience version of libltdl and LTDLINCL will be
3249 `-I' followed by the directory that contains libltdl, both starting
3250 with `${top_builddir}/' or `${top_srcdir}/', respectively.
3252    If you request an installed version of libltdl and one is found(1),
3253 LIBLTDL will be set to `-lltdl' and LTDLINCL will be empty (which is
3254 just a blind assumption that `ltdl.h' is somewhere in the include path
3255 if libltdl is in the library path).  If an installable version of
3256 libltdl must be built, its pathname, starting with `${top_builddir}/',
3257 will be stored in LIBLTDL, and LTDLINCL will be set just like in the
3258 case of convenience library.
3260    So, when you want to link a program with libltdl, be it a
3261 convenience, installed or installable library, just compile with
3262 `$(LTDLINCL)' and link it with `$(LIBLTDL)', using libtool.
3264    You should probably also add `AC_LIBTOOL_DLOPEN' to your
3265 `configure.in' _before_ `AC_PROG_LIBTOOL', otherwise libtool will
3266 assume no dlopening mechanism is supported, and revert to dlpreopening,
3267 which is probably not what you want.
3269    Avoid using the `-static', `-static-libtool-libs' or `-all-static'
3270 switches when linking programs with libltdl.  This will not work on all
3271 platforms, because the dlopening functions may not be available for
3272 static linking.
3274    The following example shows you how to embed the convenience libltdl
3275 in your package.  In order to use the installable variant just replace
3276 `AC_LIBLTDL_CONVENIENCE' with `AC_LIBLTDL_INSTALLABLE'.  We assume that
3277 libltdl was embedded using `libtoolize --ltdl'.
3279    configure.in:
3280      ...
3281      dnl Enable building of the convenience library
3282      dnl and set LIBLTDL accordingly
3283      AC_LIBLTDL_CONVENIENCE
3284      dnl Check for dlopen support
3285      AC_LIBTOOL_DLOPEN
3286      dnl Configure libtool
3287      AC_PROG_LIBTOOL
3288      dnl Configure libltdl
3289      AC_CONFIG_SUBDIRS(libltdl)
3290      ...
3292    Makefile.am:
3293      ...
3294      SUBDIRS = libltdl
3296      INCLUDES = $(LTDLINCL)
3298      myprog_LDFLAGS = -export-dynamic
3299      # The quotes around -dlopen below fool automake <= 1.4 into accepting it
3300      myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la
3301      myprog_DEPENDENCIES = $(LIBLTDL) foo1.la
3302      ...
3304    ---------- Footnotes ----------
3306    (1) Even if libltdl is installed, `AC_LIBLTDL_INSTALLABLE' may fail
3307 to detect it, if libltdl depends on symbols provided by libraries other
3308 than the C library.  In this case, it will needlessly build and install
3309 libltdl.
3311 \x1f
3312 File: libtool.info,  Node: Other languages,  Next: Troubleshooting,  Prev: Using libltdl,  Up: Top
3314 11 Using libtool with other languages
3315 *************************************
3317 Libtool was first implemented in order to add support for writing shared
3318 libraries in the C language.  However, over time, libtool is being
3319 integrated with other languages, so that programmers are free to reap
3320 the benefits of shared libraries in their favorite programming language.
3322    This chapter describes how libtool interacts with other languages,
3323 and what special considerations you need to make if you do not use C.
3325 * Menu:
3327 * C++ libraries::               Writing libraries for C++
3328 * Tags::                        Tags
3330 \x1f
3331 File: libtool.info,  Node: C++ libraries,  Next: Tags,  Up: Other languages
3333 11.1 Writing libraries for C++
3334 ==============================
3336 Creating libraries of C++ code should be a fairly straightforward
3337 process, because its object files differ from C ones in only three ways:
3339   1. Because of name mangling, C++ libraries are only usable by the C++
3340      compiler that created them.  This decision was made by the
3341      designers of C++ in order to protect users from conflicting
3342      implementations of features such as constructors, exception
3343      handling, and RTTI.
3345   2. On some systems, the C++ compiler must take special actions for the
3346      dynamic linker to run dynamic (i.e., run-time) initializers.  This
3347      means that we should not call `ld' directly to link such
3348      libraries, and we should use the C++ compiler instead.
3350   3. C++ compilers will link some Standard C++ library in by default,
3351      but libtool does not know which are these libraries, so it cannot
3352      even run the inter-library dependence analyzer to check how to
3353      link it in.  Therefore, running `ld' to link a C++ program or
3354      library is deemed to fail.
3356    Because of these three issues, Libtool has been designed to always
3357 use the C++ compiler to compile and link C++ programs and libraries.  In
3358 some instances the `main()' function of a program must also be compiled
3359 with the C++ compiler for static C++ objects to be properly initialized.
3361 \x1f
3362 File: libtool.info,  Node: Tags,  Prev: C++ libraries,  Up: Other languages
3364 11.2 Tags
3365 =========
3367 Libtool supports multiple languages through the use of tags.
3368 Technically a tag corresponds to a set of configuration variables
3369 associated with a language.  These variables tell `libtool' how it
3370 should create objects and libraries for each language.
3372    Tags are defined at `configure'-time for each language activated in
3373 the package.  Here is the correspondence between language names and tags
3374 names.
3376 Language name      Tag name
3377 C                  CC
3378 C++                CXX
3379 Java               GCJ
3380 Fortran 77         F77
3381 Windows Resource   RC
3383    `libtool' tries to automatically infer which tag to use from the
3384 compiler command being used to compile or link.  If it can't infer a
3385 tag, then it defaults to the configuration for the `C' language.
3387    The tag can also be specified using `libtool''s `--tag=TAG' option
3388 (*note Invoking libtool::).  It is a good idea to do so in `Makefile'
3389 rules, because that will allow users to substitute the compiler without
3390 relying on `libtool' inference heuristics.  When no tag is specified,
3391 `libtool' will default to `CC'; this tag always exists.
3393 \x1f
3394 File: libtool.info,  Node: Troubleshooting,  Next: Maintaining,  Prev: Other languages,  Up: Top
3396 12 Troubleshooting
3397 ******************
3399 Libtool is under constant development, changing to remain up-to-date
3400 with modern operating systems.  If libtool doesn't work the way you
3401 think it should on your platform, you should read this chapter to help
3402 determine what the problem is, and how to resolve it.
3404 * Menu:
3406 * Libtool test suite::          Libtool's self-tests.
3407 * Reporting bugs::              How to report problems with libtool.
3409 \x1f
3410 File: libtool.info,  Node: Libtool test suite,  Next: Reporting bugs,  Up: Troubleshooting
3412 12.1 The libtool test suite
3413 ===========================
3415 Libtool comes with its own set of programs that test its capabilities,
3416 and report obvious bugs in the libtool program.  These tests, too, are
3417 constantly evolving, based on past problems with libtool, and known
3418 deficiencies in other operating systems.
3420    As described in the `INSTALL' file, you may run `make check' after
3421 you have built libtool (possibly before you install it) in order to
3422 make sure that it meets basic functional requirements.
3424 * Menu:
3426 * Test descriptions::           The contents of the test suite.
3427 * When tests fail::             What to do when a test fails.
3429 \x1f
3430 File: libtool.info,  Node: Test descriptions,  Next: When tests fail,  Up: Libtool test suite
3432 12.1.1 Description of test suite
3433 --------------------------------
3435 Here is a list of the current programs in the test suite, and what they
3436 test for:
3438 `cdemo-conf.test'
3439 `cdemo-exec.test'
3440 `cdemo-make.test'
3441 `cdemo-static.test'
3442 `cdemo-shared.test'
3443      These programs check to see that the `cdemo' subdirectory of the
3444      libtool distribution can be configured and built correctly.
3446      The `cdemo' subdirectory contains a demonstration of libtool
3447      convenience libraries, a mechanism that allows build-time static
3448      libraries to be created, in a way that their components can be
3449      later linked into programs or other libraries, even shared ones.
3451      The tests `cdemo-make.test' and `cdemo-exec.test' are executed
3452      three times, under three different libtool configurations:
3453      `cdemo-conf.test' configures `cdemo/libtool' to build both static
3454      and shared libraries (the default for platforms that support
3455      both), `cdemo-static.test' builds only static libraries
3456      (`--disable-shared'), and `cdemo-shared.test' builds only shared
3457      libraries (`--disable-static').
3459 `demo-conf.test'
3460 `demo-exec.test'
3461 `demo-inst.test'
3462 `demo-make.test'
3463 `demo-unst.test'
3464 `demo-static.test'
3465 `demo-shared.test'
3466 `demo-nofast.test'
3467 `demo-pic.test'
3468 `demo-nopic.test'
3469      These programs check to see that the `demo' subdirectory of the
3470      libtool distribution can be configured, built, installed, and
3471      uninstalled correctly.
3473      The `demo' subdirectory contains a demonstration of a trivial
3474      package that uses libtool.  The tests `demo-make.test',
3475      `demo-exec.test', `demo-inst.test' and `demo-unst.test' are
3476      executed four times, under four different libtool configurations:
3477      `demo-conf.test' configures `demo/libtool' to build both static
3478      and shared libraries, `demo-static.test' builds only static
3479      libraries (`--disable-shared'), and `demo-shared.test' builds only
3480      shared libraries (`--disable-static').  `demo-nofast.test'
3481      configures `demo/libtool' to disable the fast-install mode
3482      (`--enable-fast-install=no').  `demo-pic.test' configures
3483      `demo/libtool' to prefer building PIC code (`--with-pic'),
3484      `demo-nopic.test' to prefer non-PIC code (`--without-pic').
3486 `deplibs.test'
3487      Many systems cannot link static libraries into shared libraries.
3488      libtool uses a `deplibs_check_method' to prevent such cases.  This
3489      tests checks whether libtool's `deplibs_check_method' works
3490      properly.
3492 `hardcode.test'
3493      On all systems with shared libraries, the location of the library
3494      can be encoded in executables that are linked against it *note
3495      Linking executables::.  This test checks the conditions under
3496      which your system linker hardcodes the library location, and
3497      guarantees that they correspond to libtool's own notion of how
3498      your linker behaves.
3500 `build-relink.test'
3501      Checks whether variable SHLIBPATH_OVERRIDES_RUNPATH is properly
3502      set.  If the test fails and VERBOSE is set, it will indicate what
3503      the variable should have been set to.
3505 `noinst-link.test'
3506      Checks whether libtool will not try to link with a previously
3507      installed version of a library when it should be linking with a
3508      just-built one.
3510 `depdemo-conf.test'
3511 `depdemo-exec.test'
3512 `depdemo-inst.test'
3513 `depdemo-make.test'
3514 `depdemo-unst.test'
3515 `depdemo-static.test'
3516 `depdemo-shared.test'
3517 `depdemo-nofast.test'
3518      These programs check to see that the `depdemo' subdirectory of the
3519      libtool distribution can be configured, built, installed, and
3520      uninstalled correctly.
3522      The `depdemo' subdirectory contains a demonstration of
3523      inter-library dependencies with libtool.  The test programs link
3524      some interdependent libraries.
3526      The tests `depdemo-make.test', `depdemo-exec.test',
3527      `depdemo-inst.test' and `depdemo-unst.test' are executed four
3528      times, under four different libtool configurations:
3529      `depdemo-conf.test' configures `depdemo/libtool' to build both
3530      static and shared libraries, `depdemo-static.test' builds only
3531      static libraries (`--disable-shared'), and `depdemo-shared.test'
3532      builds only shared libraries (`--disable-static').
3533      `depdemo-nofast.test' configures `depdemo/libtool' to disable the
3534      fast-install mode (`--enable-fast-install=no'.
3536 `mdemo-conf.test'
3537 `mdemo-exec.test'
3538 `mdemo-inst.test'
3539 `mdemo-make.test'
3540 `mdemo-unst.test'
3541 `mdemo-static.test'
3542 `mdemo-shared.test'
3543      These programs check to see that the `mdemo' subdirectory of the
3544      libtool distribution can be configured, built, installed, and
3545      uninstalled correctly.
3547      The `mdemo' subdirectory contains a demonstration of a package that
3548      uses libtool and the system independent dlopen wrapper `libltdl' to
3549      load modules.  The library `libltdl' provides a dlopen wrapper for
3550      various platforms (Linux, Solaris, HP/UX etc.) including support
3551      for dlpreopened modules (*note Dlpreopening::).
3553      The tests `mdemo-make.test', `mdemo-exec.test', `mdemo-inst.test'
3554      and `mdemo-unst.test' are executed three times, under three
3555      different libtool configurations: `mdemo-conf.test' configures
3556      `mdemo/libtool' to build both static and shared libraries,
3557      `mdemo-static.test' builds only static libraries
3558      (`--disable-shared'), and `mdemo-shared.test' builds only shared
3559      libraries (`--disable-static').
3561 `dryrun.test'
3562      This test checks whether libtool's `--dry-run' mode works properly.
3564 `assign.test'
3565      Checks whether we don't put break or continue on the same line as
3566      an assignment in the libtool script.
3568 `link.test'
3569      This test guarantees that linking directly against a non-libtool
3570      static library works properly.
3572 `link-2.test'
3573      This test makes sure that files ending in `.lo' are never linked
3574      directly into a program file.
3576 `nomode.test'
3577      Check whether we can actually get help for libtool.
3579 `quote.test'
3580      This program checks libtool's metacharacter quoting.
3582 `sh.test'
3583      Checks whether a `test' command was forgotten in libtool.
3585 `suffix.test'
3586      When other programming languages are used with libtool (*note
3587      Other languages::), the source files may end in suffixes other
3588      than `.c'.  This test validates that libtool can handle suffixes
3589      for all the file types that it supports, and that it fails when
3590      the suffix is invalid.
3593 \x1f
3594 File: libtool.info,  Node: When tests fail,  Prev: Test descriptions,  Up: Libtool test suite
3596 12.1.2 When tests fail
3597 ----------------------
3599 Each of the above tests are designed to produce no output when they are
3600 run via `make check'.  The exit status of each program tells the
3601 `Makefile' whether or not the test succeeded.
3603    If a test fails, it means that there is either a programming error in
3604 libtool, or in the test program itself.
3606    To investigate a particular test, you may run it directly, as you
3607 would a normal program.  When the test is invoked in this way, it
3608 produces output which may be useful in determining what the problem is.
3610    Another way to have the test programs produce output is to set the
3611 VERBOSE environment variable to `yes' before running them.  For
3612 example, `env VERBOSE=yes make check' runs all the tests, and has each
3613 of them display debugging information.
3615 \x1f
3616 File: libtool.info,  Node: Reporting bugs,  Prev: Libtool test suite,  Up: Troubleshooting
3618 12.2 Reporting bugs
3619 ===================
3621 If you think you have discovered a bug in libtool, you should think
3622 twice: the libtool maintainer is notorious for passing the buck (or
3623 maybe that should be "passing the bug").  Libtool was invented to fix
3624 known deficiencies in shared library implementations, so, in a way, most
3625 of the bugs in libtool are actually bugs in other operating systems.
3626 However, the libtool maintainer would definitely be happy to add support
3627 for somebody else's buggy operating system.  [I wish there was a good
3628 way to do winking smiley-faces in Texinfo.]
3630    Genuine bugs in libtool include problems with shell script
3631 portability, documentation errors, and failures in the test suite
3632 (*note Libtool test suite::).
3634    First, check the documentation and help screens to make sure that the
3635 behaviour you think is a problem is not already mentioned as a feature.
3637    Then, you should read the Emacs guide to reporting bugs (*note
3638 Reporting Bugs: (emacs)Bugs.).  Some of the details listed there are
3639 specific to Emacs, but the principle behind them is a general one.
3641    Finally, send a bug report to the libtool bug reporting address
3642 <bug-libtool@gnu.org> with any appropriate _facts_, such as test suite
3643 output (*note When tests fail::), all the details needed to reproduce
3644 the bug, and a brief description of why you think the behaviour is a
3645 bug.  Be sure to include the word "libtool" in the subject line, as
3646 well as the version number you are using (which can be found by typing
3647 `libtool --version').
3649 \x1f
3650 File: libtool.info,  Node: Maintaining,  Next: GNU Free Documentation License,  Prev: Troubleshooting,  Up: Top
3652 13 Maintenance notes for libtool
3653 ********************************
3655 This chapter contains information that the libtool maintainer finds
3656 important.  It will be of no use to you unless you are considering
3657 porting libtool to new systems, or writing your own libtool.
3659 * Menu:
3661 * New ports::                   How to port libtool to new systems.
3662 * Tested platforms::            When libtool was last tested.
3663 * Platform quirks::             Information about different library systems.
3664 * libtool script contents::     Configuration information that libtool uses.
3665 * Cheap tricks::                Making libtool maintainership easier.
3667 \x1f
3668 File: libtool.info,  Node: New ports,  Next: Tested platforms,  Up: Maintaining
3670 13.1 Porting libtool to new systems
3671 ===================================
3673 Before you embark on porting libtool to an unsupported system, it is
3674 worthwhile to send e-mail to the libtool mailing list
3675 <libtool@gnu.org>, to make sure that you are not duplicating existing
3676 work.
3678    If you find that any porting documentation is missing, please
3679 complain!  Complaints with patches and improvements to the
3680 documentation, or to libtool itself, are more than welcome.
3682 * Menu:
3684 * Information sources::         Where to find relevant documentation
3685 * Porting inter-library dependencies::  Implementation details explained
3687 \x1f
3688 File: libtool.info,  Node: Information sources,  Next: Porting inter-library dependencies,  Up: New ports
3690 13.1.1 Information sources
3691 --------------------------
3693 Once it is clear that a new port is necessary, you'll generally need the
3694 following information:
3696 canonical system name
3697      You need the output of `config.guess' for this system, so that you
3698      can make changes to the libtool configuration process without
3699      affecting other systems.
3701 man pages for `ld' and `cc'
3702      These generally describe what flags are used to generate PIC, to
3703      create shared libraries, and to link against only static
3704      libraries.  You may need to follow some cross references to find
3705      the information that is required.
3707 man pages for `ld.so', `rtld', or equivalent
3708      These are a valuable resource for understanding how shared
3709      libraries are loaded on the system.
3711 man page for `ldconfig', or equivalent
3712      This page usually describes how to install shared libraries.
3714 output from `ls -l /lib /usr/lib'
3715      This shows the naming convention for shared libraries on the
3716      system, including which names should be symbolic links.
3718 any additional documentation
3719      Some systems have special documentation on how to build and install
3720      shared libraries.
3722    If you know how to program the Bourne shell, then you can complete
3723 the port yourself; otherwise, you'll have to find somebody with the
3724 relevant skills who will do the work.  People on the libtool mailing
3725 list are usually willing to volunteer to help you with new ports, so
3726 you can send the information to them.
3728    To do the port yourself, you'll definitely need to modify the
3729 `libtool.m4' macros in order to make platform-specific changes to the
3730 configuration process.  You should search that file for the `PORTME'
3731 keyword, which will give you some hints on what you'll need to change.
3732 In general, all that is involved is modifying the appropriate
3733 configuration variables (*note libtool script contents::).
3735    Your best bet is to find an already-supported system that is similar
3736 to yours, and make your changes based on that.  In some cases, however,
3737 your system will differ significantly from every other supported system,
3738 and it may be necessary to add new configuration variables, and modify
3739 the `ltmain.in' script accordingly.  Be sure to write to the mailing
3740 list before you make changes to `ltmain.in', since they may have advice
3741 on the most effective way of accomplishing what you want.
3743 \x1f
3744 File: libtool.info,  Node: Porting inter-library dependencies,  Prev: Information sources,  Up: New ports
3746 13.1.2 Porting inter-library dependencies support
3747 -------------------------------------------------
3749 Since version 1.2c, libtool has re-introduced the ability to do
3750 inter-library dependency on some platforms, thanks to a patch by Toshio
3751 Kuratomi <badger@prtr-13.ucsc.edu>.  Here's a shortened version of the
3752 message that contained his patch:
3754    The basic architecture is this: in `libtool.m4', the person who
3755 writes libtool makes sure `$deplibs' is included in `$archive_cmds'
3756 somewhere and also sets the variable `$deplibs_check_method', and maybe
3757 `$file_magic_cmd' when `deplibs_check_method' is file_magic.
3759    `deplibs_check_method' can be one of five things:
3760 `file_magic [REGEX]'
3761      looks in the library link path for libraries that have the right
3762      libname.  Then it runs `$file_magic_cmd' on the library and checks
3763      for a match against the extended regular expression REGEX.  When
3764      FILE_MAGIC_TEST_FILE is set by `libtool.m4', it is used as an
3765      argument to `$file_magic_cmd' in order to verify whether the
3766      regular expression matches its output, and warn the user otherwise.
3768 `test_compile'
3769      just checks whether it is possible to link a program out of a list
3770      of libraries, and checks which of those are listed in the output of
3771      `ldd'.  It is currently unused, and will probably be dropped in the
3772      future.
3774 `pass_all'
3775      will pass everything without any checking.  This may work on
3776      platforms in which code is position-independent by default and
3777      inter-library dependencies are properly supported by the dynamic
3778      linker, for example, on DEC OSF/1 3 and 4.
3780 `none'
3781      It causes deplibs to be reassigned deplibs="".  That way
3782      `archive_cmds' can contain deplibs on all platforms, but not have
3783      deplibs used unless needed.
3785 `unknown'
3786      is the default for all systems unless overridden in `libtool.m4'.
3787      It is the same as `none', but it documents that we really don't
3788      know what the correct value should be, and we welcome patches that
3789      improve it.
3791    Then in `ltmain.in' we have the real workhorse: a little
3792 initialization and postprocessing (to setup/release variables for use
3793 with eval echo libname_spec etc.) and a case statement that decides
3794 which method is being used.  This is the real code... I wish I could
3795 condense it a little more, but I don't think I can without function
3796 calls.  I've mostly optimized it (moved things out of loops, etc.) but
3797 there is probably some fat left.  I thought I should stop while I was
3798 ahead, work on whatever bugs you discover, etc. before thinking about
3799 more than obvious optimizations.
3801 \x1f
3802 File: libtool.info,  Node: Tested platforms,  Next: Platform quirks,  Prev: New ports,  Up: Maintaining
3804 13.2 Tested platforms
3805 =====================
3807 This table describes when libtool was last known to be tested on
3808 platforms where it claims to support shared libraries:
3810      -------------------------------------------------------
3811      canonical host name          compiler  libtool results
3812        (tools versions)                     release
3813      -------------------------------------------------------
3814      alpha-dec-osf5.1           cc       1.3e     ok (1.910)
3815      alpha-dec-osf4.0f               gcc      1.3e     ok (1.910)
3816      alpha-dec-osf4.0f               cc       1.3e     ok (1.910)
3817      alpha-dec-osf3.2                gcc      0.8      ok
3818      alpha-dec-osf3.2                cc       0.8      ok
3819      alpha-dec-osf2.1                gcc      1.2f     NS
3820      alpha*-unknown-linux-gnu        gcc      1.3b     ok
3821        (egcs-1.1.2, GNU ld 2.9.1.0.23)
3822      hppa2.0w-hp-hpux11.00           cc       1.2f     ok
3823      hppa2.0-hp-hpux10.20            cc       1.3.2    ok
3824      hppa1.1-hp-hpux10.20            gcc      1.2f     ok
3825      hppa1.1-hp-hpux10.20            cc       1.3c     ok (1.821)
3826      hppa1.1-hp-hpux10.10            gcc      1.2f     ok
3827      hppa1.1-hp-hpux10.10            cc       1.2f     ok
3828      hppa1.1-hp-hpux9.07             gcc      1.2f     ok
3829      hppa1.1-hp-hpux9.07             cc       1.2f     ok
3830      hppa1.1-hp-hpux9.05             gcc      1.2f     ok
3831      hppa1.1-hp-hpux9.05             cc       1.2f     ok
3832      hppa1.1-hp-hpux9.01             gcc      1.2f     ok
3833      hppa1.1-hp-hpux9.01             cc       1.2f     ok
3834      i*86-*-beos                     gcc      1.2f     ok
3835      i*86-*-bsdi4.0.1                gcc      1.3c     ok
3836        (gcc-2.7.2.1)
3837      i*86-*-bsdi4.0                  gcc      1.2f     ok
3838      i*86-*-bsdi3.1                  gcc      1.2e     NS
3839      i*86-*-bsdi3.0                  gcc      1.2e     NS
3840      i*86-*-bsdi2.1                  gcc      1.2e     NS
3841      i*86-pc-cygwin                  gcc      1.3b     NS
3842        (egcs-1.1 stock b20.1 compiler)
3843      i*86-*-dguxR4.20MU01            gcc      1.2      ok
3844      i*86-*-freebsd4.3          gcc      1.3e     ok (1.912)
3845      i*86-*-freebsdelf4.0            gcc      1.3c     ok
3846        (egcs-1.1.2)
3847      i*86-*-freebsdelf3.2            gcc      1.3c     ok
3848        (gcc-2.7.2.1)
3849      i*86-*-freebsdelf3.1            gcc      1.3c     ok
3850        (gcc-2.7.2.1)
3851      i*86-*-freebsdelf3.0            gcc      1.3c     ok
3852      i*86-*-freebsd3.0               gcc      1.2e     ok
3853      i*86-*-freebsd2.2.8             gcc      1.3c     ok
3854        (gcc-2.7.2.1)
3855      i*86-*-freebsd2.2.6             gcc      1.3b     ok
3856        (egcs-1.1 & gcc-2.7.2.1, native ld)
3857      i*86-*-freebsd2.1.5             gcc      0.5      ok
3858      i*86-*-netbsd1.5                gcc      1.3e     ok (1.901)
3859        (egcs-1.1.2)
3860      i*86-*-netbsd1.4                gcc      1.3c     ok
3861        (egcs-1.1.1)
3862      i*86-*-netbsd1.4.3A             gcc      1.3e     ok (1.901)
3863      i*86-*-netbsd1.3.3              gcc      1.3c     ok
3864        (gcc-2.7.2.2+myc2)
3865      i*86-*-netbsd1.3.2              gcc      1.2e     ok
3866      i*86-*-netbsd1.3I               gcc      1.2e     ok
3867        (egcs 1.1?)
3868      i*86-*-netbsd1.2                gcc      0.9g     ok
3869      i*86-*-linux-gnu           gcc      1.3e     ok (1.901)
3870        (Red Hat 7.0, gcc "2.96")
3871      i*86-*-linux-gnu           gcc      1.3e     ok (1.911)
3872        (SuSE 7.0, gcc 2.95.2)
3873      i*86-*-linux-gnulibc1           gcc      1.2f     ok
3874      i*86-*-openbsd2.5               gcc      1.3c     ok
3875        (gcc-2.8.1)
3876      i*86-*-openbsd2.4               gcc      1.3c     ok
3877        (gcc-2.8.1)
3878      i*86-*-solaris2.7               gcc      1.3b     ok
3879        (egcs-1.1.2, native ld)
3880      i*86-*-solaris2.6               gcc      1.2f     ok
3881      i*86-*-solaris2.5.1             gcc      1.2f     ok
3882      i*86-ncr-sysv4.3.03             gcc      1.2f     ok
3883      i*86-ncr-sysv4.3.03             cc       1.2e     ok
3884        (cc -Hnocopyr)
3885      i*86-pc-sco3.2v5.0.5               cc       1.3c     ok
3886      i*86-pc-sco3.2v5.0.5               gcc      1.3c     ok
3887        (gcc 95q4c)
3888      i*86-pc-sco3.2v5.0.5               gcc      1.3c     ok
3889        (egcs-1.1.2)
3890      i*86-sco-sysv5uw7.1.1              gcc      1.3e     ok (1.901)
3891        (gcc-2.95.2, SCO linker)
3892      i*86-UnixWare7.1.0-sysv5   cc       1.3c     ok
3893      i*86-UnixWare7.1.0-sysv5   gcc      1.3c     ok
3894        (egcs-1.1.1)
3895      m68k-next-nextstep3             gcc      1.2f     NS
3896      m68k-sun-sunos4.1.1             gcc      1.2f     NS
3897        (gcc-2.5.7)
3898      m88k-dg-dguxR4.12TMU01          gcc      1.2      ok
3899      m88k-motorola-sysv4             gcc      1.3      ok
3900        (egcs-1.1.2)
3901      mips-sgi-irix6.5                gcc      1.2f     ok
3902        (gcc-2.8.1)
3903      mips-sgi-irix6.4                gcc      1.2f     ok
3904      mips-sgi-irix6.3                gcc      1.3b     ok
3905        (egcs-1.1.2, native ld)
3906      mips-sgi-irix6.3                cc       1.3b     ok
3907        (cc 7.0)
3908      mips-sgi-irix6.2                gcc      1.2f     ok
3909      mips-sgi-irix6.2                cc       0.9      ok
3910      mips-sgi-irix5.3                gcc      1.2f     ok
3911        (egcs-1.1.1)
3912      mips-sgi-irix5.3                gcc      1.2f     NS
3913        (gcc-2.6.3)
3914      mips-sgi-irix5.3                cc       0.8      ok
3915      mips-sgi-irix5.2                gcc      1.3b     ok
3916        (egcs-1.1.2, native ld)
3917      mips-sgi-irix5.2                cc       1.3b     ok
3918        (cc 3.18)
3919      mips-sni-sysv4                     cc       1.3.5    ok
3920        (Siemens C-compiler)
3921      mips-sni-sysv4                     gcc      1.3.5    ok
3922        (gcc-2.7.2.3, GNU assembler 2.8.1, native ld)
3923      mipsel-unknown-openbsd2.1       gcc      1.0      ok
3924      powerpc-apple-darwin6.4         gcc      1.5      ok
3925      (apple dev tools released 12/2002)
3926      powerpc-ibm-aix4.3.1.0          gcc      1.2f     ok
3927        (egcs-1.1.1)
3928      powerpc-ibm-aix4.2.1.0          gcc      1.2f     ok
3929        (egcs-1.1.1)
3930      powerpc-ibm-aix4.1.5.0          gcc      1.2f     ok
3931        (egcs-1.1.1)
3932      powerpc-ibm-aix4.1.5.0          gcc      1.2f     NS
3933        (gcc-2.8.1)
3934      powerpc-ibm-aix4.1.4.0          gcc      1.0      ok
3935      powerpc-ibm-aix4.1.4.0          xlc      1.0i     ok
3936      rs6000-ibm-aix4.1.5.0           gcc      1.2f     ok
3937        (gcc-2.7.2)
3938      rs6000-ibm-aix4.1.4.0           gcc      1.2f     ok
3939        (gcc-2.7.2)
3940      rs6000-ibm-aix3.2.5             gcc      1.0i     ok
3941      rs6000-ibm-aix3.2.5             xlc      1.0i     ok
3942      sparc-sun-solaris2.8               gcc      1.3e     ok (1.913)
3943        (gcc-2.95.3 & native ld)
3944      sparc-sun-solaris2.7            gcc      1.3e     ok (1.913)
3945        (gcc-2.95.3 & native ld)
3946      sparc-sun-solaris2.6            gcc      1.3e     ok (1.913)
3947        (gcc-2.95.3 & native ld)
3948      sparc-sun-solaris2.5.1          gcc      1.3e     ok (1.911)
3949      sparc-sun-solaris2.5            gcc      1.3b     ok
3950        (egcs-1.1.2, GNU ld 2.9.1 & native ld)
3951      sparc-sun-solaris2.5            cc       1.3b     ok
3952        (SC 3.0.1)
3953      sparc-sun-solaris2.4            gcc      1.0a     ok
3954      sparc-sun-solaris2.4            cc       1.0a     ok
3955      sparc-sun-solaris2.3            gcc      1.2f     ok
3956      sparc-sun-sunos4.1.4            gcc      1.2f     ok
3957      sparc-sun-sunos4.1.4            cc       1.0f     ok
3958      sparc-sun-sunos4.1.3_U1         gcc      1.2f     ok
3959      sparc-sun-sunos4.1.3C           gcc      1.2f     ok
3960      sparc-sun-sunos4.1.3            gcc      1.3b     ok
3961        (egcs-1.1.2, GNU ld 2.9.1 & native ld)
3962      sparc-sun-sunos4.1.3            cc       1.3b     ok
3963      sparc-unknown-bsdi4.0           gcc      1.2c     ok
3964      sparc-unknown-linux-gnulibc1    gcc      1.2f     ok
3965      sparc-unknown-linux-gnu         gcc      1.3b     ok
3966        (egcs-1.1.2, GNU ld 2.9.1.0.23)
3967      sparc64-unknown-linux-gnu       gcc      1.2f     ok
3969      Notes:
3970      - "ok" means "all tests passed".
3971      - "NS" means "Not Shared", but OK for static libraries
3973    Note: The vendor-distributed HP-UX `sed'(1) programs are horribly
3974 broken, and cannot handle libtool's requirements, so users may report
3975 unusual problems.  There is no workaround except to install a working
3976 `sed' (such as GNU `sed') on these systems.
3978    Note: The vendor-distributed NCR MP-RAS `cc' programs emits
3979 copyright on standard error that confuse tests on size of
3980 `conftest.err'.  The workaround is to specify `CC' when run `configure'
3981 with `CC='cc -Hnocopyr''.
3983 \x1f
3984 File: libtool.info,  Node: Platform quirks,  Next: libtool script contents,  Prev: Tested platforms,  Up: Maintaining
3986 13.3 Platform quirks
3987 ====================
3989 This section is dedicated to the sanity of the libtool maintainers.  It
3990 describes the programs that libtool uses, how they vary from system to
3991 system, and how to test for them.
3993    Because libtool is a shell script, it can be difficult to understand
3994 just by reading it from top to bottom.  This section helps show why
3995 libtool does things a certain way.  Combined with the scripts
3996 themselves, you should have a better sense of how to improve libtool, or
3997 write your own.
3999 * Menu:
4001 * References::                  Finding more information.
4002 * Compilers::                   Creating object files from source files.
4003 * Reloadable objects::          Binding object files together.
4004 * Multiple dependencies::       Removing duplicate dependent libraries.
4005 * Archivers::                   Programs that create static archives.
4007 \x1f
4008 File: libtool.info,  Node: References,  Next: Compilers,  Up: Platform quirks
4010 13.3.1 References
4011 -----------------
4013 The following is a list of valuable documentation references:
4015    * SGI's IRIX Manual Pages, which can be found at
4016      `http://techpubs.sgi.com/cgi-bin/infosrch.cgi?cmd=browse&db=man'.
4018    * Sun's free service area
4019      (`http://www.sun.com/service/online/free.html') and documentation
4020      server (`http://docs.sun.com/').
4022    * Compaq's Tru64 UNIX online documentation is at
4023      (`http://tru64unix.compaq.com/faqs/publications/pub_page/doc_list.html')
4024      with C++ documentation at
4025      (`http://tru64unix.compaq.com/cplus/docs/index.htm').
4027    * Hewlett-Packard has online documentation at
4028      (`http://docs.hp.com/index.html').
4030    * IBM has online documentation at
4031      (`http://www.rs6000.ibm.com/resource/aix_resource/Pubs/').
4033 \x1f
4034 File: libtool.info,  Node: Compilers,  Next: Reloadable objects,  Prev: References,  Up: Platform quirks
4036 13.3.2 Compilers
4037 ----------------
4039 The only compiler characteristics that affect libtool are the flags
4040 needed (if any) to generate PIC objects.  In general, if a C compiler
4041 supports certain PIC flags, then any derivative compilers support the
4042 same flags.  Until there are some noteworthy exceptions to this rule,
4043 this section will document only C compilers.
4045    The following C compilers have standard command line options,
4046 regardless of the platform:
4048 `gcc'
4049      This is the GNU C compiler, which is also the system compiler for
4050      many free operating systems (FreeBSD, GNU/Hurd, GNU/Linux, Lites,
4051      NetBSD, and OpenBSD, to name a few).
4053      The `-fpic' or `-fPIC' flags can be used to generate
4054      position-independent code.  `-fPIC' is guaranteed to generate
4055      working code, but the code is slower on m68k, m88k, and Sparc
4056      chips.  However, using `-fpic' on those chips imposes arbitrary
4057      size limits on the shared libraries.
4059    The rest of this subsection lists compilers by the operating system
4060 that they are bundled with:
4062 `aix3*'
4063 `aix4*'
4064      Most AIX compilers have no PIC flags, since AIX (with the
4065      exception of AIX for IA-64) runs on PowerPC and RS/6000 chips. (1)
4067 `hpux10*'
4068      Use `+Z' to generate PIC.
4070 `osf3*'
4071      Digital/UNIX 3.x does not have PIC flags, at least not on the
4072      PowerPC platform.
4074 `solaris2*'
4075      Use `-KPIC' to generate PIC.
4077 `sunos4*'
4078      Use `-PIC' to generate PIC.
4080    ---------- Footnotes ----------
4082    (1) All code compiled for the PowerPC and RS/6000 chips
4083 (`powerpc-*-*', `powerpcle-*-*', and `rs6000-*-*') is
4084 position-independent, regardless of the operating system or compiler
4085 suite.  So, "regular objects" can be used to build shared libraries on
4086 these systems and no special PIC compiler flags are required.
4088 \x1f
4089 File: libtool.info,  Node: Reloadable objects,  Next: Multiple dependencies,  Prev: Compilers,  Up: Platform quirks
4091 13.3.3 Reloadable objects
4092 -------------------------
4094 On all known systems, a reloadable object can be created by running `ld
4095 -r -o OUTPUT.o INPUT1.o INPUT2.o'.  This reloadable object may be
4096 treated as exactly equivalent to other objects.
4098 \x1f
4099 File: libtool.info,  Node: Multiple dependencies,  Next: Archivers,  Prev: Reloadable objects,  Up: Platform quirks
4101 13.3.4 Multiple dependencies
4102 ----------------------------
4104 On most modern platforms the order that dependent libraries are listed
4105 has no effect on object generation.  In theory, there are platforms
4106 which require libraries which provide missing symbols to other libraries
4107 to listed after those libraries whose symbols they provide.
4109    Particularly, if a pair of static archives each resolve some of the
4110 other's symbols, it might be necessary to list one of those archives
4111 both before and after the other one.  Libtool does not currently cope
4112 with this situation well, since duplicate libraries are removed from
4113 the link line by default.  Libtool provides the command line option
4114 `--preserve-dup-deps' to preserve all duplicate dependencies in cases
4115 where it is necessary.
4117 \x1f
4118 File: libtool.info,  Node: Archivers,  Prev: Multiple dependencies,  Up: Platform quirks
4120 13.3.5 Archivers
4121 ----------------
4123 On all known systems, building a static library can be accomplished by
4124 running `ar cru libNAME.a OBJ1.o OBJ2.o ...', where the `.a' file is
4125 the output library, and each `.o' file is an object file.
4127    On all known systems, if there is a program named `ranlib', then it
4128 must be used to "bless" the created library before linking against it,
4129 with the `ranlib libNAME.a' command.  Some systems, like Irix, use the
4130 `ar ts' command, instead.
4132 \x1f
4133 File: libtool.info,  Node: libtool script contents,  Next: Cheap tricks,  Prev: Platform quirks,  Up: Maintaining
4135 13.4 `libtool' script contents
4136 ==============================
4138 Since version 1.4, the `libtool' script is generated by `configure'
4139 (*note Configuring::).  In earlier versions, `configure' achieved this
4140 by calling a helper script called `ltconfig'.  From libtool version 0.7
4141 to 1.0, this script simply set shell variables, then sourced the
4142 libtool backend, `ltmain.sh'.  `ltconfig' from libtool version 1.1
4143 through 1.3 inlined the contents of `ltmain.sh' into the generated
4144 `libtool', which improved performance on many systems.  The tests that
4145 `ltconfig' used to perform are now kept in `libtool.m4' where they can
4146 be written using Autoconf.  This has the runtime performance benefits
4147 of inlined `ltmain.sh', _and_ improves the build time a little while
4148 considerably easing the amount of raw shell code that used to need
4149 maintaining.
4151    The convention used for naming variables which hold shell commands
4152 for delayed evaluation, is to use the suffix `_cmd' where a single line
4153 of valid shell script is needed, and the suffix `_cmds' where multiple
4154 lines of shell script *may* be delayed for later evaluation.  By
4155 convention, `_cmds' variables delimit the evaluation units with the `~'
4156 character where necessary.
4158    Here is a listing of each of the configuration variables, and how
4159 they are used within `ltmain.sh' (*note Configuring::):
4161  -- Variable: AR
4162      The name of the system library archiver.
4164  -- Variable: CC
4165      The name of the C compiler used to configure libtool.
4167  -- Variable: LD
4168      The name of the linker that libtool should use internally for
4169      reloadable linking and possibly shared libraries.
4171  -- Variable: NM
4172      The name of a BSD-compatible `nm' program, which produces listings
4173      of global symbols in one the following formats:
4175           ADDRESS C GLOBAL-VARIABLE-NAME
4176           ADDRESS D GLOBAL-VARIABLE-NAME
4177           ADDRESS T GLOBAL-FUNCTION-NAME
4179  -- Variable: RANLIB
4180      Set to the name of the ranlib program, if any.
4182  -- Variable: allow_undefined_flag
4183      The flag that is used by `archive_cmds' in order to declare that
4184      there will be unresolved symbols in the resulting shared library.
4185      Empty, if no such flag is required.  Set to `unsupported' if there
4186      is no way to generate a shared library with references to symbols
4187      that aren't defined in that library.
4189  -- Variable: always_export_symbols
4190      Whether libtool should automatically generate a list of exported
4191      symbols using EXPORT_SYMBOLS_CMDS before linking an archive.  Set
4192      to `yes' or `no'.  Default is `no'.
4194  -- Variable: archive_cmds
4195  -- Variable: archive_expsym_cmds
4196  -- Variable: old_archive_cmds
4197      Commands used to create shared libraries, shared libraries with
4198      `-export-symbols' and static libraries, respectively.
4200  -- Variable: old_archive_from_new_cmds
4201      If the shared library depends on a static library,
4202      `old_archive_from_new_cmds' contains the commands used to create
4203      that static library.  If this variable is not empty,
4204      `old_archive_cmds' is not used.
4206  -- Variable: old_archive_from_expsyms_cmds
4207      If a static library must be created from the export symbol list in
4208      order to correctly link with a shared library,
4209      `old_archive_from_expsyms_cmds' contains the commands needed to
4210      create that static library.  When these commands are executed, the
4211      variable SONAME contains the name of the shared library in
4212      question, and the $OBJDIR/$NEWLIB contains the path of the static
4213      library these commands should build.  After executing these
4214      commands, libtool will proceed to link against $OBJDIR/$NEWLIB
4215      instead of SONAME.
4217  -- Variable: build_libtool_libs
4218      Whether libtool should build shared libraries on this system.  Set
4219      to `yes' or `no'.
4221  -- Variable: build_old_libs
4222      Whether libtool should build static libraries on this system.  Set
4223      to `yes' or `no'.
4225  -- Variable: compiler_c_o
4226      Whether the compiler supports the `-c' and `-o' options
4227      simultaneously. Set to `yes' or `no'.
4229  -- Variable: compiler_o_lo
4230      Whether the compiler supports compiling directly to a ".lo" file,
4231      i.e whether object files do not have to have the suffix ".o".  Set
4232      to `yes' or `no'.
4234  -- Variable: dlopen_support
4235      Whether `dlopen' is supported on the platform.  Set to `yes' or
4236      `no'.
4238  -- Variable: dlopen_self
4239      Whether it is possible to `dlopen' the executable itself.  Set to
4240      `yes' or `no'.
4242  -- Variable: dlopen_self_static
4243      Whether it is possible to `dlopen' the executable itself, when it
4244      is linked statically (`-all-static').  Set to `yes' or `no'.
4246  -- Variable: echo
4247      An `echo' program which does not interpret backslashes as an
4248      escape character.
4250  -- Variable: exclude_expsyms
4251      List of symbols that should not be listed in the preloaded symbols.
4253  -- Variable: export_dynamic_flag_spec
4254      Compiler link flag that allows a dlopened shared library to
4255      reference symbols that are defined in the program.
4257  -- Variable: export_symbols_cmds
4258      Commands to extract exported symbols from LIBOBJS to the file
4259      EXPORT_SYMBOLS.
4261  -- Variable: extract_expsyms_cmds
4262      Commands to extract the exported symbols list from a shared
4263      library.  These commands are executed if there is no file
4264      $OBJDIR/$SONAME-DEF, and should write the names of the exported
4265      symbols to that file, for the use of
4266      `old_archive_from_expsyms_cmds'.
4268  -- Variable: fast_install
4269      Determines whether libtool will privilege the installer or the
4270      developer.  The assumption is that installers will seldom run
4271      programs in the build tree, and the developer will seldom install.
4272      This is only meaningful on platforms in which
4273      SHLIBPATH_OVERRIDES_RUNPATH is not `yes', so FAST_INSTALL will be
4274      set to `needless' in this case.  If FAST_INSTALL set to `yes',
4275      libtool will create programs that search for installed libraries,
4276      and, if a program is run in the build tree, a new copy will be
4277      linked on-demand to use the yet-to-be-installed libraries.  If set
4278      to `no', libtool will create programs that use the
4279      yet-to-be-installed libraries, and will link a new copy of the
4280      program at install time.  The default value is `yes' or
4281      `needless', depending on platform and configuration flags, and it
4282      can be turned from `yes' to `no' with the configure flag
4283      `--disable-fast-install'.
4285  -- Variable: finish_cmds
4286      Commands to tell the dynamic linker how to find shared libraries
4287      in a specific directory.
4289  -- Variable: finish_eval
4290      Same as FINISH_CMDS, except the commands are not displayed.
4292  -- Variable: fix_srcfile_path
4293      Expression to fix the shell variable $srcfile for the compiler.
4295  -- Variable: global_symbol_pipe
4296      A pipeline that takes the output of NM, and produces a listing of
4297      raw symbols followed by their C names.  For example:
4299           $ eval "$NM progname | $global_symbol_pipe"
4300           D SYMBOL1 C-SYMBOL1
4301           T SYMBOL2 C-SYMBOL2
4302           C SYMBOL3 C-SYMBOL3
4303           ...
4304           $
4306      The first column contains the symbol type (used to tell data from
4307      code on some platforms), but its meaning is system dependent.
4309  -- Variable: global_symbol_to_cdecl
4310      A pipeline that translates the output of GLOBAL_SYMBOL_PIPE into
4311      proper C declarations.  On platforms whose linkers differentiate
4312      code from data, such as HP/UX, data symbols will be declared as
4313      such, and code symbols will be declared as functions.  On
4314      platforms that don't care, everything is assumed to be data.
4316  -- Variable: hardcode_action
4317      Either `immediate' or `relink', depending on whether shared
4318      library paths can be hardcoded into executables before they are
4319      installed, or if they need to be relinked.
4321  -- Variable: hardcode_direct
4322      Set to `yes' or `no', depending on whether the linker hardcodes
4323      directories if a library is directly specified on the command line
4324      (such as `DIR/libNAME.a') when HARDCODE_LIBDIR_FLAG_SPEC is
4325      specified.
4327  -- Variable: hardcode_into_libs
4328      Whether the platform supports hardcoding of run-paths into
4329      libraries.  If enabled, linking of programs will be much simpler
4330      but libraries will need to be relinked during installation.   Set
4331      to `yes' or `no'.
4333  -- Variable: hardcode_libdir_flag_spec
4334      Flag to hardcode a LIBDIR variable into a binary, so that the
4335      dynamic linker searches LIBDIR for shared libraries at runtime.
4336      If it is empty, libtool will try to use some other hardcoding
4337      mechanism.
4339  -- Variable: hardcode_libdir_separator
4340      If the compiler only accepts a single HARDCODE_LIBDIR_FLAG, then
4341      this variable contains the string that should separate multiple
4342      arguments to that flag.
4344  -- Variable: hardcode_minus_L
4345      Set to `yes' or `no', depending on whether the linker hardcodes
4346      directories specified by `-L' flags into the resulting executable
4347      when HARDCODE_LIBDIR_FLAG_SPEC is specified.
4349  -- Variable: hardcode_shlibpath_var
4350      Set to `yes' or `no', depending on whether the linker hardcodes
4351      directories by writing the contents of `$shlibpath_var' into the
4352      resulting executable when HARDCODE_LIBDIR_FLAG_SPEC is specified.
4353      Set to `unsupported' if directories specified by `$shlibpath_var'
4354      are searched at run time, but not at link time.
4356  -- Variable: host
4357  -- Variable: host_alias
4358      For information purposes, set to the specified and canonical names
4359      of the system that libtool was configured for.
4361  -- Variable: include_expsyms
4362      List of symbols that must always be exported when using
4363      EXPORT_SYMBOLS.
4365  -- Variable: libext
4366      The standard old archive suffix (normally "a").
4368  -- Variable: libname_spec
4369      The format of a library name prefix.  On all Unix systems, static
4370      libraries are called `libNAME.a', but on some systems (such as
4371      OS/2 or MS-DOS), the library is just called `NAME.a'.
4373  -- Variable: library_names_spec
4374      A list of shared library names.  The first is the name of the file,
4375      the rest are symbolic links to the file.  The name in the list is
4376      the file name that the linker finds when given `-lNAME'.
4378  -- Variable: link_all_deplibs
4379      Whether libtool must link a program against all its dependency
4380      libraries.  Set to `yes' or `no'.  Default is `unknown', which is
4381      a synonym for `yes'.
4383  -- Variable: link_static_flag
4384      Linker flag (passed through the C compiler) used to prevent dynamic
4385      linking.
4387  -- Variable: need_lib_prefix
4388      Whether libtool should automatically prefix module names with
4389      'lib'.  Set to `yes' or `no'.  By default, it is `unknown', which
4390      means the same as `yes', but documents that we are not really sure
4391      about it.  `yes' means that it is possible both to `dlopen' and to
4392      link against a library without 'lib' prefix, i.e., it requires
4393      HARDCODE_DIRECT to be `yes'.
4395  -- Variable: need_version
4396      Whether versioning is required for libraries, i.e. whether the
4397      dynamic linker requires a version suffix for all libraries.  Set
4398      to `yes' or `no'.  By default, it is `unknown', which means the
4399      same as `yes', but documents that we are not really sure about it.
4401  -- Variable: need_locks
4402      Whether files must be locked to prevent conflicts when compiling
4403      simultaneously. Set to `yes' or `no'.
4405  -- Variable: no_builtin_flag
4406      Compiler flag to disable builtin functions that conflict with
4407      declaring external global symbols as `char'.
4409  -- Variable: no_undefined_flag
4410      The flag that is used by `archive_cmds' in order to declare that
4411      there will be no unresolved symbols in the resulting shared
4412      library.  Empty, if no such flag is required.
4414  -- Variable: objdir
4415      The name of the directory that contains temporary libtool files.
4417  -- Variable: objext
4418      The standard object file suffix (normally "o").
4420  -- Variable: pic_flag
4421      Any additional compiler flags for building library object files.
4423  -- Variable: postinstall_cmds
4424  -- Variable: old_postinstall_cmds
4425      Commands run after installing a shared or static library,
4426      respectively.
4428  -- Variable: postuninstall_cmds
4429  -- Variable: old_postuninstall_cmds
4430      Commands run after uninstalling a shared or static library,
4431      respectively.
4433  -- Variable: reload_cmds
4434  -- Variable: reload_flag
4435      Commands to create a reloadable object.
4437  -- Variable: runpath_var
4438      The environment variable that tells the linker which directories to
4439      hardcode in the resulting executable.
4441  -- Variable: shlibpath_overrides_runpath
4442      Indicates whether it is possible to override the hard-coded library
4443      search path of a program with an environment variable.  If this is
4444      set to no, libtool may have to create two copies of a program in
4445      the build tree, one to be installed and one to be run in the build
4446      tree only.  When each of these copies is created depends on the
4447      value of `fast_install'.  The default value is `unknown', which is
4448      equivalent to `no'.
4450  -- Variable: shlibpath_var
4451      The environment variable that tells the dynamic linker where to
4452      find shared libraries.
4454  -- Variable: soname_spec
4455      The name coded into shared libraries, if different from the real
4456      name of the file.
4458  -- Variable: striplib
4459  -- Variable: old_striplib
4460      Command to strip a shared (`striplib') or static (`old_striplib')
4461      library, respectively.  If these variables are empty, the strip
4462      flag in the install mode will be ignored for libraries (*note
4463      Install mode::).
4465  -- Variable: sys_lib_dlsearch_path_spec
4466      Expression to get the run-time system library search path.
4467      Directories that appear in this list are never hard-coded into
4468      executables.
4470  -- Variable: sys_lib_search_path_spec
4471      Expression to get the compile-time system library search path.
4472      This variable is used by libtool when it has to test whether a
4473      certain library is shared or static.  The directories listed in
4474      SHLIBPATH_VAR are automatically appended to this list, every time
4475      libtool runs (i.e., not at configuration time), because some
4476      linkers use this variable to extend the library search path.
4477      Linker switches such as `-L' also augment the search path.
4479  -- Variable: thread_safe_flag_spec
4480      Linker flag (passed through the C compiler) used to generate
4481      thread-safe libraries.
4483  -- Variable: version_type
4484      The library version numbering type.  One of `libtool',
4485      `freebsd-aout', `freebsd-elf', `irix', `linux', `osf', `sunos',
4486      `windows', or `none'.
4488  -- Variable: whole_archive_flag_spec
4489      Compiler flag to generate shared objects from convenience archives.
4491  -- Variable: wl
4492      The C compiler flag that allows libtool to pass a flag directly to
4493      the linker.  Used as: `${wl}SOME-FLAG'.
4495    Variables ending in `_cmds' or `_eval' contain a `~'-separated list
4496 of commands that are `eval'ed one after another.  If any of the
4497 commands return a nonzero exit status, libtool generally exits with an
4498 error message.
4500    Variables ending in `_spec' are `eval'ed before being used by
4501 libtool.
4503 \x1f
4504 File: libtool.info,  Node: Cheap tricks,  Prev: libtool script contents,  Up: Maintaining
4506 13.5 Cheap tricks
4507 =================
4509 Here are a few tricks that you can use in order to make maintainership
4510 easier:
4512    * When people report bugs, ask them to use the `--config',
4513      `--debug', or `--features' flags, if you think they will help you.
4514      These flags are there to help you get information directly, rather
4515      than having to trust second-hand observation.
4517    * Rather than reconfiguring libtool every time I make a change to
4518      `ltmain.in', I keep a permanent `libtool' script in my PATH, which
4519      sources `ltmain.in' directly.
4521      The following steps describe how to create such a script, where
4522      `/home/src/libtool' is the directory containing the libtool source
4523      tree, `/home/src/libtool/libtool' is a libtool script that has been
4524      configured for your platform, and `~/bin' is a directory in your
4525      PATH:
4527           trick$ cd ~/bin
4528           trick$ sed '/^# ltmain\.sh/q' /home/src/libtool/libtool > libtool
4529           trick$ echo '. /home/src/libtool/ltmain.in' >> libtool
4530           trick$ chmod +x libtool
4531           trick$ libtool --version
4532           ltmain.sh (GNU @PACKAGE@) @VERSION@@TIMESTAMP@
4533           trick$
4535    The output of the final `libtool --version' command shows that the
4536 `ltmain.in' script is being used directly.  Now, modify `~/bin/libtool'
4537 or `/home/src/libtool/ltmain.in' directly in order to test new changes
4538 without having to rerun `configure'.
4540 \x1f
4541 File: libtool.info,  Node: GNU Free Documentation License,  Next: Index,  Prev: Maintaining,  Up: Top
4543 GNU Free Documentation License
4544 ******************************
4546                         Version 1.1, March 2000
4548      Copyright (C) 2000  Free Software Foundation, Inc.
4549          51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4550      Everyone is permitted to copy and distribute verbatim copies
4551      of this license document, but changing it is not allowed.
4553 Preamble
4554 ========
4556 The purpose of this License is to make a manual, textbook, or other
4557 written document "free" in the sense of freedom: to assure everyone the
4558 effective freedom to copy and redistribute it, with or without
4559 modifying it, either commercially or noncommercially.  Secondarily,
4560 this License preserves for the author and publisher a way to get credit
4561 for their work, while not being considered responsible for
4562 modifications made by others.
4564    This License is a kind of "copyleft", which means that derivative
4565 works of the document must themselves be free in the same sense.  It
4566 complements the GNU General Public License, which is a copyleft license
4567 designed for free software.
4569    We have designed this License in order to use it for manuals for free
4570 software, because free software needs free documentation: a free
4571 program should come with manuals providing the same freedoms that the
4572 software does.  But this License is not limited to software manuals; it
4573 can be used for any textual work, regardless of subject matter or
4574 whether it is published as a printed book.  We recommend this License
4575 principally for works whose purpose is instruction or reference.
4577 APPLICABILITY AND DEFINITIONS
4578 =============================
4580 This License applies to any manual or other work that contains a notice
4581 placed by the copyright holder saying it can be distributed under the
4582 terms of this License.  The "Document", below, refers to any such
4583 manual or work.  Any member of the public is a licensee, and is
4584 addressed as "you".
4586    A "Modified Version" of the Document means any work containing the
4587 Document or a portion of it, either copied verbatim, or with
4588 modifications and/or translated into another language.
4590    A "Secondary Section" is a named appendix or a front-matter section
4591 of the Document that deals exclusively with the relationship of the
4592 publishers or authors of the Document to the Document's overall subject
4593 (or to related matters) and contains nothing that could fall directly
4594 within that overall subject.  (For example, if the Document is in part a
4595 textbook of mathematics, a Secondary Section may not explain any
4596 mathematics.)  The relationship could be a matter of historical
4597 connection with the subject or with related matters, or of legal,
4598 commercial, philosophical, ethical or political position regarding them.
4600    The "Invariant Sections" are certain Secondary Sections whose titles
4601 are designated, as being those of Invariant Sections, in the notice
4602 that says that the Document is released under this License.
4604    The "Cover Texts" are certain short passages of text that are listed,
4605 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
4606 the Document is released under this License.
4608    A "Transparent" copy of the Document means a machine-readable copy,
4609 represented in a format whose specification is available to the general
4610 public, whose contents can be viewed and edited directly and
4611 straightforwardly with generic text editors or (for images composed of
4612 pixels) generic paint programs or (for drawings) some widely available
4613 drawing editor, and that is suitable for input to text formatters or
4614 for automatic translation to a variety of formats suitable for input to
4615 text formatters.  A copy made in an otherwise Transparent file format
4616 whose markup has been designed to thwart or discourage subsequent
4617 modification by readers is not Transparent.  A copy that is not
4618 "Transparent" is called "Opaque".
4620    Examples of suitable formats for Transparent copies include plain
4621 ASCII without markup, Texinfo input format, LaTeX input format, SGML or
4622 XML using a publicly available DTD, and standard-conforming simple HTML
4623 designed for human modification.  Opaque formats include PostScript,
4624 PDF, proprietary formats that can be read and edited only by
4625 proprietary word processors, SGML or XML for which the DTD and/or
4626 processing tools are not generally available, and the machine-generated
4627 HTML produced by some word processors for output purposes only.
4629    The "Title Page" means, for a printed book, the title page itself,
4630 plus such following pages as are needed to hold, legibly, the material
4631 this License requires to appear in the title page.  For works in
4632 formats which do not have any title page as such, "Title Page" means
4633 the text near the most prominent appearance of the work's title,
4634 preceding the beginning of the body of the text.
4636 VERBATIM COPYING
4637 ================
4639 You may copy and distribute the Document in any medium, either
4640 commercially or noncommercially, provided that this License, the
4641 copyright notices, and the license notice saying this License applies
4642 to the Document are reproduced in all copies, and that you add no other
4643 conditions whatsoever to those of this License.  You may not use
4644 technical measures to obstruct or control the reading or further
4645 copying of the copies you make or distribute.  However, you may accept
4646 compensation in exchange for copies.  If you distribute a large enough
4647 number of copies you must also follow the conditions in section 3.
4649    You may also lend copies, under the same conditions stated above, and
4650 you may publicly display copies.
4652 COPYING IN QUANTITY
4653 ===================
4655 If you publish printed copies of the Document numbering more than 100,
4656 and the Document's license notice requires Cover Texts, you must enclose
4657 the copies in covers that carry, clearly and legibly, all these Cover
4658 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
4659 the back cover.  Both covers must also clearly and legibly identify you
4660 as the publisher of these copies.  The front cover must present the
4661 full title with all words of the title equally prominent and visible.
4662 You may add other material on the covers in addition.  Copying with
4663 changes limited to the covers, as long as they preserve the title of
4664 the Document and satisfy these conditions, can be treated as verbatim
4665 copying in other respects.
4667    If the required texts for either cover are too voluminous to fit
4668 legibly, you should put the first ones listed (as many as fit
4669 reasonably) on the actual cover, and continue the rest onto adjacent
4670 pages.
4672    If you publish or distribute Opaque copies of the Document numbering
4673 more than 100, you must either include a machine-readable Transparent
4674 copy along with each Opaque copy, or state in or with each Opaque copy
4675 a publicly-accessible computer-network location containing a complete
4676 Transparent copy of the Document, free of added material, which the
4677 general network-using public has access to download anonymously at no
4678 charge using public-standard network protocols.  If you use the latter
4679 option, you must take reasonably prudent steps, when you begin
4680 distribution of Opaque copies in quantity, to ensure that this
4681 Transparent copy will remain thus accessible at the stated location
4682 until at least one year after the last time you distribute an Opaque
4683 copy (directly or through your agents or retailers) of that edition to
4684 the public.
4686    It is requested, but not required, that you contact the authors of
4687 the Document well before redistributing any large number of copies, to
4688 give them a chance to provide you with an updated version of the
4689 Document.
4691 MODIFICATIONS
4692 =============
4694 You may copy and distribute a Modified Version of the Document under
4695 the conditions of sections 2 and 3 above, provided that you release the
4696 Modified Version under precisely this License, with the Modified
4697 Version filling the role of the Document, thus licensing distribution
4698 and modification of the Modified Version to whoever possesses a copy of
4699 it.  In addition, you must do these things in the Modified Version:
4701   A. Use in the Title Page (and on the covers, if any) a title distinct
4702      from that of the Document, and from those of previous versions
4703      (which should, if there were any, be listed in the History section
4704      of the Document).  You may use the same title as a previous version
4705      if the original publisher of that version gives permission.
4707   B.  List on the Title Page, as authors, one or more persons or
4708      entities responsible for authorship of the modifications in the
4709      Modified Version, together with at least five of the principal
4710      authors of the Document (all of its principal authors, if it has
4711      less than five).
4713   C. State on the Title page the name of the publisher of the Modified
4714      Version, as the publisher.
4716   D.  Preserve all the copyright notices of the Document.
4718   E. Add an appropriate copyright notice for your modifications
4719      adjacent to the other copyright notices.
4721   F. Include, immediately after the copyright notices, a license notice
4722      giving the public permission to use the Modified Version under the
4723      terms of this License, in the form shown in the Addendum below.
4725   G. Preserve in that license notice the full lists of Invariant
4726      Sections and required Cover Texts given in the Document's license
4727      notice.
4729   H. Include an unaltered copy of this License.
4731   I. Preserve the section entitled "History", and its title, and add to
4732      it an item stating at least the title, year, new authors, and
4733      publisher of the Modified Version as given on the Title Page.  If
4734      there is no section entitled "History" in the Document, create one
4735      stating the title, year, authors, and publisher of the Document as
4736      given on its Title Page, then add an item describing the Modified
4737      Version as stated in the previous sentence.
4739   J. Preserve the network location, if any, given in the Document for
4740      public access to a Transparent copy of the Document, and likewise
4741      the network locations given in the Document for previous versions
4742      it was based on.  These may be placed in the "History" section.
4743      You may omit a network location for a work that was published at
4744      least four years before the Document itself, or if the original
4745      publisher of the version it refers to gives permission.
4747   K. In any section entitled "Acknowledgements" or "Dedications",
4748      preserve the section's title, and preserve in the section all the
4749      substance and tone of each of the contributor acknowledgements
4750      and/or dedications given therein.
4752   L. Preserve all the Invariant Sections of the Document, unaltered in
4753      their text and in their titles.  Section numbers or the equivalent
4754      are not considered part of the section titles.
4756   M. Delete any section entitled "Endorsements".  Such a section may
4757      not be included in the Modified Version.
4759   N. Do not retitle any existing section as "Endorsements" or to
4760      conflict in title with any Invariant Section.
4762    If the Modified Version includes new front-matter sections or
4763 appendices that qualify as Secondary Sections and contain no material
4764 copied from the Document, you may at your option designate some or all
4765 of these sections as invariant.  To do this, add their titles to the
4766 list of Invariant Sections in the Modified Version's license notice.
4767 These titles must be distinct from any other section titles.
4769    You may add a section entitled "Endorsements", provided it contains
4770 nothing but endorsements of your Modified Version by various
4771 parties-for example, statements of peer review or that the text has
4772 been approved by an organization as the authoritative definition of a
4773 standard.
4775    You may add a passage of up to five words as a Front-Cover Text, and
4776 a passage of up to 25 words as a Back-Cover Text, to the end of the list
4777 of Cover Texts in the Modified Version.  Only one passage of
4778 Front-Cover Text and one of Back-Cover Text may be added by (or through
4779 arrangements made by) any one entity.  If the Document already includes
4780 a cover text for the same cover, previously added by you or by
4781 arrangement made by the same entity you are acting on behalf of, you
4782 may not add another; but you may replace the old one, on explicit
4783 permission from the previous publisher that added the old one.
4785    The author(s) and publisher(s) of the Document do not by this License
4786 give permission to use their names for publicity for or to assert or
4787 imply endorsement of any Modified Version.
4789 COMBINING DOCUMENTS
4790 ===================
4792 You may combine the Document with other documents released under this
4793 License, under the terms defined in section 4 above for modified
4794 versions, provided that you include in the combination all of the
4795 Invariant Sections of all of the original documents, unmodified, and
4796 list them all as Invariant Sections of your combined work in its
4797 license notice.
4799    The combined work need only contain one copy of this License, and
4800 multiple identical Invariant Sections may be replaced with a single
4801 copy.  If there are multiple Invariant Sections with the same name but
4802 different contents, make the title of each such section unique by
4803 adding at the end of it, in parentheses, the name of the original
4804 author or publisher of that section if known, or else a unique number.
4805 Make the same adjustment to the section titles in the list of Invariant
4806 Sections in the license notice of the combined work.
4808    In the combination, you must combine any sections entitled "History"
4809 in the various original documents, forming one section entitled
4810 "History"; likewise combine any sections entitled "Acknowledgements",
4811 and any sections entitled "Dedications".  You must delete all sections
4812 entitled "Endorsements."
4814 COLLECTIONS OF DOCUMENTS
4815 ========================
4817 You may make a collection consisting of the Document and other documents
4818 released under this License, and replace the individual copies of this
4819 License in the various documents with a single copy that is included in
4820 the collection, provided that you follow the rules of this License for
4821 verbatim copying of each of the documents in all other respects.
4823    You may extract a single document from such a collection, and
4824 distribute it individually under this License, provided you insert a
4825 copy of this License into the extracted document, and follow this
4826 License in all other respects regarding verbatim copying of that
4827 document.
4829 AGGREGATION WITH INDEPENDENT WORKS
4830 ==================================
4832 A compilation of the Document or its derivatives with other separate
4833 and independent documents or works, in or on a volume of a storage or
4834 distribution medium, does not as a whole count as a Modified Version of
4835 the Document, provided no compilation copyright is claimed for the
4836 compilation.  Such a compilation is called an "aggregate", and this
4837 License does not apply to the other self-contained works thus compiled
4838 with the Document, on account of their being thus compiled, if they are
4839 not themselves derivative works of the Document.
4841    If the Cover Text requirement of section 3 is applicable to these
4842 copies of the Document, then if the Document is less than one quarter
4843 of the entire aggregate, the Document's Cover Texts may be placed on
4844 covers that surround only the Document within the aggregate.  Otherwise
4845 they must appear on covers around the whole aggregate.
4847 TRANSLATION
4848 ===========
4850 Translation is considered a kind of modification, so you may distribute
4851 translations of the Document under the terms of section 4.  Replacing
4852 Invariant Sections with translations requires special permission from
4853 their copyright holders, but you may include translations of some or
4854 all Invariant Sections in addition to the original versions of these
4855 Invariant Sections.  You may include a translation of this License
4856 provided that you also include the original English version of this
4857 License.  In case of a disagreement between the translation and the
4858 original English version of this License, the original English version
4859 will prevail.
4861 TERMINATION
4862 ===========
4864 You may not copy, modify, sublicense, or distribute the Document except
4865 as expressly provided for under this License.  Any other attempt to
4866 copy, modify, sublicense or distribute the Document is void, and will
4867 automatically terminate your rights under this License.  However,
4868 parties who have received copies, or rights, from you under this
4869 License will not have their licenses terminated so long as such parties
4870 remain in full compliance.
4872 FUTURE REVISIONS OF THIS LICENSE
4873 ================================
4875 The Free Software Foundation may publish new, revised versions of the
4876 GNU Free Documentation License from time to time.  Such new versions
4877 will be similar in spirit to the present version, but may differ in
4878 detail to address new problems or concerns.  See
4879 http://www.gnu.org/copyleft/.
4881    Each version of the License is given a distinguishing version number.
4882 If the Document specifies that a particular numbered version of this
4883 License "or any later version" applies to it, you have the option of
4884 following the terms and conditions either of that specified version or
4885 of any later version that has been published (not as a draft) by the
4886 Free Software Foundation.  If the Document does not specify a version
4887 number of this License, you may choose any version ever published (not
4888 as a draft) by the Free Software Foundation.
4890 ADDENDUM: How to use this License for your documents
4891 ====================================================
4893 To use this License in a document you have written, include a copy of
4894 the License in the document and put the following copyright and license
4895 notices just after the title page:
4897      Copyright (c)  YEAR  YOUR NAME.
4898      Permission is granted to copy, distribute and/or modify this document
4899      under the terms of the GNU Free Documentation License, Version 1.1
4900      or any later version published by the Free Software Foundation;
4901      with the Invariant Sections being LIST THEIR TITLES, with the
4902      Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
4903      A copy of the license is included in the section entitled "GNU
4904      Free Documentation License".
4906    If you have no Invariant Sections, write "with no Invariant Sections"
4907 instead of saying which ones are invariant.  If you have no Front-Cover
4908 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being
4909 LIST"; likewise for Back-Cover Texts.
4911    If your document contains nontrivial examples of program code, we
4912 recommend releasing these examples in parallel under your choice of
4913 free software license, such as the GNU General Public License, to
4914 permit their use in free software.
4916 \x1f
4917 File: libtool.info,  Node: Index,  Prev: GNU Free Documentation License,  Up: Top
4919 Index
4920 *****
4922 \0\b[index\0\b]
4923 * Menu:
4925 * .la files:                             Linking libraries.   (line  24)
4926 * .libs subdirectory:                    Linking libraries.   (line  69)
4927 * .lo files:                             Creating object files.
4928                                                               (line  28)
4929 * AC_CONFIG_AUX_DIR:                     Invoking libtoolize. (line  55)
4930 * AC_DISABLE_FAST_INSTALL:               AC_PROG_LIBTOOL.     (line  87)
4931 * AC_DISABLE_SHARED:                     AC_PROG_LIBTOOL.     (line  93)
4932 * AC_DISABLE_STATIC:                     AC_PROG_LIBTOOL.     (line  99)
4933 * AC_FUNC_ALLOCA:                        Autoconf .o macros.  (line  13)
4934 * AC_LIBTOOL_DLOPEN:                     AC_PROG_LIBTOOL.     (line  67)
4935 * AC_LIBTOOL_WIN32_DLL:                  AC_PROG_LIBTOOL.     (line  73)
4936 * AC_PROG_LIBTOOL:                       AC_PROG_LIBTOOL.     (line  12)
4937 * AC_REPLACE_FUNCS:                      Autoconf .o macros.  (line  18)
4938 * aclocal:                               AC_PROG_LIBTOOL.     (line 162)
4939 * allow_undefined_flag:                  libtool script contents.
4940                                                               (line  51)
4941 * always_export_symbols:                 libtool script contents.
4942                                                               (line  58)
4943 * AM_DISABLE_SHARED:                     AC_PROG_LIBTOOL.     (line  94)
4944 * AM_DISABLE_STATIC:                     AC_PROG_LIBTOOL.     (line 100)
4945 * AM_PROG_LIBTOOL:                       AC_PROG_LIBTOOL.     (line  13)
4946 * application-level dynamic linking <1>: Using libltdl.       (line   6)
4947 * application-level dynamic linking:     Dlopened modules.    (line   6)
4948 * AR:                                    libtool script contents.
4949                                                               (line  30)
4950 * ar:                                    Linking libraries.   (line   6)
4951 * archive_cmds:                          libtool script contents.
4952                                                               (line  63)
4953 * archive_expsym_cmds:                   libtool script contents.
4954                                                               (line  64)
4955 * AS:                                    AC_PROG_LIBTOOL.     (line 159)
4956 * assign.test:                           Test descriptions.   (line 136)
4957 * avoiding shared libraries:             Static-only libraries.
4958                                                               (line   6)
4959 * bug reports:                           Reporting bugs.      (line   6)
4960 * buggy system linkers:                  Linking executables. (line  11)
4961 * bugs, subtle ones caused by buggy linkers: Linking executables.
4962                                                               (line  16)
4963 * build-relink.test:                     Test descriptions.   (line  72)
4964 * build_libtool_libs:                    libtool script contents.
4965                                                               (line  86)
4966 * build_old_libs:                        libtool script contents.
4967                                                               (line  90)
4968 * C header files, portable:              C header files.      (line   6)
4969 * C++, pitfalls:                         C++ libraries.       (line   6)
4970 * C++, using:                            Other languages.     (line   6)
4971 * C, not using:                          Other languages.     (line   6)
4972 * CC <1>:                                libtool script contents.
4973                                                               (line  33)
4974 * CC:                                    AC_PROG_LIBTOOL.     (line 108)
4975 * cdemo-conf.test:                       Test descriptions.   (line  14)
4976 * cdemo-exec.test:                       Test descriptions.   (line  14)
4977 * cdemo-make.test:                       Test descriptions.   (line  14)
4978 * cdemo-shared.test:                     Test descriptions.   (line  14)
4979 * cdemo-static.test:                     Test descriptions.   (line  14)
4980 * CFLAGS:                                AC_PROG_LIBTOOL.     (line 112)
4981 * clean mode:                            Clean mode.          (line   6)
4982 * command options, libtool:              Invoking libtool.    (line   6)
4983 * command options, libtoolize:           Invoking libtoolize. (line   6)
4984 * compile mode:                          Compile mode.        (line   6)
4985 * compiler_c_o:                          libtool script contents.
4986                                                               (line  94)
4987 * compiler_o_lo:                         libtool script contents.
4988                                                               (line  98)
4989 * compiling object files:                Creating object files.
4990                                                               (line   6)
4991 * complexity of library systems:         Postmortem.          (line  11)
4992 * config.guess:                          Distributing.        (line  10)
4993 * config.sub:                            Distributing.        (line  13)
4994 * configuring libtool:                   Configuring.         (line   6)
4995 * convenience libraries:                 Static libraries.    (line   6)
4996 * CPPFLAGS:                              AC_PROG_LIBTOOL.     (line 118)
4997 * debugging libraries:                   Static-only libraries.
4998                                                               (line   6)
4999 * definition of libraries:               Libtool paradigm.    (line  11)
5000 * demo-conf.test:                        Test descriptions.   (line  40)
5001 * demo-exec.test:                        Test descriptions.   (line  40)
5002 * demo-inst.test:                        Test descriptions.   (line  40)
5003 * demo-make.test:                        Test descriptions.   (line  40)
5004 * demo-nofast.test:                      Test descriptions.   (line  40)
5005 * demo-nopic.test:                       Test descriptions.   (line  40)
5006 * demo-pic.test:                         Test descriptions.   (line  40)
5007 * demo-shared.test:                      Test descriptions.   (line  40)
5008 * demo-static.test:                      Test descriptions.   (line  40)
5009 * demo-unst.test:                        Test descriptions.   (line  40)
5010 * depdemo-conf.test:                     Test descriptions.   (line  89)
5011 * depdemo-exec.test:                     Test descriptions.   (line  89)
5012 * depdemo-inst.test:                     Test descriptions.   (line  89)
5013 * depdemo-make.test:                     Test descriptions.   (line  89)
5014 * depdemo-nofast.test:                   Test descriptions.   (line  89)
5015 * depdemo-shared.test:                   Test descriptions.   (line  89)
5016 * depdemo-static.test:                   Test descriptions.   (line  89)
5017 * depdemo-unst.test:                     Test descriptions.   (line  89)
5018 * dependencies between libraries:        Inter-library dependencies.
5019                                                               (line   6)
5020 * dependency versioning:                 Versioning.          (line   6)
5021 * deplibs.test:                          Test descriptions.   (line  58)
5022 * deplibs_check_method:                  Porting inter-library dependencies.
5023                                                               (line   6)
5024 * design issues:                         Issues.              (line   6)
5025 * design of library interfaces:          Library tips.        (line   6)
5026 * design philosophy:                     Motivation.          (line   6)
5027 * developing libraries:                  Static-only libraries.
5028                                                               (line   6)
5029 * dlclose <1>:                           Using libltdl.       (line   6)
5030 * dlclose:                               Dlopened modules.    (line   6)
5031 * dlerror:                               Using libltdl.       (line   6)
5032 * DLLTOOL:                               AC_PROG_LIBTOOL.     (line 151)
5033 * dlopen <1>:                            Using libltdl.       (line   6)
5034 * dlopen:                                Dlopened modules.    (line   6)
5035 * dlopen_self:                           libtool script contents.
5036                                                               (line 107)
5037 * dlopen_self_static:                    libtool script contents.
5038                                                               (line 111)
5039 * dlopen_support:                        libtool script contents.
5040                                                               (line 103)
5041 * dlopening modules <1>:                 Using libltdl.       (line   6)
5042 * dlopening modules:                     Dlopened modules.    (line   6)
5043 * dlopening, pitfalls:                   Dlopen issues.       (line   6)
5044 * dlsym <1>:                             Using libltdl.       (line   6)
5045 * dlsym:                                 Dlopened modules.    (line   6)
5046 * double-compilation, avoiding:          Static-only libraries.
5047                                                               (line   6)
5048 * dryrun.test:                           Test descriptions.   (line 133)
5049 * dynamic dependencies:                  Versioning.          (line   6)
5050 * dynamic linking, applications <1>:     Using libltdl.       (line   6)
5051 * dynamic linking, applications:         Dlopened modules.    (line   6)
5052 * dynamic modules, names:                Finding the dlname.  (line   6)
5053 * echo:                                  libtool script contents.
5054                                                               (line 115)
5055 * eliding shared libraries:              Static-only libraries.
5056                                                               (line   6)
5057 * examples of using libtool:             Using libtool.       (line   6)
5058 * exclude_expsyms:                       libtool script contents.
5059                                                               (line 119)
5060 * execute mode:                          Execute mode.        (line   6)
5061 * export_dynamic_flag_spec:              libtool script contents.
5062                                                               (line 122)
5063 * export_symbols_cmds:                   libtool script contents.
5064                                                               (line 126)
5065 * extract_expsyms_cmds:                  libtool script contents.
5066                                                               (line 130)
5067 * failed tests:                          When tests fail.     (line   6)
5068 * fast_install:                          libtool script contents.
5069                                                               (line 137)
5070 * file_magic:                            Porting inter-library dependencies.
5071                                                               (line  18)
5072 * file_magic_cmd:                        Porting inter-library dependencies.
5073                                                               (line  18)
5074 * file_magic_test_file:                  Porting inter-library dependencies.
5075                                                               (line  18)
5076 * finish mode:                           Finish mode.         (line   6)
5077 * finish_cmds:                           libtool script contents.
5078                                                               (line 154)
5079 * finish_eval:                           libtool script contents.
5080                                                               (line 158)
5081 * fix_srcfile_path:                      libtool script contents.
5082                                                               (line 161)
5083 * formal versioning:                     Libtool versioning.  (line   6)
5084 * global functions:                      Library tips.        (line  45)
5085 * global_symbol_pipe:                    libtool script contents.
5086                                                               (line 164)
5087 * global_symbol_to_cdecl:                libtool script contents.
5088                                                               (line 178)
5089 * hardcode.test:                         Test descriptions.   (line  64)
5090 * hardcode_action:                       libtool script contents.
5091                                                               (line 185)
5092 * hardcode_direct:                       libtool script contents.
5093                                                               (line 190)
5094 * hardcode_into_libs:                    libtool script contents.
5095                                                               (line 196)
5096 * hardcode_libdir_flag_spec:             libtool script contents.
5097                                                               (line 202)
5098 * hardcode_libdir_separator:             libtool script contents.
5099                                                               (line 208)
5100 * hardcode_minus_L:                      libtool script contents.
5101                                                               (line 213)
5102 * hardcode_shlibpath_var:                libtool script contents.
5103                                                               (line 218)
5104 * header files:                          Library tips.        (line  39)
5105 * host:                                  libtool script contents.
5106                                                               (line 225)
5107 * host_alias:                            libtool script contents.
5108                                                               (line 226)
5109 * implementation of libtool:             libtool script contents.
5110                                                               (line   6)
5111 * include files, portable:               C header files.      (line   6)
5112 * include_expsyms:                       libtool script contents.
5113                                                               (line 230)
5114 * inferring tags:                        Tags.                (line   6)
5115 * install:                               Installing libraries.
5116                                                               (line  19)
5117 * install mode:                          Install mode.        (line   6)
5118 * install-sh:                            Distributing.        (line  16)
5119 * installation, finishing:               Installing libraries.
5120                                                               (line  54)
5121 * inter-library dependencies:            Inter-library dependencies.
5122                                                               (line   6)
5123 * inter-library dependency:              Porting inter-library dependencies.
5124                                                               (line   6)
5125 * language names:                        Tags.                (line   6)
5126 * languages, non-C:                      Other languages.     (line   6)
5127 * LD <1>:                                libtool script contents.
5128                                                               (line  36)
5129 * LD:                                    AC_PROG_LIBTOOL.     (line 123)
5130 * LDFLAGS:                               AC_PROG_LIBTOOL.     (line 128)
5131 * libext:                                libtool script contents.
5132                                                               (line 234)
5133 * libltdl:                               Using libltdl.       (line   6)
5134 * libname_spec:                          libtool script contents.
5135                                                               (line 237)
5136 * libraries, definition of:              Libtool paradigm.    (line  11)
5137 * libraries, finishing installation:     Installing libraries.
5138                                                               (line  54)
5139 * libraries, stripping:                  Installing libraries.
5140                                                               (line  44)
5141 * library interfaces:                    Interfaces.          (line   6)
5142 * library interfaces, design:            Library tips.        (line   6)
5143 * library object file:                   Creating object files.
5144                                                               (line  28)
5145 * library_names_spec:                    libtool script contents.
5146                                                               (line 242)
5147 * LIBS:                                  AC_PROG_LIBTOOL.     (line 134)
5148 * libtool:                               Invoking libtool.    (line   6)
5149 * libtool command options:               Invoking libtool.    (line   6)
5150 * libtool examples:                      Using libtool.       (line   6)
5151 * libtool implementation:                libtool script contents.
5152                                                               (line   6)
5153 * libtool libraries:                     Linking libraries.   (line  24)
5154 * libtool library versions:              Libtool versioning.  (line   6)
5155 * libtool specifications:                Motivation.          (line  20)
5156 * libtoolize:                            Invoking libtoolize. (line   6)
5157 * libtoolize command options:            Invoking libtoolize. (line   6)
5158 * link mode:                             Link mode.           (line   6)
5159 * link-2.test:                           Test descriptions.   (line 144)
5160 * link.test:                             Test descriptions.   (line 140)
5161 * link_all_deplibs:                      libtool script contents.
5162                                                               (line 247)
5163 * link_static_flag:                      libtool script contents.
5164                                                               (line 252)
5165 * linking against installed libraries:   Linking executables. (line   6)
5166 * linking against uninstalled libraries: Linking executables. (line  25)
5167 * linking with installed libtool libraries: Linking executables.
5168                                                               (line  47)
5169 * linking, partial:                      Link mode.           (line 165)
5170 * LN_S:                                  AC_PROG_LIBTOOL.     (line 146)
5171 * lt_dladderror:                         Module loaders for libltdl.
5172                                                               (line 199)
5173 * lt_dladdsearchdir:                     Libltdl interface.   (line 156)
5174 * lt_dlcaller_get_data:                  User defined module data.
5175                                                               (line  92)
5176 * lt_dlcaller_id:                        User defined module data.
5177                                                               (line  58)
5178 * lt_dlcaller_register:                  User defined module data.
5179                                                               (line  61)
5180 * lt_dlcaller_set_data:                  User defined module data.
5181                                                               (line  66)
5182 * lt_dlclose:                            Libltdl interface.   (line 112)
5183 * lt_dlerror:                            Libltdl interface.   (line 122)
5184 * lt_dlexit:                             Libltdl interface.   (line  53)
5185 * lt_dlforeach:                          User defined module data.
5186                                                               (line  34)
5187 * lt_dlforeachfile:                      Libltdl interface.   (line 176)
5188 * lt_dlfree:                             Libltdl interface.   (line 212)
5189 * lt_dlgetinfo:                          User defined module data.
5190                                                               (line  24)
5191 * lt_dlgetsearchpath:                    Libltdl interface.   (line 172)
5192 * lt_dlhandle:                           Libltdl interface.   (line  38)
5193 * lt_dlhandle_next:                      User defined module data.
5194                                                               (line  41)
5195 * lt_dlinfo:                             User defined module data.
5196                                                               (line  12)
5197 * lt_dlinit:                             Libltdl interface.   (line  48)
5198 * lt_dlinsertsearchdir:                  Libltdl interface.   (line 161)
5199 * lt_dlisresident:                       Libltdl interface.   (line 204)
5200 * lt_dlloader:                           Module loaders for libltdl.
5201                                                               (line  45)
5202 * lt_dlloader_add:                       Module loaders for libltdl.
5203                                                               (line 132)
5204 * lt_dlloader_data:                      Module loaders for libltdl.
5205                                                               (line 190)
5206 * lt_dlloader_exit:                      Module loaders for libltdl.
5207                                                               (line  86)
5208 * lt_dlloader_find:                      Module loaders for libltdl.
5209                                                               (line 170)
5210 * lt_dlloader_name:                      Module loaders for libltdl.
5211                                                               (line 184)
5212 * lt_dlloader_next:                      Module loaders for libltdl.
5213                                                               (line 159)
5214 * lt_dlloader_remove:                    Module loaders for libltdl.
5215                                                               (line 147)
5216 * lt_dlmakeresident:                     Libltdl interface.   (line 194)
5217 * lt_dlmalloc:                           Libltdl interface.   (line 210)
5218 * lt_dlmutex_geterror:                   Thread Safety in libltdl.
5219                                                               (line  34)
5220 * lt_dlmutex_lock:                       Thread Safety in libltdl.
5221                                                               (line  11)
5222 * lt_dlmutex_register:                   Thread Safety in libltdl.
5223                                                               (line  44)
5224 * lt_dlmutex_seterror:                   Thread Safety in libltdl.
5225                                                               (line  23)
5226 * lt_dlmutex_unlock:                     Thread Safety in libltdl.
5227                                                               (line  20)
5228 * lt_dlopen:                             Libltdl interface.   (line  59)
5229 * lt_dlopenext:                          Libltdl interface.   (line  96)
5230 * lt_dlpreload:                          Libltdl interface.   (line 128)
5231 * lt_dlpreload_default:                  Libltdl interface.   (line 134)
5232 * lt_dlrealloc:                          Libltdl interface.   (line 211)
5233 * lt_dlseterror:                         Module loaders for libltdl.
5234                                                               (line 211)
5235 * lt_dlsetsearchpath:                    Libltdl interface.   (line 167)
5236 * lt_dlsym:                              Libltdl interface.   (line 117)
5237 * lt_dlsymlist <1>:                      Libltdl interface.   (line  42)
5238 * lt_dlsymlist:                          Dlpreopening.        (line  41)
5239 * lt_find_sym:                           Module loaders for libltdl.
5240                                                               (line  79)
5241 * lt_module:                             Module loaders for libltdl.
5242                                                               (line  41)
5243 * lt_module_close:                       Module loaders for libltdl.
5244                                                               (line  72)
5245 * lt_module_open:                        Module loaders for libltdl.
5246                                                               (line  61)
5247 * lt_preloaded_symbols:                  Dlpreopening.        (line  46)
5248 * lt_ptr:                                Libltdl interface.   (line  35)
5249 * lt_user_data:                          Module loaders for libltdl.
5250                                                               (line  48)
5251 * lt_user_dlloader:                      Module loaders for libltdl.
5252                                                               (line  53)
5253 * LTALLOCA:                              Autoconf .o macros.  (line  13)
5254 * LTDL_SET_PRELOADED_SYMBOLS:            Libltdl interface.   (line 144)
5255 * LTLIBOBJS:                             Autoconf .o macros.  (line  18)
5256 * LTLIBRARIES:                           Using Automake.      (line   6)
5257 * ltmain.sh:                             Distributing.        (line  19)
5258 * Makefile:                              Makefile rules.      (line   6)
5259 * Makefile.am:                           Makefile rules.      (line   6)
5260 * Makefile.in:                           Makefile rules.      (line   6)
5261 * mdemo-conf.test:                       Test descriptions.   (line 114)
5262 * mdemo-exec.test:                       Test descriptions.   (line 114)
5263 * mdemo-inst.test:                       Test descriptions.   (line 114)
5264 * mdemo-make.test:                       Test descriptions.   (line 114)
5265 * mdemo-shared.test:                     Test descriptions.   (line 114)
5266 * mdemo-static.test:                     Test descriptions.   (line 114)
5267 * mdemo-unst.test:                       Test descriptions.   (line 114)
5268 * mode, clean:                           Clean mode.          (line   6)
5269 * mode, compile:                         Compile mode.        (line   6)
5270 * mode, execute:                         Execute mode.        (line   6)
5271 * mode, finish:                          Finish mode.         (line   6)
5272 * mode, install:                         Install mode.        (line   6)
5273 * mode, link:                            Link mode.           (line   6)
5274 * mode, uninstall:                       Uninstall mode.      (line   6)
5275 * modules, dynamic <1>:                  Using libltdl.       (line   6)
5276 * modules, dynamic:                      Dlopened modules.    (line   6)
5277 * motivation for writing libtool:        Motivation.          (line   6)
5278 * names of dynamic modules:              Finding the dlname.  (line   6)
5279 * need_lib_prefix:                       libtool script contents.
5280                                                               (line 256)
5281 * need_locks:                            libtool script contents.
5282                                                               (line 270)
5283 * need_version:                          libtool script contents.
5284                                                               (line 264)
5285 * NM <1>:                                libtool script contents.
5286                                                               (line  40)
5287 * NM:                                    AC_PROG_LIBTOOL.     (line 140)
5288 * no_builtin_flag:                       libtool script contents.
5289                                                               (line 274)
5290 * no_undefined_flag:                     libtool script contents.
5291                                                               (line 278)
5292 * noinst-link.test:                      Test descriptions.   (line  77)
5293 * nomode.test:                           Test descriptions.   (line 148)
5294 * none:                                  Porting inter-library dependencies.
5295                                                               (line  38)
5296 * objdir:                                libtool script contents.
5297                                                               (line 283)
5298 * OBJDUMP:                               AC_PROG_LIBTOOL.     (line 155)
5299 * object files, compiling:               Creating object files.
5300                                                               (line   6)
5301 * object files, library:                 Creating object files.
5302                                                               (line  28)
5303 * objext:                                libtool script contents.
5304                                                               (line 286)
5305 * old_archive_cmds:                      libtool script contents.
5306                                                               (line  65)
5307 * old_archive_from_expsyms_cmds:         libtool script contents.
5308                                                               (line  75)
5309 * old_archive_from_new_cmds:             libtool script contents.
5310                                                               (line  69)
5311 * old_postinstall_cmds:                  libtool script contents.
5312                                                               (line 293)
5313 * old_postuninstall_cmds:                libtool script contents.
5314                                                               (line 298)
5315 * old_striplib:                          libtool script contents.
5316                                                               (line 328)
5317 * opaque data types:                     Library tips.        (line  28)
5318 * options, libtool command:              Invoking libtool.    (line   6)
5319 * options, libtoolize command:           Invoking libtoolize. (line   6)
5320 * other implementations, flaws in:       Postmortem.          (line   6)
5321 * partial linking:                       Link mode.           (line 165)
5322 * pass_all:                              Porting inter-library dependencies.
5323                                                               (line  32)
5324 * PIC (position-independent code):       Creating object files.
5325                                                               (line  23)
5326 * pic_flag:                              libtool script contents.
5327                                                               (line 289)
5328 * pitfalls using C++:                    C++ libraries.       (line   6)
5329 * pitfalls with dlopen:                  Dlopen issues.       (line   6)
5330 * portable C headers:                    C header files.      (line   6)
5331 * position-independent code:             Creating object files.
5332                                                               (line  23)
5333 * postinstall_cmds:                      libtool script contents.
5334                                                               (line 292)
5335 * postinstallation:                      Installing libraries.
5336                                                               (line  54)
5337 * postuninstall_cmds:                    libtool script contents.
5338                                                               (line 297)
5339 * problem reports:                       Reporting bugs.      (line   6)
5340 * problems, blaming somebody else for:   Troubleshooting.     (line   6)
5341 * problems, solving:                     Troubleshooting.     (line   6)
5342 * program wrapper scripts:               Linking executables. (line  75)
5343 * quote.test:                            Test descriptions.   (line 151)
5344 * RANLIB <1>:                            libtool script contents.
5345                                                               (line  48)
5346 * RANLIB:                                AC_PROG_LIBTOOL.     (line 143)
5347 * ranlib:                                Linking libraries.   (line  12)
5348 * reload_cmds:                           libtool script contents.
5349                                                               (line 302)
5350 * reload_flag:                           libtool script contents.
5351                                                               (line 303)
5352 * renaming interface functions:          Library tips.        (line  21)
5353 * reporting bugs:                        Reporting bugs.      (line   6)
5354 * reusability of library systems:        Postmortem.          (line   6)
5355 * runpath_var:                           libtool script contents.
5356                                                               (line 306)
5357 * saving time:                           Static-only libraries.
5358                                                               (line   6)
5359 * security problems with buggy linkers:  Linking executables. (line  16)
5360 * sh.test:                               Test descriptions.   (line 154)
5361 * shared libraries, not using:           Static-only libraries.
5362                                                               (line   6)
5363 * shared library versions:               Versioning.          (line   6)
5364 * shl_load <1>:                          Using libltdl.       (line   6)
5365 * shl_load:                              Dlopened modules.    (line   6)
5366 * shlibpath_overrides_runpath:           libtool script contents.
5367                                                               (line 310)
5368 * shlibpath_var:                         libtool script contents.
5369                                                               (line 319)
5370 * solving problems:                      Troubleshooting.     (line   6)
5371 * soname_spec:                           libtool script contents.
5372                                                               (line 323)
5373 * specifications for libtool:            Motivation.          (line  20)
5374 * standalone binaries:                   Static libraries.    (line  61)
5375 * static linking:                        Static libraries.    (line   6)
5376 * strip:                                 Installing libraries.
5377                                                               (line   6)
5378 * striplib:                              libtool script contents.
5379                                                               (line 327)
5380 * stripping libraries:                   Installing libraries.
5381                                                               (line  44)
5382 * su:                                    Installing libraries.
5383                                                               (line   9)
5384 * suffix.test:                           Test descriptions.   (line 157)
5385 * sys_lib_dlsearch_path_spec:            libtool script contents.
5386                                                               (line 334)
5387 * sys_lib_search_path_spec:              libtool script contents.
5388                                                               (line 339)
5389 * tag names:                             Tags.                (line   6)
5390 * test suite:                            Libtool test suite.  (line   6)
5391 * test_compile:                          Porting inter-library dependencies.
5392                                                               (line  26)
5393 * tests, failed:                         When tests fail.     (line   6)
5394 * thread_safe_flag_spec:                 libtool script contents.
5395                                                               (line 348)
5396 * time, saving:                          Static-only libraries.
5397                                                               (line   6)
5398 * tricky design issues:                  Issues.              (line   6)
5399 * trouble with C++:                      C++ libraries.       (line   6)
5400 * trouble with dlopen:                   Dlopen issues.       (line   6)
5401 * troubleshooting:                       Troubleshooting.     (line   6)
5402 * undefined symbols, allowing:           Link mode.           (line  14)
5403 * uninstall mode:                        Uninstall mode.      (line   6)
5404 * unknown:                               Porting inter-library dependencies.
5405                                                               (line  43)
5406 * unresolved symbols, allowing:          Link mode.           (line  14)
5407 * using shared libraries, not:           Static-only libraries.
5408                                                               (line   6)
5409 * version_type:                          libtool script contents.
5410                                                               (line 352)
5411 * versioning, formal:                    Libtool versioning.  (line   6)
5412 * whole_archive_flag_spec:               libtool script contents.
5413                                                               (line 357)
5414 * wl:                                    libtool script contents.
5415                                                               (line 360)
5416 * wrapper scripts for programs:          Linking executables. (line  75)
5419 \x1f
5420 Tag Table:
5421 Node: Top\x7f873
5422 Node: Introduction\x7f6792
5423 Node: Motivation\x7f8614
5424 Node: Issues\x7f9934
5425 Node: Other implementations\x7f11404
5426 Node: Postmortem\x7f11947
5427 Node: Libtool paradigm\x7f13568
5428 Node: Using libtool\x7f14513
5429 Node: Creating object files\x7f16627
5430 Node: Linking libraries\x7f19141
5431 Ref: Linking libraries-Footnote-1\x7f22073
5432 Node: Linking executables\x7f22214
5433 Ref: Linking executables-Footnote-1\x7f27223
5434 Node: Debugging executables\x7f27516
5435 Node: Installing libraries\x7f30224
5436 Ref: Installing libraries-Footnote-1\x7f33400
5437 Node: Installing executables\x7f33482
5438 Node: Static libraries\x7f34275
5439 Node: Invoking libtool\x7f37534
5440 Node: Compile mode\x7f40855
5441 Node: Link mode\x7f43184
5442 Node: Execute mode\x7f50279
5443 Node: Install mode\x7f51059
5444 Node: Finish mode\x7f53065
5445 Node: Uninstall mode\x7f53500
5446 Node: Clean mode\x7f53941
5447 Node: Integrating libtool\x7f54400
5448 Node: Makefile rules\x7f55083
5449 Node: Using Automake\x7f56159
5450 Node: Configuring\x7f58727
5451 Node: AC_PROG_LIBTOOL\x7f59901
5452 Ref: AC_PROG_LIBTOOL-Footnote-1\x7f67233
5453 Node: Distributing\x7f67494
5454 Node: Invoking libtoolize\x7f68662
5455 Node: Autoconf .o macros\x7f70397
5456 Node: Static-only libraries\x7f71651
5457 Ref: Static-only libraries-Footnote-1\x7f73010
5458 Node: Versioning\x7f73119
5459 Node: Interfaces\x7f74491
5460 Node: Libtool versioning\x7f75124
5461 Node: Updating version info\x7f77337
5462 Node: Release numbers\x7f79215
5463 Node: Library tips\x7f81062
5464 Node: C header files\x7f83871
5465 Ref: C header files-Footnote-1\x7f87542
5466 Node: Inter-library dependencies\x7f87751
5467 Node: Dlopened modules\x7f90415
5468 Ref: Dlopened modules-Footnote-1\x7f92328
5469 Node: Building modules\x7f92394
5470 Node: Dlpreopening\x7f93602
5471 Node: Finding the dlname\x7f96436
5472 Ref: Finding the dlname-Footnote-1\x7f97735
5473 Node: Dlopen issues\x7f97788
5474 Node: Using libltdl\x7f98841
5475 Node: Libltdl interface\x7f100621
5476 Node: Modules for libltdl\x7f110781
5477 Node: Thread Safety in libltdl\x7f113268
5478 Node: User defined module data\x7f115479
5479 Node: Module loaders for libltdl\x7f120302
5480 Ref: Module loaders for libltdl-Footnote-1\x7f129691
5481 Node: Distributing libltdl\x7f129797
5482 Ref: Distributing libltdl-Footnote-1\x7f136339
5483 Node: Other languages\x7f136564
5484 Node: C++ libraries\x7f137273
5485 Node: Tags\x7f138713
5486 Node: Troubleshooting\x7f139899
5487 Node: Libtool test suite\x7f140434
5488 Node: Test descriptions\x7f141167
5489 Node: When tests fail\x7f147618
5490 Node: Reporting bugs\x7f148513
5491 Node: Maintaining\x7f150131
5492 Node: New ports\x7f150874
5493 Node: Information sources\x7f151567
5494 Node: Porting inter-library dependencies\x7f154035
5495 Node: Tested platforms\x7f156754
5496 Node: Platform quirks\x7f165184
5497 Node: References\x7f166158
5498 Node: Compilers\x7f167015
5499 Ref: Compilers-Footnote-1\x7f168591
5500 Node: Reloadable objects\x7f168907
5501 Node: Multiple dependencies\x7f169266
5502 Node: Archivers\x7f170158
5503 Node: libtool script contents\x7f170724
5504 Node: Cheap tricks\x7f185961
5505 Node: GNU Free Documentation License\x7f187464
5506 Node: Index\x7f206163
5507 \x1f
5508 End Tag Table