This is how I install emacs 30 on Windows 11, to get native compilation support.
winget install msys2.msys2 "profiles":
{
"list":
[
{
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
"guid": "{05becdfa-31e7-4900-ae5d-818333d164f6}",
"hidden": false,
"icon": "C:/msys64/mingw64.ico",
"name": "MINGW64 / MSYS2",
"startingDirectory": "%USERPROFILE%"
},
]
}In a new mingw64 session
pacman -SuyIf asked, agree to update. Then close session, and re-open. Repeat this step until no more updates.
pacman -S --needed \
base-devel \
autoconf \
git \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-xpm-nox \
mingw-w64-x86_64-gmp \
mingw-w64-x86_64-gnutls \
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 \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-harfbuzz \
mingw-w64-x86_64-libgccjit \
mingw-w64-x86_64-sqlite3 \
mingw-w64-x86_64-libtree-sitterUse github, it's a lot faster than savanah.
git clone https://github.com/emacs-mirror/emacs
cd emacs
git config core.autocrlf falsegit checkout emacs-30You may need to --force the checkout.
./autogen.sh./configure --prefix=/c/emacs \
--without-dbus \
--without-gconf \
--without-gsettings \
--without-pop \
--without-compress-install \
--with-gnutls \
--with-modules \
--with-wide-intChange 16 to no more than 3/4 of your available CPU cores.
make -j 16 bootstrap
make install- Add
C:\msys64\mingw64\bin\toPATHso the msys2 DLLs are available to the binaries. - Set
HOMEtoC:\Users\Luke
Create a shortcut to "C:\emacs\bin\runemacs.exe", probably on ~\Desktop.
Change the shortcut's Start in: value to your home folder i.e. C:\Users\Luke\
I'm using minimal-emacs
cd ~
git clone --depth 1 https://github.com/jamescherti/minimal-emacs.d .emacs.d
cd .emacs.dIn powershell or pwsh:
cd ~/.emacs.d/
New-Item -ItemType SymbolicLink -Path pre-early-init.el -Target C:\Users\Luke\Repos\dotfiles\pre-early-init.el
New-Item -ItemType SymbolicLink -Path post-early-init.el -Target C:\Users\Luke\Repos\dotfiles\post-early-init.el
New-Item -ItemType SymbolicLink -Path pre-init.el -Target C:\Users\Luke\Repos\dotfiles\pre-init.el
New-Item -ItemType SymbolicLink -Path post-init.el -Target C:\Users\Luke\Repos\dotfiles\post-init.elUse the shortcut to start emacs, so that open file/folder dialogs start at ~
(native-comp-available-p)Should evaluate to t.