|
NAMEPkgConfig::LibPkgConf::Package - Represents a packageSYNOPSISuse PkgConfig::LibPkgConf::Client; my $client = PkgConfig::LibPkgConf::Client->new; $client->env; my $pkg = $client->find('libarchive'); # use with system in scalar form: my $cflags = $pkg->cflags; my $libs = $pkg->libs; system "$cc $cflags foo.c"; system "$cc -o foo foo.o $libs"; # use with system in list form: my @cflags = $pkg->list_cflags; my @libs = $pkg->list_libs; system $cc, @cflags, 'foo.c'; system $cc, -p => 'foo', 'foo.o', @libs; DESCRIPTIONThe PkgConfig::LibPkgConf::Package object stores package information. Part of the package information is the compiler and linker flags. This can be fetched as strings with "cflags" and "libs" and as a list with "list_cflags" and "list_libs". In the string form, escapes are retained, but in list form the white space escapes are converted into spaces. That means if you are using the string form of "system"/"exec" you should use the string accessors, and if you are using the list form of "system"/"exec" you should use the list accessors.ATTRIBUTESrefcountInternal reference count used by "pkgconf".idThe id of the package.filenameThe filename of the ".pc" file.realnameThe real name for the package.versionThe version of the package.descriptionDescription of the package.urlURL for the package.pc_filedirTODOMETHODSlibsLibrary flags. This usually includes things like "-L/foo/lib" and "-lfoo".libs_staticStatic library flags.cflagsCompiler flags. This usually includes things like "-I/foo/include" and "-DFOO=1".cflags_staticStatic compiler flags.list_libsmy @fragments = $package->list_libs; Library flags as a list of fragments PkgConfig::LibPkgConf::Fragment. This is similar to the "libs" method above, but since it returns a list instead of a single string, it can be used to filter for specific flags. For example: # equivalent to pkgconf --libs-only-L my @lib_dirs = grep { $_->type eq 'L' } $package->list_libs; # equivalent to pkgconf --libs-only-l my @libs = grep { $_->type eq 'l' } $package->list_libs; list_libs_staticmy @fragments = $package->list_libs_static; Similar to "list_libs", but for the static libs flags. list_cflagsmy @fragments = $package->list_cflags; Compiler flags as a list of fragments PkgConfig::LibPkgConf::Fragment. This is similar to the "cflags" method above, but since it returns a list instead of a single string, it can be used to filter for specific flags. For example: # equivalent to pkgconf --cflags-only-I my @include_dirs = grep { $_->type eq 'I' } $package->list_cflags; # equivalent to pkgconf --cflags-only-other my @other_cflags = grep { $_->type ne 'I' } $package->list_cflags; list_cflags_staticmy @fragments = $package->list_cflags_static; Similar to "list_cflags", but for the static compiler flags. variablemy $value = $package->variable($key); Look up the value for the given variable. Returns the value if found, otherwise it will return undef (technically empty list). 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. |