blob: 4cf7a40bac13ce5654a8a3465ef2a8176ec85faf [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
K.Takatad8f86292022-03-07 15:16:15 +00003714. Building with libsodium support
3815. Windows 3.1
3916. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000040
K.Takatad8f86292022-03-07 15:16:15 +00004117. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020042
43
Bram Moolenaar18cfa942017-10-08 17:58:44 +020044The currently recommended way (that means it has been verified to work) is
45using the "Visual Studio Community 2015" installation. This includes the SDK
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010046needed to target Windows XP. But not older Windows versions (95, 98), see
Bram Moolenaara0754902019-11-19 23:01:28 +010047"OLDER VERSIONS" below for that.
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
49
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000501. Microsoft Visual C++
51=======================
52
Bram Moolenaar73f44392017-10-07 18:38:43 +020053We do not provide download links, since Microsoft keeps changing them. You
Bram Moolenaar18cfa942017-10-08 17:58:44 +020054can search for "Visual Studio Community 2015", for example. You will need to
Bram Moolenaare8008642022-08-19 17:15:35 +010055create a Microsoft account (it's free). You need to download the "DVD", and
56execute the installer from it.
Bram Moolenaar73f44392017-10-07 18:38:43 +020057
Bram Moolenaare8008642022-08-19 17:15:35 +010058When installing "Visual Studio Community 2015 with Update 3" or "Visual C++
59Build Tools for Visual Studio 2015 with Update 3" make sure to
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010060select "custom" and check "Windows XP Support for C++" and all checkboxes
Bram Moolenaarfd999452022-08-24 18:30:14 +010061under "Universal Windows App Development Tools". Or whatever they are called
Bram Moolenaare8008642022-08-19 17:15:35 +010062now.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010063
Bram Moolenaar73f44392017-10-07 18:38:43 +020064
Bram Moolenaar362e1a32006-03-06 23:29:24 +000065Visual Studio
66-------------
67
Bram Moolenaara0754902019-11-19 23:01:28 +010068Building with Visual Studio (VS2010, VS2012, VS2013, VS2015, VS2017 and VS2019)
69is straightforward.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020070
Bram Moolenaar362e1a32006-03-06 23:29:24 +000071To build Vim from the command line with MSVC, use Make_mvc.mak.
72Visual Studio installed a batch file called vcvars32.bat, which you must
73run to set up paths for nmake and MSVC.
74
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000075nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
76nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
77nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000078nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000079 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000080
81Make_mvc.mak allows a Vim to be built with various different features and
Bram Moolenaarfda97842019-05-07 22:25:27 +020082debug support.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000083
Bram Moolenaara0754902019-11-19 23:01:28 +010084For compiling gVim with IME support on far-east Windows, add IME=yes
Bram Moolenaar362e1a32006-03-06 23:29:24 +000085to the parameters you pass to Make_mvc.mak.
86
Bram Moolenaar362e1a32006-03-06 23:29:24 +000087See the specific files for comments and options.
88
89These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
90Ron Aaron; they have been tested.
91
92
Bram Moolenaar02cfac82016-04-21 14:34:58 +020093Visual C++ 2010 Express Edition *msvc-2010-express*
94-------------------------------
95
96Visual C++ 2010 Express Edition can be downloaded for free from:
97 http://www.microsoft.com/express/vc/Default.aspx
98This includes the IDE and the debugger.
99
100To set the environment execute the msvc2010.bat script. You can then build
101Vim with Make_mvc.mak.
102
103
Bram Moolenaar73f44392017-10-07 18:38:43 +0200104Targeting Windows XP with MSVC 2012 and later *new-msvc-windows-xp*
105---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200106
107Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
108so that it targets Windows 6.0 (Vista) by default. In order to override
109this, the target Windows version number needs to be passed to LINK like
110follows:
111 LINK ... /subsystem:console,5.01
112
113Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200114Use lines like follows to target Windows XP x86 (assuming using Visual C++
1152012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200116 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200117 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
118 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200119 set CL=/D_USING_V110_SDK71_
120 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
121
Bram Moolenaar73f44392017-10-07 18:38:43 +0200122To target Windows XP x64 instead of x86, you need to change the settings of
123LIB and SUBSYSTEM_VER:
124 ...
125 set LIB=%WinSdk71%\Lib\x64;%LIB%
126 ...
127 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
128
129If you use Visual C++ 2015 (either Express or Community Edition), executing
130msvc2015.bat will set them automatically. For x86 builds run this without
131options:
132 msvc2015
133For x64 builds run this with the "x86_amd64" option:
134 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200135This enables x86_x64 cross compiler. This works on any editions including
136Express edition.
137If you use Community (or Professional) edition, you can enable the x64 native
138compiler by using the "x64" option:
139 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200140
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200141The following Visual C++ team blog can serve as a reference page:
142 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
143
Bram Moolenaara0754902019-11-19 23:01:28 +0100144VC 2019 dropped support for targeting Windows XP. If you want a binary that
145targeting Windows XP, use VC 2017 or earlier.
146
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200147
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200148Cross compile support for Windows on ARM64
149------------------------------------------
150
151This depends on VS2017 with the optional ARM64 compiler and SDK
152installed. Use "vcvarsall.bat x64_arm64" as the build environment.
153
154The ARM64 support was provided by Leendert van Doorn.
155
156
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200157OLDER VERSIONS
158
159The minimal supported version is Windows XP. Building with older compilers
160might still work, but these instructions might be outdated.
161
K.Takata76687d22022-01-25 10:31:37 +0000162If you need the executable to run on Windows 98 or ME, use the 2005 one
163|msvc-2005-express|, and use the source code before 8.0.0029.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000164
165
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000166Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000167-------------------------------
168
Bram Moolenaara0754902019-11-19 23:01:28 +0100169NOTE: this most likely does not work
170
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000171Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000172 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
173This includes the IDE and the debugger. You will also need
174|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
175
176Instructions for integrating the Platform SDK into VC Express:
177 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
178
179
Bram Moolenaara0754902019-11-19 23:01:28 +0100180Visual C++ 2008 Express Edition *msvc-2008-express*
181-------------------------------
182
183NOTE: this most likely does not work
184
185Visual C++ 2008 Express Edition can be downloaded for free from:
186 http://www.microsoft.com/express/downloads/
187This includes the IDE and the debugger.
188
189To set the environment execute the msvc2008.bat script. You can then build
190Vim with Make_mvc.mak.
191
192For building 64 bit binaries you also need to install the SDK:
193"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
194You don't need the examples and documentation.
195
Bram Moolenaara0754902019-11-19 23:01:28 +0100196
Bram Moolenaar304925e2018-06-30 16:27:02 +02001972. MSYS2 with MinGW
198===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200199
Bram Moolenaar304925e2018-06-30 16:27:02 +02002002.1. Setup the basic msys2 environment
201
202Go to the official page of MSYS2: https://www.msys2.org
203Download an installer:
204
205* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
206 (Even if you want to build 32-bit Vim)
207* msys2-i686-YYYYMMDD.exe for 32-bit Windows
208
209Execute the installer and follow the instructions to update basic packages.
210At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200211open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200212
213Execute:
214 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200215
Bram Moolenaar2346a632021-06-13 19:02:49 +0200216And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start
217Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit").
Bram Moolenaar304925e2018-06-30 16:27:02 +0200218Then execute:
219 $ pacman -Su
220
221If pacman complains that `catgets` and `libcatgets` conflict with another
222package, select `y` to remove them.
223
224
2252.2. Install additional packages for building Vim
226
227The following package groups are required for building Vim:
228
229* base-devel
230* mingw-w64-i686-toolchain (for building 32-bit Vim)
231* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
232
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200233(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200234Use the following command to install them:
235
236 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
237
238Or you can use the `pacboy` command to avoid long package names:
239
240 $ pacboy -S base-devel: toolchain:m
241
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200242The suffix ":" means that it disables the package name translation.
243The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
244to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200245(See `pacboy help` for the help.)
246
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200247See also the pacman page in ArchWiki for the general usage of pacman:
248 https://wiki.archlinux.org/index.php/pacman
249
250MSYS2 has its own git package, and you can also install it via pacman:
251
252 $ pacman -S git
253
Bram Moolenaar304925e2018-06-30 16:27:02 +0200254
2552.3. Keep the build environment up-to-date
256
257After you have installed the build environment, you may want to keep it
258up-to-date (E.g. always use the latest GCC).
259In that case, you just need to execute the command:
260 $ pacman -Syu
261
262
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02002632.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200264
265Select one of the following icon from the Start Menu:
266
267* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
268* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
269
270Go to the source directory of Vim, then execute the make command. E.g.:
271
272 make -f Make_ming.mak
273 make -f Make_ming.mak GUI=no
274 make -f Make_ming.mak GUI=no DEBUG=yes
275
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200276NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200277console for that. You need to set $PATH to be able to build there, e.g.:
278
279 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
280
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200281This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200282
283 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
284
285If you have msys64 in another location you will need to adjust the paths for
286that.
287
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +01002882.5. Build Vim with Clang
289
290The following package group is required for building Vim with Clang:
291
292* mingw-w64-clang-x86_64-clang
293
294Use the following command to install it:
295
296 $ pacman -S mingw-w64-clang-x86_64-clang
297
298Go to the source directory of Vim, then execute the make command. E.g.:
299
300 CC=clang
301 CXX=clang++
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100302 # To build Vim without the GUI support
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100303 make -f Make_ming.mak GUI=no
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100304 # To build Vim with the GUI support
305 make -f Make_ming.mak GUI=yes XPM=no
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100306
307To build Vim with the address sanitizer (ASAN), execute the following command:
308
309 CC=clang
310 CXX=clang++
311 make -f Make_ming.mak DEBUG=yes ASAN=yes
Bram Moolenaar304925e2018-06-30 16:27:02 +0200312
3133. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000314========
315
Bram Moolenaara0754902019-11-19 23:01:28 +0100316(written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000317
Bram Moolenaara0754902019-11-19 23:01:28 +0100318This is about how to produce a Win32 binary of gvim with MinGW from the normal
319Command Prompt window. (To use MSYS2 console, see above.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000320
Bram Moolenaara0754902019-11-19 23:01:28 +0100321First, you need to get the 'MinGW-w64' compiler, which is free for the
322download at:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100323
324 http://mingw-w64.sourceforge.net/
325
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100326Or a compiler provided on msys2:
327
Bram Moolenaara0754902019-11-19 23:01:28 +0100328 https://www.msys2.org/
329
330The original 'mingw32' compiler is outdated, and may no longer work:
331
332 http://www.mingw.org/
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100333
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000334Once you have downloaded the compiler binaries, unpack them on your hard disk
Bram Moolenaara0754902019-11-19 23:01:28 +0100335somewhere, and put them on your PATH. Go to the Control Panel, (Performance
336and Maintenance), System, Advanced, and edit the environment from there. If
Bram Moolenaar23515b42020-11-29 14:36:24 +0100337you use the standalone MinGW-w64 compiler, the path may depend on your
Bram Moolenaara0754902019-11-19 23:01:28 +0100338installation. If you use msys2 compilers, set your installed paths (normally
339one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100340
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100341 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
342 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
343 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000344
Bram Moolenaara0754902019-11-19 23:01:28 +0100345Test if gcc is on your path. From a Command Prompt window:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000346
347 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100348 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000349
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100350 C:\> mingw32-make --version
351 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000352
353Now you are ready to rock 'n' roll. Unpack the vim sources (look on
354www.vim.org for exactly which version of the vim files you need).
355
356Change directory to 'vim\src':
357
358 C:\> cd vim\src
359 C:\VIM\SRC>
360
361and you type:
362
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100363 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000364
365After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
366directory.
367
368You should not need to do *any* editing of any files to get vim compiled this
369way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100370is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100371
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100372 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000373
374If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
375(also free!) and compress the file (typical compression is 50%). UPX can be
376found at
377 http://www.upx.org/
378
Bram Moolenaar91856272012-02-29 16:56:39 +0100379As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
380built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
381at:
382 http://www.matcode.com/mpress.htm
383
384
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000385ADDITION: NLS support with MinGW
386
387(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
388
389If you want National Language Support, read the file src/po/README_mingw.txt.
390You need to uncomment lines in Make_ming.mak to have NLS defined.
391
392
Bram Moolenaar304925e2018-06-30 16:27:02 +02003934. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000394=========
395
396Use Make_cyg.mak with Cygwin's GCC. See
397 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
398
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100399With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000400Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100401running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000402with the other makefiles).
403
404
Bram Moolenaareae1b912019-05-09 15:12:55 +02004055. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000406=================================================
407
408[Update of 1) needs to be verified]
409
410If you like, you can compile the 'mingw' Win32 version from the comfort of
411your Linux (or other unix) box. To do this, you need to follow a few steps:
412 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100413 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000414 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000415 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100416 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
417 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
418 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100419 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000420 4) make -f Make_ming.mak gvim.exe
421
422Now you have created the Windows binary from your Linux box! Have fun...
423
424
Bram Moolenaareae1b912019-05-09 15:12:55 +02004256. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000426===============================
427
Bram Moolenaara0754902019-11-19 23:01:28 +0100428For building with MSVC the "Windows Installer" from www.python.org works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000429
Bram Moolenaar30a89472016-01-10 14:35:58 +0100430When building, you need to set the following variables at least:
431
432 PYTHON: Where Python is installed. E.g. C:\Python27
433 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
434 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
435
436E.g. When using MSVC (as one line):
437
438 nmake -f Make_mvc.mak
439 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
440
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100441When using MinGW and link with the official Python (as one line):
442
443 mingw32-make -f Make_ming.mak
444 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
445
446When using msys2 and link with Python2 bundled with msys2 (as one line):
447
448 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
449 PYTHON_HOME=c:/msys64/mingw64
450 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
451 DYNAMIC_PYTHON=yes
452 PYTHON_VER=27
453 DYNAMIC_PYTHON_DLL=libpython2.7.dll
454 STATIC_STDCPLUS=yes
455
456(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
457(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
458libstdc++-6.dll.)
459
460
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200461(rest written by Ron Aaron: <ronaharon@yahoo.com>)
462
463Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000464 http://www.ActiveState.com/Products/ActivePython/
465
466After installing the ActivePython, you will have to create a 'mingw32'
467'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100468 cd $PYTHON/libs
469 pexports python20.dll > python20.def
470 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000471
472Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
473the root of the Python installation (C:\Python20, for example). If you are
474cross-compiling on Linux with the mingw32 setup, you need to also convert all
475the 'Include' files to *unix* line-endings. This bash command will do it
476easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100477 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000478
479Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100480 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000481
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100482You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000483
484
Bram Moolenaareae1b912019-05-09 15:12:55 +02004857. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100486================================
487
Bram Moolenaara0754902019-11-19 23:01:28 +0100488For building with MSVC the "Windows Installer" from www.python.org works fine.
489Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100490
491When building, you need to set the following variables at least:
492
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100493 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100494 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100495 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100496
497E.g. When using MSVC (as one line):
498
499 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100500 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
501
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100502When using MinGW and link with the official Python3 (as one line):
503
504 mingw32-make -f Make_ming.mak
505 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100506
507When using msys2 and link with Python3 bundled with msys2 (as one line):
508
509 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
510 PYTHON3_HOME=c:/msys64/mingw64
511 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
512 DYNAMIC_PYTHON3=yes
513 PYTHON3_VER=36
514 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
515 STATIC_STDCPLUS=yes
516
517(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100518(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
519libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100520
521
Bram Moolenaareae1b912019-05-09 15:12:55 +02005228. Building with Racket or MzScheme support
Bram Moolenaara0754902019-11-19 23:01:28 +0100523===========================================
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100524
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005251) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100526
527MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200528support can be built with either MSVC or MinGW (or Cygwin).
529Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100530
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200531Copy lib/libracket{version}.dll to your Windows system directory. The system
532directory depends on your Windows bitness and Vim bitness:
533 32-bit Vim on 32-bit Windows: C:\Windows\System32
534 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
535 64-bit Vim on 64-bit Windows: C:\Windows\System32
536
537For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100538
539 MZSCHEME: Where Racket is installed.
540 E.g. C:\Program Files (x86)\Racket
541 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200542 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200543 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200544 The DLL can be found under the lib directory. E.g.
545 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100546 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
547 runtime. Default: $(MZSCHEME)\collects
548 User can override this with the PLTCOLLECTS environment
549 variable.
550
Bram Moolenaar73f44392017-10-07 18:38:43 +0200551List of MZSCHEME_VER (incomplete):
552
553 Racket ver. | MZSCHEME_VER
554 ==========================
555 6.3 | 3m_9z0ds0
556 6.6 | 3m_a0solc
557 6.8 | 3m_a1zjsw
558 6.10 | 3m_a36fs8
559
560
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100561E.g. When using MSVC (as one line):
562
563 nmake -f Make_mvc.mak
564 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
565 MZSCHEME_VER=3m_9z0ds0
566
567Or when using MinGW (as one line):
568
569 mingw32-make -f Make_ming.mak
570 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
571 MZSCHEME_VER=3m_9z0ds0
572
573 Spaces should be escaped with '\'.
574
575
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005762) Building with MzScheme support (older)
577
578(written by Sergey Khorev <sergey.khorev@gmail.com>)
579
580Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
581be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
582above (including 299 and 30x series).
583
584The MSVC build is quite straightforward. Simply invoke (in one line)
585nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
586 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
587where <MzScheme-version> is the last seven characters from MzScheme dll name
588(libmzschXXXXXXX.dll).
589If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
590DLL's, but will load them in runtime on demand.
591
592Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
593account that <Path-to-MzScheme> should contain slashes rather than backslashes
594(e.g. d:/Develop/MzScheme)
595
596"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
597explicitly) on MinGW and Cygwin requires additional step.
598
599libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
600%WINDOWS%\System32 to other location (either build directory, some temporary
601dir or even MzScheme home).
602
603Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
604make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
605 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
606
607After a successful build, these dlls can be freely removed, leaving them in
608%WINDOWS%\System32 only.
609
610
611
Bram Moolenaareae1b912019-05-09 15:12:55 +02006129. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100613============================
614
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100615Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
616You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
617This also applies to when you get a Vim executable and don't build yourself,
618do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100619
6201) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100621
Bram Moolenaar30a89472016-01-10 14:35:58 +0100622Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100623 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100624
625Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100626lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100627MinGW.
628
629Unpack it to a working directory. E.g. C:\projects\lua53.
630Lua's header files will be installed under the include directory.
631
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100632Copy luaXY.dll to your Windows system directory. The system directory depends
633on your Windows bitness and Vim bitness:
634 32-bit Vim on 32-bit Windows: C:\Windows\System32
635 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
636 64-bit Vim on 64-bit Windows: C:\Windows\System32
637
638Or another option is copying luaXY.dll to the directory where gvim.exe
639(or vim.exe) is.
640
Bram Moolenaar30a89472016-01-10 14:35:58 +0100641
6422) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100643
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100644You need to set LUA, DYNAMIC_LUA and LUA_VER.
645
646 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
647 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
648 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100649
650E.g. When using MSVC (as one line):
651
652 nmake -f Make_mvc.mak
653 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
654
655Or when using MinGW (as one line):
656
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200657 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100658 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100659
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100660
661Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100662
663 make -f Make_cyg.mak
664 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
665
666
Bram Moolenaareae1b912019-05-09 15:12:55 +020066710. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100668==============================
669
670Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
671You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
672
673 http://www.activestate.com/activeperl
674 http://strawberryperl.com/
675
676When building, you need to set the following variables:
677
678 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
679 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
680 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
681
682E.g. When using MSVC (as one line):
683
684 nmake -f Make_mvc.mak
685 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
686
687Or when using MinGW (as one line):
688
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200689 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100690 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100691
692
Bram Moolenaareae1b912019-05-09 15:12:55 +020069311. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100694==============================
695
696Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
697Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200698Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100699
700 http://rubyinstaller.org/
701
702If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
703you need some tricks described below.
704(Another binary distribution is ActiveScriptRuby:
705 http://www.artonx.org/data/asr/)
706
707When building, you need to set the following variables at least:
708
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200709 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200710 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200711 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200712 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200713 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100714
715Ruby version vs. Ruby API version:
716
717 Ruby ver. | Ruby API ver.
718 =========================
719 1.8.X | 1.8
720 1.9.[1-3] | 1.9.1
721 2.0.0 | 2.0.0
722 2.X.Y | 2.X.0
723
724(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
725
726
727A) Using MSVC
728
729If you want to link with ruby, normally you must use the same compiler as
730which was used to build the ruby binary. RubyInstaller is built with MinGW,
731so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200732RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100733config.h and Ruby's DLL name. Here are the steps for working around them:
734
735 1) Download and Install RubyInstaller.
736 You can install RubyInstaller with the default options and directory.
737 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200738 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100739
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200740 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100741
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200742 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100743
744 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200745 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100746 cd ruby
747 win32\configure.bat
748 nmake .config.h.time
749
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200750 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100751 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100752 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200753 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100754 If you use 64-bit MSVC 2015, the config.h is generated in the
755 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100756
757 3) Install the generated config.h.
758
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100759 For 32-bit version:
760
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100761 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100762
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100763 For 64-bit version:
764
765 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
766
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200767 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
768 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100769
770 4) Build Vim. Note that you need to adjust some variables (as one line):
771
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100772 For 32-bit version:
773
Bram Moolenaar30a89472016-01-10 14:35:58 +0100774 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200775 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100776 RUBY_MSVCRT_NAME=msvcrt
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200777 WINVER=0x501
Bram Moolenaar30a89472016-01-10 14:35:58 +0100778
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100779 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
780
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200781 If you set WINVER explicitly, it must be set to >=0x500, when building
782 with Ruby 2.1 or later. (Default is 0x501.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100783 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
784 which is used for the Ruby's DLL name.
785
786B) Using MinGW
787
788Using MinGW is easier than using MSVC when linking with RubyInstaller.
789After you install RubyInstaller, just type this (as one line):
790
791 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100792 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100793 WINVER=0x600
Bram Moolenaar30a89472016-01-10 14:35:58 +0100794
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100795For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200796If you set WINVER explicitly, it must be set to >=0x500, when building with
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100797Ruby 2.1 or later. (Default is 0x600.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200798
Bram Moolenaar30a89472016-01-10 14:35:58 +0100799
800
Bram Moolenaareae1b912019-05-09 15:12:55 +020080112. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100802=============================
803
804Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
805You can use binaries from ActiveState (ActiveTcl).
806
807 http://www.activestate.com/activetcl
808
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100809Alternatively, you can use the binaries provided by IronTcl from
810
811 https://www.irontcl.com/
812
813They might lack behind the latest version a bit, but should provide 64bit
814and 32bit versions even if ActiveTcl does not provide them anymore.
815
816For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100817When building, you need to set the following variables:
818
819 TCL: Where tcl is installed. E.g. C:\Tcl86
820 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
821 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
822 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
823
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200824Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
825but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
826the TCL_DLL variable:
827 TCL_DLL=tcl86t.dll
828
Bram Moolenaar30a89472016-01-10 14:35:58 +0100829E.g. When using MSVC (as one line):
830
831 nmake -f Make_mvc.mak
832 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
833
834Or when using MinGW (as one line):
835
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200836 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100837 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100838
839
Bram Moolenaar8024f932020-01-14 19:29:13 +010084013. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100841===============================================
842
843Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
844This requires dwrite_2.h and some other header files which come with Windows
845SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
846This also requires MBYTE=yes which is enabled by default.
847
848A) Using MSVC
849
850If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
851You just need to specify DIRECTX=yes:
852
853 nmake -f Make_mvc.mak DIRECTX=yes
854
855If you use MSVC 2012 or earlier, the required header files are not available
856by default. However, you can use the header files from newer SDKs with older
857compilers. E.g.:
858
859 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
860 nmake -f Make_mvc.mak DIRECTX=yes
861
862If you don't need color emoji support, only dwrite.h is required. You can use
863older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
864
865 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
866
867B) Using MinGW-w64
868
869Just set DIRECTX to yes:
870
871 mingw32-make -f Make_ming.mak DIRECTX=yes
872
873
K.Takatad8f86292022-03-07 15:16:15 +000087414. Building with libsodium support
875===================================
876
877For better encryption support, you can build Vim with libsodium.
878
879A) Using MSVC
880
881You can download the latest libsodium library from here:
882 https://download.libsodium.org/libsodium/releases/
883
884At this moment, libsodium-1.0.18-stable-msvc.zip is the latest package.
885Unpack it to anywhere you like, and specify the path to the SODIUM option:
886
887 nmake -f Make_mvc.mak SODIUM=C:/path/to/libsodium
888 (libsodium.dll will be used as the libsodium DLL name.)
889
890B) Using MinGW
891
892If you use msys2, you can install the libsodium package by pacman (or pacboy):
893
894 $ pacman -S mingw-w64-x86_64-libsodium # for 64-bit Vim
895 $ pacman -S mingw-w64-i686-libsodium # for 32-bit Vim
896 $ pacboy -S libsodium:m # for both 32-bit and 64-bit Vim
897
898Then set SODIUM to yes:
899
900 mingw32-make -f Make_ming.mak SODIUM=yes
901 (libsodium-23.dll will be used as the libsodium DLL name.)
902
903Or you can set the path to libsodium explicitly:
904
905 mingw32-make -f Make_ming.mak SODIUM=C:/path/to/libsodium
906 (libsodium.dll will be used as the libsodium DLL name.)
907
908
90915. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100910================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000911
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100912The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000913
914
K.Takatad8f86292022-03-07 15:16:15 +000091516. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100916==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000917
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100918The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
919work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200920
921
K.Takatad8f86292022-03-07 15:16:15 +000092217. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200923==========================================
924
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100925[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200926
927After you've built the Vim binaries as described above, you're ready to
928install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100929using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaar8024f932020-01-14 19:29:13 +0100930first create a "vim82" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200931zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100932correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200933
Bram Moolenaar8024f932020-01-14 19:29:13 +0100934 A. Create a Vim "runtime" subdirectory named "vim82"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200935 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100936 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200937 Otherwise, continue reading.
938
939 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaar8024f932020-01-14 19:29:13 +0100940 directories and create a new subdirectory named "vim82".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100941
Bram Moolenaar8024f932020-01-14 19:29:13 +0100942 Copy the "runtime" files into "vim82":
943 copy runtime\* vim82
Bram Moolenaarade0d392020-01-21 22:33:58 +0100944 xcopy /s runtime\* vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200945
Bram Moolenaar8024f932020-01-14 19:29:13 +0100946 B. Copy the new binaries into the "vim82" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200947 ----------------------------------------------------
948 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaar8024f932020-01-14 19:29:13 +0100949 new binaries you created above into "vim82":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200950
Bram Moolenaar8024f932020-01-14 19:29:13 +0100951 copy src\*.exe vim82
952 copy src\tee\tee.exe vim82
953 copy src\xxd\xxd.exe vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200954
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100955 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
Bram Moolenaar8024f932020-01-14 19:29:13 +0100956 versions of gvimext.dll. They should be copied to "vim82\GvimExt32" and
957 "vim82\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100958 First, build the 32-bit version, then:
959
Bram Moolenaar8024f932020-01-14 19:29:13 +0100960 mkdir vim82\GvimExt32
961 copy src\GvimExt\gvimext.dll vim82\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100962
963 Next, clean the 32-bit version and build the 64-bit version, then:
964
Bram Moolenaar8024f932020-01-14 19:29:13 +0100965 mkdir vim82\GvimExt64
966 copy src\GvimExt\gvimext.dll vim82\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100967
Bram Moolenaar8024f932020-01-14 19:29:13 +0100968 C. Copy gettext and iconv DLLs into the "vim82" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100969 ----------------------------------------------------------
970 Get gettext and iconv DLLs from the following site:
971 https://github.com/mlocati/gettext-iconv-windows/releases
972 Both 64- and 32-bit versions are needed.
973 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
974 DLLs and place them as follows:
975
Bram Moolenaar8024f932020-01-14 19:29:13 +0100976 vim82\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100977 | libintl-8.dll
978 | libiconv-2.dll
979 | libgcc_s_sjlj-1.dll (only for 32-bit)
980 |
981 + GvimExt32\
982 | libintl-8.dll
983 | libiconv-2.dll
984 | libgcc_s_sjlj-1.dll
985 |
986 ` GvimExt64\
987 libintl-8.dll
988 libiconv-2.dll
989
Bram Moolenaar8024f932020-01-14 19:29:13 +0100990 The DLLs in the "vim82" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100991
Bram Moolenaar8024f932020-01-14 19:29:13 +0100992 D. Move the "vim82" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200993 ---------------------------------------------------------------------
Bram Moolenaar8024f932020-01-14 19:29:13 +0100994 Move the "vim82" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100995 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaar8024f932020-01-14 19:29:13 +0100996 If you already have a "vim82" subdirectory in "vim", delete it first
Bram Moolenaar30e8e732019-09-27 13:08:36 +0200997 by running its uninstall.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200998
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100999 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +02001000 ---------------
Bram Moolenaar8024f932020-01-14 19:29:13 +01001001 "cd" to your Vim installation subdirectory "vim\vim82" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +02001002 "install.exe" program. It will ask you a number of questions about
1003 how you would like to have your Vim setup. Among these are:
1004 - You can tell it to write a "_vimrc" file with your preferences in the
1005 parent directory.
1006 - It can also install an "Edit with Vim" entry in the Windows Explorer
1007 popup menu.
1008 - You can have it create batch files, so that you can run Vim from the
1009 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001010 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001011 - Create entries for Vim on the desktop and in the Start menu.
1012
1013Happy Vimming!