blob: 5661f9655c4aad494cb5623a900edb3f77b34be5 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001INSTALLpc.txt - Installation of Vim on PC
2
3This file contains instructions for compiling Vim. If you already have an
4executable version of Vim, you don't need this.
5
Bram Moolenaar362e1a32006-03-06 23:29:24 +00006More information can be found here: (Very stale now.)
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
Bram Moolenaar362e1a32006-03-06 23:29:24 +00008 http://mywebpage.netscape.com/sharppeople/vim/howto/
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10The file "feature.h" can be edited to match your preferences. You can skip
11this, then you will get the default behavior as is documented, which should
12be fine for most people.
13
Bram Moolenaar02cfac82016-04-21 14:34:58 +020014This document assumes that you are building Vim for Win32 or later (Windows
15XP/2003/Vista/7/8/10). There are also instructions for pre-XP systems, but
16they might no longer work.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000017
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
19Contents:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000201. Microsoft Visual C++
212. Using MinGW
223. Cygwin
234. Borland
245. Cross compiling for Win32 from a Linux machine
256. Building with Python support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100267. Building with Python3 support
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100278. Building with MzScheme/Racket support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100289. Building with Lua support
2910. Building with Perl support
3011. Building with Ruby support
3112. Building with Tcl support
3213. Windows 3.1
3314. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000034
Bram Moolenaar30a89472016-01-10 14:35:58 +01003515. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020036
37
Bram Moolenaarc236c162008-07-13 17:41:49 +000038The currently preferred method is using the free Visual C++ Toolkit 2008
Bram Moolenaar02cfac82016-04-21 14:34:58 +020039|msvc-2008-express|, the produced binary runs on most MS-Windows systems.
Bram Moolenaar071d4272004-06-13 20:20:40 +000040
41
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000421. Microsoft Visual C++
43=======================
44
45Visual Studio
46-------------
47
Bram Moolenaar30a89472016-01-10 14:35:58 +010048Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
49VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
50should also work for VS 4 and VS 5.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +000051
Bram Moolenaar89eaa412016-07-31 14:17:27 +020052Using VS C++ 2008 Express is recommended, the binaries built with that run on
Bram Moolenaar97cc2382012-10-03 21:46:54 +020053nearly all platforms. Binaries from later versions may not run on Windows 95
54or XP.
55
Bram Moolenaar362e1a32006-03-06 23:29:24 +000056To build Vim from the command line with MSVC, use Make_mvc.mak.
57Visual Studio installed a batch file called vcvars32.bat, which you must
58run to set up paths for nmake and MSVC.
59
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000060nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
61nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
62nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000063nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000064 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000065
66Make_mvc.mak allows a Vim to be built with various different features and
67debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
68For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
69
70For compiling Gvim with IME support on far-east Windows, add IME=yes
71to the parameters you pass to Make_mvc.mak.
72
73To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
74(Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
75far more configuration.) Make_ivc.mak can also be built with nmake.
76
77nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000078 GUI Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000079nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000080 OLE Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000081
82See the specific files for comments and options.
83
84These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
85Ron Aaron; they have been tested.
86
87
Bram Moolenaar02cfac82016-04-21 14:34:58 +020088Visual C++ 2008 Express Edition *msvc-2008-express*
89-------------------------------
90
91Visual C++ 2008 Express Edition can be downloaded for free from:
92 http://www.microsoft.com/express/downloads/
93This includes the IDE and the debugger.
94
95To set the environment execute the msvc2008.bat script. You can then build
96Vim with Make_mvc.mak.
97
98For building 64 bit binaries you also need to install the SDK:
99"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
100You don't need the examples and documentation.
101
102If you get an error that Win32.mak can't be found, you have to set the
103variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
104puts include files in the following directory:
105 set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
106
107
108Visual C++ 2010 Express Edition *msvc-2010-express*
109-------------------------------
110
111Visual C++ 2010 Express Edition can be downloaded for free from:
112 http://www.microsoft.com/express/vc/Default.aspx
113This includes the IDE and the debugger.
114
115To set the environment execute the msvc2010.bat script. You can then build
116Vim with Make_mvc.mak.
117
118
119Targeting Windows XP with new MSVC *new-msvc-windows-xp*
120----------------------------------
121
122Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
123so that it targets Windows 6.0 (Vista) by default. In order to override
124this, the target Windows version number needs to be passed to LINK like
125follows:
126 LINK ... /subsystem:console,5.01
127
128Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
129Use lines like follows to target Windows XP (assuming using Visual C++ 2012
130under 64-bit Windows):
131 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
132 set SDK_INCLUDE_DIR=%WinSdk71%\Include
133 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
134 set LIB=%WinSdk71%\Lib;%LIB%
135 set PATH=%WinSdk71%\Bin;%PATH%
136 set CL=/D_USING_V110_SDK71_
137 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
138
139The following Visual C++ team blog can serve as a reference page:
140 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
141
142
143OLDER VERSIONS
144
145The minimal supported version is Windows XP. Building with older compilers
146might still work, but these instructions might be outdated.
147
148If you need the executable to run on Windows 98 or ME, use the 2003 one
149|msvc-2003-toolkit|.
150
Bram Moolenaarc236c162008-07-13 17:41:49 +0000151Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000152-----------------------
153
Bram Moolenaarc236c162008-07-13 17:41:49 +0000154You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000155 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaarc236c162008-07-13 17:41:49 +0000156Unfortunately this URL is no longer valid. Inofficial downloads appear to be
157available from links mentioned on these pages (use at your own risk):
158 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
159 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
160
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000161This contains the command-line tools (compiler, linker, CRT headers,
162and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
163To compile and debug Vim with the VC2003 Toolkit, you will also need
164|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
165and |windbg-download|.
166
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000167It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
168which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000169
170The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
171 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
172(This site also takes you through configuring a number of other
173free C compilers for Win32.)
174
175To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
176execute the following commands in a cmd.exe window (the msvcsetup.bat batch
177file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000178
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000179 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
180 call "%VCToolkitInstallDir%vcvars32.bat"
181 set MSVCVer=7.1
182 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
183 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
184
185Now you can build Vim with Make_mvc.mak.
186
187
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000188Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000189
190You will also need a copy of the Windows Platform SDK from
191 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
192Specifically, you need the Windows Core SDK subset of the Platform SDK,
193which contains the Windows headers and libraries.
194
195
196Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
197
198You need the .NET Framework 1.1 Redistributable Package from
199 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
200or from Windows Update:
201 http://windowsupdate.microsoft.com/
202This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
203which is needed to link Vim.
204
205
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000206Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000207
208You need the .NET Framework 1.1 SDK from
209 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
210This contains some additional libraries needed to compile Vim,
211such as msvcrt.lib. You must install |dotnet-1.1-redist| before
212installing the .NET 1.1 SDK.
213
214
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000215Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000216
217The Debugging Tools for Windows can be downloaded from
218 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
219This includes the WinDbg debugger, which you will want if you ever need
220to debug Vim itself. An earlier version of the Debugging Tools
221is also available through the Platform SDK, |ms-platform-sdk|.
222
223
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000224Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000225-------------------------------
226
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000227Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000228 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
229This includes the IDE and the debugger. You will also need
230|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
231
232Instructions for integrating the Platform SDK into VC Express:
233 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
234
235
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200236
Bram Moolenaar362e1a32006-03-06 23:29:24 +00002372. MinGW
238========
239
240(written by Ron Aaron: <ronaharon@yahoo.com>)
241
242This is about how to produce a Win32 binary of gvim with MinGW.
243
244First, you need to get the 'mingw32' compiler, which is free for the download
245at:
246
247 http://www.mingw.org/
248
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100249or you can use 'MinGW-w64' compiler.
250
251 http://mingw-w64.sourceforge.net/
252
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100253Or a compiler provided on msys2:
254
255 https://msys2.github.io/
256
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000257Once you have downloaded the compiler binaries, unpack them on your hard disk
258somewhere, and put them on your PATH. If you are on Win95/98 you can edit
259your AUTOEXEC.BAT file with a line like:
260
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100261 set PATH=C:\MinGW\bin;%PATH%
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000262
263or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100264System, Advanced, and edit the environment from there. If you use msys2
265compilers, set your installed paths:
266
267 C:\msys2\mingw32\bin
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200268or
269 C:\msys64\mingw32\bin
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100270
271for 32bit. And 64bit:
272
273 C:\msys2\mingw64\bin
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200274or
275 C:\msys64\mingw64\bin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000276
277Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
278
279 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100280 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000281
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100282 C:\> mingw32-make --version
283 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000284
285Now you are ready to rock 'n' roll. Unpack the vim sources (look on
286www.vim.org for exactly which version of the vim files you need).
287
288Change directory to 'vim\src':
289
290 C:\> cd vim\src
291 C:\VIM\SRC>
292
293and you type:
294
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100295 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000296
297After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
298directory.
299
300You should not need to do *any* editing of any files to get vim compiled this
301way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100302is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100303
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100304 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000305
306If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
307(also free!) and compress the file (typical compression is 50%). UPX can be
308found at
309 http://www.upx.org/
310
Bram Moolenaar91856272012-02-29 16:56:39 +0100311As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
312built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
313at:
314 http://www.matcode.com/mpress.htm
315
316
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000317ADDITION: NLS support with MinGW
318
319(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
320
321If you want National Language Support, read the file src/po/README_mingw.txt.
322You need to uncomment lines in Make_ming.mak to have NLS defined.
323
324
3253. Cygwin
326=========
327
328Use Make_cyg.mak with Cygwin's GCC. See
329 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
330
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100331With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000332Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100333running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000334with the other makefiles).
335
336
3374. Borland
338===========
339
340Use Make_bc5.mak with Borland C++ 5.x. See
341 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
342
343
3445. Cross compiling for Win32 from a Linux machine
345=================================================
346
347[Update of 1) needs to be verified]
348
349If you like, you can compile the 'mingw' Win32 version from the comfort of
350your Linux (or other unix) box. To do this, you need to follow a few steps:
351 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100352 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000353 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000354 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100355 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
356 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
357 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100358 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000359 4) make -f Make_ming.mak gvim.exe
360
361Now you have created the Windows binary from your Linux box! Have fun...
362
363
3646. Building with Python support
365===============================
366
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200367For building with MSVC 2008 the "Windows Installer" from www.python.org
368works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000369
Bram Moolenaar30a89472016-01-10 14:35:58 +0100370When building, you need to set the following variables at least:
371
372 PYTHON: Where Python is installed. E.g. C:\Python27
373 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
374 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
375
376E.g. When using MSVC (as one line):
377
378 nmake -f Make_mvc.mak
379 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
380
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200381(rest written by Ron Aaron: <ronaharon@yahoo.com>)
382
383Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000384 http://www.ActiveState.com/Products/ActivePython/
385
386After installing the ActivePython, you will have to create a 'mingw32'
387'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100388 cd $PYTHON/libs
389 pexports python20.dll > python20.def
390 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000391
392Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
393the root of the Python installation (C:\Python20, for example). If you are
394cross-compiling on Linux with the mingw32 setup, you need to also convert all
395the 'Include' files to *unix* line-endings. This bash command will do it
396easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100397 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000398
399Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100400 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000401
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100402And if you use msys2 to build python support (as one line):
403
404 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
405 PYTHON_HOME=c:/msys64/mingw64
406 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
407 DYNAMIC_PYTHON=yes
408 PYTHON_VER=27
409 DYNAMIC_PYTHON_DLL=libpython2.7.dll
410 ARCH=x86-64
411 STATIC_STDCPLUS=yes
412
413You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000414
415
Bram Moolenaar30a89472016-01-10 14:35:58 +01004167. Building with Python3 support
417================================
418
419For building with MSVC 2008 the "Windows Installer" from www.python.org
420works fine. Python 3.4 is recommended.
421
422When building, you need to set the following variables at least:
423
424 PYTHON3: Where Python3 is installed. E.g. C:\Python34
425 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
426 PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
427
428E.g. When using MSVC (as one line):
429
430 nmake -f Make_mvc.mak
431 PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
432
433
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01004348. Building with MzScheme/Racket support
435========================================
436
4371) Building with MzScheme support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000438
439(written by Sergey Khorev <sergey.khorev@gmail.com>)
440
441Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
442be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
443above (including 299 and 30x series).
444
445The MSVC build is quite straightforward. Simply invoke (in one line)
446nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
447 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
448where <MzScheme-version> is the last seven characters from MzScheme dll name
449(libmzschXXXXXXX.dll).
450If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
451DLL's, but will load them in runtime on demand.
452
453Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
454account that <Path-to-MzScheme> should contain slashes rather than backslashes
455(e.g. d:/Develop/MzScheme)
456
457"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
458explicitly) on MinGW and Cygwin requires additional step.
459
460libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
461%WINDOWS%\System32 to other location (either build directory, some temporary
462dir or even MzScheme home).
463
464Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
465make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
466 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
467
468After a successful build, these dlls can be freely removed, leaving them in
469%WINDOWS%\System32 only.
470
471
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01004722) Building with Racket support
473
474MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
475(https://racket-lang.org/) support can be built with either MSVC or MinGW (or
476Cygwin).
477
478You need to set the following variables:
479
480 MZSCHEME: Where Racket is installed.
481 E.g. C:\Program Files (x86)\Racket
482 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
483 MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3.
484 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
485 runtime. Default: $(MZSCHEME)\collects
486 User can override this with the PLTCOLLECTS environment
487 variable.
488
489E.g. When using MSVC (as one line):
490
491 nmake -f Make_mvc.mak
492 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
493 MZSCHEME_VER=3m_9z0ds0
494
495Or when using MinGW (as one line):
496
497 mingw32-make -f Make_ming.mak
498 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
499 MZSCHEME_VER=3m_9z0ds0
500
501 Spaces should be escaped with '\'.
502
503
Bram Moolenaar30a89472016-01-10 14:35:58 +01005049. Building with Lua support
505============================
506
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100507Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
508You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
509This also applies to when you get a Vim executable and don't build yourself,
510do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100511
5121) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100513
Bram Moolenaar30a89472016-01-10 14:35:58 +0100514Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100515 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100516
517Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100518lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100519MinGW.
520
521Unpack it to a working directory. E.g. C:\projects\lua53.
522Lua's header files will be installed under the include directory.
523
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100524Copy luaXY.dll to your Windows system directory. The system directory depends
525on your Windows bitness and Vim bitness:
526 32-bit Vim on 32-bit Windows: C:\Windows\System32
527 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
528 64-bit Vim on 64-bit Windows: C:\Windows\System32
529
530Or another option is copying luaXY.dll to the directory where gvim.exe
531(or vim.exe) is.
532
Bram Moolenaar30a89472016-01-10 14:35:58 +0100533
5342) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100535
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100536You need to set LUA, DYNAMIC_LUA and LUA_VER.
537
538 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
539 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
540 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100541
542E.g. When using MSVC (as one line):
543
544 nmake -f Make_mvc.mak
545 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
546
547Or when using MinGW (as one line):
548
549 mingw32-make -f Make_mingw.mak
550 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
551
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100552
553Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100554
555 make -f Make_cyg.mak
556 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
557
558
55910. Building with Perl support
560==============================
561
562Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
563You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
564
565 http://www.activestate.com/activeperl
566 http://strawberryperl.com/
567
568When building, you need to set the following variables:
569
570 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
571 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
572 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
573
574E.g. When using MSVC (as one line):
575
576 nmake -f Make_mvc.mak
577 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
578
579Or when using MinGW (as one line):
580
581 mingw32-make -f Make_mingw.mak
582 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
583
584
58511. Building with Ruby support
586==============================
587
588Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
589Ruby doesn't provide the official Windows binaries. The most widely used
590Windows binaries might be RubyInstaller.
591
592 http://rubyinstaller.org/
593
594If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
595you need some tricks described below.
596(Another binary distribution is ActiveScriptRuby:
597 http://www.artonx.org/data/asr/)
598
599When building, you need to set the following variables at least:
600
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200601 RUBY: Where ruby is installed. E.g. C:\Ruby22
602 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
603 RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X.
604 RUBY_API_VER_LONG: Ruby API version in a long format.
605 E.g. 2.2.0 for Ruby 2.2.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100606
607Ruby version vs. Ruby API version:
608
609 Ruby ver. | Ruby API ver.
610 =========================
611 1.8.X | 1.8
612 1.9.[1-3] | 1.9.1
613 2.0.0 | 2.0.0
614 2.X.Y | 2.X.0
615
616(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
617
618
619A) Using MSVC
620
621If you want to link with ruby, normally you must use the same compiler as
622which was used to build the ruby binary. RubyInstaller is built with MinGW,
623so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200624RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100625config.h and Ruby's DLL name. Here are the steps for working around them:
626
627 1) Download and Install RubyInstaller.
628 You can install RubyInstaller with the default options and directory.
629 E.g.:
630 C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit)
631
632 Ruby 2.2.X is used in this example.
633
634 2) Download Ruby 2.2.X's source code and generate config.h:
635
636 cd C:\projects
637 git clone https://github.com/ruby/ruby.git -b ruby_2_2
638 cd ruby
639 win32\configure.bat
640 nmake .config.h.time
641
642 Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code.
643 There is no need to build whole Ruby, just config.h is needed.
644 If you use 32-bit MSVC10, the config.h is generated in the
645 .ext\include\i386-mswin32_100 directory.
646
647 3) Install the generated config.h.
648
649 xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
650
651 Note that 2.2.0 is Ruby API version of Ruby 2.2.X.
652
653 4) Build Vim. Note that you need to adjust some variables (as one line):
654
655 nmake -f Make_mvc.mak
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200656 RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100657 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200658 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100659
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200660 If you set WINVER explicitly, it must be set to >=0x500, when building
661 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100662 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
663 which is used for the Ruby's DLL name.
664
665B) Using MinGW
666
667Using MinGW is easier than using MSVC when linking with RubyInstaller.
668After you install RubyInstaller, just type this (as one line):
669
670 mingw32-make -f Make_ming.mak
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200671 RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200672 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100673
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200674If you set WINVER explicitly, it must be set to >=0x500, when building with
675Ruby 2.1 or later. (Default is 0x501.)
676
Bram Moolenaar30a89472016-01-10 14:35:58 +0100677
678
67912. Building with Tcl support
680=============================
681
682Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
683You can use binaries from ActiveState (ActiveTcl).
684
685 http://www.activestate.com/activetcl
686
687When building, you need to set the following variables:
688
689 TCL: Where tcl is installed. E.g. C:\Tcl86
690 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
691 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
692 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
693
694E.g. When using MSVC (as one line):
695
696 nmake -f Make_mvc.mak
697 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
698
699Or when using MinGW (as one line):
700
701 mingw32-make -f Make_mingw.mak
702 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
703
704
70513. Windows 3.1x
706================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000707
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100708The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000709
710
Bram Moolenaar30a89472016-01-10 14:35:58 +010071114. MS-DOS
712==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000713
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100714The MS-DOS support was removed in patch 7.4.1399.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200715
716
Bram Moolenaar30a89472016-01-10 14:35:58 +010071715. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200718==========================================
719
720[provided by Michael Soyka]
721
722After you've built the Vim binaries as described above, you're ready to
723install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100724using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200725first create a "vim80" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200726zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100727correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200728
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200729 A. Create a Vim "runtime" subdirectory named "vim80"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200730 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100731 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200732 Otherwise, continue reading.
733
734 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200735 directories and create a new subdirectory named "vim80".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100736
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200737 Copy the "runtime" files into "vim80":
738 copy runtime\* vim80
Bram Moolenaar734d9982011-07-15 13:52:04 +0200739
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200740 B. Copy the new binaries into the "vim80" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200741 ----------------------------------------------------
742 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200743 new binaries you created above into "vim80":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200744
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200745 copy src\*.exe vim80
746 copy src\GvimExt\gvimext.dll vim80
747 copy src\xxd\xxd.exe vim80
Bram Moolenaar734d9982011-07-15 13:52:04 +0200748
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200749 C. Move the "vim80" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200750 ---------------------------------------------------------------------
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200751 Move the "vim80" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100752 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200753 If you already have a "vim80" subdirectory in "vim", delete it first
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100754 by running its uninstal.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200755
756 D. Install Vim
757 ---------------
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200758 "cd" to your Vim installation subdirectory "vim\vim80" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +0200759 "install.exe" program. It will ask you a number of questions about
760 how you would like to have your Vim setup. Among these are:
761 - You can tell it to write a "_vimrc" file with your preferences in the
762 parent directory.
763 - It can also install an "Edit with Vim" entry in the Windows Explorer
764 popup menu.
765 - You can have it create batch files, so that you can run Vim from the
766 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100767 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200768 - Create entries for Vim on the desktop and in the Start menu.
769
770Happy Vimming!