From a55d4ddd20f8bd122d3f4fc897d90f6273dcf9a8 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sun, 8 Nov 2015 00:50:06 +0000 Subject: [PATCH] Add a hack to workaround ZSH as BUILDENV_SHELL breaking CPUTYPE. ZSH considers CPUTYPE a magic variable that will be the output of 'uname -m' even if already set in environment when starting up. The CPUTYPE?= check in Makefile.inc1 and supporting overriding CPUTYPE manually in the buildenv shell make automatic workarounds too tricky here. ZSH should really respect variables set in the environment before trashing them. X-MFC-With: r290423 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division --- Makefile.inc1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 12759c330fc9..3f37401b3823 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -784,6 +784,9 @@ buildenvvars: .PHONY BUILDENV_DIR?= ${.CURDIR} buildenv: .PHONY @echo Entering world for ${TARGET_ARCH}:${TARGET} +.if ${BUILDENV_SHELL:M*zsh*} + @echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE} +.endif @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \ || true