From 45fab5d8710a869c04755168e324db428303f11f Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 31 Mar 2013 08:31:06 +0000 Subject: [PATCH] Fix xdev. Clang and libc were not building correctly on older worlds, for example, on 9.1. * To fix clang add an _xb-bootstrap-tools target that mirrors the existing bootstrap-tools target in the full world. * For libc have the compiler use the newly installed includes, and, while here, tell the compiler about the xdev library path as some other libraries will link against the installed libraries. --- Makefile.inc1 | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 2a0d1a075403..d0736817014c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1745,11 +1745,12 @@ CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDTP} \ TOOLS_PREFIX=${XDTP} -CD2ENV=${CDENV} \ +CD2CFLAGS=-isystem ${XDTP}/usr/include -L${XDTP}/usr/lib -B${XDTP}/usr/lib +CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" \ MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} -CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp -CDMAKE=${CDENV} ${MAKE} ${NOFUN} +CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp +CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} XDDESTDIR=${DESTDIR}${XDTP} .if !defined(OSREL) @@ -1759,8 +1760,24 @@ OSREL!= uname -r | sed -e 's/[-(].*//' .ORDER: xdev-build xdev-install xdev: xdev-build xdev-install -.ORDER: _xb-build-tools _xb-cross-tools -xdev-build: _xb-build-tools _xb-cross-tools +.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools +xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools + +_xb-worldtmp: + mkdir -p ${CDTMP}/usr + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${CDTMP}/usr >/dev/null + +_xb-bootstrap-tools: +.for _tool in \ + ${_clang_tblgen} + ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + ${CDMAKE} DIRPRFX=${_tool}/ all; \ + ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install +.endfor _xb-build-tools: ${_+_}@cd ${.CURDIR}; \ @@ -1770,7 +1787,9 @@ _xb-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ gnu/usr.bin/cc \ - usr.bin/ar + usr.bin/ar \ + ${_clang_libs} \ + ${_clang} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -1796,7 +1815,8 @@ _xi-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ gnu/usr.bin/cc \ - usr.bin/ar + usr.bin/ar \ + ${_clang} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}