Skip to content

Commit

Permalink
rustbuild: allow configuring bindir
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-Antoine Perennou <[email protected]>
  • Loading branch information
Keruspe committed May 16, 2017
1 parent ae33d99 commit b310a25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub struct Config {
pub musl_root: Option<PathBuf>,
pub prefix: Option<PathBuf>,
pub docdir: Option<PathBuf>,
pub bindir: Option<PathBuf>,
pub libdir: Option<PathBuf>,
pub libdir_relative: Option<PathBuf>,
pub mandir: Option<PathBuf>,
Expand Down Expand Up @@ -165,9 +166,10 @@ struct Build {
#[derive(RustcDecodable, Default, Clone)]
struct Install {
prefix: Option<String>,
mandir: Option<String>,
docdir: Option<String>,
bindir: Option<String>,
libdir: Option<String>,
mandir: Option<String>,
}

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

if let Some(ref install) = toml.install {
config.prefix = install.prefix.clone().map(PathBuf::from);
config.mandir = install.mandir.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);
config.mandir = install.mandir.clone().map(PathBuf::from);
}

if let Some(ref llvm) = toml.llvm {
Expand Down Expand Up @@ -526,6 +529,9 @@ impl Config {
"CFG_DOCDIR" => {
self.docdir = Some(PathBuf::from(value));
}
"CFG_BINDIR" => {
self.bindir = Some(PathBuf::from(value));
}
"CFG_LIBDIR" => {
self.libdir = Some(PathBuf::from(value));
}
Expand Down
9 changes: 6 additions & 3 deletions src/bootstrap/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,18 @@
# Instead of installing to /usr/local, install to this path instead.
#prefix = "/usr/local"

# Where to install documentation in `prefix` above
#docdir = "share/doc/rust"

# Where to install binaries in `prefix` above
#bindir = "bin"

# Where to install libraries in `prefix` above
#libdir = "lib"

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

# Where to install documentation in `prefix` above
#docdir = "share/doc/rust"

# =============================================================================
# Options for compiling Rust code itself
# =============================================================================
Expand Down

0 comments on commit b310a25

Please sign in to comment.