Chromium Code Reviews| Index: ninja |
| =================================================================== |
| --- ninja (revision 172191) |
| +++ ninja (working copy) |
| @@ -7,24 +7,28 @@ |
| OS="$(uname -s)" |
| THIS_DIR="$(dirname "${0}")" |
| -if [ "${OS}" = "Linux" ]; then |
| - machine=$(getconf LONG_BIT) |
| - if [[ "$machine" = "64" ]]; then |
| - exec "${THIS_DIR}/ninja-linux64" "$@" |
| - elif [[ "$machine" = "32" ]]; then |
| - exec "${THIS_DIR}/ninja-linux32" "$@" |
| - else |
| - echo Unknown architecture \($machine\) -- unable to run ninja. |
| - exit 1 |
| - fi |
| -elif [ "${OS}" = "Darwin" ]; then |
| +case "$OS" in |
| +Linux) |
| + MACHINE=$(getconf LONG_BIT) |
| + case "$MACHINE" in |
| + 64) exec "${THIS_DIR}/ninja-linux64" "$@";; |
|
iannucci
2012/12/11 00:25:34
I might do something like:
32|64) exec "${THIS_DI
tony
2012/12/11 00:34:52
Done.
|
| + 32) exec "${THIS_DIR}/ninja-linux32" "$@";; |
| + *) echo Unknown architecture \($MACHINE\) -- unable to run ninja. |
| + exit 1 |
| + ;; |
| + esac |
| + ;; |
| +Darwin) |
|
iannucci
2012/12/11 00:25:34
Maybe these can all be on one line each like for t
tony
2012/12/11 00:34:52
Done.
|
| exec "${THIS_DIR}/ninja-mac" "$@" |
| -elif [[ ${OS} == CYGWIN* ]]; then |
| + ;; |
| +CYGWIN*) |
| exec cmd.exe /c `cygpath -t windows $0`.exe "$@" |
|
iannucci
2012/12/11 00:25:34
Should use $() over ``
tony
2012/12/11 00:34:52
Done.
|
| -elif [[ ${OS} == MINGW32* ]]; then |
| + ;; |
| +MINGW32*) |
| cmd.exe //c $0.exe "$@" |
| -else |
| + ;; |
| +*) |
| echo "Unsupported OS ${OS}" |
| exit 1 |
| -fi |
| - |
| + ;; |
| +esac |