.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PkgConfig::LibPkgConf 3" .TH PkgConfig::LibPkgConf 3 2024-11-29 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PkgConfig::LibPkgConf \- Interface to .pc file interface via libpkgconf .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use PkgConfig::LibPkgConf; \& \& if(pkgconf_exists(\*(Aqlibarchive\*(Aq)) \& { \& my $version = pkgconf_version(\*(Aqlibarchive\*(Aq); \& my $cflags = pkgconf_cflags(\*(Aqlibarchive\*(Aq); \& my $libs = pkgconf_libs(\*(Aqlibarchive\*(Aq); \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Many libraries in compiled languages such as C or C++ provide \f(CW\*(C`.pc\*(C'\fR files to specify the flags required for compiling and linking against those libraries. Traditionally, the command line program \f(CW\*(C`pkg\-config\*(C'\fR is used to query these files. This module provides a Perl level API using \f(CW\*(C`libpkgconf\*(C'\fR to these files. .PP This module provides a simplified interface for getting the existence, version, cflags and library flags needed for compiling against a package, using the default compiled in configuration of \f(CW\*(C`pkgconf\*(C'\fR. For a more powerful, but complicated interface see PkgConfig::LibPkgConf::Client. In addition, PkgConfig::LibPkgConf::Util provides some useful utility functions that are also provided by \f(CW\*(C`pkgconf\*(C'\fR. .SH FUNCTIONS .IX Header "FUNCTIONS" .SS pkgconf_exists .IX Subsection "pkgconf_exists" .Vb 1 \& my $bool = pkgconf_exists $package_name; .Ve .PP Returns true if the package is available. .PP Exported by default. .SS pkgconf_version .IX Subsection "pkgconf_version" .Vb 1 \& my $version = pkgconf_version $package_name; .Ve .PP Returns the version of the package, if it exists. Will throw an exception if not found. .PP Exported by default. .SS pkgconf_cflags .IX Subsection "pkgconf_cflags" .Vb 1 \& my $cflags = pkgconf_cflags $package_name; .Ve .PP Returns the compiler flags for the package, if it exists. Will throw an exception if not found. .PP Exported by default. .SS pkgconf_cflags_static .IX Subsection "pkgconf_cflags_static" .Vb 1 \& my $cflags = pkgconf_cflags_static $package_name; .Ve .PP Returns the static compiler flags for the package, if it exists. Will throw an exception if not found. .SS pkgconf_libs .IX Subsection "pkgconf_libs" .Vb 1 \& my $libs = pkgconf_libs $package_name; .Ve .PP Returns the linker library flags for the package, if it exists. Will throw an exception if not found. .PP Exported by default. .SS pkgconf_libs_static .IX Subsection "pkgconf_libs_static" .Vb 1 \& my $libs = pkgconf_libs_static $package_name; .Ve .PP Returns the static linker library flags for the package, if it exists. Will throw an exception if not found. .SH SUPPORT .IX Header "SUPPORT" IRC #native on irc.perl.org .PP Project GitHub tracker: .PP .PP If you want to contribute, please open a pull request on GitHub: .PP .SH "SEE ALSO" .IX Header "SEE ALSO" The best entry point to the low level \f(CW\*(C`pkgconf\*(C'\fR interface can be found via PkgConfig::LibPkgConf::Client. .PP Alternatives include: .IP PkgConfig 4 .IX Item "PkgConfig" Pure Perl implementation of \f(CW\*(C`pkg\-config\*(C'\fR which can be used from the command line, or as an API from Perl. Does not require pkg-config in your path, so is a safe dependency for CPAN modules. .IP ExtUtils::PkgConfig 4 .IX Item "ExtUtils::PkgConfig" Wrapper for the \f(CW\*(C`pkg\-config\*(C'\fR command line interface. This module will fail to install if \f(CW\*(C`pkg\-config\*(C'\fR cannot be found in the \f(CW\*(C`PATH\*(C'\fR, so it is not safe to use a dependency if you want your CPAN module to work on platforms where \f(CW\*(C`pkg\-config\*(C'\fR is not installed. .IP Alien::Base 4 .IX Item "Alien::Base" Provides tools for building non-Perl libraries and making them dependencies for your CPAN modules, even on platforms where the non-Perl libraries aren't already installed. Includes hooks for probing \&\f(CW\*(C`pkg\-config\*(C'\fR \f(CW\*(C`.pc\*(C'\fR files using either \f(CW\*(C`pkg\-config\*(C'\fR or PkgConfig. .SH ACKNOWLEDGMENTS .IX Header "ACKNOWLEDGMENTS" Thanks to the \f(CW\*(C`pkgconf\*(C'\fR developers for their efforts: .PP .SH AUTHOR .IX Header "AUTHOR" Graham Ollis .PP Contributors: .PP A. Wilcox (awilfox) .PP Petr Pisar (ppisar) .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2016 Graham Ollis. .PP This is free software; you may redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.