summaryrefslogtreecommitdiffstats
path: root/third_party/rust/libloading-0.5.2/build.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/libloading-0.5.2/build.rs
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/libloading-0.5.2/build.rs')
-rw-r--r--third_party/rust/libloading-0.5.2/build.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/third_party/rust/libloading-0.5.2/build.rs b/third_party/rust/libloading-0.5.2/build.rs
new file mode 100644
index 0000000000..fc380a7450
--- /dev/null
+++ b/third_party/rust/libloading-0.5.2/build.rs
@@ -0,0 +1,32 @@
+extern crate cc;
+
+use std::io::Write;
+use std::env;
+
+fn main(){
+ let target_os = env::var("CARGO_CFG_TARGET_OS");
+ let is_unix = env::var_os("CARGO_CFG_UNIX").is_some();
+ match target_os.as_ref().map(|x| &**x) {
+ Ok("linux") | Ok("android") => println!("cargo:rustc-link-lib=dl"),
+ Ok("freebsd") | Ok("dragonfly") => println!("cargo:rustc-link-lib=c"),
+ // netbsd claims dl* will be available to any dynamically linked binary, but I haven’t
+ // found any libraries that have to be linked to on other platforms.
+ // What happens if the executable is not linked up dynamically?
+ Ok("openbsd") | Ok("bitrig") | Ok("netbsd") | Ok("macos") | Ok("ios") => {}
+ Ok("solaris") => {}
+ Ok("haiku") => {}
+ // dependencies come with winapi
+ Ok("windows") => {}
+ tos => {
+ writeln!(::std::io::stderr(),
+ "Building for an unknown target_os=`{:?}`!\nPlease report an issue ",
+ tos).expect("could not report the error");
+ ::std::process::exit(0xfc);
+ }
+ }
+ if is_unix {
+ cc::Build::new()
+ .file("src/os/unix/global_static.c")
+ .compile("global_static");
+ }
+}