File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -477,12 +477,23 @@ impl Config {
477
477
}
478
478
479
479
fn run ( & self , name : & str , args : & [ & str ] ) -> Result < Vec < u8 > , Error > {
480
- let exe = self
481
- . targetted_env_var ( "PKG_CONFIG" )
482
- . unwrap_or_else ( || OsString :: from ( "pkg-config" ) ) ;
480
+ let pkg_config_exe = self . targetted_env_var ( "PKG_CONFIG" ) ;
481
+ let fallback_exe = if pkg_config_exe. is_none ( ) {
482
+ Some ( OsString :: from ( "pkgconf" ) )
483
+ } else {
484
+ None
485
+ } ;
486
+ let exe = pkg_config_exe. unwrap_or_else ( || OsString :: from ( "pkg-config" ) ) ;
483
487
484
488
let mut cmd = self . command ( exe, name, args) ;
485
- match cmd. output ( ) {
489
+
490
+ match cmd. output ( ) . or_else ( |e| {
491
+ if let Some ( exe) = fallback_exe {
492
+ self . command ( exe, name, args) . output ( )
493
+ } else {
494
+ Err ( e)
495
+ }
496
+ } ) {
486
497
Ok ( output) => {
487
498
if output. status . success ( ) {
488
499
Ok ( output. stdout )
You can’t perform that action at this time.
0 commit comments