]>
git.proxmox.com Git - rustc.git/blob - vendor/libloading/build.rs
4 fn dlerror_is_mtsafe(target_os
: &str) {
16 println
!("cargo:rustc-cfg=mtsafe_dlerror");
18 // Confirmed not MT-safe:
29 fn link_libraries(target_os
: &str) {
31 "linux" | "android" => println
!("cargo:rustc-link-lib=dl"),
32 "freebsd" | "dragonfly" => println
!("cargo:rustc-link-lib=c"),
33 // netbsd claims dl* will be available to any dynamically linked binary, but I haven’t
34 // found any libraries that have to be linked to on other platforms.
35 // What happens if the executable is not linked up dynamically?
36 "openbsd" | "bitrig" | "netbsd" | "macos" | "ios" => {}
37 "solaris" | "illumos" => {}
41 // dependencies come with winapi
44 writeln
!(::std
::io
::stderr(),
45 "Building for an unknown target_os=`{:?}`!\nPlease report an issue ",
46 tos
).expect("could not report the error");
47 ::std
::process
::exit(0xfc);
53 match env
::var("CARGO_CFG_TARGET_OS") {
55 dlerror_is_mtsafe(&target_os
);
56 link_libraries(&target_os
);
59 writeln
!(::std
::io
::stderr(),
60 "Unable to get target_os=`{}`!", e
).expect("could not report the error");
61 ::std
::process
::exit(0xfd);
67 "cargo:rustc-env=LIBLOADING_TEST_TARGET={}",
68 std
::env
::var("TARGET").expect("$TARGET is not set")