Skip to content

Commit

Permalink
Add support for AIX (#2030)
Browse files Browse the repository at this point in the history
* Add support for AIX

* Add sysconfig on AIX
  • Loading branch information
bzEq authored Apr 9, 2024
1 parent 9b50390 commit 90f8f22
Show file tree
Hide file tree
Showing 2 changed files with 729 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub enum Os {
Haiku,
Emscripten,
Wasi,
Aix,
}

impl fmt::Display for Os {
Expand All @@ -47,6 +48,7 @@ impl fmt::Display for Os {
Os::Haiku => write!(f, "Haiku"),
Os::Emscripten => write!(f, "Emscripten"),
Os::Wasi => write!(f, "Wasi"),
Os::Aix => write!(f, "AIX"),
}
}
}
Expand Down Expand Up @@ -184,6 +186,7 @@ fn get_supported_architectures(os: &Os) -> Vec<Arch> {
Os::Haiku => vec![Arch::X86_64],
Os::Solaris => vec![Arch::X86_64, Arch::Sparc64],
Os::Emscripten | Os::Wasi => vec![Arch::Wasm32],
Os::Aix => vec![Arch::Powerpc64],
}
}

Expand Down Expand Up @@ -244,6 +247,7 @@ impl Target {
OperatingSystem::Haiku => Os::Haiku,
OperatingSystem::Emscripten => Os::Emscripten,
OperatingSystem::Wasi => Os::Wasi,
OperatingSystem::Aix => Os::Aix,
unsupported => bail!("The operating system {:?} is not supported", unsupported),
};

Expand Down Expand Up @@ -375,6 +379,7 @@ impl Target {
Os::Emscripten => "emscripten",
// This isn't real, there's no sys.platform here
Os::Wasi => "wasi",
Os::Aix => "aix",
}
}

Expand Down Expand Up @@ -457,7 +462,8 @@ impl Target {
| Os::Illumos
| Os::Haiku
| Os::Emscripten
| Os::Wasi => true,
| Os::Wasi
| Os::Aix => true,
}
}

Expand Down
Loading

0 comments on commit 90f8f22

Please sign in to comment.