Add Requires.cflags
Submitted by Behdad Esfahbod
Assigned to Tollef Fog Heen @tfheen
Description
According to Loïc Minier [1] pkg-config was recently modified to recursively collect the cflags of Requires.private modules referenced. I believe using Requires.private for two completely separate purposes (libraries to be linked statically, and cflags needed for our headers) is totally bogus.
I suggest that the Requires.private change be reverted and a new tag Requires.cflags be added that only fetches cflags of the modules. For symmetry a Requires.libs tag may as well be added. To keep backward compatibility, you can leave Requires.private alone and add Requires.libs.private with the new semantics.
The use cases for Requires, Requires.cflags, and Requires.libs.private are very clear and separate:
-
Requires: "cairo-xlib" for example requires "cairo" and "xlib". It makes little sense to be using cairo-xlib functions but not linking to cairo and xlib. Though it's not impossible. This is more of a convenience case.
-
Requires.cflags: Used with modules that we use (as in #include) in our public headers. For example, "vte.h" includes "pango.h", "gtk.h", and "glib.h", but it's understandable that not every vte-using application may use those libraries. So vte must Requires.cflags: pango gtk glib, to not force linking to those.
-
Requires.libs.private: This is completely implementation details of the module. For example, harfbuzz may use glib internally, but it doesn't expose any glib-related api nor does it include glib.h from its public headers. The only use for making this information available to users of harfbuzz is solely for static linking purposes.
Cheers,
behdad
[1] http://bugzilla.gnome.org/show_bug.cgi?id=322240