m4macros: Allow information from pkg-config to be overridden
PKG_CHECK_VAR, we declare
$GLIB_COMPILE_RESOURCES as Autoconf "precious variables" with
$CC, so that they can be put on a configure
If they are set to a non-empty value,
PKG_CHECK_VAR will use that
instead of auto-detecting from
pkg-config, so that builders can
override them, for example when cross-compiling.
Similarly, use the standard
PKG_CHECK_MODULES macro to get GLib's
It's possible that most of the rest of each macro can also disappear, but for the moment I've given them the benefit of the doubt.
This does result in printing "checking for GLIB" twice (once for
PKG_CHECK_MODULES and once for GLib's custom checks), but if you're
using Autotools, you probably don't have a strong objection to overly
Related to discussion on #1521 (closed).