1 of 9

PkgConfig

as a configure_requires

Graham THE Ollis <plicease@cpan.org>

YAPC :: NA 2014

25 June 2014

2 of 9

ME!

Graham THE Ollis

  • Perl programmer since 1994
  • DC.pm member since 2012
  • a.k.a. plicease

3 of 9

pkg-config

  • pkg-config
    • program for getting the cflags and libs necessary for compiling and linking against a library
  • ExtUtils::PkgConfig
    • an interface to pkg-config for Perl

4 of 9

ExtUtils::PkgConfig’s Makefile.PL

# don't go any further if pkg-config cannot be found.my $have_pkg_config = `pkg-config --version`;� �if ($have_pkg_config eq "") {� # Warn and exit with status 0 to indicate (to the user and the CPAN# testers infrastructure) that this module won't work on this machine.warn <<"__EOW__";****** ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't*** seem to be in your PATH. Is it correctly installed?*** PATH=$ENV{PATH}***__EOW__exit 0;�}

5 of 9

PkgConfig

  • Pure Perl (5.6.2+) pkg-config
  • PkgConfig API (no fork necessary)
  • No non-core deps (Perl 5.12+)
  • Maintainer is active

6 of 9

PkgConfig supported platforms

  • Debian Linux
  • Debian kFreeBSD
  • RedHat Linux
  • FreeBSD
  • NetBSD
  • OpenBSD
  • Solaris
  • cygwin
  • MSWin32

7 of 9

PkgConfig

PkgConfig is the official pkg-config for Strawberry Perl as of 5.20.0

8 of 9

Plug

Consider using PkgConfig for your next project!

Already using PkgConfig:

  • Math::GSL
  • FFI::Raw
  • Alien::Libarchive
  • Strawberry Perl

9 of 9

ME!