Bug 3060 - Requires mechanism broken
Summary: Requires mechanism broken
Status: RESOLVED NOTABUG
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-18 13:16 UTC by Ronald Wahl
Modified: 2005-04-20 05:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ronald Wahl 2005-04-18 13:16:24 UTC
Just upgraded from 0.15.0 to 0.17.2 and mysql-administrator (besides other
packages) didn't build anymore. I tracked this down to pkg-config. Look:

0.15.0:

$ pkg-config --libs gtkmm-2.0
-L/usr/X11R6/lib -lgtkmm-2.0 -lgdkmm-2.0 -latkmm-1.0 -lgtk-x11-2.0 -lpangomm-1.0
-lglibmm-2.0 -lsigc-1.2 -lgdk-x11-2.0 -lXrandr -lXinerama -lXfixes -lXcursor
-lXext -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lXrender
-lfontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl
-lglib-2.0  

0.17.2:

$ pkg-config --libs gtkmm-2.0
-lgtkmm-2.0  

It seems that the "Requires:" line is ignored.
Comment 1 Tollef Fog Heen 2005-04-18 21:16:34 UTC
This is a feature.

On systems support inter-library linking (such as Linux), libraries should be
linked with the libraries they need.  If your system for some reason doesn't do
that, you can get the previous behaviour by passing --enable-indirect-deps to
pkg-config's configure script.
Comment 2 Ronald Wahl 2005-04-20 15:24:15 UTC
Ok, I understand. But I do not see any real benefit of the new default behavior
currently. What are the reasons for this change? There are some additional notes
from my side:

(1) AFAIK inter-library linking works only for dynamic libraries. So if you
    decide building a static binary of some package you'll still need to
    specify all the required libraries during linking. But pkg-config doesn't
    care about static or dynamic linking, does it?

(2) If a system supports inter-library linking this doesn't necessarily mean
    that it is used in all cases. This depends on the authors of the packages
    that provide the libraries. There are still many old software packages
    around that need fixing to work with the new pkg-config as long as it is
    was configured with the defaults.

As long as there is no real benefit I vote for restoring the old default.
Comment 3 Tollef Fog Heen 2005-04-20 18:42:56 UTC
For static linking, pkg-config now has a --static flag which uses the old
behaviour.  (That won't add -static or anything to the gcc line, so it should be
perfectly safe to use even if you are doing dynamic binaries or libraries)

It has some real benefits; an example is the recent removal of libhowl from
Debian (because of license issues).  If we had a pkg-config which actually only
linked against the libraries the applications needed, we'd have a lot less
uploads and fixes to do, but since all applications which used libgnome (or
libgnomevfs or some other gnome lib) were linked directly with it, they had to
be rebuilt and uploaded anew.

If inter-library linking is supported but not used, I'd argue that's a bug in
the libraries and should be fixed.  Fixing pkg-config to do the right thing
while providing a mechanism for the old behaviour is a way to do that.
Comment 4 Ronald Wahl 2005-04-20 22:26:16 UTC
Ah I see. So fixing the old packages is the right way to go - ok. I was not aware
of the --static flag since it is not specified in the manual. Maybe it should be
documented in the next version. :-)


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.