blob: b1b14262c63eb635d9f3c13b0c6202339990f2e0 [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 Moolenaara87f8fd2018-09-18 22:58:41 +02006You can find the latest here: https://github.com/vim/vim-win32-installer
Bram Moolenaar18cfa942017-10-08 17:58:44 +02007This page also has links to install support for interfaces such as Perl,
8Python, Lua, etc.
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 Moolenaar18cfa942017-10-08 17:58:44 +020018The recommended way is to build a 32 bit Vim, also on 64 bit systems. You can
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010019build a 64 bit Vim if you like, the executable will be bigger and Vim won't be
Bram Moolenaar18cfa942017-10-08 17:58:44 +020020any faster, but you can edit files larger than 2 Gbyte.
21
Bram Moolenaar071d4272004-06-13 20:20:40 +000022
23Contents:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000241. Microsoft Visual C++
Bram Moolenaar304925e2018-06-30 16:27:02 +0200252. Using MSYS2 with MinGW
263. Using MinGW
274. Cygwin
Bram Moolenaareae1b912019-05-09 15:12:55 +0200285. 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 Terminal support
3714. Building with DirectX (DirectWrite) support
3815. Windows 3.1
3916. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000040
Bram Moolenaareae1b912019-05-09 15:12:55 +02004117. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020042
43
Bram Moolenaar18cfa942017-10-08 17:58:44 +020044The currently recommended way (that means it has been verified to work) is
45using the "Visual Studio Community 2015" installation. This includes the SDK
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010046needed to target Windows XP. But not older Windows versions (95, 98), see
Bram Moolenaara0754902019-11-19 23:01:28 +010047"OLDER VERSIONS" below for that.
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
49
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000501. Microsoft Visual C++
51=======================
52
Bram Moolenaar73f44392017-10-07 18:38:43 +020053We do not provide download links, since Microsoft keeps changing them. You
Bram Moolenaar18cfa942017-10-08 17:58:44 +020054can search for "Visual Studio Community 2015", for example. You will need to
Bram Moolenaar73f44392017-10-07 18:38:43 +020055create a Microsoft account (it's free).
56
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010057When installing "Visual Studio Community 2015 with Update 3" make sure to
58select "custom" and check "Windows XP Support for C++" and all checkboxes
59under "Universal Windows App Development Tools"
60
Bram Moolenaar73f44392017-10-07 18:38:43 +020061
Bram Moolenaar362e1a32006-03-06 23:29:24 +000062Visual Studio
63-------------
64
Bram Moolenaara0754902019-11-19 23:01:28 +010065Building with Visual Studio (VS2010, VS2012, VS2013, VS2015, VS2017 and VS2019)
66is straightforward.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020067
Bram Moolenaar362e1a32006-03-06 23:29:24 +000068To build Vim from the command line with MSVC, use Make_mvc.mak.
69Visual Studio installed a batch file called vcvars32.bat, which you must
70run to set up paths for nmake and MSVC.
71
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000072nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
73nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
74nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000075nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000076 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000077
78Make_mvc.mak allows a Vim to be built with various different features and
Bram Moolenaarfda97842019-05-07 22:25:27 +020079debug support.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000080
Bram Moolenaara0754902019-11-19 23:01:28 +010081For compiling gVim with IME support on far-east Windows, add IME=yes
Bram Moolenaar362e1a32006-03-06 23:29:24 +000082to the parameters you pass to Make_mvc.mak.
83
Bram Moolenaar362e1a32006-03-06 23:29:24 +000084See the specific files for comments and options.
85
86These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
87Ron Aaron; they have been tested.
88
89
Bram Moolenaar02cfac82016-04-21 14:34:58 +020090Visual C++ 2010 Express Edition *msvc-2010-express*
91-------------------------------
92
93Visual C++ 2010 Express Edition can be downloaded for free from:
94 http://www.microsoft.com/express/vc/Default.aspx
95This includes the IDE and the debugger.
96
97To set the environment execute the msvc2010.bat script. You can then build
98Vim with Make_mvc.mak.
99
100
Bram Moolenaar73f44392017-10-07 18:38:43 +0200101Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
102---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200103
104Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
105so that it targets Windows 6.0 (Vista) by default. In order to override
106this, the target Windows version number needs to be passed to LINK like
107follows:
108 LINK ... /subsystem:console,5.01
109
110Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200111Use lines like follows to target Windows XP x86 (assuming using Visual C++
1122012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200113 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200114 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
115 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200116 set CL=/D_USING_V110_SDK71_
117 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
118
Bram Moolenaar73f44392017-10-07 18:38:43 +0200119To target Windows XP x64 instead of x86, you need to change the settings of
120LIB and SUBSYSTEM_VER:
121 ...
122 set LIB=%WinSdk71%\Lib\x64;%LIB%
123 ...
124 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
125
126If you use Visual C++ 2015 (either Express or Community Edition), executing
127msvc2015.bat will set them automatically. For x86 builds run this without
128options:
129 msvc2015
130For x64 builds run this with the "x86_amd64" option:
131 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200132This enables x86_x64 cross compiler. This works on any editions including
133Express edition.
134If you use Community (or Professional) edition, you can enable the x64 native
135compiler by using the "x64" option:
136 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200137
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200138The following Visual C++ team blog can serve as a reference page:
139 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
140
Bram Moolenaara0754902019-11-19 23:01:28 +0100141VC 2019 dropped support for targeting Windows XP. If you want a binary that
142targeting Windows XP, use VC 2017 or earlier.
143
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200144
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200145Cross compile support for Windows on ARM64
146------------------------------------------
147
148This depends on VS2017 with the optional ARM64 compiler and SDK
149installed. Use "vcvarsall.bat x64_arm64" as the build environment.
150
151The ARM64 support was provided by Leendert van Doorn.
152
153
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200154OLDER VERSIONS
155
156The minimal supported version is Windows XP. Building with older compilers
157might still work, but these instructions might be outdated.
158
159If you need the executable to run on Windows 98 or ME, use the 2003 one
Bram Moolenaara0754902019-11-19 23:01:28 +0100160|msvc-2003-toolkit| or |msvc-2005-express|, and use the source code before
1618.0.0029.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200162
Bram Moolenaarc236c162008-07-13 17:41:49 +0000163Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000164-----------------------
165
Bram Moolenaara0754902019-11-19 23:01:28 +0100166NOTE: this most likely does not work
167
Bram Moolenaarc236c162008-07-13 17:41:49 +0000168You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000169 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200170Unfortunately this URL is no longer valid. Unofficial downloads appear to be
Bram Moolenaarc236c162008-07-13 17:41:49 +0000171available from links mentioned on these pages (use at your own risk):
172 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
173 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
174
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000175This contains the command-line tools (compiler, linker, CRT headers,
176and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
177To compile and debug Vim with the VC2003 Toolkit, you will also need
178|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
179and |windbg-download|.
180
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000181It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
182which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000183
184The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
185 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
186(This site also takes you through configuring a number of other
187free C compilers for Win32.)
188
189To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
190execute the following commands in a cmd.exe window (the msvcsetup.bat batch
191file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000192
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000193 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
194 call "%VCToolkitInstallDir%vcvars32.bat"
195 set MSVCVer=7.1
196 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
197 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
198
199Now you can build Vim with Make_mvc.mak.
200
201
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000202Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000203
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200204You will also need a copy of the Windows Platform SDK. Specifically, you need
205the Windows Core SDK subset of the Platform SDK, which contains the Windows
206headers and libraries. You need to search for it, Microsoft keeps changing
207the URL.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000208
209
210Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
211
212You need the .NET Framework 1.1 Redistributable Package from
213 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
214or from Windows Update:
215 http://windowsupdate.microsoft.com/
216This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
217which is needed to link Vim.
218
219
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000220Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000221
222You need the .NET Framework 1.1 SDK from
223 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
224This contains some additional libraries needed to compile Vim,
225such as msvcrt.lib. You must install |dotnet-1.1-redist| before
226installing the .NET 1.1 SDK.
227
228
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000229Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000230
231The Debugging Tools for Windows can be downloaded from
232 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
233This includes the WinDbg debugger, which you will want if you ever need
234to debug Vim itself. An earlier version of the Debugging Tools
235is also available through the Platform SDK, |ms-platform-sdk|.
236
237
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000238Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000239-------------------------------
240
Bram Moolenaara0754902019-11-19 23:01:28 +0100241NOTE: this most likely does not work
242
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000243Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000244 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
245This includes the IDE and the debugger. You will also need
246|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
247
248Instructions for integrating the Platform SDK into VC Express:
249 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
250
251
Bram Moolenaara0754902019-11-19 23:01:28 +0100252Visual C++ 2008 Express Edition *msvc-2008-express*
253-------------------------------
254
255NOTE: this most likely does not work
256
257Visual C++ 2008 Express Edition can be downloaded for free from:
258 http://www.microsoft.com/express/downloads/
259This includes the IDE and the debugger.
260
261To set the environment execute the msvc2008.bat script. You can then build
262Vim with Make_mvc.mak.
263
264For building 64 bit binaries you also need to install the SDK:
265"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
266You don't need the examples and documentation.
267
268If you get an error that Win32.mak can't be found, you have to set the
269variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
270puts include files in the following directory:
271 set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
272
273
Bram Moolenaar304925e2018-06-30 16:27:02 +02002742. MSYS2 with MinGW
275===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200276
Bram Moolenaar304925e2018-06-30 16:27:02 +02002772.1. Setup the basic msys2 environment
278
279Go to the official page of MSYS2: https://www.msys2.org
280Download an installer:
281
282* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
283 (Even if you want to build 32-bit Vim)
284* msys2-i686-YYYYMMDD.exe for 32-bit Windows
285
286Execute the installer and follow the instructions to update basic packages.
287At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200288open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200289
290Execute:
291 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200292
293And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu).
Bram Moolenaar304925e2018-06-30 16:27:02 +0200294Then execute:
295 $ pacman -Su
296
297If pacman complains that `catgets` and `libcatgets` conflict with another
298package, select `y` to remove them.
299
300
3012.2. Install additional packages for building Vim
302
303The following package groups are required for building Vim:
304
305* base-devel
306* mingw-w64-i686-toolchain (for building 32-bit Vim)
307* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
308
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200309(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200310Use the following command to install them:
311
312 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
313
314Or you can use the `pacboy` command to avoid long package names:
315
316 $ pacboy -S base-devel: toolchain:m
317
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200318The suffix ":" means that it disables the package name translation.
319The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
320to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200321(See `pacboy help` for the help.)
322
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200323See also the pacman page in ArchWiki for the general usage of pacman:
324 https://wiki.archlinux.org/index.php/pacman
325
326MSYS2 has its own git package, and you can also install it via pacman:
327
328 $ pacman -S git
329
Bram Moolenaar304925e2018-06-30 16:27:02 +0200330
3312.3. Keep the build environment up-to-date
332
333After you have installed the build environment, you may want to keep it
334up-to-date (E.g. always use the latest GCC).
335In that case, you just need to execute the command:
336 $ pacman -Syu
337
338
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02003392.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200340
341Select one of the following icon from the Start Menu:
342
343* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
344* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
345
346Go to the source directory of Vim, then execute the make command. E.g.:
347
348 make -f Make_ming.mak
349 make -f Make_ming.mak GUI=no
350 make -f Make_ming.mak GUI=no DEBUG=yes
351
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200352NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200353console for that. You need to set $PATH to be able to build there, e.g.:
354
355 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
356
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200357This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200358
359 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
360
361If you have msys64 in another location you will need to adjust the paths for
362that.
363
364
3653. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000366========
367
Bram Moolenaara0754902019-11-19 23:01:28 +0100368(written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000369
Bram Moolenaara0754902019-11-19 23:01:28 +0100370This is about how to produce a Win32 binary of gvim with MinGW from the normal
371Command Prompt window. (To use MSYS2 console, see above.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000372
Bram Moolenaara0754902019-11-19 23:01:28 +0100373First, you need to get the 'MinGW-w64' compiler, which is free for the
374download at:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100375
376 http://mingw-w64.sourceforge.net/
377
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100378Or a compiler provided on msys2:
379
Bram Moolenaara0754902019-11-19 23:01:28 +0100380 https://www.msys2.org/
381
382The original 'mingw32' compiler is outdated, and may no longer work:
383
384 http://www.mingw.org/
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100385
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000386Once you have downloaded the compiler binaries, unpack them on your hard disk
Bram Moolenaara0754902019-11-19 23:01:28 +0100387somewhere, and put them on your PATH. Go to the Control Panel, (Performance
388and Maintenance), System, Advanced, and edit the environment from there. If
389you use the standalone MinGW-w64 compiler, the path may depends on your
390installation. If you use msys2 compilers, set your installed paths (normally
391one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100392
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100393 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
394 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
395 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000396
Bram Moolenaara0754902019-11-19 23:01:28 +0100397Test if gcc is on your path. From a Command Prompt window:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000398
399 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100400 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000401
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100402 C:\> mingw32-make --version
403 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000404
405Now you are ready to rock 'n' roll. Unpack the vim sources (look on
406www.vim.org for exactly which version of the vim files you need).
407
408Change directory to 'vim\src':
409
410 C:\> cd vim\src
411 C:\VIM\SRC>
412
413and you type:
414
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100415 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000416
417After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
418directory.
419
420You should not need to do *any* editing of any files to get vim compiled this
421way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100422is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100423
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100424 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000425
426If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
427(also free!) and compress the file (typical compression is 50%). UPX can be
428found at
429 http://www.upx.org/
430
Bram Moolenaar91856272012-02-29 16:56:39 +0100431As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
432built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
433at:
434 http://www.matcode.com/mpress.htm
435
436
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000437ADDITION: NLS support with MinGW
438
439(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
440
441If you want National Language Support, read the file src/po/README_mingw.txt.
442You need to uncomment lines in Make_ming.mak to have NLS defined.
443
444
Bram Moolenaar304925e2018-06-30 16:27:02 +02004454. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000446=========
447
448Use Make_cyg.mak with Cygwin's GCC. See
449 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
450
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100451With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000452Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100453running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000454with the other makefiles).
455
456
Bram Moolenaareae1b912019-05-09 15:12:55 +02004575. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000458=================================================
459
460[Update of 1) needs to be verified]
461
462If you like, you can compile the 'mingw' Win32 version from the comfort of
463your Linux (or other unix) box. To do this, you need to follow a few steps:
464 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100465 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000466 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000467 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100468 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
469 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
470 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100471 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000472 4) make -f Make_ming.mak gvim.exe
473
474Now you have created the Windows binary from your Linux box! Have fun...
475
476
Bram Moolenaareae1b912019-05-09 15:12:55 +02004776. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000478===============================
479
Bram Moolenaara0754902019-11-19 23:01:28 +0100480For building with MSVC the "Windows Installer" from www.python.org works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000481
Bram Moolenaar30a89472016-01-10 14:35:58 +0100482When building, you need to set the following variables at least:
483
484 PYTHON: Where Python is installed. E.g. C:\Python27
485 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
486 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
487
488E.g. When using MSVC (as one line):
489
490 nmake -f Make_mvc.mak
491 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
492
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100493When using MinGW and link with the official Python (as one line):
494
495 mingw32-make -f Make_ming.mak
496 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
497
498When using msys2 and link with Python2 bundled with msys2 (as one line):
499
500 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
501 PYTHON_HOME=c:/msys64/mingw64
502 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
503 DYNAMIC_PYTHON=yes
504 PYTHON_VER=27
505 DYNAMIC_PYTHON_DLL=libpython2.7.dll
506 STATIC_STDCPLUS=yes
507
508(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
509(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
510libstdc++-6.dll.)
511
512
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200513(rest written by Ron Aaron: <ronaharon@yahoo.com>)
514
515Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000516 http://www.ActiveState.com/Products/ActivePython/
517
518After installing the ActivePython, you will have to create a 'mingw32'
519'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100520 cd $PYTHON/libs
521 pexports python20.dll > python20.def
522 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000523
524Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
525the root of the Python installation (C:\Python20, for example). If you are
526cross-compiling on Linux with the mingw32 setup, you need to also convert all
527the 'Include' files to *unix* line-endings. This bash command will do it
528easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100529 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000530
531Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100532 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000533
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100534You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000535
536
Bram Moolenaareae1b912019-05-09 15:12:55 +02005377. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100538================================
539
Bram Moolenaara0754902019-11-19 23:01:28 +0100540For building with MSVC the "Windows Installer" from www.python.org works fine.
541Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100542
543When building, you need to set the following variables at least:
544
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100545 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100546 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100547 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100548
549E.g. When using MSVC (as one line):
550
551 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100552 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
553
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100554When using MinGW and link with the official Python3 (as one line):
555
556 mingw32-make -f Make_ming.mak
557 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100558
559When using msys2 and link with Python3 bundled with msys2 (as one line):
560
561 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
562 PYTHON3_HOME=c:/msys64/mingw64
563 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
564 DYNAMIC_PYTHON3=yes
565 PYTHON3_VER=36
566 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
567 STATIC_STDCPLUS=yes
568
569(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100570(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
571libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100572
573
Bram Moolenaareae1b912019-05-09 15:12:55 +02005748. Building with Racket or MzScheme support
Bram Moolenaara0754902019-11-19 23:01:28 +0100575===========================================
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100576
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005771) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100578
579MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200580support can be built with either MSVC or MinGW (or Cygwin).
581Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100582
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200583Copy lib/libracket{version}.dll to your Windows system directory. The system
584directory depends on your Windows bitness and Vim bitness:
585 32-bit Vim on 32-bit Windows: C:\Windows\System32
586 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
587 64-bit Vim on 64-bit Windows: C:\Windows\System32
588
589For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100590
591 MZSCHEME: Where Racket is installed.
592 E.g. C:\Program Files (x86)\Racket
593 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200594 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200595 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200596 The DLL can be found under the lib directory. E.g.
597 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100598 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
599 runtime. Default: $(MZSCHEME)\collects
600 User can override this with the PLTCOLLECTS environment
601 variable.
602
Bram Moolenaar73f44392017-10-07 18:38:43 +0200603List of MZSCHEME_VER (incomplete):
604
605 Racket ver. | MZSCHEME_VER
606 ==========================
607 6.3 | 3m_9z0ds0
608 6.6 | 3m_a0solc
609 6.8 | 3m_a1zjsw
610 6.10 | 3m_a36fs8
611
612
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100613E.g. When using MSVC (as one line):
614
615 nmake -f Make_mvc.mak
616 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
617 MZSCHEME_VER=3m_9z0ds0
618
619Or when using MinGW (as one line):
620
621 mingw32-make -f Make_ming.mak
622 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
623 MZSCHEME_VER=3m_9z0ds0
624
625 Spaces should be escaped with '\'.
626
627
Bram Moolenaar18cfa942017-10-08 17:58:44 +02006282) Building with MzScheme support (older)
629
630(written by Sergey Khorev <sergey.khorev@gmail.com>)
631
632Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
633be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
634above (including 299 and 30x series).
635
636The MSVC build is quite straightforward. Simply invoke (in one line)
637nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
638 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
639where <MzScheme-version> is the last seven characters from MzScheme dll name
640(libmzschXXXXXXX.dll).
641If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
642DLL's, but will load them in runtime on demand.
643
644Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
645account that <Path-to-MzScheme> should contain slashes rather than backslashes
646(e.g. d:/Develop/MzScheme)
647
648"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
649explicitly) on MinGW and Cygwin requires additional step.
650
651libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
652%WINDOWS%\System32 to other location (either build directory, some temporary
653dir or even MzScheme home).
654
655Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
656make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
657 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
658
659After a successful build, these dlls can be freely removed, leaving them in
660%WINDOWS%\System32 only.
661
662
663
Bram Moolenaareae1b912019-05-09 15:12:55 +02006649. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100665============================
666
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100667Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
668You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
669This also applies to when you get a Vim executable and don't build yourself,
670do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100671
6721) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100673
Bram Moolenaar30a89472016-01-10 14:35:58 +0100674Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100675 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100676
677Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100678lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100679MinGW.
680
681Unpack it to a working directory. E.g. C:\projects\lua53.
682Lua's header files will be installed under the include directory.
683
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100684Copy luaXY.dll to your Windows system directory. The system directory depends
685on your Windows bitness and Vim bitness:
686 32-bit Vim on 32-bit Windows: C:\Windows\System32
687 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
688 64-bit Vim on 64-bit Windows: C:\Windows\System32
689
690Or another option is copying luaXY.dll to the directory where gvim.exe
691(or vim.exe) is.
692
Bram Moolenaar30a89472016-01-10 14:35:58 +0100693
6942) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100695
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100696You need to set LUA, DYNAMIC_LUA and LUA_VER.
697
698 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
699 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
700 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100701
702E.g. When using MSVC (as one line):
703
704 nmake -f Make_mvc.mak
705 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
706
707Or when using MinGW (as one line):
708
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200709 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100710 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100711
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100712
713Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100714
715 make -f Make_cyg.mak
716 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
717
718
Bram Moolenaareae1b912019-05-09 15:12:55 +020071910. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100720==============================
721
722Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
723You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
724
725 http://www.activestate.com/activeperl
726 http://strawberryperl.com/
727
728When building, you need to set the following variables:
729
730 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
731 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
732 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
733
734E.g. When using MSVC (as one line):
735
736 nmake -f Make_mvc.mak
737 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
738
739Or when using MinGW (as one line):
740
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200741 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100742 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100743
744
Bram Moolenaareae1b912019-05-09 15:12:55 +020074511. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100746==============================
747
748Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
749Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200750Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100751
752 http://rubyinstaller.org/
753
754If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
755you need some tricks described below.
756(Another binary distribution is ActiveScriptRuby:
757 http://www.artonx.org/data/asr/)
758
759When building, you need to set the following variables at least:
760
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200761 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200762 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200763 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200764 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200765 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100766
767Ruby version vs. Ruby API version:
768
769 Ruby ver. | Ruby API ver.
770 =========================
771 1.8.X | 1.8
772 1.9.[1-3] | 1.9.1
773 2.0.0 | 2.0.0
774 2.X.Y | 2.X.0
775
776(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
777
778
779A) Using MSVC
780
781If you want to link with ruby, normally you must use the same compiler as
782which was used to build the ruby binary. RubyInstaller is built with MinGW,
783so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200784RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100785config.h and Ruby's DLL name. Here are the steps for working around them:
786
787 1) Download and Install RubyInstaller.
788 You can install RubyInstaller with the default options and directory.
789 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200790 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100791
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200792 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100793
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200794 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100795
796 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200797 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100798 cd ruby
799 win32\configure.bat
800 nmake .config.h.time
801
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200802 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100803 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100804 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200805 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100806 If you use 64-bit MSVC 2015, the config.h is generated in the
807 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100808
809 3) Install the generated config.h.
810
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100811 For 32-bit version:
812
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100813 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100814
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100815 For 64-bit version:
816
817 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
818
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200819 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
820 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100821
822 4) Build Vim. Note that you need to adjust some variables (as one line):
823
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100824 For 32-bit version:
825
Bram Moolenaar30a89472016-01-10 14:35:58 +0100826 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200827 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100828 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200829 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100830
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100831 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
832
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200833 If you set WINVER explicitly, it must be set to >=0x500, when building
834 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100835 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
836 which is used for the Ruby's DLL name.
837
838B) Using MinGW
839
840Using MinGW is easier than using MSVC when linking with RubyInstaller.
841After you install RubyInstaller, just type this (as one line):
842
843 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100844 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100845 WINVER=0x600
Bram Moolenaar30a89472016-01-10 14:35:58 +0100846
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100847For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200848If you set WINVER explicitly, it must be set to >=0x500, when building with
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100849Ruby 2.1 or later. (Default is 0x600.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200850
Bram Moolenaar30a89472016-01-10 14:35:58 +0100851
852
Bram Moolenaareae1b912019-05-09 15:12:55 +020085312. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100854=============================
855
856Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
857You can use binaries from ActiveState (ActiveTcl).
858
859 http://www.activestate.com/activetcl
860
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100861Alternatively, you can use the binaries provided by IronTcl from
862
863 https://www.irontcl.com/
864
865They might lack behind the latest version a bit, but should provide 64bit
866and 32bit versions even if ActiveTcl does not provide them anymore.
867
868For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100869When building, you need to set the following variables:
870
871 TCL: Where tcl is installed. E.g. C:\Tcl86
872 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
873 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
874 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
875
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200876Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
877but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
878the TCL_DLL variable:
879 TCL_DLL=tcl86t.dll
880
Bram Moolenaar30a89472016-01-10 14:35:58 +0100881E.g. When using MSVC (as one line):
882
883 nmake -f Make_mvc.mak
884 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
885
886Or when using MinGW (as one line):
887
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200888 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100889 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100890
891
Bram Moolenaareae1b912019-05-09 15:12:55 +020089213. Building with Terminal support
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200893==================================
894
Bram Moolenaar8a773062017-07-24 22:29:21 +0200895Vim with Terminal support can be built with either MSVC, MinGW or Cygwin.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200896This uses the included libvterm and winpty. No extra header files or
Bram Moolenaar8a773062017-07-24 22:29:21 +0200897libraries are needed for building. Just set TERMINAL to yes.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200898
Bram Moolenaar8a773062017-07-24 22:29:21 +0200899E.g. When using MSVC:
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200900
Bram Moolenaar8a773062017-07-24 22:29:21 +0200901 nmake -f Make_mvc.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200902
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100903Or when using MinGW:
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200904
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200905 mingw32-make -f Make_ming.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200906
907
Bram Moolenaareae1b912019-05-09 15:12:55 +020090814. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100909===============================================
910
911Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
912This requires dwrite_2.h and some other header files which come with Windows
913SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
914This also requires MBYTE=yes which is enabled by default.
915
916A) Using MSVC
917
918If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
919You just need to specify DIRECTX=yes:
920
921 nmake -f Make_mvc.mak DIRECTX=yes
922
923If you use MSVC 2012 or earlier, the required header files are not available
924by default. However, you can use the header files from newer SDKs with older
925compilers. E.g.:
926
927 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
928 nmake -f Make_mvc.mak DIRECTX=yes
929
930If you don't need color emoji support, only dwrite.h is required. You can use
931older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
932
933 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
934
935B) Using MinGW-w64
936
937Just set DIRECTX to yes:
938
939 mingw32-make -f Make_ming.mak DIRECTX=yes
940
941
Bram Moolenaareae1b912019-05-09 15:12:55 +020094215. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100943================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000944
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100945The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000946
947
Bram Moolenaareae1b912019-05-09 15:12:55 +020094816. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100949==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000950
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100951The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
952work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200953
954
Bram Moolenaareae1b912019-05-09 15:12:55 +020095517. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200956==========================================
957
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100958[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200959
960After you've built the Vim binaries as described above, you're ready to
961install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100962using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100963first create a "vim81" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200964zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100965correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200966
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100967 A. Create a Vim "runtime" subdirectory named "vim81"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200968 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100969 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200970 Otherwise, continue reading.
971
972 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100973 directories and create a new subdirectory named "vim81".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100974
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100975 Copy the "runtime" files into "vim81":
976 copy runtime\* vim81
Bram Moolenaar734d9982011-07-15 13:52:04 +0200977
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100978 B. Copy the new binaries into the "vim81" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200979 ----------------------------------------------------
980 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100981 new binaries you created above into "vim81":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200982
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100983 copy src\*.exe vim81
984 copy src\tee\tee.exe vim81
985 copy src\xxd\xxd.exe vim81
Bram Moolenaar734d9982011-07-15 13:52:04 +0200986
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100987 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100988 versions of gvimext.dll. They should be copied to "vim81\GvimExt32" and
989 "vim81\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100990 First, build the 32-bit version, then:
991
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100992 mkdir vim81\GvimExt32
993 copy src\GvimExt\gvimext.dll vim81\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100994
995 Next, clean the 32-bit version and build the 64-bit version, then:
996
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100997 mkdir vim81\GvimExt64
998 copy src\GvimExt\gvimext.dll vim81\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100999
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001000 C. Copy gettext and iconv DLLs into the "vim81" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001001 ----------------------------------------------------------
1002 Get gettext and iconv DLLs from the following site:
1003 https://github.com/mlocati/gettext-iconv-windows/releases
1004 Both 64- and 32-bit versions are needed.
1005 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
1006 DLLs and place them as follows:
1007
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001008 vim81\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001009 | libintl-8.dll
1010 | libiconv-2.dll
1011 | libgcc_s_sjlj-1.dll (only for 32-bit)
1012 |
1013 + GvimExt32\
1014 | libintl-8.dll
1015 | libiconv-2.dll
1016 | libgcc_s_sjlj-1.dll
1017 |
1018 ` GvimExt64\
1019 libintl-8.dll
1020 libiconv-2.dll
1021
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001022 The DLLs in the "vim81" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001023
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001024 D. Move the "vim81" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +02001025 ---------------------------------------------------------------------
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001026 Move the "vim81" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001027 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001028 If you already have a "vim81" subdirectory in "vim", delete it first
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001029 by running its uninstall.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001030
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001031 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +02001032 ---------------
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001033 "cd" to your Vim installation subdirectory "vim\vim81" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +02001034 "install.exe" program. It will ask you a number of questions about
1035 how you would like to have your Vim setup. Among these are:
1036 - You can tell it to write a "_vimrc" file with your preferences in the
1037 parent directory.
1038 - It can also install an "Edit with Vim" entry in the Windows Explorer
1039 popup menu.
1040 - You can have it create batch files, so that you can run Vim from the
1041 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001042 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001043 - Create entries for Vim on the desktop and in the Start menu.
1044
1045Happy Vimming!