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