@@ -65,14 +65,14 @@ pub fn source_name(input: &input) -> @str {
65
65
}
66
66
}
67
67
68
- pub fn default_configuration(sess: Session, argv0: @str, input: &input ) ->
68
+ pub fn default_configuration(sess: Session) ->
69
69
ast::CrateConfig {
70
- let (libc, tos) = match sess.targ_cfg.os {
71
- session::os_win32 => (@" msvcrt . dll" , @" win32") ,
72
- session :: os_macos => ( @"libc . dylib " , @" macos") ,
73
- session:: os_linux => ( @"libc . so . 6 " , @" linux") ,
74
- session:: os_android => ( @"libc . so " , @" android") ,
75
- session:: os_freebsd => ( @"libc . so . 7 " , @" freebsd")
70
+ let tos = match sess.targ_cfg.os {
71
+ session::os_win32 => @" win32",
72
+ session:: os_macos => @" macos",
73
+ session:: os_linux => @" linux" ,
74
+ session:: os_android => @" android",
75
+ session:: os_freebsd => @" freebsd"
76
76
} ;
77
77
78
78
// ARM is bi-endian, however using NDK seems to default
@@ -92,10 +92,7 @@ pub fn default_configuration(sess: Session, argv0: @str, input: &input) ->
92
92
mk ( @"target_arch", arch) ,
93
93
mk ( @"target_endian", end) ,
94
94
mk ( @"target_word_size", wordsz) ,
95
- mk ( @"target_libc", libc) ,
96
- // Build bindings.
97
- mk ( @"build_compiler", argv0) ,
98
- mk ( @"build_input", source_name ( input) ) ] ;
95
+ ] ;
99
96
}
100
97
101
98
pub fn append_configuration ( cfg : & mut ast:: CrateConfig , name : @str ) {
@@ -104,11 +101,11 @@ pub fn append_configuration(cfg: &mut ast::CrateConfig, name: @str) {
104
101
}
105
102
}
106
103
107
- pub fn build_configuration ( sess : Session , argv0 : @ str , input : & input ) ->
104
+ pub fn build_configuration ( sess : Session ) ->
108
105
ast:: CrateConfig {
109
106
// Combine the configuration requested by the session (command line) with
110
107
// some default and generated configuration items
111
- let default_cfg = default_configuration ( sess, argv0 , input ) ;
108
+ let default_cfg = default_configuration ( sess) ;
112
109
let mut user_cfg = sess. opts . cfg . clone ( ) ;
113
110
// If the user wants a test runner, then add the test cfg
114
111
if sess. opts . test { append_configuration ( & mut user_cfg, @"test") }
@@ -980,7 +977,7 @@ pub fn list_metadata(sess: Session, path: &Path, out: @io::Writer) {
980
977
mod test {
981
978
982
979
use driver:: driver:: { build_configuration, build_session} ;
983
- use driver:: driver:: { build_session_options, optgroups, str_input } ;
980
+ use driver:: driver:: { build_session_options, optgroups} ;
984
981
985
982
use extra:: getopts:: groups:: getopts;
986
983
use extra:: getopts;
@@ -998,7 +995,7 @@ mod test {
998
995
let sessopts = build_session_options (
999
996
@"rustc", matches, diagnostic:: emit) ;
1000
997
let sess = build_session ( sessopts, diagnostic:: emit) ;
1001
- let cfg = build_configuration ( sess, @"whatever" , & str_input ( @"" ) ) ;
998
+ let cfg = build_configuration ( sess) ;
1002
999
assert ! ( ( attr:: contains_name( cfg, "test" ) ) ) ;
1003
1000
}
1004
1001
@@ -1016,7 +1013,7 @@ mod test {
1016
1013
let sessopts = build_session_options (
1017
1014
@"rustc", matches, diagnostic:: emit) ;
1018
1015
let sess = build_session ( sessopts, diagnostic:: emit) ;
1019
- let cfg = build_configuration ( sess, @"whatever" , & str_input ( @"" ) ) ;
1016
+ let cfg = build_configuration ( sess) ;
1020
1017
let mut test_items = cfg. iter ( ) . filter ( |m| "test" == m. name ( ) ) ;
1021
1018
assert ! ( test_items. next( ) . is_some( ) ) ;
1022
1019
assert ! ( test_items. next( ) . is_none( ) ) ;
0 commit comments