Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to install pkg-config on Mingw in 2014?

What is a good way at this moment (October 2014) to install pkg-config on Windows in a (no HTTPS) MinGW / MinGW-w64 environment? (See also this question from 2009.)

If there is a binary package that does not pull in GTK+, that would be great, but I haven't found one. Building from source is fine if that's the way to go.

On the Mingw FAQ it says: (This is from 2009 the latest, judging from a comment at the bottom of the page.)

How do I get pkg-config installed?

The difficulty in getting pkg-config installed is due its circular depency on glib. To install pkg-config, you should first install the GTK-runtime, the installer is found at (dead link) https://sourceforge.net/project/showfiles.php?group_id=121075. The pkg-config binary can be obtained from (new link, but does not mention pkg-config) https://www.gtk.org/download/windows.php. Place pkg-config.exe in your MinGW bin directory.

There are other pkg-config projects that don't have the circular dependency issue. They include:

  • (dead link) pkgconf

  • pkg-config-lite

I've quickly looked at pkg-config-lite, but it looks like it was last updated in 2012. Also, I think pkg-config now includes its own version of Glib to break the circular dependency, so it should be possible to build without Glib.

I've done searches for "mingw pkg-config". Any suggestions welcome.

like image 955
Felix Rabe Avatar asked Oct 19 '14 17:10

Felix Rabe


2 Answers

The way to go seems to be MSYS2 and MinGW-w64. Download MSYS2, on 32-bit Windows run msys32\autorebase.bat (this should not be needed much longer), then:

pacman -Syu  # to update the system packages

(these errors are not fatal), then

pacman -Ssq pkg-config  # to list pkg-config packages

#  for 64 bit:      ------
pacman -S mingw-w64-x86_64-pkg-config

#  for 32 bit:      ----
pacman -S mingw-w64-i686-pkg-config
like image 82
Felix Rabe Avatar answered Nov 15 '22 21:11

Felix Rabe


There is also pkg-config-lite:

  1. Install mingw-w64
  2. Install pkg-config-lite
  3. Set PKG_CONFIG_PATH to the directory containing your *.pc files (i.e. c:\mingw64\mingw64\lib\pkgconfig)
like image 37
Dominic Avatar answered Nov 15 '22 22:11

Dominic