Bugzilla – Bug 47996
Last modified: 2013-08-23 17:06:07 UTC
The Libs.private setting is a very handy way to handle static as well as shared library builds.
However, when (cross-)compiling for the Windows platform, this is not sufficient. The libraries need extra "dllexport" declarations in the headers when building a shared library. Those can usually be suppressed (for static linking) by something like -DTHISLIBRARY_STATIC. It would avoid lots of nasty code if "pkg-config --cflags" could take care of that. It might be as simple as:
Would you accept a patch that implements this feature?
I think this makes sense. However, I'm uneasy about adding new metadata fields since we currently have no mechanism to signal that a newer pkg-config is needed to parse the .pc file. In other words, this would break when users have an older pkg-config.
I've opened bug63747 to track writing a spec for the current metadata syntax to open the doors for extending it. I've made this bug blocked by it.
For your information: We, the MXE project, are no longer interested in adding the Cflags.private feature to pkg-config. Instead, we switched from pkg-config to pkgconf: