How to compile vim 64-bit on Windows using MinGW-64?
I tried to compile vim 64-bit on windows. But I don't know how to use MinGW-64. There's a 32-bit version of mingw-32 that I could use to build. But I didn't find any "make" program in 64-bit MinGW. Could you please tell me how to use mingw-64 or any tutorial I could follow?
Thank.
source to share
It doesn't matter where the original program comes from make
, it just needs to be able to execute the Makefile. To compile vim with MinGW with a specific compiler and Make_ming.mak
makefile, I used the following:
- Export the environment variable
CC
to the appropriate compiler (in my case it was a 32-bit namei686-pc-mingw32-gcc
). - Export the environment variable
LD
to the appropriate linker (in my case it looked similar, but with a suffix-ld
instead-gcc
). Make sure they are found on$PATH
: I'm not sure what you need to do for make make to work, so just avoid the need for escaping. - Export the environment variable
prefix
pointing to the directory where mingw is located (in my case it was/usr/i686-mingw32
: I am cross-compiling). - Export environment variable
vim_cv_toupper_broken
valueyes
. I'm not sure why I did this. -
Finally run make:
cd {path/to/vim/repository}/src make -f Make_ming.mak FEATURES=HUGE CROSS_COMPILE=i686-pc-mingw32- OPTIMIZE=SPEED VIMRUNTIMEDIR="C:\\vim73\\runtime" CROSS=yes ARCH=i686
... You definitely don't need the
CROSS_COMPILE
and optionsCROSS
, butARCH
should be omitted (or equalx86_64
).VIMRUNTIMEDIR
should point to the location where you plan to install vim. However, not sure about the escape.
Exporting environment variables should probably be done with
set var=value
eg
set CC=x86_64-w64-mingw32-gcc
(use the actual name of the executable). If that doesn't work, try moving them to the make command line:
make -f Make_ming.mak CC=x86_64-w64-mingw32-gcc LD=… …
...
And variables for python (must also be present on the command line):
PYTHON="P:\\ath\\to\\directory\\with\\python" PYTHONINC="P:\\ath\\to\\directory\\with\\python\\header\\files" PYTHON_VER=27 PYTHON_VER_LONG=2.7.5
... (If using the python msi installer PYTHONINC
, this is %PYTHON%\\include
. This is a 90% directory whose final path component include
. Should contain at least a file Python.h
.)
source to share