4. CPPFLAGS for XPM change follows the same pattern as cygwin. Both
cygwin and MSYS2 install the XPM library in an unusual place. Since
adding an include path for cygwin was already accepted, I did not see
any issue with adding a similar solution for MSYS2.
IMO, it is a mistake in the Cygwin case as well. These issues should
be resolved in the compiler installation, not in packages. If the
user installs xpm (or any other library) she should either install its
headers and library files in the standard places, or configure the
compiler to look in the non-standard places (e.g., by setting
C_INCLUDE_PATH in the environment). Otherwise, your build environment
is not really 100% functional.
I'd urge the Cygwin Emacs maintainers to revert that special case, but
that's their call. For native Windows builds, I certainly object to
introducing this deviation.