Various developers discourage the usage of the PKG_CHECK_MODULES
(for example, in this answer) but there is no clear, comprehensive explanation of their reasons as far as I've looked for. So, I ask:
- Why would
PKG_CHECK_MODULES
be harmful? - What are the alternatives?
I, for one, used it for the first time today. I found it invaluably useful, specially for dealing with pretty intricate library sets, such as GTK+, where I have all these dependencies:
-I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0
-I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12
-lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0
-lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0
pkg-config
that William Pursell usually proposes, the reality is that there are entire platforms such as GTK that work the 'wrong' way and fixing it would require all of those libraries to change the directory they install themselves to. This would cause massive breakage of the build systems of existing applications. Since I don't think the 'wrong' way actually causes any harm, it's not worth changing. – Conventionalizepkg-config
allows you to keep incompatible versions of libraries (such as GTK 2 and GTK 3) installed in parallel. Although I'm sure William Pursell has thought about this and will be happy to explain how to do it his way ;-) – Conventionalizepkg-config
crack pipe. It just took motivation and a clear direction forward. Gtk4 and even Gtk3 now build "right" with Meson. (Which is... whatever. It's not CMake, but it's "fine". Rubs me the wrong way for some reason, always has, but it beats autotools. A pair of tweezers, two rusty nails, and a jar of marmalade is a better build configurator than autotools.) – Radionuclide