LzmaCompress 848 B

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