forked from johnttaylor/colony.core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·50 lines (40 loc) · 1.34 KB
/
env.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# This script sets up the PIM environment to use NQBP and the GCC compiler
#
# This script MUST BE 'sourced' since it sets environment variables
#
# usage: env.sh [<gcc-bin-path>|default]
#
# <gcc-bin-path> Optional explicit path to the GCC bin/ directory. The
# default behavior is to use the GCC toolchain in the command
# path. If 'default' is specified than the environment
# reverts to the native GCC toolchain
#
# Get the root directory
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Set optional GCC path
if [ -n "${1}" ]; then
if [ ${1} = "default" ]; then
unset NQBP_GCC_BIN
else
export NQBP_GCC_BIN=${1}
fi
fi
# Put the current directory into the command path (simplifies invoking the nqbp.py scripts)
export PATH=$PATH:./
# Configure NQBP
export NQBP_PKG_ROOT=$HERE
export NQBP_WORK_ROOT=$HERE/..
export NQBP_XPKGS_ROOT=$HERE/xsrc
export NQBP_BIN=$NQBP_XPKGS_ROOT/nqbp
alias t="cd $HERE"
alias bob="$NQBP_BIN/other/bob.py"
alias chuck="$NQBP_BIN/other/chuck.py"
# Display which compiler is being used
if [ -z "${NQBP_GCC_BIN}" ]; then
echo "Environment set (using native GCC compiler)"
gcc --version
else
echo "Environment set (using GCC compiler @ ${NQBP_GCC_BIN})"
${NQBP_GCC_BIN}/gcc --version
fi