From 757a876f361235915ccd149fb815a4d90303effa Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Thu, 16 Apr 2015 15:34:22 +0000 Subject: [PATCH] Make it harder to specify invalid LIBADD by causing values without corresponding DPADD_ variables to produce a useful error message. Differential Revision: https://reviews.freebsd.org/D2295 Reviewed by: bapt Sponsored by: DARPA, AFRL --- UPDATING | 5 +++++ share/mk/src.libnames.mk | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 33833005c599..886020b221ce 100644 --- a/UPDATING +++ b/UPDATING @@ -35,6 +35,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: The const qualifier has been removed from iconv(3) to comply with POSIX. The ports tree is aware of this from r384038 onwards. +20150416: + Libraries specified by LIBADD in Makefiles must have a corresponding + DPADD_ variable to ensure correct dependencies. This is now + enforced in src.libnames.mk. + 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 044fc04e33b4..512ad2fdd69c 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -282,10 +282,14 @@ LDADD_gssapi_krb5+= ${LDADD_pthread} .if ${_PRIVATELIBS:M${_l}} USEPRIVATELIB+= ${_l} .endif -DPADD+= ${DPADD_${_l}} +DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}} LDADD+= ${LDADD_${_l}} .endfor +.if defined(DPADD) && ${DPADD:Mmissing-dpadd_*} +.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}". +.endif + .if defined(USEPRIVATELIB) LDFLAGS+= -rpath ${LIBPRIVATEDIR} .endif