[Xcb] XCB structure

Pierre Phaneuf pp@ludusdesign.com
Thu, 30 Oct 2003 08:02:10 -0500

Jamey Sharp wrote:

> I didn't recall that being the plan, but it seems like a fine plan. I
> thought the plan was to include the most common things in a single 
> library to avoid long lists of -l flags for applications using a
> bunch of common extensions, but I don't think there are a bunch of
> common extensions, so one per library sounds just fine.
> I did it this way as a proof of concept more than anything else, and
> I haven't tested the dependency magic with this code yet. It's easy
> to do as many libs as desired with automake.
> Statistics: I thought libXCB was running 35kB with the core only, but
> it turns out I only forgot to compile with -O2. It's 24.89kB, and
> libXCBext is 11.8kB, when you measure the text sections of the static
> libs.

There is a space and performance overhead per shared library, hence the
organization of Xlib to have a number of "common" extensions in a single
libXext library and other less common extensions in their own libraries.

So the current setup with libXCB and libXCBext sounds like the right
thing to do.

Check out the "How to Write Shared Libraries" paper that explain what's
going on with shared libraries and all the ways you can optimize for
size and speed (do you know the difference between -fpic and -fPIC? do
you use it?):


Pierre Phaneuf
"I am denial, guilt and fear -- and I control you"