The following guidelines described how to compile GNU Emacs with MSYS2/MinGW-w64 combination.
Set up the MSYS2/MinGW-w64 build environment
Download the x86_64 version of MSYS2 in here and install in your preferred directory, e.g.
C:\msys64. Note that path containing spaces may causes problems. Run
msys2_shell.bat in the
C:\msys64 and you will see a BASH window opened. In the BASH prompt, use the following command to install the necessary packages:
pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-xpm-nox \