1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--- cargo-crates/gmp-mpfr-sys-1.5.0/build.rs.orig 2006-07-24 01:21:28 UTC
+++ cargo-crates/gmp-mpfr-sys-1.5.0/build.rs
@@ -42,7 +42,7 @@ const MPFR_DIR: &str = "mpfr-4.2.0-c";
const MPC_DIR: &str = "mpc-1.3.1-c";
const GMP_VER: (i32, i32, i32) = (6, 2, 1);
const MPFR_VER: (i32, i32, i32) = (4, 2, 0);
-const MPC_VER: (i32, i32, i32) = (1, 3, 1);
+const MPC_VER: (i32, i32, i32) = (1, 2, 1);
#[derive(Clone, Copy, PartialEq)]
enum Target {
@@ -194,7 +194,7 @@ fn check_system_libs(env: &Environment) {
let mut cmd = Command::new(&env.c_compiler);
cmd.current_dir(&try_dir)
- .args(["-fPIC", "system_gmp.c", "-lgmp", "-o", "system_gmp.exe"]);
+ .args(["-fPIC", "-L%%LOCALBASE%%/lib", "-I%%LOCALBASE%%/include", "system_gmp.c", "-lgmp", "-o", "system_gmp.exe"]);
execute(cmd);
cmd = Command::new(try_dir.join("system_gmp.exe"));
@@ -218,6 +218,7 @@ fn check_system_libs(env: &Environment) {
cmd.current_dir(&try_dir).args([
"-fPIC",
"system_mpfr.c",
+ "-L%%LOCALBASE%%/lib", "-I%%LOCALBASE%%/include",
"-lmpfr",
"-lgmp",
"-o",
@@ -243,6 +244,7 @@ fn check_system_libs(env: &Environment) {
cmd = Command::new(&env.c_compiler);
cmd.current_dir(&try_dir).args([
"-fPIC",
+ "-L%%LOCALBASE%%/lib", "-I%%LOCALBASE%%/include",
"system_mpc.c",
"-lmpc",
"-lgmp",
@@ -975,7 +977,7 @@ fn write_link_info(env: &Environment, feature_mpfr: bo
println!("cargo:out_dir={out_str}");
println!("cargo:lib_dir={lib_str}");
println!("cargo:include_dir={include_str}");
- println!("cargo:rustc-link-search=native={lib_str}");
+ println!("cargo:rustc-link-search=native={}/lib", "%%LOCALBASE%%");
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
if target_env == "musl" && env.use_system_libs {
|