text
stringlengths
0
834k
=head4 I<< PkgConfig->find >>
my $result = PkgConfig->find($library, %options);
Find a library and return a result object.
C<$library> can be either a single name of a library, or a reference to an
array of library names
The options are in the form of hash keys and values, and the following are
recognized:
=over
=item C<search_path>
=item C<search_path_override>
Prepend search paths in addition to the paths specified in C<$ENV{PKG_CONFIG_PATH}>
The value is an array reference.
the C<_override> variant ignores defaults (like C<PKG_CONFIG_PATH>).
=item C<file_path>
Specifies the full path of the of the .pc file that you wish to load. It does
not need to be in the search path (although any dependencies will need to be).
Useful if you know the full path of the exact .pc file that you want.
=item C<exclude_cflags>
=item C<exclude_ldflags>
=item C<exclude_cflags_override>
=item C<exclude_ldflags_override>
Some C<.pc> files specify default compiler and linker search paths, e.g.
C<-I/usr/include -L/usr/lib>. Specifying them on the command line can be
problematic as it drastically changes the search order.
The above options will either append or replace the options which are excluded
and filtered.
The default excluded linker and compiler options can be obtained via
C<@PkgConfig::DEFAULT_EXCLUDE_LFLAGS> and C<@PkgConfig::DEFAULT_EXCLUDE_CFLAGS>,
respectively.
=item C<static>
Also specify static libraries.
=item C<no_recurse>
Do not recurse dependencies. This is useful for just doing version checks.
=item C<VARS>
Define a hashref of variables to override any variable definitions within
the .pc files. This is equivalent to the C<--define-variable> command-line
option.
=back
A C<PkgConfig> object is returned and may be queried about the results:
=head4 I<< $o->errmsg >>
An error message, if any. This is a string and indicates an error.
=head4 I<< $o->pkg_exists >>
Boolean value, true if the package exists.
=head4 I<< $o->pkg_version >>
The version of the package
=head4 I<< $o->get_cflags >>
=head4 I<< $o->get_ldflags >>
Returns compiler and linker flags, respectively.
In list context, these methods return a list with each argument split on
unescaped spaces.
In list context returns a list of compiler and linker flags, respectively.
In scalar context returns a string of compiler and linker flags with spaces
and quotes escaped correctly.
=head4 I<< $o->get_var($name) >>
Get the variable with the given name.
=head4 I<< PkgConfig->Guess >>
This is a class method, and will replace the hard-coded default linker and include
paths with those discovered by invoking L<ld(1)> and L<cpp(1)>.