native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
    /usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
    /usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by:	Dell EMC Isilon
This commit is contained in:
bdrewery 2017-11-01 21:22:13 +00:00
parent a451d2da49
commit f7c297fa61

View File

@ -2093,7 +2093,7 @@ cross-tools: .MAKE .PHONY
# already built. It then installs the static tools to NXBDESTDIR for Poudriere
# to pickup.
#
NXBOBJROOT= ${OBJROOT}nxb/
NXBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/nxb/
NXBOBJTOP= ${NXBOBJROOT}${TARGET}.${TARGET_ARCH}
NXTP?= /nxb-bin
.if ${NXTP:N/*}
@ -2790,10 +2790,16 @@ XDTP?=/usr/${XDDIR}
.error XDTP variable should be an absolute path
.endif
CDBENV=MAKEOBJDIRPREFIX=${OBJTOP}/${XDDIR} \
CDBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/xdev/
CDBOBJTOP= ${CDBOBJROOT}${XDDIR}
CDBENV= \
INSTALL="sh ${.CURDIR}/tools/install.sh"
CDENV= ${CDBENV} \
TOOLS_PREFIX=${XDTP}
CDMAKEARGS= \
OBJTOP=${CDBOBJTOP:Q} \
OBJROOT=${CDBOBJROOT:Q}
CD2MAKEARGS= ${CDMAKEARGS}
.if ${WANT_COMPILER_TYPE} == gcc || \
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
@ -2816,8 +2822,9 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}"
MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH}
CDTMP= ${OBJTOP}/${XDDIR}/tmp
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${CDMAKEARGS} ${NOFUN}
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} \
${MAKE} ${CD2MAKEARGS} ${NOFUN}
.if ${MK_META_MODE} != "no"
# Don't rebuild build-tools targets during normal build.
CD2MAKE+= BUILD_TOOLS_META=.NOMETA
@ -2849,7 +2856,7 @@ _xb-bootstrap-tools: .PHONY
_xb-build-tools: .PHONY
${_+_}@cd ${.CURDIR}; \
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools
XDEVDIRS= \
${_clang_libs} \