Skip to content

Instantly share code, notes, and snippets.

  • Star 77 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nauhygon/f3b44f51b34e89bc54f8 to your computer and use it in GitHub Desktop.
Step-by-step instructions to build Emacs for Windows 64 bit with MSYS2 and MinGW-w64. Now `native-comp` supported.

Build Emacs-w64 with MSYS2/MinGW-w64 with Native Compilation

Instructions are modified from emacs-w64 Wiki page by zklhp. Many thanks for sharing!

  1. Download the latest MSYS2 from this download page.

  2. Install MSYS2 to, for example, C:\msys2 (make sure no space in path to avoid unwanted problems).

  3. Optionally prettify the MSYS2 console mintty with ~/.minttyrc to make it more pleasing to eyes. Thanks to this awesome theme!

ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=192,192,192
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
Yellow=181,137,0
BoldYellow=101,123,131
Blue=38,139,210
BoldBlue=131,148,150
Magenta=211,54,130
BoldMagenta=108,113,196
Cyan=42,161,152
BoldCyan=147,161,161
White=238,232,213
BoldWhite=253,246,227
BoldAsFont=yes
Font=Consolas
FontHeight=12
Transparency=off
OpaqueWhenFocused=no
ScrollbackLines=200000
FontSmoothing=full
CursorType=underscore
CursorBlinks=yes
ScrollMod=off
RightClickAction=paste
ClickTargetMod=off
  1. Remove all /c/* paths in $PATH by adding this to .bashrc and restart mintty.

This is important to avoid interference from programs installed on the same machine, especially if you have Cygwin installed.

# Remove '/c/*' from PATH if running under Msys to avoid possible 
# interference from programs already installed on system. Removal 
# with awk is copied from http://stackoverflow.com/a/370192.
if [ $(uname -o) == 'Msys' ]; then
    export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/c\// {next} {print}' | sed 's/:*$//'`
fi

The whole .bashrc is copied here.

# .bashrc
 
# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
 
##############
### Basics ###
##############
 
# Don't wait for job termination notification
set -o notify
 
# Enables UTF-8 in Putty.
# See http://www.earth.li/~huggie/blog/tech/mobile/putty-utf-8-trick.html
echo -ne '\e%G\e[?47h\e%G\e[?47l'
 
# My pretty prompt (Yay!)
PS1='\[\e[32;40m\]\u\[\e[0m\]\[\e[34;40m\]\H\[\e[0m\]\[\e[40;1m\]\w\[\e[0m\] '
 
############
### PATH ###
############
 
# Remove '/c/*' from PATH if running under Msys to avoid possible 
# interference from programs already installed on system. Removal 
# with awk is copied from http://stackoverflow.com/a/370192.
if [ $(uname -o) == 'Msys' ]; then
    export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/c\// {next} {print}' | sed 's/:*$//'`
fi
 
###############
### Aliases ###
###############
 
 
alias less='less -r'
alias rm='rm -i'
alias whence='type -a'
alias ls='ls -F --color=auto'
alias dir='ls --color=auto --format=long -L'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias md='mkdir'
alias pico='nano'
alias cls='clear'
  1. Install packages required to build Emacs.

Follow instructions on this page first.

pacman -Syu
pacman -Sy
pacman -Sy\
    --needed \
    filesystem \
    msys2-runtime \
    bash \
    libreadline \
    libiconv \
    libarchive \
    libgpgme \
    libcurl \
    pacman \
    ncurses \
    libintl
    

Close mintty and restart it, do this again.

pacman -Su

Then let us install all required libs for building Emacs.

pacman -Su \
    autoconf \
    autogen \
    automake \
    automake-wrapper \
    diffutils \
    git \
    guile \
    libgc \
    libguile \
    libidn-devel \
    libltdl \
    libnettle-devel \
    libopenssl \
    libp11-kit-devel \
    libtasn1-devel \
    libunistring \
    make \
    mingw-w64-x86_64-binutils \
    mingw-w64-x86_64-bzip2 \
    mingw-w64-x86_64-cairo \
    mingw-w64-x86_64-crt-git \
    mingw-w64-x86_64-dbus \
    mingw-w64-x86_64-expat \
    mingw-w64-x86_64-fontconfig \
    mingw-w64-x86_64-freetype \
    mingw-w64-x86_64-gcc \
    mingw-w64-x86_64-gcc-libs \
    mingw-w64-x86_64-gdk-pixbuf2 \
    mingw-w64-x86_64-gettext \
    mingw-w64-x86_64-giflib \
    mingw-w64-x86_64-glib2 \
    mingw-w64-x86_64-gmp \
    mingw-w64-x86_64-gnutls \
    mingw-w64-x86_64-harfbuzz \
    mingw-w64-x86_64-headers-git \
    mingw-w64-x86_64-imagemagick \
    mingw-w64-x86_64-isl \
    mingw-w64-x86_64-jansson \
    mingw-w64-x86_64-libffi \
    mingw-w64-x86_64-libgccjit \
    mingw-w64-x86_64-libiconv \
    mingw-w64-x86_64-libidn2 \
    mingw-w64-x86_64-libjpeg-turbo \
    mingw-w64-x86_64-libpng \
    mingw-w64-x86_64-librsvg \
    mingw-w64-x86_64-libsystre \
    mingw-w64-x86_64-libtasn1 \
    mingw-w64-x86_64-libtiff \
    mingw-w64-x86_64-libunistring \
    mingw-w64-x86_64-libwinpthread-git \
    mingw-w64-x86_64-libxml2 \
    mingw-w64-x86_64-mpc \
    mingw-w64-x86_64-mpfr \
    mingw-w64-x86_64-nettle \
    mingw-w64-x86_64-p11-kit \
    mingw-w64-x86_64-pango \
    mingw-w64-x86_64-pixman \
    mingw-w64-x86_64-winpthreads \
    mingw-w64-x86_64-xpm-nox \
    mingw-w64-x86_64-xz \
    mingw-w64-x86_64-zlib \
    mingw-w64-x86_64-jbigkit \
    nano \
    openssl \
    pkgconf \
    tar \
    texinfo \
    wget
      
  1. Get emacs source.
mkdir emacs; cd emacs
git clone http://git.savannah.gnu.org/r/emacs.git emacs
git config core.autocrlf false
  1. Build Emacs!

Change target accordingly, the directory in which the freshly built Emacs binaries, libraries, and docs live.

target=/c/emacs

export PATH=/mingw64/bin:$PATH
 
mkdir build; cd build

(cd ../emacs; ./autogen.sh)

export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig

../emacs/configure \
    --host=x86_64-w64-mingw32 \
    --target=x86_64-w64-mingw32 \
    --build=x86_64-w64-mingw32 \
    --with-native-compilation \
    --with-gnutls \
    --with-imagemagick \
    --with-jpeg \
    --with-json \
    --with-png \
    --with-rsvg \
    --with-tiff \
    --with-wide-int \
    --with-xft \
    --with-xml2 \
    --with-xpm \
    'CFLAGS=-I/mingw64/include/noX' \
    prefix=$target
 
make
 
make install prefix=$target

# Only needed for standalone dist (wo MSYS2 env)
# cp /mingw64/bin/*.dll $target/bin
@LensPlaysGames
Copy link

I follow the entire guide, msys2 mingw64 shell, etc. No errors or anything during compilation or installation, but when trying to run the executable I get the following error.

image

@nauhygon
Copy link
Author

nauhygon commented Jan 1, 2023

I follow the entire guide, msys2 mingw64 shell, etc. No errors or anything during compilation or installation, but when trying to run the executable I get the following error.

Sounds strange. How did you start Emacs?

@LensPlaysGames
Copy link

LensPlaysGames commented Jan 3, 2023

I follow the entire guide, msys2 mingw64 shell, etc. No errors or anything during compilation or installation, but when trying to run the executable I get the following error.

Sounds strange. How did you start Emacs?

.\emacs.exe -Q from a non-msys2 shell

I also tried double clicking from file explorer, to no avail.

I can run it from within an msys2 mingw64 shell; how can I make it to where I don't need to run it from there? I've tried looking at other precompiled binaries and making sure I have all the same files in bin that they do (i.e. gzip.exe and all the DLLs and whathaveyou), but I still get this same cryptic error.

EDIT: here is the script I am using to copy runtime dependencies. What could I possibly be missing?

@LensPlaysGames
Copy link

LensPlaysGames commented Jan 3, 2023

After copying literally all of /usr/bin and /mingw64/bin into emacs/bin install location, it now gives me this error and exits with -1 return status

Warning: arch-dependent data dir 'c:/emacs/libexec/emacs/30.0.50/x86_64-w64-mingw32/': No such file or directory
Warning: Lisp directory 'c:/emacs/share/emacs/30.0.50/lisp': No such file or directory
Cannot open load file: No such file or directory, loadup.el

It looks like it's not respecting the install location when looking for natively compiled LISP? How would this work, since the executable ends up in the right place?

I'm using this

PREFIX="${HOME}/emacs/bin"

export PATH=/mingw64/bin:$PATH
export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig

rm -rf bin
rm -rf build
rm -rf emacs

cp -r emacs-src emacs


mkdir build
cd build

../emacs/configure \
    --host=x86_64-w64-mingw32 \
    --target=x86_64-w64-mingw32 \
    --build=x86_64-w64-mingw32 \
    --with-native-compilation \
    --with-gnutls \
    --with-imagemagick \
    --with-jpeg \
    --with-json \
    --with-png \
    --with-rsvg \
    --with-tiff \
    --with-wide-int \
    --with-xft \
    --with-xml2 \
    --with-xpm \
    --without-pop \
    prefix=$PREFIX

make -j7
make install

@LensPlaysGames
Copy link

LensPlaysGames commented Jan 6, 2023

I made it closer, still to no avail. NOW I am able to run it once with no issues (init file even loads), but certain things don't work that require native compilation. Any time a package is attempted to be loaded/compiled, the following error occurs (with the package being loaded's name instead of use-package-core).

error: Eager macro-expansion failure: (native-lisp-load-failed "c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/30.0.50-7eac5280/use-package-core-c8f76aee-0367eb9c.eln" "%1 is not a valid Win32 application.")

What is %1 is not a valid Win32 application?

On subsequent startups (after the first time), the init file is not loaded as an error occurs before it can; the very same error you see up above.

EDIT:

btw, to get it to work, I had to first copy all of /usr/bin and then all of /mingw64/bin/ and then install emacs there :p

Also, here is the output regarding a "solution" related to 32-bit vs 64-bit dependencies and executables I've seen wagered on the internet with this error: I assure you, all of the copied dependencies are for a 64-bit system, same as my CPU. Here is a little example with grep run from the install location bin subdirectory

> file * | grep "x86-64" | wc && file * | wc
    931   11357  109945
    931   11357  109945

@LensPlaysGames
Copy link

LensPlaysGames commented Jan 31, 2023

Honestly at this point it just feels like I am cursed; the universe does not want me compiling Emacs myself, I guess.

image

This is on a fresh install of msys2. I ensured path was very limited (only within the msys2 env), as well as following all build steps listed in INSTALL.W64 and such... This is from trying to run it like so, from the mingw64 msys2 shell: c:/Emacs/bin/newbin/emacs.exe -Q

I get this in stdout, along with the WinAPI popup

Warning: arch-dependent data dir 'c:/emacs/libexec/emacs/30.0.50/x86_64-w64-mingw32/': No such file
or directory
Warning: Lisp directory 'c:/emacs/share/emacs/30.0.50/lisp': No such file or directory

@nauhygon
Copy link
Author

nauhygon commented Jan 31, 2023

Honestly at this point it just feels like I am cursed; the universe does not want me compiling Emacs myself, I guess.

image

This is on a fresh install of msys2. I ensured path was very limited (only within the msys2 env), as well as following all build steps listed in INSTALL.W64 and such... This is from trying to run it like so, from the mingw64 msys2 shell: c:/Emacs/bin/newbin/emacs.exe -Q

I get this in stdout, along with the WinAPI popup

Warning: arch-dependent data dir 'c:/emacs/libexec/emacs/30.0.50/x86_64-w64-mingw32/': No such file
or directory
Warning: Lisp directory 'c:/emacs/share/emacs/30.0.50/lisp': No such file or directory

Oh sorry for the long struggle! I see the following line in your build script.

PREFIX="${HOME}/emacs/bin"

Why not just "${HOME}/emacs"? When built, a subdir bin will be created. If you want to invoke Emacs in MSYS2 shell, then just add "${HOME}/emacs/bin" to PATH. Only when you want to be able to invoke Emacs in Windows (like double clicking on runemacs.exe in Windows Explorer to start Emacs) do you copy over all the mingw64 DLLs (/mingw64/bin/*.dll). And when you do, copy them to "${HOME}/emacs/bin".

@LensPlaysGames
Copy link

Why not just "${HOME}/emacs"

I already have stuff in that folder (i.e. this build script) so I didn't want to make a mess. I figured that emacs/bin was as good as place as any to put it; then I'd add emacs/bin/bin to PATH.

But it sounds like you may be hinting that this naming clash could be causing confusion, for example if it strips the bin in some places but not others. So I should try setting prefix to something like "${HOME}/emacs/built"?

@nauhygon
Copy link
Author

nauhygon commented Feb 1, 2023

But it sounds like you may be hinting that this naming clash could be causing confusion, for example if it strips the bin in some places but not others. So I should try setting prefix to something like "${HOME}/emacs/built"?

In your messages above, the paths just look a bit too complicated. :-)

${HOME}/emacs/bin
c:/Emacs/bin/newbin/
c:/emacs/libexec/emacs/
......

If I may, I'd suggest to simplify it as much as possible by starting from scratch (clean slate) and simply following the instructions. First make it work in MSYS2 shell, then make it work outside of MSYS2. Once it works, tweak as much as you like.

@LensPlaysGames
Copy link

LensPlaysGames commented Feb 1, 2023

Doesn't matter anyway.

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: treesit.o: in function `Ftreesit_query_capture':
C:\msys64\home\MrTinyToes\emacs\build\src/../../emacs/src/treesit.c:2723: undefined reference to `ts_query_pattern_count'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:705: temacs.exe] Error 1

I can't even begin to build it now, really. Honestly I'm just so frustrated with this whole process. I've started over and followed different sets of instructions so many times that I just have lost interest in this entirely. At this point I just want to use Emacs, I don't care where I get it from (although I would absolutely be thrilled to build my own, I can't).

EDIT: btw the reason for the "complicated paths' is simply that I changed prefix from the time that I posted the script to the time I posted that particular problem. PREFIX="c:/Emacs/bin"

EDIT2: I think there would be a literal revolution if somebody could make autotools builds work consistently for Windows. Even cross compiling, so much stuff just doesn't work it's so annoying

@nauhygon
Copy link
Author

nauhygon commented Feb 1, 2023

I can't even begin to build it now, really. Honestly I'm just so frustrated with this whole process. I've started over and followed different sets of instructions so many times that I just have lost interest in this entirely. At this point I just want to use Emacs, I don't care where I get it from (although I would absolutely be thrilled to build my own, I can't).

Understand your frustration, but you were able to build it before. Right? This error seems to happen on the master branch only (some tree-sitter related issues and should be fixed in the future I believe). For now, try to clone and build emacs-29 branch, which is more stable.

git clone --branch emacs-29 http://git.savannah.gnu.org/r/emacs.git emacs

If you just want to use pre-built Emacs, simply install the Emacs package that comes with MSYS2.

pacman -S mingw-w64-x86_64-emacs

@LensPlaysGames
Copy link

I appreciate you dealing with me even when I'm frustrated.

I changed the build directory to not end in bin. It seems this was the cause of my errors; looking back, I can see now it's looking in C:/emacs/libexec, whereas it should have been looking in C:/emacs/bin/libexec. I guess some places automatically truncate bin off the end, and others don't?


I followed the instructions, this time cloning emacs-29 branch instead, as per your suggestion. However, when I came back from Lunch to check if it had worked: it failed. However however, I was surprised to see it was an error I've seen (and solved) before, related to Makefiles and git newline stuff. And then I remembered I didn't configure core.autocrlf in the newly cloned directory. So I removed everything (ugh, again), and then started fresh (ugh again). This time I remembered to run git config. And it worked!! Emacs 29 has been built on my system, and works from the MSYS2 shell... I was even able to get it to work from windows explorer runemacs.exe, but I had to run the following from shell:

export PREFIX="c:/Emacs/built" # matches configure and install prefix
cp -n /usr/bin/*.dll "${PREFIX}/bin"
cp -n /usr/bin/*.exe "${PREFIX}/bin"
cp -n /mingw64/bin/*.dll "${PREFIX}/bin"
cp -n /mingw64/bin/*.exe "${PREFIX}/bin"

Once again, I do sincerely thank you for helping me through this process. It's literally been weeks I've been trying to solve some of these things, and it turned out to be a directory name 💀

@nauhygon
Copy link
Author

nauhygon commented Feb 1, 2023

Awesome - glad it worked out for you! 👍

@LensPlaysGames
Copy link

I'm now getting this error upon running my config (instead of with -Q)

 »  Error (use-package): auto-compile/:config: Native compiler error: (lambda (arg0 &optional arg1 arg2 arg3 arg4) (let ((f #'load)) (funcall f arg0 arg1 arg2 arg3 arg4))), "Compiling c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln...
ld: cannot find dllcrt2.o: No such file or directory
ld: cannot find crtbegin.o: No such file or directory
ld: cannot find -lmingw32
ld: cannot find -lgcc_s
ld: cannot find -lgcc
ld: cannot find -lmoldname
ld: cannot find -lmingwex
ld: cannot find -lmsvcrt
ld: cannot find -lkernel32
ld: cannot find -lpthread
ld: cannot find -ladvapi32
ld: cannot find -lshell32
ld: cannot find -luser32
ld: cannot find -lkernel32
ld: cannot find -lmingw32
ld: cannot find -lgcc_s
ld: cannot find -lgcc
ld: cannot find -lmoldname
ld: cannot find -lmingwex
ld: cannot find -lmsvcrt
ld: cannot find -lkernel32
ld: cannot find crtend.o: No such file or directory

Error: native-ice (\"failed to compile\" \"c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln\" \"error invoking gcc driver\")
  debug-early-backtrace()
  debug-early(error (native-ice \"failed to compile\" \"c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln\" \"error invoking gcc driver\"))
  comp--compile-ctxt-to-file(\"c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln\")
  comp-compile-ctxt-to-file(\"c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln\")
  comp-final1()
  load-with-code-conversion(\"c:/Users/MrTinyToes/AppData/Local/Temp/emacs-int-comp-subr--trampoline-6c6f6164_load_0-BXbNTa.el\" \"c:/Users/MrTinyToes/AppData/Local/Temp/emacs-int-comp-subr--trampoline-6c6f6164_load_0-BXbNTa.el\" nil t)
  command-line-1((\"-l\" \"c:/Users/MRTINY~2/AppData/Local/Temp/emacs-int-comp-subr--trampoline-6c6f6164_load_0-BXbNTa.el\"))
  command-line()
  normal-top-level()
c:\\Emacs\\built\\bin\\libgccjit-0.dll: error: error invoking gcc driver
Internal native compiler error: \"failed to compile\", \"c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln\", \"error invoking gcc driver\"
"

@LensPlaysGames
Copy link

The above error message only occurs the first ever time Emacs runs after being compiled. Subsequent runs error with:

Error (use-package): auto-compile/:config: Native elisp load failed: "c:/Users/MrTinyToes/AppData/Roaming/.emacs.d/eln-cache/29.0.60-49a1868c/subr--trampoline-6c6f6164_load_0.eln", "%1 is not a valid Win32 application."

I get these errors everytime something tries to native compile (which is often when opening new buffers and new code gets run). UGHGHGIH. I'm happy it works but it's just about the most annoying possible way of "working" possible where I constantly get bombarded with error popups non-stop as well as native compilation just not working at all

@LensPlaysGames
Copy link

While some things continue to work, others do not. magit is completely broken and, as such, so is this build of Emacs. Once again thwarted by my curse, I guess.

cl-generic-ensure-function: transient--init-suffix-key is already defined as something else than a generic function

That error appears every time I try to run any magit command. Building software in the modern world sucks

@enderozcan
Copy link

enderozcan commented Feb 18, 2023

I had to do run the below command before execute ./autogen.sh
sed -i $'s/\r$//' "configure.ac"

@gwijayas
Copy link

gwijayas commented Jun 1, 2023

need installing mingw-tree-sitter for tree-sitter , and sqlite3 for sqlite support on emacs 29

@JonatanSahar
Copy link

JonatanSahar commented Jul 30, 2023

Hi, thanks for this guide!
make install can't find libgccjit, even though I've installed and reinstalled it - everything else up to that point worked smoothly though...
Any ideas?

checking for harfbuzz >= 1.2.3... yes
checking for X11/xpm.h... yes
checking for jpeglib 6b or later... no
checking for lcms2... yes
checking for library containing inflateEnd... -lz
checking for dladdr... no
checking for dlfunc... no
checking for gcc_jit_context_acquire in -lgccjit... no
configure: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.
make: *** [Makefile:573: config.status] Error 1
$ pacman -Su     mingw-w64-x86_64-libgccjit
warning: mingw-w64-x86_64-libgccjit-13.1.0-7 is up to date -- reinstalling
:: Starting core system upgrade...
 there is nothing to do
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-x86_64-libgccjit-13.1.0-7

Total Installed Size:  52.89 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                               [###############################] 100%
(1/1) checking package integrity                             [###############################] 100%
(1/1) loading package files                                  [###############################] 100%
(1/1) checking for file conflicts                            [###############################] 100%
(1/1) checking available disk space                          [###############################] 100%
:: Processing package changes...
(1/1) reinstalling mingw-w64-x86_64-libgccjit                [###############################] 100%

@nauhygon
Copy link
Author

Quite odd. Did you do make first, then make install?

@JonatanSahar
Copy link

actually, now I look back and I see make failed for the same reason - I could have sworn I saw it succeed!

@nauhygon
Copy link
Author

nauhygon commented Jul 30, 2023

Start with a fresh git clone and try again? Which branch are you on?

@JonatanSahar
Copy link

I didn't make any changes to the code, I'm on the emacs-29 branch

@JonatanSahar
Copy link

I just checked out a clean repo, and running make I get a lot of these messages:

CC time_rz.o
cc1.exe: warning: C:/msys64/mingw64/include/noX: No such file or directory [-Wmissing-include-dirs]

and also some other warnings like:

]
  430 |     XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0))
      |                        ^~~~~~~~~~~~~~~~
../../emacs/src/lisp.h:1212:10: note: in expansion of macro 'lisp_h_make_fixnum_wrap'
 1212 |   return lisp_h_make_fixnum_wrap (n);
      |          ^~~~~~~~~~~~~~~~~~~~~~~
../../emacs/src/frame.c: In function 'Fx_parse_geometry':
../../emacs/src/frame.c:5641:23: note: 'height' was declared here
 5641 |   unsigned int width, height;

is that normal?

@JonatanSahar
Copy link

I do have:

ls /mingw64/bin |grep xpm
cxpm-noX.exe

and

 echo $PATH
/mingw64/bin:/ucrt64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/c/msys64/mingw64/bin/

@JonatanSahar
Copy link

I've removed the CFLGAS including nox, and I notice that already here I get a lot of

checking for WebPGetInfo... no
checking for libwebpdemux >= 0.6.0 libwebpdecoder >= 0.6.0... no
checking for sqlite3_open_v2 in -lsqlite3... no
checking for getaddrinfo_a in -lanl... no
checking for malloc_trim... no
checking for dbus-1 >= 1.0... no
checking for lgetfilecon in -lselinux... no
checking for gnutls >= 2.12.2... no
checking for libsystemd >= 222... no
checking for jansson >= 2.7... no
checking for tree-sitter >= 0.20.2... no
checking for tree-sitter >= 0.6.3... no
checking for windows.h... yes
checking for harfbuzz >= 1.2.3... no
checking for X11/xpm.h... no
checking for jpeglib 6b or later... no
checking for lcms2... no
checking for library containing inflateEnd... -lz
checking for dladdr... no
checking for dlfunc... no
checking for gcc_jit_context_acquire in -lgccjit... no

at least some of which were installed in previous steps.. any idea why the compiler will not pick up on them? the PATH var I posted looks alright?

@JonatanSahar
Copy link

where does configure look for these packages? I looked around and it looks like it's using test but I really don't know much about makefiles etc.

@knelby
Copy link

knelby commented Oct 30, 2023

Hi. Thanks for posting this. I'm very much a newbie so this is super helpful. However, the link to SourceForge (http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/) is dead for me.

@nauhygon
Copy link
Author

Hi. Thanks for posting this. I'm very much a newbie so this is super helpful. However, the link to SourceForge (http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/) is dead for me.

Please ignore the sf link and just follow the steps below. I was trying to give due credits to the authors of that page.

@knelby
Copy link

knelby commented Nov 1, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment