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