Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f483af

Browse files
authored
Merge pull request alexcrichton#18 from mneumann/fix-dragonfly
Support DragonFly
2 parents 4009c19 + df07b66 commit 9f483af

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/lib.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ impl Build {
5151
self
5252
}
5353

54+
fn cmd_make(&self) -> Command {
55+
match &self.host.as_ref().expect("HOST dir not set")[..] {
56+
"x86_64-unknown-dragonfly" => Command::new("gmake"),
57+
_ => Command::new("make"),
58+
}
59+
}
60+
5461
pub fn build(&mut self) -> Artifacts {
5562
let target = &self.target.as_ref().expect("TARGET dir not set")[..];
5663
let host = &self.host.as_ref().expect("HOST dir not set")[..];
@@ -161,6 +168,7 @@ impl Build {
161168
"x86_64-pc-windows-gnu" => "mingw64",
162169
"x86_64-pc-windows-msvc" => "VC-WIN64A",
163170
"x86_64-unknown-freebsd" => "BSD-x86_64",
171+
"x86_64-unknown-dragonfly" => "BSD-x86_64",
164172
"x86_64-unknown-linux-gnu" => "linux-x86_64",
165173
"x86_64-unknown-linux-musl" => "linux-x86_64",
166174
"x86_64-unknown-netbsd" => "BSD-x86_64",
@@ -264,11 +272,11 @@ impl Build {
264272
install.arg("install_sw").current_dir(&inner_dir);
265273
self.run_command(install, "installing OpenSSL");
266274
} else {
267-
let mut depend = Command::new("make");
275+
let mut depend = self.cmd_make();
268276
depend.arg("depend").current_dir(&inner_dir);
269277
self.run_command(depend, "building OpenSSL dependencies");
270278

271-
let mut build = Command::new("make");
279+
let mut build = self.cmd_make();
272280
build.current_dir(&inner_dir);
273281
if !cfg!(windows) {
274282
if let Some(s) = env::var_os("CARGO_MAKEFLAGS") {
@@ -277,7 +285,7 @@ impl Build {
277285
}
278286
self.run_command(build, "building OpenSSL");
279287

280-
let mut install = Command::new("make");
288+
let mut install = self.cmd_make();
281289
install.arg("install_sw").current_dir(&inner_dir);
282290
self.run_command(install, "installing OpenSSL");
283291
}

0 commit comments

Comments
 (0)