=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/pkg-config/pkg-config,v retrieving revision 1.91 retrieving revision 1.92 diff -c -r1.91 -r1.92 *** src/usr.bin/pkg-config/pkg-config 2019/02/04 18:51:29 1.91 --- src/usr.bin/pkg-config/pkg-config 2019/02/04 20:18:11 1.92 *************** *** 1,5 **** #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.91 2019/02/04 18:51:29 jasper Exp $ # $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe --- 1,5 ---- #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.92 2019/02/04 20:18:11 jasper Exp $ # $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe *************** *** 46,52 **** defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; my $found_uninstalled = 0; ! my $version = '0.29.0'; # pretend to be this version of pkgconfig my %configs = (); setup_self(); --- 46,52 ---- defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; my $found_uninstalled = 0; ! my $version = '0.29.1'; # pretend to be this version of pkgconfig my %configs = (); setup_self(); *************** *** 289,294 **** --- 289,309 ---- my $get_props = sub { my $property = shift; + my $pkg; + + # See if there's anyting in the environment that we need to take into account. + ($pkg = $p) =~ s/(^.*\/)?(.*?)\.pc$/$2/g; + $pkg = uc($pkg); + + if (grep {/PKG_CONFIG_${pkg}.*/} keys %ENV) { + # Now that we know we have something to look for, do the inefficient + # iteration. + while (my ($k, $v) = each %ENV) { + if ($k =~ /^PKG_CONFIG_${pkg}_(\w+)/) { + $variables->{lc($1)} = $v; + } + } + } my $deps = $cfg->get_property($property, $variables); if (defined $deps) {