Add lib32 companion build pipeline
This commit is contained in:
@@ -40,7 +40,10 @@ pub fn build(
|
||||
}
|
||||
|
||||
use crate::builder::state::{BuildStep, StateTracker};
|
||||
let mut state = StateTracker::new(&actual_src)?;
|
||||
let mut state = StateTracker::new_with_namespace(
|
||||
&actual_src,
|
||||
spec.build.flags.lib32_variant.then_some("lib32"),
|
||||
)?;
|
||||
|
||||
// Run configure
|
||||
let build_dir = if let Some(dir) = &flags.build_dir {
|
||||
@@ -78,7 +81,14 @@ pub fn build(
|
||||
Some(flags.chost.clone())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
}
|
||||
.map(|host| {
|
||||
if flags.lib32_variant {
|
||||
lib32_host_triple(&host)
|
||||
} else {
|
||||
host
|
||||
}
|
||||
});
|
||||
|
||||
let requested_build = if cross.is_some() {
|
||||
CrossConfig::build_triple().ok()
|
||||
@@ -104,6 +114,15 @@ pub fn build(
|
||||
}
|
||||
}
|
||||
|
||||
if flags.lib32_variant {
|
||||
if !has_configure_option_prefix(&flags.configure, "--libdir") {
|
||||
configure_cmd.arg("--libdir=/usr/lib32");
|
||||
}
|
||||
if !has_configure_option_prefix(&flags.configure, "--libexecdir") {
|
||||
configure_cmd.arg("--libexecdir=/usr/lib32");
|
||||
}
|
||||
}
|
||||
|
||||
for arg in &flags.configure {
|
||||
let expanded = expand_configure_arg(spec, arg, &env_vars);
|
||||
configure_cmd.arg(expanded);
|
||||
@@ -412,6 +431,18 @@ fn configure_supports_option(help_text: Option<&str>, option: &str, configure_fi
|
||||
.unwrap_or(configure_file.trim().is_empty())
|
||||
}
|
||||
|
||||
fn has_configure_option_prefix(args: &[String], option: &str) -> bool {
|
||||
let with_eq = format!("{option}=");
|
||||
args.iter().any(|arg| {
|
||||
let trimmed = arg.trim();
|
||||
trimmed == option || trimmed.starts_with(&with_eq)
|
||||
})
|
||||
}
|
||||
|
||||
fn lib32_host_triple(host: &str) -> String {
|
||||
host.replace("x86_64", "i686")
|
||||
}
|
||||
|
||||
fn find_autotools_test_target(build_dir: &Path) -> Result<Option<&'static str>> {
|
||||
for target in ["check", "test"] {
|
||||
if makefile_has_target(build_dir, target)? {
|
||||
|
||||
Reference in New Issue
Block a user