Fix ninja wrapper script on non-x86 linux.

The script would previously attempt to run
the x86_32 version of ninja on 32-bit arches
such as mips and arm rather than display the
error message.

This error showed up an ARM builder:
/mnt/data/b/depot_tools/ninja: line 25: /mnt/data/b/depot_tools/ninja-linux32: cannot execute binary file

Review URL: https://codereview.chromium.org/26490004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@227549 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
sbc@chromium.org 12 years ago
parent 4fa02461be
commit a9f824da03

16
ninja

@ -20,12 +20,18 @@ EOF
case "$OS" in case "$OS" in
Linux) Linux)
MACHINE=$(getconf LONG_BIT) MACHINE=$(uname -m)
case "$MACHINE" in case "$MACHINE" in
32|64) exec "${THIS_DIR}/ninja-linux${MACHINE}" "$@";; i?86|x86_64)
*) echo Unknown architecture \($MACHINE\) -- unable to run ninja. LONG_BIT=$(getconf LONG_BIT)
print_help # We know we are on x86 but we need to use getconf to determine
exit 1;; # bittage of the userspace install (e.g. when runing 32-bit userspace
# on x86_64 kernel)
exec "${THIS_DIR}/ninja-linux${LONG_BIT}" "$@";;
*)
echo Unknown architecture \($MACHINE\) -- unable to run ninja.
print_help
exit 1;;
esac esac
;; ;;
Darwin) exec "${THIS_DIR}/ninja-mac" "$@";; Darwin) exec "${THIS_DIR}/ninja-mac" "$@";;

Loading…
Cancel
Save