Purpose of --static and Requires.private

Tollef Fog Heen tfheen at err.no
Fri Sep 28 12:17:35 PDT 2012


]] 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.

-- 
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are


More information about the pkg-config mailing list