问题
I tried to compile vim 64-bit on windows. But I don't know how to use MinGW-64. There's a mingw-32-make in the 32-bit version, which I could use to build. But I didn't find any 'make' program in the 64-bit MinGW. Could you please tell me how to use mingw-64, or any tutorial I could follow?
Thank you.
回答1:
It does not matter from which source make
program comes, it only just must be able to execute the Makefile. To compile vim with MinGW with specific compiler and Make_ming.mak
makefile I used to use the following:
- Export environment variable
CC
set to the appropriate compiler (in my case it was 32-bit namedi686-pc-mingw32-gcc
). - Export environment variable
LD
set to the appropriate linker (in my case it was similar, but with-ld
suffix in place of-gcc
). Be sure they are found on$PATH
: I am not sure what kind of escaping you should do to make makefile work so just avoid the necessity for escaping. - Export environment variable
prefix
pointing to the directory where mingw resides (in my case it was/usr/i686-mingw32
: I am cross-compiling). - Export environment variable
vim_cv_toupper_broken
set toyes
. I am 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 do not need
CROSS_COMPILE
andCROSS
options andARCH
should be probably omitted (or equal tox86_64
).VIMRUNTIMEDIR
should point to the place where you plan to install vim. Not sure about escaping though.
Exporting environment variables should be probably done with
set var=value
, e.g.
set CC=x86_64-w64-mingw32-gcc
(use actual name of the executable). If this does not 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 (should 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 python msi installer PYTHONINC
is %PYTHON%\\include
. It is 90% some directory whose trailing path component is include
. Should contain at least Python.h
file.)
回答2:
I just compiled VIM on MinGW and made a gist about it. I tried x86-64 (search for it), too, and with /etc/fstab changed to 64 it basically worked, just that my interpreters all were 32 and so it stopped there.
回答3:
Try to set
ARCH=x86-64 in vim74/src/Make_ming.mak
and add option CC=x86_64-w64-mingw32-gcc
, maybe it will be useful.
来源:https://stackoverflow.com/questions/19215651/how-to-compile-vim-64-bit-on-windows-using-mingw-64