|
NAMEPkgConfig::LibPkgConf::Client - Query installed libraries for compiling and linking softwareSYNOPSISuse PkgConfig::LibPkgConf::Client; my $client = PkgConfig::LibPkgConf::Client->new; $client->env; my $pkg = $client->find('libarchive'); my $cflags = $pkg->cflags; my $libs = $pkg->libs; DESCRIPTIONThe PkgConfig::LibPkgConf::Client objects store all necessary state for "libpkgconf" allowing for multiple instances to run in parallel.CONSTRUCTORnewmy $client = PkgConfig::LibPkgConf::Client->new(%opts); my $client = PkgConfig::LibPkgConf::Client->new(\%opts); Creates an instance of PkgConfig::LibPkgConf::Client. Possible options include:
environment variables honored:
ATTRIBUTESpathmy @path = $client->path; The search path to look for ".pc" files. filter_lib_dirsmy @dirs = $client->filter_lib_dirs; List of directories to filter for libraries. filter_include_dirsmy @dirs = $client->filter_include_dirs; List of directories to filter for includes. sysroot_dirmy $dir = $client->sysroot_dir; $client->sysroot_dir($dir); Get or set the sysroot directory. buildroot_dirmy $dir = $client->buildroot_dir; $client->buildroot_dir($dir); Get or set the buildroot directory. maxdepthmy $int = $client->maxdepth; $client->maxdepth($int); Get or set the maximum dependency depth. This is 2000 by default. METHODSenvmy $client->env; This method loads settings for the client object from the environment using the standard "pkg-config" or "pkgconf" environment variables. It honors the following list of environment variables:
findmy $pkg = $client->find($package_name); Searches the <.pc> file for the package with the given $package_name. If found returns an instance of PkgConfig::LibPkgConf::Package. If not found returns "undef". package_from_filemy $pkg = $client->package_from_file($filename); Load the specific <.pc> file. scan_all$client->scan_all(sub { my($client, $package) = @_; ... return $bool; }); Iterates through all packages and calls the given subroutine reference for each package. $package isa PkgConfig::LibPkgConf::Package. The scan will continue so long as a non true value is returned (as $bool). global$client->global($key => $value); my $value = $client->global($key); Define or get the global variable. errormy $client->error($message); Called when "libpkgconf" comes across a non-fatal error. By default the error is simply displayed as a warning using Carp. The intention of this method is if you want to override that behavior, you will subclass PkgConfig::LibPkgConf::Client and implement your own version of the "error" method. audit_set_log$client->audit_set_log($filename, $mode); Opens a file with the C "fopen" style $mode, and uses it for the audit log. The file is managed entirely by the client class and will be closed when the object falls out of scope. Examples: $client->audit_set_log("audit.log", "a"); # append to existing file $client->audit_set_log("audit2.log", "w"); # new or replace file SUPPORTIRC #native on irc.perl.orgProject GitHub tracker: <https://github.com/plicease/PkgConfig-LibPkgConf/issues> If you want to contribute, please open a pull request on GitHub: <https://github.com/plicease/PkgConfig-LibPkgConf/pulls> SEE ALSOFor additional related modules, see PkgConfig::LibPkgConfAUTHORGraham OllisFor additional contributors see PkgConfig::LibPkgConf COPYRIGHT AND LICENSEThis software is copyright (c) 2016 Graham Ollis.This is free software; you may redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |