blob: c01f23436ed3c6a3110f1b32bc28b45201bd571c [file] [log] [blame]
[email protected]df0fcd62012-01-14 01:37:461#!/bin/bash
[email protected]5b834912012-01-13 23:33:352
[email protected]c7bf35f2012-04-13 20:17:293# Copyright (c) 2012 Google Inc. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
[email protected]df0fcd62012-01-14 01:37:467OS="$(uname -s)"
[email protected]fdf5ca82012-11-01 21:50:268THIS_DIR="$(dirname "${0}")"
[email protected]df0fcd62012-01-14 01:37:469
[email protected]a5957db2012-12-11 22:15:4010function print_help() {
11cat <<-EOF
12No prebuilt ninja binary was found for this system.
13Try building your own binary by doing:
14 cd ~
15 git clone https://github.com/martine/ninja.git -b v1.0.0
16 ./ninja/bootstrap.py
17Then add ~/ninja/ to your PATH.
18EOF
19}
20
[email protected]5f522232012-12-11 18:00:1521case "$OS" in
22 Linux)
23 MACHINE=$(getconf LONG_BIT)
24 case "$MACHINE" in
25 32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";;
26 *) echo Unknown architecture \($MACHINE\) -- unable to run ninja.
[email protected]a5957db2012-12-11 22:15:4027 print_help
[email protected]5f522232012-12-11 18:00:1528 exit 1;;
29 esac
30 ;;
31 Darwin) exec "${THIS_DIR}/ninja-mac" "$@";;
32 CYGWIN*) exec cmd.exe /c $(cygpath -t windows $0).exe "$@";;
33 MINGW32*) cmd.exe //c $0.exe "$@";;
34 *) echo "Unsupported OS ${OS}"
[email protected]a5957db2012-12-11 22:15:4035 print_help
[email protected]5f522232012-12-11 18:00:1536 exit 1;;
37esac