如何使用MinGW-64在Windows上编译vim 64位? [英] How to compile vim 64-bit on windows using MinGW-64?

查看:341
本文介绍了如何使用MinGW-64在Windows上编译vim 64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Windows上编译vim 64位.但是我不知道如何使用MinGW-64.我可以使用32位版本的mingw-32-make进行构建.但是我没有在64位MinGW中找到任何"make"程序.您能告诉我如何使用mingw-64或我可以遵循的任何教程吗?

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?

谢谢.

推荐答案

make程序来自哪个源并不重要,它仅必须能够执行Makefile.为了用MinGW用特定的编译器和Make_ming.mak makefile编译vim,我曾经使用以下命令:

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:

  1. 导出环境变量CC设置为适当的编译器(在我的情况下,它是名为i686-pc-mingw32-gcc的32位).
  2. 导出环境变量LD设置为适当的链接器(在我的情况下,它是相似的,但是后缀-ld代替了-gcc).确保在$PATH上找到它们:我不确定要使makefile工作应该进行哪种转义,所以只是避免转义的必要.
  3. 导出环境变量prefix指向mingw所在的目录(在我的情况下是/usr/i686-mingw32:我正在交叉编译).
  4. 导出环境变量vim_cv_toupper_broken设置为yes.我不确定为什么要这么做.
  5. 最终运行make:

  1. Export environment variable CC set to the appropriate compiler (in my case it was 32-bit named i686-pc-mingw32-gcc).
  2. 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.
  3. Export environment variable prefix pointing to the directory where mingw resides (in my case it was /usr/i686-mingw32: I am cross-compiling).
  4. Export environment variable vim_cv_toupper_broken set to yes. I am not sure why I did this.
  5. 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

.您绝对不需要CROSS_COMPILECROSS选项,并且应该省略ARCH(或等于x86_64). VIMRUNTIMEDIR应该指向您打算安装vim的位置.不确定是否要转义.

. You definitely do not need CROSS_COMPILE and CROSS options and ARCH should be probably omitted (or equal to x86_64). VIMRUNTIMEDIR should point to the place where you plan to install vim. Not sure about escaping though.

导出环境变量应该使用

set var=value

,例如

set CC=x86_64-w64-mingw32-gcc

(使用可执行文件的实际名称).如果这样做不起作用,请尝试将其移至make命令行:

(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=… …

.

以及python的变量(也应在命令行中显示):

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

. (如果使用python msi安装程序PYTHONINC%PYTHON%\\include.它的90%是某些目录,其尾随路径成分是include.应至少包含Python.h文件.)

. (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.)

这篇关于如何使用MinGW-64在Windows上编译vim 64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆