blob: 4b2bd3df7ce9f9f2317fc0fd2ea18d6de2d274dc [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
285. Borland
296. Cross compiling for Win32 from a Linux machine
307. Building with Python support
318. Building with Python3 support
329. Building with Racket or MzScheme support
3310. Building with Lua support
3411. Building with Perl support
3512. Building with Ruby support
3613. Building with Tcl support
3714. Building with Terminal support
3815. Building with DirectX (DirectWrite) support
3916. Windows 3.1
4017. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000041
Bram Moolenaar304925e2018-06-30 16:27:02 +02004218. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020043
44
Bram Moolenaar18cfa942017-10-08 17:58:44 +020045The currently recommended way (that means it has been verified to work) is
46using the "Visual Studio Community 2015" installation. This includes the SDK
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010047needed to target Windows XP. But not older Windows versions (95, 98), see
Bram Moolenaar18cfa942017-10-08 17:58:44 +020048|msvc-2008-express| below for that
Bram Moolenaar071d4272004-06-13 20:20:40 +000049
50
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000511. Microsoft Visual C++
52=======================
53
Bram Moolenaar73f44392017-10-07 18:38:43 +020054We do not provide download links, since Microsoft keeps changing them. You
Bram Moolenaar18cfa942017-10-08 17:58:44 +020055can search for "Visual Studio Community 2015", for example. You will need to
Bram Moolenaar73f44392017-10-07 18:38:43 +020056create a Microsoft account (it's free).
57
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010058When installing "Visual Studio Community 2015 with Update 3" make sure to
59select "custom" and check "Windows XP Support for C++" and all checkboxes
60under "Universal Windows App Development Tools"
61
Bram Moolenaar73f44392017-10-07 18:38:43 +020062
Bram Moolenaar362e1a32006-03-06 23:29:24 +000063Visual Studio
64-------------
65
Bram Moolenaar30a89472016-01-10 14:35:58 +010066Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
67VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
68should also work for VS 4 and VS 5.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +000069
Bram Moolenaar73f44392017-10-07 18:38:43 +020070Using VS C++ 2008 Express is recommended if you need the binary to run on
71Windows 95 or 97, see |msvc-2008-express| below.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020072
Bram Moolenaar362e1a32006-03-06 23:29:24 +000073To build Vim from the command line with MSVC, use Make_mvc.mak.
74Visual Studio installed a batch file called vcvars32.bat, which you must
75run to set up paths for nmake and MSVC.
76
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000077nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
78nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
79nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000080nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000081 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000082
83Make_mvc.mak allows a Vim to be built with various different features and
84debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
85For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
86
87For compiling Gvim with IME support on far-east Windows, add IME=yes
88to the parameters you pass to Make_mvc.mak.
89
90To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
91(Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
92far more configuration.) Make_ivc.mak can also be built with nmake.
93
94nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000095 GUI Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000096nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000097 OLE Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000098
99See the specific files for comments and options.
100
101These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
102Ron Aaron; they have been tested.
103
104
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200105Visual C++ 2008 Express Edition *msvc-2008-express*
106-------------------------------
107
108Visual C++ 2008 Express Edition can be downloaded for free from:
109 http://www.microsoft.com/express/downloads/
110This includes the IDE and the debugger.
111
112To set the environment execute the msvc2008.bat script. You can then build
113Vim with Make_mvc.mak.
114
115For building 64 bit binaries you also need to install the SDK:
116"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
117You don't need the examples and documentation.
118
119If you get an error that Win32.mak can't be found, you have to set the
120variable SDK_INCLUDE_DIR. For example, on Windows 10, installation of MSVC
121puts include files in the following directory:
122 set SDK_INCLUDE_DIR=C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
123
124
125Visual C++ 2010 Express Edition *msvc-2010-express*
126-------------------------------
127
128Visual C++ 2010 Express Edition can be downloaded for free from:
129 http://www.microsoft.com/express/vc/Default.aspx
130This includes the IDE and the debugger.
131
132To set the environment execute the msvc2010.bat script. You can then build
133Vim with Make_mvc.mak.
134
135
Bram Moolenaar73f44392017-10-07 18:38:43 +0200136Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
137---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200138
139Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
140so that it targets Windows 6.0 (Vista) by default. In order to override
141this, the target Windows version number needs to be passed to LINK like
142follows:
143 LINK ... /subsystem:console,5.01
144
145Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200146Use lines like follows to target Windows XP x86 (assuming using Visual C++
1472012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200148 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200149 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
150 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200151 set CL=/D_USING_V110_SDK71_
152 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
153
Bram Moolenaar73f44392017-10-07 18:38:43 +0200154To target Windows XP x64 instead of x86, you need to change the settings of
155LIB and SUBSYSTEM_VER:
156 ...
157 set LIB=%WinSdk71%\Lib\x64;%LIB%
158 ...
159 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
160
161If you use Visual C++ 2015 (either Express or Community Edition), executing
162msvc2015.bat will set them automatically. For x86 builds run this without
163options:
164 msvc2015
165For x64 builds run this with the "x86_amd64" option:
166 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200167This enables x86_x64 cross compiler. This works on any editions including
168Express edition.
169If you use Community (or Professional) edition, you can enable the x64 native
170compiler by using the "x64" option:
171 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200172
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200173The following Visual C++ team blog can serve as a reference page:
174 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
175
176
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200177Cross compile support for Windows on ARM64
178------------------------------------------
179
180This depends on VS2017 with the optional ARM64 compiler and SDK
181installed. Use "vcvarsall.bat x64_arm64" as the build environment.
182
183The ARM64 support was provided by Leendert van Doorn.
184
185
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200186OLDER VERSIONS
187
188The minimal supported version is Windows XP. Building with older compilers
189might still work, but these instructions might be outdated.
190
191If you need the executable to run on Windows 98 or ME, use the 2003 one
192|msvc-2003-toolkit|.
193
Bram Moolenaarc236c162008-07-13 17:41:49 +0000194Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000195-----------------------
196
Bram Moolenaarc236c162008-07-13 17:41:49 +0000197You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000198 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200199Unfortunately this URL is no longer valid. Unofficial downloads appear to be
Bram Moolenaarc236c162008-07-13 17:41:49 +0000200available from links mentioned on these pages (use at your own risk):
201 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
202 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
203
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000204This contains the command-line tools (compiler, linker, CRT headers,
205and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
206To compile and debug Vim with the VC2003 Toolkit, you will also need
207|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
208and |windbg-download|.
209
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000210It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
211which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000212
213The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
214 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
215(This site also takes you through configuring a number of other
216free C compilers for Win32.)
217
218To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
219execute the following commands in a cmd.exe window (the msvcsetup.bat batch
220file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000221
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000222 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
223 call "%VCToolkitInstallDir%vcvars32.bat"
224 set MSVCVer=7.1
225 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
226 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
227
228Now you can build Vim with Make_mvc.mak.
229
230
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000231Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000232
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200233You will also need a copy of the Windows Platform SDK. Specifically, you need
234the Windows Core SDK subset of the Platform SDK, which contains the Windows
235headers and libraries. You need to search for it, Microsoft keeps changing
236the URL.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000237
238
239Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
240
241You need the .NET Framework 1.1 Redistributable Package from
242 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
243or from Windows Update:
244 http://windowsupdate.microsoft.com/
245This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
246which is needed to link Vim.
247
248
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000249Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000250
251You need the .NET Framework 1.1 SDK from
252 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
253This contains some additional libraries needed to compile Vim,
254such as msvcrt.lib. You must install |dotnet-1.1-redist| before
255installing the .NET 1.1 SDK.
256
257
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000258Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000259
260The Debugging Tools for Windows can be downloaded from
261 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
262This includes the WinDbg debugger, which you will want if you ever need
263to debug Vim itself. An earlier version of the Debugging Tools
264is also available through the Platform SDK, |ms-platform-sdk|.
265
266
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000267Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000268-------------------------------
269
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000270Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000271 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
272This includes the IDE and the debugger. You will also need
273|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
274
275Instructions for integrating the Platform SDK into VC Express:
276 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
277
278
Bram Moolenaar304925e2018-06-30 16:27:02 +02002792. MSYS2 with MinGW
280===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200281
Bram Moolenaar304925e2018-06-30 16:27:02 +02002822.1. Setup the basic msys2 environment
283
284Go to the official page of MSYS2: https://www.msys2.org
285Download an installer:
286
287* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
288 (Even if you want to build 32-bit Vim)
289* msys2-i686-YYYYMMDD.exe for 32-bit Windows
290
291Execute the installer and follow the instructions to update basic packages.
292At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200293open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200294
295Execute:
296 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200297
298And restart MSYS2 console (select "MSYS2 MSYS" icon from the Start Menu).
Bram Moolenaar304925e2018-06-30 16:27:02 +0200299Then execute:
300 $ pacman -Su
301
302If pacman complains that `catgets` and `libcatgets` conflict with another
303package, select `y` to remove them.
304
305
3062.2. Install additional packages for building Vim
307
308The following package groups are required for building Vim:
309
310* base-devel
311* mingw-w64-i686-toolchain (for building 32-bit Vim)
312* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
313
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200314(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200315Use the following command to install them:
316
317 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
318
319Or you can use the `pacboy` command to avoid long package names:
320
321 $ pacboy -S base-devel: toolchain:m
322
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200323The suffix ":" means that it disables the package name translation.
324The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
325to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200326(See `pacboy help` for the help.)
327
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200328See also the pacman page in ArchWiki for the general usage of pacman:
329 https://wiki.archlinux.org/index.php/pacman
330
331MSYS2 has its own git package, and you can also install it via pacman:
332
333 $ pacman -S git
334
Bram Moolenaar304925e2018-06-30 16:27:02 +0200335
3362.3. Keep the build environment up-to-date
337
338After you have installed the build environment, you may want to keep it
339up-to-date (E.g. always use the latest GCC).
340In that case, you just need to execute the command:
341 $ pacman -Syu
342
343
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02003442.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200345
346Select one of the following icon from the Start Menu:
347
348* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
349* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
350
351Go to the source directory of Vim, then execute the make command. E.g.:
352
353 make -f Make_ming.mak
354 make -f Make_ming.mak GUI=no
355 make -f Make_ming.mak GUI=no DEBUG=yes
356
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200357NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200358console for that. You need to set $PATH to be able to build there, e.g.:
359
360 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
361
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200362This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200363
364 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
365
366If you have msys64 in another location you will need to adjust the paths for
367that.
368
369
3703. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000371========
372
373(written by Ron Aaron: <ronaharon@yahoo.com>)
374
375This is about how to produce a Win32 binary of gvim with MinGW.
376
377First, you need to get the 'mingw32' compiler, which is free for the download
378at:
379
380 http://www.mingw.org/
381
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100382or you can use 'MinGW-w64' compiler.
383
384 http://mingw-w64.sourceforge.net/
385
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100386Or a compiler provided on msys2:
387
388 https://msys2.github.io/
389
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000390Once you have downloaded the compiler binaries, unpack them on your hard disk
391somewhere, and put them on your PATH. If you are on Win95/98 you can edit
392your AUTOEXEC.BAT file with a line like:
393
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100394 set PATH=C:\MinGW\bin;%PATH%
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000395
396or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100397System, Advanced, and edit the environment from there. If you use msys2
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100398compilers, set your installed paths (normally one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100399
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100400 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
401 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
402 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000403
404Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
405
406 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100407 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000408
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100409 C:\> mingw32-make --version
410 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000411
412Now you are ready to rock 'n' roll. Unpack the vim sources (look on
413www.vim.org for exactly which version of the vim files you need).
414
415Change directory to 'vim\src':
416
417 C:\> cd vim\src
418 C:\VIM\SRC>
419
420and you type:
421
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100422 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000423
424After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
425directory.
426
427You should not need to do *any* editing of any files to get vim compiled this
428way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100429is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100430
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100431 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000432
433If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
434(also free!) and compress the file (typical compression is 50%). UPX can be
435found at
436 http://www.upx.org/
437
Bram Moolenaar91856272012-02-29 16:56:39 +0100438As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
439built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
440at:
441 http://www.matcode.com/mpress.htm
442
443
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000444ADDITION: NLS support with MinGW
445
446(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
447
448If you want National Language Support, read the file src/po/README_mingw.txt.
449You need to uncomment lines in Make_ming.mak to have NLS defined.
450
451
Bram Moolenaar304925e2018-06-30 16:27:02 +02004524. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000453=========
454
455Use Make_cyg.mak with Cygwin's GCC. See
456 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
457
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100458With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000459Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100460running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000461with the other makefiles).
462
463
Bram Moolenaar304925e2018-06-30 16:27:02 +02004645. Borland
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000465===========
466
467Use Make_bc5.mak with Borland C++ 5.x. See
468 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
469
470
Bram Moolenaar304925e2018-06-30 16:27:02 +02004716. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000472=================================================
473
474[Update of 1) needs to be verified]
475
476If you like, you can compile the 'mingw' Win32 version from the comfort of
477your Linux (or other unix) box. To do this, you need to follow a few steps:
478 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100479 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000480 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000481 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100482 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
483 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
484 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100485 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000486 4) make -f Make_ming.mak gvim.exe
487
488Now you have created the Windows binary from your Linux box! Have fun...
489
490
Bram Moolenaar304925e2018-06-30 16:27:02 +02004917. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000492===============================
493
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200494For building with MSVC 2008 the "Windows Installer" from www.python.org
495works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000496
Bram Moolenaar30a89472016-01-10 14:35:58 +0100497When building, you need to set the following variables at least:
498
499 PYTHON: Where Python is installed. E.g. C:\Python27
500 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
501 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
502
503E.g. When using MSVC (as one line):
504
505 nmake -f Make_mvc.mak
506 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
507
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100508When using MinGW and link with the official Python (as one line):
509
510 mingw32-make -f Make_ming.mak
511 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
512
513When using msys2 and link with Python2 bundled with msys2 (as one line):
514
515 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
516 PYTHON_HOME=c:/msys64/mingw64
517 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
518 DYNAMIC_PYTHON=yes
519 PYTHON_VER=27
520 DYNAMIC_PYTHON_DLL=libpython2.7.dll
521 STATIC_STDCPLUS=yes
522
523(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
524(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
525libstdc++-6.dll.)
526
527
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200528(rest written by Ron Aaron: <ronaharon@yahoo.com>)
529
530Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000531 http://www.ActiveState.com/Products/ActivePython/
532
533After installing the ActivePython, you will have to create a 'mingw32'
534'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100535 cd $PYTHON/libs
536 pexports python20.dll > python20.def
537 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000538
539Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
540the root of the Python installation (C:\Python20, for example). If you are
541cross-compiling on Linux with the mingw32 setup, you need to also convert all
542the 'Include' files to *unix* line-endings. This bash command will do it
543easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100544 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000545
546Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100547 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000548
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100549You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000550
551
Bram Moolenaar304925e2018-06-30 16:27:02 +02005528. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100553================================
554
555For building with MSVC 2008 the "Windows Installer" from www.python.org
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100556works fine. Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100557
558When building, you need to set the following variables at least:
559
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100560 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100561 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100562 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100563
564E.g. When using MSVC (as one line):
565
566 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100567 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
568
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100569When using MinGW and link with the official Python3 (as one line):
570
571 mingw32-make -f Make_ming.mak
572 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100573
574When using msys2 and link with Python3 bundled with msys2 (as one line):
575
576 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
577 PYTHON3_HOME=c:/msys64/mingw64
578 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
579 DYNAMIC_PYTHON3=yes
580 PYTHON3_VER=36
581 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
582 STATIC_STDCPLUS=yes
583
584(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100585(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
586libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100587
588
Bram Moolenaar304925e2018-06-30 16:27:02 +02005899. Building with Racket or MzScheme support
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100590========================================
591
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005921) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100593
594MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200595support can be built with either MSVC or MinGW (or Cygwin).
596Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100597
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200598Copy lib/libracket{version}.dll to your Windows system directory. The system
599directory depends on your Windows bitness and Vim bitness:
600 32-bit Vim on 32-bit Windows: C:\Windows\System32
601 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
602 64-bit Vim on 64-bit Windows: C:\Windows\System32
603
604For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100605
606 MZSCHEME: Where Racket is installed.
607 E.g. C:\Program Files (x86)\Racket
608 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200609 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200610 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200611 The DLL can be found under the lib directory. E.g.
612 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100613 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
614 runtime. Default: $(MZSCHEME)\collects
615 User can override this with the PLTCOLLECTS environment
616 variable.
617
Bram Moolenaar73f44392017-10-07 18:38:43 +0200618List of MZSCHEME_VER (incomplete):
619
620 Racket ver. | MZSCHEME_VER
621 ==========================
622 6.3 | 3m_9z0ds0
623 6.6 | 3m_a0solc
624 6.8 | 3m_a1zjsw
625 6.10 | 3m_a36fs8
626
627
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100628E.g. When using MSVC (as one line):
629
630 nmake -f Make_mvc.mak
631 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
632 MZSCHEME_VER=3m_9z0ds0
633
634Or when using MinGW (as one line):
635
636 mingw32-make -f Make_ming.mak
637 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
638 MZSCHEME_VER=3m_9z0ds0
639
640 Spaces should be escaped with '\'.
641
642
Bram Moolenaar18cfa942017-10-08 17:58:44 +02006432) Building with MzScheme support (older)
644
645(written by Sergey Khorev <sergey.khorev@gmail.com>)
646
647Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
648be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
649above (including 299 and 30x series).
650
651The MSVC build is quite straightforward. Simply invoke (in one line)
652nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
653 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
654where <MzScheme-version> is the last seven characters from MzScheme dll name
655(libmzschXXXXXXX.dll).
656If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
657DLL's, but will load them in runtime on demand.
658
659Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
660account that <Path-to-MzScheme> should contain slashes rather than backslashes
661(e.g. d:/Develop/MzScheme)
662
663"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
664explicitly) on MinGW and Cygwin requires additional step.
665
666libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
667%WINDOWS%\System32 to other location (either build directory, some temporary
668dir or even MzScheme home).
669
670Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
671make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
672 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
673
674After a successful build, these dlls can be freely removed, leaving them in
675%WINDOWS%\System32 only.
676
677
678
Bram Moolenaar304925e2018-06-30 16:27:02 +020067910. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100680============================
681
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100682Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
683You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
684This also applies to when you get a Vim executable and don't build yourself,
685do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100686
6871) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100688
Bram Moolenaar30a89472016-01-10 14:35:58 +0100689Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100690 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100691
692Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100693lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100694MinGW.
695
696Unpack it to a working directory. E.g. C:\projects\lua53.
697Lua's header files will be installed under the include directory.
698
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100699Copy luaXY.dll to your Windows system directory. The system directory depends
700on your Windows bitness and Vim bitness:
701 32-bit Vim on 32-bit Windows: C:\Windows\System32
702 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
703 64-bit Vim on 64-bit Windows: C:\Windows\System32
704
705Or another option is copying luaXY.dll to the directory where gvim.exe
706(or vim.exe) is.
707
Bram Moolenaar30a89472016-01-10 14:35:58 +0100708
7092) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100710
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100711You need to set LUA, DYNAMIC_LUA and LUA_VER.
712
713 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
714 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
715 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100716
717E.g. When using MSVC (as one line):
718
719 nmake -f Make_mvc.mak
720 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
721
722Or when using MinGW (as one line):
723
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200724 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100725 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100726
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100727
728Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100729
730 make -f Make_cyg.mak
731 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
732
733
Bram Moolenaar304925e2018-06-30 16:27:02 +020073411. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100735==============================
736
737Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
738You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
739
740 http://www.activestate.com/activeperl
741 http://strawberryperl.com/
742
743When building, you need to set the following variables:
744
745 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
746 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
747 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
748
749E.g. When using MSVC (as one line):
750
751 nmake -f Make_mvc.mak
752 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
753
754Or when using MinGW (as one line):
755
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200756 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100757 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100758
759
Bram Moolenaar304925e2018-06-30 16:27:02 +020076012. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100761==============================
762
763Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
764Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200765Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100766
767 http://rubyinstaller.org/
768
769If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
770you need some tricks described below.
771(Another binary distribution is ActiveScriptRuby:
772 http://www.artonx.org/data/asr/)
773
774When building, you need to set the following variables at least:
775
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200776 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200777 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200778 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200779 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200780 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100781
782Ruby version vs. Ruby API version:
783
784 Ruby ver. | Ruby API ver.
785 =========================
786 1.8.X | 1.8
787 1.9.[1-3] | 1.9.1
788 2.0.0 | 2.0.0
789 2.X.Y | 2.X.0
790
791(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
792
793
794A) Using MSVC
795
796If you want to link with ruby, normally you must use the same compiler as
797which was used to build the ruby binary. RubyInstaller is built with MinGW,
798so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200799RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100800config.h and Ruby's DLL name. Here are the steps for working around them:
801
802 1) Download and Install RubyInstaller.
803 You can install RubyInstaller with the default options and directory.
804 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200805 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100806
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200807 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100808
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200809 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100810
811 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200812 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100813 cd ruby
814 win32\configure.bat
815 nmake .config.h.time
816
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200817 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100818 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100819 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200820 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100821 If you use 64-bit MSVC 2015, the config.h is generated in the
822 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100823
824 3) Install the generated config.h.
825
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100826 For 32-bit version:
827
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100828 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100829
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100830 For 64-bit version:
831
832 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
833
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200834 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
835 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100836
837 4) Build Vim. Note that you need to adjust some variables (as one line):
838
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100839 For 32-bit version:
840
Bram Moolenaar30a89472016-01-10 14:35:58 +0100841 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200842 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100843 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200844 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100845
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100846 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
847
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200848 If you set WINVER explicitly, it must be set to >=0x500, when building
849 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100850 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
851 which is used for the Ruby's DLL name.
852
853B) Using MinGW
854
855Using MinGW is easier than using MSVC when linking with RubyInstaller.
856After you install RubyInstaller, just type this (as one line):
857
858 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100859 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100860 WINVER=0x600
Bram Moolenaar30a89472016-01-10 14:35:58 +0100861
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100862For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200863If you set WINVER explicitly, it must be set to >=0x500, when building with
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100864Ruby 2.1 or later. (Default is 0x600.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200865
Bram Moolenaar30a89472016-01-10 14:35:58 +0100866
867
Bram Moolenaar304925e2018-06-30 16:27:02 +020086813. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100869=============================
870
871Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
872You can use binaries from ActiveState (ActiveTcl).
873
874 http://www.activestate.com/activetcl
875
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100876Alternatively, you can use the binaries provided by IronTcl from
877
878 https://www.irontcl.com/
879
880They might lack behind the latest version a bit, but should provide 64bit
881and 32bit versions even if ActiveTcl does not provide them anymore.
882
883For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100884When building, you need to set the following variables:
885
886 TCL: Where tcl is installed. E.g. C:\Tcl86
887 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
888 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
889 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
890
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200891Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
892but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
893the TCL_DLL variable:
894 TCL_DLL=tcl86t.dll
895
Bram Moolenaar30a89472016-01-10 14:35:58 +0100896E.g. When using MSVC (as one line):
897
898 nmake -f Make_mvc.mak
899 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
900
901Or when using MinGW (as one line):
902
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200903 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100904 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100905
906
Bram Moolenaar304925e2018-06-30 16:27:02 +020090714. Building with Terminal support
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200908==================================
909
Bram Moolenaar8a773062017-07-24 22:29:21 +0200910Vim with Terminal support can be built with either MSVC, MinGW or Cygwin.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200911This uses the included libvterm and winpty. No extra header files or
Bram Moolenaar8a773062017-07-24 22:29:21 +0200912libraries are needed for building. Just set TERMINAL to yes.
Bram Moolenaar2aeaf3f2017-07-23 17:11:15 +0200913
Bram Moolenaar8a773062017-07-24 22:29:21 +0200914E.g. When using MSVC:
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200915
Bram Moolenaar8a773062017-07-24 22:29:21 +0200916 nmake -f Make_mvc.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200917
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100918Or when using MinGW:
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200919
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200920 mingw32-make -f Make_ming.mak TERMINAL=yes
Bram Moolenaar8f84c3a2017-07-22 16:14:44 +0200921
922
Bram Moolenaar304925e2018-06-30 16:27:02 +020092315. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100924===============================================
925
926Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
927This requires dwrite_2.h and some other header files which come with Windows
928SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
929This also requires MBYTE=yes which is enabled by default.
930
931A) Using MSVC
932
933If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
934You just need to specify DIRECTX=yes:
935
936 nmake -f Make_mvc.mak DIRECTX=yes
937
938If you use MSVC 2012 or earlier, the required header files are not available
939by default. However, you can use the header files from newer SDKs with older
940compilers. E.g.:
941
942 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
943 nmake -f Make_mvc.mak DIRECTX=yes
944
945If you don't need color emoji support, only dwrite.h is required. You can use
946older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
947
948 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
949
950B) Using MinGW-w64
951
952Just set DIRECTX to yes:
953
954 mingw32-make -f Make_ming.mak DIRECTX=yes
955
956
Bram Moolenaar304925e2018-06-30 16:27:02 +020095716. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100958================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000959
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100960The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000961
962
Bram Moolenaar304925e2018-06-30 16:27:02 +020096317. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100964==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000965
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100966The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
967work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200968
969
Bram Moolenaar304925e2018-06-30 16:27:02 +020097018. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200971==========================================
972
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100973[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200974
975After you've built the Vim binaries as described above, you're ready to
976install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100977using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100978first create a "vim81" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200979zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100980correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200981
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100982 A. Create a Vim "runtime" subdirectory named "vim81"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200983 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100984 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200985 Otherwise, continue reading.
986
987 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100988 directories and create a new subdirectory named "vim81".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100989
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100990 Copy the "runtime" files into "vim81":
991 copy runtime\* vim81
Bram Moolenaar734d9982011-07-15 13:52:04 +0200992
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100993 B. Copy the new binaries into the "vim81" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200994 ----------------------------------------------------
995 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100996 new binaries you created above into "vim81":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200997
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100998 copy src\*.exe vim81
999 copy src\tee\tee.exe vim81
1000 copy src\xxd\xxd.exe vim81
Bram Moolenaar734d9982011-07-15 13:52:04 +02001001
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001002 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001003 versions of gvimext.dll. They should be copied to "vim81\GvimExt32" and
1004 "vim81\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001005 First, build the 32-bit version, then:
1006
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001007 mkdir vim81\GvimExt32
1008 copy src\GvimExt\gvimext.dll vim81\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001009
1010 Next, clean the 32-bit version and build the 64-bit version, then:
1011
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001012 mkdir vim81\GvimExt64
1013 copy src\GvimExt\gvimext.dll vim81\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001014
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001015 C. Copy gettext and iconv DLLs into the "vim81" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001016 ----------------------------------------------------------
1017 Get gettext and iconv DLLs from the following site:
1018 https://github.com/mlocati/gettext-iconv-windows/releases
1019 Both 64- and 32-bit versions are needed.
1020 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
1021 DLLs and place them as follows:
1022
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001023 vim81\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001024 | libintl-8.dll
1025 | libiconv-2.dll
1026 | libgcc_s_sjlj-1.dll (only for 32-bit)
1027 |
1028 + GvimExt32\
1029 | libintl-8.dll
1030 | libiconv-2.dll
1031 | libgcc_s_sjlj-1.dll
1032 |
1033 ` GvimExt64\
1034 libintl-8.dll
1035 libiconv-2.dll
1036
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001037 The DLLs in the "vim81" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001038
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001039 D. Move the "vim81" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +02001040 ---------------------------------------------------------------------
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001041 Move the "vim81" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001042 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001043 If you already have a "vim81" subdirectory in "vim", delete it first
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001044 by running its uninstal.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001045
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001046 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +02001047 ---------------
Bram Moolenaarba7e1862019-01-09 23:02:43 +01001048 "cd" to your Vim installation subdirectory "vim\vim81" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +02001049 "install.exe" program. It will ask you a number of questions about
1050 how you would like to have your Vim setup. Among these are:
1051 - You can tell it to write a "_vimrc" file with your preferences in the
1052 parent directory.
1053 - It can also install an "Edit with Vim" entry in the Windows Explorer
1054 popup menu.
1055 - You can have it create batch files, so that you can run Vim from the
1056 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001057 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001058 - Create entries for Vim on the desktop and in the Start menu.
1059
1060Happy Vimming!