From owner-svn-src-head@freebsd.org Tue Jun 20 20:34:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84393DA1D09; Tue, 20 Jun 2017 20:34:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5284872F3F; Tue, 20 Jun 2017 20:34:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5KKYUFC030465; Tue, 20 Jun 2017 20:34:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5KKYU2F030464; Tue, 20 Jun 2017 20:34:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201706202034.v5KKYU2F030464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 20 Jun 2017 20:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320171 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 20:34:31 -0000 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)