svn commit: r290423 - head

Bryan Drewery bdrewery at FreeBSD.org
Thu Nov 5 22:09:01 UTC 2015


Author: bdrewery
Date: Thu Nov  5 22:09:00 2015
New Revision: 290423
URL: https://svnweb.freebsd.org/changeset/base/290423

Log:
  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

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Thu Nov  5 22:03:42 2015	(r290422)
+++ head/Makefile.inc1	Thu Nov  5 22:09:00 2015	(r290423)
@@ -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}


More information about the svn-src-all mailing list