blob: b5c1a0b58c9c1c78ee88cc4fc772ee4a1e7653cc [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
Bram Moolenaar8024f932020-01-14 19:29:13 +01003613. Building with DirectX (DirectWrite) support
3714. Windows 3.1
3815. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000039
Bram Moolenaar8024f932020-01-14 19:29:13 +01004016. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020041
42
Bram Moolenaar18cfa942017-10-08 17:58:44 +020043The currently recommended way (that means it has been verified to work) is
44using the "Visual Studio Community 2015" installation. This includes the SDK
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010045needed to target Windows XP. But not older Windows versions (95, 98), see
Bram Moolenaara0754902019-11-19 23:01:28 +010046"OLDER VERSIONS" below for that.
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
48
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000491. Microsoft Visual C++
50=======================
51
Bram Moolenaar73f44392017-10-07 18:38:43 +020052We do not provide download links, since Microsoft keeps changing them. You
Bram Moolenaar18cfa942017-10-08 17:58:44 +020053can search for "Visual Studio Community 2015", for example. You will need to
Bram Moolenaar73f44392017-10-07 18:38:43 +020054create a Microsoft account (it's free).
55
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010056When installing "Visual Studio Community 2015 with Update 3" make sure to
57select "custom" and check "Windows XP Support for C++" and all checkboxes
58under "Universal Windows App Development Tools"
59
Bram Moolenaar73f44392017-10-07 18:38:43 +020060
Bram Moolenaar362e1a32006-03-06 23:29:24 +000061Visual Studio
62-------------
63
Bram Moolenaara0754902019-11-19 23:01:28 +010064Building with Visual Studio (VS2010, VS2012, VS2013, VS2015, VS2017 and VS2019)
65is straightforward.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020066
Bram Moolenaar362e1a32006-03-06 23:29:24 +000067To build Vim from the command line with MSVC, use Make_mvc.mak.
68Visual Studio installed a batch file called vcvars32.bat, which you must
69run to set up paths for nmake and MSVC.
70
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000071nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
72nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
73nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000074nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000075 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000076
77Make_mvc.mak allows a Vim to be built with various different features and
Bram Moolenaarfda97842019-05-07 22:25:27 +020078debug support.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000079
Bram Moolenaara0754902019-11-19 23:01:28 +010080For compiling gVim with IME support on far-east Windows, add IME=yes
Bram Moolenaar362e1a32006-03-06 23:29:24 +000081to the parameters you pass to Make_mvc.mak.
82
Bram Moolenaar362e1a32006-03-06 23:29:24 +000083See the specific files for comments and options.
84
85These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
86Ron Aaron; they have been tested.
87
88
Bram Moolenaar02cfac82016-04-21 14:34:58 +020089Visual C++ 2010 Express Edition *msvc-2010-express*
90-------------------------------
91
92Visual C++ 2010 Express Edition can be downloaded for free from:
93 http://www.microsoft.com/express/vc/Default.aspx
94This includes the IDE and the debugger.
95
96To set the environment execute the msvc2010.bat script. You can then build
97Vim with Make_mvc.mak.
98
99
Bram Moolenaar73f44392017-10-07 18:38:43 +0200100Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
101---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200102
103Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
104so that it targets Windows 6.0 (Vista) by default. In order to override
105this, the target Windows version number needs to be passed to LINK like
106follows:
107 LINK ... /subsystem:console,5.01
108
109Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200110Use lines like follows to target Windows XP x86 (assuming using Visual C++
1112012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200112 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200113 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
114 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200115 set CL=/D_USING_V110_SDK71_
116 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
117
Bram Moolenaar73f44392017-10-07 18:38:43 +0200118To target Windows XP x64 instead of x86, you need to change the settings of
119LIB and SUBSYSTEM_VER:
120 ...
121 set LIB=%WinSdk71%\Lib\x64;%LIB%
122 ...
123 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
124
125If you use Visual C++ 2015 (either Express or Community Edition), executing
126msvc2015.bat will set them automatically. For x86 builds run this without
127options:
128 msvc2015
129For x64 builds run this with the "x86_amd64" option:
130 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200131This enables x86_x64 cross compiler. This works on any editions including
132Express edition.
133If you use Community (or Professional) edition, you can enable the x64 native
134compiler by using the "x64" option:
135 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200136
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200137The following Visual C++ team blog can serve as a reference page:
138 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
139
Bram Moolenaara0754902019-11-19 23:01:28 +0100140VC 2019 dropped support for targeting Windows XP. If you want a binary that
141targeting Windows XP, use VC 2017 or earlier.
142
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200143
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200144Cross compile support for Windows on ARM64
145------------------------------------------
146
147This depends on VS2017 with the optional ARM64 compiler and SDK
148installed. Use "vcvarsall.bat x64_arm64" as the build environment.
149
150The ARM64 support was provided by Leendert van Doorn.
151
152
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200153OLDER VERSIONS
154
155The minimal supported version is Windows XP. Building with older compilers
156might still work, but these instructions might be outdated.
157
158If you need the executable to run on Windows 98 or ME, use the 2003 one
Bram Moolenaara0754902019-11-19 23:01:28 +0100159|msvc-2003-toolkit| or |msvc-2005-express|, and use the source code before
1608.0.0029.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200161
Bram Moolenaarc236c162008-07-13 17:41:49 +0000162Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000163-----------------------
164
Bram Moolenaara0754902019-11-19 23:01:28 +0100165NOTE: this most likely does not work
166
Bram Moolenaarc236c162008-07-13 17:41:49 +0000167You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000168 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200169Unfortunately this URL is no longer valid. Unofficial downloads appear to be
Bram Moolenaarc236c162008-07-13 17:41:49 +0000170available from links mentioned on these pages (use at your own risk):
171 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
172 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
173
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000174This contains the command-line tools (compiler, linker, CRT headers,
175and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
176To compile and debug Vim with the VC2003 Toolkit, you will also need
177|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
178and |windbg-download|.
179
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000180It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
181which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000182
183The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
184 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
185(This site also takes you through configuring a number of other
186free C compilers for Win32.)
187
188To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
189execute the following commands in a cmd.exe window (the msvcsetup.bat batch
190file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000191
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000192 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
193 call "%VCToolkitInstallDir%vcvars32.bat"
194 set MSVCVer=7.1
195 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
196 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
197
198Now you can build Vim with Make_mvc.mak.
199
200
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000201Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000202
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200203You will also need a copy of the Windows Platform SDK. Specifically, you need
204the Windows Core SDK subset of the Platform SDK, which contains the Windows
205headers and libraries. You need to search for it, Microsoft keeps changing
206the URL.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000207
208
209Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
210
211You need the .NET Framework 1.1 Redistributable Package from
212 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
213or from Windows Update:
214 http://windowsupdate.microsoft.com/
215This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
216which is needed to link Vim.
217
218
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000219Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000220
221You need the .NET Framework 1.1 SDK from
222 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
223This contains some additional libraries needed to compile Vim,
224such as msvcrt.lib. You must install |dotnet-1.1-redist| before
225installing the .NET 1.1 SDK.
226
227
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000228Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000229
230The Debugging Tools for Windows can be downloaded from
231 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
232This includes the WinDbg debugger, which you will want if you ever need
233to debug Vim itself. An earlier version of the Debugging Tools
234is also available through the Platform SDK, |ms-platform-sdk|.
235
236
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000237Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000238-------------------------------
239
Bram Moolenaara0754902019-11-19 23:01:28 +0100240NOTE: this most likely does not work
241
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000242Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000243 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
244This includes the IDE and the debugger. You will also need
245|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
246
247Instructions for integrating the Platform SDK into VC Express:
248 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
249
250
Bram Moolenaara0754902019-11-19 23:01:28 +0100251Visual C++ 2008 Express Edition *msvc-2008-express*
252-------------------------------
253
254NOTE: this most likely does not work
255
256Visual C++ 2008 Express Edition can be downloaded for free from:
257 http://www.microsoft.com/express/downloads/
258This includes the IDE and the debugger.
259
260To set the environment execute the msvc2008.bat script. You can then build
261Vim with Make_mvc.mak.
262
263For building 64 bit binaries you also need to install the SDK:
264"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
265You don't need the examples and documentation.
266
Bram Moolenaara0754902019-11-19 23:01:28 +0100267
Bram Moolenaar304925e2018-06-30 16:27:02 +02002682. MSYS2 with MinGW
269===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200270
Bram Moolenaar304925e2018-06-30 16:27:02 +02002712.1. Setup the basic msys2 environment
272
273Go to the official page of MSYS2: https://www.msys2.org
274Download an installer:
275
276* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
277 (Even if you want to build 32-bit Vim)
278* msys2-i686-YYYYMMDD.exe for 32-bit Windows
279
280Execute the installer and follow the instructions to update basic packages.
281At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200282open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200283
284Execute:
285 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200286
Bram Moolenaar2346a632021-06-13 19:02:49 +0200287And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start
288Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit").
Bram Moolenaar304925e2018-06-30 16:27:02 +0200289Then execute:
290 $ pacman -Su
291
292If pacman complains that `catgets` and `libcatgets` conflict with another
293package, select `y` to remove them.
294
295
2962.2. Install additional packages for building Vim
297
298The following package groups are required for building Vim:
299
300* base-devel
301* mingw-w64-i686-toolchain (for building 32-bit Vim)
302* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
303
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200304(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200305Use the following command to install them:
306
307 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
308
309Or you can use the `pacboy` command to avoid long package names:
310
311 $ pacboy -S base-devel: toolchain:m
312
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200313The suffix ":" means that it disables the package name translation.
314The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
315to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200316(See `pacboy help` for the help.)
317
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200318See also the pacman page in ArchWiki for the general usage of pacman:
319 https://wiki.archlinux.org/index.php/pacman
320
321MSYS2 has its own git package, and you can also install it via pacman:
322
323 $ pacman -S git
324
Bram Moolenaar304925e2018-06-30 16:27:02 +0200325
3262.3. Keep the build environment up-to-date
327
328After you have installed the build environment, you may want to keep it
329up-to-date (E.g. always use the latest GCC).
330In that case, you just need to execute the command:
331 $ pacman -Syu
332
333
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02003342.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200335
336Select one of the following icon from the Start Menu:
337
338* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
339* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
340
341Go to the source directory of Vim, then execute the make command. E.g.:
342
343 make -f Make_ming.mak
344 make -f Make_ming.mak GUI=no
345 make -f Make_ming.mak GUI=no DEBUG=yes
346
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200347NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200348console for that. You need to set $PATH to be able to build there, e.g.:
349
350 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
351
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200352This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200353
354 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
355
356If you have msys64 in another location you will need to adjust the paths for
357that.
358
359
3603. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000361========
362
Bram Moolenaara0754902019-11-19 23:01:28 +0100363(written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000364
Bram Moolenaara0754902019-11-19 23:01:28 +0100365This is about how to produce a Win32 binary of gvim with MinGW from the normal
366Command Prompt window. (To use MSYS2 console, see above.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000367
Bram Moolenaara0754902019-11-19 23:01:28 +0100368First, you need to get the 'MinGW-w64' compiler, which is free for the
369download at:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100370
371 http://mingw-w64.sourceforge.net/
372
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100373Or a compiler provided on msys2:
374
Bram Moolenaara0754902019-11-19 23:01:28 +0100375 https://www.msys2.org/
376
377The original 'mingw32' compiler is outdated, and may no longer work:
378
379 http://www.mingw.org/
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100380
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000381Once you have downloaded the compiler binaries, unpack them on your hard disk
Bram Moolenaara0754902019-11-19 23:01:28 +0100382somewhere, and put them on your PATH. Go to the Control Panel, (Performance
383and Maintenance), System, Advanced, and edit the environment from there. If
Bram Moolenaar23515b42020-11-29 14:36:24 +0100384you use the standalone MinGW-w64 compiler, the path may depend on your
Bram Moolenaara0754902019-11-19 23:01:28 +0100385installation. If you use msys2 compilers, set your installed paths (normally
386one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100387
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100388 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
389 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
390 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000391
Bram Moolenaara0754902019-11-19 23:01:28 +0100392Test if gcc is on your path. From a Command Prompt window:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000393
394 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100395 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000396
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100397 C:\> mingw32-make --version
398 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000399
400Now you are ready to rock 'n' roll. Unpack the vim sources (look on
401www.vim.org for exactly which version of the vim files you need).
402
403Change directory to 'vim\src':
404
405 C:\> cd vim\src
406 C:\VIM\SRC>
407
408and you type:
409
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100410 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000411
412After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
413directory.
414
415You should not need to do *any* editing of any files to get vim compiled this
416way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100417is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100418
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100419 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000420
421If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
422(also free!) and compress the file (typical compression is 50%). UPX can be
423found at
424 http://www.upx.org/
425
Bram Moolenaar91856272012-02-29 16:56:39 +0100426As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
427built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
428at:
429 http://www.matcode.com/mpress.htm
430
431
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000432ADDITION: NLS support with MinGW
433
434(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
435
436If you want National Language Support, read the file src/po/README_mingw.txt.
437You need to uncomment lines in Make_ming.mak to have NLS defined.
438
439
Bram Moolenaar304925e2018-06-30 16:27:02 +02004404. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000441=========
442
443Use Make_cyg.mak with Cygwin's GCC. See
444 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
445
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100446With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000447Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100448running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000449with the other makefiles).
450
451
Bram Moolenaareae1b912019-05-09 15:12:55 +02004525. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000453=================================================
454
455[Update of 1) needs to be verified]
456
457If you like, you can compile the 'mingw' Win32 version from the comfort of
458your Linux (or other unix) box. To do this, you need to follow a few steps:
459 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100460 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000461 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000462 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100463 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
464 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
465 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100466 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000467 4) make -f Make_ming.mak gvim.exe
468
469Now you have created the Windows binary from your Linux box! Have fun...
470
471
Bram Moolenaareae1b912019-05-09 15:12:55 +02004726. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000473===============================
474
Bram Moolenaara0754902019-11-19 23:01:28 +0100475For building with MSVC the "Windows Installer" from www.python.org works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000476
Bram Moolenaar30a89472016-01-10 14:35:58 +0100477When building, you need to set the following variables at least:
478
479 PYTHON: Where Python is installed. E.g. C:\Python27
480 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
481 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
482
483E.g. When using MSVC (as one line):
484
485 nmake -f Make_mvc.mak
486 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
487
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100488When using MinGW and link with the official Python (as one line):
489
490 mingw32-make -f Make_ming.mak
491 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
492
493When using msys2 and link with Python2 bundled with msys2 (as one line):
494
495 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
496 PYTHON_HOME=c:/msys64/mingw64
497 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
498 DYNAMIC_PYTHON=yes
499 PYTHON_VER=27
500 DYNAMIC_PYTHON_DLL=libpython2.7.dll
501 STATIC_STDCPLUS=yes
502
503(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
504(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
505libstdc++-6.dll.)
506
507
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200508(rest written by Ron Aaron: <ronaharon@yahoo.com>)
509
510Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000511 http://www.ActiveState.com/Products/ActivePython/
512
513After installing the ActivePython, you will have to create a 'mingw32'
514'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100515 cd $PYTHON/libs
516 pexports python20.dll > python20.def
517 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000518
519Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
520the root of the Python installation (C:\Python20, for example). If you are
521cross-compiling on Linux with the mingw32 setup, you need to also convert all
522the 'Include' files to *unix* line-endings. This bash command will do it
523easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100524 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000525
526Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100527 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000528
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100529You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000530
531
Bram Moolenaareae1b912019-05-09 15:12:55 +02005327. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100533================================
534
Bram Moolenaara0754902019-11-19 23:01:28 +0100535For building with MSVC the "Windows Installer" from www.python.org works fine.
536Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100537
538When building, you need to set the following variables at least:
539
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100540 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100541 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100542 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100543
544E.g. When using MSVC (as one line):
545
546 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100547 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
548
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100549When using MinGW and link with the official Python3 (as one line):
550
551 mingw32-make -f Make_ming.mak
552 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100553
554When using msys2 and link with Python3 bundled with msys2 (as one line):
555
556 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
557 PYTHON3_HOME=c:/msys64/mingw64
558 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
559 DYNAMIC_PYTHON3=yes
560 PYTHON3_VER=36
561 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
562 STATIC_STDCPLUS=yes
563
564(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100565(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
566libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100567
568
Bram Moolenaareae1b912019-05-09 15:12:55 +02005698. Building with Racket or MzScheme support
Bram Moolenaara0754902019-11-19 23:01:28 +0100570===========================================
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100571
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005721) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100573
574MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200575support can be built with either MSVC or MinGW (or Cygwin).
576Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100577
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200578Copy lib/libracket{version}.dll to your Windows system directory. The system
579directory depends on your Windows bitness and Vim bitness:
580 32-bit Vim on 32-bit Windows: C:\Windows\System32
581 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
582 64-bit Vim on 64-bit Windows: C:\Windows\System32
583
584For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100585
586 MZSCHEME: Where Racket is installed.
587 E.g. C:\Program Files (x86)\Racket
588 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200589 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200590 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200591 The DLL can be found under the lib directory. E.g.
592 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100593 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
594 runtime. Default: $(MZSCHEME)\collects
595 User can override this with the PLTCOLLECTS environment
596 variable.
597
Bram Moolenaar73f44392017-10-07 18:38:43 +0200598List of MZSCHEME_VER (incomplete):
599
600 Racket ver. | MZSCHEME_VER
601 ==========================
602 6.3 | 3m_9z0ds0
603 6.6 | 3m_a0solc
604 6.8 | 3m_a1zjsw
605 6.10 | 3m_a36fs8
606
607
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100608E.g. When using MSVC (as one line):
609
610 nmake -f Make_mvc.mak
611 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
612 MZSCHEME_VER=3m_9z0ds0
613
614Or when using MinGW (as one line):
615
616 mingw32-make -f Make_ming.mak
617 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
618 MZSCHEME_VER=3m_9z0ds0
619
620 Spaces should be escaped with '\'.
621
622
Bram Moolenaar18cfa942017-10-08 17:58:44 +02006232) Building with MzScheme support (older)
624
625(written by Sergey Khorev <sergey.khorev@gmail.com>)
626
627Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
628be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
629above (including 299 and 30x series).
630
631The MSVC build is quite straightforward. Simply invoke (in one line)
632nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
633 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
634where <MzScheme-version> is the last seven characters from MzScheme dll name
635(libmzschXXXXXXX.dll).
636If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
637DLL's, but will load them in runtime on demand.
638
639Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
640account that <Path-to-MzScheme> should contain slashes rather than backslashes
641(e.g. d:/Develop/MzScheme)
642
643"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
644explicitly) on MinGW and Cygwin requires additional step.
645
646libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
647%WINDOWS%\System32 to other location (either build directory, some temporary
648dir or even MzScheme home).
649
650Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
651make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
652 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
653
654After a successful build, these dlls can be freely removed, leaving them in
655%WINDOWS%\System32 only.
656
657
658
Bram Moolenaareae1b912019-05-09 15:12:55 +02006599. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100660============================
661
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100662Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
663You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
664This also applies to when you get a Vim executable and don't build yourself,
665do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100666
6671) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100668
Bram Moolenaar30a89472016-01-10 14:35:58 +0100669Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100670 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100671
672Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100673lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100674MinGW.
675
676Unpack it to a working directory. E.g. C:\projects\lua53.
677Lua's header files will be installed under the include directory.
678
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100679Copy luaXY.dll to your Windows system directory. The system directory depends
680on your Windows bitness and Vim bitness:
681 32-bit Vim on 32-bit Windows: C:\Windows\System32
682 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
683 64-bit Vim on 64-bit Windows: C:\Windows\System32
684
685Or another option is copying luaXY.dll to the directory where gvim.exe
686(or vim.exe) is.
687
Bram Moolenaar30a89472016-01-10 14:35:58 +0100688
6892) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100690
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100691You need to set LUA, DYNAMIC_LUA and LUA_VER.
692
693 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
694 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
695 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100696
697E.g. When using MSVC (as one line):
698
699 nmake -f Make_mvc.mak
700 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
701
702Or when using MinGW (as one line):
703
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200704 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100705 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100706
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100707
708Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100709
710 make -f Make_cyg.mak
711 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
712
713
Bram Moolenaareae1b912019-05-09 15:12:55 +020071410. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100715==============================
716
717Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
718You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
719
720 http://www.activestate.com/activeperl
721 http://strawberryperl.com/
722
723When building, you need to set the following variables:
724
725 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
726 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
727 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
728
729E.g. When using MSVC (as one line):
730
731 nmake -f Make_mvc.mak
732 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
733
734Or when using MinGW (as one line):
735
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200736 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100737 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100738
739
Bram Moolenaareae1b912019-05-09 15:12:55 +020074011. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100741==============================
742
743Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
744Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200745Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100746
747 http://rubyinstaller.org/
748
749If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
750you need some tricks described below.
751(Another binary distribution is ActiveScriptRuby:
752 http://www.artonx.org/data/asr/)
753
754When building, you need to set the following variables at least:
755
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200756 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200757 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200758 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200759 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200760 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100761
762Ruby version vs. Ruby API version:
763
764 Ruby ver. | Ruby API ver.
765 =========================
766 1.8.X | 1.8
767 1.9.[1-3] | 1.9.1
768 2.0.0 | 2.0.0
769 2.X.Y | 2.X.0
770
771(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
772
773
774A) Using MSVC
775
776If you want to link with ruby, normally you must use the same compiler as
777which was used to build the ruby binary. RubyInstaller is built with MinGW,
778so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200779RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100780config.h and Ruby's DLL name. Here are the steps for working around them:
781
782 1) Download and Install RubyInstaller.
783 You can install RubyInstaller with the default options and directory.
784 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200785 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100786
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200787 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100788
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200789 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100790
791 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200792 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100793 cd ruby
794 win32\configure.bat
795 nmake .config.h.time
796
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200797 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100798 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100799 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200800 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100801 If you use 64-bit MSVC 2015, the config.h is generated in the
802 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100803
804 3) Install the generated config.h.
805
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100806 For 32-bit version:
807
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100808 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100809
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100810 For 64-bit version:
811
812 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
813
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200814 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
815 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100816
817 4) Build Vim. Note that you need to adjust some variables (as one line):
818
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100819 For 32-bit version:
820
Bram Moolenaar30a89472016-01-10 14:35:58 +0100821 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200822 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100823 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200824 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100825
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100826 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
827
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200828 If you set WINVER explicitly, it must be set to >=0x500, when building
829 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100830 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
831 which is used for the Ruby's DLL name.
832
833B) Using MinGW
834
835Using MinGW is easier than using MSVC when linking with RubyInstaller.
836After you install RubyInstaller, just type this (as one line):
837
838 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100839 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100840 WINVER=0x600
Bram Moolenaar30a89472016-01-10 14:35:58 +0100841
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100842For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200843If you set WINVER explicitly, it must be set to >=0x500, when building with
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100844Ruby 2.1 or later. (Default is 0x600.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200845
Bram Moolenaar30a89472016-01-10 14:35:58 +0100846
847
Bram Moolenaareae1b912019-05-09 15:12:55 +020084812. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100849=============================
850
851Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
852You can use binaries from ActiveState (ActiveTcl).
853
854 http://www.activestate.com/activetcl
855
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100856Alternatively, you can use the binaries provided by IronTcl from
857
858 https://www.irontcl.com/
859
860They might lack behind the latest version a bit, but should provide 64bit
861and 32bit versions even if ActiveTcl does not provide them anymore.
862
863For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100864When building, you need to set the following variables:
865
866 TCL: Where tcl is installed. E.g. C:\Tcl86
867 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
868 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
869 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
870
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200871Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
872but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
873the TCL_DLL variable:
874 TCL_DLL=tcl86t.dll
875
Bram Moolenaar30a89472016-01-10 14:35:58 +0100876E.g. When using MSVC (as one line):
877
878 nmake -f Make_mvc.mak
879 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
880
881Or when using MinGW (as one line):
882
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200883 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100884 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100885
886
Bram Moolenaar8024f932020-01-14 19:29:13 +010088713. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100888===============================================
889
890Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
891This requires dwrite_2.h and some other header files which come with Windows
892SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
893This also requires MBYTE=yes which is enabled by default.
894
895A) Using MSVC
896
897If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
898You just need to specify DIRECTX=yes:
899
900 nmake -f Make_mvc.mak DIRECTX=yes
901
902If you use MSVC 2012 or earlier, the required header files are not available
903by default. However, you can use the header files from newer SDKs with older
904compilers. E.g.:
905
906 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
907 nmake -f Make_mvc.mak DIRECTX=yes
908
909If you don't need color emoji support, only dwrite.h is required. You can use
910older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
911
912 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
913
914B) Using MinGW-w64
915
916Just set DIRECTX to yes:
917
918 mingw32-make -f Make_ming.mak DIRECTX=yes
919
920
Bram Moolenaar8024f932020-01-14 19:29:13 +010092114. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100922================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000923
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100924The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000925
926
Bram Moolenaar8024f932020-01-14 19:29:13 +010092715. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100928==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000929
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100930The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
931work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200932
933
Bram Moolenaar8024f932020-01-14 19:29:13 +010093416. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200935==========================================
936
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100937[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200938
939After you've built the Vim binaries as described above, you're ready to
940install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100941using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaar8024f932020-01-14 19:29:13 +0100942first create a "vim82" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200943zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100944correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200945
Bram Moolenaar8024f932020-01-14 19:29:13 +0100946 A. Create a Vim "runtime" subdirectory named "vim82"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200947 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100948 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200949 Otherwise, continue reading.
950
951 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaar8024f932020-01-14 19:29:13 +0100952 directories and create a new subdirectory named "vim82".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100953
Bram Moolenaar8024f932020-01-14 19:29:13 +0100954 Copy the "runtime" files into "vim82":
955 copy runtime\* vim82
Bram Moolenaarade0d392020-01-21 22:33:58 +0100956 xcopy /s runtime\* vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200957
Bram Moolenaar8024f932020-01-14 19:29:13 +0100958 B. Copy the new binaries into the "vim82" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200959 ----------------------------------------------------
960 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaar8024f932020-01-14 19:29:13 +0100961 new binaries you created above into "vim82":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200962
Bram Moolenaar8024f932020-01-14 19:29:13 +0100963 copy src\*.exe vim82
964 copy src\tee\tee.exe vim82
965 copy src\xxd\xxd.exe vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200966
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100967 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
Bram Moolenaar8024f932020-01-14 19:29:13 +0100968 versions of gvimext.dll. They should be copied to "vim82\GvimExt32" and
969 "vim82\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100970 First, build the 32-bit version, then:
971
Bram Moolenaar8024f932020-01-14 19:29:13 +0100972 mkdir vim82\GvimExt32
973 copy src\GvimExt\gvimext.dll vim82\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100974
975 Next, clean the 32-bit version and build the 64-bit version, then:
976
Bram Moolenaar8024f932020-01-14 19:29:13 +0100977 mkdir vim82\GvimExt64
978 copy src\GvimExt\gvimext.dll vim82\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100979
Bram Moolenaar8024f932020-01-14 19:29:13 +0100980 C. Copy gettext and iconv DLLs into the "vim82" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100981 ----------------------------------------------------------
982 Get gettext and iconv DLLs from the following site:
983 https://github.com/mlocati/gettext-iconv-windows/releases
984 Both 64- and 32-bit versions are needed.
985 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
986 DLLs and place them as follows:
987
Bram Moolenaar8024f932020-01-14 19:29:13 +0100988 vim82\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100989 | libintl-8.dll
990 | libiconv-2.dll
991 | libgcc_s_sjlj-1.dll (only for 32-bit)
992 |
993 + GvimExt32\
994 | libintl-8.dll
995 | libiconv-2.dll
996 | libgcc_s_sjlj-1.dll
997 |
998 ` GvimExt64\
999 libintl-8.dll
1000 libiconv-2.dll
1001
Bram Moolenaar8024f932020-01-14 19:29:13 +01001002 The DLLs in the "vim82" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001003
Bram Moolenaar8024f932020-01-14 19:29:13 +01001004 D. Move the "vim82" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +02001005 ---------------------------------------------------------------------
Bram Moolenaar8024f932020-01-14 19:29:13 +01001006 Move the "vim82" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001007 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaar8024f932020-01-14 19:29:13 +01001008 If you already have a "vim82" subdirectory in "vim", delete it first
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001009 by running its uninstall.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001010
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001011 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +02001012 ---------------
Bram Moolenaar8024f932020-01-14 19:29:13 +01001013 "cd" to your Vim installation subdirectory "vim\vim82" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +02001014 "install.exe" program. It will ask you a number of questions about
1015 how you would like to have your Vim setup. Among these are:
1016 - You can tell it to write a "_vimrc" file with your preferences in the
1017 parent directory.
1018 - It can also install an "Edit with Vim" entry in the Windows Explorer
1019 popup menu.
1020 - You can have it create batch files, so that you can run Vim from the
1021 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001022 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001023 - Create entries for Vim on the desktop and in the Start menu.
1024
1025Happy Vimming!