From e4fa4fafab1ab864114245261e4e4b54ddbaad82 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Thu, 5 Nov 2015 22:09:00 +0000 Subject: Allow 'make buildenv' to default to the caller's shell by using SHELL. Also pass BUILDENV=1 into the sub-shell to allow modifying PS1 in .profile such as: if [ -n "${BUILDENV}" ]; then PS1="(buildenv) ${PS1}" fi SHELL defaults to 'sh' in share/mk/sys.mk, but is typically passed down by the shell invoking make as well. Rather than forcing all 'buildenv' users to use plain /bin/sh, let them use their favorite shell. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Discussed with: imp --- Makefile.inc1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index a83a19253084..3c5ff9320336 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -27,7 +27,7 @@ # when NO_ROOT is set. (default: ${DESTDIR}/METALOG) # TARGET="machine" to crossbuild world for a different machine type # TARGET_ARCH= may be required when a TARGET supports multiple endians -# BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh) +# BUILDENV_SHELL= shell to launch for the buildenv target (def:${SHELL}) # WORLD_FLAGS= additional flags to pass to make(1) during buildworld # KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel # SUBDIR_OVERRIDE="list of dirs" to build rather than everything. @@ -145,7 +145,7 @@ CLEANDIR= cleandir LOCAL_TOOL_DIRS?= -BUILDENV_SHELL?=/bin/sh +BUILDENV_SHELL?=${SHELL} SVN?= /usr/local/bin/svn SVNFLAGS?= -r HEAD @@ -783,7 +783,7 @@ buildenvvars: .endif buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} - @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true + @cd ${.CURDIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} || true TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} toolchain: ${TOOLCHAIN_TGTS} -- cgit v1.2.3