Revision 56360b33
tools/compiler/GCC/gccsetup.sh | ||
---|---|---|
471 | 471 |
local installdir="" |
472 | 472 |
read -p "Installation directory: " -i ${installbasedir}/${compilerdir} -e installdir |
473 | 473 |
printLog "user selected $installdir\n" |
474 |
linkdir=$(realpath ${installdir}/../) |
|
474 | 475 |
printLog "read link directory\n" |
475 | 476 |
read -p "Link directory: " -i $linkdir -e linkdir |
476 | 477 |
printLog "user selected $linkdir\n" |
... | ... | |
511 | 512 |
mkdir "$dir" |
512 | 513 |
done |
513 | 514 |
# create / overwrite links |
514 |
ls ${installdir}/bin/ | xargs -i ln -sf ${installdir}/bin/{} ${linkdir}/{} |
|
515 |
local linkpath=$(realpath --relative-base=$linkdir ${installdir}/bin/) |
|
516 |
ls ${installdir}/bin/ | xargs -i ln -sf ${linkpath}/{} ${linkdir}/{} |
|
515 | 517 |
printInfo "default version set to $(arm-none-eabi-gcc -dumpversion)\n" |
516 | 518 |
|
517 | 519 |
# append the link directory to the PATH environment variable if required |
... | ... | |
736 | 738 |
local idx=$((userinput - 1)) |
737 | 739 |
# find and delete old links |
738 | 740 |
rm `find $linkdir -maxdepth 1 -type l | grep -Ev "*[0-9]\.[0-9]\.[0-9]"` |
739 |
# create new links |
|
741 |
# create new links with relative or absolute paths
|
|
740 | 742 |
local bindir=$(dirname ${versions[$idx]}) |
741 |
ls $bindir | xargs -i ln -sf $bindir/{} $linkdir/{} |
|
743 |
local linkpath=$(realpath --relative-base=$linkdir $bindir) |
|
744 |
ls $bindir | xargs -i ln -sf $linkpath/{} $linkdir/{} |
|
742 | 745 |
printInfo "default version set to $(arm-none-eabi-gcc -dumpversion)\n" |
743 | 746 |
fi |
744 | 747 |
fi |
Also available in: Unified diff