Building against non-installed libraries

If you have seen my repositories lately, you’d probably have noticed that I started working more on third-party projects, in particular you can see repositories for libxdg-basedir (which I’ve been using already for a while for xine-lib) and libxr (which is new, recently added to portage by Luca), together with those you can find a bunch of repositories from lscube and some from Lennart .

The reason for this is that I started considering taking a more active stance when I need something fixed, in particular, I’m just making my changes and then sending upstream the repositories, hoping they get merged quickly. This is the nice thing about having repositories available with GIT and all the like. Unfortunately a lot of projects are still managed with Subversion or, even worse, CVS, or other DVCS which I don’t have set up on midas (yet).

At any rate, one of the changes that is tied with all these project is probably the introduction of the -uninstalled variant of pkg-config files. Simon McVittie writes more about it than I could probably write myself.

There are a few interesting notes about this though. The first is that -uninstalled variants of pkg-config files gets often in the way of libtool; for instance you’d have to point them to the .libs/ directory used internally by libtool, or you’d be able to link against them just with libtool (as they’d point to the .la file). The other problem is that, if you’re building with libtool, it will properly set the rpath/runpath to make sure that the resulting binary is executed against the uninstalled version, but this does not happen, by default, outside of libtool. I’m still pondering whether I should change the -uninstalled.pc files to set the runpath by themselves. Unfortunately it would then work only with ld compatible with GNU syntax.

The nice part of building against non-installed libraries is that it makes it much easier to run a series of tests on the project, which is very nice once you set up unit tests .

Now if only I can solve the unit testing problem, I could be focusing on working on unit testing and possibly to extend unit testing coverage in as many software as possible, which I use, so that I don’t have to worry about broken behaviour. But this is work for another day, right now I have enough to do, I should be writing docs and articles, and converting to Glib and writing tests.

And I just came out of the hospital! I hope the games I ordered from Amazon will arrive soon so I can at least relax a bit during the weekends.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s