From 8a6d67d1388beefb8f660b817b76a9a994c21e33 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 19 Mar 2020 10:41:36 +0800 Subject: [PATCH] tools: Make sethost.sh can be invoke from any directory --- tools/configure.sh | 4 +--- tools/sethost.sh | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/configure.sh b/tools/configure.sh index a90517d9de..6455fc49fc 100755 --- a/tools/configure.sh +++ b/tools/configure.sh @@ -282,6 +282,4 @@ fi # The saved defconfig files are all in compressed format and must be # reconstitued before they can be used. -cd ${TOPDIR} || { echo "Failed to cd to ${TOPDIR}"; exit 10; } - -./tools/sethost.sh $debug $host +${TOPDIR}/tools/sethost.sh $debug $host diff --git a/tools/sethost.sh b/tools/sethost.sh index 5a75885acc..8ebac02c07 100755 --- a/tools/sethost.sh +++ b/tools/sethost.sh @@ -125,6 +125,9 @@ if [ ! -z "$1" ]; then showusage fi +WD=`test -d ${0%/*} && cd ${0%/*}; pwd` +cd $WD + if [ -x sethost.sh ]; then nuttx=$PWD/.. else