@@ -419,16 +419,8 @@ pub mod write {
419
419
}
420
420
}
421
421
422
- pub fn run_ndk ( sess : Session , assembly : & Path , object : & Path ) {
423
- let cc_prog: ~str = match & sess. opts . android_cross_path {
424
- & Some ( ref path) => {
425
- fmt ! ( "%s/bin/arm-linux-androideabi-gcc" , * path)
426
- }
427
- & None => {
428
- sess. fatal ( "need Android NDK path for building \
429
- (--android-cross-path)")
430
- }
431
- } ;
422
+ pub fn run_assembler ( sess : Session , assembly : & Path , object : & Path ) {
423
+ let cc_prog = super :: get_cc_prog ( sess) ;
432
424
433
425
let cc_args = ~[
434
426
~"-c",
@@ -813,12 +805,7 @@ pub fn output_dll_filename(os: session::os, lm: LinkMeta) -> ~str {
813
805
fmt ! ( "%s%s-%s-%s%s" , dll_prefix, lm. name, lm. extras_hash, lm. vers, dll_suffix)
814
806
}
815
807
816
- // If the user wants an exe generated we need to invoke
817
- // cc to link the object file with some libs
818
- pub fn link_binary ( sess : Session ,
819
- obj_filename : & Path ,
820
- out_filename : & Path ,
821
- lm : LinkMeta ) {
808
+ pub fn get_cc_prog ( sess : Session ) -> ~str {
822
809
// In the future, FreeBSD will use clang as default compiler.
823
810
// It would be flexible to use cc (system's default C compiler)
824
811
// instead of hard-coded gcc.
@@ -841,9 +828,18 @@ pub fn link_binary(sess: Session,
841
828
session:: os_win32 => ~"g++",
842
829
_ => ~" cc"
843
830
}
844
- } ;
845
- // The invocations of cc share some flags across platforms
831
+ }
832
+ }
833
+
834
+ // If the user wants an exe generated we need to invoke
835
+ // cc to link the object file with some libs
836
+ pub fn link_binary ( sess : Session ,
837
+ obj_filename : & Path ,
838
+ out_filename : & Path ,
839
+ lm : LinkMeta ) {
846
840
841
+ let cc_prog = get_cc_prog ( sess) ;
842
+ // The invocations of cc share some flags across platforms
847
843
848
844
let output = if * sess. building_library {
849
845
let long_libname = output_dll_filename ( sess. targ_cfg . os , lm) ;
0 commit comments