@@ -63,8 +63,6 @@ pub struct Config {
63
63
cxxflags : OsString ,
64
64
ldflags : OsString ,
65
65
options : Vec < ( Kind , OsString , Option < OsString > ) > ,
66
- free_options : Vec < ( OsString , Option < OsString > ) > ,
67
- free_host : Option < String > ,
68
66
target : Option < String > ,
69
67
make_args : Option < Vec < String > > ,
70
68
make_targets : Option < Vec < String > > ,
@@ -109,8 +107,6 @@ impl Config {
109
107
cxxflags : OsString :: new ( ) ,
110
108
ldflags : OsString :: new ( ) ,
111
109
options : Vec :: new ( ) ,
112
- free_options : Vec :: new ( ) ,
113
- free_host : None ,
114
110
make_args : None ,
115
111
make_targets : None ,
116
112
out_dir : None ,
@@ -159,14 +155,6 @@ impl Config {
159
155
self
160
156
}
161
157
162
- /// Passes `--<opt><=optarg>` to configure.
163
- pub fn free_option < P : AsRef < OsStr > > ( & mut self , opt : P , optarg : Option < P > ) -> & mut Config {
164
- let optarg = optarg. as_ref ( ) . map ( |v| v. as_ref ( ) . to_owned ( ) ) ;
165
- self . free_options . push ( ( opt. as_ref ( ) . to_owned ( ) ,
166
- optarg) ) ;
167
- self
168
- }
169
-
170
158
/// Passes `--enable-<opt><=optarg>` to configure.
171
159
pub fn enable < P : AsRef < OsStr > > ( & mut self , opt : P , optarg : Option < P > ) -> & mut Config {
172
160
self . set_opt ( Kind :: Enable , opt, optarg)
@@ -220,7 +208,7 @@ impl Config {
220
208
self
221
209
}
222
210
223
- /// Sets the Rust host triple for this compilation.
211
+ /// Sets the host triple for this compilation.
224
212
///
225
213
/// This is automatically scraped from `$HOST` which is set for Cargo
226
214
/// build scripts so it's not necessary to call this from a build script.
@@ -229,16 +217,6 @@ impl Config {
229
217
self
230
218
}
231
219
232
- /// Sets the ./configure --host triple for this compilation.
233
- ///
234
- /// When cross-compiling, this will usually approximate what Rust calls the
235
- /// target rather than what Rust calls the host. When not explicitly
236
- /// set, we attempt to auto-compute this from the compiler path.
237
- pub fn free_host ( & mut self , host : & str ) -> & mut Config {
238
- self . free_host = Some ( host. to_string ( ) ) ;
239
- self
240
- }
241
-
242
220
/// Sets the output directory for this compilation.
243
221
///
244
222
/// This is automatically scraped from `$OUT_DIR` which is set for Cargo
@@ -308,6 +286,7 @@ impl Config {
308
286
let c_compiler = c_cfg. get_compiler ( ) ;
309
287
let cxx_compiler = cxx_cfg. get_compiler ( ) ;
310
288
289
+
311
290
let dst;
312
291
let build;
313
292
@@ -336,6 +315,7 @@ impl Config {
336
315
let executable = PathBuf :: from ( & self . path ) . join ( "configure" ) ;
337
316
let mut cmd = Command :: new ( executable) ;
338
317
318
+ cmd. arg ( format ! ( "--host={}" , host) ) ;
339
319
cmd. arg ( format ! ( "--prefix={}" , dst. display( ) ) ) ;
340
320
if self . enable_shared {
341
321
cmd. arg ( "--enable-shared" ) ;
@@ -406,19 +386,7 @@ impl Config {
406
386
cmd. arg ( os) ;
407
387
}
408
388
409
- for & ( ref k, ref v) in & self . free_options {
410
- let mut os = OsString :: from ( "--" ) ;
411
- os. push ( k) ;
412
- if let & Some ( ref v) = v {
413
- os. push ( "=" ) ;
414
- os. push ( v) ;
415
- }
416
- cmd. arg ( os) ;
417
- }
418
-
419
- if let Some ( ref host) = self . free_host {
420
- cmd. arg ( format ! ( "--host={}" , host) ) ;
421
- } else {
389
+ if true {
422
390
let compiler_path = format ! ( "--host={}" , c_compiler. path( ) . display( ) ) ;
423
391
if compiler_path != "--host=musl-gcc" && compiler_path. ends_with ( "-gcc" ) {
424
392
cmd. arg ( & compiler_path[ 0 ..compiler_path. len ( ) - 4 ] ) ;
0 commit comments