Explicitly set TARGET and TARGET_ARCH in a chroot sandbox.

In fact, these variable are set as environment variables since we run
"make TARGET=xxx TARGET_ARCH=xxx"; TARGET and TARGET_ARCH are declared
in the command line arguments.  However, if you are not make(1) guy,
it is hard to understand that TARGET/TARGET_ARCH are appropriately set
in a chroot environment (as environment variables).

Now, the only environment variable need to be set explicitly is 'PATH'.
If we set PATH in /mk script, we can make pristine sandbox for release
build (i.e., "env -i /usr/sbin/chroot ${CHROOT} /mk" will work).

Valuable comments about this issue from: ru
Tested on (virtually): snapshots.jp.FreeBSD.org
MFC after:	2 weeks
This commit is contained in:
Makoto Matsushita 2002-06-08 03:15:50 +00:00
parent 96d333b7fa
commit 04b9282ff8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=98027

View File

@ -383,6 +383,12 @@ rerelease release:
.endif
.if defined(KERNEL_FLAGS)
echo "export KERNEL_FLAGS=\"${KERNEL_FLAGS}\"" >> ${CHROOTDIR}/mk
.endif
.if defined(TARGET)
echo "export TARGET=\"${TARGET}\"" >> ${CHROOTDIR}/mk
.endif
.if defined(TARGET_ARCH)
echo "export TARGET_ARCH=\"${TARGET_ARCH}\"" >> ${CHROOTDIR}/mk
.endif
# Don't remove this, or the build will fall over!
echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk