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