On Sat, Jun 25, 2011 at 02:08:07PM +0300, Antti Harri wrote:
> On Saturday 25 June 2011 13:52:02 Alexandre Ratchov wrote:
> > There's code (eg. audio/openal, but not only) that does:
> >
> >     dlopen("libsndio.so", ...);
> >
> > and then calls dlsym() for each function and so on. What's the point
> > of doing this instead of simply linking the binary with -lsndio and
> > using functions normally?
> >
> > hints?
> >
> > -- Alexandre
> 
> Extending the same subject a little: I'm interested in knowing how to handle 
> these with ports? Is there a real good rule of thumb here and is this 
> documented in the ports faq?
> 
> For example xvidcore adds some libs to WANTLIB even though check-lib-depends 
> doesn't want them. But devel/sdl depends on libGL that it opens with dlopen() 
> and there is no "GL" in WANTLIB.

Yes, there is a good rule of thumb: things should work.

Like, it the dlopen'd stuff is actually *mandatory* for the port to be useful,
then it should be in WANTLIB.

If it's not mandatory, it's like your usual RUN_DEPENDS: is it a problem not
to have it ? does it show up as obvious from reduced functionality ? does it
pull a whole lot of shit from the ports tree or is the dependance fairly
minimal ?

There's *no way* lib-depends-check is going to help you with these: by
design, using a library through dlopen is something that happens at runtime,
so you can run all the ldds and objdump in the world, they won't catch it.

Reply via email to