Chromium Code Reviews| 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 function print_help() { | |
| 11 cat << EOF | |
|
M-A Ruel
2012/12/11 14:24:55
In theory you'd want this line to be indented.
Nico
2012/12/11 18:36:54
I could use <<- for a here document that strips le
| |
| 12 No prebuilt ninja binary was found for this system. | |
| 13 Try building your own binary by doing: | |
| 14 cd ~ | |
| 15 git clone https://github.com/martine/ninja.git | |
|
M-A Ruel
2012/12/11 14:24:55
git clone https://github.com/martine/ninja.git -b
Nico
2012/12/11 18:36:54
Done.
| |
| 16 cd ninja | |
|
M-A Ruel
2012/12/11 14:24:55
Does ./ninja/bootstrap.py works? If so, you'd save
Nico
2012/12/11 18:36:54
Done.
| |
| 17 git checkout v1.0.0 | |
| 18 ./bootstrap.py | |
| 19 Then add ~/ninja/ to your PATH. | |
| 20 EOF | |
| 21 } | |
| 22 | |
| 10 if [ "${OS}" = "Linux" ]; then | 23 if [ "${OS}" = "Linux" ]; then |
| 11 machine=$(getconf LONG_BIT) | 24 machine=$(getconf LONG_BIT) |
| 12 if [[ "$machine" = "64" ]]; then | 25 if [[ "$machine" = "64" ]]; then |
| 13 exec "${THIS_DIR}/ninja-linux64" "$@" | 26 exec "${THIS_DIR}/ninja-linux64" "$@" |
| 14 elif [[ "$machine" = "32" ]]; then | 27 elif [[ "$machine" = "32" ]]; then |
| 15 exec "${THIS_DIR}/ninja-linux32" "$@" | 28 exec "${THIS_DIR}/ninja-linux32" "$@" |
| 16 else | 29 else |
| 17 echo Unknown architecture \($machine\) -- unable to run ninja. | 30 echo "Unknown architecture ${machine}." |
| 31 print_help | |
| 18 exit 1 | 32 exit 1 |
| 19 fi | 33 fi |
| 20 elif [ "${OS}" = "Darwin" ]; then | 34 elif [ "${OS}" = "Darwin" ]; then |
| 21 exec "${THIS_DIR}/ninja-mac" "$@" | 35 exec "${THIS_DIR}/ninja-mac" "$@" |
| 22 elif [[ ${OS} == CYGWIN* ]]; then | 36 elif [[ ${OS} == CYGWIN* ]]; then |
| 23 exec cmd.exe /c `cygpath -t windows $0`.exe "$@" | 37 exec cmd.exe /c `cygpath -t windows $0`.exe "$@" |
| 24 elif [[ ${OS} == MINGW32* ]]; then | 38 elif [[ ${OS} == MINGW32* ]]; then |
| 25 cmd.exe //c $0.exe "$@" | 39 cmd.exe //c $0.exe "$@" |
| 26 else | 40 else |
| 27 echo "Unsupported OS ${OS}" | 41 echo "Unsupported OS ${OS}" |
| 42 print_help | |
| 28 exit 1 | 43 exit 1 |
| 29 fi | 44 fi |
| 30 | 45 |
| OLD | NEW |