[PATCH 2/2] Update .pc file Requires lines to express full dependencies

Alan Coopersmith alan.coopersmith at oracle.com
Sat Aug 2 11:06:51 PDT 2014


On 02/12/14 08:52 PM, Keith Packard wrote:
> Alan Coopersmith <alan.coopersmith at oracle.com> writes:
>
>> Dependencies via libraries should be tracked via linking the libraries so
>> the ELF data records them correctly.
>
> Yeah, that's not the problem these changes are trying to solve.
>
>> If the headers are required, the dependencies should appear on the
>> Requires.private: line, not the Requires: line - for most X software,
>> the Requires line should be nearly empty, and most things expressed
>> on Requires.private (which also handles static linking if needed).
>
> As the referenced modules almost always provide part of the relevant API
> (especially datatypes), I'm not sure this is correct. These requirements
> aren't hidden behind the API, they're part of the API.
>
> My understanding of Requires.private was that it was for hidden
> implementation details (like the XML library used to parse fontconfig
> configuration files) so that static linking would know to pull in the
> dependency.
>
> But, I'm probably just not understanding the subtle difference between
> Requires and Requires.private...

Sorry, I failed to answer months ago, and was just reminded on IRC.

See points #2 & #3 of
http://people.freedesktop.org/~dbn/pkg-config-guide.html#faq
and Tollef's post at http://err.no/personal/blog/2008/Mar/25 .

Requires.privates are used for both header files & static linking,
Requires are for the rare cases where callers need to directly
dynamically link to the other libraries.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the pkg-config mailing list