diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 60f65f623006..c38f860141fc 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -113,6 +113,7 @@ pub struct Target { #[derive(RustcDecodable, Default)] struct TomlConfig { build: Option, + install: Option, llvm: Option, rust: Option, target: Option>, @@ -135,6 +136,12 @@ struct Build { python: Option, } +/// TOML representation of various global install decisions. +#[derive(RustcDecodable, Default, Clone)] +struct Install { + prefix: Option, +} + /// TOML representation of how the LLVM build is configured. #[derive(RustcDecodable, Default)] struct Llvm { @@ -246,6 +253,10 @@ impl Config { set(&mut config.submodules, build.submodules); set(&mut config.vendor, build.vendor); + if let Some(ref install) = toml.install { + config.prefix = install.prefix.clone(); + } + if let Some(ref llvm) = toml.llvm { set(&mut config.ccache, llvm.ccache); set(&mut config.ninja, llvm.ninja); @@ -255,6 +266,7 @@ impl Config { set(&mut config.llvm_version_check, llvm.version_check); set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp); } + if let Some(ref rust) = toml.rust { set(&mut config.rust_debug_assertions, rust.debug_assertions); set(&mut config.rust_debuginfo, rust.debuginfo); diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index b6774b3af20a..4a08d66d8d9a 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -98,6 +98,14 @@ # Indicate whether the vendored sources are used for Rust dependencies or not #vendor = false +# ============================================================================= +# General install configuration options +# ============================================================================= +[install] + +# Instead of installing to /usr/local, install to this path instead. +#prefix = "/path/to/install" + # ============================================================================= # Options for compiling Rust code itself # =============================================================================