blob: 3777784d14d1941a311d5c4dcec95f574d32aee1 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001INSTALLpc.txt - Installation of Vim on PC
2
3This file contains instructions for compiling Vim. If you already have an
4executable version of Vim, you don't need this.
5
Bram Moolenaar362e1a32006-03-06 23:29:24 +00006More information can be found here: (Very stale now.)
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
Bram Moolenaar362e1a32006-03-06 23:29:24 +00008 http://mywebpage.netscape.com/sharppeople/vim/howto/
Bram Moolenaar071d4272004-06-13 20:20:40 +00009
10The file "feature.h" can be edited to match your preferences. You can skip
11this, then you will get the default behavior as is documented, which should
12be fine for most people.
13
Bram Moolenaar734d9982011-07-15 13:52:04 +020014With the exception of two sections (Windows 3.1 and MS-DOS), this document
15assumes that you are building Vim for Win32 or later.
Bram Moolenaar30a89472016-01-10 14:35:58 +010016(Windows 95/98/Me/NT/2000/XP/2003/Vista/7/8/10)
Bram Moolenaar362e1a32006-03-06 23:29:24 +000017
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
19Contents:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000201. Microsoft Visual C++
212. Using MinGW
223. Cygwin
234. Borland
245. Cross compiling for Win32 from a Linux machine
256. Building with Python support
Bram Moolenaar30a89472016-01-10 14:35:58 +0100267. Building with Python3 support
278. Building with MzScheme support
289. Building with Lua support
2910. Building with Perl support
3011. Building with Ruby support
3112. Building with Tcl support
3213. Windows 3.1
3314. MS-DOS
Bram Moolenaar362e1a32006-03-06 23:29:24 +000034
Bram Moolenaar30a89472016-01-10 14:35:58 +01003515. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +020036
37
Bram Moolenaarc236c162008-07-13 17:41:49 +000038The currently preferred method is using the free Visual C++ Toolkit 2008
Bram Moolenaar536d95f2011-06-12 20:36:09 +020039|msvc-2008-express|, the produced binary runs on most MS-Windows systems. If
40you need the executable to run on Windows 98 or ME, use the 2003 one
41|msvc-2003-toolkit|.
Bram Moolenaar071d4272004-06-13 20:20:40 +000042
43
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000441. Microsoft Visual C++
45=======================
46
47Visual Studio
48-------------
49
Bram Moolenaar30a89472016-01-10 14:35:58 +010050Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, VS 2008,
51VS2010, VS2012, VS2013 and VS2015) is straightforward. (These instructions
52should also work for VS 4 and VS 5.)
Bram Moolenaar362e1a32006-03-06 23:29:24 +000053
Bram Moolenaar97cc2382012-10-03 21:46:54 +020054Using VS C++ 2008 Express is recommended, the binaries build with that run on
55nearly all platforms. Binaries from later versions may not run on Windows 95
56or XP.
57
Bram Moolenaar362e1a32006-03-06 23:29:24 +000058To build Vim from the command line with MSVC, use Make_mvc.mak.
59Visual Studio installed a batch file called vcvars32.bat, which you must
60run to set up paths for nmake and MSVC.
61
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000062nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
63nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
64nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
Bram Moolenaar362e1a32006-03-06 23:29:24 +000065nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000066 Perl, Python, etc.
Bram Moolenaar362e1a32006-03-06 23:29:24 +000067
68Make_mvc.mak allows a Vim to be built with various different features and
69debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
70For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
71
72For compiling Gvim with IME support on far-east Windows, add IME=yes
73to the parameters you pass to Make_mvc.mak.
74
75To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
76(Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
77far more configuration.) Make_ivc.mak can also be built with nmake.
78
79nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000080 GUI Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000081nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000082 OLE Microsoft Visual C++ 4.x or later
Bram Moolenaar362e1a32006-03-06 23:29:24 +000083
84See the specific files for comments and options.
85
86These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
87Ron Aaron; they have been tested.
88
89
Bram Moolenaarc236c162008-07-13 17:41:49 +000090Visual C++ Toolkit 2003 *msvc-2003-toolkit*
Bram Moolenaar362e1a32006-03-06 23:29:24 +000091-----------------------
92
Bram Moolenaarc236c162008-07-13 17:41:49 +000093You could download the Microsoft Visual C++ Toolkit 2003 from
Bram Moolenaar362e1a32006-03-06 23:29:24 +000094 http://msdn.microsoft.com/visualc/vctoolkit2003/
Bram Moolenaarc236c162008-07-13 17:41:49 +000095Unfortunately this URL is no longer valid. Inofficial downloads appear to be
96available from links mentioned on these pages (use at your own risk):
97 http://www.filewatcher.com/m/VCToolkitSetup.exe.32952488.0.0.html
98 http://feargame.net/wiki/index.php?title=Building_Source_with_the_VC2003_Toolkit
99
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000100This contains the command-line tools (compiler, linker, CRT headers,
101and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
102To compile and debug Vim with the VC2003 Toolkit, you will also need
103|ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
104and |windbg-download|.
105
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000106It's easier to download Visual C++ 2008 Express Edition, |msvc-2008-express|,
107which is freely available in perpetuity.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000108
109The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
110 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
111(This site also takes you through configuring a number of other
112free C compilers for Win32.)
113
114To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
115execute the following commands in a cmd.exe window (the msvcsetup.bat batch
116file can be used):
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000117
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000118 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
119 call "%VCToolkitInstallDir%vcvars32.bat"
120 set MSVCVer=7.1
121 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
122 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
123
124Now you can build Vim with Make_mvc.mak.
125
126
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000127Getting the Windows Platform SDK *ms-platform-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000128
129You will also need a copy of the Windows Platform SDK from
130 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
131Specifically, you need the Windows Core SDK subset of the Platform SDK,
132which contains the Windows headers and libraries.
133
134
135Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
136
137You need the .NET Framework 1.1 Redistributable Package from
138 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
139or from Windows Update:
140 http://windowsupdate.microsoft.com/
141This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
142which is needed to link Vim.
143
144
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000145Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000146
147You need the .NET Framework 1.1 SDK from
148 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
149This contains some additional libraries needed to compile Vim,
150such as msvcrt.lib. You must install |dotnet-1.1-redist| before
151installing the .NET 1.1 SDK.
152
153
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000154Getting the WinDbg debugger *windbg-download*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000155
156The Debugging Tools for Windows can be downloaded from
157 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
158This includes the WinDbg debugger, which you will want if you ever need
159to debug Vim itself. An earlier version of the Debugging Tools
160is also available through the Platform SDK, |ms-platform-sdk|.
161
162
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000163Visual C++ 2005 Express Edition *msvc-2005-express*
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000164-------------------------------
165
Bram Moolenaarfc1421e2006-04-20 22:17:20 +0000166Visual C++ 2005 Express Edition can be downloaded for free from:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000167 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
168This includes the IDE and the debugger. You will also need
169|ms-platform-sdk|. You can build Vim with Make_mvc.mak.
170
171Instructions for integrating the Platform SDK into VC Express:
172 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
173
174
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000175Visual C++ 2008 Express Edition *msvc-2008-express*
176-------------------------------
177
178Visual C++ 2008 Express Edition can be downloaded for free from:
Bram Moolenaar442b4222010-05-24 21:34:22 +0200179 http://www.microsoft.com/express/downloads/
180This includes the IDE and the debugger.
181
182To set the environment execute the msvc2008.bat script. You can then build
183Vim with Make_mvc.mak.
184
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200185For building 64 bit binaries you also need to install the SDK:
186"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
187You don't need the examples and documentation.
188
Bram Moolenaar442b4222010-05-24 21:34:22 +0200189
190Visual C++ 2010 Express Edition *msvc-2010-express*
191-------------------------------
192
193Visual C++ 2010 Express Edition can be downloaded for free from:
Bram Moolenaara7241f52008-06-24 20:39:31 +0000194 http://www.microsoft.com/express/vc/Default.aspx
195This includes the IDE and the debugger.
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000196
Bram Moolenaar536d95f2011-06-12 20:36:09 +0200197To set the environment execute the msvc2010.bat script. You can then build
Bram Moolenaara7241f52008-06-24 20:39:31 +0000198Vim with Make_mvc.mak.
Bram Moolenaar98385dc2008-06-20 14:52:32 +0000199
200
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200201Targeting Windows XP with new MSVC *new-msvc-windows-xp*
202----------------------------------
203
Bram Moolenaar30a89472016-01-10 14:35:58 +0100204Beginning with Visual C++ 2012, Microsoft changed the behavior of LINK.EXE
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200205so that it targets Windows 6.0 (Vista) by default. In order to override
206this, the target Windows version number needs to be passed to LINK like
207follows:
208 LINK ... /subsystem:console,5.01
209
210Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
211Use lines like follows to target Windows XP (assuming using Visual C++ 2012
212under 64-bit Windows):
213 set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
214 set SDK_INCLUDE_DIR=%WinSdk71%\Include
215 set INCLUDE=%WinSdk71%\Include;%INCLUDE%
216 set LIB=%WinSdk71%\Lib;%LIB%
217 set PATH=%WinSdk71%\Bin;%PATH%
218 set CL=/D_USING_V110_SDK71_
219 nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
220
221The following Visual C++ team blog can serve as a reference page:
222 http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
223
224
Bram Moolenaar362e1a32006-03-06 23:29:24 +00002252. MinGW
226========
227
228(written by Ron Aaron: <ronaharon@yahoo.com>)
229
230This is about how to produce a Win32 binary of gvim with MinGW.
231
232First, you need to get the 'mingw32' compiler, which is free for the download
233at:
234
235 http://www.mingw.org/
236
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100237or you can use 'MinGW-w64' compiler.
238
239 http://mingw-w64.sourceforge.net/
240
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100241Or a compiler provided on msys2:
242
243 https://msys2.github.io/
244
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000245Once you have downloaded the compiler binaries, unpack them on your hard disk
246somewhere, and put them on your PATH. If you are on Win95/98 you can edit
247your AUTOEXEC.BAT file with a line like:
248
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100249 set PATH=C:\MinGW\bin;%PATH%
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000250
251or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100252System, Advanced, and edit the environment from there. If you use msys2
253compilers, set your installed paths:
254
255 C:\msys2\mingw32\bin
256
257for 32bit. And 64bit:
258
259 C:\msys2\mingw64\bin
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000260
261Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
262
263 C:\> gcc --version
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100264 gcc (GCC) 4.8.1
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000265
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100266 C:\> mingw32-make --version
267 GNU Make 3.82.90 (...etc...)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000268
269Now you are ready to rock 'n' roll. Unpack the vim sources (look on
270www.vim.org for exactly which version of the vim files you need).
271
272Change directory to 'vim\src':
273
274 C:\> cd vim\src
275 C:\VIM\SRC>
276
277and you type:
278
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100279 mingw32-make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000280
281After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
282directory.
283
284You should not need to do *any* editing of any files to get vim compiled this
285way. If, for some reason, you want the console-mode-only version of vim (this
Bram Moolenaar5e3dae82010-03-02 16:19:40 +0100286is NOT recommended on Win32, especially on '95/'98!!!), you can use:
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100287
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100288 mingw32-make -f Make_ming.mak GUI=no vim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000289
290If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
291(also free!) and compress the file (typical compression is 50%). UPX can be
292found at
293 http://www.upx.org/
294
Bram Moolenaar91856272012-02-29 16:56:39 +0100295As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
296built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
297at:
298 http://www.matcode.com/mpress.htm
299
300
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000301ADDITION: NLS support with MinGW
302
303(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
304
305If you want National Language Support, read the file src/po/README_mingw.txt.
306You need to uncomment lines in Make_ming.mak to have NLS defined.
307
308
3093. Cygwin
310=========
311
312Use Make_cyg.mak with Cygwin's GCC. See
313 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
314
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100315With Cygnus gcc you should use the Unix Makefile instead (you need to get the
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000316Unix archive then). Then you get a Cygwin application (feels like Vim is
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100317running on Unix), while with Make_cyg.mak you get a Windows application (like
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000318with the other makefiles).
319
320
3214. Borland
322===========
323
324Use Make_bc5.mak with Borland C++ 5.x. See
325 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
326
327
3285. Cross compiling for Win32 from a Linux machine
329=================================================
330
331[Update of 1) needs to be verified]
332
333If you like, you can compile the 'mingw' Win32 version from the comfort of
334your Linux (or other unix) box. To do this, you need to follow a few steps:
335 1) Install the mingw32 cross-compiler. See
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100336 http://www.mingw.org/wiki/LinuxCrossMinGW
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000337 http://www.libsdl.org/extras/win32/cross/README.txt
Bram Moolenaara7241f52008-06-24 20:39:31 +0000338 2) Get and unpack both the Unix sources and the extra archive
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100339 3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
340 Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
341 wish. If your cross-compiler prefix differs from the predefined value,
Bram Moolenaard8e21d32010-01-06 21:16:31 +0100342 set 'CROSS_COMPILE' corresponding.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000343 4) make -f Make_ming.mak gvim.exe
344
345Now you have created the Windows binary from your Linux box! Have fun...
346
347
3486. Building with Python support
349===============================
350
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200351For building with MSVC 2008 the "Windows Installer" from www.python.org
352works fine.
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000353
Bram Moolenaar30a89472016-01-10 14:35:58 +0100354When building, you need to set the following variables at least:
355
356 PYTHON: Where Python is installed. E.g. C:\Python27
357 DYNAMIC_PYTHON: Whether dynamic linking is used. Usually, set to yes.
358 PYTHON_VER: Python version. E.g. 27 for Python 2.7.X.
359
360E.g. When using MSVC (as one line):
361
362 nmake -f Make_mvc.mak
363 PYTHON=C:\Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
364
Bram Moolenaar97cc2382012-10-03 21:46:54 +0200365(rest written by Ron Aaron: <ronaharon@yahoo.com>)
366
367Building with the mingw32 compiler, and the ActiveState ActivePython:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000368 http://www.ActiveState.com/Products/ActivePython/
369
370After installing the ActivePython, you will have to create a 'mingw32'
371'libpython20.a' to link with:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100372 cd $PYTHON/libs
373 pexports python20.dll > python20.def
374 dlltool -d python20.def -l libpython20.a
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000375
376Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
377the root of the Python installation (C:\Python20, for example). If you are
378cross-compiling on Linux with the mingw32 setup, you need to also convert all
379the 'Include' files to *unix* line-endings. This bash command will do it
380easily:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100381 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000382
383Now just do:
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100384 make -f Make_ming.mak gvim.exe
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000385
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100386And if you use msys2 to build python support (as one line):
387
388 mingw32-make -f Make_ming.mak PYTHON=c:/msys64/mingw64
389 PYTHON_HOME=c:/msys64/mingw64
390 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7
391 DYNAMIC_PYTHON=yes
392 PYTHON_VER=27
393 DYNAMIC_PYTHON_DLL=libpython2.7.dll
394 ARCH=x86-64
395 STATIC_STDCPLUS=yes
396
397You will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000398
399
Bram Moolenaar30a89472016-01-10 14:35:58 +01004007. Building with Python3 support
401================================
402
403For building with MSVC 2008 the "Windows Installer" from www.python.org
404works fine. Python 3.4 is recommended.
405
406When building, you need to set the following variables at least:
407
408 PYTHON3: Where Python3 is installed. E.g. C:\Python34
409 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
410 PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
411
412E.g. When using MSVC (as one line):
413
414 nmake -f Make_mvc.mak
415 PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
416
417
4188. Building with MzScheme support
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000419=================================
420
421(written by Sergey Khorev <sergey.khorev@gmail.com>)
422
423Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
424be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
425above (including 299 and 30x series).
426
427The MSVC build is quite straightforward. Simply invoke (in one line)
428nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
429 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
430where <MzScheme-version> is the last seven characters from MzScheme dll name
431(libmzschXXXXXXX.dll).
432If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
433DLL's, but will load them in runtime on demand.
434
435Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
436account that <Path-to-MzScheme> should contain slashes rather than backslashes
437(e.g. d:/Develop/MzScheme)
438
439"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
440explicitly) on MinGW and Cygwin requires additional step.
441
442libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
443%WINDOWS%\System32 to other location (either build directory, some temporary
444dir or even MzScheme home).
445
446Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
447make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
448 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
449
450After a successful build, these dlls can be freely removed, leaving them in
451%WINDOWS%\System32 only.
452
453
Bram Moolenaar30a89472016-01-10 14:35:58 +01004549. Building with Lua support
455============================
456
457Vim with Lua support can be built with either MSVC or MinGW (or Cygwin).
458You can use binaries from LuaBinaries.
459 http://luabinaries.sourceforge.net/
460
4611) Download and install LuaBinaries
462Go to the Download page of LuaBinaries:
463 http://luabinaries.sourceforge.net/download.html
464
465Download lua-X.Y.Z_Win32_dllw4_lib.zip for x86 or
466lua-X.Y.Z_Win64_dllw4_lib.zip for x64. You can use them for both MSVC and
467MinGW.
468
469Unpack it to a working directory. E.g. C:\projects\lua53.
470Lua's header files will be installed under the include directory.
471
472
4732) Build
474You need to set the following variables:
475
476 LUA: Where Lua is installed. E.g. C:\projects\lua53.
477 DYNAMIC_LUA: Whether dynamic linking is used. Usually, set to yes.
478 LUA_VER: Lua version. E.g. 53 for Lua 5.3.X.
479
480E.g. When using MSVC (as one line):
481
482 nmake -f Make_mvc.mak
483 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
484
485Or when using MinGW (as one line):
486
487 mingw32-make -f Make_mingw.mak
488 LUA=C:\projects\lua53 DYNAMIC_LUA=yes LUA_VER=53
489
490Or when using Cygwin (as one line):
491
492 make -f Make_cyg.mak
493 LUA=/cygdrive/c/projects/lua53 DYNAMIC_LUA=yes LUA_VER=53
494
495
49610. Building with Perl support
497==============================
498
499Vim with Perl support can be built with either MSVC or MinGW (or Cygwin).
500You can use binaries from ActiveState (ActivePerl) or Strawberry Perl.
501
502 http://www.activestate.com/activeperl
503 http://strawberryperl.com/
504
505When building, you need to set the following variables:
506
507 PERL: Where perl is installed. E.g. C:\Perl, C:\Strawberry\perl
508 DYNAMIC_PERL: Whether dynamic linking is used. Usually, set to yes.
509 PERL_VER: Perl version. E.g. 522 for Perl 5.22.X.
510
511E.g. When using MSVC (as one line):
512
513 nmake -f Make_mvc.mak
514 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
515
516Or when using MinGW (as one line):
517
518 mingw32-make -f Make_mingw.mak
519 PERL=C:\Perl DYNAMIC_PERL=yes PERL_VER=522
520
521
52211. Building with Ruby support
523==============================
524
525Vim with Ruby support can be built with either MSVC or MinGW (or Cygwin).
526Ruby doesn't provide the official Windows binaries. The most widely used
527Windows binaries might be RubyInstaller.
528
529 http://rubyinstaller.org/
530
531If you use MinGW you can easily build with RubyInstaller, but if you use MSVC
532you need some tricks described below.
533(Another binary distribution is ActiveScriptRuby:
534 http://www.artonx.org/data/asr/)
535
536When building, you need to set the following variables at least:
537
538 RUBY: Where ruby is installed. E.g. C:\Ruby22
539 DYNAMIC_RUBY: Whether dynamic linking is used. Usually, set to yes.
540 RUBY_VER: Ruby version. E.g. 22 for Ruby 2.2.X.
541 RUBY_VER_LONG: Ruby API version in a long format.
542 E.g. 2.2.0 for Ruby 2.2.X.
543
544Ruby version vs. Ruby API version:
545
546 Ruby ver. | Ruby API ver.
547 =========================
548 1.8.X | 1.8
549 1.9.[1-3] | 1.9.1
550 2.0.0 | 2.0.0
551 2.X.Y | 2.X.0
552
553(Ruby 1.9.0 is excluded from the table because it is an unstable version.)
554
555
556A) Using MSVC
557
558If you want to link with ruby, normally you must use the same compiler as
559which was used to build the ruby binary. RubyInstaller is built with MinGW,
560so normally you cannot use MSVC for building Vim if you want to link with
561RubyInstaller. If you use a different complier, there are mainly two problems:
562config.h and Ruby's DLL name. Here are the steps for working around them:
563
564 1) Download and Install RubyInstaller.
565 You can install RubyInstaller with the default options and directory.
566 E.g.:
567 C:\Ruby22 (32-bit) or C:\Ruby22-x64 (64-bit)
568
569 Ruby 2.2.X is used in this example.
570
571 2) Download Ruby 2.2.X's source code and generate config.h:
572
573 cd C:\projects
574 git clone https://github.com/ruby/ruby.git -b ruby_2_2
575 cd ruby
576 win32\configure.bat
577 nmake .config.h.time
578
579 Note that ruby_2_2 is the branch name for Ruby 2.2.X's source code.
580 There is no need to build whole Ruby, just config.h is needed.
581 If you use 32-bit MSVC10, the config.h is generated in the
582 .ext\include\i386-mswin32_100 directory.
583
584 3) Install the generated config.h.
585
586 xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
587
588 Note that 2.2.0 is Ruby API version of Ruby 2.2.X.
589
590 4) Build Vim. Note that you need to adjust some variables (as one line):
591
592 nmake -f Make_mvc.mak
593 RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
594 RUBY_MSVCRT_NAME=msvcrt
595 WINVER=0x500
596
597 WINVER must be set to >=0x500, when building with Ruby 2.1 or later.
598 When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
599 which is used for the Ruby's DLL name.
600
601B) Using MinGW
602
603Using MinGW is easier than using MSVC when linking with RubyInstaller.
604After you install RubyInstaller, just type this (as one line):
605
606 mingw32-make -f Make_ming.mak
607 RUBY=C:/Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0
608 WINVER=0x500
609
610WINVER must be set to >=0x500, when building with Ruby 2.1 or later.
611
612
61312. Building with Tcl support
614=============================
615
616Vim with Tcl support can be built with either MSVC or MinGW (or Cygwin).
617You can use binaries from ActiveState (ActiveTcl).
618
619 http://www.activestate.com/activetcl
620
621When building, you need to set the following variables:
622
623 TCL: Where tcl is installed. E.g. C:\Tcl86
624 DYNAMIC_TCL: Whether dynamic linking is used. Usually, set to yes.
625 TCL_VER: Tcl version in a short format. E.g. 86 for Tcl 8.6.X.
626 TCL_VER_LONG: Tcl version in a long format. E.g. 8.6 for Tcl 8.6.X.
627
628E.g. When using MSVC (as one line):
629
630 nmake -f Make_mvc.mak
631 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
632
633Or when using MinGW (as one line):
634
635 mingw32-make -f Make_mingw.mak
636 TCL=C:\Tcl86 DYNAMIC_TCL=yes TCL_VER=86 TCL_VER_LONG=8.6
637
638
63913. Windows 3.1x
640================
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000641
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000642make -f Make_w16.mak 16 bit, Borland C++ 5.0
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000643
644Warning: Be sure to use the right make.exe. It should be Borland make.
645
646You will almost certainly have to change the paths for libs and include files
647in the Makefile. Look for "D:\BC5" and "ctl3dv2". You will get a number of
648warnings which can be ignored ( _chmod, precompiled header files, and
649"possibly incorrect assignment").
650
651The makefile should also work for BC++ 4.0 and 4.5, but may need tweaking to
652remove unsupported compiler & liker options.
653
654For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER.
655In MSVC 4.2 support for Win32s was dropped! Use this command:
656 nmake -f Make_mvc.mak GUI=yes
657
658
Bram Moolenaar30a89472016-01-10 14:35:58 +010065914. MS-DOS
660==========
Bram Moolenaar071d4272004-06-13 20:20:40 +0000661
662Summary:
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000663ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++
664ren Make_tcc.mak Makefile; make 16 bit, Turbo C
Bram Moolenaarc9b4b052006-04-30 18:54:39 +0000665make -f Make_djg.mak 32 bit, DJGPP 2.0
666make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to
667 define DOS)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000668
669Warning: Be sure to use the right make.exe. Microsoft C make doesn't work;
670Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak;
671DJGPP/GNU make must be used for Make_djg.mak.
672
673The Borland C++ compiler has been used to generate the MS-DOS executable; it
674should work without problems. You will probably have to change the paths for
675LIBPATH and INCLUDEPATH in the start of the Makefile. You will get two
676warnings which can be ignored (one about _chmod and one about precompiled
677header files).
678
679The "spawno" library by Ralf Brown was used in order to free memory when Vim
680starts a shell or other external command. Only about 200 bytes are taken from
681conventional memory. When recompiling get the spawno library from Simtel,
682directory "msdos/c". It is called something like "spwno413.zip". Or follow
683the instructions in the Makefile to remove the library.
684
685The Turbo C Makefile has not been tested much lately. It is included for those
686that don't have C++. You may need to make a few changes to get it to work.
687
688DJGPP needs to be installed properly to compile Vim; you need a lot of things
689before it works. When your setup is OK, Vim should compile with just one
690warning (about an argument to signal()).
691
692Make_bc5.mak is for those that have Borland C++ 5.0 or later. At the top of
693the file, there are some variables you can change to make either a 32-bit
694Windows exe (GUI or console mode), or a 16-bit MS-DOS version.
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000695NOTE: multi-byte support is broken in the Borland libraries, not everything
696will work properly! Esp. handling multi-byte file names.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000697
Bram Moolenaar97293012011-07-18 19:40:27 +0200698If you get all kinds of strange error messages when compiling, try changing
699the file format from "unix" to "dos".
Bram Moolenaar734d9982011-07-15 13:52:04 +0200700
701
Bram Moolenaar30a89472016-01-10 14:35:58 +010070215. Installing after building from sources
Bram Moolenaar734d9982011-07-15 13:52:04 +0200703==========================================
704
705[provided by Michael Soyka]
706
707After you've built the Vim binaries as described above, you're ready to
708install Vim on your system. However, if you've obtained the Vim sources
Bram Moolenaar30a89472016-01-10 14:35:58 +0100709using Git, Mercurial or by downloading them as a unix tar file, you must
710first create a "vim74" directory. If you instead downloaded the sources as
Bram Moolenaar734d9982011-07-15 13:52:04 +0200711zip files, you can skip this setup as the zip archives already have the
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100712correct directory structure.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200713
Bram Moolenaar30a89472016-01-10 14:35:58 +0100714 A. Create a Vim "runtime" subdirectory named "vim74"
Bram Moolenaar734d9982011-07-15 13:52:04 +0200715 -----------------------------------------------------
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100716 If you obtained your Vim sources as zip files, you can skip this step.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200717 Otherwise, continue reading.
718
719 Go to the directory that contains the Vim "src" and "runtime"
Bram Moolenaar30a89472016-01-10 14:35:58 +0100720 directories and create a new subdirectory named "vim74".
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100721
Bram Moolenaar30a89472016-01-10 14:35:58 +0100722 Copy the "runtime" files into "vim74":
723 copy runtime\* vim74
Bram Moolenaar734d9982011-07-15 13:52:04 +0200724
Bram Moolenaar30a89472016-01-10 14:35:58 +0100725 B. Copy the new binaries into the "vim74" directory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200726 ----------------------------------------------------
727 Regardless of how you installed the Vim sources, you need to copy the
Bram Moolenaar30a89472016-01-10 14:35:58 +0100728 new binaries you created above into "vim74":
Bram Moolenaar734d9982011-07-15 13:52:04 +0200729
Bram Moolenaar30a89472016-01-10 14:35:58 +0100730 copy src\*.exe vim74
731 copy src\GvimExt\gvimext.dll vim74
732 copy src\xxd\xxd.exe vim74
Bram Moolenaar734d9982011-07-15 13:52:04 +0200733
Bram Moolenaar30a89472016-01-10 14:35:58 +0100734 C. Move the "vim74" directory into the Vim installation subdirectory
Bram Moolenaar734d9982011-07-15 13:52:04 +0200735 ---------------------------------------------------------------------
Bram Moolenaar30a89472016-01-10 14:35:58 +0100736 Move the "vim74" subdirectory into the subdirectory where you want Vim
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100737 to be installed. Typically, this subdirectory will be named "vim".
Bram Moolenaar30a89472016-01-10 14:35:58 +0100738 If you already have a "vim74" subdirectory in "vim", delete it first
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100739 by running its uninstal.exe program.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200740
741 D. Install Vim
742 ---------------
Bram Moolenaar30a89472016-01-10 14:35:58 +0100743 "cd" to your Vim installation subdirectory "vim\vim74" and run the
Bram Moolenaar734d9982011-07-15 13:52:04 +0200744 "install.exe" program. It will ask you a number of questions about
745 how you would like to have your Vim setup. Among these are:
746 - You can tell it to write a "_vimrc" file with your preferences in the
747 parent directory.
748 - It can also install an "Edit with Vim" entry in the Windows Explorer
749 popup menu.
750 - You can have it create batch files, so that you can run Vim from the
751 console or in a shell. You can select one of the directories in your
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100752 PATH or add the directory to PATH using the Windows Control Panel.
Bram Moolenaar734d9982011-07-15 13:52:04 +0200753 - Create entries for Vim on the desktop and in the Start menu.
754
755Happy Vimming!