blob: 9a286447c2ea302f7d4ecda2028b26a437011d29 [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
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
K.Takata27b53be2022-09-18 12:25:49 +010045using the "Visual Studio Community 2015" installation. This doesn't include
46the SDK for older Windows versions (95, 98), see "OLDER VERSIONS" below for
47that.
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
K.Takata27b53be2022-09-18 12:25:49 +010060select "custom" and check all checkboxes under "Universal Windows App
61Development Tools". Or whatever they are called now.
62(If you still want to target Windows XP, check also "Windows XP Support for
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010063C++". Note that with the current source code this is no longer supported, you
64will have to check out an older version).
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +010065
Bram Moolenaar73f44392017-10-07 18:38:43 +020066
Bram Moolenaar362e1a32006-03-06 23:29:24 +000067Visual Studio
68-------------
69
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010070Building with Visual Studio (VS2015, VS2017, VS2019 and VS2022) is
71straightforward. Older versions probably don't work.
72
K.Takatac3430cb2022-09-21 11:56:41 +010073Visual Studio installed a batch file called vcvarsall.bat, which you must
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +010074run to set up paths for nmake and MSVC. We provide a batch file
75"msvc2015.bat" for this. You may need to edit it if you didn't instal Visual
76Studio in the standard location.
K.Takatac3430cb2022-09-21 11:56:41 +010077If you use VS2017 or later, you can use "msvc-latest.bat" (or "msvc2017.bat"
78and so on for the specific version). You must specify the architecture (e.g.
79"x86", "x64", etc.) as the first argument when you use this. If you use VS2017
80Express, you must use "x86_amd64" instead of "x64" for targeting the x64
81platform.
Bram Moolenaar97cc2382012-10-03 21:46:54 +020082
Bram Moolenaar362e1a32006-03-06 23:29:24 +000083To build Vim from the command line with MSVC, use Make_mvc.mak.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000084
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000085nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
86nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
87nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000088nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000089 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000090
91Make_mvc.mak allows a Vim to be built with various different features and
Bram Moolenaarfda97842019-05-07 22:25:27 +020092debug support.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000093
Bram Moolenaara0754902019-11-19 23:01:28 +010094For compiling gVim with IME support on far-east Windows, add IME=yes
Bram Moolenaar362e1a32006-03-06 23:29:24 +000095to the parameters you pass to Make_mvc.mak.
96
Bram Moolenaar362e1a32006-03-06 23:29:24 +000097See the specific files for comments and options.
98
99These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100100Ron Aaron; they have been tested. But several things changed after that...
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000101
102
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100103Targeting Windows XP with MSVC 2015 and later *new-msvc-windows-xp*
Bram Moolenaar73f44392017-10-07 18:38:43 +0200104---------------------------------------------
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200105
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100106(The support for pre-Vista was removed in patch 9.0.0496. If you want to
K.Takata27b53be2022-09-18 12:25:49 +0100107target Windows XP, use the source code before that.)
108
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200109Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
110so that it targets Windows 6.0 (Vista) by default. In order to override
111this, the target Windows version number needs to be passed to LINK like
112follows:
113 LINK ... /subsystem:console,5.01
114
115Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200116Use lines like follows to target Windows XP x86 (assuming using Visual C++
1172012 under 64-bit Windows):
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200118 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200119 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
120 set LIB=%WinSdk71%\Lib;%LIB%
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200121 set CL=/D_USING_V110_SDK71_
122 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
123
Bram Moolenaar73f44392017-10-07 18:38:43 +0200124To target Windows XP x64 instead of x86, you need to change the settings of
125LIB and SUBSYSTEM_VER:
126 ...
127 set LIB=%WinSdk71%\Lib\x64;%LIB%
128 ...
129 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.02
130
131If you use Visual C++ 2015 (either Express or Community Edition), executing
132msvc2015.bat will set them automatically. For x86 builds run this without
133options:
134 msvc2015
135For x64 builds run this with the "x86_amd64" option:
136 msvc2015 x86_amd64
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200137This enables x86_x64 cross compiler. This works on any editions including
138Express edition.
139If you use Community (or Professional) edition, you can enable the x64 native
140compiler by using the "x64" option:
141 msvc2015 x64
Bram Moolenaar73f44392017-10-07 18:38:43 +0200142
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200143The following Visual C++ team blog can serve as a reference page:
144 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
145
146
Bram Moolenaar577fadf2019-04-04 20:32:24 +0200147Cross compile support for Windows on ARM64
148------------------------------------------
149
150This depends on VS2017 with the optional ARM64 compiler and SDK
151installed. Use "vcvarsall.bat x64_arm64" as the build environment.
152
153The ARM64 support was provided by Leendert van Doorn.
154
155
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200156OLDER VERSIONS
157
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100158The minimal supported version is Windows 7. Building with compilers
159older than 2015 most likely doesn't work. Since MSVC 2015 can be obtained for
160free there is no point in supporting older versions.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200161
K.Takata76687d22022-01-25 10:31:37 +0000162If you need the executable to run on Windows 98 or ME, use the 2005 one
Bram Moolenaar4cbdcbd2022-09-20 21:23:12 +0100163|msvc-2005-express|, and use the source code before 8.0.0029. See the
164src/INSTALLpc.txt file for instructions.
Bram Moolenaara0754902019-11-19 23:01:28 +0100165
Bram Moolenaara0754902019-11-19 23:01:28 +0100166
Bram Moolenaar304925e2018-06-30 16:27:02 +02001672. MSYS2 with MinGW
168===================
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200169
Bram Moolenaar304925e2018-06-30 16:27:02 +02001702.1. Setup the basic msys2 environment
171
172Go to the official page of MSYS2: https://www.msys2.org
173Download an installer:
174
175* msys2-x86_64-YYYYMMDD.exe for 64-bit Windows
176 (Even if you want to build 32-bit Vim)
177* msys2-i686-YYYYMMDD.exe for 32-bit Windows
178
179Execute the installer and follow the instructions to update basic packages.
180At the end keep the checkbox checked to run msys2 now. If needed, you can
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200181open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200182
183Execute:
184 $ pacman -Syu
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200185
Bram Moolenaar2346a632021-06-13 19:02:49 +0200186And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start
187Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit").
Bram Moolenaar304925e2018-06-30 16:27:02 +0200188Then execute:
189 $ pacman -Su
190
191If pacman complains that `catgets` and `libcatgets` conflict with another
192package, select `y` to remove them.
193
194
1952.2. Install additional packages for building Vim
196
197The following package groups are required for building Vim:
198
199* base-devel
200* mingw-w64-i686-toolchain (for building 32-bit Vim)
201* mingw-w64-x86_64-toolchain (for building 64-bit Vim)
202
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200203(These groups also include some useful packages which are not used by Vim.)
Bram Moolenaar304925e2018-06-30 16:27:02 +0200204Use the following command to install them:
205
206 $ pacman -S base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain
207
208Or you can use the `pacboy` command to avoid long package names:
209
210 $ pacboy -S base-devel: toolchain:m
211
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200212The suffix ":" means that it disables the package name translation.
213The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix
214to install only i686, and the ":x" suffix to install only x86_64.
Bram Moolenaar304925e2018-06-30 16:27:02 +0200215(See `pacboy help` for the help.)
216
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200217See also the pacman page in ArchWiki for the general usage of pacman:
218 https://wiki.archlinux.org/index.php/pacman
219
220MSYS2 has its own git package, and you can also install it via pacman:
221
222 $ pacman -S git
223
Bram Moolenaar304925e2018-06-30 16:27:02 +0200224
2252.3. Keep the build environment up-to-date
226
227After you have installed the build environment, you may want to keep it
228up-to-date (E.g. always use the latest GCC).
229In that case, you just need to execute the command:
230 $ pacman -Syu
231
232
Bram Moolenaara87f8fd2018-09-18 22:58:41 +02002332.4. Build Vim
Bram Moolenaar304925e2018-06-30 16:27:02 +0200234
235Select one of the following icon from the Start Menu:
236
237* MSYS2 MinGW 32-bit (To build 32-bit versions of Vim)
238* MSYS2 MinGW 64-bit (To build 64-bit versions of Vim)
239
240Go to the source directory of Vim, then execute the make command. E.g.:
241
242 make -f Make_ming.mak
243 make -f Make_ming.mak GUI=no
244 make -f Make_ming.mak GUI=no DEBUG=yes
245
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200246NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows
Bram Moolenaar304925e2018-06-30 16:27:02 +0200247console for that. You need to set $PATH to be able to build there, e.g.:
248
249 set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH%
250
Bram Moolenaara87f8fd2018-09-18 22:58:41 +0200251This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat:
Bram Moolenaar304925e2018-06-30 16:27:02 +0200252
253 set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
254
255If you have msys64 in another location you will need to adjust the paths for
256that.
257
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +01002582.5. Build Vim with Clang
259
260The following package group is required for building Vim with Clang:
261
262* mingw-w64-clang-x86_64-clang
263
264Use the following command to install it:
265
266 $ pacman -S mingw-w64-clang-x86_64-clang
267
268Go to the source directory of Vim, then execute the make command. E.g.:
269
270 CC=clang
271 CXX=clang++
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100272 # To build Vim without the GUI support
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100273 make -f Make_ming.mak GUI=no
Yegappan Lakshmanancf65d882022-06-15 18:31:45 +0100274 # To build Vim with the GUI support
275 make -f Make_ming.mak GUI=yes XPM=no
Yegappan Lakshmanan1630bd92022-06-14 12:30:25 +0100276
277To build Vim with the address sanitizer (ASAN), execute the following command:
278
279 CC=clang
280 CXX=clang++
281 make -f Make_ming.mak DEBUG=yes ASAN=yes
Bram Moolenaar304925e2018-06-30 16:27:02 +0200282
2833. MinGW
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000284========
285
Bram Moolenaara0754902019-11-19 23:01:28 +0100286(written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000287
Bram Moolenaara0754902019-11-19 23:01:28 +0100288This is about how to produce a Win32 binary of gvim with MinGW from the normal
289Command Prompt window. (To use MSYS2 console, see above.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000290
Bram Moolenaara0754902019-11-19 23:01:28 +0100291First, you need to get the 'MinGW-w64' compiler, which is free for the
292download at:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100293
294 http://mingw-w64.sourceforge.net/
295
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100296Or a compiler provided on msys2:
297
Bram Moolenaara0754902019-11-19 23:01:28 +0100298 https://www.msys2.org/
299
300The original 'mingw32' compiler is outdated, and may no longer work:
301
302 http://www.mingw.org/
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100303
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000304Once you have downloaded the compiler binaries, unpack them on your hard disk
Bram Moolenaara0754902019-11-19 23:01:28 +0100305somewhere, and put them on your PATH. Go to the Control Panel, (Performance
306and Maintenance), System, Advanced, and edit the environment from there. If
Bram Moolenaar23515b42020-11-29 14:36:24 +0100307you use the standalone MinGW-w64 compiler, the path may depend on your
Bram Moolenaara0754902019-11-19 23:01:28 +0100308installation. If you use msys2 compilers, set your installed paths (normally
309one of the following):
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100310
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100311 C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds)
312 C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds)
313 C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000314
Bram Moolenaara0754902019-11-19 23:01:28 +0100315Test if gcc is on your path. From a Command Prompt window:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000316
317 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100318 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000319
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100320 C:\> mingw32-make --version
321 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000322
323Now you are ready to rock 'n' roll. Unpack the vim sources (look on
324www.vim.org for exactly which version of the vim files you need).
325
326Change directory to 'vim\src':
327
328 C:\> cd vim\src
329 C:\VIM\SRC>
330
331and you type:
332
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100333 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000334
335After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
336directory.
337
338You should not need to do *any* editing of any files to get vim compiled this
339way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100340is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100341
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100342 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000343
344If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
345(also free!) and compress the file (typical compression is 50%). UPX can be
346found at
347 http://www.upx.org/
348
Bram Moolenaar91856272012-02-29 16:56:39 +0100349As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
350built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
351at:
352 http://www.matcode.com/mpress.htm
353
354
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000355ADDITION: NLS support with MinGW
356
357(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
358
359If you want National Language Support, read the file src/po/README_mingw.txt.
360You need to uncomment lines in Make_ming.mak to have NLS defined.
361
362
Bram Moolenaar304925e2018-06-30 16:27:02 +02003634. Cygwin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000364=========
365
366Use Make_cyg.mak with Cygwin's GCC. See
367 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
368
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100369With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000370Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100371running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000372with the other makefiles).
373
374
Bram Moolenaareae1b912019-05-09 15:12:55 +02003755. Cross compiling for Win32 from a Linux machine
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000376=================================================
377
378[Update of 1) needs to be verified]
379
380If you like, you can compile the 'mingw' Win32 version from the comfort of
381your Linux (or other unix) box. To do this, you need to follow a few steps:
382 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100383 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000384 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000385 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100386 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
387 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
388 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100389 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000390 4) make -f Make_ming.mak gvim.exe
391
392Now you have created the Windows binary from your Linux box! Have fun...
393
394
Bram Moolenaareae1b912019-05-09 15:12:55 +02003956. Building with Python support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000396===============================
397
Bram Moolenaara0754902019-11-19 23:01:28 +0100398For building with MSVC the "Windows Installer" from www.python.org works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000399
Bram Moolenaar30a89472016-01-10 14:35:58 +0100400When building, you need to set the following variables at least:
401
402 PYTHON: Where Python is installed. E.g. C:\Python27
403 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
404 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
405
406E.g. When using MSVC (as one line):
407
408 nmake -f Make_mvc.mak
409 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
410
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100411When using MinGW and link with the official Python (as one line):
412
413 mingw32-make -f Make_ming.mak
414 PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
415
416When using msys2 and link with Python2 bundled with msys2 (as one line):
417
418 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
419 PYTHON_HOME=c:/msys64/mingw64
420 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
421 DYNAMIC_PYTHON=yes
422 PYTHON_VER=27
423 DYNAMIC_PYTHON_DLL=libpython2.7.dll
424 STATIC_STDCPLUS=yes
425
426(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
427(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
428libstdc++-6.dll.)
429
430
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200431(rest written by Ron Aaron: <ronaharon@yahoo.com>)
432
433Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000434 http://www.ActiveState.com/Products/ActivePython/
435
436After installing the ActivePython, you will have to create a 'mingw32'
437'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100438 cd $PYTHON/libs
439 pexports python20.dll > python20.def
440 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000441
442Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
443the root of the Python installation (C:\Python20, for example). If you are
444cross-compiling on Linux with the mingw32 setup, you need to also convert all
445the 'Include' files to *unix* line-endings. This bash command will do it
446easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100447 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000448
449Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100450 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000451
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100452You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000453
454
Bram Moolenaareae1b912019-05-09 15:12:55 +02004557. Building with Python3 support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100456================================
457
Bram Moolenaara0754902019-11-19 23:01:28 +0100458For building with MSVC the "Windows Installer" from www.python.org works fine.
459Python 3.6 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100460
461When building, you need to set the following variables at least:
462
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100463 PYTHON3: Where Python3 is installed. E.g. C:\Python36
Bram Moolenaar30a89472016-01-10 14:35:58 +0100464 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100465 PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100466
467E.g. When using MSVC (as one line):
468
469 nmake -f Make_mvc.mak
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100470 PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
471
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100472When using MinGW and link with the official Python3 (as one line):
473
474 mingw32-make -f Make_ming.mak
475 PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100476
477When using msys2 and link with Python3 bundled with msys2 (as one line):
478
479 mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
480 PYTHON3_HOME=c:/msys64/mingw64
481 PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
482 DYNAMIC_PYTHON3=yes
483 PYTHON3_VER=36
484 DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
485 STATIC_STDCPLUS=yes
486
487(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100488(STATIC_STDCPLUS is optional. Set to yes if you don't want to require
489libstdc++-6.dll.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100490
491
Bram Moolenaareae1b912019-05-09 15:12:55 +02004928. Building with Racket or MzScheme support
Bram Moolenaara0754902019-11-19 23:01:28 +0100493===========================================
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100494
Bram Moolenaar18cfa942017-10-08 17:58:44 +02004951) Building with Racket support (newest)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100496
497MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200498support can be built with either MSVC or MinGW (or Cygwin).
499Get it from https://download.racket-lang.org/
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100500
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200501Copy lib/libracket{version}.dll to your Windows system directory. The system
502directory depends on your Windows bitness and Vim bitness:
503 32-bit Vim on 32-bit Windows: C:\Windows\System32
504 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
505 64-bit Vim on 64-bit Windows: C:\Windows\System32
506
507For building you need to set the following variables:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100508
509 MZSCHEME: Where Racket is installed.
510 E.g. C:\Program Files (x86)\Racket
511 DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200512 MZSCHEME_VER: Racket DLL version which is used for the file name.
Bram Moolenaar73f44392017-10-07 18:38:43 +0200513 See below for a list of MZSCHEME_VER.
Bram Moolenaarf55e4c82017-08-01 20:44:53 +0200514 The DLL can be found under the lib directory. E.g.
515 C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100516 MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
517 runtime. Default: $(MZSCHEME)\collects
518 User can override this with the PLTCOLLECTS environment
519 variable.
520
Bram Moolenaar73f44392017-10-07 18:38:43 +0200521List of MZSCHEME_VER (incomplete):
522
523 Racket ver. | MZSCHEME_VER
524 ==========================
525 6.3 | 3m_9z0ds0
526 6.6 | 3m_a0solc
527 6.8 | 3m_a1zjsw
528 6.10 | 3m_a36fs8
529
530
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100531E.g. When using MSVC (as one line):
532
533 nmake -f Make_mvc.mak
534 MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes
535 MZSCHEME_VER=3m_9z0ds0
536
537Or when using MinGW (as one line):
538
539 mingw32-make -f Make_ming.mak
540 MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes
541 MZSCHEME_VER=3m_9z0ds0
542
543 Spaces should be escaped with '\'.
544
545
Bram Moolenaar18cfa942017-10-08 17:58:44 +02005462) Building with MzScheme support (older)
547
548(written by Sergey Khorev <sergey.khorev@gmail.com>)
549
550Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
551be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
552above (including 299 and 30x series).
553
554The MSVC build is quite straightforward. Simply invoke (in one line)
555nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
556 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
557where <MzScheme-version> is the last seven characters from MzScheme dll name
558(libmzschXXXXXXX.dll).
559If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
560DLL's, but will load them in runtime on demand.
561
562Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
563account that <Path-to-MzScheme> should contain slashes rather than backslashes
564(e.g. d:/Develop/MzScheme)
565
566"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
567explicitly) on MinGW and Cygwin requires additional step.
568
569libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
570%WINDOWS%\System32 to other location (either build directory, some temporary
571dir or even MzScheme home).
572
573Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
574make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
575 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
576
577After a successful build, these dlls can be freely removed, leaving them in
578%WINDOWS%\System32 only.
579
580
581
Bram Moolenaareae1b912019-05-09 15:12:55 +02005829. Building with Lua support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100583============================
584
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100585Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin).
586You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/
587This also applies to when you get a Vim executable and don't build yourself,
588do the part up to "Build".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100589
5901) Download and install LuaBinaries
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100591
Bram Moolenaar30a89472016-01-10 14:35:58 +0100592Go to the Download page of LuaBinaries:
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100593 http://luabinaries.sourceforge.net/download.html
Bram Moolenaar30a89472016-01-10 14:35:58 +0100594
595Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100596lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and
Bram Moolenaar30a89472016-01-10 14:35:58 +0100597MinGW.
598
599Unpack it to a working directory. E.g. C:\projects\lua53.
600Lua's header files will be installed under the include directory.
601
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100602Copy luaXY.dll to your Windows system directory. The system directory depends
603on your Windows bitness and Vim bitness:
604 32-bit Vim on 32-bit Windows: C:\Windows\System32
605 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64
606 64-bit Vim on 64-bit Windows: C:\Windows\System32
607
608Or another option is copying luaXY.dll to the directory where gvim.exe
609(or vim.exe) is.
610
Bram Moolenaar30a89472016-01-10 14:35:58 +0100611
6122) Build
Bram Moolenaar30a89472016-01-10 14:35:58 +0100613
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100614You need to set LUA, DYNAMIC_LUA and LUA_VER.
615
616 LUA: Where Lua's header files are installed. E.g. C:\projects\lua53.
617 DYNAMIC_LUA: Whether dynamic linking is used. Set to yes.
618 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100619
620E.g. When using MSVC (as one line):
621
622 nmake -f Make_mvc.mak
623 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
624
625Or when using MinGW (as one line):
626
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200627 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100628 LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
Bram Moolenaar30a89472016-01-10 14:35:58 +0100629
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100630
631Or when using Cygwin (as one line) (untested):
Bram Moolenaar30a89472016-01-10 14:35:58 +0100632
633 make -f Make_cyg.mak
634 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
635
636
Bram Moolenaareae1b912019-05-09 15:12:55 +020063710. Building with Perl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100638==============================
639
640Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
641You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
642
643 http://www.activestate.com/activeperl
644 http://strawberryperl.com/
645
646When building, you need to set the following variables:
647
648 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
649 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
650 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
651
652E.g. When using MSVC (as one line):
653
654 nmake -f Make_mvc.mak
655 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
656
657Or when using MinGW (as one line):
658
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200659 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100660 PERL=C:/Perl DYNAMIC_PERL=yes PERL_VER=522
Bram Moolenaar30a89472016-01-10 14:35:58 +0100661
662
Bram Moolenaareae1b912019-05-09 15:12:55 +020066311. Building with Ruby support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100664==============================
665
666Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
667Ruby doesn't provide the official Windows binaries. The most widely used
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200668Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100669
670 http://rubyinstaller.org/
671
672If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
673you need some tricks described below.
674(Another binary distribution is ActiveScriptRuby:
675 http://www.artonx.org/data/asr/)
676
677When building, you need to set the following variables at least:
678
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200679 RUBY: Where ruby is installed. E.g. C:\Ruby24
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200680 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200681 RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X.
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200682 RUBY_API_VER_LONG: Ruby API version in a long format.
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200683 E.g. 2.4.0 for Ruby 2.4.X.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100684
685Ruby version vs. Ruby API version:
686
687 Ruby ver. | Ruby API ver.
688 =========================
689 1.8.X | 1.8
690 1.9.[1-3] | 1.9.1
691 2.0.0 | 2.0.0
692 2.X.Y | 2.X.0
693
694(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
695
696
697A) Using MSVC
698
699If you want to link with ruby, normally you must use the same compiler as
700which was used to build the ruby binary. RubyInstaller is built with MinGW,
701so normally you cannot use MSVC for building Vim if you want to link with
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200702RubyInstaller. If you use a different compiler, there are mainly two problems:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100703config.h and Ruby's DLL name. Here are the steps for working around them:
704
705 1) Download and Install RubyInstaller.
706 You can install RubyInstaller with the default options and directory.
707 E.g.:
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200708 C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100709
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200710 Ruby 2.4.X is used in this example.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100711
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200712 2) Download Ruby 2.4.X's source code and generate config.h:
Bram Moolenaar30a89472016-01-10 14:35:58 +0100713
714 cd C:\projects
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200715 git clone https://github.com/ruby/ruby.git -b ruby_2_4
Bram Moolenaar30a89472016-01-10 14:35:58 +0100716 cd ruby
717 win32\configure.bat
718 nmake .config.h.time
719
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200720 Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100721 There is no need to build whole Ruby, just config.h is needed.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100722 If you use 32-bit MSVC 2015, the config.h is generated in the
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200723 .ext\include\i386-mswin32_140 directory.
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100724 If you use 64-bit MSVC 2015, the config.h is generated in the
725 .ext\include\x64-mswin64_140 directory.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100726
727 3) Install the generated config.h.
728
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100729 For 32-bit version:
730
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100731 xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100732
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100733 For 64-bit version:
734
735 xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
736
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200737 Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
738 You may need to close the console and reopen it to pick up the new $PATH.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100739
740 4) Build Vim. Note that you need to adjust some variables (as one line):
741
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100742 For 32-bit version:
743
Bram Moolenaar30a89472016-01-10 14:35:58 +0100744 nmake -f Make_mvc.mak
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200745 RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
Bram Moolenaar30a89472016-01-10 14:35:58 +0100746 RUBY_MSVCRT_NAME=msvcrt
K.Takata27b53be2022-09-18 12:25:49 +0100747 WINVER=0x601
Bram Moolenaar30a89472016-01-10 14:35:58 +0100748
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100749 For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
750
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200751 If you set WINVER explicitly, it must be set to >=0x500, when building
K.Takata27b53be2022-09-18 12:25:49 +0100752 with Ruby 2.1 or later. (Default is 0x601.)
Bram Moolenaar30a89472016-01-10 14:35:58 +0100753 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
754 which is used for the Ruby's DLL name.
755
756B) Using MinGW
757
758Using MinGW is easier than using MSVC when linking with RubyInstaller.
759After you install RubyInstaller, just type this (as one line):
760
761 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100762 RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
K.Takata27b53be2022-09-18 12:25:49 +0100763 WINVER=0x601
Bram Moolenaar30a89472016-01-10 14:35:58 +0100764
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100765For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200766If you set WINVER explicitly, it must be set to >=0x500, when building with
K.Takata27b53be2022-09-18 12:25:49 +0100767Ruby 2.1 or later. (Default is 0x601.)
Bram Moolenaar02cfac82016-04-21 14:34:58 +0200768
Bram Moolenaar30a89472016-01-10 14:35:58 +0100769
770
Bram Moolenaareae1b912019-05-09 15:12:55 +020077112. Building with Tcl support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100772=============================
773
774Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
775You can use binaries from ActiveState (ActiveTcl).
776
777 http://www.activestate.com/activetcl
778
Bram Moolenaarba7e1862019-01-09 23:02:43 +0100779Alternatively, you can use the binaries provided by IronTcl from
780
781 https://www.irontcl.com/
782
783They might lack behind the latest version a bit, but should provide 64bit
784and 32bit versions even if ActiveTcl does not provide them anymore.
785
786For building with MSVC 2015 use version 8.6.6 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +0100787When building, you need to set the following variables:
788
789 TCL: Where tcl is installed. E.g. C:\Tcl86
790 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
791 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
792 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
793
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200794Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll,
795but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting
796the TCL_DLL variable:
797 TCL_DLL=tcl86t.dll
798
Bram Moolenaar30a89472016-01-10 14:35:58 +0100799E.g. When using MSVC (as one line):
800
801 nmake -f Make_mvc.mak
802 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
803
804Or when using MinGW (as one line):
805
Bram Moolenaar18cfa942017-10-08 17:58:44 +0200806 mingw32-make -f Make_ming.mak
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100807 TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
Bram Moolenaar30a89472016-01-10 14:35:58 +0100808
809
Bram Moolenaar8024f932020-01-14 19:29:13 +010081013. Building with DirectX (DirectWrite) support
Bram Moolenaar7f88b652017-12-14 13:15:19 +0100811===============================================
812
813Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
814This requires dwrite_2.h and some other header files which come with Windows
815SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
816This also requires MBYTE=yes which is enabled by default.
817
818A) Using MSVC
819
820If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
821You just need to specify DIRECTX=yes:
822
823 nmake -f Make_mvc.mak DIRECTX=yes
824
825If you use MSVC 2012 or earlier, the required header files are not available
826by default. However, you can use the header files from newer SDKs with older
827compilers. E.g.:
828
829 set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
830 nmake -f Make_mvc.mak DIRECTX=yes
831
832If you don't need color emoji support, only dwrite.h is required. You can use
833older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
834
835 nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
836
837B) Using MinGW-w64
838
839Just set DIRECTX to yes:
840
841 mingw32-make -f Make_ming.mak DIRECTX=yes
842
843
K.Takatad8f86292022-03-07 15:16:15 +000084414. Building with libsodium support
845===================================
846
847For better encryption support, you can build Vim with libsodium.
848
849A) Using MSVC
850
851You can download the latest libsodium library from here:
852 https://download.libsodium.org/libsodium/releases/
853
854At this moment, libsodium-1.0.18-stable-msvc.zip is the latest package.
855Unpack it to anywhere you like, and specify the path to the SODIUM option:
856
857 nmake -f Make_mvc.mak SODIUM=C:/path/to/libsodium
858 (libsodium.dll will be used as the libsodium DLL name.)
859
860B) Using MinGW
861
862If you use msys2, you can install the libsodium package by pacman (or pacboy):
863
864 $ pacman -S mingw-w64-x86_64-libsodium # for 64-bit Vim
865 $ pacman -S mingw-w64-i686-libsodium # for 32-bit Vim
866 $ pacboy -S libsodium:m # for both 32-bit and 64-bit Vim
867
868Then set SODIUM to yes:
869
870 mingw32-make -f Make_ming.mak SODIUM=yes
871 (libsodium-23.dll will be used as the libsodium DLL name.)
872
873Or you can set the path to libsodium explicitly:
874
875 mingw32-make -f Make_ming.mak SODIUM=C:/path/to/libsodium
876 (libsodium.dll will be used as the libsodium DLL name.)
877
878
87915. Windows 3.1x
Bram Moolenaar30a89472016-01-10 14:35:58 +0100880================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000881
Bram Moolenaar6e722e22016-02-26 19:58:58 +0100882The Windows 3.1x support was removed in patch 7.4.1364.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000883
884
K.Takatad8f86292022-03-07 15:16:15 +000088516. MS-DOS
Bram Moolenaar30a89472016-01-10 14:35:58 +0100886==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100888The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
889work on MS-DOS because of the limited amount of memory available.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200890
891
K.Takatad8f86292022-03-07 15:16:15 +000089217. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200893==========================================
894
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100895[provided by Michael Soyka, updated by Ken Takata]
Bram Moolenaar734d9982011-07-15 13:52:04 +0200896
897After you've built the Vim binaries as described above, you're ready to
898install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100899using Git, Mercurial or by downloading them as a unix tar file, you must
Bram Moolenaar8024f932020-01-14 19:29:13 +0100900first create a "vim82" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200901zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100902correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200903
Bram Moolenaar8024f932020-01-14 19:29:13 +0100904 A. Create a Vim "runtime" subdirectory named "vim82"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200905 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100906 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200907 Otherwise, continue reading.
908
909 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaar8024f932020-01-14 19:29:13 +0100910 directories and create a new subdirectory named "vim82".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100911
Bram Moolenaar8024f932020-01-14 19:29:13 +0100912 Copy the "runtime" files into "vim82":
913 copy runtime\* vim82
Bram Moolenaarade0d392020-01-21 22:33:58 +0100914 xcopy /s runtime\* vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200915
Bram Moolenaar8024f932020-01-14 19:29:13 +0100916 B. Copy the new binaries into the "vim82" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200917 ----------------------------------------------------
918 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaar8024f932020-01-14 19:29:13 +0100919 new binaries you created above into "vim82":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200920
Bram Moolenaar8024f932020-01-14 19:29:13 +0100921 copy src\*.exe vim82
922 copy src\tee\tee.exe vim82
923 copy src\xxd\xxd.exe vim82
Bram Moolenaar734d9982011-07-15 13:52:04 +0200924
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100925 To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit
Bram Moolenaar8024f932020-01-14 19:29:13 +0100926 versions of gvimext.dll. They should be copied to "vim82\GvimExt32" and
927 "vim82\GvimExt64" respectively.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100928 First, build the 32-bit version, then:
929
Bram Moolenaar8024f932020-01-14 19:29:13 +0100930 mkdir vim82\GvimExt32
931 copy src\GvimExt\gvimext.dll vim82\GvimExt32
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100932
933 Next, clean the 32-bit version and build the 64-bit version, then:
934
Bram Moolenaar8024f932020-01-14 19:29:13 +0100935 mkdir vim82\GvimExt64
936 copy src\GvimExt\gvimext.dll vim82\GvimExt64
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100937
Bram Moolenaar8024f932020-01-14 19:29:13 +0100938 C. Copy gettext and iconv DLLs into the "vim82" directory
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100939 ----------------------------------------------------------
940 Get gettext and iconv DLLs from the following site:
941 https://github.com/mlocati/gettext-iconv-windows/releases
942 Both 64- and 32-bit versions are needed.
943 Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract
944 DLLs and place them as follows:
945
Bram Moolenaar8024f932020-01-14 19:29:13 +0100946 vim82\
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100947 | libintl-8.dll
948 | libiconv-2.dll
949 | libgcc_s_sjlj-1.dll (only for 32-bit)
950 |
951 + GvimExt32\
952 | libintl-8.dll
953 | libiconv-2.dll
954 | libgcc_s_sjlj-1.dll
955 |
956 ` GvimExt64\
957 libintl-8.dll
958 libiconv-2.dll
959
Bram Moolenaar8024f932020-01-14 19:29:13 +0100960 The DLLs in the "vim82" should be the same bitness with the (g)vim.exe.
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100961
Bram Moolenaar8024f932020-01-14 19:29:13 +0100962 D. Move the "vim82" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200963 ---------------------------------------------------------------------
Bram Moolenaar8024f932020-01-14 19:29:13 +0100964 Move the "vim82" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100965 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaar8024f932020-01-14 19:29:13 +0100966 If you already have a "vim82" subdirectory in "vim", delete it first
Bram Moolenaar30e8e732019-09-27 13:08:36 +0200967 by running its uninstall.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200968
Bram Moolenaar3bf8c3c2017-11-05 16:04:43 +0100969 E. Install Vim
Bram Moolenaar734d9982011-07-15 13:52:04 +0200970 ---------------
Bram Moolenaar8024f932020-01-14 19:29:13 +0100971 "cd" to your Vim installation subdirectory "vim\vim82" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +0200972 "install.exe" program. It will ask you a number of questions about
973 how you would like to have your Vim setup. Among these are:
974 - You can tell it to write a "_vimrc" file with your preferences in the
975 parent directory.
976 - It can also install an "Edit with Vim" entry in the Windows Explorer
977 popup menu.
978 - You can have it create batch files, so that you can run Vim from the
979 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100980 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200981 - Create entries for Vim on the desktop and in the Start menu.
982
983Happy Vimming!