Skip to content
Newer
Older
100644 379 lines (264 sloc) 13.8 KB
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
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
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
6 More information can be found here: (Very stale now.)
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
7
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
8 http://mywebpage.netscape.com/sharppeople/vim/howto/
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
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
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
14 With the exception of the last two sections (Windows 3.1 and MS-DOS),
15 this document assumes that you are building Vim for Win32
16 (Windows NT/2000/XP/2003/Vista and Windows 95/98/Me)
17
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
18
19 Contents:
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
20 1. Microsoft Visual C++
21 2. Using MinGW
22 3. Cygwin
23 4. Borland
24 5. Cross compiling for Win32 from a Linux machine
25 6. Building with Python support
26 7. Building with MzScheme support
27 8. Windows 3.1
28 9. MS-DOS
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
29
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
30 The currently preferred method is using the free Visual C++ Toolkit 2003.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
31
32
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
33 1. Microsoft Visual C++
34 =======================
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
35
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
36 Visual Studio
37 -------------
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
38
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
39 Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, and VS .NET 2005)
40 is straightforward. (These instructions should also work for VS 4 and VS 5.)
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
41
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
42 To build Vim from the command line with MSVC, use Make_mvc.mak.
43 Visual Studio installed a batch file called vcvars32.bat, which you must
44 run to set up paths for nmake and MSVC.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
45
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
46 nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
47 nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
48 nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
49 nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
50 Perl, Python, etc.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
51
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
52 Make_mvc.mak allows a Vim to be built with various different features and
53 debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
54 For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
55
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
56 For compiling Gvim with IME support on far-east Windows, add IME=yes
57 to the parameters you pass to Make_mvc.mak.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
58
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
59 To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project.
60 (Note: Make_ivc.mak is not as rich as Make_mvc.mak, which allows for
61 far more configuration.) Make_ivc.mak can also be built with nmake.
62
63 nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
64 GUI Microsoft Visual C++ 4.x or later
65 nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
66 OLE Microsoft Visual C++ 4.x or later
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
67
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
68 See the specific files for comments and options.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
69
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
70 These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
71 Ron Aaron; they have been tested.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
72
73
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
74 Visual C++ Toolkit 2003
75 -----------------------
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
76
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
77 You can download the Microsoft Visual C++ Toolkit 2003 from
78 http://msdn.microsoft.com/visualc/vctoolkit2003/
79 This contains the command-line tools (compiler, linker, CRT headers,
80 and libraries) for Visual Studio .NET 2003, but not the Visual Studio IDE.
81 To compile and debug Vim with the VC2003 Toolkit, you will also need
82 |ms-platform-sdk|, |dotnet-1.1-redist|, |dotnet-1.1-sdk|,
83 and |windbg-download|.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
84
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
85 It's easier to download Visual C++ 2005 Express Edition, |msvc-2005-express|.
86 The advantage of the VC 2003 Toolkit is that it will be freely available
87 long after VC 2005 Express Edition stops being free in November 2006.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
88
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
89 The free Code::Blocks IDE works with the VC2003 Toolkit, as described at
90 http://wiki.codeblocks.org/index.php?title=Integrating_Microsoft_Visual_Toolkit_2003_with_Code::Blocks_IDE
91 (This site also takes you through configuring a number of other
92 free C compilers for Win32.)
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
93
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
94 To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first
95 execute the following commands in a cmd.exe window (the msvcsetup.bat batch
96 file can be used):
97
98 set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH%
99 call "%VCToolkitInstallDir%vcvars32.bat"
100 set MSVCVer=7.1
101 call "%ProgramFiles%\Microsoft Platform SDK\SetEnv.Cmd"
102 set LIB=%ProgramFiles%\Microsoft Visual Studio .NET 2003\Vc7\lib;%LIB%
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
103
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
104 Now you can build Vim with Make_mvc.mak.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
105
106
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
107 Getting the Windows Platform SDK *ms-platform-sdk*
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
108
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
109 You will also need a copy of the Windows Platform SDK from
110 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
111 Specifically, you need the Windows Core SDK subset of the Platform SDK,
112 which contains the Windows headers and libraries.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
113
114
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
115 Getting the .NET Framework 1.1 Runtime *dotnet-1.1-redist*
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
116
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
117 You need the .NET Framework 1.1 Redistributable Package from
118 http://www.microsoft.com/downloads/details.aspx?familyid=262d25e3-f589-4842-8157-034d1e7cf3a3
119 or from Windows Update:
120 http://windowsupdate.microsoft.com/
121 This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe,
122 which is needed to link Vim.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
123
124
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
125 Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk*
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
126
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
127 You need the .NET Framework 1.1 SDK from
128 http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d
129 This contains some additional libraries needed to compile Vim,
130 such as msvcrt.lib. You must install |dotnet-1.1-redist| before
131 installing the .NET 1.1 SDK.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
132
133
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
134 Getting the WinDbg debugger *windbg-download*
135
136 The Debugging Tools for Windows can be downloaded from
137 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
138 This includes the WinDbg debugger, which you will want if you ever need
139 to debug Vim itself. An earlier version of the Debugging Tools
140 is also available through the Platform SDK, |ms-platform-sdk|.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
141
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
142
143 Visual C++ 2005 Express Edition
144 -------------------------------
145
146 Visual C++ 2005 Express Edition can be downloaded for free
147 before November 2006 from
148 http://msdn.microsoft.com/vstudio/express/visualC/default.aspx
149 This includes the IDE and the debugger. You will also need
150 |ms-platform-sdk|. You can build Vim with Make_mvc.mak.
151
152 Instructions for integrating the Platform SDK into VC Express:
153 http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx
154
155
156 2. MinGW
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
157 ========
158
159 (written by Ron Aaron: <ronaharon@yahoo.com>)
160
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
161 This is about how to produce a Win32 binary of gvim with MinGW.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
162
163 First, you need to get the 'mingw32' compiler, which is free for the download
164 at:
165
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
166 http://www.mingw.org/
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
167
168 Once you have downloaded the compiler binaries, unpack them on your hard disk
169 somewhere, and put them on your PATH. If you are on Win95/98 you can edit
170 your AUTOEXEC.BAT file with a line like:
171
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
172 set PATH=C:\GCC-2.95.2\BIN;%PATH%
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
173
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
174 or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
175 System, Advanced, and edit the environment from there.
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
176
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
177 Test if gcc is on your path. From a CMD (or COMMAND on '95/98) window:
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
178
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
179 C:\> gcc --version
180 2.95.2
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
181
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
182 C:\> make --version
183 GNU Make version 3.77 (...etc...)
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
184
185 Now you are ready to rock 'n' roll. Unpack the vim sources (look on
186 www.vim.org for exactly which version of the vim files you need).
187
188 Change directory to 'vim\src':
189
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
190 C:\> cd vim\src
191 C:\VIM\SRC>
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
192
193 and you type:
194
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
195 make -f Make_ming.mak gvim.exe
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
196
197 After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
198 directory.
199
200 You should not need to do *any* editing of any files to get vim compiled this
201 way. If, for some reason, you want the console-mode-only version of vim (this
202 is NOT recommended on Win32, especially on '95/'98!!!), you need only change
203 the 'gvim.exe' to 'vim.exe' in the 'make' commands given above.
204
205 If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
206 (also free!) and compress the file (typical compression is 50%). UPX can be
207 found at
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
208 http://www.upx.org/
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
209
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
210 ADDITION: NLS support with MinGW
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
211
212 (by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
213
214 If you want National Language Support, read the file src/po/README_mingw.txt.
215 You need to uncomment lines in Make_ming.mak to have NLS defined.
216
217
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
218 3. Cygwin
219 =========
220
221 Use Make_cyg.mak with Cygwin's GCC. See
222 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
223
224 The Cygnus one many not fully work yet.
225 With Cygnus gcc you can use the Unix Makefile instead (you need to get the
226 Unix archive then). Then you get a Cygwin application (feels like Vim is
227 runnin on Unix), while with Make_cyg.mak you get a Windows application (like
228 with the other makefiles).
229
230
231 4. Borland
232 ===========
233
234 Use Make_bc5.mak with Borland C++ 5.x. See
235 http://users.skynet.be/antoine.mechelynck/vim/compile.htm
236
237
238 5. Cross compiling for Win32 from a Linux machine
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
239 =================================================
240
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
241 [Update of 1) needs to be verified]
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
242
243 If you like, you can compile the 'mingw' Win32 version from the comfort of
244 your Linux (or other unix) box. To do this, you need to follow a few steps:
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
245 1) Install the mingw32 cross-compiler. See
246 http://www.libsdl.org/extras/win32/cross/README.txt
247 2) get the *unix* version of the vim sources
248 3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'.
249 4) make -f Make_ming.mak gvim.exe
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
250
251 Now you have created the Windows binary from your Linux box! Have fun...
252
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
253
254 6. Building with Python support
255 ===============================
e5c6ef7 updated for version 7.0001
vimboss authored Jun 13, 2004
256
257 (written by Ron Aaron: <ronaharon@yahoo.com>)
258
259 This has been tested with the mingw32 compiler, and the ActiveState
260 ActivePython:
261 http://www.ActiveState.com/Products/ActivePython/
262
263 After installing the ActivePython, you will have to create a 'mingw32'
264 'libpython20.a' to link with:
265 cd $PYTHON/libs
266 pexports python20.dll > python20.def
267 dlltool -d python20.def -l libpython20.a
268
269 Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
270 the root of the Python installation (C:\Python20, for example). If you are
271 cross-compiling on Linux with the mingw32 setup, you need to also convert all
272 the 'Include' files to *unix* line-endings. This bash command will do it
273 easily:
274 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
275
276 Now just do:
277 make -f Make_ming.mak gvim.exe
278
279 and you will end up with a Python-enabled, Win32 version. Enjoy!
8183e77 updated for version 7.0046
vimboss authored Jan 31, 2005
280
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
281
282 7. Building with MzScheme support
283 =================================
8183e77 updated for version 7.0046
vimboss authored Jan 31, 2005
284
285 (written by Sergey Khorev <sergey.khorev@gmail.com>)
286
287 Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
288 be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
289 above (including 299 and 30x series).
290
291 The MSVC build is quite straightforward. Simply invoke (in one line)
292 nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
293 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
294 where <MzScheme-version> is the last seven characters from MzScheme dll name
295 (libmzschXXXXXXX.dll).
296 If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
297 DLL's, but will load them in runtime on demand.
298
299 Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
300 account that <Path-to-MzScheme> should contain slashes rather than backslashes
301 (e.g. d:/Develop/MzScheme)
302
303 "Static" MzScheme support (Vim executable will depend on MzScheme DLLs
304 explicitly) on MinGW and Cygwin requires additional step.
305
306 libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
307 %WINDOWS%\System32 to other location (either build directory, some temporary
308 dir or even MzScheme home).
309
310 Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
311 make -f Make_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
8183e77 updated for version 7.0046
vimboss authored Jan 31, 2005
312 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
313
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
314 After a successful build, these dlls can be freely removed, leaving them in
8183e77 updated for version 7.0046
vimboss authored Jan 31, 2005
315 %WINDOWS%\System32 only.
852a687 updated for version 7.0216
vimboss authored Mar 6, 2006
316
317
318 8. Windows 3.1x
319 ===============
320
321 make -f Make_w16.mak 16 bit, Borland C++ 5.0
322
323 Warning: Be sure to use the right make.exe. It should be Borland make.
324
325 You will almost certainly have to change the paths for libs and include files
326 in the Makefile. Look for "D:\BC5" and "ctl3dv2". You will get a number of
327 warnings which can be ignored ( _chmod, precompiled header files, and
328 "possibly incorrect assignment").
329
330 The makefile should also work for BC++ 4.0 and 4.5, but may need tweaking to
331 remove unsupported compiler & liker options.
332
333 For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER.
334 In MSVC 4.2 support for Win32s was dropped! Use this command:
335 nmake -f Make_mvc.mak GUI=yes
336
337
338 9. MS-DOS
339 =========
340
341 Summary:
342 ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++
343 ren Make_tcc.mak Makefile; make 16 bit, Turbo C
344 make -f Make_djg.mak 32 bit, DJGPP 2.0
345 make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to
346 define DOS)
347
348 Warning: Be sure to use the right make.exe. Microsoft C make doesn't work;
349 Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak;
350 DJGPP/GNU make must be used for Make_djg.mak.
351
352 The Borland C++ compiler has been used to generate the MS-DOS executable; it
353 should work without problems. You will probably have to change the paths for
354 LIBPATH and INCLUDEPATH in the start of the Makefile. You will get two
355 warnings which can be ignored (one about _chmod and one about precompiled
356 header files).
357
358 The "spawno" library by Ralf Brown was used in order to free memory when Vim
359 starts a shell or other external command. Only about 200 bytes are taken from
360 conventional memory. When recompiling get the spawno library from Simtel,
361 directory "msdos/c". It is called something like "spwno413.zip". Or follow
362 the instructions in the Makefile to remove the library.
363
364 The Turbo C Makefile has not been tested much lately. It is included for those
365 that don't have C++. You may need to make a few changes to get it to work.
366
367 DJGPP needs to be installed properly to compile Vim; you need a lot of things
368 before it works. When your setup is OK, Vim should compile with just one
369 warning (about an argument to signal()).
370
371 Make_bc5.mak is for those that have Borland C++ 5.0 or later. At the top of
372 the file, there are some variables you can change to make either a 32-bit
373 Windows exe (GUI or console mode), or a 16-bit MS-DOS version.
374 NOTE: multi-byte support is broken in the Borland libraries, not everything
375 will work properly! Esp. handling multi-byte file names.
376
377 If you get all kinds of strange error messages when compiling, try adding
378 changing the file format from "unix" to "dos".
Something went wrong with that request. Please try again.