Graham Ollis π > PkgConfig-0.12026 > README.win32


Annotate this POD


View/Report Bugs


This file contains some tips for using and developing PkgConfig on the Microsoft Windows platform (without Cygwin).


Starting with Strawberry Perl, PkgConfig is included as part of Strawberry. It can be run from the command line as pkg-config, just as the c version works on Unix style platforms. Unfortunately, the version included with is incompatible with the version on CPAN.

This was fixed in the next version of Strawberry.

You may optionally patch the .pc files that come with Strawberry Perl or earlier to either get the same pkg-config capability which will come with future versions of Strawberry (if you are using 5.18 or earlier) or to fix the incompatibility that was introduced in Strawberry Simply follow these steps:

1. install PkgConfig

You will need to tell it to install the script as pkg-config:

 C:\> cpanm PkgConfig --configure-args=--script=pkg-config

You may optionally install the script as ppkg-config as well to match the behavior on Unix style platforms, though the main reason for that named version is simply to avoid replacing the "real" pkg-config commonly available on Unix style platforms.

 C:\> rem alternatively
 C:\> cpanm PkgConfig --configure--args=--script=pkg-config,ppkg-config
2. patch the .pc files that come with Strawberry

The .pc files that come with older versions of Strawberry include references to /mingw. These need to be changes to ${pcfiledir}/../... To make this easy, I have written a script to automate the task.

 C:\PkgConfig\> perl win32\

This is not done automatically as part of the install of PkgConfig because the current maintainer of PkgConfig feels that these files are the domain of the Strawberry team and the user of Strawberry.

This script will make backups of the .pc files with a .bak extension.

This script will refuse to run on newer versions of Strawberry that do not need to be patched.


This distribution contains symbolic links for historical reasons, which may be inconvenient if you are trying to run one of the scripts in the script directory. Out of respect for the original author, this design decision will not be revisited. There are some work arounds that may help.

run the .pm file

To try simple stuff out you can "run" the .pm file like it is a script.

 C:\PkgConfig\> perl lib\ libarchive --cflags
create windows symlinks

Symbolic links are available on newer versions of windows that use NTFS as the file system. Unfortunately, it appears to create them requires administrator access. I have provided a script in the win32 directory which you can use to replace the files in the script directory with real symbolic links. You will need to run this script with adminstrator rights:

 C:\PkgConfig\> perl win32\

This may not work reliably if you are using the same git repository for both MSWin32 and cygwin.

run the tests

As of commit cc2a2d8892 you should be able to run the full test suite on MSWin32 from a git repository. This works because lib/ is used as the script when MSWin32 and the .git directory are detected.

This leaves creating a tarball (make dist) and releasing it as the only activities which cannot easily be performed on Windows.

syntax highlighting: