Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 2017 20:47:25 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320122 - in head: cddl/usr.sbin/zfsd/tests gnu/usr.bin/grep include lib/librpcsvc lib/libsysdecode sbin/gvinum share/mk sys/boot/efi/loader usr.bin/grep usr.sbin/bootparamd/bootparamd ...
Message-ID:  <201706192047.v5JKlPs6034248@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Mon Jun 19 20:47:24 2017
New Revision: 320122
URL: https://svnweb.freebsd.org/changeset/base/320122

Log:
  Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.
  
  Since buildenv exports SYSROOT all of these uses will now look in
  WORLDTMP by default.
  
  sys/boot/efi/loader/Makefile
          A LIBSTAND hack is no longer required for buildenv.
  
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/cddl/usr.sbin/zfsd/tests/Makefile
  head/gnu/usr.bin/grep/Makefile
  head/include/Makefile
  head/lib/librpcsvc/Makefile
  head/lib/libsysdecode/Makefile
  head/sbin/gvinum/Makefile
  head/share/mk/bsd.libnames.mk
  head/share/mk/src.libnames.mk
  head/sys/boot/efi/loader/Makefile
  head/usr.bin/grep/Makefile
  head/usr.sbin/bootparamd/bootparamd/Makefile
  head/usr.sbin/bootparamd/callbootd/Makefile
  head/usr.sbin/keyserv/Makefile
  head/usr.sbin/ntp/ntpdc/Makefile
  head/usr.sbin/ntp/ntpq/Makefile
  head/usr.sbin/rpc.lockd/Makefile
  head/usr.sbin/rpc.statd/Makefile
  head/usr.sbin/rpc.ypupdated/Makefile
  head/usr.sbin/tcpdump/tcpdump/Makefile

Modified: head/cddl/usr.sbin/zfsd/tests/Makefile
==============================================================================
--- head/cddl/usr.sbin/zfsd/tests/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/cddl/usr.sbin/zfsd/tests/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -11,16 +11,10 @@ SRCS=
 # Use #include <zfsd/xxx.h> in test programs.
 INCFLAGS+=	-I${.CURDIR:H:H}
 
-.if defined(DESTDIR)
-INCFLAGS+=	-I${DESTDIR}/usr/include
-LIBRARY_PATH=	${DESTDIR}/lib:${DESTDIR}/usr/lib
-LDFLAGS.zfsd_unittest+=	-L${DESTDIR}/lib -L${DESTDIR}/usr/lib
-.elif defined(WORLDTMP)
-INCFLAGS+=	-I${WORLDTMP}/usr/include
-LIBRARY_PATH=	${WORLDTMP}/lib:${WORLDTMP}/usr/lib
-LDFLAGS.zfsd_unittest+=	-L${WORLDTMP}/lib -L${WORLDTMP}/usr/lib
-.else
-LIBRARY_PATH=
+.if defined(DESTDIR) || defined(SYSROOT)
+INCFLAGS+=		-I${SYSROOT:U${DESTDIR}}/usr/include
+LDFLAGS.zfsd_unittest+=	-L${SYSROOT:U${DESTDIR}}/lib \
+			-L${SYSROOT:U${DESTDIR}}/usr/lib
 .endif
 
 # Googletest options

Modified: head/gnu/usr.bin/grep/Makefile
==============================================================================
--- head/gnu/usr.bin/grep/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/gnu/usr.bin/grep/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -14,7 +14,7 @@ SRCS=	closeout.c dfa.c error.c exclude.c grep.c grepma
 	xstrtoumax.c
 CLEANFILES+=	gnugrep.1
 
-CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H
+CFLAGS+=-I${.CURDIR} -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DHAVE_CONFIG_H
 
 .if ${MK_BSD_GREP} != "yes"
 LINKS+=	${BINDIR}/grep ${BINDIR}/egrep \

Modified: head/include/Makefile
==============================================================================
--- head/include/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/include/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -133,23 +133,24 @@ _MARCHS+=	x86
 
 META_TARGETS+=	compat
 stage_includes: ${SHARED}
+SDESTDIR=	${SYSROOT:U${DESTDIR}}
 
 # Take care of stale directory-level symlinks.
 compat:
 .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
-	if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \
-		rm -f ${DESTDIR}${INCLUDEDIR}/$i; \
+	if [ -L ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
+		rm -f ${SDESTDIR}${INCLUDEDIR}/$i; \
 	fi
 .endfor
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
 	    -f ${SRCTOP}/etc/mtree/BSD.include.dist \
-	    -p ${DESTDIR}${INCLUDEDIR} > /dev/null
+	    -p ${SDESTDIR}${INCLUDEDIR} > /dev/null
 
 copies: .PHONY .META
 .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
 	${_MARCHS}
-	if [ -d ${DESTDIR}${INCLUDEDIR}/$i ]; then \
-		cd ${DESTDIR}${INCLUDEDIR}/$i; \
+	if [ -d ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
+		cd ${SDESTDIR}${INCLUDEDIR}/$i; \
 		for h in *.h; do \
 			if [ -L $$h ]; then rm -f $$h; fi; \
 		done; \
@@ -158,101 +159,101 @@ copies: .PHONY .META
 .for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS}
 	cd ${SRCTOP}/sys; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
-	    ${DESTDIR}${INCLUDEDIR}/$i
+	    ${SDESTDIR}${INCLUDEDIR}/$i
 .endfor
 	cd ${SRCTOP}/sys/dev/acpica; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
+	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/acpica
+	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica
 	cd ${SRCTOP}/sys/dev/agp; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/agp
+	    ${SDESTDIR}${INCLUDEDIR}/dev/agp
 	cd ${SRCTOP}/sys/dev/bktr; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/bktr
+	    ${SDESTDIR}${INCLUDEDIR}/dev/bktr
 .if ${MK_NAND} != "no"
 	cd ${SRCTOP}/sys/dev/nand; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nandsim.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/nand; \
+	    ${SDESTDIR}${INCLUDEDIR}/dev/nand; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/nand
+	    ${SDESTDIR}${INCLUDEDIR}/dev/nand
 .endif
 	cd ${SRCTOP}/sys/dev/evdev; \
 	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
 	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
 	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/evdev
+	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev
 	cd ${SRCTOP}/sys/dev/hyperv/include; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hyperv.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/hyperv
+	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv
 	cd ${SRCTOP}/sys/dev/hyperv/utilities; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hv_snapshot.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/hyperv
+	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv
 	cd ${SRCTOP}/sys/dev/pci; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
-	    ${DESTDIR}${INCLUDEDIR}/dev/pci
+	    ${SDESTDIR}${INCLUDEDIR}/dev/pci
 	cd ${SRCTOP}/sys/fs/cd9660/; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
+	    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660
 .if ${MK_IPFILTER} != "no"
 	cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/netinet
+	    ${SDESTDIR}${INCLUDEDIR}/netinet
 .endif
 .if ${MK_PF} != "no"
 	cd ${SRCTOP}/sys/netpfil/pf; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/netpfil/pf
+	    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf
 .endif
 	cd ${SRCTOP}/sys/crypto; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
-	    ${DESTDIR}${INCLUDEDIR}/crypto
+	    ${SDESTDIR}${INCLUDEDIR}/crypto
 	cd ${SRCTOP}/sys/opencrypto; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/crypto
+	    ${SDESTDIR}${INCLUDEDIR}/crypto
 	cd ${SRCTOP}/sys/${MACHINE}/include; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/machine
+	    ${SDESTDIR}${INCLUDEDIR}/machine
 .if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
 	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/machine/pc
+	    ${SDESTDIR}${INCLUDEDIR}/machine/pc
 .endif
 .for _MARCH in ${_MARCHS}
 .if exists(${SRCTOP}/sys/${_MARCH}/include)
 	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
 	cd ${SRCTOP}/sys/${_MARCH}/include; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}
 .if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
 	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
 	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc
 .endif
 .endif
 .endfor
 	cd ${SRCTOP}/sys/rpc; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
-	    ${DESTDIR}${INCLUDEDIR}/rpc
+	    ${SDESTDIR}${INCLUDEDIR}/rpc
 	cd ${SRCTOP}/sys/teken; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
-	    ${DESTDIR}${INCLUDEDIR}/teken
+	    ${SDESTDIR}${INCLUDEDIR}/teken
 .if ${MK_CDDL} != "no"
 	cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libzfs_core/common; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \
-	    ${DESTDIR}${INCLUDEDIR}
+	    ${SDESTDIR}${INCLUDEDIR}
 	cd ${SRCTOP}/cddl/contrib/opensolaris/lib/libnvpair; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \
-	    ${DESTDIR}${INCLUDEDIR}
+	    ${SDESTDIR}${INCLUDEDIR}
 	cd ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys; \
 	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \
-	    ${DESTDIR}${INCLUDEDIR}/sys
+	    ${SDESTDIR}${INCLUDEDIR}/sys
 .endif
 
 symlinks: .PHONY .META
@@ -260,115 +261,115 @@ symlinks: .PHONY .META
 .for i in ${LDIRS}
 	cd ${SRCTOP}/sys/$i; \
 	for h in *.h; do \
-		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
 	done
 .endfor
 .for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/hyperv:Ndev/nand:Ndev/pci}
 	cd ${SRCTOP}/sys/$i; \
 	for h in *.h; do \
-		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
 	done
 .endfor
 	cd ${SRCTOP}/sys/dev/acpica; \
 	for h in acpiio.h acpi_hpet.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/acpica/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/acpica; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
 	done
 	cd ${SRCTOP}/sys/dev/agp; \
 	for h in agpreg.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/agp/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/agp; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/agp; \
 	done
 	cd ${SRCTOP}/sys/dev/bktr; \
 	for h in ioctl_*.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/bktr/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/bktr; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/bktr; \
 	done
 .if ${MK_NAND} != "no"
 	cd ${SRCTOP}/sys/dev/nand; \
 	for h in nandsim.h nand_dev.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/nand/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/nand; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/nand; \
 	done
 .endif
 	cd ${SRCTOP}/sys/dev/evdev; \
 	for h in input.h input-event-codes.h uinput.h; do \
 		ln -fs ../../../../sys/dev/evdev/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
 	done
 	cd ${SRCTOP}/sys/dev/hyperv/include; \
 	for h in hyperv.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/include/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/hyperv; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
 	done
 	cd ${SRCTOP}/sys/dev/hyperv/utilities; \
 	for h in hv_snapshot.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/utilities/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/hyperv; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
 	done
 	cd ${SRCTOP}/sys/dev/pci; \
 	for h in pcireg.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/dev/pci; \
+		    ${SDESTDIR}${INCLUDEDIR}/dev/pci; \
 	done
 .for i in ${LSUBSUBDIRS}
 	cd ${SRCTOP}/sys/$i; \
 	for h in *.h; do \
-		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
 	done
 .endfor
 .if ${MK_IPFILTER} != "no"
 	cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/contrib/ipfilter/netinet/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/netinet; \
+		    ${SDESTDIR}${INCLUDEDIR}/netinet; \
 	done
 .endif
 .if ${MK_PF} != "no"
 	cd ${SRCTOP}/sys/netpfil/pf; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/netpfil/pf/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/netpfil/pf; \
+		    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf; \
 	done
 .endif
 	cd ${SRCTOP}/sys/crypto; \
 	for h in rijndael/rijndael.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/crypto/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/crypto; \
+		    ${SDESTDIR}${INCLUDEDIR}/crypto; \
 	done
 	cd ${SRCTOP}/sys/opencrypto; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/opencrypto/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/crypto; \
+		    ${SDESTDIR}${INCLUDEDIR}/crypto; \
 	done
 	cd ${SRCTOP}/sys/${MACHINE}/include; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${MACHINE}/include/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/machine; \
+		    ${SDESTDIR}${INCLUDEDIR}/machine; \
 	done
 .if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
 	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${MACHINE}/include/pc/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/machine/pc; \
+		    ${SDESTDIR}${INCLUDEDIR}/machine/pc; \
 	done
 .endif
 .for _MARCH in ${_MARCHS}
 .if exists(${SRCTOP}/sys/${_MARCH}/include)
 	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
 	cd ${SRCTOP}/sys/${_MARCH}/include; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${_MARCH}/include/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
+		    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
 	done
 .if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
 	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
-	    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
+	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
 	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${_MARCH}/include/pc/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
+		    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
 	done
 .endif
 .endif
@@ -376,12 +377,12 @@ symlinks: .PHONY .META
 	cd ${SRCTOP}/sys/fs/cd9660; \
 	for h in *.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/fs/cd9660/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
+		    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660; \
 	done
 	cd ${SRCTOP}/sys/rpc; \
 	for h in types.h; do \
 		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/rpc/$$h \
-		    ${DESTDIR}${INCLUDEDIR}/rpc; \
+		    ${SDESTDIR}${INCLUDEDIR}/rpc; \
 	done
 
 .include <bsd.prog.mk>

Modified: head/lib/librpcsvc/Makefile
==============================================================================
--- head/lib/librpcsvc/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/lib/librpcsvc/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -21,7 +21,7 @@ OTHERSRCS+= yp_passwd.c yp_update.c
 
 RPCCOM=	RPCGEN_CPP=${CPP:Q} rpcgen -C
 
-INCDIRS= -I${DESTDIR}/usr/include/rpcsvc
+INCDIRS= -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
 
 CFLAGS+= -DYP ${INCDIRS}
 

Modified: head/lib/libsysdecode/Makefile
==============================================================================
--- head/lib/libsysdecode/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/lib/libsysdecode/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -114,7 +114,7 @@ CFLAGS.gcc+=	${CFLAGS.gcc.${.IMPSRC}}
 
 DEPENDOBJS+=	tables.h
 tables.h: mktables
-	sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} ${.TARGET}
+	sh ${.CURDIR}/mktables ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} ${.TARGET}
 
 # mkioctls runs find(1) for headers so needs to rebuild every time.  This used
 # to be a hack only done in buildworld.
@@ -123,7 +123,7 @@ ioctl.c: .PHONY
 .endif
 ioctl.c: mkioctls .META
 	env CPP="${CPP}" \
-		/bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
+	    /bin/sh ${.CURDIR}/mkioctls ${SYSROOT:U${DESTDIR}}${INCLUDEDIR} > ${.TARGET}
 
 beforedepend: ioctl.c tables.h
 

Modified: head/sbin/gvinum/Makefile
==============================================================================
--- head/sbin/gvinum/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/sbin/gvinum/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -6,7 +6,7 @@ SRCS=	gvinum.c gvinum.h geom_vinum_share.c
 MAN=	gvinum.8
 
 WARNS?=	2
-CFLAGS+=	-I${SRCTOP}/sys -I${DESTDIR}/${INCLUDEDIR}/edit
+CFLAGS+=	-I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 LIBADD=	edit geom
 

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/share/mk/bsd.libnames.mk	Mon Jun 19 20:47:24 2017	(r320122)
@@ -8,166 +8,168 @@
 .error bsd.libnames.mk cannot be included directly.
 .endif
 
+LIBDESTDIR=	${SYSROOT:U${DESTDIR}}
+
 .sinclude <src.libnames.mk>
 
 # Src directory locations are also defined in src.libnames.mk.
 
-LIBCRT0?=	${DESTDIR}${LIBDIR_BASE}/crt0.o
+LIBCRT0?=	${LIBDESTDIR}${LIBDIR_BASE}/crt0.o
 
-LIB80211?=	${DESTDIR}${LIBDIR_BASE}/lib80211.a
-LIBALIAS?=	${DESTDIR}${LIBDIR_BASE}/libalias.a
-LIBARCHIVE?=	${DESTDIR}${LIBDIR_BASE}/libarchive.a
-LIBASN1?=	${DESTDIR}${LIBDIR_BASE}/libasn1.a
-LIBATM?=	${DESTDIR}${LIBDIR_BASE}/libatm.a
-LIBAUDITD?=	${DESTDIR}${LIBDIR_BASE}/libauditd.a
-LIBAVL?=	${DESTDIR}${LIBDIR_BASE}/libavl.a
-LIBBEGEMOT?=	${DESTDIR}${LIBDIR_BASE}/libbegemot.a
-LIBBLACKLIST?=	${DESTDIR}${LIBDIR_BASE}/libblacklist.a
-LIBBLUETOOTH?=	${DESTDIR}${LIBDIR_BASE}/libbluetooth.a
-LIBBSDXML?=	${DESTDIR}${LIBDIR_BASE}/libbsdxml.a
-LIBBSM?=	${DESTDIR}${LIBDIR_BASE}/libbsm.a
-LIBBSNMP?=	${DESTDIR}${LIBDIR_BASE}/libbsnmp.a
-LIBBZ2?=	${DESTDIR}${LIBDIR_BASE}/libbz2.a
-LIBC?=		${DESTDIR}${LIBDIR_BASE}/libc.a
-LIBCALENDAR?=	${DESTDIR}${LIBDIR_BASE}/libcalendar.a
-LIBCAM?=	${DESTDIR}${LIBDIR_BASE}/libcam.a
-LIBCAP_DNS?=	${DESTDIR}${LIBDIR_BASE}/libcap_dns.a
-LIBCAP_GRP?=	${DESTDIR}${LIBDIR_BASE}/libcap_grp.a
-LIBCAP_PWD?=	${DESTDIR}${LIBDIR_BASE}/libcap_pwd.a
-LIBCAP_RANDOM?=	${DESTDIR}${LIBDIR_BASE}/libcap_random.a
-LIBCAP_SYSCTL?=	${DESTDIR}${LIBDIR_BASE}/libcap_sysctl.a
-LIBCASPER?=	${DESTDIR}${LIBDIR_BASE}/libcasper.a
-LIBCOMPAT?=	${DESTDIR}${LIBDIR_BASE}/libcompat.a
-LIBCOMPILER_RT?=${DESTDIR}${LIBDIR_BASE}/libcompiler_rt.a
-LIBCOM_ERR?=	${DESTDIR}${LIBDIR_BASE}/libcom_err.a
-LIBCPLUSPLUS?=	${DESTDIR}${LIBDIR_BASE}/libc++.a
-LIBCRYPT?=	${DESTDIR}${LIBDIR_BASE}/libcrypt.a
-LIBCRYPTO?=	${DESTDIR}${LIBDIR_BASE}/libcrypto.a
-LIBCTF?=	${DESTDIR}${LIBDIR_BASE}/libctf.a
-LIBCURSES?=	${DESTDIR}${LIBDIR_BASE}/libcurses.a
-LIBCUSE?=	${DESTDIR}${LIBDIR_BASE}/libcuse.a
-LIBCXGB4?=	${DESTDIR}${LIBDIR_BASE}/libcxgb4.a
-LIBCXXRT?=	${DESTDIR}${LIBDIR_BASE}/libcxxrt.a
-LIBC_PIC?=	${DESTDIR}${LIBDIR_BASE}/libc_pic.a
-LIBDEVCTL?=	${DESTDIR}${LIBDIR_BASE}/libdevctl.a
-LIBDEVDCTL?=	${DESTDIR}${LIBDIR_BASE}/libdevdctl.a
-LIBDEVINFO?=	${DESTDIR}${LIBDIR_BASE}/libdevinfo.a
-LIBDEVSTAT?=	${DESTDIR}${LIBDIR_BASE}/libdevstat.a
-LIBDIALOG?=	${DESTDIR}${LIBDIR_BASE}/libdialog.a
-LIBDNS?=	${DESTDIR}${LIBDIR_BASE}/libdns.a
-LIBDPV?=	${DESTDIR}${LIBDIR_BASE}/libdpv.a
-LIBDTRACE?=	${DESTDIR}${LIBDIR_BASE}/libdtrace.a
-LIBDWARF?=	${DESTDIR}${LIBDIR_BASE}/libdwarf.a
-LIBEDIT?=	${DESTDIR}${LIBDIR_BASE}/libedit.a
-LIBEFIVAR?=	${DESTDIR}${LIBDIR_BASE}/libefivar.a
-LIBELF?=	${DESTDIR}${LIBDIR_BASE}/libelf.a
-LIBEXECINFO?=	${DESTDIR}${LIBDIR_BASE}/libexecinfo.a
-LIBFETCH?=	${DESTDIR}${LIBDIR_BASE}/libfetch.a
-LIBFIGPAR?=	${DESTDIR}${LIBDIR_BASE}/libfigpar.a
+LIB80211?=	${LIBDESTDIR}${LIBDIR_BASE}/lib80211.a
+LIBALIAS?=	${LIBDESTDIR}${LIBDIR_BASE}/libalias.a
+LIBARCHIVE?=	${LIBDESTDIR}${LIBDIR_BASE}/libarchive.a
+LIBASN1?=	${LIBDESTDIR}${LIBDIR_BASE}/libasn1.a
+LIBATM?=	${LIBDESTDIR}${LIBDIR_BASE}/libatm.a
+LIBAUDITD?=	${LIBDESTDIR}${LIBDIR_BASE}/libauditd.a
+LIBAVL?=	${LIBDESTDIR}${LIBDIR_BASE}/libavl.a
+LIBBEGEMOT?=	${LIBDESTDIR}${LIBDIR_BASE}/libbegemot.a
+LIBBLACKLIST?=	${LIBDESTDIR}${LIBDIR_BASE}/libblacklist.a
+LIBBLUETOOTH?=	${LIBDESTDIR}${LIBDIR_BASE}/libbluetooth.a
+LIBBSDXML?=	${LIBDESTDIR}${LIBDIR_BASE}/libbsdxml.a
+LIBBSM?=	${LIBDESTDIR}${LIBDIR_BASE}/libbsm.a
+LIBBSNMP?=	${LIBDESTDIR}${LIBDIR_BASE}/libbsnmp.a
+LIBBZ2?=	${LIBDESTDIR}${LIBDIR_BASE}/libbz2.a
+LIBC?=		${LIBDESTDIR}${LIBDIR_BASE}/libc.a
+LIBCALENDAR?=	${LIBDESTDIR}${LIBDIR_BASE}/libcalendar.a
+LIBCAM?=	${LIBDESTDIR}${LIBDIR_BASE}/libcam.a
+LIBCAP_DNS?=	${LIBDESTDIR}${LIBDIR_BASE}/libcap_dns.a
+LIBCAP_GRP?=	${LIBDESTDIR}${LIBDIR_BASE}/libcap_grp.a
+LIBCAP_PWD?=	${LIBDESTDIR}${LIBDIR_BASE}/libcap_pwd.a
+LIBCAP_RANDOM?=	${LIBDESTDIR}${LIBDIR_BASE}/libcap_random.a
+LIBCAP_SYSCTL?=	${LIBDESTDIR}${LIBDIR_BASE}/libcap_sysctl.a
+LIBCASPER?=	${LIBDESTDIR}${LIBDIR_BASE}/libcasper.a
+LIBCOMPAT?=	${LIBDESTDIR}${LIBDIR_BASE}/libcompat.a
+LIBCOMPILER_RT?=${LIBDESTDIR}${LIBDIR_BASE}/libcompiler_rt.a
+LIBCOM_ERR?=	${LIBDESTDIR}${LIBDIR_BASE}/libcom_err.a
+LIBCPLUSPLUS?=	${LIBDESTDIR}${LIBDIR_BASE}/libc++.a
+LIBCRYPT?=	${LIBDESTDIR}${LIBDIR_BASE}/libcrypt.a
+LIBCRYPTO?=	${LIBDESTDIR}${LIBDIR_BASE}/libcrypto.a
+LIBCTF?=	${LIBDESTDIR}${LIBDIR_BASE}/libctf.a
+LIBCURSES?=	${LIBDESTDIR}${LIBDIR_BASE}/libcurses.a
+LIBCUSE?=	${LIBDESTDIR}${LIBDIR_BASE}/libcuse.a
+LIBCXGB4?=	${LIBDESTDIR}${LIBDIR_BASE}/libcxgb4.a
+LIBCXXRT?=	${LIBDESTDIR}${LIBDIR_BASE}/libcxxrt.a
+LIBC_PIC?=	${LIBDESTDIR}${LIBDIR_BASE}/libc_pic.a
+LIBDEVCTL?=	${LIBDESTDIR}${LIBDIR_BASE}/libdevctl.a
+LIBDEVDCTL?=	${LIBDESTDIR}${LIBDIR_BASE}/libdevdctl.a
+LIBDEVINFO?=	${LIBDESTDIR}${LIBDIR_BASE}/libdevinfo.a
+LIBDEVSTAT?=	${LIBDESTDIR}${LIBDIR_BASE}/libdevstat.a
+LIBDIALOG?=	${LIBDESTDIR}${LIBDIR_BASE}/libdialog.a
+LIBDNS?=	${LIBDESTDIR}${LIBDIR_BASE}/libdns.a
+LIBDPV?=	${LIBDESTDIR}${LIBDIR_BASE}/libdpv.a
+LIBDTRACE?=	${LIBDESTDIR}${LIBDIR_BASE}/libdtrace.a
+LIBDWARF?=	${LIBDESTDIR}${LIBDIR_BASE}/libdwarf.a
+LIBEDIT?=	${LIBDESTDIR}${LIBDIR_BASE}/libedit.a
+LIBEFIVAR?=	${LIBDESTDIR}${LIBDIR_BASE}/libefivar.a
+LIBELF?=	${LIBDESTDIR}${LIBDIR_BASE}/libelf.a
+LIBEXECINFO?=	${LIBDESTDIR}${LIBDIR_BASE}/libexecinfo.a
+LIBFETCH?=	${LIBDESTDIR}${LIBDIR_BASE}/libfetch.a
+LIBFIGPAR?=	${LIBDESTDIR}${LIBDIR_BASE}/libfigpar.a
 LIBFL?=		"don't use LIBFL, use LIBL"
-LIBFORM?=	${DESTDIR}${LIBDIR_BASE}/libform.a
-LIBG2C?=	${DESTDIR}${LIBDIR_BASE}/libg2c.a
-LIBGEOM?=	${DESTDIR}${LIBDIR_BASE}/libgeom.a
-LIBGNUREGEX?=	${DESTDIR}${LIBDIR_BASE}/libgnuregex.a
-LIBGPIO?=	${DESTDIR}${LIBDIR_BASE}/libgpio.a
-LIBGSSAPI?=	${DESTDIR}${LIBDIR_BASE}/libgssapi.a
-LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a
-LIBHDB?=	${DESTDIR}${LIBDIR_BASE}/libhdb.a
-LIBHEIMBASE?=	${DESTDIR}${LIBDIR_BASE}/libheimbase.a
-LIBHEIMNTLM?=	${DESTDIR}${LIBDIR_BASE}/libheimntlm.a
-LIBHEIMSQLITE?=	${DESTDIR}${LIBDIR_BASE}/libheimsqlite.a
-LIBHX509?=	${DESTDIR}${LIBDIR_BASE}/libhx509.a
-LIBIBCM?=	${DESTDIR}${LIBDIR_BASE}/libibcm.a
-LIBIBCOMMON?=	${DESTDIR}${LIBDIR_BASE}/libibcommon.a
-LIBIBMAD?=	${DESTDIR}${LIBDIR_BASE}/libibmad.a
-LIBIBSDP?=	${DESTDIR}${LIBDIR_BASE}/libibsdp.a
-LIBIBUMAD?=	${DESTDIR}${LIBDIR_BASE}/libibumad.a
-LIBIBVERBS?=	${DESTDIR}${LIBDIR_BASE}/libibverbs.a
-LIBIFCONFIG?=	${DESTDIR}${LIBDIR_BASE}/libifconfig.a
-LIBIPSEC?=	${DESTDIR}${LIBDIR_BASE}/libipsec.a
-LIBJAIL?=	${DESTDIR}${LIBDIR_BASE}/libjail.a
-LIBKADM5CLNT?=	${DESTDIR}${LIBDIR_BASE}/libkadm5clnt.a
-LIBKADM5SRV?=	${DESTDIR}${LIBDIR_BASE}/libkadm5srv.a
-LIBKAFS5?=	${DESTDIR}${LIBDIR_BASE}/libkafs5.a
-LIBKDC?=	${DESTDIR}${LIBDIR_BASE}/libkdc.a
-LIBKEYCAP?=	${DESTDIR}${LIBDIR_BASE}/libkeycap.a
-LIBKICONV?=	${DESTDIR}${LIBDIR_BASE}/libkiconv.a
-LIBKRB5?=	${DESTDIR}${LIBDIR_BASE}/libkrb5.a
-LIBKVM?=	${DESTDIR}${LIBDIR_BASE}/libkvm.a
-LIBL?=		${DESTDIR}${LIBDIR_BASE}/libl.a
+LIBFORM?=	${LIBDESTDIR}${LIBDIR_BASE}/libform.a
+LIBG2C?=	${LIBDESTDIR}${LIBDIR_BASE}/libg2c.a
+LIBGEOM?=	${LIBDESTDIR}${LIBDIR_BASE}/libgeom.a
+LIBGNUREGEX?=	${LIBDESTDIR}${LIBDIR_BASE}/libgnuregex.a
+LIBGPIO?=	${LIBDESTDIR}${LIBDIR_BASE}/libgpio.a
+LIBGSSAPI?=	${LIBDESTDIR}${LIBDIR_BASE}/libgssapi.a
+LIBGSSAPI_KRB5?= ${LIBDESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a
+LIBHDB?=	${LIBDESTDIR}${LIBDIR_BASE}/libhdb.a
+LIBHEIMBASE?=	${LIBDESTDIR}${LIBDIR_BASE}/libheimbase.a
+LIBHEIMNTLM?=	${LIBDESTDIR}${LIBDIR_BASE}/libheimntlm.a
+LIBHEIMSQLITE?=	${LIBDESTDIR}${LIBDIR_BASE}/libheimsqlite.a
+LIBHX509?=	${LIBDESTDIR}${LIBDIR_BASE}/libhx509.a
+LIBIBCM?=	${LIBDESTDIR}${LIBDIR_BASE}/libibcm.a
+LIBIBCOMMON?=	${LIBDESTDIR}${LIBDIR_BASE}/libibcommon.a
+LIBIBMAD?=	${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a
+LIBIBSDP?=	${LIBDESTDIR}${LIBDIR_BASE}/libibsdp.a
+LIBIBUMAD?=	${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a
+LIBIBVERBS?=	${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a
+LIBIFCONFIG?=	${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a
+LIBIPSEC?=	${LIBDESTDIR}${LIBDIR_BASE}/libipsec.a
+LIBJAIL?=	${LIBDESTDIR}${LIBDIR_BASE}/libjail.a
+LIBKADM5CLNT?=	${LIBDESTDIR}${LIBDIR_BASE}/libkadm5clnt.a
+LIBKADM5SRV?=	${LIBDESTDIR}${LIBDIR_BASE}/libkadm5srv.a
+LIBKAFS5?=	${LIBDESTDIR}${LIBDIR_BASE}/libkafs5.a
+LIBKDC?=	${LIBDESTDIR}${LIBDIR_BASE}/libkdc.a
+LIBKEYCAP?=	${LIBDESTDIR}${LIBDIR_BASE}/libkeycap.a
+LIBKICONV?=	${LIBDESTDIR}${LIBDIR_BASE}/libkiconv.a
+LIBKRB5?=	${LIBDESTDIR}${LIBDIR_BASE}/libkrb5.a
+LIBKVM?=	${LIBDESTDIR}${LIBDIR_BASE}/libkvm.a
+LIBL?=		${LIBDESTDIR}${LIBDIR_BASE}/libl.a
 LIBLN?=		"don't use LIBLN, use LIBL"
-LIBLZMA?=	${DESTDIR}${LIBDIR_BASE}/liblzma.a
-LIBM?=		${DESTDIR}${LIBDIR_BASE}/libm.a
-LIBMAGIC?=	${DESTDIR}${LIBDIR_BASE}/libmagic.a
-LIBMD?=		${DESTDIR}${LIBDIR_BASE}/libmd.a
-LIBMEMSTAT?=	${DESTDIR}${LIBDIR_BASE}/libmemstat.a
-LIBMENU?=	${DESTDIR}${LIBDIR_BASE}/libmenu.a
-LIBMILTER?=	${DESTDIR}${LIBDIR_BASE}/libmilter.a
-LIBMLX4?=	${DESTDIR}${LIBDIR_BASE}/libmlx4.a
-LIBMP?=		${DESTDIR}${LIBDIR_BASE}/libmp.a
-LIBMT?=		${DESTDIR}${LIBDIR_BASE}/libmt.a
-LIBMTHCA?=	${DESTDIR}${LIBDIR_BASE}/libmthca.a
-LIBNANDFS?=	${DESTDIR}${LIBDIR_BASE}/libnandfs.a
-LIBNCURSES?=	${DESTDIR}${LIBDIR_BASE}/libncurses.a
-LIBNCURSESW?=	${DESTDIR}${LIBDIR_BASE}/libncursesw.a
-LIBNETGRAPH?=	${DESTDIR}${LIBDIR_BASE}/libnetgraph.a
-LIBNGATM?=	${DESTDIR}${LIBDIR_BASE}/libngatm.a
-LIBNV?=		${DESTDIR}${LIBDIR_BASE}/libnv.a
-LIBNVPAIR?=	${DESTDIR}${LIBDIR_BASE}/libnvpair.a
-LIBOPENSM?=	${DESTDIR}${LIBDIR_BASE}/libopensm.a
-LIBOPIE?=	${DESTDIR}${LIBDIR_BASE}/libopie.a
-LIBOSMCOMP?=	${DESTDIR}${LIBDIR_BASE}/libosmcomp.a
-LIBOSMVENDOR?=	${DESTDIR}${LIBDIR_BASE}/libosmvendor.a
-LIBPAM?=	${DESTDIR}${LIBDIR_BASE}/libpam.a
-LIBPANEL?=	${DESTDIR}${LIBDIR_BASE}/libpanel.a
-LIBPANELW?=	${DESTDIR}${LIBDIR_BASE}/libpanelw.a
-LIBPCAP?=	${DESTDIR}${LIBDIR_BASE}/libpcap.a
-LIBPJDLOG?=	${DESTDIR}${LIBDIR_BASE}/libpjdlog.a
-LIBPMC?=	${DESTDIR}${LIBDIR_BASE}/libpmc.a
-LIBPROC?=	${DESTDIR}${LIBDIR_BASE}/libproc.a
-LIBPROCSTAT?=	${DESTDIR}${LIBDIR_BASE}/libprocstat.a
-LIBPTHREAD?=	${DESTDIR}${LIBDIR_BASE}/libpthread.a
-LIBRADIUS?=	${DESTDIR}${LIBDIR_BASE}/libradius.a
-LIBRDMACM?=	${DESTDIR}${LIBDIR_BASE}/librdmacm.a
-LIBROKEN?=	${DESTDIR}${LIBDIR_BASE}/libroken.a
-LIBRPCSEC_GSS?=	${DESTDIR}${LIBDIR_BASE}/librpcsec_gss.a
-LIBRPCSVC?=	${DESTDIR}${LIBDIR_BASE}/librpcsvc.a
-LIBRT?=		${DESTDIR}${LIBDIR_BASE}/librt.a
-LIBRTLD_DB?=	${DESTDIR}${LIBDIR_BASE}/librtld_db.a
-LIBSBUF?=	${DESTDIR}${LIBDIR_BASE}/libsbuf.a
-LIBSDP?=	${DESTDIR}${LIBDIR_BASE}/libsdp.a
-LIBSMB?=	${DESTDIR}${LIBDIR_BASE}/libsmb.a
-LIBSSL?=	${DESTDIR}${LIBDIR_BASE}/libssl.a
-LIBSSP_NONSHARED?=	${DESTDIR}${LIBDIR_BASE}/libssp_nonshared.a
-LIBSTAND?=	${DESTDIR}${LIBDIR_BASE}/libstand.a
-LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libstdc++.a
-LIBSTDTHREADS?=	${DESTDIR}${LIBDIR_BASE}/libstdthreads.a
-LIBSYSDECODE?=	${DESTDIR}${LIBDIR_BASE}/libsysdecode.a
-LIBTACPLUS?=	${DESTDIR}${LIBDIR_BASE}/libtacplus.a
-LIBTERMCAP?=	${DESTDIR}${LIBDIR_BASE}/libtermcap.a
-LIBTERMCAPW?=	${DESTDIR}${LIBDIR_BASE}/libtermcapw.a
+LIBLZMA?=	${LIBDESTDIR}${LIBDIR_BASE}/liblzma.a
+LIBM?=		${LIBDESTDIR}${LIBDIR_BASE}/libm.a
+LIBMAGIC?=	${LIBDESTDIR}${LIBDIR_BASE}/libmagic.a
+LIBMD?=		${LIBDESTDIR}${LIBDIR_BASE}/libmd.a
+LIBMEMSTAT?=	${LIBDESTDIR}${LIBDIR_BASE}/libmemstat.a
+LIBMENU?=	${LIBDESTDIR}${LIBDIR_BASE}/libmenu.a
+LIBMILTER?=	${LIBDESTDIR}${LIBDIR_BASE}/libmilter.a
+LIBMLX4?=	${LIBDESTDIR}${LIBDIR_BASE}/libmlx4.a
+LIBMP?=		${LIBDESTDIR}${LIBDIR_BASE}/libmp.a
+LIBMT?=		${LIBDESTDIR}${LIBDIR_BASE}/libmt.a
+LIBMTHCA?=	${LIBDESTDIR}${LIBDIR_BASE}/libmthca.a
+LIBNANDFS?=	${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a
+LIBNCURSES?=	${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a
+LIBNCURSESW?=	${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a
+LIBNETGRAPH?=	${LIBDESTDIR}${LIBDIR_BASE}/libnetgraph.a
+LIBNGATM?=	${LIBDESTDIR}${LIBDIR_BASE}/libngatm.a
+LIBNV?=		${LIBDESTDIR}${LIBDIR_BASE}/libnv.a
+LIBNVPAIR?=	${LIBDESTDIR}${LIBDIR_BASE}/libnvpair.a
+LIBOPENSM?=	${LIBDESTDIR}${LIBDIR_BASE}/libopensm.a
+LIBOPIE?=	${LIBDESTDIR}${LIBDIR_BASE}/libopie.a
+LIBOSMCOMP?=	${LIBDESTDIR}${LIBDIR_BASE}/libosmcomp.a
+LIBOSMVENDOR?=	${LIBDESTDIR}${LIBDIR_BASE}/libosmvendor.a
+LIBPAM?=	${LIBDESTDIR}${LIBDIR_BASE}/libpam.a
+LIBPANEL?=	${LIBDESTDIR}${LIBDIR_BASE}/libpanel.a
+LIBPANELW?=	${LIBDESTDIR}${LIBDIR_BASE}/libpanelw.a
+LIBPCAP?=	${LIBDESTDIR}${LIBDIR_BASE}/libpcap.a
+LIBPJDLOG?=	${LIBDESTDIR}${LIBDIR_BASE}/libpjdlog.a
+LIBPMC?=	${LIBDESTDIR}${LIBDIR_BASE}/libpmc.a
+LIBPROC?=	${LIBDESTDIR}${LIBDIR_BASE}/libproc.a
+LIBPROCSTAT?=	${LIBDESTDIR}${LIBDIR_BASE}/libprocstat.a
+LIBPTHREAD?=	${LIBDESTDIR}${LIBDIR_BASE}/libpthread.a
+LIBRADIUS?=	${LIBDESTDIR}${LIBDIR_BASE}/libradius.a
+LIBRDMACM?=	${LIBDESTDIR}${LIBDIR_BASE}/librdmacm.a
+LIBROKEN?=	${LIBDESTDIR}${LIBDIR_BASE}/libroken.a
+LIBRPCSEC_GSS?=	${LIBDESTDIR}${LIBDIR_BASE}/librpcsec_gss.a
+LIBRPCSVC?=	${LIBDESTDIR}${LIBDIR_BASE}/librpcsvc.a
+LIBRT?=		${LIBDESTDIR}${LIBDIR_BASE}/librt.a
+LIBRTLD_DB?=	${LIBDESTDIR}${LIBDIR_BASE}/librtld_db.a
+LIBSBUF?=	${LIBDESTDIR}${LIBDIR_BASE}/libsbuf.a
+LIBSDP?=	${LIBDESTDIR}${LIBDIR_BASE}/libsdp.a
+LIBSMB?=	${LIBDESTDIR}${LIBDIR_BASE}/libsmb.a
+LIBSSL?=	${LIBDESTDIR}${LIBDIR_BASE}/libssl.a
+LIBSSP_NONSHARED?=	${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a
+LIBSTAND?=	${LIBDESTDIR}${LIBDIR_BASE}/libstand.a
+LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a
+LIBSTDTHREADS?=	${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a
+LIBSYSDECODE?=	${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a
+LIBTACPLUS?=	${LIBDESTDIR}${LIBDIR_BASE}/libtacplus.a
+LIBTERMCAP?=	${LIBDESTDIR}${LIBDIR_BASE}/libtermcap.a
+LIBTERMCAPW?=	${LIBDESTDIR}${LIBDIR_BASE}/libtermcapw.a
 LIBTERMLIB?=	"don't use LIBTERMLIB, use LIBTERMCAP"
 LIBTINFO?=	"don't use LIBTINFO, use LIBNCURSES"
-LIBUFS?=	${DESTDIR}${LIBDIR_BASE}/libufs.a
-LIBUGIDFW?=	${DESTDIR}${LIBDIR_BASE}/libugidfw.a
-LIBULOG?=	${DESTDIR}${LIBDIR_BASE}/libulog.a
-LIBUMEM?=	${DESTDIR}${LIBDIR_BASE}/libumem.a
-LIBUSB?=	${DESTDIR}${LIBDIR_BASE}/libusb.a
-LIBUSBHID?=	${DESTDIR}${LIBDIR_BASE}/libusbhid.a
-LIBUTIL?=	${DESTDIR}${LIBDIR_BASE}/libutil.a
-LIBUUTIL?=	${DESTDIR}${LIBDIR_BASE}/libuutil.a
-LIBVGL?=	${DESTDIR}${LIBDIR_BASE}/libvgl.a
-LIBVMMAPI?=	${DESTDIR}${LIBDIR_BASE}/libvmmapi.a
-LIBWIND?=	${DESTDIR}${LIBDIR_BASE}/libwind.a
-LIBWRAP?=	${DESTDIR}${LIBDIR_BASE}/libwrap.a
-LIBXO?=		${DESTDIR}${LIBDIR_BASE}/libxo.a
-LIBXPG4?=	${DESTDIR}${LIBDIR_BASE}/libxpg4.a
-LIBY?=		${DESTDIR}${LIBDIR_BASE}/liby.a
-LIBYPCLNT?=	${DESTDIR}${LIBDIR_BASE}/libypclnt.a
-LIBZ?=		${DESTDIR}${LIBDIR_BASE}/libz.a
-LIBZFS?=	${DESTDIR}${LIBDIR_BASE}/libzfs.a
-LIBZFS_CORE?=	${DESTDIR}${LIBDIR_BASE}/libzfs_core.a
-LIBZPOOL?=	${DESTDIR}${LIBDIR_BASE}/libzpool.a
+LIBUFS?=	${LIBDESTDIR}${LIBDIR_BASE}/libufs.a
+LIBUGIDFW?=	${LIBDESTDIR}${LIBDIR_BASE}/libugidfw.a
+LIBULOG?=	${LIBDESTDIR}${LIBDIR_BASE}/libulog.a
+LIBUMEM?=	${LIBDESTDIR}${LIBDIR_BASE}/libumem.a
+LIBUSB?=	${LIBDESTDIR}${LIBDIR_BASE}/libusb.a
+LIBUSBHID?=	${LIBDESTDIR}${LIBDIR_BASE}/libusbhid.a
+LIBUTIL?=	${LIBDESTDIR}${LIBDIR_BASE}/libutil.a
+LIBUUTIL?=	${LIBDESTDIR}${LIBDIR_BASE}/libuutil.a
+LIBVGL?=	${LIBDESTDIR}${LIBDIR_BASE}/libvgl.a
+LIBVMMAPI?=	${LIBDESTDIR}${LIBDIR_BASE}/libvmmapi.a
+LIBWIND?=	${LIBDESTDIR}${LIBDIR_BASE}/libwind.a
+LIBWRAP?=	${LIBDESTDIR}${LIBDIR_BASE}/libwrap.a
+LIBXO?=		${LIBDESTDIR}${LIBDIR_BASE}/libxo.a
+LIBXPG4?=	${LIBDESTDIR}${LIBDIR_BASE}/libxpg4.a
+LIBY?=		${LIBDESTDIR}${LIBDIR_BASE}/liby.a
+LIBYPCLNT?=	${LIBDESTDIR}${LIBDIR_BASE}/libypclnt.a
+LIBZ?=		${LIBDESTDIR}${LIBDIR_BASE}/libz.a
+LIBZFS?=	${LIBDESTDIR}${LIBDIR_BASE}/libzfs.a
+LIBZFS_CORE?=	${LIBDESTDIR}${LIBDIR_BASE}/libzfs_core.a
+LIBZPOOL?=	${LIBDESTDIR}${LIBDIR_BASE}/libzpool.a
 
 # enforce the 2 -lpthread and -lc to always be the last in that exact order
 .if defined(LDADD)
@@ -184,7 +186,7 @@ LDADD:=	${LDADD:N-lc} -lc
 .if defined(_LIBRARIES) && defined(LIB) && \
     ${_LIBRARIES:M${LIB}} != ""
 .if !defined(LIB${LIB:tu})
-.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR_BASE}/lib${LIB}.a
+.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${LIBDESTDIR}$${LIBDIR_BASE}/lib${LIB}.a
 .endif
 .endif
 

Modified: head/share/mk/src.libnames.mk
==============================================================================
--- head/share/mk/src.libnames.mk	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/share/mk/src.libnames.mk	Mon Jun 19 20:47:24 2017	(r320122)
@@ -343,13 +343,13 @@ _DP_rdmacm=	ibverbs
 
 # Define special cases
 LDADD_supcplusplus=	-lsupc++
-LIBATF_C=	${DESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
-LIBATF_CXX=	${DESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
+LIBATF_C=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
+LIBATF_CXX=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
 LDADD_atf_c=	-lprivateatf-c
 LDADD_atf_cxx=	-lprivateatf-c++
 
 .for _l in ${_PRIVATELIBS}
-LIB${_l:tu}?=	${DESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
+LIB${_l:tu}?=	${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
 .endfor
 
 .for _l in ${_LIBRARIES}

Modified: head/sys/boot/efi/loader/Makefile
==============================================================================
--- head/sys/boot/efi/loader/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/sys/boot/efi/loader/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -71,12 +71,6 @@ CFLAGS+=	-DEFI_ZFS_BOOT
 .endif
 CFLAGS+=	-DNO_PCI -DEFI
 
-# make buildenv doesn't set DESTDIR, this means LIBSTAND
-# will be wrong when crossbuilding.
-.if exists(${.OBJDIR}/../../../../lib/libstand/libstand.a)
-LIBSTAND=	${.OBJDIR}/../../../../lib/libstand/libstand.a
-.endif
-
 .if !defined(BOOT_HIDE_SERIAL_NUMBERS)
 # Export serial numbers, UUID, and asset tag from loader.
 CFLAGS+= -DSMBIOS_SERIAL_NUMBERS

Modified: head/usr.bin/grep/Makefile
==============================================================================
--- head/usr.bin/grep/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.bin/grep/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -82,7 +82,7 @@ CFLAGS+= -DWITHOUT_BZIP2
 .endif
 
 .if ${MK_GNU_GREP_COMPAT} != "no"
-CFLAGS+= -I${DESTDIR}/usr/include/gnu -DWITH_GNU
+CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU
 LIBADD+=	gnuregex
 .endif
 

Modified: head/usr.sbin/bootparamd/bootparamd/Makefile
==============================================================================
--- head/usr.sbin/bootparamd/bootparamd/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/bootparamd/bootparamd/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -15,7 +15,7 @@ CFLAGS+= -DYP
 
 CLEANFILES= ${GENSRCS}
 
-RPCSRC=	${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x
+RPCSRC=	${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/bootparam_prot.x
 
 bootparam_prot_svc.c: ${RPCSRC}
 	RPCGEN_CPP=${CPP:Q} rpcgen -C -m -o ${.TARGET} ${RPCSRC}

Modified: head/usr.sbin/bootparamd/callbootd/Makefile
==============================================================================
--- head/usr.sbin/bootparamd/callbootd/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/bootparamd/callbootd/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -10,7 +10,7 @@ CFLAGS+= -I.
 
 CLEANFILES= ${GENSRCS}
 
-RPCSRC=	${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x
+RPCSRC=	${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/bootparam_prot.x
 
 bootparam_prot_clnt.c: ${RPCSRC}
 	RPCGEN_CPP=${CPP:Q} rpcgen -C -l -o ${.TARGET} ${RPCSRC}

Modified: head/usr.sbin/keyserv/Makefile
==============================================================================
--- head/usr.sbin/keyserv/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/keyserv/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -10,7 +10,7 @@ LIBADD=	mp rpcsvc
 
 WARNS?=	1
 
-RPCDIR=	${DESTDIR}/usr/include/rpcsvc
+RPCDIR=	${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
 
 CLEANFILES= crypt_svc.c crypt.h
 

Modified: head/usr.sbin/ntp/ntpdc/Makefile
==============================================================================
--- head/usr.sbin/ntp/ntpdc/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/ntp/ntpdc/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -19,7 +19,7 @@ CFLAGS+= -I${SRCTOP}/contrib/ntp/include \
 
 LIBADD=	edit ntp m opts pthread
 CFLAGS+=	-DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
-		-I${DESTDIR}/${INCLUDEDIR}/edit
+		-I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 .if ${MK_OPENSSL} != "no"
 LIBADD+=	crypto

Modified: head/usr.sbin/ntp/ntpq/Makefile
==============================================================================
--- head/usr.sbin/ntp/ntpq/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/ntp/ntpq/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -29,7 +29,7 @@ LIBADD+=	md
 .endif
 
 CFLAGS+=	-DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
-		-I${DESTDIR}/${INCLUDEDIR}/edit
+		-I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit
 
 CLEANFILES+= .version version.c
 

Modified: head/usr.sbin/rpc.lockd/Makefile
==============================================================================
--- head/usr.sbin/rpc.lockd/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/rpc.lockd/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -6,14 +6,14 @@ MAN=	rpc.lockd.8
 MLINKS=	rpc.lockd.8 lockd.8
 SRCS=	kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
 
-CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc
+CFLAGS+= -I. -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
 WARNS?= 3
 
 LIBADD=	rpcsvc
 
 CLEANFILES= nlm_prot_svc.c nlm_prot.h test
 
-RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x
+RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/nlm_prot.x
 RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C
 
 nlm_prot_svc.c: ${RPCSRC}

Modified: head/usr.sbin/rpc.statd/Makefile
==============================================================================
--- head/usr.sbin/rpc.statd/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/rpc.statd/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -11,7 +11,7 @@ LIBADD=	rpcsvc
 
 CLEANFILES= sm_inter_svc.c sm_inter.h
 
-RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x
+RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/sm_inter.x
 RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C
 
 sm_inter_svc.c: ${RPCSRC}

Modified: head/usr.sbin/rpc.ypupdated/Makefile
==============================================================================
--- head/usr.sbin/rpc.ypupdated/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/rpc.ypupdated/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -17,7 +17,7 @@ LIBADD=	rpcsvc
 
 CLEANFILES= ypupdate_prot_svc.c ypupdate_prot.h
 
-RPCDIR=	${DESTDIR}/usr/include/rpcsvc
+RPCDIR=	${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
 RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C
 
 # We need to remove the 'static' keyword from _rpcsvcstate so that

Modified: head/usr.sbin/tcpdump/tcpdump/Makefile
==============================================================================
--- head/usr.sbin/tcpdump/tcpdump/Makefile	Mon Jun 19 20:40:59 2017	(r320121)
+++ head/usr.sbin/tcpdump/tcpdump/Makefile	Mon Jun 19 20:47:24 2017	(r320122)
@@ -194,7 +194,7 @@ CFLAGS+=-DHAVE_CASPER
 .endif
 .if ${MK_OPENSSL} != "no"
 LIBADD+=	crypto
-CFLAGS+= -I${DESTDIR}/usr/include/openssl
+CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/openssl
 CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H
 .endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706192047.v5JKlPs6034248>