blob: d220e0e1bdc0c312989a096ab063fbc684ea1230 [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
6More information can be found here:
7
8 http://mywebpage.netscape.com/sharppeople/vim/howto/
9
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
14
15Contents:
161. MS-DOS
Bram Moolenaar97d29a12005-12-17 22:02:57 +0000172. Win32 (Windows XP/NT and Windows 95/98)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183. Windows NT with OpenNT
194. Windows 3.1
205. Using Mingw
216. Cross compiling for Win32 from a Linux machine
227. Building with Python support
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000238. Building with MzScheme support
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
25
261. MS-DOS
27=========
28
29Summary:
30ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++
31ren Make_tcc.mak Makefile; make 16 bit, Turbo C
32make -f Make_djg.mak 32 bit, DJGPP 2.0
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000033make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to
Bram Moolenaar071d4272004-06-13 20:20:40 +000034 define DOS)
35
36Warning: Be sure to use the right make.exe. Microsoft C make doesn't work;
37Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak;
38DJGPP/GNU make must be used for Make_djg.mak.
39
40The Borland C++ compiler has been used to generate the MS-DOS executable; it
41should work without problems. You will probably have to change the paths for
42LIBPATH and INCLUDEPATH in the start of the Makefile. You will get two
43warnings which can be ignored (one about _chmod and one about precompiled
44header files).
45
46The "spawno" library by Ralf Brown was used in order to free memory when Vim
47starts a shell or other external command. Only about 200 bytes are taken from
48conventional memory. When recompiling get the spawno library from Simtel,
49directory "msdos/c". It is called something like "spwno413.zip". Or follow
50the instructions in the Makefile to remove the library.
51
52The Turbo C Makefile has not been tested much lately. It is included for those
53that don't have C++. You may need to make a few changes to get it to work.
54
55DJGPP needs to be installed properly to compile Vim; you need a lot of things
56before it works. When your setup is OK, Vim should compile with just one
57warning (about an argument to signal()).
58
59Make_bc5.mak is for those that have Borland C++ 5.0 or later. At the top of
60the file, there are some variables you can change to make either a 32-bit
61Windows exe (GUI or console mode), or a 16-bit MS-DOS version.
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000062NOTE: multi-byte support is broken in the Borland libraries, not everything
63will work properly! Esp. handling multi-byte file names.
Bram Moolenaar071d4272004-06-13 20:20:40 +000064
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000065If you get all kinds of strange error messages when compiling, try adding
66changing the file format from "unix" to "dos".
Bram Moolenaar071d4272004-06-13 20:20:40 +000067
68
Bram Moolenaar97d29a12005-12-17 22:02:57 +0000692. Win32 (Windows NT/XP and Windows 95/98)
Bram Moolenaar071d4272004-06-13 20:20:40 +000070====================================
71
72Summary:
73vcvars32 Setup paths for nmake and MSVC
74
75nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++
76nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++
77nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++
78nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc.
79 Perl, Python, etc.
80 Microsoft Visual C++
81
82make -f Make_bc5.mak GUI Borland C++ 5.x
83make -f Make_bc5.mak console Borland C++ 5.x (change the file)
84nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim"
85 GUI Microsoft Visual C++ 4.x or later
86nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE"
87 OLE Microsoft Visual C++ 4.x or later
88
89make -f Make_cyg.mak various Cygnus gcc
Bram Moolenaar389cb3e2005-05-27 20:14:58 +000090make -f Make_ming.mak various MingW with gcc
Bram Moolenaar071d4272004-06-13 20:20:40 +000091
92See the specific files for comments and options.
93
94These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and
95Ron Aaron; they have been tested. The Cygnus one many not fully work yet.
96With Cygnus gcc you can use the Unix Makefile instead (you need to get the
97Unix archive then). Then you get a Cygwin application (feels like Vim is
98runnin on Unix), while with Make_cyg.mak you get a Windows application (like
99with the other makefiles).
100
101You can also use the Visual C++ IDE: use File/Open workspace, select the
102Make_ivc.mak file, then select Build/Build all. This builds the GUI version
103by default.
104
105Vim for Win32 compiles with the Microsoft Visual C++ 2.0 compiler and later,
106and with the Borland C++ 4.5 32-bit compiler and later. It compiles on
107Windows 95 and all four NT platforms: i386, Alpha, MIPS, and PowerPC. The
108NT/i386 and the Windows 95 binaries are identical. Use Make_mvc.mak to
109compile with Visual C++ and Make_bc5.mak to compile with Borland C++.
110
111Make_mvc.mak allows a Vim to be built with various different features and
112debug support. Debugging with MS Devstudio is provided by Make_dvc.mak.
113For a description of the use of Make_dvc.mak, look in Make_mvc.mak.
114
115For compiling Gvim with IME support on far-east Windows, uncomment the
116MULTI_BYTE_IME define in the src/feature.h file before compiling.
117
118The Win32 console binary was compiled with Visual C++ version 5.0, using
119Make_mvc.mak and Make_bc5.mak (Borland C). Other compilers should also work.
120If you get all kinds of strange error messages when compiling (you shouldn't
121with the Microsoft or Borland 32-bit compilers), try adding <CR> characters
122at the end of each line.
123
124You probably need to run "vcvars32" before using "nmake".
125
126For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER.
127In version 4.2 support for Win32s was dropped! Use this command:
128 nmake -f Make_mvc.mak GUI=yes
129
130See the respective Makefiles for more comments.
131
132
1333. Windows NT with OpenNT
134=========================
135
136(contributed by Michael A. Benzinger)
137
138Building Vim on OpenNT 2.0 on Windows NT 4.0, with Softway's prerelease gcc:
1391. export CONFIG_SHELL=//D/OpenNT/bin/sh
1402. Make the following exports for modifying config.mk:
141 export CFLAGS=-O -Wshadow
142 export X_PRE_LIBS=-lXmu
1432. Run configure as follows:
144 configure --prefix=/vim --bindir=/bin/opennt --enable-gui=Motif
145 If you don't have OpenNTif (Motif support), use this:
146 configure --prefix=/vim --bindir=/bin/opennt --enable-gui=Athena
1473. Edit Makefile to perform the following since the Makefile include syntax
148 differs from that of gmake:
149 #include config.mk
150 .include "config.mk"
1514. Change all install links to be "ln -f" and not "ln -s".
1525. Change to the 'ctags' directory and configure.
1536. Edit the Makefile and remove spurious spaces from lines 99 and 114.
1547. Change slink to "ln -f" from "ln -s".
1558. Return to the src directory.
1569. make
157
158
1594. Windows 3.1x
160===============
161
162make -f Make_w16.mak 16 bit, Borland C++ 5.0
163
164Warning: Be sure to use the right make.exe. It should be Borland make.
165
166You will almost certainly have to change the paths for libs and include files
167in the Makefile. Look for "D:\BC5" and "ctl3dv2". You will get a number of
168warnings which can be ignored ( _chmod, precompiled header files, and
169"possibly incorrect assignment").
170
171The makefile should also work for BC++ 4.0 and 4.5, but may need tweaking to
172remove unsupported compiler & liker options.
173
174
1755. Mingw
176========
177
178(written by Ron Aaron: <ronaharon@yahoo.com>)
179
180This is about how to produce a Win32 binary of gvim with Mingw.
181
182First, you need to get the 'mingw32' compiler, which is free for the download
183at:
184
185 http://www.mingw.org/
186
187Once you have downloaded the compiler binaries, unpack them on your hard disk
188somewhere, and put them on your PATH. If you are on Win95/98 you can edit
189your AUTOEXEC.BAT file with a line like:
190
191 set PATH=C:\GCC-2.95.2\BIN;%PATH%
192
193or on NT/2000, go to the Control Panel, System, and edit the environment from
194there.
195
196Test if gcc is on your path. From a CMD (or COMMAND on '95/98):
197
198 C:\> gcc --version
199 2.95.2
200
201 C:\> make --version
202 GNU Make version 3.77 (...etc...)
203
204Now you are ready to rock 'n' roll. Unpack the vim sources (look on
205www.vim.org for exactly which version of the vim files you need).
206
207Change directory to 'vim\src':
208
209 C:\> cd vim\src
210 C:\VIM\SRC>
211
212and you type:
213
214 make -f Make_ming.mak gvim.exe
215
216After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
217directory.
218
219You should not need to do *any* editing of any files to get vim compiled this
220way. If, for some reason, you want the console-mode-only version of vim (this
221is NOT recommended on Win32, especially on '95/'98!!!), you need only change
222the 'gvim.exe' to 'vim.exe' in the 'make' commands given above.
223
224If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
225(also free!) and compress the file (typical compression is 50%). UPX can be
226found at
227 http://upx.tsx.org/
228
229
230ADDITION: NLS support with Mingw
231
232(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
233
234If you want National Language Support, read the file src/po/README_mingw.txt.
235You need to uncomment lines in Make_ming.mak to have NLS defined.
236
237
2386. Cross compiling for Win32 from a Linux machine
239=================================================
240
241(written by Ron Aaron: <ronaharon@yahoo.com> with help from
242Martin Kahlert <martin.kahlert@infineon.com>)
243
244If you like, you can compile the 'mingw' Win32 version from the comfort of
245your Linux (or other unix) box. To do this, you need to follow a few steps:
246
247 1) Install the mingw32 cross-compiler (if you have it, go to step 2)
248 1a) from 'ftp://ftp.nanotech.wisc.edu/pub/khan/gnu-win32/mingw32/snapshots/gcc-2.95.2-1',
249 get:
250 binutils-19990818-1-src.tar.gz
251 mingw-msvcrt-20000203.zip
252 gcc-2.95.2-1-x86-win32.diff.gz
253 1b) from 'http://gcc.gnu.org/' get:
254 gcc-2.95.2.tar.gz
255 1c) create a place to put the compiler source and binaries:
256 (assuming you are in the home directory)
257 mkdir gcc-bin
258 mkdir gcc-src
259 1d) unpack the sources:
260 cd gcc-src
261 tar xzf ../binutils-19990818-1-src.tar.gz
262 tar xzf ../gcc-2.95.2.tar.gz
263 unzip ../mingw-msvcrt-20000203
264 1e) build the different tools:
265 export PREFIX=~/gcc-bin/
266 cd gcc-2.95.2
267 zcat ../gcc-2.95.2-1-x86-win32.diff.gz | patch -p1 -E
268 cd ../binutils-19990818
269 ./configure --target=i586-pc-mingw32msvc --prefix=$PREFIX
270 make
271 make install
272 cd ../gcc-2.95.2
273 ./configure --target=i586-pc-mingw32msvc \
274 --with-libs=~/gcc-bin/i386-mingw32msvc/lib \
275 --with-headers=~/gcc-bin/i386-mingw32msvc/include \
276 --enable-languages=c++ \
277 --prefix=$PREFIX
278 make
279 make install
280 1f) Add $PREFIX/bin to your $PATH.
281
282 2) get the *unix* version of the vim sources
283 3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'.
284 4) make -f Make_ming.mak gvim.exe
285
286Now you have created the Windows binary from your Linux box! Have fun...
287
2887. Building with Python support
289=================================================
290
291(written by Ron Aaron: <ronaharon@yahoo.com>)
292
293This has been tested with the mingw32 compiler, and the ActiveState
294ActivePython:
295 http://www.ActiveState.com/Products/ActivePython/
296
297After installing the ActivePython, you will have to create a 'mingw32'
298'libpython20.a' to link with:
299 cd $PYTHON/libs
300 pexports python20.dll > python20.def
301 dlltool -d python20.def -l libpython20.a
302
303Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to
304the root of the Python installation (C:\Python20, for example). If you are
305cross-compiling on Linux with the mingw32 setup, you need to also convert all
306the 'Include' files to *unix* line-endings. This bash command will do it
307easily:
308 for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
309
310Now just do:
311 make -f Make_ming.mak gvim.exe
312
313and you will end up with a Python-enabled, Win32 version. Enjoy!
Bram Moolenaar65c1b012005-01-31 19:02:28 +0000314
3158. Building with MzScheme support
316=================================================
317
318(written by Sergey Khorev <sergey.khorev@gmail.com>)
319
320Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can
321be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and
322above (including 299 and 30x series).
323
324The MSVC build is quite straightforward. Simply invoke (in one line)
325nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme>
326 [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>]
327where <MzScheme-version> is the last seven characters from MzScheme dll name
328(libmzschXXXXXXX.dll).
329If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme
330DLL's, but will load them in runtime on demand.
331
332Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into
333account that <Path-to-MzScheme> should contain slashes rather than backslashes
334(e.g. d:/Develop/MzScheme)
335
336"Static" MzScheme support (Vim executable will depend on MzScheme DLLs
337explicitly) on MinGW and Cygwin requires additional step.
338
339libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from
340%WINDOWS%\System32 to other location (either build directory, some temporary
341dir or even MzScheme home).
342
343Pass that path as MZSCHEME_DLLS parameter for Make. E.g.,
344make -fMake_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000
345 MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no
346
347After successful build these dlls can be freely removed, leaving them in
348%WINDOWS%\System32 only.