Thursday, July 23, 2009

Building vim with support for Python and Perl on Windows

Previously:

install a suitable version of Visual Studio / Visual C++
install a suitable version of Python
install a suitable version of Perl
open a Visual Studio Command Prompt

I have VC Express 9.0, ActivePerl 5.10.0, and Python 2.6.2 installed from Python.org's installer.


Check out the VIM source code, you can find directions here. I suggest using CVS or SVN to make the patching life easier. Precompiled binaries of CVS and SVN are available for Windows, and it is possible to build them yourself of course ;).


I use CVS and wish to keep the tree along side my regular vim:

> cd /d P:\editors\vim
> cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout -Nd vim7-cvs-src vim7
> cd vim7-cvs-src\src

You should know read the Make_mvc.mak makefile to find the options you are interested in using. I'll leave the viewing the file from the command line to a Windows users intelligence (hints: more, edit, notepad, wordpad, or gvim would be useful). We have to tell nmake.exe to use this file and our options, for asses who use Visual Studio all day but don't remember nmake: we pass it VAR=value pairs.

> nmake /F Make_mvc.mak CPUNR=i686 FEATURES=HUGE GUI=yes OLE=yes CSCOPE=yes CTAGS=ctags POSTSCRIPT=yes PYTHON=P:\Devel\Languages\Python\2.6\ PYTHON_VER=26 PERL=P:\Devel\Languages\Perl\ PERL_VER=510

Obviously if you want same options, adjust the paths like a good little geek.

At least on my system, MSVCs compiler refuses to build the vimrun.exe, install.exe, uninstal.exe, and xxd/xxd.exe targets (and programs). As such, I build gvim and the gvimext.dll - the targets are in the makefile. if one wants to build a vim execuitable under a diffirent name, I suggest 'nmake /e VIM=foo /f ... OPTS=... foo.exe' to create foo.exe (default is gvim).


As such we need a place to put vim so we can actually use it.

> MKDIR ..\..\vim-personal
> FOR %F IN (*.dll *.exe) DO XCOPY /Y %F ..\..\vim-personal
> XCOPY /Y P:\Devel\Languages\Perl\bin\perl510.dll ..\..\vim-personal
> XCOPY /I /E /Y ..\runtime\* ..\..\vim-personal

and one can borrow the lost vimrun and diff files from a working install. If one also juggled the names so that vim-personal became vim72, one could also borrow the install.exe file most likely...



In doing all of this, I've written a batch script to use in automating the thing, which is not as good as my vimbuild shell script but still works lol. When I get some time I'll make my script also update the spell files and what nots (hint: see spell\readme.txt)

No comments:

Post a Comment