On 9/12/07, Brian Paul <[EMAIL PROTECTED]> wrote:
> Dan Nicholson wrote:
> > On 9/12/07, Brian Paul <[EMAIL PROTECTED]> wrote:
> >> Dan Nicholson wrote:
> >>> Currently there is no reliable and simple way to configure for and develop
> >>> with the Mesa OpenGL libraries. This is especially true if there are 
> >>> multiple
> >>> GL installations. The pkg-config utility makes these problems much easier 
> >>> to
> >>> deal with.
> >>>
> >>> This is an initial patch to export information for the GL, GLU, GLw and 
> >>> glut
> >>> libraries. Several improvements could be made, such as including the 
> >>> backend
> >>> dependent requirements of the libraries.
> >> Checked in.  Thanks.
> >
> > Thanks, Brian. As alluded to, this is still a little bare because
> > you're not getting all the dependencies, such as -lX11 -lXext.
> > Ideally, you'd have x11 and xext (and libdrm, etc.) in the Requires:
> > line. But I don't see any sane way to handle that right now. A
> > possibility would be to stuff the GL_LIB_DEPS variable onto the Libs:
> > line. Ditto the Cflags.
>
> Well, when we build libGL.so we link it with -lX11 -lXext -lpthread,
> etc. so the user doesn't have to know all the dependencies of libGL.
>
> Am I missing something?

A couple things could happen. First, consider static linking. In that
case, you do need to specify all the library dependencies. If you're
on host with Xorg development libraries (I would imagine :), compare
the output of `pkg-config --libs x11' and `pkg-config --libs --static
x11'. Here's what's in x11.pc.

$ cat /usr/lib/pkgconfig/x11.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

xthreadlib=-lpthread

Name: X11
Description: X Library
Version: 1.1.3
Requires: xproto kbproto
Requires.private: xau xdmcp xcb-xlib
Cflags: -I${includedir}
Libs: -L${libdir} -lX11
Libs.private: -lpthread

When you specify --static, it also pulls up the Requires.private and
Libs.private lines. So, if you tried to static link a program with the
gl.pc file I sent you, it wouldn't work right now.

The second issue is multiple install prefixes. What happens if you
have X in /opt/xorg or ~/xorg-devel? How does that interact with your
distro's X in /usr or /usr/X11R6. Within Mesa, this is handled by
setting the variables X11_INCLUDES and EXTRA_LIBRARY_PATH. Outside the
Mesa tree, the ideal way for this to be handled would be if you had
'Requires: x11' in the gl.pc file. Then pkg-config would search for
the first occurrence of x11.pc in $PKG_CONFIG_PATH and add the
metadata from there. This is exactly how you build an isolated Xorg
right now.

That issue is more difficult to handle right now because it would
require a fully pkg-config using X installation (Xorg). It would also
be difficult to reliably substitute the right information into the
gl.pc file at Mesa build time, too.

Both issues could probably be punted on for now, but it might be the
right thing to just populate Libs.private with $(GL_LIB_DEPS).

--
Dan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to