m4macros: Allow information from pkg-config to be overridden

By using PKG_CHECK_VAR, we declare $GLIB_COMPILE_SCHEMAS,
$GLIB_GENMARSHAL, $GOBJECT_QUERY, $GLIB_MKENUMS and
$GLIB_COMPILE_RESOURCES as Autoconf "precious variables" with AC_ARG_VAR,
similar to $PKG_CONFIG and $CC, so that they can be put on a configure
command line:

    ./configure GLIB_COMPILE_RESOURCES=my-glib-compile-resources

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 CFLAGS
and LIBS.

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
verbose output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
9 jobs for <span class="ref-name">m4macros</span> in 29 minutes and 20 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Build
passed #116856
cross-android_api21_arm64

00:01:37

passed #116857
cross-android_api28_arm64

00:01:35

passed #116858
cross-mingw64

00:02:13

passed #116855
fedora-autotools-x86_64

00:05:45

passed #116854
fedora-x86_64

00:05:24

manual #116861
freebsd-11 allowed to fail manual
freebsd-11-x86_64
passed #116859
win32
msys2-mingw32

00:10:21

passed #116860
win32
vs2017-x64

00:07:45

 
  Coverage
passed #116862
coverage

00:02:22

74.6%