Bug 32827 - Tidy up Libs in .pc file and add -uninstalled.pc version
Summary: Tidy up Libs in .pc file and add -uninstalled.pc version
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: Other All
: medium enhancement
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
: 27287 (view as bug list)
Depends on:
Blocks: dbus-1.4 dbus-1.5
  Show dependency treegraph
 
Reported: 2011-01-04 11:17 UTC by Simon McVittie
Modified: 2011-04-26 11:22 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dbus-1.pc.in: move -lpthread, -lrt, Winsock to Libs.private (866 bytes, patch)
2011-01-04 11:17 UTC, Simon McVittie
Details | Splinter Review
Add dbus-1-uninstalled.pc.in (1.58 KB, patch)
2011-01-04 11:18 UTC, Simon McVittie
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Simon McVittie 2011-01-04 11:17:43 UTC
Created attachment 41637 [details] [review]
dbus-1.pc.in: move -lpthread, -lrt, Winsock to Libs.private

dbus-1.pc.in has libpthread, librt and/or Winsock in its Libs, whereas they should be in Libs.private:

"Private libraries  are  libraries  which  are  not  exposed through your
library, but are needed in the case of static linking" -- pkg-config(1)

Meanwhile, it'd be nice for developers if there was an uninstalled version of the .pc file so you can link against an uninstalled copy of libdbus; see http://smcv.pseudorandom.co.uk/2008/09/pc-uninstalled/ for more about that.
Comment 1 Simon McVittie 2011-01-04 11:18:46 UTC
Created attachment 41638 [details] [review]
Add dbus-1-uninstalled.pc.in
Comment 2 Simon McVittie 2011-03-03 07:33:28 UTC
*** Bug 27287 has been marked as a duplicate of this bug. ***
Comment 3 Colin Walters 2011-04-26 09:52:22 UTC
(In reply to comment #0)
> Created an attachment (id=41637) [details]
> dbus-1.pc.in: move -lpthread, -lrt, Winsock to Libs.private
> 
> dbus-1.pc.in has libpthread, librt and/or Winsock in its Libs, whereas they
> should be in Libs.private:

Hmmm, ouch.  We really should have noticed this in the first place =/

But...I'm worried about application compatibility.  It's possible that an application was building using -ldbus and was using e.g. clock_gettime() and not explicitly linking to -lrt.

Granted this is just a compilation and probably won't break existing binaries, but still I think this one is better on the 1.5 branch and not in a stable release.
Comment 4 Colin Walters 2011-04-26 09:53:49 UTC
(In reply to comment #1)
> Created an attachment (id=41638) [details]
> Add dbus-1-uninstalled.pc.in

Looks good, and thanks for the blog entry link - I never knew exactly how the -uninstalled stuff was supposed to work.
Comment 5 Simon McVittie 2011-04-26 11:22:48 UTC
(In reply to comment #3)
> But...I'm worried about application compatibility.  It's possible that an
> application was building using -ldbus and was using e.g. clock_gettime() and
> not explicitly linking to -lrt.

OK, I only applied this commit on master (for 1.5.2).

> Granted this is just a compilation and probably won't break existing binaries

It won't, pkg-config is only used at compile time.

(In reply to comment #4)
> (In reply to comment #1)
> > Created an attachment (id=41638) [details] [details]
> > Add dbus-1-uninstalled.pc.in
> 
> Looks good

Fixed in git for 1.4.10, 1.5.2. Note that because this was based on the improved .pc from the commit above, people using an uninstalled dbus *do* get the Libs.private fix - but if you're using an uninstalled copy of dbus I think it's OK to enforce stricter correctness.


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.