Rex Dieter wrote on Thu, Aug 02, 2018 at 10:14:13AM -0500:
Dominique Martinet wrote:
> In practice, `pkg-config --cflags foo` will only fetch cflags for
> dependencies listed in Requires, not Requires.private
pkg-config --cflags foo
fetches cflags of Requires.private items in foo.pc for me.
I see, that indeed appears to work on fedora, but not on the nixos box I
tested (because having different include paths made testing easier
there, but now I'm testing on fedora it looks OK there as you say)
The difference between the two is that nixos is using the freedesktop
pkg-config while fedora uses pkgconf, so it would appear this
isn't standard maybe? At which point the man page could use being more
explicit about it...
Oh, now I'm looking there's a (rather long) bug open about this here:
I've patched many packages to use that feature, and haven't
breakage (so far).
Well, packages can be fixed on the fedora side, but as upstream I
wouldn't accept such a change until the freedesktop version behaves the
same as I'd want to support users of either pkg-config version.
Igor Gnatenko wrote on Thu, Aug 02, 2018 at 06:12:23PM +0200:
The real problem here is when you have complex frameworks like gtk.
pkg-config basically will link you against gdk, gdk-pixbuf, gtk and a lot
of other stuff. But in practice, not every application need to link against
all of them.
Yeah, complex frameworks are difficult with that, but upstream is
actually dealing with it indirectly by switching to more modern build
systems (for gtk, see gnome's MesonPorting page)
meson will automatically add --as-needed to the linker flags as
appropriate (don't ask me what is appropriate), so we won't need to
force it for them when they're done.
Eventually some autotools/libtool macro could be added for other
projects to use..