GNOME Bugzilla – Bug 685477
Incorrect pkg-config files causes useless linking in applications
Last modified: 2021-05-17 16:29:29 UTC
All pkg-config files in the gupnp stack (gssdp, gupnp, gupnp-av, ...) are flawed in two ways. 1) Requires.Private is not parsed at all by pkg-config (c.f. Requires.private) 2) When exposing used libraries types in public headers, they should be in Requires.private (to be included in pkg-config --cflags libfoo, but not pkg-config --libs libfoo) I guess the first mistake lead up to putting everything in Requires rather then Requires.private in the pkg-config files. (For reference on 2, see the faq #2 in "Guide to pkg-config")
Please beware! Some applications might be broken to rely on GUPnP pulling in linker flags to libraries that the application uses! One such application is Rygel which uses gssdp (et.al.) directly but doesn't link to it. See Bug #685478
Created attachment 225778 [details] [review] gssdp patch 1/2 the libraries in Requires.Private maybe should be in Requires.private for static linking to work properly. I have no way of testing this theory though.
Created attachment 225779 [details] [review] gssdp patch 2/2
Created attachment 225781 [details] [review] gupnp patch 1/2 the libraries in Requires.Private maybe should be in Requires.private for static linking to work properly. I have no way of testing this theory though.
Created attachment 225782 [details] [review] gupnp patch 2/2
Created attachment 225785 [details] [review] gupnp-av patch 1/2
Created attachment 225786 [details] [review] gupnp-av patch 2/2 Once gssdp/gupnp gets fixed, gupnp-av will fail to build without this patch because of "underlinking" (not explicitly linking to stuff it uses directly).
Created attachment 225787 [details] [review] gupnp-dlna
Created attachment 225788 [details] [review] gupnp-igd
Comment on attachment 225778 [details] [review] gssdp patch 1/2 Applied
Comment on attachment 225779 [details] [review] gssdp patch 2/2 Applied
Comment on attachment 225781 [details] [review] gupnp patch 1/2 commited
Comment on attachment 225782 [details] [review] gupnp patch 2/2 Commited
Comment on attachment 225787 [details] [review] gupnp-dlna While this patch is still correct in theory, the gst dependency has been split out of gupnp(-dlna) and into a separate sub-module.... If I understand the new lay of the land, this makes the problem strictly theoretical..... Marking the patch as obsolete (even though the exact same change could still be used on gupnp-dlna-gst-2.0.pc now, but for no practically visible gain).
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME'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.gnome.org/GNOME/gupnp/-/issues/31.