mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ladislav Michl <oss-lists@triops.cz>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 2/6] ptxdist: introduce PTXDIST_HOSTTOOLS_DIR
Date: Tue, 13 Oct 2026 13:17:18 +0200	[thread overview]
Message-ID: <as4TPkMFRGnj2bqU@lenoch> (raw)
In-Reply-To: <as4S9kELLgKY9wdR@lenoch>

From: Ladislav Michl <ladis@triops.cz>

Store the links to the host tools and kconfig in a separate variable
for now the same as PTXDIST_TOPDIR.

Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
 bin/ptxdist                     | 7 +++++--
 rules/host-qemu.make            | 2 +-
 rules/other/Toplevel.make       | 6 +++---
 scripts/lib/ptxd_lib_kconfig.sh | 6 +++---
 scripts/lib/ptxd_make_nested.sh | 2 +-
 scripts/lib/ptxd_make_report.sh | 2 +-
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/bin/ptxdist b/bin/ptxdist
index 2557cb9a2..94c41412f 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2118,6 +2118,7 @@ _realpath()
 #
 # out: PTXDIST
 #      PTXDIST_TOPDIR
+#      PTXDIST_HOSTTOOLS_DIR
 #      PTXDIST_WORKSPACE
 #      PTXDIST_PTXCONFIG_DEFAULT
 #      PTXDIST_PLATFORMCONFIG_DEFAULT
@@ -2142,6 +2143,7 @@ setup_topdir() {
 
 	PTXDIST="${ptxdist}"
 	PTXDIST_TOPDIR="${topdir}"
+	PTXDIST_HOSTTOOLS_DIR="${topdir}"
 	PTXDIST_WORKSPACE="$(pwd)"
 
 	eval PTXDIST_PTXCONFIG_DEFAULT="${PTXDIST_PTXCONFIG_DEFAULT}"
@@ -2149,8 +2151,8 @@ setup_topdir() {
 	eval PTXDIST_COLLECTIONCONFIG_DEFAULT="${PTXDIST_COLLECTIONCONFIG_DEFAULT}"
 	eval PTXDIST_TOOLCHAIN_DEFAULT="${PTXDIST_TOOLCHAIN_DEFAULT}"
 
-	# ${PTXDIST_TOPDIR}/bin contains links to sane tools found by configure
-	export PATH="${PTXDIST_TOPDIR}/bin:${PATH}"
+	# ${PTXDIST_HOSTTOOLS_DIR}/bin contains links to sane tools found by configure
+	export PATH="${PTXDIST_HOSTTOOLS_DIR}/bin:${PATH}"
 }
 
 
@@ -2727,6 +2729,7 @@ setup_export() {
 		\
 		PTXDIST \
 		PTXDIST_TOPDIR \
+		PTXDIST_HOSTTOOLS_DIR \
 		PTXDIST_SRCDIR \
 		PTXDIST_TEMPDIR \
 		PTXDIST_LIB_DIR \
diff --git a/rules/host-qemu.make b/rules/host-qemu.make
index eef2dc133..77cd8dcea 100644
--- a/rules/host-qemu.make
+++ b/rules/host-qemu.make
@@ -249,7 +249,7 @@ ifdef PTXCONF_HOST_QEMU_USR
 		-e 's|RTLDLIST=.*|RTLDLIST="$(PTXDIST_SYSROOT_TOOLCHAIN)$(QEMU_CROSS_DL)"|' \
 		-e 's|eval $$add_env|eval $(PTXDIST_SYSROOT_CROSS)/usr/bin/qemu-cross -E "$${add_env// /,}"|' \
 		-e 's|verify_out=`|verify_out=`$(PTXDIST_SYSROOT_CROSS)/usr/bin/qemu-cross |' \
-		-e 's|#! */.*$$|#!$(shell readlink $(PTXDIST_TOPDIR)/bin/bash)|' \
+		-e 's|#! */.*$$|#!$(shell readlink $(PTXDIST_HOSTTOOLS_DIR)/bin/bash)|' \
 		$(PTXDIST_SYSROOT_TOOLCHAIN)/usr/bin/ldd > $(PTXDIST_SYSROOT_CROSS)/usr/bin/qemu/ldd
 	@chmod +x $(PTXDIST_SYSROOT_CROSS)/usr/bin/qemu/ldd
 endif
diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make
index 44a030825..5dec61bb3 100644
--- a/rules/other/Toplevel.make
+++ b/rules/other/Toplevel.make
@@ -8,7 +8,7 @@ ifneq ($(findstring n,$(filter-out --%,$(MAKEFLAGS))),)
 MAKE=true
 SHELL=true
 define ptx/force-shell
-$(eval SHELL=$(realpath $(PTXDIST_TOPDIR)/bin/bash))$(shell $(1))$(eval SHELL=true)
+$(eval SHELL=$(realpath $(PTXDIST_HOSTTOOLS_DIR)/bin/bash))$(shell $(1))$(eval SHELL=true)
 endef
 define ptx/force-sh
 $(eval SHELL=/bin/sh)$(shell $(1))$(eval SHELL=true)
@@ -17,12 +17,12 @@ define ptx/sh
 endef
 else
 # make sure bash is used to execute commands from makefiles
-SHELL=$(realpath $(PTXDIST_TOPDIR)/bin/bash)
+SHELL=$(realpath $(PTXDIST_HOSTTOOLS_DIR)/bin/bash)
 define ptx/force-shell
 $(shell $(1))
 endef
 define ptx/force-sh
-$(eval SHELL=/bin/sh)$(shell $(1))$(eval SHELL=$(realpath $(PTXDIST_TOPDIR)/bin/bash))
+$(eval SHELL=/bin/sh)$(shell $(1))$(eval SHELL=$(realpath $(PTXDIST_HOSTTOOLS_DIR)/bin/bash))
 endef
 define ptx/sh
 $(call ptx/force-sh,$(1))
diff --git a/scripts/lib/ptxd_lib_kconfig.sh b/scripts/lib/ptxd_lib_kconfig.sh
index 0cec1edac..625a32c8a 100644
--- a/scripts/lib/ptxd_lib_kconfig.sh
+++ b/scripts/lib/ptxd_lib_kconfig.sh
@@ -781,9 +781,9 @@ ptxd_kconfig() {
 	;;
     esac
 
-    local conf="${PTXDIST_TOPDIR}/scripts/kconfig/conf"
-    local mconf="${PTXDIST_TOPDIR}/scripts/kconfig/mconf"
-    local nconf="${PTXDIST_TOPDIR}/scripts/kconfig/nconf"
+    local conf="${PTXDIST_HOSTTOOLS_DIR}/scripts/kconfig/conf"
+    local mconf="${PTXDIST_HOSTTOOLS_DIR}/scripts/kconfig/mconf"
+    local nconf="${PTXDIST_HOSTTOOLS_DIR}/scripts/kconfig/nconf"
 
     export \
 	KCONFIG_NOTIMESTAMP="1" \
diff --git a/scripts/lib/ptxd_make_nested.sh b/scripts/lib/ptxd_make_nested.sh
index 54535377f..35087034c 100644
--- a/scripts/lib/ptxd_make_nested.sh
+++ b/scripts/lib/ptxd_make_nested.sh
@@ -47,7 +47,7 @@ ptxd_make_nested_ptxdist() {
     args=( "cd" "${pkg_workspace}" "&&" "${PTXDIST_TOPDIR}/bin/ptxdist" )
 
     PTXDIST_TOOLCHAIN="$(readlink "${PTXDIST_PLATFORMDIR}/selected_toolchain")"
-    PATH=$(sed -e 's;[^:]*/sysroot-\(host\|cross\)/[^:]*:;;g' -e "s;${PTXDIST_TOPDIR}/bin:;;" -e "s;${PTXDIST_TOOLCHAIN}:;;" <<< "${PATH}")
+    PATH=$(sed -e 's;[^:]*/sysroot-\(host\|cross\)/[^:]*:;;g' -e "s;${PTXDIST_HOSTTOOLS_DIR}/bin:;;" -e "s;${PTXDIST_TOOLCHAIN}:;;" <<< "${PATH}")
 
     if [ "${PTXDIST_WORKSPACE}" != "${pkg_workspace}" ]; then
 	unset PTXDIST_PLATFORMDIR
diff --git a/scripts/lib/ptxd_make_report.sh b/scripts/lib/ptxd_make_report.sh
index 7eea60900..7f8ad07ad 100644
--- a/scripts/lib/ptxd_make_report.sh
+++ b/scripts/lib/ptxd_make_report.sh
@@ -24,7 +24,7 @@ ptxd_make_bsp_report_header() {
     do_path() {
 	local orig_IFS="${IFS}"
 	# only the paths added by PTXdist
-	local path="${2%:${PTXDIST_TOPDIR}/bin:*}:${PTXDIST_TOPDIR}/bin"
+	local path="${2%:${PTXDIST_HOSTTOOLS_DIR}/bin:*}:${PTXDIST_HOSTTOOLS_DIR}/bin"
 	echo "${indent}${1}"
 	awk "BEGIN { RS=\":\" } { if (\$1) print \"${indent}- '\" \$1 \"'\" }" <<<"${path}"
     }
-- 
2.47.3




  parent reply	other threads:[~2026-10-13 11:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 11:16 [ptxdist] [PATCH 0/6] New BSP from template Ladislav Michl
2026-10-13 11:16 ` [ptxdist] [PATCH 1/6] scripts: add ptxdist_bootstrap.sh with out-of-tree build support Ladislav Michl
2026-10-13 11:17 ` Ladislav Michl [this message]
2026-10-13 11:17 ` [ptxdist] [PATCH 3/6] ptxdist: prepare host tools on demand Ladislav Michl
2026-10-13 11:18 ` [ptxdist] [PATCH 4/6] ptxdist: don't depend on bash being /bin/bash Ladislav Michl
2026-10-13 11:18 ` [ptxdist] [PATCH 5/6] configure: use ptxdist_bootstrap.sh to check the host Ladislav Michl
2026-10-13 11:18 ` [ptxdist] [PATCH 6/6] ptxdist: let new project raise from template Ladislav Michl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=as4TPkMFRGnj2bqU@lenoch \
    --to=oss-lists@triops.cz \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox