OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 OS="$(uname -s)" | 7 OS="$(uname -s)" |
8 THIS_DIR="$(dirname "${0}")" | 8 THIS_DIR="$(dirname "${0}")" |
9 | 9 |
10 if [ "${OS}" = "Linux" ]; then | 10 case "$OS" in |
11 machine=$(getconf LONG_BIT) | 11 Linux) |
M-A Ruel
2012/12/11 17:43:46
Please align at +2 and the inner at +4.
tony
2012/12/11 17:53:33
Done.
| |
12 if [[ "$machine" = "64" ]]; then | 12 MACHINE=$(getconf LONG_BIT) |
13 exec "${THIS_DIR}/ninja-linux64" "$@" | 13 case "$MACHINE" in |
14 elif [[ "$machine" = "32" ]]; then | 14 32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";; |
M-A Ruel
2012/12/11 17:43:46
Same
| |
15 exec "${THIS_DIR}/ninja-linux32" "$@" | 15 *) echo Unknown architecture \($MACHINE\) -- unable to run ninja. |
16 else | 16 exit 1 |
17 echo Unknown architecture \($machine\) -- unable to run ninja. | 17 ;; |
18 exit 1 | 18 esac |
19 fi | 19 ;; |
20 elif [ "${OS}" = "Darwin" ]; then | 20 Darwin) exec "${THIS_DIR}/ninja-mac" "$@";; |
21 exec "${THIS_DIR}/ninja-mac" "$@" | 21 CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";; |
22 elif [[ ${OS} == CYGWIN* ]]; then | 22 MINGW32*) cmd.exe //c $0.exe "$@";; |
23 exec cmd.exe /c `cygpath -t windows $0`.exe "$@" | 23 *) echo "Unsupported OS ${OS}" |
24 elif [[ ${OS} == MINGW32* ]]; then | 24 exit 1;; |
25 cmd.exe //c $0.exe "$@" | 25 esac |
26 else | |
27 echo "Unsupported OS ${OS}" | |
28 exit 1 | |
29 fi | |
30 | |
OLD | NEW |