Colin Cross | e441b9d | 2015-01-26 16:30:13 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | export BOOTSTRAP="${BASH_SOURCE[0]}" |
| 4 | export SRCDIR=$(dirname "${BASH_SOURCE[0]}") |
| 5 | export BOOTSTRAP_MANIFEST="${SRCDIR}/build/soong/build.ninja.in" |
| 6 | |
| 7 | case $(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;; |
| 17 | esac |
| 18 | export GOROOT="${SRCDIR}/prebuilts/go/$PREBUILTOS/" |
| 19 | export GOARCH="amd64" |
| 20 | export GOCHAR="6" |
| 21 | |
| 22 | if [[ $(find . -maxdepth 1 -name $(basename "${BOOTSTRAP}")) ]]; then |
| 23 | echo "FAILED: Tried to run "$(basename "${BOOTSTRAP}")" from "$(pwd)"" |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
| 27 | if [[ $# -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 |
| 32 | fi |
| 33 | |
| 34 | ${SRCDIR}/build/blueprint/bootstrap.bash "$@" |