blob: c711b85b1f27398a628cfcc143e9e049cfaccd26 [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
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +02003213. Building with Terminal support
3314. Windows 3.1
3415. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000035
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +02003616. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020037
38
Bram Moolenaarc236c162008-07-13 17:41:49 +000039The currently preferred method is using the free Visual C++ Toolkit 2008
Bram Moolenaar02cfac82016-04-21 14:34:58 +020040|msvc-2008-express|, the produced binary runs on most MS-Windows systems.
Bram Moolenaar071d4272004-06-13 20:20:40 +000041
42
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000431. Microsoft Visual C++
44=======================
45
Bram Moolenaar73f44392017-10-07 18:38:43 +020046We do not provide download links, since Microsoft keeps changing them. You
47can search for "Visual C++ 2015 build tools", for example. You will need to
48create a Microsoft account (it's free).
49
50
Bram Moolenaar362e1a32006-03-06 23:29:24 +000051Visual Studio
52-------------
53
Bram Moolenaar30a89472016-01-10 14:35:58 +010054Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
55VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
56should also work for VS 4 and VS 5.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +000057
Bram Moolenaar73f44392017-10-07 18:38:43 +020058Using VS C++ 2008 Express is recommended if you need the binary to run on
59Windows 95 or 97, see |msvc-2008-express| below.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020060
Bram Moolenaar362e1a32006-03-06 23:29:24 +000061To build Vim from the command line with MSVC, use Make_mvc.mak.
62Visual Studio installed a batch file called vcvars32.bat, which you must
63run to set up paths for nmake and MSVC.
64
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000065nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
66nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
67nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000068nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000069 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000070
71Make_mvc.mak allows a Vim to be built with various different features and
72debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
73For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
74
75For compiling Gvim with IME support on far-east Windows, add IME=yes
76to the parameters you pass to Make_mvc.mak.
77
78To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
79(Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
80far more configuration.) Make_ivc.mak can also be built with nmake.
81
82nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000083 GUI Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000084nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000085 OLE Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000086
87See the specific files for comments and options.
88
89These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
90Ron Aaron; they have been tested.
91
92
Bram Moolenaar02cfac82016-04-21 14:34:58 +020093Visual C++ 2008 Express Edition *msvc-2008-express*
94-------------------------------
95
96Visual C++ 2008 Express Edition can be downloaded for free from:
97 http://www.microsoft.com/express/downloads/
98This includes the IDE and the debugger.
99
100To set the environment execute the msvc2008.bat script. You can then build
101Vim with Make_mvc.mak.
102
103For building 64 bit binaries you also need to install the SDK:
104"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
105You don't need the examples and documentation.
106
107If you get an error that Win32.mak can't be found, you have to set the
108variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
109puts include files in the following directory:
110 set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
111
112
113Visual C++ 2010 Express Edition *msvc-2010-express*
114-------------------------------
115
116Visual C++ 2010 Express Edition can be downloaded for free from:
117 http://www.microsoft.com/express/vc/Default.aspx
118This includes the IDE and the debugger.
119
120To set the environment execute the msvc2010.bat script. You can then build
121Vim with Make_mvc.mak.
122
123
Bram Moolenaar73f44392017-10-07 18:38:43 +0200124Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
125---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200126
127Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
128so that it targets Windows 6.0 (Vista) by default. In order to override
129this, the target Windows version number needs to be passed to LINK like
130follows:
131 LINK ... /subsystem:console,5.01
132
133Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200134Use lines like follows to target Windows XP x86 (assuming using Visual C++
1352012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200136 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200137 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
138 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200139 set CL=/D_USING_V110_SDK71_
140 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
141
Bram Moolenaar73f44392017-10-07 18:38:43 +0200142To target Windows XP x64 instead of x86, you need to change the settings of
143LIB and SUBSYSTEM_VER:
144 ...
145 set LIB=%WinSdk71%\Lib\x64;%LIB%
146 ...
147 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
148
149If you use Visual C++ 2015 (either Express or Community Edition), executing
150msvc2015.bat will set them automatically. For x86 builds run this without
151options:
152 msvc2015
153For x64 builds run this with the "x86_amd64" option:
154 msvc2015 x86_amd64
155
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200156The following Visual C++ team blog can serve as a reference page:
157 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
158
159
160OLDER VERSIONS
161
162The minimal supported version is Windows XP. Building with older compilers
163might still work, but these instructions might be outdated.
164
165If you need the executable to run on Windows 98 or ME, use the 2003 one
166|msvc-2003-toolkit|.
167
Bram Moolenaarc236c162008-07-13 17:41:49 +0000168Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000169-----------------------
170
Bram Moolenaarc236c162008-07-13 17:41:49 +0000171You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000172 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaarc236c162008-07-13 17:41:49 +0000173Unfortunately this URL is no longer valid. Inofficial downloads appear to be
174available from links mentioned on these pages (use at your own risk):
175 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
176 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
177
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000178This contains the command-line tools (compiler, linker, CRT headers,
179and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
180To compile and debug Vim with the VC2003 Toolkit, you will also need
181|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
182and |windbg-download|.
183
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000184It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
185which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000186
187The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
188 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
189(This site also takes you through configuring a number of other
190free C compilers for Win32.)
191
192To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
193execute the following commands in a cmd.exe window (the msvcsetup.bat batch
194file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000195
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000196 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
197 call "%VCToolkitInstallDir%vcvars32.bat"
198 set MSVCVer=7.1
199 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
200 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
201
202Now you can build Vim with Make_mvc.mak.
203
204
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000205Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000206
207You will also need a copy of the Windows Platform SDK from
208 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
209Specifically, you need the Windows Core SDK subset of the Platform SDK,
210which contains the Windows headers and libraries.
211
212
213Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
214
215You need the .NET Framework 1.1 Redistributable Package from
216 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
217or from Windows Update:
218 http://windowsupdate.microsoft.com/
219This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
220which is needed to link Vim.
221
222
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000223Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000224
225You need the .NET Framework 1.1 SDK from
226 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
227This contains some additional libraries needed to compile Vim,
228such as msvcrt.lib. You must install |dotnet-1.1-redist| before
229installing the .NET 1.1 SDK.
230
231
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000232Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000233
234The Debugging Tools for Windows can be downloaded from
235 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
236This includes the WinDbg debugger, which you will want if you ever need
237to debug Vim itself. An earlier version of the Debugging Tools
238is also available through the Platform SDK, |ms-platform-sdk|.
239
240
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000241Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000242-------------------------------
243
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000244Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000245 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
246This includes the IDE and the debugger. You will also need
247|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
248
249Instructions for integrating the Platform SDK into VC Express:
250 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
251
252
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200253
Bram Moolenaar362e1a32006-03-06 23:29:24 +00002542. MinGW
255========
256
257(written by Ron Aaron: <ronaharon@yahoo.com>)
258
259This is about how to produce a Win32 binary of gvim with MinGW.
260
261First, you need to get the 'mingw32' compiler, which is free for the download
262at:
263
264 http://www.mingw.org/
265
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100266or you can use 'MinGW-w64' compiler.
267
268 http://mingw-w64.sourceforge.net/
269
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100270Or a compiler provided on msys2:
271
272 https://msys2.github.io/
273
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000274Once you have downloaded the compiler binaries, unpack them on your hard disk
275somewhere, and put them on your PATH. If you are on Win95/98 you can edit
276your AUTOEXEC.BAT file with a line like:
277
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100278 set PATH=C:\MinGW\bin;%PATH%
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000279
280or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100281System, Advanced, and edit the environment from there. If you use msys2
282compilers, set your installed paths:
283
284 C:\msys2\mingw32\bin
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200285or
286 C:\msys64\mingw32\bin
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100287
288for 32bit. And 64bit:
289
290 C:\msys2\mingw64\bin
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200291or
292 C:\msys64\mingw64\bin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000293
294Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
295
296 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100297 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000298
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100299 C:\> mingw32-make --version
300 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000301
302Now you are ready to rock 'n' roll. Unpack the vim sources (look on
303www.vim.org for exactly which version of the vim files you need).
304
305Change directory to 'vim\src':
306
307 C:\> cd vim\src
308 C:\VIM\SRC>
309
310and you type:
311
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100312 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000313
314After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
315directory.
316
317You should not need to do *any* editing of any files to get vim compiled this
318way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100319is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100320
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100321 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000322
323If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
324(also free!) and compress the file (typical compression is 50%). UPX can be
325found at
326 http://www.upx.org/
327
Bram Moolenaar91856272012-02-29 16:56:39 +0100328As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
329built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
330at:
331 http://www.matcode.com/mpress.htm
332
333
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000334ADDITION: NLS support with MinGW
335
336(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
337
338If you want National Language Support, read the file src/po/README_mingw.txt.
339You need to uncomment lines in Make_ming.mak to have NLS defined.
340
341
3423. Cygwin
343=========
344
345Use Make_cyg.mak with Cygwin's GCC. See
346 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
347
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100348With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000349Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100350running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000351with the other makefiles).
352
353
3544. Borland
355===========
356
357Use Make_bc5.mak with Borland C++ 5.x. See
358 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
359
360
3615. Cross compiling for Win32 from a Linux machine
362=================================================
363
364[Update of 1) needs to be verified]
365
366If you like, you can compile the 'mingw' Win32 version from the comfort of
367your Linux (or other unix) box. To do this, you need to follow a few steps:
368 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100369 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000370 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000371 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100372 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
373 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
374 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100375 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000376 4) make -f Make_ming.mak gvim.exe
377
378Now you have created the Windows binary from your Linux box! Have fun...
379
380
3816. Building with Python support
382===============================
383
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200384For building with MSVC 2008 the "Windows Installer" from www.python.org
385works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000386
Bram Moolenaar30a89472016-01-10 14:35:58 +0100387When building, you need to set the following variables at least:
388
389 PYTHON: Where Python is installed. E.g. C:\Python27
390 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
391 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
392
393E.g. When using MSVC (as one line):
394
395 nmake -f Make_mvc.mak
396 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
397
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200398(rest written by Ron Aaron: <ronaharon@yahoo.com>)
399
400Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000401 http://www.ActiveState.com/Products/ActivePython/
402
403After installing the ActivePython, you will have to create a 'mingw32'
404'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100405 cd $PYTHON/libs
406 pexports python20.dll > python20.def
407 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000408
409Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
410the root of the Python installation (C:\Python20, for example). If you are
411cross-compiling on Linux with the mingw32 setup, you need to also convert all
412the 'Include' files to *unix* line-endings. This bash command will do it
413easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100414 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000415
416Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100417 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000418
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100419And if you use msys2 to build python support (as one line):
420
421 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
422 PYTHON_HOME=c:/msys64/mingw64
423 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
424 DYNAMIC_PYTHON=yes
425 PYTHON_VER=27
426 DYNAMIC_PYTHON_DLL=libpython2.7.dll
427 ARCH=x86-64
428 STATIC_STDCPLUS=yes
429
430You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000431
432
Bram Moolenaar30a89472016-01-10 14:35:58 +01004337. Building with Python3 support
434================================
435
436For building with MSVC 2008 the "Windows Installer" from www.python.org
437works fine. Python 3.4 is recommended.
438
439When building, you need to set the following variables at least:
440
441 PYTHON3: Where Python3 is installed. E.g. C:\Python34
442 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
443 PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
444
445E.g. When using MSVC (as one line):
446
447 nmake -f Make_mvc.mak
448 PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
449
450
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01004518. Building with MzScheme/Racket support
452========================================
453
4541) Building with MzScheme support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000455
456(written by Sergey Khorev <sergey.khorev@gmail.com>)
457
458Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
459be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
460above (including 299 and 30x series).
461
462The MSVC build is quite straightforward. Simply invoke (in one line)
463nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
464 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
465where <MzScheme-version> is the last seven characters from MzScheme dll name
466(libmzschXXXXXXX.dll).
467If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
468DLL's, but will load them in runtime on demand.
469
470Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
471account that <Path-to-MzScheme> should contain slashes rather than backslashes
472(e.g. d:/Develop/MzScheme)
473
474"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
475explicitly) on MinGW and Cygwin requires additional step.
476
477libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
478%WINDOWS%\System32 to other location (either build directory, some temporary
479dir or even MzScheme home).
480
481Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
482make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
483 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
484
485After a successful build, these dlls can be freely removed, leaving them in
486%WINDOWS%\System32 only.
487
488
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01004892) Building with Racket support
490
491MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
492(https://racket-lang.org/) support can be built with either MSVC or MinGW (or
493Cygwin).
494
495You need to set the following variables:
496
497 MZSCHEME: Where Racket is installed.
498 E.g. C:\Program Files (x86)\Racket
499 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200500 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200501 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200502 The DLL can be found under the lib directory. E.g.
503 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100504 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
505 runtime. Default: $(MZSCHEME)\collects
506 User can override this with the PLTCOLLECTS environment
507 variable.
508
Bram Moolenaar73f44392017-10-07 18:38:43 +0200509List of MZSCHEME_VER (incomplete):
510
511 Racket ver. | MZSCHEME_VER
512 ==========================
513 6.3 | 3m_9z0ds0
514 6.6 | 3m_a0solc
515 6.8 | 3m_a1zjsw
516 6.10 | 3m_a36fs8
517
518
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100519E.g. When using MSVC (as one line):
520
521 nmake -f Make_mvc.mak
522 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
523 MZSCHEME_VER=3m_9z0ds0
524
525Or when using MinGW (as one line):
526
527 mingw32-make -f Make_ming.mak
528 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
529 MZSCHEME_VER=3m_9z0ds0
530
531 Spaces should be escaped with '\'.
532
533
Bram Moolenaar30a89472016-01-10 14:35:58 +01005349. Building with Lua support
535============================
536
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100537Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
538You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
539This also applies to when you get a Vim executable and don't build yourself,
540do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100541
5421) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100543
Bram Moolenaar30a89472016-01-10 14:35:58 +0100544Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100545 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100546
547Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100548lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100549MinGW.
550
551Unpack it to a working directory. E.g. C:\projects\lua53.
552Lua's header files will be installed under the include directory.
553
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100554Copy luaXY.dll to your Windows system directory. The system directory depends
555on your Windows bitness and Vim bitness:
556 32-bit Vim on 32-bit Windows: C:\Windows\System32
557 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
558 64-bit Vim on 64-bit Windows: C:\Windows\System32
559
560Or another option is copying luaXY.dll to the directory where gvim.exe
561(or vim.exe) is.
562
Bram Moolenaar30a89472016-01-10 14:35:58 +0100563
5642) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100565
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100566You need to set LUA, DYNAMIC_LUA and LUA_VER.
567
568 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
569 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
570 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100571
572E.g. When using MSVC (as one line):
573
574 nmake -f Make_mvc.mak
575 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
576
577Or when using MinGW (as one line):
578
579 mingw32-make -f Make_mingw.mak
580 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
581
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100582
583Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100584
585 make -f Make_cyg.mak
586 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
587
588
58910. Building with Perl support
590==============================
591
592Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
593You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
594
595 http://www.activestate.com/activeperl
596 http://strawberryperl.com/
597
598When building, you need to set the following variables:
599
600 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
601 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
602 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
603
604E.g. When using MSVC (as one line):
605
606 nmake -f Make_mvc.mak
607 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
608
609Or when using MinGW (as one line):
610
611 mingw32-make -f Make_mingw.mak
612 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
613
614
61511. Building with Ruby support
616==============================
617
618Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
619Ruby doesn't provide the official Windows binaries. The most widely used
620Windows binaries might be RubyInstaller.
621
622 http://rubyinstaller.org/
623
624If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
625you need some tricks described below.
626(Another binary distribution is ActiveScriptRuby:
627 http://www.artonx.org/data/asr/)
628
629When building, you need to set the following variables at least:
630
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200631 RUBY: Where ruby is installed. E.g. C:\Ruby22
632 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
633 RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X.
634 RUBY_API_VER_LONG: Ruby API version in a long format.
635 E.g. 2.2.0 for Ruby 2.2.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100636
637Ruby version vs. Ruby API version:
638
639 Ruby ver. | Ruby API ver.
640 =========================
641 1.8.X | 1.8
642 1.9.[1-3] | 1.9.1
643 2.0.0 | 2.0.0
644 2.X.Y | 2.X.0
645
646(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
647
648
649A) Using MSVC
650
651If you want to link with ruby, normally you must use the same compiler as
652which was used to build the ruby binary. RubyInstaller is built with MinGW,
653so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200654RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100655config.h and Ruby's DLL name. Here are the steps for working around them:
656
657 1) Download and Install RubyInstaller.
658 You can install RubyInstaller with the default options and directory.
659 E.g.:
660 C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit)
661
662 Ruby 2.2.X is used in this example.
663
664 2) Download Ruby 2.2.X's source code and generate config.h:
665
666 cd C:\projects
667 git clone https://github.com/ruby/ruby.git -b ruby_2_2
668 cd ruby
669 win32\configure.bat
670 nmake .config.h.time
671
672 Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code.
673 There is no need to build whole Ruby, just config.h is needed.
674 If you use 32-bit MSVC10, the config.h is generated in the
675 .ext\include\i386-mswin32_100 directory.
676
677 3) Install the generated config.h.
678
679 xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
680
681 Note that 2.2.0 is Ruby API version of Ruby 2.2.X.
682
683 4) Build Vim. Note that you need to adjust some variables (as one line):
684
685 nmake -f Make_mvc.mak
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200686 RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100687 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200688 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100689
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200690 If you set WINVER explicitly, it must be set to >=0x500, when building
691 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100692 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
693 which is used for the Ruby's DLL name.
694
695B) Using MinGW
696
697Using MinGW is easier than using MSVC when linking with RubyInstaller.
698After you install RubyInstaller, just type this (as one line):
699
700 mingw32-make -f Make_ming.mak
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200701 RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_API_VER_LONG=2.2.0
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200702 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100703
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200704If you set WINVER explicitly, it must be set to >=0x500, when building with
705Ruby 2.1 or later. (Default is 0x501.)
706
Bram Moolenaar30a89472016-01-10 14:35:58 +0100707
708
70912. Building with Tcl support
710=============================
711
712Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
713You can use binaries from ActiveState (ActiveTcl).
714
715 http://www.activestate.com/activetcl
716
717When building, you need to set the following variables:
718
719 TCL: Where tcl is installed. E.g. C:\Tcl86
720 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
721 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
722 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
723
724E.g. When using MSVC (as one line):
725
726 nmake -f Make_mvc.mak
727 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
728
729Or when using MinGW (as one line):
730
731 mingw32-make -f Make_mingw.mak
732 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
733
734
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +020073513. Building with Terminal support
736==================================
737
Bram Moolenaar8a773062017-07-24 22:29:21 +0200738Vim with Terminal support can be built with either MSVC, MinGW or Cygwin.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200739This uses the included libvterm and winpty. No extra header files or
Bram Moolenaar8a773062017-07-24 22:29:21 +0200740libraries are needed for building. Just set TERMINAL to yes.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200741
Bram Moolenaar8a773062017-07-24 22:29:21 +0200742E.g. When using MSVC:
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200743
Bram Moolenaar8a773062017-07-24 22:29:21 +0200744 nmake -f Make_mvc.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200745
Bram Moolenaar8a773062017-07-24 22:29:21 +0200746Or when using MinGW (as one line):
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200747
Bram Moolenaar8a773062017-07-24 22:29:21 +0200748 mingw32-make -f Make_mingw.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200749
750
75114. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100752================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000753
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100754The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000755
756
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +020075715. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100758==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000759
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100760The MS-DOS support was removed in patch 7.4.1399.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200761
762
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +020076316. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200764==========================================
765
766[provided by Michael Soyka]
767
768After you've built the Vim binaries as described above, you're ready to
769install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100770using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200771first create a "vim80" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200772zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100773correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200774
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200775 A. Create a Vim "runtime" subdirectory named "vim80"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200776 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100777 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200778 Otherwise, continue reading.
779
780 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200781 directories and create a new subdirectory named "vim80".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100782
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200783 Copy the "runtime" files into "vim80":
784 copy runtime\* vim80
Bram Moolenaar734d9982011-07-15 13:52:04 +0200785
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200786 B. Copy the new binaries into the "vim80" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200787 ----------------------------------------------------
788 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200789 new binaries you created above into "vim80":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200790
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200791 copy src\*.exe vim80
792 copy src\GvimExt\gvimext.dll vim80
793 copy src\xxd\xxd.exe vim80
Bram Moolenaar734d9982011-07-15 13:52:04 +0200794
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200795 C. Move the "vim80" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200796 ---------------------------------------------------------------------
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200797 Move the "vim80" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100798 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200799 If you already have a "vim80" subdirectory in "vim", delete it first
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100800 by running its uninstal.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200801
802 D. Install Vim
803 ---------------
Bram Moolenaarbbe917d2016-09-21 22:41:24 +0200804 "cd" to your Vim installation subdirectory "vim\vim80" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +0200805 "install.exe" program. It will ask you a number of questions about
806 how you would like to have your Vim setup. Among these are:
807 - You can tell it to write a "_vimrc" file with your preferences in the
808 parent directory.
809 - It can also install an "Edit with Vim" entry in the Windows Explorer
810 popup menu.
811 - You can have it create batch files, so that you can run Vim from the
812 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100813 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200814 - Create entries for Vim on the desktop and in the Start menu.
815
816Happy Vimming!