On Sun, 2006-07-23 at 19:26 +0100, Alan Hourihane wrote: 
> On Sun, 2006-07-23 at 13:31 +0200, Michel Dänzer wrote:
> > On Sat, 2006-07-22 at 18:52 +0100, Alan Hourihane wrote:
> > > 
> > > Although should we try and open "libGL.so" first, and then
> > > "libGL.so.1" ??
> > 
> > Can you elaborate on what kind of scenario you think that would be
> > necessary in?
> 
> I'm thinking if anyone does libGL.so.2 for OpenGL 2.x (maybe) ??
> 
> But checking on other OS's I see one of my OpenBSD installs actually
> called it libGL.so.3. I've no idea why though.

Hmm. Basically, whatever libGL's soname actually is, libGL itself (and
by extension this code) should know and thus be able to dlopen the
correct soname. I don't really like the idea of dlopening libGL.so
because it may pick up the wrong one with libGL.so.1 vs. libGL.so.2, and
it may not exist anyway when the distribution GL development packages
aren't installed.

So, I think that these cases could be handled fairly easily in this code
once an ABI for libGL.so.2 has been defined or OpenBSD gets DRI
support. :)

Alternatively, it looks like maybe dladdr() could be used to determine
the soname at runtime, but that's a GNU extension, so it wouldn't help
for the OpenBSD case.

> Having checked the dlopen() man page, maybe we can use NULL for the
> filename which should use the main program, and check all loaded
> libraries anyway....
> 
> So, does this work ...
> 
> glhandle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
> 
> ??

Unfortunately not. I guess 'main program' is to be taken literally...
Thanks for the idea though, this would have been a nice solution.


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to