-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetenv
More file actions
executable file
·72 lines (68 loc) · 2.35 KB
/
setenv
File metadata and controls
executable file
·72 lines (68 loc) · 2.35 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# eChronos Real-Time Operating System
# Copyright (C) 2015 National ICT Australia Limited (NICTA), ABN 62 102 206 173.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3, provided that these additional
# terms apply under section 7:
#
# No right, title or interest in or to any trade mark, service mark, logo or
# trade name of of National ICT Australia Limited, ABN 62 102 206 173
# ("NICTA") or its licensors is granted. Modified versions of the Program
# must be plainly marked as such, and must not be distributed using
# "eChronos" as a trade mark or product name, or misrepresented as being the
# original Program.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# @TAG(NICTA_AGPL)
#
#
# This shell script should be sourced to set up a shell environment for working on the RTOS.
#
# Usage:
#
# % . ./setenv
#
# Later 'unsetenv' can be used to restore the environment.
#
unsetenv () {
if test -n ""$OLD_PATH; then
export PATH=$OLD_PATH
unset OLD_PATH
else
# This shouldn't be possible, but just in case
echo "Environment not set"
fi;
# Remove unsetenv from the environment since it is no longer
# required.
unset -f unsetenv
}
setenv () {
if test -n ""$OLD_PATH; then
echo "Environment already set."
elif test ! -f setenv; then
echo "Don't appear to be source from the correct directory."
else
OLD_PATH=$PATH
if test $(uname) = Darwin; then
PATH=$(pwd)/core/tools/x86_64-apple-darwin/bin:$PATH
elif test $(uname) = Linux; then
PATH=$(pwd)/core/tools/x86_64-unknown-linux-gnu/bin:$PATH
PATH=$(pwd)/core/tools/gcc-4.8.2-Ee500v2-eabispe/bin:$PATH
else
echo "Unknown host operating system"
fi
export PATH=$PATH
fi;
}
setenv
# No need to call setenv twice, so remove it form the environment.
unset -f setenv