blob: 0aa073cc4f34d30ed15d2606f39825b759d22a63 [file] [log] [blame]
Colin Crosse441b9d2015-01-26 16:30:13 -08001#!/bin/bash
2
3export BOOTSTRAP="${BASH_SOURCE[0]}"
4export SRCDIR=$(dirname "${BASH_SOURCE[0]}")
5export BOOTSTRAP_MANIFEST="${SRCDIR}/build/soong/build.ninja.in"
6
7case $(uname) in
8 Linux)
9 export GOOS="linux"
10 export PREBUILTOS="linux-x86"
11 ;;
12 Darwin)
13 export GOOS="darwin"
14 export PREBUILTOS="darwin-x86"
15 ;;
16 *) echo "unknown OS:" $(uname) && exit 1;;
17esac
18export GOROOT="${SRCDIR}/prebuilts/go/$PREBUILTOS/"
19export GOARCH="amd64"
20export GOCHAR="6"
21
22if [[ $(find . -maxdepth 1 -name $(basename "${BOOTSTRAP}")) ]]; then
23 echo "FAILED: Tried to run "$(basename "${BOOTSTRAP}")" from "$(pwd)""
24 exit 1
25fi
26
27if [[ $# -eq 0 ]]; then
28 sed -e "s|@@SrcDir@@|${SRCDIR}|" \
29 -e "s|@@PrebuiltOS@@|${PREBUILTOS}|" \
30 ${SRCDIR}/build/soong/soong.in > soong
31 chmod 0770 soong
32fi
33
34${SRCDIR}/build/blueprint/bootstrap.bash "$@"