Direct or indirect libdependencies (using the case)

Alexander Leidinger Alexander at
Thu Jun 3 13:02:16 UTC 2010

Quoting Peter Jeremy <peter at> (from Thu, 3 Jun 2010  
22:37:28 +1000):

> On 2010-Jun-01 10:54:02 +0200, Jan Henrik Sylvester <me at> wrote:
>> Yesterday, I was chasing, rebuilding all ports that got
>> bumped, checking with libchk for other dependencies, and
>> forcing a rebuild of all these packages: All but two of them had an
>> indirect dependency on devel/gettext (and I did email the maintainers of
>> devel/ccrtp and textproc/gsed linking without a dependency).
> This might be unrealistic but, IMHO, these "indirect dependencies" should
> not exist.  IMHO, there should only be two situations:
> 1) Port X directly links against or dlopen's from port Y.
> In this case, port Y should be listed in LIB_DEPENDS or equivalent
> for port X and port X will need a portrevision bump and rebuild if
> the port Y ABI changes (eg a .so version bump)
> 2) Port X directly links against or dlopen's and pulls
>    in from port Y.
> In this case, port X should not be directly accessing any symbols in
>  If the ABI changes, will need to be rebuilt
> but unless the ABI changes, there should be no need to rebuild
> port X.
> Are there any other situations that have to be considered?

The problem is a little bit more complex if you have a look at the big  

Indirect dependencies get hardcoded into binaries in several  
cases(*1), except you use a compiler switch which tells the  
compile-time-linker to not record library dependencies when no symbols  
of those libs are reference directly(*2).

If you want to know which libs are linked into binaries of a port, I  
suggest you have a look at my  
/usr/ports/Tools/scripts/ script (note that its  
name starts with "explicit", not with "direct", this is on purpose as  
those two descriptions have a different semantic which is important  
for this discussion).

(*1) Either by libtool as it does not has some hint enabled on  
FreeBSD, or by pkg-config listing them directly even if the  
corresponding library does not reference symbols of such a dependency  
in its API.

(*2) This is used by some gnome ports (not all), and can not be  
enabled globally, as some programs may depend upon this (e.g. when  
loading plugins which are not linked correctly).


Most people can do without the essentials, but not without the luxuries.    Alexander @ PGP ID = B0063FE7       netchild @  : PGP ID = 72077137

More information about the freebsd-ports mailing list