dynamically linking debian packages?
I'm the author of LoserJabber (http://loserjabber.sourceforge.net).
Christian Surchi (email@example.com) kindly offerred to make a Debian
package of loserjabber, but he noticed one problem:
LoserJabber can conditionally compile with XMMS support (it will grab
the title of the music you're listening to).
In most cases with Debian packages, I've seen two seperate packages,
compiled in each way (ie, a package "loserjabber" and a package
Christian noted (and I agree) that this seems excessive for such a
simple program. He suggested I make LoserJabber dynamically link to
libxmms.so at runtime (using dlopen()), so a binary compiled with XMMS
support would still run on a system without XMMS (or the XMMS libraries,
I have done this with the CVS version of LoserJabber, and I'm about to
release a official version with the new dlopen() code. (The changes for
using dlopen() aren't major, just about 10 extra lines.)
Unfortunately, I've already recieved a few bug reports about problems
with this. Considering that there's only about six people using the CVS
version of LoserJabber, this is pretty serious. :)
One user had a libxmms.so in /usr/lib that was a symlink to nowhere, and
then a good install of XMMS in /usr/local/lib. He claimed the old
version worked fine, but the new version refused to use XMMS. Another
user had apparently installed his XMMS libraries in /usr2/lib (yes,
that's a 2 in there, don't ask me why).
- Does dlopen() use a different method for finding files than the
standard .so loader? These users had no problems when they were using a
version compiled with -lxmms. I don't understand the dynamic linking
system well enough to determine where the problem is. My code looks
like this: dlopen("libxmms.so", RTLD_LAZY);
- Is this dlopen() method a reasonable solution? It seems like a lot of
effort just to be able to produce one binary package.
(This problem also makes me think of all of the duplicated Debian
packages compiled with different options... sometimes I wonder if it'd
be better if Debian just had you compile them yourself. But that's a
question for a different time.)
Thanks for the help,
Evan Martin - firstname.lastname@example.org