From 4f47920e9c33368c746bc45b26383ccd2ce5cdb2 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sun, 12 Jan 2020 04:18:36 +0000 Subject: [PATCH] Makefile.inc1: push /usr/libexec into the BPATH/TMPPATH ${WORLDTMP}/legacy/usr/libexec will only have libexec/ bits that we've pushed as bootstrap tools, so this is generally safe to include prior to PATH. The following are the ramifications of this change: - BPATH addition gets us at least bootstrap flua in WMAKEENV path for buildenv, for those earlier systems where it's bootstrapped still - Reworked the sysent target to just set PATH and let it get worked out in src.lua.mk or individual sysent makefiles -- this gives us back the ability to overwrite LUA_CMD and use a different/external lua for these targets. sysent can also now work cleanly in buildenv. - tools/build/Makefile will now symlink the host flua into build's host tools so that the above can work without needing to add the host's /usr/libexec explicitly into TMPPATH. Reviewed by: arichardson, brooks, imp (all slightly earlier version) Differential Revision: https://reviews.freebsd.org/D22464 --- Makefile.inc1 | 15 +++++++-------- tools/build/Makefile | 3 +++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 2a03a5bad8b7..be3e8d1ee31e 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -590,7 +590,7 @@ BUILD_ARCH!= uname -p .endif .endif WORLDTMP?= ${OBJTOP}/tmp -BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin +BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin:${WORLDTMP}/legacy/usr/libexec XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin # When building we want to find the cross tools before the host tools in ${BPATH}. @@ -1500,11 +1500,11 @@ makeman: .PHONY ${_+_}cd ${.CURDIR}/tools/build/options; sh makeman > \ ${.CURDIR}/share/man/man5/src.conf.5 -.if make(sysent) -.include -.endif - -_sysent_PATH= ${WORLDTMP}/legacy/usr/libexec:/usr/libexec:${PATH} +# We can't assume here that ${TMPPATH} will include ${PATH} or /usr/libexec +# because we may be building with a STRICTTMPPATH, so we explicitly include +# /usr/libexec here for flua. ${TMPPATH} still usefully includes anything else +# we may need to function. +_sysent_PATH= ${TMPPATH}:/usr/libexec _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 _sysent_dirs+= sys/compat/cloudabi32 \ @@ -1517,8 +1517,7 @@ _sysent_dirs+= sys/amd64/linux \ sysent: .PHONY .for _dir in ${_sysent_dirs} @echo "${MAKE} -C ${.CURDIR}/${_dir} sysent" - ${_+_}@env PATH=${_sysent_PATH} LUA=${LUA_CMD} \ - ${MAKE} -C ${.CURDIR}/${_dir} sysent + ${_+_}@env PATH=${_sysent_PATH} ${MAKE} -C ${.CURDIR}/${_dir} sysent .endfor # diff --git a/tools/build/Makefile b/tools/build/Makefile index c86d4f79cb2f..87916eb2c398 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -116,6 +116,9 @@ host-symlinks: ln -sfnv "$${source_path}" "$${target_path}"; \ fi .endfor +.if exists(/usr/libexec/flua) + ln -sf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua +.endif # Create all the directories that are needed during the legacy, bootstrap-tools # and cross-tools stages. We do this here using mkdir since mtree may not exist