2012-04-10 09:28:51 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-01-20 06:12:02 +01:00
|
|
|
full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
|
|
|
|
dir=$(dirname "$full_cmd")
|
|
|
|
cmd=${full_cmd##*/}
|
2012-04-10 09:28:51 +02:00
|
|
|
|
2016-01-20 06:12:02 +01:00
|
|
|
if [ -n "$WORKSPACE" ] && [ -e "$WORKSPACE/Conf/BaseToolsCBinaries" ]
|
2012-04-10 09:28:51 +02:00
|
|
|
then
|
2016-01-20 06:12:02 +01:00
|
|
|
exec "$WORKSPACE/Conf/BaseToolsCBinaries/$cmd"
|
|
|
|
elif [ -n "$WORKSPACE" ] && [ -e "$EDK_TOOLS_PATH/Source/C" ]
|
2012-04-10 09:28:51 +02:00
|
|
|
then
|
2016-01-20 06:12:02 +01:00
|
|
|
if [ ! -e "$EDK_TOOLS_PATH/Source/C/bin/$cmd" ]
|
2012-04-10 09:28:51 +02:00
|
|
|
then
|
2016-01-20 06:12:02 +01:00
|
|
|
echo "BaseTools C Tool binary was not found ($cmd)"
|
|
|
|
echo "You may need to run:"
|
2012-04-10 09:28:51 +02:00
|
|
|
echo " make -C $EDK_TOOLS_PATH/Source/C"
|
|
|
|
else
|
2016-01-20 06:12:02 +01:00
|
|
|
exec "$EDK_TOOLS_PATH/Source/C/bin/$cmd" "$@"
|
2012-04-10 09:28:51 +02:00
|
|
|
fi
|
2016-01-20 06:12:02 +01:00
|
|
|
elif [ -e "$dir/../../Source/C/bin/$cmd" ]
|
2012-04-10 09:28:51 +02:00
|
|
|
then
|
2016-01-20 06:12:02 +01:00
|
|
|
exec "$dir/../../Source/C/bin/$cmd" "$@"
|
2012-04-10 09:28:51 +02:00
|
|
|
else
|
2016-01-20 06:12:02 +01:00
|
|
|
echo "Unable to find the real '$cmd' to run"
|
|
|
|
echo "This message was printed by"
|
2012-04-10 09:28:51 +02:00
|
|
|
echo " $0"
|
2016-01-20 06:12:02 +01:00
|
|
|
exit 127
|
2012-04-10 09:28:51 +02:00
|
|
|
fi
|
|
|
|
|