Reply 40 of 244, by kjliew
Though I have never used macOS systems, it is obvious to me that either you don't really understand how your "homebrew" works or your pkg-config is simply broken. There is nothing magic about pkg-config, it just needs to know where to look for *.pc files. Some pkg-config ports could be really dumb, they hard-coded the path for all the *.pc files. Some smarter pkg-config ports will use relative path and resolve the absolute path from where it was invoked and end up with *basedir*/lib/pkgconfig where all the *.pc files are stored.
QEMU configure script depends on pkg-config (typical Linux style build) to resolve the libraries dependencies. You should have checked the pkg-config sanity with
$ pkg-config --list-all | grep -i glib
$ pkg-config --modversion glib-2.0
If the above commands failed, then you don't have a sane build environment and you got to fix that. Using environment override "export XXX" could work sometimes, but personally I would refrain from doing so to get things going. It is an obvious indication that somethings was wrong if environment overrides are needed.