svn commit: r320171 - head/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Tue Jun 20 20:34:31 UTC 2017
Author: bdrewery
Date: Tue Jun 20 20:34:30 2017
New Revision: 320171
URL: https://svnweb.freebsd.org/changeset/base/320171
Log:
LIBADD: Try to support partial tree checkouts in some limited cases.
LIBADD is only supported for in-tree builds because we do not install
share/mk/src.libnames.mk (which provides LIBADD support) into /usr/share/mk.
So if a partial checkout is done then the LIBADDs are ignored and no LDADD is
ever added.
Provide limited support for this case for when LIBADD is composed entirely of
base libraries. This is to avoid clashes with ports and other out-of-tree
LIBADD uses that should not be mapped to LDADD and because we do not want to
support LIBADD out-of-tree right now.
Reported by: mckusick, kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Modified:
head/share/mk/bsd.libnames.mk
Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk Tue Jun 20 20:22:34 2017 (r320170)
+++ head/share/mk/bsd.libnames.mk Tue Jun 20 20:34:30 2017 (r320171)
@@ -194,4 +194,26 @@ LDADD:= ${LDADD:N-lc} -lc
.for lib in ${_LIBRARIES}
LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,}
.endfor
+.else
+
+# Out of tree builds
+
+# There are LIBADD defined in an out-of-tree build. Are they *all*
+# in-tree libraries? If so convert them to LDADD to support
+# partial checkouts.
+.if !empty(LIBADD)
+_convert_libadd= 1
+.for l in ${LIBADD}
+.if empty(LIB${l:tu})
+_convert_libadd= 0
.endif
+.endfor
+.if ${_convert_libadd} == 1
+.warning Converting out-of-tree build LIBADDs into LDADD. This is not fully supported.
+.for l in ${LIBADD}
+LDADD+= -l${l}
+.endfor
+.endif
+.endif
+
+.endif # defined(SRCTOP)
More information about the svn-src-head
mailing list