#!/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 case "$version_rustc" 1.3[0-9].*|1.4[0-6].*) paths='src/libstd src/librustc cargo' ;; 1.47.*|*) paths='library/std src/librustc cargo' ;; esac # Build and install mkdir -p "$dir_install" ./x.py install $MAKEFLAGS --stage 2 $paths