File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,10 +48,20 @@ if [[ "$RECONFIGURE" == 1 || ! -f .config ]]; then
4848 make rk3506_aes_defconfig
4949fi
5050
51+ # Detect toolchain root from PATH (avoid hardcoding /opt/... in the defconfig).
52+ # This lets the user change toolchain location without editing config files.
53+ TC_GCC=$( command -v " arm-none-linux-gnueabihf-gcc" 2> /dev/null || true)
54+ if [[ -z " $TC_GCC " ]]; then
55+ die " arm-none-linux-gnueabihf-gcc not found on PATH. Run: source scripts/env-setup.sh"
56+ fi
57+ BR2_TC_PATH=$( cd " $( dirname " $TC_GCC " ) /.." && pwd)
58+ log_info " detected toolchain: $BR2_TC_PATH "
59+
5160# WSL: buildroot dependencies.mk rejects PATH entries with spaces (/mnt/c/...).
5261# forge_clean_path strips them; run make under the cleaned PATH.
53- log_info " make (PATH cleaned of /mnt + whitespace)"
54- PATH=" $( forge_clean_path) " make
62+ # BR2_TOOLCHAIN_EXTERNAL_PATH overrides the defconfig's hardcoded default.
63+ log_info " make (PATH cleaned of /mnt + whitespace, BR2_TOOLCHAIN_EXTERNAL_PATH from env)"
64+ PATH=" $( forge_clean_path) " make BR2_TOOLCHAIN_EXTERNAL_PATH=" $BR2_TC_PATH "
5565
5666ROOTFS_TAR=" $BUILDROOT /output/images/rootfs.tar"
5767[[ -f " $ROOTFS_TAR " ]] || die " buildroot produced no rootfs.tar"
You can’t perform that action at this time.
0 commit comments