Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bootstrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ path = "lib.rs"

[[bin]]
name = "bootstrap"
path = "main.rs"
path = "bin/main.rs"

[[bin]]
name = "rustc"
path = "rustc.rs"
path = "bin/rustc.rs"

[[bin]]
name = "rustdoc"
path = "rustdoc.rs"
path = "bin/rustdoc.rs"

[dependencies]
build_helper = { path = "../build_helper" }
Expand Down
14 changes: 1 addition & 13 deletions src/bootstrap/main.rs → src/bootstrap/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,10 @@
#![deny(warnings)]

extern crate bootstrap;
extern crate build_helper;
extern crate cmake;
extern crate filetime;
extern crate gcc;
extern crate getopts;
extern crate libc;
extern crate num_cpus;
extern crate rustc_serialize;
extern crate toml;
extern crate md5;

use std::env;

use build::{Flags, Config, Build};

mod build;
use bootstrap::{Flags, Config, Build};

fn main() {
let args = env::args().skip(1).collect::<Vec<_>>();
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/rustc.rs → src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ fn main() {

let rustc = env::var_os(rustc).unwrap();
let libdir = env::var_os(libdir).unwrap();
let mut dylib_path = bootstrap::dylib_path();
let mut dylib_path = bootstrap::util::dylib_path();
dylib_path.insert(0, PathBuf::from(libdir));

let mut cmd = Command::new(rustc);
cmd.args(&args)
.arg("--cfg").arg(format!("stage{}", stage))
.env(bootstrap::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
.env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap());

if let Some(target) = target {
// The stage0 compiler has a special sysroot distinct from what we
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/rustdoc.rs → src/bootstrap/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ fn main() {
let rustdoc = env::var_os("RUSTDOC_REAL").unwrap();
let libdir = env::var_os("RUSTC_LIBDIR").unwrap();

let mut dylib_path = bootstrap::dylib_path();
let mut dylib_path = bootstrap::util::dylib_path();
dylib_path.insert(0, PathBuf::from(libdir));

let mut cmd = Command::new(rustdoc);
cmd.args(&args)
.arg("--cfg").arg(format!("stage{}", env::var("RUSTC_STAGE").unwrap()))
.arg("--cfg").arg("dox")
.env(bootstrap::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
.env(bootstrap::util::dylib_path_var(),
env::join_paths(&dylib_path).unwrap());
std::process::exit(match cmd.status() {
Ok(s) => s.code().unwrap_or(1),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
Expand Down
Loading