[gcc][riscv] update the patch to add a mcmodel=medany multilib
[toolchains.git] / env.bash
blob0c4d051113e5abad85267819912bb90473c5d0da
1 # This script adds toolchains built by doit to $PATH. It should sourced from within bash like:
2 # . path/to/env.sh
4 OS=`uname`
5 HOSTARCH=`uname -m`
6 DIR=`dirname "$BASH_SOURCE"`
7 SELF=`basename "$BASH_SOURCE"`
8 # OSX readlink doesn't support -f, but greadlink is the gnu version
9 # that Linux uses
10 READLINK=`which greadlink || which readlink`
12 if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
13 echo "$SELF must be sourced, not executed"
14 exit 1
17 for p in `ls -d $DIR/*-$OS-$HOSTARCH | grep -v build`;
19 if [ -d $p/bin ]; then
20 ABS_PATH=`$READLINK -f $p`
21 echo "added $ABS_PATH";
22 export PATH=$ABS_PATH/bin:$PATH;
24 done