diff options
author | Colin Cross <ccross@android.com> | 2015-01-26 16:30:13 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2015-03-04 16:13:27 -0800 |
commit | e441b9df9a68595d0dd7b8ed184aecb27c86054b (patch) | |
tree | e625df0fbd1dde9000c7da039b4242899acf249f /bootstrap.bash | |
parent | 8a051b802fa5e9ffa350cd732663849f44502c76 (diff) | |
download | build_soong-e441b9df9a68595d0dd7b8ed184aecb27c86054b.tar.gz build_soong-e441b9df9a68595d0dd7b8ed184aecb27c86054b.tar.bz2 build_soong-e441b9df9a68595d0dd7b8ed184aecb27c86054b.zip |
Initial soong
This creates the infrastructure that will be used to bootstrap the
soong primary builder through blueprint and ninja.
Change-Id: Iebed8f369e4db41b207d0b2a48a7a54a4dd7d45d
Diffstat (limited to 'bootstrap.bash')
-rwxr-xr-x | bootstrap.bash | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/bootstrap.bash b/bootstrap.bash new file mode 100755 index 00000000..0aa073cc --- /dev/null +++ b/bootstrap.bash @@ -0,0 +1,34 @@ +#!/bin/bash + +export BOOTSTRAP="${BASH_SOURCE[0]}" +export SRCDIR=$(dirname "${BASH_SOURCE[0]}") +export BOOTSTRAP_MANIFEST="${SRCDIR}/build/soong/build.ninja.in" + +case $(uname) in + Linux) + export GOOS="linux" + export PREBUILTOS="linux-x86" + ;; + Darwin) + export GOOS="darwin" + export PREBUILTOS="darwin-x86" + ;; + *) echo "unknown OS:" $(uname) && exit 1;; +esac +export GOROOT="${SRCDIR}/prebuilts/go/$PREBUILTOS/" +export GOARCH="amd64" +export GOCHAR="6" + +if [[ $(find . -maxdepth 1 -name $(basename "${BOOTSTRAP}")) ]]; then + echo "FAILED: Tried to run "$(basename "${BOOTSTRAP}")" from "$(pwd)"" + exit 1 +fi + +if [[ $# -eq 0 ]]; then + sed -e "s|@@SrcDir@@|${SRCDIR}|" \ + -e "s|@@PrebuiltOS@@|${PREBUILTOS}|" \ + ${SRCDIR}/build/soong/soong.in > soong + chmod 0770 soong +fi + +${SRCDIR}/build/blueprint/bootstrap.bash "$@" |