On Mon, 25 Jan 2010 09:09:47 -0500, Jeff Squyres <jsquy...@cisco.com> wrote: > The short version is that the possibility of static linking really > fouls up the scheme, and we haven't figured out a good way around this > yet. :-(
So pkg-config addresses this with it's Libs.private field and an explicit command-line argument when you want static libs, e.g. $ pkg-config --libs libavcodec -lavcodec $ pkg-config --libs --static libavcodec -pthread -lavcodec -lz -lbz2 -lfaac -lfaad -lmp3lame -lopencore-amrnb -lopencore-amrwb -ltheoraenc -ltheoradec -lvorbisenc -lvorbis -logg -lx264 -lm -lxvidcore -ldl -lasound -lavutil There is no way to simultaneously (a) prevent overlinking shared libs and (b) correctly link static libs without an explicit statement from the user about whether to link *your library* statically or dynamically. Unfortunately, pkgconfig doesn't work well with multiple builds of a package, and doesn't know how to link some libs statically and some dynamically. On the cited bug report, I just wanted to note that collapsing libopen-rte and libopen-pal (even only in production builds) has the undesirable effect that their ABI cannot change without incrementing the soname of libmpi (i.e. user binaries are coupled just as tightly to these libraries as when they were separate but linked explicitly, so this offers no benefit at all). Jed