[23/28] make.sh: Add CUSTOM_PATH option to lfsmake1

Message ID 20220204164748.315559-23-michael.tremer@ipfire.org
State Accepted
Commit 0ce11c680d8052cf3eede09dcde3e3a67d52905a
Headers
Series [01/28] gcc: toolchain stage 2: Set sysroot to /tools_${arch} |

Commit Message

Michael Tremer Feb. 4, 2022, 4:47 p.m. UTC
  This is required so that we use the host's tools to perform the
stripping.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 make.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/make.sh b/make.sh
index cd7464917..f59624665 100755
--- a/make.sh
+++ b/make.sh
@@ -663,8 +663,12 @@  lfsmake1() {
 	lfsmakecommoncheck $*
 	[ $? == 1 ] && return 0
 
+	if [ -n "${CUSTOM_PATH}" ]; then
+		local PATH="${CUSTOM_PATH}:${PATH}"
+	fi
+
 	cd $BASEDIR/lfs && env -i \
-		PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/sbin:${TOOLS_DIR}/bin:${PATH}" \
+		PATH="${PATH}" \
 		CCACHE_DIR="${CCACHE_DIR}"/${BUILD_ARCH}/${TOOLCHAINVER} \
 		CCACHE_TEMPDIR="${CCACHE_TEMPDIR}" \
 		CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \
@@ -1062,7 +1066,7 @@  buildtoolchain() {
 	lfsmake1 bison
 	lfsmake1 flex
 	lfsmake1 fake-environ
-	lfsmake1 strip
+	CUSTOM_PATH="${PATH}" lfsmake1 strip
 	lfsmake1 cleanup-toolchain
 }