make buildenv tweak

Ian Lepore freebsd at damnhippie.dyndns.org
Wed Jan 11 20:49:34 UTC 2012


The following little patch enhances 'make buildenv' quite a bit for me.
Once I have a cross-build environment built out that I'm going to be
working in for a while, I hand-copy a statically-linked bash into
chroot/bin/ and export BUILDENV_SHELL=/bin/bash and life is good.  Of
course it also works with /bin/csh if that's your favorite.

Index: Makefile.inc1
===================================================================
RCS file: /local/base/FreeBSD-CVS/src/Makefile.inc1,v
retrieving revision 1.721
diff -u -p -r1.721 Makefile.inc1
--- Makefile.inc1	6 Jan 2012 00:34:27 -0000	1.721
+++ Makefile.inc1	11 Jan 2012 20:24:22 -0000
@@ -19,6 +19,7 @@
 #	    list
 #	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)
 
 #
 # The intended user-driven targets are:
@@ -556,9 +557,10 @@ buildworld_epilogue:
 buildenvvars:
 	@echo ${WMAKEENV:Q}
 
+BUILDENV_SHELL?=/bin/sh
 buildenv:
 	@echo Entering world for ${TARGET_ARCH}:${TARGET}
-	@cd ${.CURDIR} && env ${WMAKEENV} sh || true
+	@cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true
 
 TOOLCHAIN_TGTS=	${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
 toolchain: ${TOOLCHAIN_TGTS}




More information about the freebsd-embedded mailing list