diff options
author | imp <imp@FreeBSD.org> | 2015-11-05 21:48:12 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2015-11-05 21:48:12 +0000 |
commit | 65c695767fab2a1fb8af73554186040343e44d98 (patch) | |
tree | 7c58162e9680cb3dc63fbecb57221ac17dd46de9 | |
parent | cc4b042480ba323909ca3f549093b4623a143d03 (diff) | |
download | FreeBSD-src-65c695767fab2a1fb8af73554186040343e44d98.zip FreeBSD-src-65c695767fab2a1fb8af73554186040343e44d98.tar.gz |
Fix CC being wrong during install* targets.
Move CROSS_TOOLS stuff to top of file (before bsd.compiler.mk) so that
decisions made by bsd.compiler.mk can properly affect the defaults in
src.opts.mk. Move that to after bsd.compiler.mk. Add a comment about
why we include bsd.compiler.mk here despite the fact that src.opts.mk
currently does too. Also remove bsd.arch.inc.mk that's been OBE.
Differential Revision: https://reviews.freebsd.org/D4087
-rw-r--r-- | Makefile.inc1 | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 681884c..a83a192 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -48,9 +48,15 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif -.include "share/mk/src.opts.mk" -.include <bsd.arch.inc.mk> -.include <bsd.compiler.mk> +# Cross toolchain changes must be in effect before bsd.compiler.mk +# so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. +.if defined(CROSS_TOOLCHAIN) +LOCALBASE?= /usr/local +.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" +CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" +.endif +.include <bsd.compiler.mk> # don't depend on src.opts.mk doing it +.include "share/mk/src.opts.mk" # We must do lib/ and libexec/ before bin/ in case of a mid-install error to # keep the users system reasonably usable. For static->dynamic root upgrades, @@ -254,7 +260,7 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install BOOTSTRAPPING?= 0 # Common environment for world related stages -CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ +CROSSENV+= MAKEOBJDIRPREFIX=${OBJTREE} \ MACHINE_ARCH=${TARGET_ARCH} \ MACHINE=${TARGET} \ CPUTYPE=${TARGET_CPUTYPE} @@ -329,10 +335,6 @@ HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q} HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT .endif -.if defined(CROSS_TOOLCHAIN) -LOCALBASE?= /usr/local -.include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" -.endif .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} @@ -369,7 +371,7 @@ X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} X${BINUTIL}?= ${${BINUTIL}} .endif .endfor -WMAKEENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ +CROSSENV+= CC="${XCC} ${XCFLAGS}" CXX="${XCXX} ${XCFLAGS} ${XCXXFLAGS}" \ DEPFLAGS="${DEPFLAGS}" \ CPP="${XCPP} ${XCFLAGS}" \ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ |