Thursday, November 5, 2015

Which libtool?

Projects that are based around the GNU Autotools will normally use a tool called libtool to abstract away the different tool options that are needed to build software libraries on different platforms.

However, if you're using Travis's support for the OS X platform to build your project, you may encounter a problem: OS X has its own libtool that does something slightly different. As a result, there's an alternate name for the GNU libtool on OS X, namely glibtool; similarly, the companion libtoolize tool is called glibtoolize.

This problem doesn't usually show up when you're building the distributed version of an project, because that will normally ship with a pre-built configure script, and that configure script can generate and use its own ./libtool (normally from an included file).

However, Travis typically builds things straight from a Git repo, which normally doesn't include the outputs of the autotools process (i.e. the Travis build normally includes a step like ./ or autoreconf to generate configure, and friends). This also means that a missing libtoolize may well show up as the first sign of this problem, since libtoolize is used in this generation process.

If you hit this problem, you may need to fiddle with your Autotools wrapper script so that it copes with either glibtool or libtool. Here's a couple of examples:

See also: Stack Overflow question.

No comments:

Post a Comment