version 1.90, 2017/08/26 09:03:51 |
version 1.91, 2019/02/04 18:51:29 |
|
|
# $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ |
# $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ |
|
|
# Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org> |
# Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org> |
# Copyright (c) 2011 Jasper Lievisse Adriaanse <jasper@openbsd.org> |
# Copyright (c) 2011,2019 Jasper Lievisse Adriaanse <jasper@openbsd.org> |
# |
# |
# Permission to use, copy, modify, and distribute this software for any |
# Permission to use, copy, modify, and distribute this software for any |
# purpose with or without fee is hereby granted, provided that the above |
# purpose with or without fee is hereby granted, provided that the above |
|
|
defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; |
defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; |
my $found_uninstalled = 0; |
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 = (); |
my %configs = (); |
setup_self(); |
setup_self(); |
|
|
'libs-only-L' => sub { $mode{libs} |= 2}, |
'libs-only-L' => sub { $mode{libs} |= 2}, |
'libs-only-other' => sub { $mode{libs} |= 4}, |
'libs-only-other' => sub { $mode{libs} |= 4}, |
'exists' => sub { $mode{exists} = 1} , |
'exists' => sub { $mode{exists} = 1} , |
|
'validate' => sub { $mode{validate} = 1}, |
'static' => sub { $mode{static} = 1}, |
'static' => sub { $mode{static} = 1}, |
'uninstalled' => sub { $mode{uninstalled} = 1}, |
'uninstalled' => sub { $mode{uninstalled} = 1}, |
'atleast-version=s' => \$mode{minversion}, |
'atleast-version=s' => \$mode{minversion}, |
|
|
if (defined $mode{libs} |
if (defined $mode{libs} |
or defined $mode{cflags} |
or defined $mode{cflags} |
or defined $mode{version} |
or defined $mode{version} |
or defined $mode{list}) { |
or defined $mode{list} |
|
or defined $mode{validate}) { |
$mode{printerr} = 1; |
$mode{printerr} = 1; |
} else { |
} else { |
$mode{printerr} = 0; |
$mode{printerr} = 0; |
|
|
push(@$top_config, $p); |
push(@$top_config, $p); |
} |
} |
|
|
if ($mode{exists}) { |
if ($mode{exists} || $mode{validate}) { |
exit $rc; |
exit $rc; |
} |
} |
|
|
|
|
or $mode{exists}) { |
or $mode{exists}) { |
&$get_props("Requires.private"); |
&$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 |
# look for the .pc file in each of the PKGPATH elements. Return the path or |
|
|
foreach (@required_elems) { |
foreach (@required_elems) { |
my $e = $cfg->get_property($_, $variables); |
my $e = $cfg->get_property($_, $variables); |
if (!defined $e) { |
if (!defined $e) { |
$f =~ s/(^.*\/)(.*?)\.pc$/$2/g; |
$f =~ s/(^.*\/)?(.*?)\.pc$/$2/g; |
say_error("Package '$f' has no $_: field"); |
say_error("Package '$f' has no $_: field"); |
return undef; |
return undef; |
} |
} |
|
|
--libs-only-L - only output -Llibpath flags |
--libs-only-L - only output -Llibpath flags |
--libs-only-other - only output flags that are not -l or -L |
--libs-only-other - only output flags that are not -l or -L |
--exists package [versionspec] [package [versionspec]] |
--exists package [versionspec] [package [versionspec]] |
|
--validate package |
--uninstalled - allow for uninstalled versions to be used |
--uninstalled - allow for uninstalled versions to be used |
--static - adjust output for static linking |
--static - adjust output for static linking |
--atleast-version [version] - require a certain version of a package |
--atleast-version [version] - require a certain version of a package |