Building Vim for Windows (like "Vim Without Cream")

242 views
Skip to first unread message

Michael Henry

unread,
Aug 25, 2012, 10:02:30 AM8/25/12
to vim...@googlegroups.com
All,

I'm interested in compiling Vim for Windows. Ideally, I'd like
to replicate the "Vim Without Cream" build associated with the
"Cream" project:
http://cream.sourceforge.net/

The Cream FAQ didn't seem to have anything about building from
source:
http://cream.sourceforge.net/faq.html

I was hoping to get hold of an installation guide and ideally a
full build script that would go with it. I had no luck looking
at the source for Cream (though I'm looking for the "without
Cream" variant):
http://sourceforge.net/projects/cream/files/Cream/0.43/

I'm probably overlooking something obvious; hopefully someone
can point me in the right direction.

Note that I don't have to have "Vim Without Cream" specifically,
but it's a nicely done package with a "huge" Vim build and a
nice installer. It does nearly everything I'd like, but I would
like to customize certain things about the build (for example,
I'd like to include the ruby bindings).

I looked for alternatives. There are some tips on the Vim wiki,
but they seem out of date or not complete enough to replicate a
huge build from all sources, ideally with an installer as
well:
http://vim.wikia.com/wiki/Build_Vim_in_Windows_with_Cygwin
http://vim.wikia.com/wiki/Build_Vim_in_Windows_with_Visual_Studio
http://vim.wikia.com/wiki/Build_Python-enabled_Vim_on_Windows_with_MinGW

I took a quick look at Tony's guide:
http://users.skynet.be/antoine.mechelynck/vim/compile.htm

I didn't try these instructions because Cygwin gcc no longer
allows the -mno-cygwin flag.

Does anybody have any suggestions?

Thanks,
Michael Henry

skeept

unread,
Aug 25, 2012, 12:48:59 PM8/25/12
to vim...@googlegroups.com
Hi, I have been building vim successfully either vim visual studio or cygwin but including only perl and python, not ruby.
For visual studio assuming you have perl in C:\Perl and python in C:\Python27
and that you have the vim source folder somewhere, you just have to go into the folder src type msvc2010.bat and then

nmake -f Make_mvc.mak DYNAMIC_PYTHON=yes PYTHON="C:\Python27" PYTHON_VER=27 PERL="C:\Perl" PERL_VER=512 DYNAMIC_PERL=yes FEATURES=HUGE OLE=yes GUI=yes

this works for me, building vim with visual studio.

For building vim with cygwin, I was also stuck for a while because of that gcc option no longer being valid, but it turns out it is not a big deal.

I copied the file Make_cyg.mak to Make_cyg1.mak
and then in the file Make_cyg1.mak replaced the lines

CC = gcc
by
CC = i686-pc-mingw32-gcc

and
INCLUDES += -mno-cygwin
by
INCLUDES +=

Then I have this small perl script that I use to compile vim in cygwin
%%%%%%%%%%%%%%%%%%%%%%%%%%
#!/usr/bin/env perl

# compile vim for windows using a cross compiler in cygwing

my $python = "PYTHON=/cygdrive/c/Python27 PYTHON_VER=27 DYNAMIC_PYTHON=yes";
my $perl = "PERL=/cygdrive/c/Perl PERL_VER=512 DYNAMIC_PERL=yes";

my $makefile = "Make_cyg1.mak";

my $jflag = "-j5";

my $cmd_vim = "make -B -f $makefile GUI=no $python $perl $jflag vim.exe";
my $cmd_gvim = "make -B -f $makefile GUI=yes $python $perl $jflag gvim.exe";

print "$cmd_vim\n";
system "$cmd_vim";
print "$cmd_gvim\n";
system "$cmd_gvim";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


and then I just run this perl script to compile vim in cygwin.


I guess maybe the file Make_cyg.mak should be modified in the distribution so
that people can use that directly.

I would also like to see a guide on how to compile vim 64 bits.

Steve Hall

unread,
Aug 25, 2012, 2:54:20 PM8/25/12
to vim...@googlegroups.com
On Sat, Aug 25, 2012 at 10:02 AM, Michael Henry <v...@drmikehenry.com> wrote:
>
> I'm interested in compiling Vim for Windows. Ideally, I'd like
> to replicate the "Vim Without Cream" build associated with the
> "Cream" project:
> http://cream.sourceforge.net/

I'm the author and will be glad to help as much as I can. We keep our
build source in CVS:

http://cream.cvs.sourceforge.net/viewvc/cream/misc/

Sadly, this is all a bit out of date. BUT, I have completely updated
code and a simple installation guide at work I can push up Monday.

[...]
> It does nearly everything I'd like, but I would like to customize
> certain things about the build (for example, I'd like to include the
> ruby bindings).

I would love some help with this, the Ruby, MZscheme, python3, and TCL
all broke when our platform changed from WinXP to Win7.

--
Steve Hall [ digitect dancingpaper com ]
:: Cream for Vim http://cream.sourceforge.net

Michael Henry

unread,
Aug 26, 2012, 4:26:14 PM8/26/12
to vim...@googlegroups.com
On 08/25/2012 12:48 PM, skeept wrote:
> Hi, I have been building vim successfully either vim visual
> studio or cygwin but including only perl and python, not ruby.

Thanks for these hints. It's very helpful to have some sample
invocations.

I tried the two modifications to Make_cyg.mak, and several files
compiled, but the build halted because of a missing definition
for _MAX_PATH. I set it to 256 (as done in Make_cyg.mak when
USEDLL=yes), but the build halted again when it found
conflicting types for gettimeofday. As Steve Hall has offered
to post his build scripts for "Vim Without Cream", I think I'll
wait to see how that fares before debugging further.

> I guess maybe the file Make_cyg.mak should be modified in the
distribution so
> that people can use that directly.

It does seem like the distributed Make_cyg.mak file has fallen
behind the times a bit.

Thanks,
Michael Henry

Michael Henry

unread,
Aug 26, 2012, 4:27:45 PM8/26/12
to vim...@googlegroups.com
On 08/25/2012 02:54 PM, Steve Hall wrote:
> On Sat, Aug 25, 2012 at 10:02 AM, Michael Henry <v...@drmikehenry.com>
wrote:
>>
>> Ideally, I'd like to replicate the "Vim Without Cream" build
>> [...]
>
> I'm the author and will be glad to help as much as I can. We keep our
> build source in CVS:
>
> http://cream.cvs.sourceforge.net/viewvc/cream/misc/
>
> Sadly, this is all a bit out of date. BUT, I have completely updated
> code and a simple installation guide at work I can push up Monday.

That would be very helpful; thanks!

Michael Henry

Steve Hall

unread,
Aug 27, 2012, 9:06:28 PM8/27/12
to vim...@googlegroups.com
On Sun, Aug 26, 2012 at 4:27 PM, Michael Henry <v...@drmikehenry.com> wrote:
> On 08/25/2012 02:54 PM, Steve Hall wrote:
>> On Sat, Aug 25, 2012 at 10:02 AM, Michael Henry <v...@drmikehenry.com> wrote:
>>>
>>> Ideally, I'd like to replicate the "Vim Without Cream" build
>>
>> I'm the author and will be glad to help as much as I can. We keep our
>> build source in CVS:
>>
>> http://cream.cvs.sourceforge.net/viewvc/cream/misc/
>>
>> Sadly, this is all a bit out of date. BUT, I have completely updated
>> code and a simple installation guide at work I can push up Monday.
>
> That would be very helpful; thanks!

Ok, build sources are updated. A few hints:

build.bat This goes in your build directory. It copies vim-build.bat
to it and then calls it. Useful when your developing
vim-build.bat ;)

gvim.nsi The Nullsoft Installer script used to build the .exe. As
much as possible it references variables set in the build
script so that it doesn't really need to be edited unless
you are trying to change the behavior of the actual
installer.

*.bmp Pretty graphics I made for our installer and our Vim toolbar.

vim-build.bat The actual build script, you'll definitely need to edit
the ENVIRONMENT section to set paths, versions, etc. This
is where everything happens and most likely where every
problem will be fixed. :)

vim-build-INSTALLS.txt A cheat sheet of required dependencies.


I've got about 10 years in these files. They've become durable enough
that I sometimes don't remember how they work in places. But let me
know if you have any questions and I'll dig back into them.

I would greatly appreciate any help you can give us to fix Ruby, TCL,
and MZScheme!
Reply all
Reply to author
Forward
0 new messages