text
stringlengths
0
834k
# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
# -pthread -lgio-2.0 -lz -lresolv -lgobject-2.0
# -lgmodule-2.0 -ldl -lgthread-2.0 -pthread -lrt -lglib-2.0
C<pkg-config.pl> can be used as an alias for C<ppkg-config> on platforms that
support it. It can also be installed as C<pkg-config> though this is not
recommended if your system has a native C<pkg-config>.
Compare to:
$ pkg-config --libs --cflags --static gio-2.0
#outputs ( """" ):
# -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
# -pthread -lgio-2.0 -lz -lresolv -lgobject-2.0 -lgmodule-2.0
# -ldl -lgthread-2.0 -lrt -lglib-2.0
=head2 From another Perl module
use PkgConfig;
my $o = PkgConfig->find('gio');
if($o->errmsg) {
#handle error
} else {
my $prefix = $o->get_var('prefix');
my @cflags = $o->get_cflags;
my @ldflags = $o->get_ldflags;
}
=head1 DESCRIPTION
C<PkgConfig> provides a pure-perl, core-only replacement for the C<pkg-config>
utility.
This is not a description of the uses of C<pkg-config> but rather a description
of the differences between the C version and the Perl one.
While C<pkg-config> is a compiled binary linked with glib, the pure-perl version
has no such requirement, and will run wherever Perl ( >= 5.6 ) does.
The main supported options are the common C<--libs>, C<--cflags>,
C<--static>, C<--exists> and C<--modversion>.
=head2 SCRIPT OPTIONS
=head3 USAGE
<packagename1 pkgname2..> [ --options ]
=head3 ARGUMENTS
By default, a library name must be supplied unless one of L<--version>,
or L<--real-version> is specified.
The output should normally be suitable for passing to your favorite compiler.
=head4 --libs
(Also) print linker flags. Dependencies are traverse in order. Top-level dependencies
will appear earlier in the command line than bottom-level dependencies.
=head4 --libs-only-L
Prints -L/-R part of ""--libs"". It defines library search path but without libraries to link with.
=head4 --libs-only-l
Prints the -l part of ""--libs"".
=head4 --libs-only-other
Prints the part of ""--libs"" not covered by ""--libs-only-L""
and ""--libs-only-l"", such as ""--pthread"".
=head4 --list-all
List all know packages.
=head4 --cflags
(Also) print compiler and C preprocessor flags.
=head4 --cflags-only-I
Prints the -I part of ""--cflags""
=head4 --cflags-only-other
Prints the parts of ""--cflags"" not covered by ""--cflags-only-I"".
=head4 --modversion
Print the version of a given package.
=head4 --static
Use extra dependencies and libraries if linking against a static version of the
requested library