Scripts for bootstrapping various programming languages
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
version_rustc_bootstrap="$1"
|
|
|
|
version_rustc="$2"
|
|
|
|
version_llvm="$3"
|
|
|
|
|
|
|
|
dir_download="$PWD/download"
|
|
|
|
mkdir -p build; cd build
|
|
|
|
dir_install="$PWD/install-rustc-$version_rustc"
|
|
|
|
|
|
|
|
# Prepare source
|
|
|
|
tar xf "$dir_download/rustc-$version_rustc-src.tar.xz"
|
|
|
|
cd "rustc-$version_rustc-src"
|
|
|
|
|
|
|
|
# Configure source
|
|
|
|
./configure \
|
|
|
|
--prefix="$dir_install" \
|
|
|
|
--sysconfdir="$dir_install/etc" \
|
|
|
|
--local-rust-root="$PWD/../install-rustc-$version_rustc_bootstrap" \
|
|
|
|
--llvm-root="$PWD/../install-llvm-$version_llvm" \
|
|
|
|
--enable-vendor
|
|
|
|
# --enable-llvm-link-shared
|
|
|
|
|
|
|
|
case "$version_rustc" in
|
|
|
|
1.3[0-9].*|1.4[0-6].*)
|
|
|
|
paths='src/libstd src/librustc cargo' ;;
|
|
|
|
1.47.*|*)
|
|
|
|
paths='library/std src/librustc cargo' ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# ./x.py install --stage 1 compiler/rustc library/std
|
|
|
|
# ./x.py install --stage 0 cargo
|
|
|
|
|
|
|
|
# Build and install
|
|
|
|
mkdir -p "$dir_install"
|
|
|
|
./x.py install $MAKEFLAGS --stage 2 $paths
|