compiler-builtins-zynq/ci/install.sh

72 lines
1.2 KiB
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() {
case $TARGET in
powerpc64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
qemu-user
;;
esac
}
2016-08-08 06:32:53 +08:00
install_binutils() {
case $TRAVIS_OS_NAME in
osx)
brew install binutils
2016-08-08 06:03:44 +08:00
;;
*)
;;
esac
2016-08-08 05:55:30 +08:00
}
2016-08-08 06:32:53 +08:00
install_c_toolchain() {
case $TARGET in
aarch64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
2016-08-08 06:23:30 +08:00
;;
*)
;;
esac
}
2016-08-08 06:03:44 +08:00
install_rust() {
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=nightly
rustc -V
cargo -V
}
2016-08-08 05:55:30 +08:00
2016-08-08 06:03:44 +08:00
add_rustup_target() {
if [[ $TARGET != $HOST ]]; then
rustup target add $TARGET
fi
2016-08-08 05:55:30 +08:00
}
2016-08-08 06:03:44 +08:00
configure_cargo() {
if [[ $PREFIX ]]; then
${PREFIX}gcc -v
mkdir -p .cargo
cat >>.cargo/config <<EOF
[target.$TARGET]
linker = "${PREFIX}gcc"
EOF
fi
2016-08-08 05:55:30 +08:00
}
main() {
2016-08-09 09:37:04 +08:00
if [[ -z $DOCKER ]]; then
install_qemu
install_binutils
install_c_toolchain
install_rust
add_rustup_target
configure_cargo
fi
2016-08-08 05:55:30 +08:00
}
main