Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 97d29a1 | 2005-12-17 22:02:57 +0000 | [diff] [blame] | 17 | 2. Win32 (Windows XP/NT and Windows 95/98) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 23 | 8. Building with MzScheme support |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 24 | |
| 25 | |
| 26 | 1. MS-DOS |
| 27 | ========= |
| 28 | |
| 29 | Summary: |
| 30 | ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++ |
| 31 | ren Make_tcc.mak Makefile; make 16 bit, Turbo C |
| 32 | make -f Make_djg.mak 32 bit, DJGPP 2.0 |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 33 | make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 34 | define DOS) |
| 35 | |
| 36 | Warning: Be sure to use the right make.exe. Microsoft C make doesn't work; |
| 37 | Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak; |
| 38 | DJGPP/GNU make must be used for Make_djg.mak. |
| 39 | |
| 40 | The Borland C++ compiler has been used to generate the MS-DOS executable; it |
| 41 | should work without problems. You will probably have to change the paths for |
| 42 | LIBPATH and INCLUDEPATH in the start of the Makefile. You will get two |
| 43 | warnings which can be ignored (one about _chmod and one about precompiled |
| 44 | header files). |
| 45 | |
| 46 | The "spawno" library by Ralf Brown was used in order to free memory when Vim |
| 47 | starts a shell or other external command. Only about 200 bytes are taken from |
| 48 | conventional memory. When recompiling get the spawno library from Simtel, |
| 49 | directory "msdos/c". It is called something like "spwno413.zip". Or follow |
| 50 | the instructions in the Makefile to remove the library. |
| 51 | |
| 52 | The Turbo C Makefile has not been tested much lately. It is included for those |
| 53 | that don't have C++. You may need to make a few changes to get it to work. |
| 54 | |
| 55 | DJGPP needs to be installed properly to compile Vim; you need a lot of things |
| 56 | before it works. When your setup is OK, Vim should compile with just one |
| 57 | warning (about an argument to signal()). |
| 58 | |
| 59 | Make_bc5.mak is for those that have Borland C++ 5.0 or later. At the top of |
| 60 | the file, there are some variables you can change to make either a 32-bit |
| 61 | Windows exe (GUI or console mode), or a 16-bit MS-DOS version. |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 62 | NOTE: multi-byte support is broken in the Borland libraries, not everything |
| 63 | will work properly! Esp. handling multi-byte file names. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 64 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 65 | If you get all kinds of strange error messages when compiling, try adding |
| 66 | changing the file format from "unix" to "dos". |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 67 | |
| 68 | |
Bram Moolenaar | 97d29a1 | 2005-12-17 22:02:57 +0000 | [diff] [blame] | 69 | 2. Win32 (Windows NT/XP and Windows 95/98) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 70 | ==================================== |
| 71 | |
| 72 | Summary: |
| 73 | vcvars32 Setup paths for nmake and MSVC |
| 74 | |
| 75 | nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++ |
| 76 | nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++ |
| 77 | nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++ |
| 78 | nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc. |
| 79 | Perl, Python, etc. |
| 80 | Microsoft Visual C++ |
| 81 | |
| 82 | make -f Make_bc5.mak GUI Borland C++ 5.x |
| 83 | make -f Make_bc5.mak console Borland C++ 5.x (change the file) |
| 84 | nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim" |
| 85 | GUI Microsoft Visual C++ 4.x or later |
| 86 | nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE" |
| 87 | OLE Microsoft Visual C++ 4.x or later |
| 88 | |
| 89 | make -f Make_cyg.mak various Cygnus gcc |
Bram Moolenaar | 389cb3e | 2005-05-27 20:14:58 +0000 | [diff] [blame] | 90 | make -f Make_ming.mak various MingW with gcc |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 91 | |
| 92 | See the specific files for comments and options. |
| 93 | |
| 94 | These files have been supplied by George V. Reilly, Ben Singer, Ken Scott and |
| 95 | Ron Aaron; they have been tested. The Cygnus one many not fully work yet. |
| 96 | With Cygnus gcc you can use the Unix Makefile instead (you need to get the |
| 97 | Unix archive then). Then you get a Cygwin application (feels like Vim is |
| 98 | runnin on Unix), while with Make_cyg.mak you get a Windows application (like |
| 99 | with the other makefiles). |
| 100 | |
| 101 | You can also use the Visual C++ IDE: use File/Open workspace, select the |
| 102 | Make_ivc.mak file, then select Build/Build all. This builds the GUI version |
| 103 | by default. |
| 104 | |
| 105 | Vim for Win32 compiles with the Microsoft Visual C++ 2.0 compiler and later, |
| 106 | and with the Borland C++ 4.5 32-bit compiler and later. It compiles on |
| 107 | Windows 95 and all four NT platforms: i386, Alpha, MIPS, and PowerPC. The |
| 108 | NT/i386 and the Windows 95 binaries are identical. Use Make_mvc.mak to |
| 109 | compile with Visual C++ and Make_bc5.mak to compile with Borland C++. |
| 110 | |
| 111 | Make_mvc.mak allows a Vim to be built with various different features and |
| 112 | debug support. Debugging with MS Devstudio is provided by Make_dvc.mak. |
| 113 | For a description of the use of Make_dvc.mak, look in Make_mvc.mak. |
| 114 | |
| 115 | For compiling Gvim with IME support on far-east Windows, uncomment the |
| 116 | MULTI_BYTE_IME define in the src/feature.h file before compiling. |
| 117 | |
| 118 | The Win32 console binary was compiled with Visual C++ version 5.0, using |
| 119 | Make_mvc.mak and Make_bc5.mak (Borland C). Other compilers should also work. |
| 120 | If you get all kinds of strange error messages when compiling (you shouldn't |
| 121 | with the Microsoft or Borland 32-bit compilers), try adding <CR> characters |
| 122 | at the end of each line. |
| 123 | |
| 124 | You probably need to run "vcvars32" before using "nmake". |
| 125 | |
| 126 | For making the Win32s version, you need Microsoft Visual C++ 4.1 OR EARLIER. |
| 127 | In version 4.2 support for Win32s was dropped! Use this command: |
| 128 | nmake -f Make_mvc.mak GUI=yes |
| 129 | |
| 130 | See the respective Makefiles for more comments. |
| 131 | |
| 132 | |
| 133 | 3. Windows NT with OpenNT |
| 134 | ========================= |
| 135 | |
| 136 | (contributed by Michael A. Benzinger) |
| 137 | |
| 138 | Building Vim on OpenNT 2.0 on Windows NT 4.0, with Softway's prerelease gcc: |
| 139 | 1. export CONFIG_SHELL=//D/OpenNT/bin/sh |
| 140 | 2. Make the following exports for modifying config.mk: |
| 141 | export CFLAGS=-O -Wshadow |
| 142 | export X_PRE_LIBS=-lXmu |
| 143 | 2. 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 |
| 147 | 3. 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" |
| 151 | 4. Change all install links to be "ln -f" and not "ln -s". |
| 152 | 5. Change to the 'ctags' directory and configure. |
| 153 | 6. Edit the Makefile and remove spurious spaces from lines 99 and 114. |
| 154 | 7. Change slink to "ln -f" from "ln -s". |
| 155 | 8. Return to the src directory. |
| 156 | 9. make |
| 157 | |
| 158 | |
| 159 | 4. Windows 3.1x |
| 160 | =============== |
| 161 | |
| 162 | make -f Make_w16.mak 16 bit, Borland C++ 5.0 |
| 163 | |
| 164 | Warning: Be sure to use the right make.exe. It should be Borland make. |
| 165 | |
| 166 | You will almost certainly have to change the paths for libs and include files |
| 167 | in the Makefile. Look for "D:\BC5" and "ctl3dv2". You will get a number of |
| 168 | warnings which can be ignored ( _chmod, precompiled header files, and |
| 169 | "possibly incorrect assignment"). |
| 170 | |
| 171 | The makefile should also work for BC++ 4.0 and 4.5, but may need tweaking to |
| 172 | remove unsupported compiler & liker options. |
| 173 | |
| 174 | |
| 175 | 5. Mingw |
| 176 | ======== |
| 177 | |
| 178 | (written by Ron Aaron: <ronaharon@yahoo.com>) |
| 179 | |
| 180 | This is about how to produce a Win32 binary of gvim with Mingw. |
| 181 | |
| 182 | First, you need to get the 'mingw32' compiler, which is free for the download |
| 183 | at: |
| 184 | |
| 185 | http://www.mingw.org/ |
| 186 | |
| 187 | Once you have downloaded the compiler binaries, unpack them on your hard disk |
| 188 | somewhere, and put them on your PATH. If you are on Win95/98 you can edit |
| 189 | your AUTOEXEC.BAT file with a line like: |
| 190 | |
| 191 | set PATH=C:\GCC-2.95.2\BIN;%PATH% |
| 192 | |
| 193 | or on NT/2000, go to the Control Panel, System, and edit the environment from |
| 194 | there. |
| 195 | |
| 196 | Test 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 | |
| 204 | Now you are ready to rock 'n' roll. Unpack the vim sources (look on |
| 205 | www.vim.org for exactly which version of the vim files you need). |
| 206 | |
| 207 | Change directory to 'vim\src': |
| 208 | |
| 209 | C:\> cd vim\src |
| 210 | C:\VIM\SRC> |
| 211 | |
| 212 | and you type: |
| 213 | |
| 214 | make -f Make_ming.mak gvim.exe |
| 215 | |
| 216 | After churning for a while, you will end up with 'gvim.exe' in the 'vim\src' |
| 217 | directory. |
| 218 | |
| 219 | You should not need to do *any* editing of any files to get vim compiled this |
| 220 | way. If, for some reason, you want the console-mode-only version of vim (this |
| 221 | is NOT recommended on Win32, especially on '95/'98!!!), you need only change |
| 222 | the 'gvim.exe' to 'vim.exe' in the 'make' commands given above. |
| 223 | |
| 224 | If 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 |
| 226 | found at |
| 227 | http://upx.tsx.org/ |
| 228 | |
| 229 | |
| 230 | ADDITION: NLS support with Mingw |
| 231 | |
| 232 | (by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>) |
| 233 | |
| 234 | If you want National Language Support, read the file src/po/README_mingw.txt. |
| 235 | You need to uncomment lines in Make_ming.mak to have NLS defined. |
| 236 | |
| 237 | |
| 238 | 6. Cross compiling for Win32 from a Linux machine |
| 239 | ================================================= |
| 240 | |
| 241 | (written by Ron Aaron: <ronaharon@yahoo.com> with help from |
| 242 | Martin Kahlert <martin.kahlert@infineon.com>) |
| 243 | |
| 244 | If you like, you can compile the 'mingw' Win32 version from the comfort of |
| 245 | your 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 | |
| 286 | Now you have created the Windows binary from your Linux box! Have fun... |
| 287 | |
| 288 | 7. Building with Python support |
| 289 | ================================================= |
| 290 | |
| 291 | (written by Ron Aaron: <ronaharon@yahoo.com>) |
| 292 | |
| 293 | This has been tested with the mingw32 compiler, and the ActiveState |
| 294 | ActivePython: |
| 295 | http://www.ActiveState.com/Products/ActivePython/ |
| 296 | |
| 297 | After 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 | |
| 303 | Once that is done, edit the 'Make_ming.mak' so the PYTHON variable points to |
| 304 | the root of the Python installation (C:\Python20, for example). If you are |
| 305 | cross-compiling on Linux with the mingw32 setup, you need to also convert all |
| 306 | the 'Include' files to *unix* line-endings. This bash command will do it |
| 307 | easily: |
| 308 | for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil |
| 309 | |
| 310 | Now just do: |
| 311 | make -f Make_ming.mak gvim.exe |
| 312 | |
| 313 | and you will end up with a Python-enabled, Win32 version. Enjoy! |
Bram Moolenaar | 65c1b01 | 2005-01-31 19:02:28 +0000 | [diff] [blame] | 314 | |
| 315 | 8. Building with MzScheme support |
| 316 | ================================================= |
| 317 | |
| 318 | (written by Sergey Khorev <sergey.khorev@gmail.com>) |
| 319 | |
| 320 | Vim with MzScheme (http://www.plt-scheme.org/software/mzscheme) support can |
| 321 | be built with either MSVC, or MinGW, or Cygwin. Supported versions are 205 and |
| 322 | above (including 299 and 30x series). |
| 323 | |
| 324 | The MSVC build is quite straightforward. Simply invoke (in one line) |
| 325 | nmake -fMake_mvc.mak MZSCHEME=<Path-to-MzScheme> |
| 326 | [MZSCHEME_VER=<MzScheme-version>] [DYNAMIC_MZSCHEME=<yes or no>] |
| 327 | where <MzScheme-version> is the last seven characters from MzScheme dll name |
| 328 | (libmzschXXXXXXX.dll). |
| 329 | If DYNAMIC_MZSCHEME=yes, resulting executable will not depend on MzScheme |
| 330 | DLL's, but will load them in runtime on demand. |
| 331 | |
| 332 | Building dynamic MzScheme support on MinGW and Cygwin is similar. Take into |
| 333 | account 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 |
| 337 | explicitly) on MinGW and Cygwin requires additional step. |
| 338 | |
| 339 | libmzschXXXXXXX.dll and libmzgcXXXXXXX.dll should be copied from |
| 340 | %WINDOWS%\System32 to other location (either build directory, some temporary |
| 341 | dir or even MzScheme home). |
| 342 | |
| 343 | Pass that path as MZSCHEME_DLLS parameter for Make. E.g., |
| 344 | make -fMake_cyg.mak MZSCHEME=d:/Develop/MzScheme MZSCHEME_VER=209_000 |
| 345 | MZSCHEME_DLLS=c:/Temp DYNAMIC_MZSCHEME=no |
| 346 | |
| 347 | After successful build these dlls can be freely removed, leaving them in |
| 348 | %WINDOWS%\System32 only. |