Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
Haiku: fix initial platform support
This commit is contained in:
commit
639000ea2e
|
@ -367,6 +367,9 @@ class RustBuild(object):
|
||||||
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
|
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
|
||||||
(os.pathsep + env["DYLD_LIBRARY_PATH"]) \
|
(os.pathsep + env["DYLD_LIBRARY_PATH"]) \
|
||||||
if "DYLD_LIBRARY_PATH" in env else ""
|
if "DYLD_LIBRARY_PATH" in env else ""
|
||||||
|
env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
|
||||||
|
(os.pathsep + env["LIBRARY_PATH"]) \
|
||||||
|
if "LIBRARY_PATH" in env else ""
|
||||||
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
|
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
|
||||||
os.pathsep + env["PATH"]
|
os.pathsep + env["PATH"]
|
||||||
if not os.path.isfile(self.cargo()):
|
if not os.path.isfile(self.cargo()):
|
||||||
|
|
|
@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str {
|
||||||
"PATH"
|
"PATH"
|
||||||
} else if cfg!(target_os = "macos") {
|
} else if cfg!(target_os = "macos") {
|
||||||
"DYLD_LIBRARY_PATH"
|
"DYLD_LIBRARY_PATH"
|
||||||
|
} else if cfg!(target_os = "haiku") {
|
||||||
|
"LIBRARY_PATH"
|
||||||
} else {
|
} else {
|
||||||
"LD_LIBRARY_PATH"
|
"LD_LIBRARY_PATH"
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,8 @@ impl DynamicLibrary {
|
||||||
"PATH"
|
"PATH"
|
||||||
} else if cfg!(target_os = "macos") {
|
} else if cfg!(target_os = "macos") {
|
||||||
"DYLD_LIBRARY_PATH"
|
"DYLD_LIBRARY_PATH"
|
||||||
|
} else if cfg!(target_os = "haiku") {
|
||||||
|
"LIBRARY_PATH"
|
||||||
} else {
|
} else {
|
||||||
"LD_LIBRARY_PATH"
|
"LD_LIBRARY_PATH"
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,10 @@ pub fn opts() -> TargetOptions {
|
||||||
linker: "cc".to_string(),
|
linker: "cc".to_string(),
|
||||||
dynamic_linking: true,
|
dynamic_linking: true,
|
||||||
executables: true,
|
executables: true,
|
||||||
has_rpath: true,
|
has_rpath: false,
|
||||||
target_family: Some("unix".to_string()),
|
target_family: Some("unix".to_string()),
|
||||||
linker_is_gnu: true,
|
linker_is_gnu: true,
|
||||||
|
no_integrated_as: true,
|
||||||
.. Default::default()
|
.. Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,7 @@ mod imp {
|
||||||
pub l_sysid: libc::c_int,
|
pub l_sysid: libc::c_int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const F_RDLCK: libc::c_short = 0x0040;
|
||||||
pub const F_UNLCK: libc::c_short = 0x0200;
|
pub const F_UNLCK: libc::c_short = 0x0200;
|
||||||
pub const F_WRLCK: libc::c_short = 0x0400;
|
pub const F_WRLCK: libc::c_short = 0x0400;
|
||||||
pub const F_SETLK: libc::c_int = 0x0080;
|
pub const F_SETLK: libc::c_int = 0x0080;
|
||||||
|
|
|
@ -39,5 +39,7 @@ fn main() {
|
||||||
println!("cargo:rustc-link-lib=static-nobundle=pthread");
|
println!("cargo:rustc-link-lib=static-nobundle=pthread");
|
||||||
} else if target.contains("fuchsia") {
|
} else if target.contains("fuchsia") {
|
||||||
println!("cargo:rustc-link-lib=unwind");
|
println!("cargo:rustc-link-lib=unwind");
|
||||||
|
} else if target.contains("haiku") {
|
||||||
|
println!("cargo:rustc-link-lib=gcc_s");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str {
|
||||||
"PATH"
|
"PATH"
|
||||||
} else if cfg!(target_os = "macos") {
|
} else if cfg!(target_os = "macos") {
|
||||||
"DYLD_LIBRARY_PATH"
|
"DYLD_LIBRARY_PATH"
|
||||||
|
} else if cfg!(target_os = "haiku") {
|
||||||
|
"LIBRARY_PATH"
|
||||||
} else {
|
} else {
|
||||||
"LD_LIBRARY_PATH"
|
"LD_LIBRARY_PATH"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue