how should .pc files be configured for "static only" builds?

Michał Górny mgorny at gentoo.org
Thu May 22 00:30:25 PDT 2014


Dnia 2014-05-21, o godz. 10:45:09
Roger Pack <rogerdpack2 at gmail.com> napisał(a):

> It's come to my attention the following conundrum:
> 
> https://www.flameeyes.eu/autotools-mythbuster/pkgconfig/dependencies.html
> 
> in my own words, it seems impossible to know if, when calling
> pkg-config, the library was compiled statically or dynamically" (so
> you don't know whether to call pkg-config --static or not).
> 
> Has there been any improvement/progress on this as of late?

No, and I doubt there ever will be. If there were real interest
in static linking, it would rather be focused on fixing/replacing
the static library format rather than improving work-arounds over it.

Static linking is practically always a wrong idea. You can look at [1]
for some reasoning though static linking is just one of the focuses of
that wiki page. You can also find some mentions of it on Diego's blog
you linked.

If you're writing a build system for a project, don't take static
linking into consideration at all. If you're an user, just don't use
it ;). If you really need it, you're on your own and you probably don't
want to rely on any automated solutions like 'pkg-config --static'
at all. Instead, hand-pick necessary libraries and try to get as many
linked dynamically as possible :).

[1]:https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies

-- 
Best regards,
Michał Górny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pkg-config/attachments/20140522/a699e2f8/attachment.sig>


More information about the pkg-config mailing list