@ -7,24 +7,18 @@
OS="$(uname -s)"
OS="$(uname -s)"
THIS_DIR="$(dirname "${0}")"
THIS_DIR="$(dirname "${0}")"
if [ "${OS}" = "Linux" ]; then
case "$OS" in
machine=$(getconf LONG_BIT)
Linux)
if [[ "$machine" = "64" ]]; then
MACHINE=$(getconf LONG_BIT)
exec "${THIS_DIR}/ninja-linux64" "$@"
case "$MACHINE" in
elif [[ "$machine" = "32" ]]; then
32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";;
exec "${THIS_DIR}/ninja-linux32" "$@"
*) echo Unknown architecture \($MACHINE\) -- unable to run ninja.
else
exit 1;;
echo Unknown architecture \($machine\) -- unable to run ninja.
esac
exit 1
;;
fi
Darwin) exec "${THIS_DIR}/ninja-mac" "$@";;
elif [ "${OS}" = "Darwin" ]; then
CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";;
exec "${THIS_DIR}/ninja-mac" "$@"
MINGW32*) cmd.exe //c $0.exe "$@";;
elif [[ ${OS} == CYGWIN* ]]; then
*) echo "Unsupported OS ${OS}"
exec cmd.exe /c `cygpath -t windows $0`.exe "$@"
exit 1;;
elif [[ ${OS} == MINGW32* ]]; then
esac
cmd.exe //c $0.exe "$@"
else
echo "Unsupported OS ${OS}"
exit 1
fi