Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write *.pc files for pkg-config on Windows?

I've recently downloaded the gtk+ all-in-one bundle downloaded from the GTK+ website, which works fine and allows me to build gtk+ applications on Windows using the MinGW compiler.

However, when now looking at the *.pc files for pkg-config in lib/pkgconfig, I noticed something weird. Here's how the beginning of glib-2.0 looks like:

prefix=c:/devel/target/059c48de6b739307c37648aba3005b29
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

My gtk+ folder resides on a different drive than C:\ and I don't have a C:\devel folder at all. So what does this prefix stand for? What prefix would I use if I decided to write a *.pc file for easily linking my own application?

Surprisingly enough, using pkg-config works as expected and returns the correct path the libraries and headers inside the gtk+ folder.

like image 360
smf68 Avatar asked Feb 10 '11 17:02

smf68


1 Answers

The version of pkg-config that comes with the all in one package basically ignores the prefix. It knows to look in ../lib/pkgconfig for the pkg-config files. You don't need to do anything special for your pkgconfig files other than either put them in that pkgconfig directory, or set some environment variables so pkg-config knows where to look for your *.pc files.

like image 62
Matthew Talbert Avatar answered Oct 08 '22 15:10

Matthew Talbert