Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Dec 30, 2024
1 parent 8dc7fdd commit 05be286
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions src/bootstrap/src/core/build_steps/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,42 @@ impl Step for Gcc {
return true;
}

command(root.join("contrib/download_prerequisites")).current_dir(&root).run(builder);
command(root.join("configure"))
let deps_dir = out_dir.join("deps");
t!(fs::create_dir_all(&deps_dir));

// Download dependencies into the build directory, to avoid modifying the source dir
// The configure script should automatically find them in the build directory
command(root.join("contrib/download_prerequisites"))
.current_dir(&root)
.arg("--directory")
.arg(deps_dir)
.run(builder);

let mut configure_cmd = command(root.join("configure"));
configure_cmd
.current_dir(&out_dir)
.arg("--enable-host-shared")
.arg("--enable-languages=jit")
.arg("--enable-checking=release")
.arg("--disable-bootstrap")
.arg("--disable-multilib")
.arg(format!("--prefix={}", install_dir.display()))
.run(builder);
.arg(format!("--prefix={}", install_dir.display()));
let mut cc = builder.build.cc(target).display().to_string();
if let Some(ref ccache) = builder.build.config.ccache {
cc = format!("{ccache} {cc}");
}
configure_cmd.env("CC", cc);

if let Ok(ref cxx) = builder.build.cxx(target) {
let mut cxx = cxx.display().to_string();
if let Some(ref ccache) = builder.build.config.ccache {
cxx = format!("{ccache} {cxx}");
}
configure_cmd.env("CXX", cxx);
}

configure_cmd.run(builder);

command("make").current_dir(&out_dir).arg(format!("-j{}", builder.jobs())).run(builder);
command("make").current_dir(&out_dir).arg("install").run(builder);

Expand Down

0 comments on commit 05be286

Please sign in to comment.