[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13. Troubleshooting

Libtool is under constant development, changing to remain up-to-date with modern operating systems. If libtool doesn't work the way you think it should on your platform, you should read this chapter to help determine what the problem is, and how to resolve it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1 The libtool test suite

Libtool comes with two integrated sets of tests to check that your build is sane, that test its capabilities, and report obvious bugs in the libtool program. These tests, too, are constantly evolving, based on past problems with libtool, and known deficiencies in other operating systems.

As described in the `README' file, you may run make -k check after you have built libtool (possibly before you install it) in order to make sure that it meets basic functional requirements.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1.1 Description of test suite

Here is a list of the current programs in the old test suite, and what they test for:

`cdemo-conf.test'
`cdemo-exec.test'
`cdemo-make.test'
`cdemo-static.test'
`cdemo-shared.test'
`cdemo-undef.test'

These programs check to see that the `tests/cdemo' subdirectory of the libtool distribution can be configured and built correctly.

The `tests/cdemo' subdirectory contains a demonstration of libtool convenience libraries, a mechanism that allows build-time static libraries to be created, in a way that their components can be later linked into programs or other libraries, even shared ones.

The tests `cdemo-make.test' and `cdemo-exec.test' are executed three times, under three different libtool configurations: `cdemo-conf.test' configures `cdemo/libtool' to build both static and shared libraries (the default for platforms that support both), `cdemo-static.test' builds only static libraries (`--disable-shared'), and `cdemo-shared.test' builds only shared libraries (`--disable-static').

The test `cdemo-undef.test' tests the generation of shared libraries with undefined symbols on systems that allow this.

`demo-conf.test'
`demo-exec.test'
`demo-inst.test'
`demo-make.test'
`demo-unst.test'
`demo-static.test'
`demo-shared.test'
`demo-nofast.test'
`demo-pic.test'
`demo-nopic.test'

These programs check to see that the `tests/demo' subdirectory of the libtool distribution can be configured, built, installed, and uninstalled correctly.

The `tests/demo' subdirectory contains a demonstration of a trivial package that uses libtool. The tests `demo-make.test', `demo-exec.test', `demo-inst.test' and `demo-unst.test' are executed four times, under four different libtool configurations: `demo-conf.test' configures `demo/libtool' to build both static and shared libraries, `demo-static.test' builds only static libraries (`--disable-shared'), and `demo-shared.test' builds only shared libraries (`--disable-static'). `demo-nofast.test' configures `demo/libtool' to disable the fast-install mode (`--enable-fast-install=no'). `demo-pic.test' configures `demo/libtool' to prefer building PIC code (`--with-pic'), `demo-nopic.test' to prefer non-PIC code (`--without-pic').

`demo-deplibs.test'

Many systems cannot link static libraries into shared libraries. libtool uses a deplibs_check_method to prevent such cases. This tests checks whether libtool's deplibs_check_method works properly.

`demo-hardcode.test'

On all systems with shared libraries, the location of the library can be encoded in executables that are linked against it see section Linking executables. This test checks the conditions under which your system linker hardcodes the library location, and guarantees that they correspond to libtool's own notion of how your linker behaves.

`demo-relink.test'
`depdemo-relink.test'

These tests check whether variable shlibpath_overrides_runpath is properly set. If the test fails and VERBOSE is set, it will indicate what the variable should have been set to.

`demo-noinst-link.test'

Checks whether libtool will not try to link with a previously installed version of a library when it should be linking with a just-built one.

`depdemo-conf.test'
`depdemo-exec.test'
`depdemo-inst.test'
`depdemo-make.test'
`depdemo-unst.test'
`depdemo-static.test'
`depdemo-shared.test'
`depdemo-nofast.test'

These programs check to see that the `tests/depdemo' subdirectory of the libtool distribution can be configured, built, installed, and uninstalled correctly.

The `tests/depdemo' subdirectory contains a demonstration of inter-library dependencies with libtool. The test programs link some interdependent libraries.

The tests `depdemo-make.test', `depdemo-exec.test', `depdemo-inst.test' and `depdemo-unst.test' are executed four times, under four different libtool configurations: `depdemo-conf.test' configures `depdemo/libtool' to build both static and shared libraries, `depdemo-static.test' builds only static libraries (`--disable-shared'), and `depdemo-shared.test' builds only shared libraries (`--disable-static'). `depdemo-nofast.test' configures `depdemo/libtool' to disable the fast-install mode (`--enable-fast-install=no'.

`mdemo-conf.test'
`mdemo-exec.test'
`mdemo-inst.test'
`mdemo-make.test'
`mdemo-unst.test'
`mdemo-static.test'
`mdemo-shared.test'

These programs check to see that the `tests/mdemo' subdirectory of the libtool distribution can be configured, built, installed, and uninstalled correctly.

The `tests/mdemo' subdirectory contains a demonstration of a package that uses libtool and the system independent dlopen wrapper `libltdl' to load modules. The library `libltdl' provides a dlopen wrapper for various platforms (Linux, Solaris, HP/UX etc.) including support for dlpreopened modules (see section Dlpreopening).

The tests `mdemo-make.test', `mdemo-exec.test', `mdemo-inst.test' and `mdemo-unst.test' are executed three times, under three different libtool configurations: `mdemo-conf.test' configures `mdemo/libtool' to build both static and shared libraries, `mdemo-static.test' builds only static libraries (`--disable-shared'), and `mdemo-shared.test' builds only shared libraries (`--disable-static').

`mdemo-dryrun.test'

This test checks whether libtool's `--dry-run' mode works properly.

`mdemo2-conf.test'
`mdemo2-exec.test'
`mdemo2-make.test'

These programs check to see that the `tests/mdemo2' subdirectory of the libtool distribution can be configured, built, and executed correctly.

The `tests/mdemo2' directory contains a demonstration of a package that attempts to link with a library (from the `tests/mdemo' directory) that itself does dlopening of libtool modules.

`link.test'

This test guarantees that linking directly against a non-libtool static library works properly.

`link-2.test'

This test makes sure that files ending in `.lo' are never linked directly into a program file.

`nomode.test'

Check whether we can actually get help for libtool.

`objectlist.test'

Check that a nonexistent objectlist file is properly detected.

`pdemo-conf.test'
`pdemo-exec.test'
`pdemo-inst.test'
`pdemo-make.test'

These programs check to see that the `tests/pdemo' subdirectory of the libtool distribution can be configured, built, and executed correctly.

The `pdemo-conf.test' lowers the max_cmd_len variable in the generated libtool script to test the measures to evade command line length limitations.

`quote.test'

This program checks libtool's metacharacter quoting.

`sh.test'

Checks for some nonportable or dubious or undesired shell constructs in shell scripts.

`suffix.test'

When other programming languages are used with libtool (see section Using libtool with other languages), the source files may end in suffixes other than `.c'. This test validates that libtool can handle suffixes for all the file types that it supports, and that it fails when the suffix is invalid.

`tagdemo-conf.test'
`tagdemo-exec.test'
`tagdemo-make.test'
`tagdemo-static.test'
`tagdemo-shared.test'
`tagdemo-undef.test'

These programs check to see that the `tests/tagdemo' subdirectory of the libtool distribution can be configured, built, and executed correctly.

The `tests/tagdemo' directory contains a demonstration of a package that uses libtool's multi-language support through configuration tags. It generates a library from C++ sources, which is then linked to a C++ program.

`f77demo-conf.test'
`f77demo-exec.test'
`f77demo-make.test'
`f77demo-static.test'
`f77demo-shared.test'

These programs check to see that the `tests/f77demo' subdirectory of the libtool distribution can be configured, built, and executed correctly.

The `tests/f77demo' tests test Fortran 77 support in libtool by creating libraries from Fortran 77 sources, and mixed Fortran and C sources, and a Fortran 77 program to use the former library, and a C program to use the latter library.

`fcdemo-conf.test'
`fcdemo-exec.test'
`fcdemo-make.test'
`fcdemo-static.test'
`fcdemo-shared.test'

These programs check to see that the `tests/fcdemo' subdirectory of the libtool distribution can be configured, built, and executed correctly.

The `tests/fcdemo' is similar to the `tests/f77demo' directory, except that Fortran 90 is used in combination with the `FC' interface provided by Autoconf and Automake.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.1.2 When tests fail

Each of the tests in the old test suite are designed to produce no output when they are run via make check. The exit status of each program tells the `Makefile' whether or not the test succeeded.

If a test fails, it means that there is either a programming error in libtool, or in the test program itself.

To investigate a particular test, you may run it directly, as you would a normal program. When the test is invoked in this way, it produces output that may be useful in determining what the problem is.

Another way to have the test programs produce output is to set the VERBOSE environment variable to `yes' before running them. For example, env VERBOSE=yes make check runs all the tests, and has each of them display debugging information.

The new, Autotest-based test suite produces as output a file `tests/testsuite.log' which contains information about failed tests.

You can pass options to the test suite through the make variable TESTSUITEFLAGS (see (autoconf)testsuite Invocation section `The Autoconf Manual' in The Autoconf Manual).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.2 Reporting bugs

If you think you have discovered a bug in libtool, you should think twice: the libtool maintainer is notorious for passing the buck (or maybe that should be "passing the bug"). Libtool was invented to fix known deficiencies in shared library implementations, so, in a way, most of the bugs in libtool are actually bugs in other operating systems. However, the libtool maintainer would definitely be happy to add support for somebody else's buggy operating system. [I wish there was a good way to do winking smiley-faces in Texinfo.]

Genuine bugs in libtool include problems with shell script portability, documentation errors, and failures in the test suite (see section The libtool test suite).

First, check the documentation and help screens to make sure that the behaviour you think is a problem is not already mentioned as a feature.

Then, you should read the Emacs guide to reporting bugs (see (emacs)Bugs section `Reporting Bugs' in The Emacs Manual). Some of the details listed there are specific to Emacs, but the principle behind them is a general one.

Finally, send a bug report to the Libtool bug reporting address bug-libtool@gnu.org with any appropriate facts, such as test suite output (see section When tests fail), all the details needed to reproduce the bug, and a brief description of why you think the behaviour is a bug. Be sure to include the word "libtool" in the subject line, as well as the version number you are using (which can be found by typing libtool --version).


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated on July, 20 2009 using texi2html 1.76.