Improve platform and CPU detection, use the correct protoc binary for the running system.
Tested on OS X 10.10, Debian 8.1 (x86_64) and Debian 8.1 (i686).
--
MOS_MIGRATED_REVID=95819163
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 2a64d8c..d59370d 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,6 +25,12 @@
BAZELRC=${BAZELRC:-"/dev/null"}
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
+MACHINE_TYPE="$(uname -m)"
+MACHINE_IS_64BIT='no'
+if [ "${MACHINE_TYPE}" = 'amd64' -o "${MACHINE_TYPE}" = 'x86_64' ]; then
+ MACHINE_IS_64BIT='yes'
+fi
+
ATEXIT_=""
function atexit() {
ATEXIT_="$1; ${ATEXIT_}"