Linux binary compatibility
Owen Taylor
otaylor at redhat.com
Sat Feb 28 22:30:10 EET 2004
On Sat, 2004-02-28 at 15:07, Thomas Leonard wrote:
> > > Great, another binary-compat problem fixed :-)
> >
> > This time .... I can't babysit people forever. A part of the autopackage
> > developer guide is dedicated to binary portability. I want to flesh it
> > out and perhaps split it off into a separate book.
> >
> > Do you think it'd be worth collaborating on such a guidebook and hosting
> > it at freedesktop.org?
>
> If they'll have it (I expect so; CC'd). It seems that a lot of these
> problems could actually be fixed upstream, though, rather than just
> written about.
>
> For example, instead of doing
>
> LDFLAGS = `pkg-config --libs gtk+-2.0 | sed 's/-lpangoxft-[^ ]*//'`
>
> in every program's Makefile
Please don't do *that* in *any* programs Makefile. If you are interested
in this subject you should look at what Pango is doing to hide
most of it's dependent libraries, and the --enable-explicit-deps
command option.
But I don't think pkg-config can do this automatically, for instance,
while hiding pangoxft is probably right, hiding pango or GLib is almost
certainly wrong, since Pango and GLib are considered an integral parts
of the GTK+ API.
(On Linux, this actually doesn't matter much, because ld can follow
shared dependencies, but on say Solaris, shared library dependencies are
a run-time only thing. If you use a symbol from a library in your
application, that library must be on the link line.)
Regards,
Owen
More information about the xdg
mailing list