Add HAVE_GLIB check instead of checking individual libraries that use GLib.