Bug 47996 - Feature-Request: Cflags.private
Summary: Feature-Request: Cflags.private
Status: RESOLVED MOVED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 63747
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-28 04:01 UTC by Volker Grabsch
Modified: 2018-08-25 12:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Volker Grabsch 2012-03-28 04:01:03 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:

Cflags.privat: -DTHISLIBRARY_STATIC

Would you accept a patch that implements this feature?

See also:

http://sourceforge.net/tracker/?func=detail&atid=101032&aid=3511842&group_id=1032#artifact_comment_6232799
Comment 1 Dan Nicholson 2013-04-20 01:53:35 UTC
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.
Comment 2 Volker Grabsch 2013-08-23 17:06:07 UTC
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:

https://lists.nongnu.org/archive/html/mingw-cross-env-list/2013-08/msg00062.html

Best Regards,
Volker
Comment 3 GitLab Migration User 2018-08-25 12:56:00 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/38.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.