SailfishOS - what's pkg-config?

ou started developing for the Jolla phone, downloaded the SailfoshOS SDK and started coding. After a while you stumble upon pkg-config. What's that?

bq. pkg-config is a helper tool used when compiling applications and libraries. It helps you insert the correct compiler options on the command line so an application can use gcc -o test test.cpkg-config --libs --cflags glib-2.0 for instance, rather than hard-coding values on where to find glib (or other libraries). It is language-agnostic, so it can be used for defining the location of documentation tools, for instance. Cited from

bq. The primary use of pkg-config is to provide the nec- essary details for compiling and linking a program to a library. This metadata is stored in pkg-config files. These files have the suffix .pc and reside in specific locations known to the pkg-config tool. Cited from free

That being said you find .pc files on the SailfishOS MerSDK VM. If you compile for the emulator, it is /srv/mer/targets/SailfishOS-i486-x86/usr/lib/pkgconfig So that means if you want to compile a program that depends on other libraries, there you find the names that you can use in the PkgConfigBR section of the .yaml file. Of course that does not mean that your app will be accepted in the harbor ;-) Using pkg-config in the shell directly will not provide any useful information. It is used inside the Scratchbox2 environment.