Skip to content

Commit b310a25

Browse files
committed
rustbuild: allow configuring bindir
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
1 parent ae33d99 commit b310a25

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/bootstrap/config.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub struct Config {
100100
pub musl_root: Option<PathBuf>,
101101
pub prefix: Option<PathBuf>,
102102
pub docdir: Option<PathBuf>,
103+
pub bindir: Option<PathBuf>,
103104
pub libdir: Option<PathBuf>,
104105
pub libdir_relative: Option<PathBuf>,
105106
pub mandir: Option<PathBuf>,
@@ -165,9 +166,10 @@ struct Build {
165166
#[derive(RustcDecodable, Default, Clone)]
166167
struct Install {
167168
prefix: Option<String>,
168-
mandir: Option<String>,
169169
docdir: Option<String>,
170+
bindir: Option<String>,
170171
libdir: Option<String>,
172+
mandir: Option<String>,
171173
}
172174

173175
/// TOML representation of how the LLVM build is configured.
@@ -315,9 +317,10 @@ impl Config {
315317

316318
if let Some(ref install) = toml.install {
317319
config.prefix = install.prefix.clone().map(PathBuf::from);
318-
config.mandir = install.mandir.clone().map(PathBuf::from);
319320
config.docdir = install.docdir.clone().map(PathBuf::from);
321+
config.bindir = install.bindir.clone().map(PathBuf::from);
320322
config.libdir = install.libdir.clone().map(PathBuf::from);
323+
config.mandir = install.mandir.clone().map(PathBuf::from);
321324
}
322325

323326
if let Some(ref llvm) = toml.llvm {
@@ -526,6 +529,9 @@ impl Config {
526529
"CFG_DOCDIR" => {
527530
self.docdir = Some(PathBuf::from(value));
528531
}
532+
"CFG_BINDIR" => {
533+
self.bindir = Some(PathBuf::from(value));
534+
}
529535
"CFG_LIBDIR" => {
530536
self.libdir = Some(PathBuf::from(value));
531537
}

src/bootstrap/config.toml.example

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,18 @@
160160
# Instead of installing to /usr/local, install to this path instead.
161161
#prefix = "/usr/local"
162162

163+
# Where to install documentation in `prefix` above
164+
#docdir = "share/doc/rust"
165+
166+
# Where to install binaries in `prefix` above
167+
#bindir = "bin"
168+
163169
# Where to install libraries in `prefix` above
164170
#libdir = "lib"
165171

166172
# Where to install man pages in `prefix` above
167173
#mandir = "share/man"
168174

169-
# Where to install documentation in `prefix` above
170-
#docdir = "share/doc/rust"
171-
172175
# =============================================================================
173176
# Options for compiling Rust code itself
174177
# =============================================================================

0 commit comments

Comments
 (0)