=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/pkg-config/pkg-config,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- src/usr.bin/pkg-config/pkg-config 2017/08/26 09:03:51 1.90 +++ src/usr.bin/pkg-config/pkg-config 2019/02/04 18:51:29 1.91 @@ -1,9 +1,9 @@ #!/usr/bin/perl -# $OpenBSD: pkg-config,v 1.90 2017/08/26 09:03:51 jsg Exp $ +# $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 -# Copyright (c) 2011 Jasper Lievisse Adriaanse +# Copyright (c) 2011,2019 Jasper Lievisse Adriaanse # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -46,7 +46,7 @@ defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; my $found_uninstalled = 0; -my $version = '0.27.1'; # pretend to be this version of pkgconfig +my $version = '0.29.0'; # pretend to be this version of pkgconfig my %configs = (); setup_self(); @@ -99,6 +99,7 @@ 'libs-only-L' => sub { $mode{libs} |= 2}, 'libs-only-other' => sub { $mode{libs} |= 4}, 'exists' => sub { $mode{exists} = 1} , + 'validate' => sub { $mode{validate} = 1}, 'static' => sub { $mode{static} = 1}, 'uninstalled' => sub { $mode{uninstalled} = 1}, 'atleast-version=s' => \$mode{minversion}, @@ -125,7 +126,8 @@ if (defined $mode{libs} or defined $mode{cflags} or defined $mode{version} - or defined $mode{list}) { + or defined $mode{list} + or defined $mode{validate}) { $mode{printerr} = 1; } else { $mode{printerr} = 0; @@ -194,7 +196,7 @@ push(@$top_config, $p); } -if ($mode{exists}) { +if ($mode{exists} || $mode{validate}) { exit $rc; } @@ -307,8 +309,11 @@ or $mode{exists}) { &$get_props("Requires.private"); } - &$get_props("Requires"); + unless (defined $mode{validate}) { + &$get_props("Requires"); + } + } # look for the .pc file in each of the PKGPATH elements. Return the path or @@ -380,7 +385,7 @@ foreach (@required_elems) { my $e = $cfg->get_property($_, $variables); if (!defined $e) { - $f =~ s/(^.*\/)(.*?)\.pc$/$2/g; + $f =~ s/(^.*\/)?(.*?)\.pc$/$2/g; say_error("Package '$f' has no $_: field"); return undef; } @@ -614,6 +619,7 @@ --libs-only-L - only output -Llibpath flags --libs-only-other - only output flags that are not -l or -L --exists package [versionspec] [package [versionspec]] +--validate package --uninstalled - allow for uninstalled versions to be used --static - adjust output for static linking --atleast-version [version] - require a certain version of a package