@@ -23,6 +23,7 @@ use std::process;
2323use num_cpus;
2424use rustc_serialize:: Decodable ;
2525use toml:: { Parser , Decoder , Value } ;
26+ use util:: push_exe_path;
2627
2728/// Global configuration for the entire build and/or bootstrap.
2829///
@@ -417,7 +418,7 @@ impl Config {
417418 let target = self . target_config . entry ( self . build . clone ( ) )
418419 . or_insert ( Target :: default ( ) ) ;
419420 let root = PathBuf :: from ( value) ;
420- target. llvm_config = Some ( root . join ( "bin/ llvm-config" ) ) ;
421+ target. llvm_config = Some ( push_exe_path ( root , & [ "bin" , " llvm-config"] ) ) ;
421422 }
422423 "CFG_JEMALLOC_ROOT" if value. len ( ) > 0 => {
423424 let target = self . target_config . entry ( self . build . clone ( ) )
@@ -449,8 +450,9 @@ impl Config {
449450 target. ndk = Some ( PathBuf :: from ( value) ) ;
450451 }
451452 "CFG_LOCAL_RUST_ROOT" if value. len ( ) > 0 => {
452- self . rustc = Some ( PathBuf :: from ( value) . join ( "bin/rustc" ) ) ;
453- self . cargo = Some ( PathBuf :: from ( value) . join ( "bin/cargo" ) ) ;
453+ let path = PathBuf :: from ( value) ;
454+ self . rustc = Some ( push_exe_path ( path. clone ( ) , & [ "bin" , "rustc" ] ) ) ;
455+ self . cargo = Some ( push_exe_path ( path, & [ "bin" , "cargo" ] ) ) ;
454456 }
455457 _ => { }
456458 }
0 commit comments