Skip to content

Commit 95c4b3f

Browse files
committed
Relax TARGET check to support all BSD
1 parent cff60bc commit 95c4b3f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/build.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ const SNAPPY_VERSION: &'static str = "1.1.2";
1313
const LEVELDB_VERSION: &'static str = "1.18";
1414

1515

16-
fn build_snappy(is_freebsd: bool) {
16+
fn build_snappy(is_bsd: bool) {
1717
// Step 1: Build snappy
1818
// ----------------------------------------------------------------------
1919
let snappy_path = Path::new("deps")
2020
.join(format!("snappy-{}", SNAPPY_VERSION));
21-
let make = if is_freebsd { "gmake" } else { "make" };
21+
let make = if is_bsd { "gmake" } else { "make" };
2222

2323
// Clean the build directory first.
2424
println!("[snappy] Cleaning");
@@ -47,12 +47,12 @@ fn build_snappy(is_freebsd: bool) {
4747
res.ok().expect("copy of output files failed");
4848
}
4949

50-
fn build_leveldb(with_snappy: bool, is_freebsd: bool) {
50+
fn build_leveldb(with_snappy: bool, is_bsd: bool) {
5151
// Step 1: Build LevelDB
5252
// ----------------------------------------------------------------------
5353
let leveldb_path = Path::new("deps")
5454
.join(format!("leveldb-{}", LEVELDB_VERSION));
55-
let make = if is_freebsd { "gmake" } else { "make" };
55+
let make = if is_bsd { "gmake" } else { "make" };
5656

5757
// Clean the build directory first.
5858
println!("[leveldb] Cleaning");
@@ -121,11 +121,11 @@ fn main() {
121121
println!("[build] Started");
122122

123123
let have_snappy = env::var("CARGO_FEATURE_SNAPPY").is_ok();
124-
let is_freebsd = env::var("TARGET").unwrap().ends_with("freebsd");
124+
let is_bsd = env::var("TARGET").unwrap().ends_with("bsd");
125125

126126
// If we have the appropriate feature, then we build snappy.
127127
if have_snappy {
128-
build_snappy(is_freebsd);
128+
build_snappy(is_bsd);
129129
}
130130

131131
// Copy the build_detect_platform file into the appropriate place.
@@ -178,7 +178,7 @@ fn main() {
178178
fs::set_permissions(&detect_path, perms).ok().expect("permissions could not be set");
179179

180180
// Build LevelDB
181-
build_leveldb(have_snappy, is_freebsd);
181+
build_leveldb(have_snappy, is_bsd);
182182

183183
// Print the appropriate linker flags
184184
let out_dir = env::var("OUT_DIR").ok().expect("OUT_DIR missing");

0 commit comments

Comments
 (0)