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