Skip to content

Commit c99203e

Browse files
committed
Use PKG_CONFIG environment variable
This will mimic PKG_CONF_PKG_CONFIG m4 macro.
1 parent e493197 commit c99203e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ impl Config {
328328
}
329329

330330
fn command(&self, name: &str, args: &[&str]) -> Command {
331-
let mut cmd = Command::new("pkg-config");
331+
let exe = env::var("PKG_CONFIG").unwrap_or(String::from("pkg-config"));
332+
let mut cmd = Command::new(exe);
332333
if self.is_static(name) {
333334
cmd.arg("--static");
334335
}

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static LOCK: StaticMutex = MUTEX_INIT;
1111

1212
fn reset() {
1313
for (k, _) in env::vars() {
14-
if k.contains("PKG_CONFIG") || k.contains("DYNAMIC") ||
14+
if k.contains("DYNAMIC") ||
1515
k.contains("STATIC") {
1616
env::remove_var(&k);
1717
}

0 commit comments

Comments
 (0)