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