Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 1 | INSTALLpc.txt - Installation of Vim on PC - Last Update: 2025 May 14 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | This file contains instructions for compiling Vim. If you already have an |
| 4 | executable version of Vim, you don't need this. |
| 5 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 6 | You can find the latest here: https://github.com/vim/vim-win32-installer |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 7 | This page also has links to install support for interfaces such as Perl, |
| 8 | Python, Lua, etc. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | |
| 10 | The file "feature.h" can be edited to match your preferences. You can skip |
| 11 | this, then you will get the default behavior as is documented, which should |
| 12 | be fine for most people. |
| 13 | |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 14 | This document assumes that you are building Vim for Win32 or later (Windows |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 15 | 7/8/10/11). There are also instructions for pre-Vista and pre-XP systems, but |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 16 | they might no longer work. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 17 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 18 | The recommended way is to build a 32 bit Vim, also on 64 bit systems. You can |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 19 | build a 64 bit Vim if you like, the executable will be bigger and Vim won't be |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 20 | any faster, but you can edit files larger than 2 Gbyte. |
| 21 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 22 | |
| 23 | Contents: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 24 | 1. Microsoft Visual C++ |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 25 | 2. Using MSYS2 with MinGW |
| 26 | 3. Using MinGW |
| 27 | 4. Cygwin |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 28 | 5. Cross compiling for Win32 from a Linux machine |
| 29 | 6. Building with Python support |
| 30 | 7. Building with Python3 support |
| 31 | 8. Building with Racket or MzScheme support |
| 32 | 9. Building with Lua support |
| 33 | 10. Building with Perl support |
| 34 | 11. Building with Ruby support |
| 35 | 12. Building with Tcl support |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 36 | 13. Building with DirectX (DirectWrite) support |
K.Takata | d8f8629 | 2022-03-07 15:16:15 +0000 | [diff] [blame] | 37 | 14. Building with libsodium support |
| 38 | 15. Windows 3.1 |
| 39 | 16. MS-DOS |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 40 | |
K.Takata | d8f8629 | 2022-03-07 15:16:15 +0000 | [diff] [blame] | 41 | 17. Installing after building from sources |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 42 | |
| 43 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 44 | The currently recommended way (that means it has been verified to work) is |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 45 | using the "Visual Studio 2022 Community Edition" installation. This doesn't |
| 46 | include the SDK for older Windows versions (95 - XP), see "OLDER VERSIONS" |
| 47 | below for that. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 48 | |
| 49 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 50 | 1. Microsoft Visual C++ |
| 51 | ======================= |
| 52 | |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 53 | We do not provide download links, since Microsoft keeps changing them. You |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 54 | can search for "Visual Studio 2022 Community Edition", for example. You will |
| 55 | need to create a Microsoft account (it's free). You need to download the |
| 56 | "DVD", and execute the installer from it. |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 57 | |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 58 | When installing "Visual Studio 2022 Community Edition" or "Build Tools for |
| 59 | Visual Studio 2022" make sure to select "custom" and check all checkboxes |
| 60 | under "Universal Windows App Development Tools". Or whatever they are called |
| 61 | now. |
| 62 | |
| 63 | Note: Vim source code no longer supports Windows XP since Patch 9.0.0496. |
| 64 | Also, Visual Studio 2017 was the last version to support a Windows XP target. |
| 65 | If you still want to target Windows XP, you can check out an older version of |
| 66 | vim source code and install Visual Studio 2017 or 2015 - making sure to check |
| 67 | the checkbox for "Windows XP Support for C++". Additional build instructions |
| 68 | for Windows XP are provided below. |new-msvc-windows-xp| |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 69 | |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 70 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 71 | Visual Studio |
| 72 | ------------- |
| 73 | |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 74 | Building with Visual Studio (VS2015, VS2017, VS2019 and VS2022) is |
| 75 | straightforward. Older versions probably don't work. |
| 76 | |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 77 | Vim versions built with VS2015 and VS2017 are systematically tested and known |
| 78 | to work well on Windows versions 7, 8 and 8.1. |
| 79 | |
| 80 | Vim versions built with VS2015 and VS2017 are also known to work well on all |
| 81 | early versions of Windows 10. However, Vim versions built with VS2015 and |
| 82 | VS2017 may run into a known issue on the latest versions of Windows 10 and 11. |
| 83 | Building Vim with VS2019 or VS2022 resolves the issue. |
| 84 | |
| 85 | Vim versions built with VS2019 and VS2022 are systematically tested and |
| 86 | known to work on Windows versions 7, 8, 8.1, 10, 11 and all respective server |
| 87 | variants. |
| 88 | |
K.Takata | c3430cb | 2022-09-21 11:56:41 +0100 | [diff] [blame] | 89 | Visual Studio installed a batch file called vcvarsall.bat, which you must |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 90 | run to set up paths for nmake and MSVC. We provide a batch file |
dundargoc | c57b5bc | 2022-11-02 13:30:51 +0000 | [diff] [blame] | 91 | "msvc2015.bat" for this. You may need to edit it if you didn't install Visual |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 92 | Studio in the standard location. |
K.Takata | c3430cb | 2022-09-21 11:56:41 +0100 | [diff] [blame] | 93 | If you use VS2017 or later, you can use "msvc-latest.bat" (or "msvc2017.bat" |
| 94 | and 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 |
| 96 | Express, you must use "x86_amd64" instead of "x64" for targeting the x64 |
| 97 | platform. |
Bram Moolenaar | 97cc238 | 2012-10-03 21:46:54 +0200 | [diff] [blame] | 98 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 99 | To build Vim from the command line with MSVC, use Make_mvc.mak. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 100 | |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 101 | nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++ |
| 102 | nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++ |
| 103 | nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++ |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 104 | nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc. |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 105 | Perl, Python, etc. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 106 | |
| 107 | Make_mvc.mak allows a Vim to be built with various different features and |
Bram Moolenaar | fda9784 | 2019-05-07 22:25:27 +0200 | [diff] [blame] | 108 | debug support. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 109 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 110 | For compiling gVim with IME support on far-east Windows, add IME=yes |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 111 | to the parameters you pass to Make_mvc.mak. |
| 112 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 113 | See the specific files for comments and options. |
| 114 | |
| 115 | These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 116 | Ron Aaron; they have been tested. But several things changed after that... |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 117 | |
| 118 | |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 119 | Targeting Windows XP with MSVC 2015 or 2017 *new-msvc-windows-xp* |
| 120 | ------------------------------------------- |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 121 | |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 122 | (The support for pre-Vista was removed in patch 9.0.0496. If you want to |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 123 | target Windows XP, use the source code before that.) |
| 124 | |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 125 | Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE |
| 126 | so that it targets Windows 6.0 (Vista) by default. In order to override |
| 127 | this, the target Windows version number needs to be passed to LINK like |
| 128 | follows: |
| 129 | LINK ... /subsystem:console,5.01 |
| 130 | |
| 131 | Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version. |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 132 | Use lines like follows to target Windows XP x86 (assuming using Visual C++ |
| 133 | 2012 under 64-bit Windows): |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 134 | set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 135 | set INCLUDE=%WinSdk71%\Include;%INCLUDE% |
| 136 | set LIB=%WinSdk71%\Lib;%LIB% |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 137 | set CL=/D_USING_V110_SDK71_ |
| 138 | nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01 |
| 139 | |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 140 | To target Windows XP x64 instead of x86, you need to change the settings of |
| 141 | LIB 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 | |
| 147 | If you use Visual C++ 2015 (either Express or Community Edition), executing |
| 148 | msvc2015.bat will set them automatically. For x86 builds run this without |
| 149 | options: |
| 150 | msvc2015 |
| 151 | For x64 builds run this with the "x86_amd64" option: |
| 152 | msvc2015 x86_amd64 |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 153 | This enables x86_x64 cross compiler. This works on any editions including |
| 154 | Express edition. |
| 155 | If you use Community (or Professional) edition, you can enable the x64 native |
| 156 | compiler by using the "x64" option: |
| 157 | msvc2015 x64 |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 158 | |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 159 | The 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 Moolenaar | 577fadf | 2019-04-04 20:32:24 +0200 | [diff] [blame] | 163 | Cross compile support for Windows on ARM64 |
| 164 | ------------------------------------------ |
| 165 | |
| 166 | This depends on VS2017 with the optional ARM64 compiler and SDK |
| 167 | installed. Use "vcvarsall.bat x64_arm64" as the build environment. |
| 168 | |
| 169 | The ARM64 support was provided by Leendert van Doorn. |
| 170 | |
| 171 | |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 172 | OLDER VERSIONS |
| 173 | |
Christopher Plewright | 60908c4 | 2023-01-13 15:28:14 +0000 | [diff] [blame] | 174 | The minimal supported version is Windows 7. Building with compilers older than |
| 175 | 2015 most likely doesn't work. Since MSVC 2022 can be obtained for free there |
| 176 | is no point in supporting older versions. |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 177 | |
K.Takata | 76687d2 | 2022-01-25 10:31:37 +0000 | [diff] [blame] | 178 | If you need the executable to run on Windows 98 or ME, use the 2005 one |
Bram Moolenaar | 4cbdcbd | 2022-09-20 21:23:12 +0100 | [diff] [blame] | 179 | |msvc-2005-express|, and use the source code before 8.0.0029. See the |
| 180 | src/INSTALLpc.txt file for instructions. |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 181 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 182 | |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 183 | 2. MSYS2 with MinGW |
| 184 | =================== |
Bram Moolenaar | ce2f2e0 | 2014-08-22 18:12:57 +0200 | [diff] [blame] | 185 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 186 | 2.1 Buidling x86 32bit or 64bit versions. |
| 187 | |
| 188 | 2.1.1. Setup the basic msys2 environment |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 189 | |
| 190 | Go to the official page of MSYS2: https://www.msys2.org |
| 191 | Download an installer: |
| 192 | |
| 193 | * msys2-x86_64-YYYYMMDD.exe for 64-bit Windows |
| 194 | (Even if you want to build 32-bit Vim) |
| 195 | * msys2-i686-YYYYMMDD.exe for 32-bit Windows |
| 196 | |
| 197 | Execute the installer and follow the instructions to update basic packages. |
| 198 | At the end keep the checkbox checked to run msys2 now. If needed, you can |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 199 | open the window from the start menu, MSYS2 64 bit / MSYS2 MSYS. |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 200 | |
| 201 | Execute: |
| 202 | $ pacman -Syu |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 203 | |
Bram Moolenaar | 2346a63 | 2021-06-13 19:02:49 +0200 | [diff] [blame] | 204 | And restart MSYS2 console (select "MSYS2 MSYS 32-Bit" icon from the Start |
| 205 | Menu for building 32 bit Vim, otherwise select "MSYS2 MinGW 64-Bit"). |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 206 | Then execute: |
| 207 | $ pacman -Su |
| 208 | |
| 209 | If pacman complains that `catgets` and `libcatgets` conflict with another |
| 210 | package, select `y` to remove them. |
| 211 | |
| 212 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 213 | 2.1.2. Install additional packages for building Vim |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 214 | |
| 215 | The following package groups are required for building Vim: |
| 216 | |
| 217 | * base-devel |
| 218 | * mingw-w64-i686-toolchain (for building 32-bit Vim) |
| 219 | * mingw-w64-x86_64-toolchain (for building 64-bit Vim) |
Christian Brabandt | 177437c | 2023-09-17 16:36:33 +0200 | [diff] [blame] | 220 | * git (optional, to clone the repository) |
| 221 | * pactoys (optional for the pacboy command) |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 222 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 223 | (These groups also include some useful packages which are not used by Vim.) |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 224 | Use the following command to install them: |
| 225 | |
Christian Brabandt | 177437c | 2023-09-17 16:36:33 +0200 | [diff] [blame] | 226 | $ pacman -S base-devel mingw-w64-i686-toolchain \ |
| 227 | mingw-w64-x86_64-toolchain pactoys git |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 228 | |
| 229 | Or you can use the `pacboy` command to avoid long package names: |
| 230 | |
| 231 | $ pacboy -S base-devel: toolchain:m |
| 232 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 233 | The suffix ":" means that it disables the package name translation. |
| 234 | The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 235 | to install only i686, the ":x" suffix for x86_64 and ":a" for "aarch64". |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 236 | (See `pacboy help` for the help.) |
| 237 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 238 | See also the pacman page in ArchWiki for the general usage of pacman: |
| 239 | https://wiki.archlinux.org/index.php/pacman |
| 240 | |
| 241 | MSYS2 has its own git package, and you can also install it via pacman: |
| 242 | |
| 243 | $ pacman -S git |
| 244 | |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 245 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 246 | 2.1.3. Keep the build environment up-to-date |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 247 | |
| 248 | After you have installed the build environment, you may want to keep it |
| 249 | up-to-date (E.g. always use the latest GCC). |
| 250 | In that case, you just need to execute the command: |
| 251 | $ pacman -Syu |
| 252 | |
| 253 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 254 | 2.1.4. Build Vim |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 255 | |
| 256 | Select one of the following icon from the Start Menu: |
| 257 | |
| 258 | * MSYS2 MinGW 32-bit (To build 32-bit versions of Vim) |
| 259 | * MSYS2 MinGW 64-bit (To build 64-bit versions of Vim) |
| 260 | |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 261 | Before building look through notes for MinGW in part 3 below. |
| 262 | |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 263 | Go to the source directory of Vim, then execute the make command. E.g.: |
| 264 | |
| 265 | make -f Make_ming.mak |
| 266 | make -f Make_ming.mak GUI=no |
| 267 | make -f Make_ming.mak GUI=no DEBUG=yes |
| 268 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 269 | NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 270 | console for that. You need to set $PATH to be able to build there, e.g.: |
| 271 | |
| 272 | set PATH=c:\msys64\mingw32\bin;c:\msys64\usr\bin;%PATH% |
| 273 | |
Bram Moolenaar | a87f8fd | 2018-09-18 22:58:41 +0200 | [diff] [blame] | 274 | This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat: |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 275 | |
| 276 | set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH% |
| 277 | |
| 278 | If you have msys64 in another location you will need to adjust the paths for |
| 279 | that. |
| 280 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 281 | 2.1.5. Build Vim with Clang |
Yegappan Lakshmanan | 1630bd9 | 2022-06-14 12:30:25 +0100 | [diff] [blame] | 282 | |
| 283 | The following package group is required for building Vim with Clang: |
| 284 | |
| 285 | * mingw-w64-clang-x86_64-clang |
| 286 | |
| 287 | Use the following command to install it: |
| 288 | |
| 289 | $ pacman -S mingw-w64-clang-x86_64-clang |
| 290 | |
| 291 | Go to the source directory of Vim, then execute the make command. E.g.: |
| 292 | |
| 293 | CC=clang |
| 294 | CXX=clang++ |
Yegappan Lakshmanan | cf65d88 | 2022-06-15 18:31:45 +0100 | [diff] [blame] | 295 | # To build Vim without the GUI support |
Yegappan Lakshmanan | 1630bd9 | 2022-06-14 12:30:25 +0100 | [diff] [blame] | 296 | make -f Make_ming.mak GUI=no |
Yegappan Lakshmanan | cf65d88 | 2022-06-15 18:31:45 +0100 | [diff] [blame] | 297 | # To build Vim with the GUI support |
| 298 | make -f Make_ming.mak GUI=yes XPM=no |
Yegappan Lakshmanan | 1630bd9 | 2022-06-14 12:30:25 +0100 | [diff] [blame] | 299 | |
| 300 | To build Vim with the address sanitizer (ASAN), execute the following command: |
| 301 | |
| 302 | CC=clang |
| 303 | CXX=clang++ |
| 304 | make -f Make_ming.mak DEBUG=yes ASAN=yes |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 305 | |
Christian Brabandt | c952fd1 | 2025-05-14 20:14:30 +0200 | [diff] [blame] | 306 | 2.2 Buidling an Arch64 version of Vim |
| 307 | |
| 308 | 2.2.1. Setup the basic msys2 environment |
| 309 | |
| 310 | See also https://www.msys2.org/wiki/arm64/ |
| 311 | Go to the official page of MSYS2: https://www.msys2.org |
| 312 | |
| 313 | Download the self-extracting archive: |
| 314 | |
| 315 | * msys2-base-x86_64-latest.sfx.exe |
| 316 | |
| 317 | Execute the self-extracting archive into a folder of your choice. |
| 318 | In the extracted folder, run clangarm64.exe |
| 319 | This will open a MSYS2 terminal window for you. |
| 320 | |
| 321 | Execute: |
| 322 | $ pacman -Syu |
| 323 | |
| 324 | And restart MSYS2 console. Then execute: |
| 325 | $ pacman -Su |
| 326 | |
| 327 | |
| 328 | 2.2.2. Install additional packages for building Vim |
| 329 | |
| 330 | $ pacman -S mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-toolchain base-devel git |
| 331 | |
| 332 | Or you can use the `pacboy` command to avoid long package names: |
| 333 | |
| 334 | $ pacboy -S base-devel: toolchain:a |
| 335 | |
| 336 | The suffix ":" means that it disables the package name translation. |
| 337 | The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix |
| 338 | to install only i686, the ":x" suffix for x86_64 and ":a" for "aarch64". |
| 339 | (See `pacboy help` for the help.) |
| 340 | |
| 341 | See also the pacman page in ArchWiki for the general usage of pacman: |
| 342 | https://wiki.archlinux.org/index.php/pacman |
| 343 | |
| 344 | 2.2.3. Keep the build environment up-to-date |
| 345 | |
| 346 | After you have installed the build environment, you may want to keep it |
| 347 | up-to-date (E.g. always use the latest GCC). |
| 348 | In that case, you just need to execute the command: |
| 349 | $ pacman -Syu |
| 350 | |
| 351 | |
| 352 | 2.2.4. Build Vim |
| 353 | |
| 354 | Before building look through notes for MinGW in part 3 below. |
| 355 | |
| 356 | Go to the source directory of Vim, then execute the make command. E.g.: |
| 357 | |
| 358 | CC=clang |
| 359 | CXX=clang++ |
| 360 | make -f Make_ming.mak |
| 361 | make -f Make_ming.mak GUI=yes |
| 362 | make -f Make_ming.mak GUI=no DEBUG=yes |
| 363 | |
| 364 | NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows |
| 365 | console for that. |
| 366 | |
| 367 | To build Vim with the address sanitizer (ASAN), execute the following command: |
| 368 | |
| 369 | make -f Make_ming.mak DEBUG=yes ASAN=yes |
| 370 | |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 371 | 3. MinGW |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 372 | ======== |
| 373 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 374 | (written by Ron Aaron: <ronaharon@yahoo.com>, updated by Ken Takata, et al.) |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 375 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 376 | This is about how to produce a Win32 binary of gvim with MinGW from the normal |
| 377 | Command Prompt window. (To use MSYS2 console, see above.) |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 378 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 379 | First, you need to get the 'MinGW-w64' compiler, which is free for the |
| 380 | download at: |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 381 | |
| 382 | http://mingw-w64.sourceforge.net/ |
| 383 | |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 384 | Or a compiler provided on msys2: |
| 385 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 386 | https://www.msys2.org/ |
| 387 | |
| 388 | The original 'mingw32' compiler is outdated, and may no longer work: |
| 389 | |
| 390 | http://www.mingw.org/ |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 391 | |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 392 | Please note, newer versions of Windows (I believe starting with Win10) |
| 393 | offer support for UCRT C-library in addition to traditional MSVCRT. As result, |
| 394 | one may find 2 flavors of MinGW: one compiling against UCRT and another compiling |
| 395 | against MSVCRT. Currently VIM comes with libXpm.a compiled against MSVCRT, |
| 396 | so an attempt to build VIM against UCRT will fail with: |
| 397 | |
| 398 | undefined reference to __imp___iob_func |
| 399 | |
| 400 | In which case, if one does not need support for XPM, then argument XPM=no can be |
| 401 | added to make-command. If support is needed, then another flavor of MinGW must |
| 402 | be used. |
| 403 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 404 | Once you have downloaded the compiler binaries, unpack them on your hard disk |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 405 | somewhere, and put them on your PATH. Go to the Control Panel, (Performance |
| 406 | and Maintenance), System, Advanced, and edit the environment from there. If |
Bram Moolenaar | 23515b4 | 2020-11-29 14:36:24 +0100 | [diff] [blame] | 407 | you use the standalone MinGW-w64 compiler, the path may depend on your |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 408 | installation. If you use msys2 compilers, set your installed paths (normally |
| 409 | one of the following): |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 410 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 411 | C:\msys32\mingw32\bin (32-bit msys2, targeting 32-bit builds) |
| 412 | C:\msys64\mingw32\bin (64-bit msys2, targeting 32-bit builds) |
| 413 | C:\msys64\mingw64\bin (64-bit msys2, targeting 64-bit builds) |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 414 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 415 | Test if gcc is on your path. From a Command Prompt window: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 416 | |
| 417 | C:\> gcc --version |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 418 | gcc (GCC) 4.8.1 |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 419 | |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 420 | C:\> mingw32-make --version |
| 421 | GNU Make 3.82.90 (...etc...) |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 422 | |
| 423 | Now you are ready to rock 'n' roll. Unpack the vim sources (look on |
| 424 | www.vim.org for exactly which version of the vim files you need). |
| 425 | |
| 426 | Change directory to 'vim\src': |
| 427 | |
| 428 | C:\> cd vim\src |
| 429 | C:\VIM\SRC> |
| 430 | |
| 431 | and you type: |
| 432 | |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 433 | mingw32-make -f Make_ming.mak ARCH=x86-64 gvim.exe |
| 434 | |
| 435 | Note, ARCH is necessary if you don't have the sed command in your $PATH. Just |
| 436 | make sure that the correct value is used with ARCH. In the example above the |
Christian Brabandt | 0a3b9fb | 2024-12-27 15:51:09 +0100 | [diff] [blame] | 437 | value corresponds to 64-bit architecture. For 32-bit the value is "i686". |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 438 | |
| 439 | After churning for a while, you will end up with 'gvim.exe' in the 'vim\src' |
| 440 | directory. |
| 441 | |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 442 | If you also want to get xxd.exe, install.exe etc. then just remove "gvim.exe" |
| 443 | from the make-command. |
| 444 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 445 | You should not need to do *any* editing of any files to get vim compiled this |
| 446 | way. If, for some reason, you want the console-mode-only version of vim (this |
Bram Moolenaar | 5e3dae8 | 2010-03-02 16:19:40 +0100 | [diff] [blame] | 447 | is NOT recommended on Win32, especially on '95/'98!!!), you can use: |
Bram Moolenaar | d8e21d3 | 2010-01-06 21:16:31 +0100 | [diff] [blame] | 448 | |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 449 | mingw32-make -f Make_ming.mak GUI=no vim.exe |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 450 | |
| 451 | If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX' |
| 452 | (also free!) and compress the file (typical compression is 50%). UPX can be |
| 453 | found at |
| 454 | http://www.upx.org/ |
| 455 | |
Bram Moolenaar | 9185627 | 2012-02-29 16:56:39 +0100 | [diff] [blame] | 456 | As of 2011, UPX still does not support compressing 64-bit EXE's; if you have |
| 457 | built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found |
| 458 | at: |
| 459 | http://www.matcode.com/mpress.htm |
| 460 | |
| 461 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 462 | ADDITION: NLS support with MinGW |
| 463 | |
| 464 | (by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>) |
| 465 | |
| 466 | If you want National Language Support, read the file src/po/README_mingw.txt. |
| 467 | You need to uncomment lines in Make_ming.mak to have NLS defined. |
| 468 | |
| 469 | |
Bram Moolenaar | 304925e | 2018-06-30 16:27:02 +0200 | [diff] [blame] | 470 | 4. Cygwin |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 471 | ========= |
| 472 | |
| 473 | Use Make_cyg.mak with Cygwin's GCC. See |
| 474 | http://users.skynet.be/antoine.mechelynck/vim/compile.htm |
| 475 | |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 476 | With Cygnus gcc you should use the Unix Makefile instead (you need to get the |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 477 | Unix archive then). Then you get a Cygwin application (feels like Vim is |
Bram Moolenaar | 48f80c2 | 2010-02-24 15:08:27 +0100 | [diff] [blame] | 478 | running on Unix), while with Make_cyg.mak you get a Windows application (like |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 479 | with the other makefiles). |
| 480 | |
| 481 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 482 | 5. Cross compiling for Win32 from a Linux machine |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 483 | ================================================= |
| 484 | |
| 485 | [Update of 1) needs to be verified] |
| 486 | |
| 487 | If you like, you can compile the 'mingw' Win32 version from the comfort of |
| 488 | your Linux (or other unix) box. To do this, you need to follow a few steps: |
| 489 | 1) Install the mingw32 cross-compiler. See |
Bram Moolenaar | d8e21d3 | 2010-01-06 21:16:31 +0100 | [diff] [blame] | 490 | http://www.mingw.org/wiki/LinuxCrossMinGW |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 491 | http://www.libsdl.org/extras/win32/cross/README.txt |
Bram Moolenaar | a7241f5 | 2008-06-24 20:39:31 +0000 | [diff] [blame] | 492 | 2) Get and unpack both the Unix sources and the extra archive |
Bram Moolenaar | 4f7e821 | 2014-11-05 13:53:32 +0100 | [diff] [blame] | 493 | 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'. |
| 494 | Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you |
| 495 | wish. If your cross-compiler prefix differs from the predefined value, |
Bram Moolenaar | d8e21d3 | 2010-01-06 21:16:31 +0100 | [diff] [blame] | 496 | set 'CROSS_COMPILE' corresponding. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 497 | 4) make -f Make_ming.mak gvim.exe |
| 498 | |
| 499 | Now you have created the Windows binary from your Linux box! Have fun... |
| 500 | |
| 501 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 502 | 6. Building with Python support |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 503 | =============================== |
| 504 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 505 | For building with MSVC the "Windows Installer" from www.python.org works fine. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 506 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 507 | When building, you need to set the following variables at least: |
| 508 | |
| 509 | PYTHON: Where Python is installed. E.g. C:\Python27 |
| 510 | DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes. |
| 511 | PYTHON_VER: Python version. E.g. 27 for Python 2.7.X. |
| 512 | |
| 513 | E.g. When using MSVC (as one line): |
| 514 | |
| 515 | nmake -f Make_mvc.mak |
| 516 | PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 |
| 517 | |
Bram Moolenaar | ba7e186 | 2019-01-09 23:02:43 +0100 | [diff] [blame] | 518 | When using MinGW and link with the official Python (as one line): |
| 519 | |
| 520 | mingw32-make -f Make_ming.mak |
| 521 | PYTHON=C:/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 |
| 522 | |
| 523 | When using msys2 and link with Python2 bundled with msys2 (as one line): |
| 524 | |
| 525 | mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64 |
| 526 | PYTHON_HOME=c:/msys64/mingw64 |
| 527 | PYTHONINC=-Ic:/msys64/mingw64/include/python2.7 |
| 528 | DYNAMIC_PYTHON=yes |
| 529 | PYTHON_VER=27 |
| 530 | DYNAMIC_PYTHON_DLL=libpython2.7.dll |
| 531 | STATIC_STDCPLUS=yes |
| 532 | |
| 533 | (This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.) |
| 534 | (STATIC_STDCPLUS is optional. Set to yes if you don't want to require |
| 535 | libstdc++-6.dll.) |
| 536 | |
| 537 | |
Bram Moolenaar | 97cc238 | 2012-10-03 21:46:54 +0200 | [diff] [blame] | 538 | (rest written by Ron Aaron: <ronaharon@yahoo.com>) |
| 539 | |
| 540 | Building with the mingw32 compiler, and the ActiveState ActivePython: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 541 | http://www.ActiveState.com/Products/ActivePython/ |
| 542 | |
| 543 | After installing the ActivePython, you will have to create a 'mingw32' |
| 544 | 'libpython20.a' to link with: |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 545 | cd $PYTHON/libs |
| 546 | pexports python20.dll > python20.def |
| 547 | dlltool -d python20.def -l libpython20.a |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 548 | |
| 549 | Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to |
| 550 | the root of the Python installation (C:\Python20, for example). If you are |
| 551 | cross-compiling on Linux with the mingw32 setup, you need to also convert all |
| 552 | the 'Include' files to *unix* line-endings. This bash command will do it |
| 553 | easily: |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 554 | for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 555 | |
| 556 | Now just do: |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 557 | make -f Make_ming.mak gvim.exe |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 558 | |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 559 | You will end up with a Python-enabled, Win32 version. Enjoy! |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 560 | |
| 561 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 562 | 7. Building with Python3 support |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 563 | ================================ |
| 564 | |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 565 | For building with MSVC the "Windows Installer" from www.python.org works fine. |
| 566 | Python 3.6 is recommended. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 567 | |
| 568 | When building, you need to set the following variables at least: |
| 569 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 570 | PYTHON3: Where Python3 is installed. E.g. C:\Python36 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 571 | DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes. |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 572 | PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 573 | |
| 574 | E.g. When using MSVC (as one line): |
| 575 | |
| 576 | nmake -f Make_mvc.mak |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 577 | PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 |
| 578 | |
Bram Moolenaar | ba7e186 | 2019-01-09 23:02:43 +0100 | [diff] [blame] | 579 | When using MinGW and link with the official Python3 (as one line): |
| 580 | |
| 581 | mingw32-make -f Make_ming.mak |
| 582 | PYTHON3=C:/Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 583 | |
| 584 | When using msys2 and link with Python3 bundled with msys2 (as one line): |
| 585 | |
| 586 | mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64 |
| 587 | PYTHON3_HOME=c:/msys64/mingw64 |
| 588 | PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m |
| 589 | DYNAMIC_PYTHON3=yes |
| 590 | PYTHON3_VER=36 |
| 591 | DYNAMIC_PYTHON3_DLL=libpython3.6m.dll |
| 592 | STATIC_STDCPLUS=yes |
| 593 | |
| 594 | (This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.) |
Bram Moolenaar | ba7e186 | 2019-01-09 23:02:43 +0100 | [diff] [blame] | 595 | (STATIC_STDCPLUS is optional. Set to yes if you don't want to require |
| 596 | libstdc++-6.dll.) |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 597 | |
| 598 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 599 | 8. Building with Racket or MzScheme support |
Bram Moolenaar | a075490 | 2019-11-19 23:01:28 +0100 | [diff] [blame] | 600 | =========================================== |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 601 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 602 | 1) Building with Racket support (newest) |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 603 | |
| 604 | MzScheme and PLT Scheme names have been rebranded as Racket. Vim with Racket |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 605 | support can be built with either MSVC or MinGW (or Cygwin). |
| 606 | Get it from https://download.racket-lang.org/ |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 607 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 608 | Copy lib/libracket{version}.dll to your Windows system directory. The system |
| 609 | directory depends on your Windows bitness and Vim bitness: |
| 610 | 32-bit Vim on 32-bit Windows: C:\Windows\System32 |
| 611 | 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64 |
| 612 | 64-bit Vim on 64-bit Windows: C:\Windows\System32 |
| 613 | |
| 614 | For building you need to set the following variables: |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 615 | |
| 616 | MZSCHEME: Where Racket is installed. |
| 617 | E.g. C:\Program Files (x86)\Racket |
| 618 | DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes. |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 619 | MZSCHEME_VER: Racket DLL version which is used for the file name. |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 620 | See below for a list of MZSCHEME_VER. |
Bram Moolenaar | f55e4c8 | 2017-08-01 20:44:53 +0200 | [diff] [blame] | 621 | The DLL can be found under the lib directory. E.g. |
| 622 | C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 623 | MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at |
| 624 | runtime. Default: $(MZSCHEME)\collects |
| 625 | User can override this with the PLTCOLLECTS environment |
| 626 | variable. |
| 627 | |
Bram Moolenaar | 73f4439 | 2017-10-07 18:38:43 +0200 | [diff] [blame] | 628 | List of MZSCHEME_VER (incomplete): |
| 629 | |
| 630 | Racket ver. | MZSCHEME_VER |
| 631 | ========================== |
| 632 | 6.3 | 3m_9z0ds0 |
| 633 | 6.6 | 3m_a0solc |
| 634 | 6.8 | 3m_a1zjsw |
| 635 | 6.10 | 3m_a36fs8 |
| 636 | |
| 637 | |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 638 | E.g. When using MSVC (as one line): |
| 639 | |
| 640 | nmake -f Make_mvc.mak |
| 641 | MZSCHEME="C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes |
| 642 | MZSCHEME_VER=3m_9z0ds0 |
| 643 | |
| 644 | Or when using MinGW (as one line): |
| 645 | |
| 646 | mingw32-make -f Make_ming.mak |
| 647 | MZSCHEME='C:/Program\ Files\ (x86)/Racket' DYNAMIC_MZSCHEME=yes |
| 648 | MZSCHEME_VER=3m_9z0ds0 |
| 649 | |
| 650 | Spaces should be escaped with '\'. |
| 651 | |
| 652 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 653 | 2) Building with MzScheme support (older) |
| 654 | |
| 655 | (written by Sergey Khorev <sergey.khorev@gmail.com>) |
| 656 | |
| 657 | Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can |
| 658 | be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and |
| 659 | above (including 299 and 30x series). |
| 660 | |
| 661 | The MSVC build is quite straightforward. Simply invoke (in one line) |
| 662 | nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme> |
| 663 | [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>] |
| 664 | where <MzScheme-version> is the last seven characters from MzScheme dll name |
| 665 | (libmzschXXXXXXX.dll). |
| 666 | If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme |
| 667 | DLL's, but will load them in runtime on demand. |
| 668 | |
| 669 | Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into |
| 670 | account that <Path-to-MzScheme> should contain slashes rather than backslashes |
| 671 | (e.g. d:/Develop/MzScheme) |
| 672 | |
| 673 | "Static" MzScheme support (Vim executable will depend on MzScheme DLLs |
| 674 | explicitly) on MinGW and Cygwin requires additional step. |
| 675 | |
| 676 | libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from |
| 677 | %WINDOWS%\System32 to other location (either build directory, some temporary |
| 678 | dir or even MzScheme home). |
| 679 | |
| 680 | Pass that path as MZSCHEME_DLLS parameter for Make. E.g., |
| 681 | make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000 |
| 682 | MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no |
| 683 | |
| 684 | After a successful build, these dlls can be freely removed, leaving them in |
| 685 | %WINDOWS%\System32 only. |
| 686 | |
| 687 | |
| 688 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 689 | 9. Building with Lua support |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 690 | ============================ |
| 691 | |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 692 | Vim with Lua support can be built with either MSVC or MinGW (or maybe Cygwin). |
| 693 | You can use binaries from LuaBinaries: http://luabinaries.sourceforge.net/ |
| 694 | This also applies to when you get a Vim executable and don't build yourself, |
| 695 | do the part up to "Build". |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 696 | |
| 697 | 1) Download and install LuaBinaries |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 698 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 699 | Go to the Download page of LuaBinaries: |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 700 | http://luabinaries.sourceforge.net/download.html |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 701 | |
| 702 | Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 703 | lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them both for MSVC and |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 704 | MinGW. |
| 705 | |
| 706 | Unpack it to a working directory. E.g. C:\projects\lua53. |
| 707 | Lua's header files will be installed under the include directory. |
| 708 | |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 709 | Copy luaXY.dll to your Windows system directory. The system directory depends |
| 710 | on your Windows bitness and Vim bitness: |
| 711 | 32-bit Vim on 32-bit Windows: C:\Windows\System32 |
| 712 | 32-bit Vim on 64-bit Windows: C:\Windows\SysWOW64 |
| 713 | 64-bit Vim on 64-bit Windows: C:\Windows\System32 |
| 714 | |
| 715 | Or another option is copying luaXY.dll to the directory where gvim.exe |
| 716 | (or vim.exe) is. |
| 717 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 718 | |
| 719 | 2) Build |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 720 | |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 721 | You need to set LUA, DYNAMIC_LUA and LUA_VER. |
| 722 | |
| 723 | LUA: Where Lua's header files are installed. E.g. C:\projects\lua53. |
| 724 | DYNAMIC_LUA: Whether dynamic linking is used. Set to yes. |
| 725 | LUA_VER: Lua version. E.g. 53 for Lua 5.3.X. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 726 | |
| 727 | E.g. When using MSVC (as one line): |
| 728 | |
| 729 | nmake -f Make_mvc.mak |
| 730 | LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53 |
| 731 | |
| 732 | Or when using MinGW (as one line): |
| 733 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 734 | mingw32-make -f Make_ming.mak |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 735 | LUA=C:/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 736 | |
Bram Moolenaar | 4e640bd | 2016-01-16 16:20:38 +0100 | [diff] [blame] | 737 | |
| 738 | Or when using Cygwin (as one line) (untested): |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 739 | |
| 740 | make -f Make_cyg.mak |
| 741 | LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53 |
| 742 | |
| 743 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 744 | 10. Building with Perl support |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 745 | ============================== |
| 746 | |
| 747 | Vim with Perl support can be built with either MSVC or MinGW (or Cygwin). |
| 748 | You can use binaries from ActiveState (ActivePerl) or Strawberry Perl. |
| 749 | |
| 750 | http://www.activestate.com/activeperl |
| 751 | http://strawberryperl.com/ |
| 752 | |
| 753 | When building, you need to set the following variables: |
| 754 | |
| 755 | PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl |
| 756 | DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes. |
| 757 | PERL_VER: Perl version. E.g. 522 for Perl 5.22.X. |
| 758 | |
| 759 | E.g. When using MSVC (as one line): |
| 760 | |
| 761 | nmake -f Make_mvc.mak |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 762 | PERL=C:\StrawberryPerl\perl DYNAMIC_PERL=yes PERL_VER=522 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 763 | |
| 764 | Or when using MinGW (as one line): |
| 765 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 766 | mingw32-make -f Make_ming.mak |
Andrey A. Voropaev | 157397e | 2024-12-26 15:55:24 +0100 | [diff] [blame] | 767 | PERL=C:/StrawberryPerl/perl DYNAMIC_PERL=yes PERL_VER=522 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 768 | |
| 769 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 770 | 11. Building with Ruby support |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 771 | ============================== |
| 772 | |
| 773 | Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin). |
| 774 | Ruby doesn't provide the official Windows binaries. The most widely used |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 775 | Windows binaries might be RubyInstaller. Currently Ruby 2.4 is recommended. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 776 | |
| 777 | http://rubyinstaller.org/ |
| 778 | |
| 779 | If you use MinGW you can easily build with RubyInstaller, but if you use MSVC |
| 780 | you need some tricks described below. |
| 781 | (Another binary distribution is ActiveScriptRuby: |
| 782 | http://www.artonx.org/data/asr/) |
| 783 | |
| 784 | When building, you need to set the following variables at least: |
| 785 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 786 | RUBY: Where ruby is installed. E.g. C:\Ruby24 |
Bram Moolenaar | 6384c5d | 2016-09-06 22:06:35 +0200 | [diff] [blame] | 787 | DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes. |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 788 | RUBY_VER: Ruby version. E.g. 24 for Ruby 2.4.X. |
Bram Moolenaar | 6384c5d | 2016-09-06 22:06:35 +0200 | [diff] [blame] | 789 | RUBY_API_VER_LONG: Ruby API version in a long format. |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 790 | E.g. 2.4.0 for Ruby 2.4.X. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 791 | |
| 792 | Ruby version vs. Ruby API version: |
| 793 | |
| 794 | Ruby ver. | Ruby API ver. |
| 795 | ========================= |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 796 | 1.9.[1-3] | 1.9.1 |
| 797 | 2.0.0 | 2.0.0 |
| 798 | 2.X.Y | 2.X.0 |
| 799 | |
| 800 | (Ruby 1.9.0 is excluded from the table because it is an unstable version.) |
| 801 | |
| 802 | |
| 803 | A) Using MSVC |
| 804 | |
| 805 | If you want to link with ruby, normally you must use the same compiler as |
| 806 | which was used to build the ruby binary. RubyInstaller is built with MinGW, |
| 807 | so normally you cannot use MSVC for building Vim if you want to link with |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 808 | RubyInstaller. If you use a different compiler, there are mainly two problems: |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 809 | config.h and Ruby's DLL name. Here are the steps for working around them: |
| 810 | |
| 811 | 1) Download and Install RubyInstaller. |
| 812 | You can install RubyInstaller with the default options and directory. |
| 813 | E.g.: |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 814 | C:\Ruby24 (32-bit) or C:\Ruby24-x64 (64-bit) |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 815 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 816 | Ruby 2.4.X is used in this example. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 817 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 818 | 2) Download Ruby 2.4.X's source code and generate config.h: |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 819 | |
| 820 | cd C:\projects |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 821 | git clone https://github.com/ruby/ruby.git -b ruby_2_4 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 822 | cd ruby |
| 823 | win32\configure.bat |
| 824 | nmake .config.h.time |
| 825 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 826 | Note that ruby_2_4 is the branch name for Ruby 2.4.X's source code. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 827 | There is no need to build whole Ruby, just config.h is needed. |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 828 | If you use 32-bit MSVC 2015, the config.h is generated in the |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 829 | .ext\include\i386-mswin32_140 directory. |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 830 | If you use 64-bit MSVC 2015, the config.h is generated in the |
| 831 | .ext\include\x64-mswin64_140 directory. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 832 | |
| 833 | 3) Install the generated config.h. |
| 834 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 835 | For 32-bit version: |
| 836 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 837 | xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 838 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 839 | For 64-bit version: |
| 840 | |
| 841 | xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0 |
| 842 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 843 | Note that 2.4.0 is Ruby API version of Ruby 2.4.X. |
| 844 | You may need to close the console and reopen it to pick up the new $PATH. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 845 | |
| 846 | 4) Build Vim. Note that you need to adjust some variables (as one line): |
| 847 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 848 | For 32-bit version: |
| 849 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 850 | nmake -f Make_mvc.mak |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 851 | RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 852 | RUBY_MSVCRT_NAME=msvcrt |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 853 | WINVER=0x601 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 854 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 855 | For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64. |
| 856 | |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 857 | If you set WINVER explicitly, it must be set to >=0x500, when building |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 858 | with Ruby 2.1 or later. (Default is 0x601.) |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 859 | When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt |
| 860 | which is used for the Ruby's DLL name. |
| 861 | |
| 862 | B) Using MinGW |
| 863 | |
| 864 | Using MinGW is easier than using MSVC when linking with RubyInstaller. |
| 865 | After you install RubyInstaller, just type this (as one line): |
| 866 | |
| 867 | mingw32-make -f Make_ming.mak |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 868 | RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 869 | WINVER=0x601 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 870 | |
Bram Moolenaar | 59eb016 | 2017-12-10 18:17:44 +0100 | [diff] [blame] | 871 | For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64. |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 872 | If you set WINVER explicitly, it must be set to >=0x500, when building with |
K.Takata | 27b53be | 2022-09-18 12:25:49 +0100 | [diff] [blame] | 873 | Ruby 2.1 or later. (Default is 0x601.) |
Bram Moolenaar | 02cfac8 | 2016-04-21 14:34:58 +0200 | [diff] [blame] | 874 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 875 | |
| 876 | |
Bram Moolenaar | eae1b91 | 2019-05-09 15:12:55 +0200 | [diff] [blame] | 877 | 12. Building with Tcl support |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 878 | ============================= |
| 879 | |
| 880 | Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin). |
| 881 | You can use binaries from ActiveState (ActiveTcl). |
| 882 | |
| 883 | http://www.activestate.com/activetcl |
| 884 | |
Bram Moolenaar | ba7e186 | 2019-01-09 23:02:43 +0100 | [diff] [blame] | 885 | Alternatively, you can use the binaries provided by IronTcl from |
| 886 | |
| 887 | https://www.irontcl.com/ |
| 888 | |
| 889 | They might lack behind the latest version a bit, but should provide 64bit |
| 890 | and 32bit versions even if ActiveTcl does not provide them anymore. |
| 891 | |
| 892 | For building with MSVC 2015 use version 8.6.6 or later. |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 893 | When building, you need to set the following variables: |
| 894 | |
| 895 | TCL: Where tcl is installed. E.g. C:\Tcl86 |
| 896 | DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes. |
| 897 | TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X. |
| 898 | TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X. |
| 899 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 900 | Sometimes the Tcl dll name changes. E.g. ActiveTcl 8.6.4 comes with tcl86.dll, |
| 901 | but ActiveTcl 8.6.6 comes with tcl86t.dll. You can set the dll name by setting |
| 902 | the TCL_DLL variable: |
| 903 | TCL_DLL=tcl86t.dll |
| 904 | |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 905 | E.g. When using MSVC (as one line): |
| 906 | |
| 907 | nmake -f Make_mvc.mak |
| 908 | TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 |
| 909 | |
| 910 | Or when using MinGW (as one line): |
| 911 | |
Bram Moolenaar | 18cfa94 | 2017-10-08 17:58:44 +0200 | [diff] [blame] | 912 | mingw32-make -f Make_ming.mak |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 913 | TCL=C:/Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6 |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 914 | |
| 915 | |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 916 | 13. Building with DirectX (DirectWrite) support |
Bram Moolenaar | 7f88b65 | 2017-12-14 13:15:19 +0100 | [diff] [blame] | 917 | =============================================== |
| 918 | |
| 919 | Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW. |
| 920 | This requires dwrite_2.h and some other header files which come with Windows |
| 921 | SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support. |
| 922 | This also requires MBYTE=yes which is enabled by default. |
| 923 | |
| 924 | A) Using MSVC |
| 925 | |
| 926 | If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default. |
| 927 | You just need to specify DIRECTX=yes: |
| 928 | |
| 929 | nmake -f Make_mvc.mak DIRECTX=yes |
| 930 | |
| 931 | If you use MSVC 2012 or earlier, the required header files are not available |
| 932 | by default. However, you can use the header files from newer SDKs with older |
| 933 | compilers. E.g.: |
| 934 | |
| 935 | set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um" |
| 936 | nmake -f Make_mvc.mak DIRECTX=yes |
| 937 | |
| 938 | If you don't need color emoji support, only dwrite.h is required. You can use |
| 939 | older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.: |
| 940 | |
| 941 | nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no |
| 942 | |
| 943 | B) Using MinGW-w64 |
| 944 | |
| 945 | Just set DIRECTX to yes: |
| 946 | |
| 947 | mingw32-make -f Make_ming.mak DIRECTX=yes |
| 948 | |
| 949 | |
K.Takata | d8f8629 | 2022-03-07 15:16:15 +0000 | [diff] [blame] | 950 | 14. Building with libsodium support |
| 951 | =================================== |
| 952 | |
| 953 | For better encryption support, you can build Vim with libsodium. |
| 954 | |
| 955 | A) Using MSVC |
| 956 | |
| 957 | You can download the latest libsodium library from here: |
| 958 | https://download.libsodium.org/libsodium/releases/ |
| 959 | |
| 960 | At this moment, libsodium-1.0.18-stable-msvc.zip is the latest package. |
| 961 | Unpack it to anywhere you like, and specify the path to the SODIUM option: |
| 962 | |
| 963 | nmake -f Make_mvc.mak SODIUM=C:/path/to/libsodium |
| 964 | (libsodium.dll will be used as the libsodium DLL name.) |
| 965 | |
| 966 | B) Using MinGW |
| 967 | |
| 968 | If you use msys2, you can install the libsodium package by pacman (or pacboy): |
| 969 | |
| 970 | $ pacman -S mingw-w64-x86_64-libsodium # for 64-bit Vim |
| 971 | $ pacman -S mingw-w64-i686-libsodium # for 32-bit Vim |
| 972 | $ pacboy -S libsodium:m # for both 32-bit and 64-bit Vim |
| 973 | |
| 974 | Then set SODIUM to yes: |
| 975 | |
| 976 | mingw32-make -f Make_ming.mak SODIUM=yes |
| 977 | (libsodium-23.dll will be used as the libsodium DLL name.) |
| 978 | |
| 979 | Or you can set the path to libsodium explicitly: |
| 980 | |
| 981 | mingw32-make -f Make_ming.mak SODIUM=C:/path/to/libsodium |
| 982 | (libsodium.dll will be used as the libsodium DLL name.) |
| 983 | |
| 984 | |
| 985 | 15. Windows 3.1x |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 986 | ================ |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 987 | |
Bram Moolenaar | 6e722e2 | 2016-02-26 19:58:58 +0100 | [diff] [blame] | 988 | The Windows 3.1x support was removed in patch 7.4.1364. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 989 | |
| 990 | |
K.Takata | d8f8629 | 2022-03-07 15:16:15 +0000 | [diff] [blame] | 991 | 16. MS-DOS |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 992 | ========== |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 993 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 994 | The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions |
| 995 | work on MS-DOS because of the limited amount of memory available. |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 996 | |
| 997 | |
K.Takata | d8f8629 | 2022-03-07 15:16:15 +0000 | [diff] [blame] | 998 | 17. Installing after building from sources |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 999 | ========================================== |
| 1000 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1001 | [provided by Michael Soyka, updated by Ken Takata] |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1002 | |
| 1003 | After you've built the Vim binaries as described above, you're ready to |
| 1004 | install Vim on your system. However, if you've obtained the Vim sources |
Bram Moolenaar | 30a8947 | 2016-01-10 14:35:58 +0100 | [diff] [blame] | 1005 | using Git, Mercurial or by downloading them as a unix tar file, you must |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1006 | first create a "vim91" directory. If you instead downloaded the sources as |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1007 | zip files, you can skip this setup as the zip archives already have the |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 1008 | correct directory structure. |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1009 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1010 | A. Create a Vim "runtime" subdirectory named "vim91" |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1011 | ----------------------------------------------------- |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 1012 | If you obtained your Vim sources as zip files, you can skip this step. |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1013 | Otherwise, continue reading. |
| 1014 | |
| 1015 | Go to the directory that contains the Vim "src" and "runtime" |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1016 | directories and create a new subdirectory named "vim91". |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 1017 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1018 | Copy the "runtime" files into "vim91": |
| 1019 | copy runtime\* vim91 |
| 1020 | xcopy /s runtime\* vim91 |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1021 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1022 | B. Copy the new binaries into the "vim91" directory |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1023 | ---------------------------------------------------- |
| 1024 | Regardless of how you installed the Vim sources, you need to copy the |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1025 | new binaries you created above into "vim91": |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1026 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1027 | copy src\*.exe vim91 |
| 1028 | copy src\tee\tee.exe vim91 |
| 1029 | copy src\xxd\xxd.exe vim91 |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1030 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1031 | To install the "Edit with Vim" popup menu, you need both 32-bit and 64-bit |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1032 | versions of gvimext.dll. They should be copied to "vim91\GvimExt32" and |
| 1033 | "vim91\GvimExt64" respectively. |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1034 | First, build the 32-bit version, then: |
| 1035 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1036 | mkdir vim91\GvimExt32 |
| 1037 | copy src\GvimExt\gvimext.dll vim91\GvimExt32 |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1038 | |
| 1039 | Next, clean the 32-bit version and build the 64-bit version, then: |
| 1040 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1041 | mkdir vim91\GvimExt64 |
| 1042 | copy src\GvimExt\gvimext.dll vim91\GvimExt64 |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1043 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1044 | C. Copy gettext and iconv DLLs into the "vim91" directory |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1045 | ---------------------------------------------------------- |
| 1046 | Get gettext and iconv DLLs from the following site: |
| 1047 | https://github.com/mlocati/gettext-iconv-windows/releases |
| 1048 | Both 64- and 32-bit versions are needed. |
| 1049 | Download the files gettextX.X.X.X-iconvX.XX-shared-{32,64}.zip, extract |
| 1050 | DLLs and place them as follows: |
| 1051 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1052 | vim91\ |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1053 | | libintl-8.dll |
| 1054 | | libiconv-2.dll |
| 1055 | | libgcc_s_sjlj-1.dll (only for 32-bit) |
| 1056 | | |
| 1057 | + GvimExt32\ |
| 1058 | | libintl-8.dll |
| 1059 | | libiconv-2.dll |
| 1060 | | libgcc_s_sjlj-1.dll |
| 1061 | | |
| 1062 | ` GvimExt64\ |
| 1063 | libintl-8.dll |
| 1064 | libiconv-2.dll |
| 1065 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1066 | The DLLs in the "vim91" should be the same bitness with the (g)vim.exe. |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1067 | |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1068 | D. Move the "vim91" directory into the Vim installation subdirectory |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1069 | --------------------------------------------------------------------- |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1070 | Move the "vim91" subdirectory into the subdirectory where you want Vim |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 1071 | to be installed. Typically, this subdirectory will be named "vim". |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1072 | If you already have a "vim91" subdirectory in "vim", delete it first |
Bram Moolenaar | 30e8e73 | 2019-09-27 13:08:36 +0200 | [diff] [blame] | 1073 | by running its uninstall.exe program. |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1074 | |
Bram Moolenaar | 3bf8c3c | 2017-11-05 16:04:43 +0100 | [diff] [blame] | 1075 | E. Install Vim |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1076 | --------------- |
mikoto2000 | 166f89e | 2024-09-26 15:52:22 +0200 | [diff] [blame] | 1077 | "cd" to your Vim installation subdirectory "vim\vim91" and run the |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1078 | "install.exe" program. It will ask you a number of questions about |
| 1079 | how you would like to have your Vim setup. Among these are: |
| 1080 | - You can tell it to write a "_vimrc" file with your preferences in the |
| 1081 | parent directory. |
| 1082 | - It can also install an "Edit with Vim" entry in the Windows Explorer |
| 1083 | popup menu. |
| 1084 | - You can have it create batch files, so that you can run Vim from the |
| 1085 | console or in a shell. You can select one of the directories in your |
Bram Moolenaar | 3c6f92e | 2016-01-02 20:26:36 +0100 | [diff] [blame] | 1086 | PATH or add the directory to PATH using the Windows Control Panel. |
Bram Moolenaar | 734d998 | 2011-07-15 13:52:04 +0200 | [diff] [blame] | 1087 | - Create entries for Vim on the desktop and in the Start menu. |
| 1088 | |
| 1089 | Happy Vimming! |