]>
Commit | Line | Data |
---|---|---|
5ef6e0d3 | 1 | #!/usr/bin/env bash |
5ef6e0d3 | 2 | |
5e407648 CD |
3 | full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here |
4 | dir=$(dirname "$full_cmd") | |
5 | cmd=${full_cmd##*/} | |
5ef6e0d3 | 6 | |
5e407648 | 7 | if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ] |
5ef6e0d3 | 8 | then |
5e407648 CD |
9 | exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd" |
10 | elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ] | |
5ef6e0d3 | 11 | then |
5e407648 | 12 | if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ] |
5ef6e0d3 | 13 | then |
5e407648 CD |
14 | echo "BaseTools C Tool binary was not found ($cmd)" |
15 | echo "You may need to run:" | |
5ef6e0d3 LG |
16 | echo " make -C $EDK_TOOLS_PATH/Source/C" |
17 | else | |
5e407648 | 18 | exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@" |
5ef6e0d3 | 19 | fi |
5e407648 | 20 | elif [ -e "$dir/../../Source/C/bin/$cmd" ] |
5ef6e0d3 | 21 | then |
5e407648 | 22 | exec "$dir/../../Source/C/bin/$cmd" "$@" |
5ef6e0d3 | 23 | else |
5e407648 CD |
24 | echo "Unable to find the real '$cmd' to run" |
25 | echo "This message was printed by" | |
5ef6e0d3 | 26 | echo " $0" |
5e407648 | 27 | exit 127 |
5ef6e0d3 LG |
28 | fi |
29 |