Subject: Unneeded dependencies on MesaLib
To: None <tech-pkg@netbsd.org>
From: Jonathan Schleifer <jschleifer@gmail.com>
List: tech-pkg
Date: 07/24/2005 18:25:52
I just wanted to play a bit foobillard over ethernet on an accelerated
display, but I had only about 0.5 fps. So I looked further into this
and found out that it dependes on MesaLib, which is pure software
rendering. I also found out that /usr/X11R6/lib/libGL.so.1 exists, so
there's no need for MesaLib. If MesaLib is installed, MesaLib's
libGL.so is used instead of X11's. That's why I just removed it, but
this raised very strange behaviour:
ldd /usr/pkg/bin/zsnes shows that it now uses
/usr/X11R6/lib/libGL.so.1 instead of MesaLibs's
/usr/pkg/lib/libGL.so.1 which is just fine, but ldd
/usr/pkg/bin/foobillard shows this:
-lGL.1 =3D> /usr/X11R6/lib/libGL.so.1
-lGL.1 =3D> not found
ldd zsnes only shows the first line. So I thought I'd just have to
recompile foobillard without MesaLib and removed that .include
"../../graphics/MesaLib/buildlink3.mk" in the Makefile.
Even after this, it still wanted MesaLib, so I looked further into it
and found out that GLU, GLUT, SDL and many more also depend on
MesaLib. Even those don't need it if /usr/X11R6/lib/libGL.so.1 exists.
I also found out that the libGL.so.1 that comes with X11 is also on
unaccelerated displays much faster than MesaLib. With MesaLib, I get
about 144 fps on my unaccelerated notebook, without it, I get about
224 fps.

That's why I would suggest the following:
It would be better if there would be mk/gl.mk and that would be
included instead of MesaLib's buildlink3.mk.
This file should check if /usr/X11R6/lib/libGL.so.1 exists, and if it
does, then this one is used. If it doesn't exists, then MesaLib is
built and used.
This way, it would be possible to use X11's faster libGL.so, that even
has acceleration on remote displays, on machines with X11 and to use
MesaLib on machines without X11 (for example for svgalib). Also, it
would be possible to run GL games and apps on accelerated remote
displays, which is very fast. If someone really wants MesaLib on X11,
it's still possible to install it manually and then MesaLib is used.

Please also post your ideas. Maybe it's all my fault and I've overseen
something important? Any feedback is welcome!

--=20
Jonathan