@@ -15,6 +15,16 @@ use std::fs;
15
15
use std:: path:: PathBuf ;
16
16
use std:: process:: Command ;
17
17
18
+ fn gnu_target ( target : & str ) -> String {
19
+ match target {
20
+ "i686-pc-windows-msvc" => "i686-pc-win32" . to_string ( ) ,
21
+ "x86_64-pc-windows-msvc" => "x86_64-pc-win32" . to_string ( ) ,
22
+ "i686-pc-windows-gnu" => "i686-w64-mingw32" . to_string ( ) ,
23
+ "x86_64-pc-windows-gnu" => "x86_64-w64-mingw32" . to_string ( ) ,
24
+ s => s. to_string ( ) ,
25
+ }
26
+ }
27
+
18
28
fn main ( ) {
19
29
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
20
30
let host = env:: var ( "HOST" ) . unwrap ( ) ;
@@ -47,6 +57,12 @@ fn main() {
47
57
. env ( "CC" , compiler. path ( ) )
48
58
. env ( "CFLAGS" , cflags) ;
49
59
60
+ // jemalloc's configure doesn't detect this value
61
+ // automatically for this target:
62
+ if target == "sparc64-unknown-linux-gnu" {
63
+ cmd. arg ( "--with-lg-quantum=4" ) ;
64
+ }
65
+
50
66
if target. contains ( "ios" ) {
51
67
cmd. arg ( "--disable-tls" ) ;
52
68
} else if target. contains ( "android" ) {
@@ -62,8 +78,8 @@ fn main() {
62
78
if env:: var_os ( "CARGO_FEATURE_PROFILING" ) . is_some ( ) {
63
79
cmd. arg ( "--enable-prof" ) ;
64
80
}
65
- cmd. arg ( format ! ( "--host={}" , target . replace ( "windows-gnu" , "w64-mingw32" ) ) ) ;
66
- cmd. arg ( format ! ( "--build={}" , host . replace ( "windows-gnu" , "w64-mingw32" ) ) ) ;
81
+ cmd. arg ( format ! ( "--host={}" , gnu_target ( & target ) ) ) ;
82
+ cmd. arg ( format ! ( "--build={}" , gnu_target ( & host ) ) ) ;
67
83
cmd. arg ( format ! ( "--prefix={}" , out_dir. display( ) ) ) ;
68
84
69
85
run ( & mut cmd) ;
0 commit comments