Guideline for building GNU Emacs with MSYS2/MinGW-w64
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:
1 | pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-xpm-nox \ |
These packages are:
Build required package
- base-devel
- mingw-w64-x86_64-toolchain
Optional
- mingw-w64-x86_64-toolchain
- For various image formats
- mingw-w64-x86_64-libtiff
- mingw-w64-x86_64-giflib
- mingw-w64-x86_64-libpng
- mingw-w64-x86_64-libjpeg-turbo
- mingw-w64-x86_64-librsvg
- For libxml2
- mingw-w64-x86_64-libxml2
- For GnuTLS
- mingw-w64-x86_64-gnutls
Get the source code
Follow the instruction in savannah. Or download the release version in gnu ftp. It should be noted that the the autocrlf feature of git may mess up the configure file. Therefore it is better to disable this feature by running the command:
1 | git config core.autocrlf false |
configure; make; make install
Run mingw64_shell.bat in C:\msys64
. This will open a BASH window for MinGW-w64 environment. In the BASH prompt, chdir to the directory of source code. Then run the following commands to build Emacs and install in C:\emacs
. If you are building the development version, the first line of the commands will be needed.
1 | ./autogen.sh |
Note that I disable imagemagick because it breaks the build process.
If all of the above are successfully done, you should have an Emacs installed in C:\emacs
. However, it may not work properly since it depends on DLLs in the MinGW-w64 environment. I use the following command to make sure the DLLs are placed with the execution file:
1 | cp /mingw64/bin/{libwinpthread-*.dll,libXpm-noX*.dll,libdbus-*.dll} /c/emacs/bin |
If you only run Emacs in your PC and your MinGW-w64 binary folder (e.g. C:\msys64\mingw64\bin
) is in PATH the above copy step can be optional.
Run
Double click the runemacs.exe in C:\emacs\bin
. If no errors occur, you have successfully builded the 64-Bit version of GNU Emacs.
或者您可以把评论发在别处,添加指向本页的连接,然后把网址告诉我:
本文标题:Guideline for building GNU Emacs with MSYS2/MinGW-w64
文章作者:Chris
发布时间:2015-01-23
最后更新:2022-03-23
原始链接:https://chriszheng.science/2015/01/23/Guideline-for-building-GNU-Emacs-with-MSYS2-MinGW-w64/
版权声明:本博客所有文章除特别声明外,均采用 CC BY 4.0 许可协议。转载请注明出处!
分享