rustbuild: allow configuring bindir

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
Marc-Antoine Perennou 2017-04-28 11:01:15 +02:00
parent ae33d99bcd
commit b310a259f8
2 changed files with 14 additions and 5 deletions

View File

@ -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>,
@ -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.
@ -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 {
@ -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));
}

View File

@ -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
# =============================================================================