@@ -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 ( ) ;
@@ -49,6 +59,12 @@ fn main() {
49
59
. env ( "CPPFLAGS" , cflags. clone ( ) )
50
60
. arg ( "--disable-cxx" ) ;
51
61
62
+ // jemalloc's configure doesn't detect this value
63
+ // automatically for this target:
64
+ if target == "sparc64-unknown-linux-gnu" {
65
+ cmd. arg ( "--with-lg-quantum=4" ) ;
66
+ }
67
+
52
68
if target. contains ( "ios" ) {
53
69
cmd. arg ( "--disable-tls" ) ;
54
70
} else if target. contains ( "android" ) {
@@ -64,8 +80,8 @@ fn main() {
64
80
if env:: var_os ( "CARGO_FEATURE_PROFILING" ) . is_some ( ) {
65
81
cmd. arg ( "--enable-prof" ) ;
66
82
}
67
- cmd. arg ( format ! ( "--host={}" , target . replace ( "windows-gnu" , "w64-mingw32" ) ) ) ;
68
- cmd. arg ( format ! ( "--build={}" , host . replace ( "windows-gnu" , "w64-mingw32" ) ) ) ;
83
+ cmd. arg ( format ! ( "--host={}" , gnu_target ( & target ) ) ) ;
84
+ cmd. arg ( format ! ( "--build={}" , gnu_target ( & host ) ) ) ;
69
85
cmd. arg ( format ! ( "--prefix={}" , out_dir. display( ) ) ) ;
70
86
71
87
run ( & mut cmd) ;
0 commit comments