blob: 5854b10c5a636855a6de0f2cf2de538d057af1a8 [file] [log] [blame]
Andrey A. Voropaev157397e2024-12-26 15:55:24 +01001INSTALLpc.txt - Installation of Vim on PC - Last Update: 2024 Dec 26
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
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
K.Takata27b53be2022-09-18 12:25:49 +0100157/8/10/11). There are also instructions for pre-Vista and pre-XP systems, but
Bram Moolenaar02cfac82016-04-21 14:34:58 +020016they 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
Christopher Plewright60908c42023-01-13 15:28:14 +000045using the "Visual Studio 2022 Community Edition" installation. This doesn't
46include the SDK for older Windows versions (95 - XP), see "OLDER VERSIONS"
47below 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
Christopher Plewright60908c42023-01-13 15:28:14 +000054can search for "Visual Studio 2022 Community Edition", for example. You will
55need to create a Microsoft account (it's free). You need to download the
56"DVD", and execute the installer from it.
Bram Moolenaar73f44392017-10-07 18:38:43 +020057
Christopher Plewright60908c42023-01-13 15:28:14 +000058When installing "Visual Studio 2022 Community Edition" or "Build Tools for
59Visual Studio 2022" make sure to select "custom" and check all checkboxes
60under "Universal Windows App Development Tools". Or whatever they are called
61now.
62
63Note: Vim source code no longer supports Windows XP since Patch 9.0.0496.
64Also, Visual Studio 2017 was the last version to support a Windows XP target.
65If you still want to target Windows XP, you can check out an older version of
66vim source code and install Visual Studio 2017 or 2015 - making sure to check
67the checkbox for "Windows XP Support for C++". Additional build instructions
68for Windows XP are provided below. |new-msvc-windows-xp|
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010069
Bram Moolenaar73f44392017-10-07 18:38:43 +020070
Bram Moolenaar362e1a32006-03-06 23:29:24 +000071Visual Studio
72-------------
73
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010074Building with Visual Studio (VS2015, VS2017, VS2019 and VS2022) is
75straightforward. Older versions probably don't work.
76
Christopher Plewright60908c42023-01-13 15:28:14 +000077Vim versions built with VS2015 and VS2017 are systematically tested and known
78to work well on Windows versions 7, 8 and 8.1.
79
80Vim versions built with VS2015 and VS2017 are also known to work well on all
81early versions of Windows 10. However, Vim versions built with VS2015 and
82VS2017 may run into a known issue on the latest versions of Windows 10 and 11.
83Building Vim with VS2019 or VS2022 resolves the issue.
84
85Vim versions built with VS2019 and VS2022 are systematically tested and
86known to work on Windows versions 7, 8, 8.1, 10, 11 and all respective server
87variants.
88
K.Takatac3430cb2022-09-21 11:56:41 +010089Visual Studio installed a batch file called vcvarsall.bat, which you must
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010090run to set up paths for nmake and MSVC. We provide a batch file
dundargocc57b5bc2022-11-02 13:30:51 +000091"msvc2015.bat" for this. You may need to edit it if you didn't install Visual
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010092Studio in the standard location.
K.Takatac3430cb2022-09-21 11:56:41 +010093If you use VS2017 or later, you can use "msvc-latest.bat" (or "msvc2017.bat"
94and so on for the specific version). You must specify the architecture (e.g.
95"x86", "x64", etc.) as the first argument when you use this. If you use VS2017
96Express, you must use "x86_amd64" instead of "x64" for targeting the x64
97platform.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020098
Bram Moolenaar362e1a32006-03-06 23:29:24 +000099To build Vim from the command line with MSVC, use Make_mvc.mak.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000100
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000101nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
102nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
103nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000104nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000105 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000106
107Make_mvc.mak allows a Vim to be built with various different features and
Bram Moolenaarfda97842019-05-07 22:25:27 +0200108debug support.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000109
Bram Moolenaara0754902019-11-19 23:01:28 +0100110For compiling gVim with IME support on far-east Windows, add IME=yes
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000111to the parameters you pass to Make_mvc.mak.
112
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000113See the specific files for comments and options.
114
115These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100116Ron Aaron; they have been tested. But several things changed after that...
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000117
118
Christopher Plewright60908c42023-01-13 15:28:14 +0000119Targeting Windows XP with MSVC 2015 or 2017 *new-msvc-windows-xp*
120-------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200121
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100122(The support for pre-Vista was removed in patch 9.0.0496. If you want to
K.Takata27b53be2022-09-18 12:25:49 +0100123target Windows XP, use the source code before that.)
124
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200125Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
126so that it targets Windows 6.0 (Vista) by default. In order to override
127this, the target Windows version number needs to be passed to LINK like
128follows:
129 LINK ... /subsystem:console,5.01
130
131Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200132Use lines like follows to target Windows XP x86 (assuming using Visual C++
1332012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200134 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200135 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
136 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200137 set CL=/D_USING_V110_SDK71_
138 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
139
Bram Moolenaar73f44392017-10-07 18:38:43 +0200140To target Windows XP x64 instead of x86, you need to change the settings of
141LIB and SUBSYSTEM_VER:
142 ...
143 set LIB=%WinSdk71%\Lib\x64;%LIB%
144 ...
145 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
146
147If you use Visual C++ 2015 (either Express or Community Edition), executing
148msvc2015.bat will set them automatically. For x86 builds run this without
149options:
150 msvc2015
151For x64 builds run this with the "x86_amd64" option:
152 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200153This enables x86_x64 cross compiler. This works on any editions including
154Express edition.
155If you use Community (or Professional) edition, you can enable the x64 native
156compiler by using the "x64" option:
157 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200158
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200159The following Visual C++ team blog can serve as a reference page:
160 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
161
162
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200163Cross compile support for Windows on ARM64
164------------------------------------------
165
166This depends on VS2017 with the optional ARM64 compiler and SDK
167installed. Use "vcvarsall.bat x64_arm64" as the build environment.
168
169The ARM64 support was provided by Leendert van Doorn.
170
171
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200172OLDER VERSIONS
173
Christopher Plewright60908c42023-01-13 15:28:14 +0000174The minimal supported version is Windows 7. Building with compilers older than
1752015 most likely doesn't work. Since MSVC 2022 can be obtained for free there
176is no point in supporting older versions.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200177
K.Takata76687d22022-01-25 10:31:37 +0000178If you need the executable to run on Windows 98 or ME, use the 2005 one
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100179|msvc-2005-express|, and use the source code before 8.0.0029. See the
180src/INSTALLpc.txt file for instructions.
Bram Moolenaara0754902019-11-19 23:01:28 +0100181
Bram Moolenaara0754902019-11-19 23:01:28 +0100182
Bram Moolenaar304925e2018-06-30 16:27:02 +02001832. MSYS2 with MinGW
184===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200185
Bram Moolenaar304925e2018-06-30 16:27:02 +02001862.1. Setup the basic msys2 environment
187
188Go to the official page of MSYS2: https://www.msys2.org
189Download an installer:
190
191* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
192 (Even if you want to build 32-bit Vim)
193* msys2-i686-YYYYMMDD.exe for 32-bit Windows
194
195Execute the installer and follow the instructions to update basic packages.
196At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200197open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200198
199Execute:
200 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200201
Bram Moolenaar2346a632021-06-13 19:02:49 +0200202And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start
203Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit").
Bram Moolenaar304925e2018-06-30 16:27:02 +0200204Then execute:
205 $ pacman -Su
206
207If pacman complains that `catgets` and `libcatgets` conflict with another
208package, select `y` to remove them.
209
210
2112.2. Install additional packages for building Vim
212
213The following package groups are required for building Vim:
214
215* base-devel
216* mingw-w64-i686-toolchain (for building 32-bit Vim)
217* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
Christian Brabandt177437c2023-09-17 16:36:33 +0200218* git (optional, to clone the repository)
219* pactoys (optional for the pacboy command)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200220
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200221(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200222Use the following command to install them:
223
Christian Brabandt177437c2023-09-17 16:36:33 +0200224 $ pacman -S base-devel mingw-w64-i686-toolchain \
225 mingw-w64-x86_64-toolchain pactoys git
Bram Moolenaar304925e2018-06-30 16:27:02 +0200226
227Or you can use the `pacboy` command to avoid long package names:
228
229 $ pacboy -S base-devel: toolchain:m
230
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200231The suffix ":" means that it disables the package name translation.
232The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
233to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200234(See `pacboy help` for the help.)
235
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200236See also the pacman page in ArchWiki for the general usage of pacman:
237 https://wiki.archlinux.org/index.php/pacman
238
239MSYS2 has its own git package, and you can also install it via pacman:
240
241 $ pacman -S git
242
Bram Moolenaar304925e2018-06-30 16:27:02 +0200243
2442.3. Keep the build environment up-to-date
245
246After you have installed the build environment, you may want to keep it
247up-to-date (E.g. always use the latest GCC).
248In that case, you just need to execute the command:
249 $ pacman -Syu
250
251
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02002522.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200253
254Select one of the following icon from the Start Menu:
255
256* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
257* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
258
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100259Before building look through notes for MinGW in part 3 below.
260
Bram Moolenaar304925e2018-06-30 16:27:02 +0200261Go to the source directory of Vim, then execute the make command. E.g.:
262
263 make -f Make_ming.mak
264 make -f Make_ming.mak GUI=no
265 make -f Make_ming.mak GUI=no DEBUG=yes
266
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200267NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200268console for that. You need to set $PATH to be able to build there, e.g.:
269
270 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
271
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200272This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200273
274 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
275
276If you have msys64 in another location you will need to adjust the paths for
277that.
278
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +01002792.5. Build Vim with Clang
280
281The following package group is required for building Vim with Clang:
282
283* mingw-w64-clang-x86_64-clang
284
285Use the following command to install it:
286
287 $ pacman -S mingw-w64-clang-x86_64-clang
288
289Go to the source directory of Vim, then execute the make command. E.g.:
290
291 CC=clang
292 CXX=clang++
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100293 # To build Vim without the GUI support
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100294 make -f Make_ming.mak GUI=no
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100295 # To build Vim with the GUI support
296 make -f Make_ming.mak GUI=yes XPM=no
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100297
298To build Vim with the address sanitizer (ASAN), execute the following command:
299
300 CC=clang
301 CXX=clang++
302 make -f Make_ming.mak DEBUG=yes ASAN=yes
Bram Moolenaar304925e2018-06-30 16:27:02 +0200303
3043. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000305========
306
Bram Moolenaara0754902019-11-19 23:01:28 +0100307(written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000308
Bram Moolenaara0754902019-11-19 23:01:28 +0100309This is about how to produce a Win32 binary of gvim with MinGW from the normal
310Command Prompt window. (To use MSYS2 console, see above.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000311
Bram Moolenaara0754902019-11-19 23:01:28 +0100312First, you need to get the 'MinGW-w64' compiler, which is free for the
313download at:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100314
315 http://mingw-w64.sourceforge.net/
316
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100317Or a compiler provided on msys2:
318
Bram Moolenaara0754902019-11-19 23:01:28 +0100319 https://www.msys2.org/
320
321The original 'mingw32' compiler is outdated, and may no longer work:
322
323 http://www.mingw.org/
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100324
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100325Please note, newer versions of Windows (I believe starting with Win10)
326offer support for UCRT C-library in addition to traditional MSVCRT. As result,
327one may find 2 flavors of MinGW: one compiling against UCRT and another compiling
328against MSVCRT. Currently VIM comes with libXpm.a compiled against MSVCRT,
329so an attempt to build VIM against UCRT will fail with:
330
331 undefined reference to __imp___iob_func
332
333In which case, if one does not need support for XPM, then argument XPM=no can be
334added to make-command. If support is needed, then another flavor of MinGW must
335be used.
336
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000337Once you have downloaded the compiler binaries, unpack them on your hard disk
Bram Moolenaara0754902019-11-19 23:01:28 +0100338somewhere, and put them on your PATH. Go to the Control Panel, (Performance
339and Maintenance), System, Advanced, and edit the environment from there. If
Bram Moolenaar23515b42020-11-29 14:36:24 +0100340you use the standalone MinGW-w64 compiler, the path may depend on your
Bram Moolenaara0754902019-11-19 23:01:28 +0100341installation. If you use msys2 compilers, set your installed paths (normally
342one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100343
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100344 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
345 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
346 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000347
Bram Moolenaara0754902019-11-19 23:01:28 +0100348Test if gcc is on your path. From a Command Prompt window:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000349
350 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100351 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000352
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100353 C:\> mingw32-make --version
354 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000355
356Now you are ready to rock 'n' roll. Unpack the vim sources (look on
357www.vim.org for exactly which version of the vim files you need).
358
359Change directory to 'vim\src':
360
361 C:\> cd vim\src
362 C:\VIM\SRC>
363
364and you type:
365
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100366 mingw32-make -f Make_ming.mak ARCH=x86-64 gvim.exe
367
368Note, ARCH is necessary if you don't have the sed command in your $PATH. Just
369make sure that the correct value is used with ARCH. In the example above the
370value corresponds to 64-bit architecture. For 32-bit the value is x86.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000371
372After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
373directory.
374
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100375If you also want to get xxd.exe, install.exe etc. then just remove "gvim.exe"
376from the make-command.
377
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000378You should not need to do *any* editing of any files to get vim compiled this
379way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100380is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100381
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100382 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000383
384If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
385(also free!) and compress the file (typical compression is 50%). UPX can be
386found at
387 http://www.upx.org/
388
Bram Moolenaar91856272012-02-29 16:56:39 +0100389As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
390built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
391at:
392 http://www.matcode.com/mpress.htm
393
394
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000395ADDITION: NLS support with MinGW
396
397(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
398
399If you want National Language Support, read the file src/po/README_mingw.txt.
400You need to uncomment lines in Make_ming.mak to have NLS defined.
401
402
Bram Moolenaar304925e2018-06-30 16:27:02 +02004034. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000404=========
405
406Use Make_cyg.mak with Cygwin's GCC. See
407 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
408
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100409With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000410Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100411running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000412with the other makefiles).
413
414
Bram Moolenaareae1b912019-05-09 15:12:55 +02004155. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000416=================================================
417
418[Update of 1) needs to be verified]
419
420If you like, you can compile the 'mingw' Win32 version from the comfort of
421your Linux (or other unix) box. To do this, you need to follow a few steps:
422 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100423 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000424 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000425 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100426 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
427 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
428 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100429 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000430 4) make -f Make_ming.mak gvim.exe
431
432Now you have created the Windows binary from your Linux box! Have fun...
433
434
Bram Moolenaareae1b912019-05-09 15:12:55 +02004356. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000436===============================
437
Bram Moolenaara0754902019-11-19 23:01:28 +0100438For building with MSVC the "Windows Installer" from www.python.org works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000439
Bram Moolenaar30a89472016-01-10 14:35:58 +0100440When building, you need to set the following variables at least:
441
442 PYTHON: Where Python is installed. E.g. C:\Python27
443 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
444 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
445
446E.g. When using MSVC (as one line):
447
448 nmake -f Make_mvc.mak
449 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
450
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100451When using MinGW and link with the official Python (as one line):
452
453 mingw32-make -f Make_ming.mak
454 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
455
456When using msys2 and link with Python2 bundled with msys2 (as one line):
457
458 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
459 PYTHON_HOME=c:/msys64/mingw64
460 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
461 DYNAMIC_PYTHON=yes
462 PYTHON_VER=27
463 DYNAMIC_PYTHON_DLL=libpython2.7.dll
464 STATIC_STDCPLUS=yes
465
466(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
467(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
468libstdc++-6.dll.)
469
470
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200471(rest written by Ron Aaron: <ronaharon@yahoo.com>)
472
473Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000474 http://www.ActiveState.com/Products/ActivePython/
475
476After installing the ActivePython, you will have to create a 'mingw32'
477'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100478 cd $PYTHON/libs
479 pexports python20.dll > python20.def
480 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000481
482Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
483the root of the Python installation (C:\Python20, for example). If you are
484cross-compiling on Linux with the mingw32 setup, you need to also convert all
485the 'Include' files to *unix* line-endings. This bash command will do it
486easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100487 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000488
489Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100490 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000491
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100492You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000493
494
Bram Moolenaareae1b912019-05-09 15:12:55 +02004957. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100496================================
497
Bram Moolenaara0754902019-11-19 23:01:28 +0100498For building with MSVC the "Windows Installer" from www.python.org works fine.
499Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100500
501When building, you need to set the following variables at least:
502
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100503 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100504 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100505 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100506
507E.g. When using MSVC (as one line):
508
509 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100510 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
511
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100512When using MinGW and link with the official Python3 (as one line):
513
514 mingw32-make -f Make_ming.mak
515 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100516
517When using msys2 and link with Python3 bundled with msys2 (as one line):
518
519 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
520 PYTHON3_HOME=c:/msys64/mingw64
521 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
522 DYNAMIC_PYTHON3=yes
523 PYTHON3_VER=36
524 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
525 STATIC_STDCPLUS=yes
526
527(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100528(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
529libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100530
531
Bram Moolenaareae1b912019-05-09 15:12:55 +02005328. Building with Racket or MzScheme support
Bram Moolenaara0754902019-11-19 23:01:28 +0100533===========================================
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100534
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005351) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100536
537MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200538support can be built with either MSVC or MinGW (or Cygwin).
539Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100540
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200541Copy lib/libracket{version}.dll to your Windows system directory. The system
542directory depends on your Windows bitness and Vim bitness:
543 32-bit Vim on 32-bit Windows: C:\Windows\System32
544 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
545 64-bit Vim on 64-bit Windows: C:\Windows\System32
546
547For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100548
549 MZSCHEME: Where Racket is installed.
550 E.g. C:\Program Files (x86)\Racket
551 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200552 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200553 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200554 The DLL can be found under the lib directory. E.g.
555 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100556 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
557 runtime. Default: $(MZSCHEME)\collects
558 User can override this with the PLTCOLLECTS environment
559 variable.
560
Bram Moolenaar73f44392017-10-07 18:38:43 +0200561List of MZSCHEME_VER (incomplete):
562
563 Racket ver. | MZSCHEME_VER
564 ==========================
565 6.3 | 3m_9z0ds0
566 6.6 | 3m_a0solc
567 6.8 | 3m_a1zjsw
568 6.10 | 3m_a36fs8
569
570
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100571E.g. When using MSVC (as one line):
572
573 nmake -f Make_mvc.mak
574 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
575 MZSCHEME_VER=3m_9z0ds0
576
577Or when using MinGW (as one line):
578
579 mingw32-make -f Make_ming.mak
580 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
581 MZSCHEME_VER=3m_9z0ds0
582
583 Spaces should be escaped with '\'.
584
585
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005862) Building with MzScheme support (older)
587
588(written by Sergey Khorev <sergey.khorev@gmail.com>)
589
590Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
591be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
592above (including 299 and 30x series).
593
594The MSVC build is quite straightforward. Simply invoke (in one line)
595nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
596 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
597where <MzScheme-version> is the last seven characters from MzScheme dll name
598(libmzschXXXXXXX.dll).
599If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
600DLL's, but will load them in runtime on demand.
601
602Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
603account that <Path-to-MzScheme> should contain slashes rather than backslashes
604(e.g. d:/Develop/MzScheme)
605
606"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
607explicitly) on MinGW and Cygwin requires additional step.
608
609libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
610%WINDOWS%\System32 to other location (either build directory, some temporary
611dir or even MzScheme home).
612
613Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
614make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
615 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
616
617After a successful build, these dlls can be freely removed, leaving them in
618%WINDOWS%\System32 only.
619
620
621
Bram Moolenaareae1b912019-05-09 15:12:55 +02006229. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100623============================
624
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100625Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
626You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
627This also applies to when you get a Vim executable and don't build yourself,
628do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100629
6301) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100631
Bram Moolenaar30a89472016-01-10 14:35:58 +0100632Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100633 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100634
635Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100636lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100637MinGW.
638
639Unpack it to a working directory. E.g. C:\projects\lua53.
640Lua's header files will be installed under the include directory.
641
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100642Copy luaXY.dll to your Windows system directory. The system directory depends
643on your Windows bitness and Vim bitness:
644 32-bit Vim on 32-bit Windows: C:\Windows\System32
645 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
646 64-bit Vim on 64-bit Windows: C:\Windows\System32
647
648Or another option is copying luaXY.dll to the directory where gvim.exe
649(or vim.exe) is.
650
Bram Moolenaar30a89472016-01-10 14:35:58 +0100651
6522) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100653
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100654You need to set LUA, DYNAMIC_LUA and LUA_VER.
655
656 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
657 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
658 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100659
660E.g. When using MSVC (as one line):
661
662 nmake -f Make_mvc.mak
663 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
664
665Or when using MinGW (as one line):
666
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200667 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100668 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100669
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100670
671Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100672
673 make -f Make_cyg.mak
674 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
675
676
Bram Moolenaareae1b912019-05-09 15:12:55 +020067710. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100678==============================
679
680Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
681You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
682
683 http://www.activestate.com/activeperl
684 http://strawberryperl.com/
685
686When building, you need to set the following variables:
687
688 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
689 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
690 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
691
692E.g. When using MSVC (as one line):
693
694 nmake -f Make_mvc.mak
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100695 PERL=C:\StrawberryPerl\perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100696
697Or when using MinGW (as one line):
698
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200699 mingw32-make -f Make_ming.mak
Andrey A. Voropaev157397e2024-12-26 15:55:24 +0100700 PERL=C:/StrawberryPerl/perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100701
702
Bram Moolenaareae1b912019-05-09 15:12:55 +020070311. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100704==============================
705
706Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
707Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200708Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100709
710 http://rubyinstaller.org/
711
712If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
713you need some tricks described below.
714(Another binary distribution is ActiveScriptRuby:
715 http://www.artonx.org/data/asr/)
716
717When building, you need to set the following variables at least:
718
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200719 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200720 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200721 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200722 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200723 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100724
725Ruby version vs. Ruby API version:
726
727 Ruby ver. | Ruby API ver.
728 =========================
Bram Moolenaar30a89472016-01-10 14:35:58 +0100729 1.9.[1-3] | 1.9.1
730 2.0.0 | 2.0.0
731 2.X.Y | 2.X.0
732
733(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
734
735
736A) Using MSVC
737
738If you want to link with ruby, normally you must use the same compiler as
739which was used to build the ruby binary. RubyInstaller is built with MinGW,
740so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200741RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100742config.h and Ruby's DLL name. Here are the steps for working around them:
743
744 1) Download and Install RubyInstaller.
745 You can install RubyInstaller with the default options and directory.
746 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200747 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100748
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200749 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100750
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200751 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100752
753 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200754 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100755 cd ruby
756 win32\configure.bat
757 nmake .config.h.time
758
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200759 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100760 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100761 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200762 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100763 If you use 64-bit MSVC 2015, the config.h is generated in the
764 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100765
766 3) Install the generated config.h.
767
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100768 For 32-bit version:
769
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100770 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100771
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100772 For 64-bit version:
773
774 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
775
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200776 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
777 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100778
779 4) Build Vim. Note that you need to adjust some variables (as one line):
780
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100781 For 32-bit version:
782
Bram Moolenaar30a89472016-01-10 14:35:58 +0100783 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200784 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100785 RUBY_MSVCRT_NAME=msvcrt
K.Takata27b53be2022-09-18 12:25:49 +0100786 WINVER=0x601
Bram Moolenaar30a89472016-01-10 14:35:58 +0100787
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100788 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
789
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200790 If you set WINVER explicitly, it must be set to >=0x500, when building
K.Takata27b53be2022-09-18 12:25:49 +0100791 with Ruby 2.1 or later. (Default is 0x601.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100792 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
793 which is used for the Ruby's DLL name.
794
795B) Using MinGW
796
797Using MinGW is easier than using MSVC when linking with RubyInstaller.
798After you install RubyInstaller, just type this (as one line):
799
800 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100801 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
K.Takata27b53be2022-09-18 12:25:49 +0100802 WINVER=0x601
Bram Moolenaar30a89472016-01-10 14:35:58 +0100803
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100804For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200805If you set WINVER explicitly, it must be set to >=0x500, when building with
K.Takata27b53be2022-09-18 12:25:49 +0100806Ruby 2.1 or later. (Default is 0x601.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200807
Bram Moolenaar30a89472016-01-10 14:35:58 +0100808
809
Bram Moolenaareae1b912019-05-09 15:12:55 +020081012. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100811=============================
812
813Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
814You can use binaries from ActiveState (ActiveTcl).
815
816 http://www.activestate.com/activetcl
817
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100818Alternatively, you can use the binaries provided by IronTcl from
819
820 https://www.irontcl.com/
821
822They might lack behind the latest version a bit, but should provide 64bit
823and 32bit versions even if ActiveTcl does not provide them anymore.
824
825For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100826When building, you need to set the following variables:
827
828 TCL: Where tcl is installed. E.g. C:\Tcl86
829 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
830 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
831 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
832
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200833Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
834but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
835the TCL_DLL variable:
836 TCL_DLL=tcl86t.dll
837
Bram Moolenaar30a89472016-01-10 14:35:58 +0100838E.g. When using MSVC (as one line):
839
840 nmake -f Make_mvc.mak
841 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
842
843Or when using MinGW (as one line):
844
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200845 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100846 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100847
848
Bram Moolenaar8024f932020-01-14 19:29:13 +010084913. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100850===============================================
851
852Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
853This requires dwrite_2.h and some other header files which come with Windows
854SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
855This also requires MBYTE=yes which is enabled by default.
856
857A) Using MSVC
858
859If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
860You just need to specify DIRECTX=yes:
861
862 nmake -f Make_mvc.mak DIRECTX=yes
863
864If you use MSVC 2012 or earlier, the required header files are not available
865by default. However, you can use the header files from newer SDKs with older
866compilers. E.g.:
867
868 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
869 nmake -f Make_mvc.mak DIRECTX=yes
870
871If you don't need color emoji support, only dwrite.h is required. You can use
872older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
873
874 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
875
876B) Using MinGW-w64
877
878Just set DIRECTX to yes:
879
880 mingw32-make -f Make_ming.mak DIRECTX=yes
881
882
K.Takatad8f86292022-03-07 15:16:15 +000088314. Building with libsodium support
884===================================
885
886For better encryption support, you can build Vim with libsodium.
887
888A) Using MSVC
889
890You can download the latest libsodium library from here:
891 https://download.libsodium.org/libsodium/releases/
892
893At this moment, libsodium-1.0.18-stable-msvc.zip is the latest package.
894Unpack it to anywhere you like, and specify the path to the SODIUM option:
895
896 nmake -f Make_mvc.mak SODIUM=C:/path/to/libsodium
897 (libsodium.dll will be used as the libsodium DLL name.)
898
899B) Using MinGW
900
901If you use msys2, you can install the libsodium package by pacman (or pacboy):
902
903 $ pacman -S mingw-w64-x86_64-libsodium # for 64-bit Vim
904 $ pacman -S mingw-w64-i686-libsodium # for 32-bit Vim
905 $ pacboy -S libsodium:m # for both 32-bit and 64-bit Vim
906
907Then set SODIUM to yes:
908
909 mingw32-make -f Make_ming.mak SODIUM=yes
910 (libsodium-23.dll will be used as the libsodium DLL name.)
911
912Or you can set the path to libsodium explicitly:
913
914 mingw32-make -f Make_ming.mak SODIUM=C:/path/to/libsodium
915 (libsodium.dll will be used as the libsodium DLL name.)
916
917
91815. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100919================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000920
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100921The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000922
923
K.Takatad8f86292022-03-07 15:16:15 +000092416. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100925==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100927The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
928work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200929
930
K.Takatad8f86292022-03-07 15:16:15 +000093117. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200932==========================================
933
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100934[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200935
936After you've built the Vim binaries as described above, you're ready to
937install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100938using Git, Mercurial or by downloading them as a unix tar file, you must
mikoto2000166f89e2024-09-26 15:52:22 +0200939first create a "vim91" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200940zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100941correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200942
mikoto2000166f89e2024-09-26 15:52:22 +0200943 A. Create a Vim "runtime" subdirectory named "vim91"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200944 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100945 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200946 Otherwise, continue reading.
947
948 Go to the directory that contains the Vim "src" and "runtime"
mikoto2000166f89e2024-09-26 15:52:22 +0200949 directories and create a new subdirectory named "vim91".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100950
mikoto2000166f89e2024-09-26 15:52:22 +0200951 Copy the "runtime" files into "vim91":
952 copy runtime\* vim91
953 xcopy /s runtime\* vim91
Bram Moolenaar734d9982011-07-15 13:52:04 +0200954
mikoto2000166f89e2024-09-26 15:52:22 +0200955 B. Copy the new binaries into the "vim91" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200956 ----------------------------------------------------
957 Regardless of how you installed the Vim sources, you need to copy the
mikoto2000166f89e2024-09-26 15:52:22 +0200958 new binaries you created above into "vim91":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200959
mikoto2000166f89e2024-09-26 15:52:22 +0200960 copy src\*.exe vim91
961 copy src\tee\tee.exe vim91
962 copy src\xxd\xxd.exe vim91
Bram Moolenaar734d9982011-07-15 13:52:04 +0200963
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100964 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
mikoto2000166f89e2024-09-26 15:52:22 +0200965 versions of gvimext.dll. They should be copied to "vim91\GvimExt32" and
966 "vim91\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100967 First, build the 32-bit version, then:
968
mikoto2000166f89e2024-09-26 15:52:22 +0200969 mkdir vim91\GvimExt32
970 copy src\GvimExt\gvimext.dll vim91\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100971
972 Next, clean the 32-bit version and build the 64-bit version, then:
973
mikoto2000166f89e2024-09-26 15:52:22 +0200974 mkdir vim91\GvimExt64
975 copy src\GvimExt\gvimext.dll vim91\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100976
mikoto2000166f89e2024-09-26 15:52:22 +0200977 C. Copy gettext and iconv DLLs into the "vim91" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100978 ----------------------------------------------------------
979 Get gettext and iconv DLLs from the following site:
980 https://github.com/mlocati/gettext-iconv-windows/releases
981 Both 64- and 32-bit versions are needed.
982 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
983 DLLs and place them as follows:
984
mikoto2000166f89e2024-09-26 15:52:22 +0200985 vim91\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100986 | libintl-8.dll
987 | libiconv-2.dll
988 | libgcc_s_sjlj-1.dll (only for 32-bit)
989 |
990 + GvimExt32\
991 | libintl-8.dll
992 | libiconv-2.dll
993 | libgcc_s_sjlj-1.dll
994 |
995 ` GvimExt64\
996 libintl-8.dll
997 libiconv-2.dll
998
mikoto2000166f89e2024-09-26 15:52:22 +0200999 The DLLs in the "vim91" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001000
mikoto2000166f89e2024-09-26 15:52:22 +02001001 D. Move the "vim91" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +02001002 ---------------------------------------------------------------------
mikoto2000166f89e2024-09-26 15:52:22 +02001003 Move the "vim91" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001004 to be installed. Typically, this subdirectory will be named "vim".
mikoto2000166f89e2024-09-26 15:52:22 +02001005 If you already have a "vim91" subdirectory in "vim", delete it first
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001006 by running its uninstall.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001007
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +01001008 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +02001009 ---------------
mikoto2000166f89e2024-09-26 15:52:22 +02001010 "cd" to your Vim installation subdirectory "vim\vim91" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +02001011 "install.exe" program. It will ask you a number of questions about
1012 how you would like to have your Vim setup. Among these are:
1013 - You can tell it to write a "_vimrc" file with your preferences in the
1014 parent directory.
1015 - It can also install an "Edit with Vim" entry in the Windows Explorer
1016 popup menu.
1017 - You can have it create batch files, so that you can run Vim from the
1018 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +01001019 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +02001020 - Create entries for Vim on the desktop and in the Start menu.
1021
1022Happy Vimming!