compiler-builtins-zynq/ci/install.sh

54 lines
919 B
Bash
Raw Normal View History

2016-08-08 05:55:30 +08:00
set -ex
. $(dirname $0)/env.sh
2016-08-09 09:37:04 +08:00
install_qemu() {
2016-08-30 08:31:49 +08:00
if [[ $QEMU_LD_PREFIX ]]; then
apt-get update
apt-get install -y --no-install-recommends \
binfmt-support qemu-user-static
fi
}
install_gist() {
if [[ $OSX ]]; then
gem install gist -v 4.5.0
fi
2016-08-09 09:37:04 +08:00
}
2016-08-08 06:32:53 +08:00
install_binutils() {
2016-08-30 08:31:49 +08:00
if [[ $OSX ]]; then
brew install binutils
fi
2016-08-08 06:23:30 +08:00
}
2016-08-08 06:03:44 +08:00
install_rust() {
2016-08-30 08:31:49 +08:00
if [[ $OSX ]]; then
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=nightly
else
rustup default nightly
fi
2016-08-08 06:03:44 +08:00
2016-08-28 01:34:39 +08:00
rustup -V
2016-08-08 06:03:44 +08:00
rustc -V
cargo -V
}
2016-08-08 05:55:30 +08:00
2016-08-08 06:03:44 +08:00
add_rustup_target() {
2016-08-30 08:31:49 +08:00
if [[ $TARGET != $HOST && $CARGO == cargo ]]; then
2016-08-08 06:03:44 +08:00
rustup target add $TARGET
fi
2016-08-08 05:55:30 +08:00
}
main() {
2016-08-30 08:31:49 +08:00
if [[ $OSX || ${IN_DOCKER_CONTAINER:-n} == y ]]; then
2016-08-09 09:37:04 +08:00
install_qemu
install_gist
2016-08-09 09:37:04 +08:00
install_binutils
install_rust
add_rustup_target
fi
2016-08-08 05:55:30 +08:00
}
main