1INSTALL - Installation of Vim on different machines. 2 3This file contains instructions for compiling Vim. If you already have an 4executable version of Vim, you don't need this. 5 6Contents: 71. Generic 82. Unix 93. OS/2 (with EMX 0.9b) 104. Atari MiNT 11 12See INSTALLami.txt for Amiga 13See INSTALLmac.txt for Macintosh 14See INSTALLpc.txt for PC (Windows XP/Vista/7/8/10) 15See INSTALLvms.txt for VMS 16See INSTALLx.txt for cross-compiling on Unix 17See ../READMEdir/README_390.txt for z/OS and OS/390 Unix 18See ../runtime/doc/os_haiku.txt for Haiku 19 201. Generic 21========== 22 23If you compile Vim without specifying anything, you will get the default 24behaviour as is documented, which should be fine for most people. 25 26For features that you can't enable/disable in another way, you can edit the 27file "feature.h" to match your preferences. 28 29 302. Unix 31======= 32 33Summary: 341. make run configure, compile and link 352. make install installation in /usr/local 36 37This will include the GUI and X11 libraries, if you have them. If you want a 38version of Vim that is small and starts up quickly, see the Makefile for how 39to disable the GUI and X11. If you don't have GUI libraries and/or X11, these 40features will be disabled automatically. 41 42To built Vim on Ubuntu from scratch on a clean system using git: 43 Install tools required to be able to get and build Vim: 44 % sudo apt install git 45 % sudo apt install make 46 % sudo apt install clang 47 48 Build Vim with default features: 49 % git clone https://github.com/vim/vim.git 50 % cd vim/src 51 % make 52 53 Run tests to check there are no problems: 54 % make test 55 56 Install Vim in /usr/local: 57 % sudo make install 58 59 Add X windows clipboard support (also needed for GUI): 60 % sudo apt install libxt-dev 61 % make reconfig 62 63 Add GUI support (ignore compiler warnings): 64 % sudo apt install libgtk2.0-dev 65 % make reconfig 66 67 Add Python 3 support: 68 % sudo apt install libpython3-dev 69 Uncomment this line in Makefile: 70 "CONF_OPT_PYTHON3 = --enable-python3interp" 71 % make reconfig 72 73 Debugging: 74 % sudo apt install valgrind 75 Uncomment this line in Makefile: 76 CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 77 % make reconfig 78 % make test_{test-name} 79 See output in testdir/valgrind.test_{test-name} 80 81 82See the start of Makefile for more detailed instructions about how to compile 83Vim. 84 85If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS 86before starting configure. Example: 87 88 env CFLAGS=-I/usr/local/include LIBS=-lm make 89 90This is only needed for things that configure doesn't offer a specific argument 91for or figures out by itself. First try running configure without extra 92arguments. 93 94GNU Autoconf and a few other tools have been used to make Vim work on many 95different Unix systems. The advantage of this is that Vim should compile 96on most systems without any adjustments. The disadvantage is that when 97adjustments are required, it takes some time to understand what is happening. 98 99If configure finds all library files and then complains when linking that some 100of them can't be found, your linker doesn't return an error code for missing 101libraries. Vim should be linked fine anyway, mostly you can just ignore these 102errors. 103 104If you run configure by hand (not using the Makefile), remember that any 105changes in the Makefile have no influence on configure. This may be what you 106want, but maybe not! 107 108The advantage of running configure separately, is that you can write a script 109to build Vim, without changing the Makefile or feature.h. Example (using sh): 110 111 CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif 112 113One thing to watch out for: If the configure script itself changes, running 114"make" will execute it again, but without your arguments. Do "make clean" and 115run configure again. 116 117If you are compiling Vim for several machines, for each machine: 118 a. make shadow 119 b. mv shadow machine_name 120 c. cd machine_name 121 d. make; make install 122 123[Don't use a path for machine_name, just a directory name, otherwise the links 124that "make shadow" creates won't work.] 125 126 127Unix: COMPILING WITH/WITHOUT GUI 128 129NOTE: This is incomplete, look in Makefile for more info. 130 131These configure arguments can be used to select which GUI to use: 132--enable-gui=gtk or: gtk2, motif, athena or auto 133--disable-gtk-check 134--disable-motif-check 135--disable-athena-check 136 137--enable-gui defaults to "auto", so it will automatically look for a GUI (in 138the order of GTK, Motif, then Athena). If one is found, then is uses it and 139does not proceed to check any of the remaining ones. Otherwise, it moves on 140to the next one. 141 142--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if 143--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will 144be checked for. If you want to *exclude* a certain check, then you use 145--disable-{gtk,gtk2,kde,motif,athena}-check. 146 147For example, if --enable-gui is set to "auto", but you don't want it look for 148Motif, you then also specify --disable-motif-check. This results in only 149checking for GTK and Athena. 150 151Lastly, if you know which one you want to use, then you can just do 152--enable-gui={gtk,gtk2,kde,motif,athena}. So if you wanted to only use Motif, 153then you'd specify --enable-gui=motif. Once you specify what you want, the 154--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored. 155 156On Linux you usually need GUI "-devel" packages. You may already have GTK 157libraries installed, but that doesn't mean you can compile Vim with GTK, you 158also need the header files. 159 160For compiling with the GTK+ GUI, you need a recent version of glib and gtk+. 161Configure checks for at least version 1.1.16. An older version is not selected 162automatically. If you want to use it anyway, run configure with 163"--disable-gtktest". 164GTK requires an ANSI C compiler. If you fail to compile Vim with GTK+ (it 165is the preferred choice), try selecting another one in the Makefile. 166If you are sure you have GTK installed, but for some reason configure says you 167do not, you may have left-over header files and/or library files from an older 168(and incompatible) version of GTK. if this is the case, please check 169auto/config.log for any error messages that may give you a hint as to what's 170happening. 171 172There used to be a KDE version of Vim, using Qt libraries, but since it didn't 173work very well and there was no maintainer it was dropped. 174 175 176Unix: COMPILING WITH MULTI-BYTE 177 178When you want to compile with the multi-byte features enabled, make sure you 179compile on a machine where the locale settings actually work, otherwise the 180configure tests may fail. You need to compile with "big" features: 181 182 ./configure --with-features=big 183 184Unix: COMPILING ON LINUX 185 186On Linux, when using -g to compile (which is default for gcc), the executable 187will probably be statically linked. If you don't want this, remove the -g 188option from CFLAGS. 189 190Unix: PUTTING vimrc IN /etc 191 192Some Linux distributions prefer to put the global vimrc file in /etc, and the 193Vim runtime files in /usr. This can be done with: 194 ./configure --prefix=/usr 195 make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e" 196 197Unix: COMPILING ON NeXT 198 199Add the "-posix" argument to the compiler by using one of these commands: 200 setenv CC 'cc -posix' (csh) 201 export CC='cc -posix' (sh) 202And run configure with "--disable-motif-check". 203 204Unix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local 205 206Sometimes it is necessary to search different path than /usr/local for locally 207installed headers (/usr/local/include) and libraries (/usr/local/lib). 208To search /stranger/include and /stranger/lib for locally installed 209headers and libraries, use: 210 ./configure --with-local-dir=/stranger 211And to not search for locally installed headers and libraries at all, use: 212 ./configure --without-local-dir 213 214 2153. OS/2 216======= 217 218OS/2 support was removed in patch 7.4.1008 219 220 2214. Atari MiNT 222============= 223 224Atari MiNT support was removed in patch 8.2.1215. 225