Purpose of --static and Requires.private

Niklas Gürtler profclonk at gmx.de
Fri Sep 28 13:11:36 PDT 2012

On 09/28/2012 09:17 PM, Tollef Fog Heen wrote:
> ]] Niklas Gürtler 
>> On 09/28/2012 08:43 PM, Tollef Fog Heen wrote:
>>> ]] Niklas Gürtler 
>>>> Is it strictly needed for some case that helloworld1 doesn't depend on
>>>> libgmodule-2.0.so.0, or is this a rather cosmetic feature?
>>> It's for use when statically compiling.  So, rather esoteric.
>> No i meant "not specifying --static" - what would be the
>> problem/downside if there were no Requires.private, and pkg-config would
>> always output everything that's being output when specifying "--static"?
> You end up linking against more than you need to and binaries would
> sometimes needlessly need to be recompiled.
> A depends on B which depends on C (but does not expose C anywhere).  C
> bumps soname.  If A is linked against B and C, A needs to be
> recompiled.  If A is only linked against B, only B needs a recompile for
> the ABI change.
Okay thanks, that's what i guessed for why it's there. But then, why
does pkg-config ignore the --static flag when using --cflags? That way
one could make "A" dependant on "C" when accidentally using functions
from "C" or something...

More information about the pkg-config mailing list