Bug 32827

Summary: Tidy up Libs in .pc file and add -uninstalled.pc version
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: enhancement    
Priority: medium CC: hp, mikhail.zabaluev, walters
Version: 1.4.xKeywords: patch
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/dbus-smcv.git;a=shortlog;h=refs/heads/uninstalled
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 36074, 36164    
Attachments: dbus-1.pc.in: move -lpthread, -lrt, Winsock to Libs.private
Add dbus-1-uninstalled.pc.in

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.