HomeFreeBSD

Fix Makefiles which override LIBDIR to not add incorrect dependencies into .

Description

Fix Makefiles which override LIBDIR to not add incorrect dependencies into .depend.

This fixes these cases which would rebuild every time:

make[6]: /usr/obj/usr/src/libexec/rtld-elf/tests/libpythagoras/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/libexec/rtld-elf/libm.a
make[6]: /usr/obj/usr/src/lib/libxo/tests/encoder/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/lib/libxo/libxo.a
make[7]: /usr/obj/usr/src/lib/libthr/tests/dlopen/dso/.depend, 1: ignoring stale .depend for /usr/obj/usr/src/tmp/usr/tests/lib/libthr/dlopen/libpthread.a

The problem is that some Makefiles will override LIBDIR to where they want
their library to install. bsd.libnames.mk will then use ${LIBDIR} to define
where *existing* libraries are. This then leads to looking for the
libraries in the *target* place rather than the *expected* place.

We may want to expand this (and all of the other *DIR variables in bsd.own.mk)
into something like what Ports has, a PREFIX and a LOCALBASE. PREFIX being
where things are being installed to and LOCALBASE being where they already are.

For now store the default expected LIBDIR into LIBDIR_BASE and use that for
library locations.

Reported by: sbruno
MFC after: 1 week
Sponsored by: Dell EMC Isilon

Details

Provenance
bdreweryAuthored on
Parents
rS320060: lld: Fix weak symbols on arm and aarch64
Branches
Unknown
Tags
Unknown