about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2017-04-28 11:03:58 +0200
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2017-05-16 08:21:27 +0200
commite8a74c32a429b1745b7abaa132c1bdbe5f6c656a (patch)
tree61f32871a57caa02b2e6b57702d93f89395d9e50 /src/bootstrap
parent93f3b0c9139926c6acf0b2d63ab8d39f45c90089 (diff)
downloadrust-e8a74c32a429b1745b7abaa132c1bdbe5f6c656a.tar.gz
rust-e8a74c32a429b1745b7abaa132c1bdbe5f6c656a.zip
rustbuild: allow configuring sysconfdir
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/config.rs6
-rw-r--r--src/bootstrap/config.toml.example4
2 files changed, 10 insertions, 0 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 28ff14ab30f..0fb597564e3 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -99,6 +99,7 @@ pub struct Config {
     // Fallback musl-root for all targets
     pub musl_root: Option<PathBuf>,
     pub prefix: Option<PathBuf>,
+    pub sysconfdir: Option<PathBuf>,
     pub docdir: Option<PathBuf>,
     pub bindir: Option<PathBuf>,
     pub libdir: Option<PathBuf>,
@@ -166,6 +167,7 @@ struct Build {
 #[derive(RustcDecodable, Default, Clone)]
 struct Install {
     prefix: Option<String>,
+    sysconfdir: Option<String>,
     docdir: Option<String>,
     bindir: Option<String>,
     libdir: Option<String>,
@@ -317,6 +319,7 @@ impl Config {
 
         if let Some(ref install) = toml.install {
             config.prefix = install.prefix.clone().map(PathBuf::from);
+            config.sysconfdir = install.sysconfdir.clone().map(PathBuf::from);
             config.docdir = install.docdir.clone().map(PathBuf::from);
             config.bindir = install.bindir.clone().map(PathBuf::from);
             config.libdir = install.libdir.clone().map(PathBuf::from);
@@ -526,6 +529,9 @@ impl Config {
                 "CFG_PREFIX" => {
                     self.prefix = Some(PathBuf::from(value));
                 }
+                "CFG_SYSCONFDIR" => {
+                    self.sysconfdir = Some(PathBuf::from(value));
+                }
                 "CFG_DOCDIR" => {
                     self.docdir = Some(PathBuf::from(value));
                 }
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index 57cafbaf280..df180be4e27 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -160,6 +160,10 @@
 # Instead of installing to /usr/local, install to this path instead.
 #prefix = "/usr/local"
 
+# Where to install system configuration files
+# If this is a relative path, it will get installed in `prefix` above
+#sysconfdir = "/etc"
+
 # Where to install documentation in `prefix` above
 #docdir = "share/doc/rust"