2015-01-27 01:30:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export BOOTSTRAP="${BASH_SOURCE[0]}"
|
|
|
|
export SRCDIR=$(dirname "${BASH_SOURCE[0]}")
|
2015-06-11 01:59:11 +02:00
|
|
|
export TOPNAME="Android.bp"
|
2015-01-27 01:30:13 +01:00
|
|
|
export BOOTSTRAP_MANIFEST="${SRCDIR}/build/soong/build.ninja.in"
|
2015-06-24 04:46:20 +02:00
|
|
|
export RUN_TESTS="-t"
|
2015-01-27 01:30:13 +01:00
|
|
|
|
|
|
|
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}|" \
|
2015-04-11 00:45:15 +02:00
|
|
|
"${SRCDIR}/build/soong/soong.bootstrap.in" > .soong.bootstrap
|
|
|
|
ln -sf "${SRCDIR}/build/soong/soong.bash" soong
|
2015-01-27 01:30:13 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-11 00:45:15 +02:00
|
|
|
"${SRCDIR}/build/blueprint/bootstrap.bash" "$@"
|