Prompt to build the toolchain if it doesn't exist.

This commit is contained in:
K. Lange 2018-03-21 16:53:40 +09:00 committed by Kevin Lange
parent 0c41873da8
commit 9870ddecaf

View File

@ -3,8 +3,13 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -e "$DIR/local/bin/i686-pc-toaru-gcc" ]; then
echo "Toolchain has not been built. Please run \`bash util/build-gcc.sh\`." >&2
exit 1
echo -n "Toolchain has not been built. Would you like to build it now? (y/n) " >&2
read response
case $response in
[yY]) bash $DIR/build-gcc.sh ;;
[nN]) exit 1 ;;
*)
esac
fi
export PATH="$DIR/local/bin:$PATH"