xref: /vim-8.2.3635/src/INSTALLpc.txt (revision 94688b8a)
1INSTALLpc.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
6You can find the latest here: https://github.com/vim/vim-win32-installer
7This page also has links to install support for interfaces such as Perl,
8Python, Lua, etc.
9
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
14This 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.
17
18The recommended way is to build a 32 bit Vim, also on 64 bit systems.  You can
19build a 64 bit Vim if you like, the executable will be bigger and Vim won't be
20any faster, but you can edit files larger than 2 Gbyte.
21
22
23Contents:
241. Microsoft Visual C++
252. Using MSYS2 with MinGW
263. Using MinGW
274. Cygwin
285. Borland
296. Cross compiling for Win32 from a Linux machine
307. Building with Python support
318. Building with Python3 support
329. Building with Racket or MzScheme support
3310. Building with Lua support
3411. Building with Perl support
3512. Building with Ruby support
3613. Building with Tcl support
3714. Building with Terminal support
3815. Building with DirectX (DirectWrite) support
3916. Windows 3.1
4017. MS-DOS
41
4218. Installing after building from sources
43
44
45The currently recommended way (that means it has been verified to work) is
46using the "Visual Studio Community 2015" installation.  This includes the SDK
47needed to target Windows XP.  But not older Windows versions (95, 98), see
48|msvc-2008-express| below for that
49
50
511. Microsoft Visual C++
52=======================
53
54We do not provide download links, since Microsoft keeps changing them.  You
55can search for "Visual Studio Community 2015", for example.  You will need to
56create a Microsoft account (it's free).
57
58When installing "Visual Studio Community 2015 with Update 3" make sure to
59select "custom" and check "Windows XP Support for C++" and all checkboxes
60under "Universal Windows App Development Tools"
61
62
63Visual Studio
64-------------
65
66Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
67VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
68should also work for VS 4 and VS 5.)
69
70Using VS C++ 2008 Express is recommended if you need the binary to run on
71Windows 95 or 97, see |msvc-2008-express| below.
72
73To build Vim from the command line with MSVC, use Make_mvc.mak.
74Visual Studio installed a batch file called vcvars32.bat, which you must
75run to set up paths for nmake and MSVC.
76
77nmake -f Make_mvc.mak		console   Win32 SDK or Microsoft Visual C++
78nmake -f Make_mvc.mak GUI=yes	GUI	  Microsoft Visual C++
79nmake -f Make_mvc.mak OLE=yes	OLE	  Microsoft Visual C++
80nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
81				Perl, Python, etc.
82
83Make_mvc.mak allows a Vim to be built with various different features and
84debug support.  Debugging with MS Devstudio is provided by Make_dvc.mak.
85For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
86
87For compiling Gvim with IME support on far-east Windows, add IME=yes
88to the parameters you pass to Make_mvc.mak.
89
90To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
91(Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
92far more configuration.) Make_ivc.mak can also be built with nmake.
93
94nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
95				GUI	  Microsoft Visual C++ 4.x or later
96nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
97				OLE	  Microsoft Visual C++ 4.x or later
98
99See the specific files for comments and options.
100
101These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
102Ron Aaron; they have been tested.
103
104
105Visual C++ 2008 Express Edition       *msvc-2008-express*
106-------------------------------
107
108Visual C++ 2008 Express Edition can be downloaded for free from:
109    http://www.microsoft.com/express/downloads/
110This includes the IDE and the debugger.
111
112To set the environment execute the msvc2008.bat script.  You can then build
113Vim with Make_mvc.mak.
114
115For building 64 bit binaries you also need to install the SDK:
116"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
117You don't need the examples and documentation.
118
119If you get an error that Win32.mak can't be found, you have to set the
120variable SDK_INCLUDE_DIR.  For example, on Windows 10, installation of MSVC
121puts include files in the following directory:
122    set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
123
124
125Visual C++ 2010 Express Edition       *msvc-2010-express*
126-------------------------------
127
128Visual C++ 2010 Express Edition can be downloaded for free from:
129    http://www.microsoft.com/express/vc/Default.aspx
130This includes the IDE and the debugger.
131
132To set the environment execute the msvc2010.bat script.  You can then build
133Vim with Make_mvc.mak.
134
135
136Targeting Windows XP with MSVC 2012 and later      *new-msvc-windows-xp*
137---------------------------------------------
138
139Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
140so that it targets Windows 6.0 (Vista) by default.  In order to override
141this, the target Windows version number needs to be passed to LINK like
142follows:
143    LINK ... /subsystem:console,5.01
144
145Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
146Use lines like follows to target Windows XP x86 (assuming using Visual C++
1472012 under 64-bit Windows):
148    set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
149    set INCLUDE=%WinSdk71%\Include;%INCLUDE%
150    set LIB=%WinSdk71%\Lib;%LIB%
151    set CL=/D_USING_V110_SDK71_
152    nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
153
154To target Windows XP x64 instead of x86, you need to change the settings of
155LIB and SUBSYSTEM_VER:
156    ...
157    set LIB=%WinSdk71%\Lib\x64;%LIB%
158    ...
159    nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
160
161If you use Visual C++ 2015 (either Express or Community Edition), executing
162msvc2015.bat will set them automatically.  For x86 builds run this without
163options:
164  msvc2015
165For x64 builds run this with the "x86_amd64" option:
166  msvc2015 x86_amd64
167This enables x86_x64 cross compiler. This works on any editions including
168Express edition.
169If you use Community (or Professional) edition, you can enable the x64 native
170compiler by using the "x64" option:
171  msvc2015 x64
172
173The following Visual C++ team blog can serve as a reference page:
174    http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
175
176
177OLDER VERSIONS
178
179The minimal supported version is Windows XP. Building with older compilers
180might still work, but these instructions might be outdated.
181
182If you need the executable to run on Windows 98 or ME, use the 2003 one
183|msvc-2003-toolkit|.
184
185Visual C++ Toolkit 2003				*msvc-2003-toolkit*
186-----------------------
187
188You could download the Microsoft Visual C++ Toolkit 2003 from
189    http://msdn.microsoft.com/visualc/vctoolkit2003/
190Unfortunately this URL is no longer valid.  Unofficial downloads appear to be
191available from links mentioned on these pages (use at your own risk):
192   http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
193   http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
194
195This contains the command-line tools (compiler, linker, CRT headers,
196and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
197To compile and debug Vim with the VC2003 Toolkit, you will also need
198|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
199and |windbg-download|.
200
201It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
202which is freely available in perpetuity.
203
204The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
205    http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
206(This site also takes you through configuring a number of other
207free C compilers for Win32.)
208
209To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
210execute the following commands in a cmd.exe window (the msvcsetup.bat batch
211file can be used):
212
213    set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
214    call "%VCToolkitInstallDir%vcvars32.bat"
215    set MSVCVer=7.1
216    call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
217    set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
218
219Now you can build Vim with Make_mvc.mak.
220
221
222Getting the Windows Platform SDK	    *ms-platform-sdk*
223
224You will also need a copy of the Windows Platform SDK.  Specifically, you need
225the Windows Core SDK subset of the Platform SDK, which contains the Windows
226headers and libraries.  You need to search for it, Microsoft keeps changing
227the URL.
228
229
230Getting the .NET Framework 1.1 Runtime      *dotnet-1.1-redist*
231
232You need the .NET Framework 1.1 Redistributable Package from
233    http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
234or from Windows Update:
235    http://windowsupdate.microsoft.com/
236This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
237which is needed to link Vim.
238
239
240Getting the .NET Framework 1.1 SDK	    *dotnet-1.1-sdk*
241
242You need the .NET Framework 1.1 SDK from
243    http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
244This contains some additional libraries needed to compile Vim,
245such as msvcrt.lib. You must install |dotnet-1.1-redist| before
246installing the .NET 1.1 SDK.
247
248
249Getting the WinDbg debugger		    *windbg-download*
250
251The Debugging Tools for Windows can be downloaded from
252    http://www.microsoft.com/whdc/devtools/debugging/default.mspx
253This includes the WinDbg debugger, which you will want if you ever need
254to debug Vim itself. An earlier version of the Debugging Tools
255is also available through the Platform SDK, |ms-platform-sdk|.
256
257
258Visual C++ 2005 Express Edition       *msvc-2005-express*
259-------------------------------
260
261Visual C++ 2005 Express Edition can be downloaded for free from:
262    http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
263This includes the IDE and the debugger. You will also need
264|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
265
266Instructions for integrating the Platform SDK into VC Express:
267    http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
268
269
2702. MSYS2 with MinGW
271===================
272
2732.1. Setup the basic msys2 environment
274
275Go to the official page of MSYS2: https://www.msys2.org
276Download an installer:
277
278* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
279  (Even if you want to build 32-bit Vim)
280* msys2-i686-YYYYMMDD.exe for 32-bit Windows
281
282Execute the installer and follow the instructions to update basic packages.
283At the end keep the checkbox checked to run msys2 now.  If needed, you can
284open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
285
286Execute:
287    $ pacman -Syu
288
289And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu).
290Then execute:
291    $ pacman -Su
292
293If pacman complains that `catgets` and `libcatgets` conflict with another
294package, select `y` to remove them.
295
296
2972.2. Install additional packages for building Vim
298
299The following package groups are required for building Vim:
300
301* base-devel
302* mingw-w64-i686-toolchain (for building 32-bit Vim)
303* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
304
305(These groups also include some useful packages which are not used by Vim.)
306Use the following command to install them:
307
308    $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
309
310Or you can use the `pacboy` command to avoid long package names:
311
312    $ pacboy -S base-devel: toolchain:m
313
314The suffix ":" means that it disables the package name translation.
315The suffix ":m" means both i686 and x86_64.  You can also use the ":i" suffix
316to install only i686, and the ":x" suffix to install only x86_64.
317(See `pacboy help` for the help.)
318
319See also the pacman page in ArchWiki for the general usage of pacman:
320    https://wiki.archlinux.org/index.php/pacman
321
322MSYS2 has its own git package, and you can also install it via pacman:
323
324    $ pacman -S git
325
326
3272.3. Keep the build environment up-to-date
328
329After you have installed the build environment, you may want to keep it
330up-to-date (E.g. always use the latest GCC).
331In that case, you just need to execute the command:
332    $ pacman -Syu
333
334
3352.4. Build Vim
336
337Select one of the following icon from the Start Menu:
338
339* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
340* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
341
342Go to the source directory of Vim, then execute the make command.  E.g.:
343
344    make -f Make_ming.mak
345    make -f Make_ming.mak GUI=no
346    make -f Make_ming.mak GUI=no DEBUG=yes
347
348NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
349console for that.  You need to set $PATH to be able to build there, e.g.:
350
351    set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
352
353This command is in msys32.bat.  Or for the 64 bit compiler use msys64.bat:
354
355    set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
356
357If you have msys64 in another location you will need to adjust the paths for
358that.
359
360
3613. MinGW
362========
363
364(written by Ron Aaron: <[email protected]>)
365
366This is about how to produce a Win32 binary of gvim with MinGW.
367
368First, you need to get the 'mingw32' compiler, which is free for the download
369at:
370
371    http://www.mingw.org/
372
373or you can use 'MinGW-w64' compiler.
374
375    http://mingw-w64.sourceforge.net/
376
377Or a compiler provided on msys2:
378
379    https://msys2.github.io/
380
381Once you have downloaded the compiler binaries, unpack them on your hard disk
382somewhere, and put them on your PATH.  If you are on Win95/98 you can edit
383your AUTOEXEC.BAT file with a line like:
384
385    set PATH=C:\MinGW\bin;%PATH%
386
387or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
388System, Advanced, and edit the environment from there. If you use msys2
389compilers, set your installed paths (normally one of the following):
390
391    C:\msys32\mingw32\bin   (32-bit msys2, targeting 32-bit builds)
392    C:\msys64\mingw32\bin   (64-bit msys2, targeting 32-bit builds)
393    C:\msys64\mingw64\bin   (64-bit msys2, targeting 64-bit builds)
394
395Test if gcc is on your path.  From a CMD (or COMMAND on '95/98) window:
396
397    C:\> gcc --version
398    gcc (GCC) 4.8.1
399
400    C:\> mingw32-make --version
401    GNU Make 3.82.90 (...etc...)
402
403Now you are ready to rock 'n' roll.  Unpack the vim sources (look on
404www.vim.org for exactly which version of the vim files you need).
405
406Change directory to 'vim\src':
407
408    C:\> cd vim\src
409    C:\VIM\SRC>
410
411and you type:
412
413    mingw32-make -f Make_ming.mak gvim.exe
414
415After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
416directory.
417
418You should not need to do *any* editing of any files to get vim compiled this
419way.  If, for some reason, you want the console-mode-only version of vim (this
420is NOT recommended on Win32, especially on '95/'98!!!), you can use:
421
422    mingw32-make -f Make_ming.mak GUI=no vim.exe
423
424If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
425(also free!) and compress the file (typical compression is 50%). UPX can be
426found at
427    http://www.upx.org/
428
429As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
430built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
431at:
432    http://www.matcode.com/mpress.htm
433
434
435ADDITION: NLS support with MinGW
436
437(by Eduardo F. Amatria <[email protected]>)
438
439If you want National Language Support, read the file src/po/README_mingw.txt.
440You need to uncomment lines in Make_ming.mak to have NLS defined.
441
442
4434. Cygwin
444=========
445
446Use Make_cyg.mak with Cygwin's GCC. See
447    http://users.skynet.be/antoine.mechelynck/vim/compile.htm
448
449With Cygnus gcc you should use the Unix Makefile instead (you need to get the
450Unix archive then).  Then you get a Cygwin application (feels like Vim is
451running on Unix), while with Make_cyg.mak you get a Windows application (like
452with the other makefiles).
453
454
4555. Borland
456===========
457
458Use Make_bc5.mak with Borland C++ 5.x. See
459    http://users.skynet.be/antoine.mechelynck/vim/compile.htm
460
461
4626. Cross compiling for Win32 from a Linux machine
463=================================================
464
465[Update of 1) needs to be verified]
466
467If you like, you can compile the 'mingw' Win32 version from the comfort of
468your Linux (or other unix) box.  To do this, you need to follow a few steps:
469    1) Install the mingw32 cross-compiler. See
470	http://www.mingw.org/wiki/LinuxCrossMinGW
471	http://www.libsdl.org/extras/win32/cross/README.txt
472    2) Get and unpack both the Unix sources and the extra archive
473    3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
474       Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
475       wish.  If your cross-compiler prefix differs from the predefined value,
476       set 'CROSS_COMPILE' corresponding.
477    4) make -f Make_ming.mak gvim.exe
478
479Now you have created the Windows binary from your Linux box!  Have fun...
480
481
4827. Building with Python support
483===============================
484
485For building with MSVC 2008 the "Windows Installer" from www.python.org
486works fine.
487
488When building, you need to set the following variables at least:
489
490    PYTHON:         Where Python is installed. E.g. C:\Python27
491    DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
492    PYTHON_VER:     Python version. E.g. 27 for Python 2.7.X.
493
494E.g. When using MSVC (as one line):
495
496    nmake -f Make_mvc.mak
497        PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
498
499When using MinGW and link with the official Python (as one line):
500
501    mingw32-make -f Make_ming.mak
502        PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
503
504When using msys2 and link with Python2 bundled with msys2 (as one line):
505
506    mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
507        PYTHON_HOME=c:/msys64/mingw64
508        PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
509        DYNAMIC_PYTHON=yes
510        PYTHON_VER=27
511        DYNAMIC_PYTHON_DLL=libpython2.7.dll
512        STATIC_STDCPLUS=yes
513
514(This is for 64-bit builds.  For 32-bit builds, replace mingw64 with mingw32.)
515(STATIC_STDCPLUS is optional.  Set to yes if you don't want to require
516libstdc++-6.dll.)
517
518
519(rest written by Ron Aaron: <[email protected]>)
520
521Building with the mingw32 compiler, and the ActiveState ActivePython:
522    http://www.ActiveState.com/Products/ActivePython/
523
524After installing the ActivePython, you will have to create a 'mingw32'
525'libpython20.a' to link with:
526    cd $PYTHON/libs
527    pexports python20.dll > python20.def
528    dlltool -d python20.def -l libpython20.a
529
530Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
531the root of the Python installation (C:\Python20, for example).  If you are
532cross-compiling on Linux with the mingw32 setup, you need to also convert all
533the 'Include' files to *unix* line-endings.  This bash command will do it
534easily:
535    for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
536
537Now just do:
538    make -f Make_ming.mak gvim.exe
539
540You will end up with a Python-enabled, Win32 version. Enjoy!
541
542
5438. Building with Python3 support
544================================
545
546For building with MSVC 2008 the "Windows Installer" from www.python.org
547works fine.  Python 3.6 is recommended.
548
549When building, you need to set the following variables at least:
550
551    PYTHON3:         Where Python3 is installed. E.g. C:\Python36
552    DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
553    PYTHON3_VER:     Python3 version. E.g. 36 for Python 3.6.X.
554
555E.g. When using MSVC (as one line):
556
557    nmake -f Make_mvc.mak
558        PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
559
560When using MinGW and link with the official Python3 (as one line):
561
562    mingw32-make -f Make_ming.mak
563        PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
564
565When using msys2 and link with Python3 bundled with msys2 (as one line):
566
567    mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
568        PYTHON3_HOME=c:/msys64/mingw64
569        PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
570        DYNAMIC_PYTHON3=yes
571        PYTHON3_VER=36
572        DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
573        STATIC_STDCPLUS=yes
574
575(This is for 64-bit builds.  For 32-bit builds, replace mingw64 with mingw32.)
576(STATIC_STDCPLUS is optional.  Set to yes if you don't want to require
577libstdc++-6.dll.)
578
579
5809. Building with Racket or MzScheme support
581========================================
582
5831) Building with Racket support (newest)
584
585MzScheme and PLT Scheme names have been rebranded as Racket.  Vim with Racket
586support can be built with either MSVC or MinGW (or Cygwin).
587Get it from https://download.racket-lang.org/
588
589Copy lib/libracket{version}.dll to your Windows system directory. The system
590directory depends on your Windows bitness and Vim bitness:
591  32-bit Vim on 32-bit Windows: C:\Windows\System32
592  32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
593  64-bit Vim on 64-bit Windows: C:\Windows\System32
594
595For building you need to set the following variables:
596
597    MZSCHEME:          Where Racket is installed.
598                       E.g. C:\Program Files (x86)\Racket
599    DYNAMIC_MZSCHEME:  Whether dynamic linking is used. Usually, set to yes.
600    MZSCHEME_VER:      Racket DLL version which is used for the file name.
601                       See below for a list of MZSCHEME_VER.
602                       The DLL can be found under the lib directory. E.g.
603                       C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
604    MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
605                       runtime. Default: $(MZSCHEME)\collects
606                       User can override this with the PLTCOLLECTS environment
607                       variable.
608
609List of MZSCHEME_VER (incomplete):
610
611    Racket ver. | MZSCHEME_VER
612    ==========================
613    6.3         | 3m_9z0ds0
614    6.6         | 3m_a0solc
615    6.8         | 3m_a1zjsw
616    6.10        | 3m_a36fs8
617
618
619E.g. When using MSVC (as one line):
620
621    nmake -f Make_mvc.mak
622        MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
623        MZSCHEME_VER=3m_9z0ds0
624
625Or when using MinGW (as one line):
626
627    mingw32-make -f Make_ming.mak
628        MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
629        MZSCHEME_VER=3m_9z0ds0
630
631    Spaces should be escaped with '\'.
632
633
6342) Building with MzScheme support (older)
635
636(written by Sergey Khorev <[email protected]>)
637
638Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
639be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
640above (including 299 and 30x series).
641
642The MSVC build is quite straightforward. Simply invoke (in one line)
643nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
644    [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
645where <MzScheme-version> is the last seven characters from MzScheme dll name
646(libmzschXXXXXXX.dll).
647If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
648DLL's, but will load them in runtime on demand.
649
650Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
651account that <Path-to-MzScheme> should contain slashes rather than backslashes
652(e.g. d:/Develop/MzScheme)
653
654"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
655explicitly) on MinGW and Cygwin requires additional step.
656
657libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
658%WINDOWS%\System32 to other location (either build directory, some temporary
659dir or even MzScheme home).
660
661Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
662make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
663    MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
664
665After a successful build, these dlls can be freely removed, leaving them in
666%WINDOWS%\System32 only.
667
668
669
67010. Building with Lua support
671============================
672
673Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
674You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
675This also applies to when you get a Vim executable and don't build yourself,
676do the part up to "Build".
677
6781) Download and install LuaBinaries
679
680Go to the Download page of LuaBinaries:
681  http://luabinaries.sourceforge.net/download.html
682
683Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
684lua-X.Y.Z_Win64_dllw4_lib.zip for x64.  You can use them both for MSVC and
685MinGW.
686
687Unpack it to a working directory. E.g. C:\projects\lua53.
688Lua's header files will be installed under the include directory.
689
690Copy luaXY.dll to your Windows system directory. The system directory depends
691on your Windows bitness and Vim bitness:
692  32-bit Vim on 32-bit Windows: C:\Windows\System32
693  32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
694  64-bit Vim on 64-bit Windows: C:\Windows\System32
695
696Or another option is copying luaXY.dll to the directory where gvim.exe
697(or vim.exe) is.
698
699
7002) Build
701
702You need to set LUA, DYNAMIC_LUA and LUA_VER.
703
704  LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
705  DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
706  LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
707
708E.g. When using MSVC (as one line):
709
710    nmake -f Make_mvc.mak
711        LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
712
713Or when using MinGW (as one line):
714
715    mingw32-make -f Make_ming.mak
716        LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
717
718
719Or when using Cygwin (as one line) (untested):
720
721    make -f Make_cyg.mak
722        LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
723
724
72511. Building with Perl support
726==============================
727
728Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
729You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
730
731    http://www.activestate.com/activeperl
732    http://strawberryperl.com/
733
734When building, you need to set the following variables:
735
736    PERL:         Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
737    DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
738    PERL_VER:     Perl version. E.g. 522 for Perl 5.22.X.
739
740E.g. When using MSVC (as one line):
741
742    nmake -f Make_mvc.mak
743        PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
744
745Or when using MinGW (as one line):
746
747    mingw32-make -f Make_ming.mak
748        PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
749
750
75112. Building with Ruby support
752==============================
753
754Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
755Ruby doesn't provide the official Windows binaries.  The most widely used
756Windows binaries might be RubyInstaller.  Currently Ruby 2.4 is recommended.
757
758    http://rubyinstaller.org/
759
760If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
761you need some tricks described below.
762(Another binary distribution is ActiveScriptRuby:
763    http://www.artonx.org/data/asr/)
764
765When building, you need to set the following variables at least:
766
767    RUBY:              Where ruby is installed. E.g. C:\Ruby24
768    DYNAMIC_RUBY:      Whether dynamic linking is used. Usually, set to yes.
769    RUBY_VER:          Ruby version. E.g. 24 for Ruby 2.4.X.
770    RUBY_API_VER_LONG: Ruby API version in a long format.
771                       E.g. 2.4.0 for Ruby 2.4.X.
772
773Ruby version vs. Ruby API version:
774
775    Ruby ver. | Ruby API ver.
776    =========================
777    1.8.X     | 1.8
778    1.9.[1-3] | 1.9.1
779    2.0.0     | 2.0.0
780    2.X.Y     | 2.X.0
781
782(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
783
784
785A) Using MSVC
786
787If you want to link with ruby, normally you must use the same compiler as
788which was used to build the ruby binary.  RubyInstaller is built with MinGW,
789so normally you cannot use MSVC for building Vim if you want to link with
790RubyInstaller.  If you use a different compiler, there are mainly two problems:
791config.h and Ruby's DLL name. Here are the steps for working around them:
792
793  1) Download and Install RubyInstaller.
794    You can install RubyInstaller with the default options and directory.
795    E.g.:
796      C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
797
798    Ruby 2.4.X is used in this example.
799
800  2) Download Ruby 2.4.X's source code and generate config.h:
801
802      cd C:\projects
803      git clone https://github.com/ruby/ruby.git -b ruby_2_4
804      cd ruby
805      win32\configure.bat
806      nmake .config.h.time
807
808    Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
809    There is no need to build whole Ruby, just config.h is needed.
810    If you use 32-bit MSVC 2015, the config.h is generated in the
811    .ext\include\i386-mswin32_140 directory.
812    If you use 64-bit MSVC 2015, the config.h is generated in the
813    .ext\include\x64-mswin64_140 directory.
814
815  3) Install the generated config.h.
816
817    For 32-bit version:
818
819      xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
820
821    For 64-bit version:
822
823      xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
824
825    Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
826    You may need to close the console and reopen it to pick up the new $PATH.
827
828  4) Build Vim. Note that you need to adjust some variables (as one line):
829
830    For 32-bit version:
831
832      nmake -f Make_mvc.mak
833          RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
834          RUBY_MSVCRT_NAME=msvcrt
835          WINVER=0x501
836
837    For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
838
839    If you set WINVER explicitly, it must be set to >=0x500, when building
840    with Ruby 2.1 or later.  (Default is 0x501.)
841    When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
842    which is used for the Ruby's DLL name.
843
844B) Using MinGW
845
846Using MinGW is easier than using MSVC when linking with RubyInstaller.
847After you install RubyInstaller, just type this (as one line):
848
849    mingw32-make -f Make_ming.mak
850        RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
851        WINVER=0x600
852
853For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
854If you set WINVER explicitly, it must be set to >=0x500, when building with
855Ruby 2.1 or later.  (Default is 0x600.)
856
857
858
85913. Building with Tcl support
860=============================
861
862Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
863You can use binaries from ActiveState (ActiveTcl).
864
865    http://www.activestate.com/activetcl
866
867Alternatively, you can use the binaries provided by IronTcl from
868
869    https://www.irontcl.com/
870
871They might lack behind the latest version a bit, but should provide 64bit
872and 32bit versions even if ActiveTcl does not provide them anymore.
873
874For building with MSVC 2015 use version 8.6.6 or later.
875When building, you need to set the following variables:
876
877    TCL:          Where tcl is installed. E.g. C:\Tcl86
878    DYNAMIC_TCL:  Whether dynamic linking is used. Usually, set to yes.
879    TCL_VER:      Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
880    TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
881
882Sometimes the Tcl dll name changes.  E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
883but ActiveTcl 8.6.6 comes with tcl86t.dll.  You can set the dll name by setting
884the TCL_DLL variable:
885    TCL_DLL=tcl86t.dll
886
887E.g. When using MSVC (as one line):
888
889    nmake -f Make_mvc.mak
890        TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
891
892Or when using MinGW (as one line):
893
894    mingw32-make -f Make_ming.mak
895        TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
896
897
89814. Building with Terminal support
899==================================
900
901Vim with Terminal support can be built with either MSVC, MinGW or Cygwin.
902This uses the included libvterm and winpty.  No extra header files or
903libraries are needed for building.  Just set TERMINAL to yes.
904
905E.g. When using MSVC:
906
907    nmake -f Make_mvc.mak TERMINAL=yes
908
909Or when using MinGW:
910
911    mingw32-make -f Make_ming.mak TERMINAL=yes
912
913
91415. Building with DirectX (DirectWrite) support
915===============================================
916
917Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
918This requires dwrite_2.h and some other header files which come with Windows
919SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
920This also requires MBYTE=yes which is enabled by default.
921
922A) Using MSVC
923
924If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
925You just need to specify DIRECTX=yes:
926
927    nmake -f Make_mvc.mak DIRECTX=yes
928
929If you use MSVC 2012 or earlier, the required header files are not available
930by default.  However, you can use the header files from newer SDKs with older
931compilers.  E.g.:
932
933    set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
934    nmake -f Make_mvc.mak DIRECTX=yes
935
936If you don't need color emoji support, only dwrite.h is required.  You can use
937older compilers (e.g. VC2010) without Windows SDK 8.1.  E.g.:
938
939    nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
940
941B) Using MinGW-w64
942
943Just set DIRECTX to yes:
944
945    mingw32-make -f Make_ming.mak DIRECTX=yes
946
947
94816. Windows 3.1x
949================
950
951The Windows 3.1x support was removed in patch 7.4.1364.
952
953
95417. MS-DOS
955==========
956
957The MS-DOS support was removed in patch 7.4.1399.  Only very old Vim versions
958work on MS-DOS because of the limited amount of memory available.
959
960
96118. Installing after building from sources
962==========================================
963
964[provided by Michael Soyka, updated by Ken Takata]
965
966After you've built the Vim binaries as described above, you're ready to
967install Vim on your system.  However, if you've obtained the Vim sources
968using Git, Mercurial or by downloading them as a unix tar file, you must
969first create a "vim81" directory.  If you instead downloaded the sources as
970zip files, you can skip this setup as the zip archives already have the
971correct directory structure.
972
973  A.  Create a Vim "runtime" subdirectory named "vim81"
974  -----------------------------------------------------
975  If you obtained your Vim sources as zip files, you can skip this step.
976  Otherwise, continue reading.
977
978  Go to the directory that contains the Vim "src" and "runtime"
979  directories and create a new subdirectory named "vim81".
980
981  Copy the "runtime" files into "vim81":
982     copy runtime\* vim81
983
984  B.  Copy the new binaries into the "vim81" directory
985  ----------------------------------------------------
986  Regardless of how you installed the Vim sources, you need to copy the
987  new binaries you created above into "vim81":
988
989     copy src\*.exe vim81
990     copy src\tee\tee.exe vim81
991     copy src\xxd\xxd.exe vim81
992
993  To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
994  versions of gvimext.dll.  They should be copied to "vim81\GvimExt32" and
995  "vim81\GvimExt64" respectively.
996  First, build the 32-bit version, then:
997
998     mkdir vim81\GvimExt32
999     copy src\GvimExt\gvimext.dll vim81\GvimExt32
1000
1001  Next, clean the 32-bit version and build the 64-bit version, then:
1002
1003     mkdir vim81\GvimExt64
1004     copy src\GvimExt\gvimext.dll vim81\GvimExt64
1005
1006  C.  Copy gettext and iconv DLLs into the "vim81" directory
1007  ----------------------------------------------------------
1008  Get gettext and iconv DLLs from the following site:
1009     https://github.com/mlocati/gettext-iconv-windows/releases
1010  Both 64- and 32-bit versions are needed.
1011  Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
1012  DLLs and place them as follows:
1013
1014        vim81\
1015            |   libintl-8.dll
1016            |   libiconv-2.dll
1017            |   libgcc_s_sjlj-1.dll     (only for 32-bit)
1018            |
1019            + GvimExt32\
1020            |   libintl-8.dll
1021            |   libiconv-2.dll
1022            |   libgcc_s_sjlj-1.dll
1023            |
1024            ` GvimExt64\
1025                libintl-8.dll
1026                libiconv-2.dll
1027
1028  The DLLs in the "vim81" should be the same bitness with the (g)vim.exe.
1029
1030  D.  Move the "vim81" directory into the Vim installation subdirectory
1031  ---------------------------------------------------------------------
1032  Move the "vim81" subdirectory into the subdirectory where you want Vim
1033  to be installed.  Typically, this subdirectory will be named "vim".
1034  If you already have a "vim81" subdirectory in "vim", delete it first
1035  by running its uninstal.exe program.
1036
1037  E.  Install Vim
1038  ---------------
1039  "cd" to your Vim installation subdirectory "vim\vim81" and run the
1040  "install.exe" program.  It will ask you a number of questions about
1041  how you would like to have your Vim setup.  Among these are:
1042  - You can tell it to write a "_vimrc" file with your preferences in the
1043    parent directory.
1044  - It can also install an "Edit with Vim" entry in the Windows Explorer
1045    popup menu.
1046  - You can have it create batch files, so that you can run Vim from the
1047    console or in a shell.  You can select one of the directories in your
1048    PATH or add the directory to PATH using the Windows Control Panel.
1049  - Create entries for Vim on the desktop and in the Start menu.
1050
1051Happy Vimming!
1052