about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeremy Soller <jackpot51@gmail.com>2016-12-19 15:49:57 -0700
committerJeremy Soller <jackpot51@gmail.com>2016-12-19 15:49:57 -0700
commit0a014c684140c8df32aea55801f006a1b8aa973c (patch)
tree698604640d87789e85b5183d0beb30f2587bb54b
parent58b94bd3a84600047f6a994b55b51bb2baf143d9 (diff)
downloadrust-0a014c684140c8df32aea55801f006a1b8aa973c.tar.gz
rust-0a014c684140c8df32aea55801f006a1b8aa973c.zip
Move prefix to [install] section
-rw-r--r--src/bootstrap/config.rs14
-rw-r--r--src/bootstrap/config.toml.example11
2 files changed, 20 insertions, 5 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index beb62ef2074..94255527405 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<Build>,
+    install: Option<Install>,
     llvm: Option<Llvm>,
     rust: Option<Rust>,
     target: Option<HashMap<String, TomlTarget>>,
@@ -126,7 +127,6 @@ struct Build {
     target: Vec<String>,
     cargo: Option<String>,
     rustc: Option<String>,
-    prefix: Option<String>,
     compiler_docs: Option<bool>,
     docs: Option<bool>,
     submodules: Option<bool>,
@@ -136,6 +136,12 @@ struct Build {
     python: Option<String>,
 }
 
+/// TOML representation of various global install decisions.
+#[derive(RustcDecodable, Default, Clone)]
+struct Install {
+    prefix: Option<String>,
+}
+
 /// TOML representation of how the LLVM build is configured.
 #[derive(RustcDecodable, Default)]
 struct Llvm {
@@ -239,7 +245,6 @@ impl Config {
         }
         config.rustc = build.rustc.map(PathBuf::from);
         config.cargo = build.cargo.map(PathBuf::from);
-        config.prefix = build.prefix;
         config.nodejs = build.nodejs.map(PathBuf::from);
         config.gdb = build.gdb.map(PathBuf::from);
         config.python = build.python.map(PathBuf::from);
@@ -248,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);
@@ -257,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 76fcfebdb94..4a08d66d8d9 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -70,9 +70,6 @@
 # specified, use this rustc binary instead as the stage0 snapshot compiler.
 #rustc = "/path/to/bin/rustc"
 
-# Instead of installing to /usr/local, install to this path instead.
-#prefix = "/path/to/install"
-
 # Flag to specify whether any documentation is built. If false, rustdoc and
 # friends will still be compiled but they will not be used to generate any
 # documentation.
@@ -102,6 +99,14 @@
 #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
 # =============================================================================
 [rust]