https://bugs.winehq.org/show_bug.cgi?id=31836
--- Comment #37 from Rafał Mużyło galtgendo@o2.pl --- The way I read wine's configure.ac and glibconfig.h, the check you really want here is slightly different and in a slightly different position.
Namely, first the checks AC_CHECK_HEADER/AC_CHECK_LIB should run. Then, if they succeed, the next check to run would be AC_COMPILE_IFELSE for 'GLIB_SIZEOF_LONG == sizeof(long)'. If that fails, you want to AC_MSG_ERROR right here, cause this would mean exactly that the mentioned toolchain mistake took place.