[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pkg-config including too much crap



"Martijn van Oosterhout" <kleptog@gmail.com> writes:

> On 4/4/06, Loïc Minier <lool+debian@via.ecp.fr> wrote:
>>  gtk+-2.0.pc's Libs only has -lgtk, it requires gdk, atk, and cairo
>>  because of grep -ir #include /usr/include/gtk-2.0 | grep -v 'atk' (it
>>  needs at least the Cflags).  Some people go as far as saying that since
>>  the headers are included from gtk's headers, the resulting binaries
>>  should be linked against these dependency-libs.

There are two cases:

1) the library just passes things through

A gtk structure could have a "struct atk *" member that is passed down
to libatk by the application without gtk ever touching it. In that
case the binary should be linked against gtk and atk but libgtk should
not link against atk. A change in the struct atk would not affect
libgtk.

2) the library uses and exports part of the other lib

Again say a gtk structure has a "struct atk *" as member but gtk also
dereferences the pointer and uses the contents. In that case libgtk
should link against atk itself already. A change in the structure
would affect libgtk. The (useless) linking to atk would show the
dependency on the ABI.

In both cases the CFLAGS would have to include the atk include path
though.

> What we need is an option follow requires for cflags but not for libs.
>
> Hopefully, one day....

Hopefully. :)

MfG
        Goswin



Reply to: