xref: /vim-8.2.3635/src/INSTALL (revision 3d2bb8b6)
1071d4279SBram MoolenaarINSTALL - Installation of Vim on different machines.
2071d4279SBram Moolenaar
3071d4279SBram MoolenaarThis file contains instructions for compiling Vim. If you already have an
4071d4279SBram Moolenaarexecutable version of Vim, you don't need this.
5071d4279SBram Moolenaar
6071d4279SBram MoolenaarContents:
7071d4279SBram Moolenaar1. Generic
8071d4279SBram Moolenaar2. Unix
9b07269a5SBram Moolenaar3. OS/2 (with EMX 0.9b)
10b07269a5SBram Moolenaar4. Atari MiNT
11071d4279SBram Moolenaar
124e32e4bcSBram MoolenaarSee INSTALLami.txt              for Amiga
134e32e4bcSBram MoolenaarSee INSTALLmac.txt              for Macintosh
14c4568ab3SBram MoolenaarSee INSTALLpc.txt               for PC (Windows XP/Vista/7/8/10)
154e32e4bcSBram MoolenaarSee INSTALLvms.txt              for VMS
16c1a11ed5SBram MoolenaarSee INSTALLx.txt		for cross-compiling on Unix
17c4568ab3SBram MoolenaarSee ../READMEdir/README_390.txt for z/OS and OS/390 Unix
18b3f74069SBram MoolenaarSee ../runtime/doc/os_haiku.txt	for Haiku
19071d4279SBram Moolenaar
20071d4279SBram Moolenaar1. Generic
21071d4279SBram Moolenaar==========
22071d4279SBram Moolenaar
23071d4279SBram MoolenaarIf you compile Vim without specifying anything, you will get the default
24071d4279SBram Moolenaarbehaviour as is documented, which should be fine for most people.
25071d4279SBram Moolenaar
26071d4279SBram MoolenaarFor features that you can't enable/disable in another way, you can edit the
27071d4279SBram Moolenaarfile "feature.h" to match your preferences.
28071d4279SBram Moolenaar
29071d4279SBram Moolenaar
30071d4279SBram Moolenaar2. Unix
31071d4279SBram Moolenaar=======
32071d4279SBram Moolenaar
33071d4279SBram MoolenaarSummary:
34071d4279SBram Moolenaar1. make			run configure, compile and link
35071d4279SBram Moolenaar2. make install		installation in /usr/local
36071d4279SBram Moolenaar
37071d4279SBram MoolenaarThis will include the GUI and X11 libraries, if you have them.  If you want a
38071d4279SBram Moolenaarversion of Vim that is small and starts up quickly, see the Makefile for how
394e32e4bcSBram Moolenaarto disable the GUI and X11.  If you don't have GUI libraries and/or X11, these
40071d4279SBram Moolenaarfeatures will be disabled automatically.
41071d4279SBram Moolenaar
42*3d2bb8b6SBram MoolenaarTo built Vim on Ubuntu from scratch on a clean system using git:
43*3d2bb8b6SBram Moolenaar	Install tools required to be able to get and build Vim:
44*3d2bb8b6SBram Moolenaar	% sudo apt install git
45*3d2bb8b6SBram Moolenaar	% sudo apt install make
46*3d2bb8b6SBram Moolenaar	% sudo apt install clang
47*3d2bb8b6SBram Moolenaar
48*3d2bb8b6SBram Moolenaar	Build Vim with default features:
49*3d2bb8b6SBram Moolenaar	% git clone https://github.com/vim/vim.git
50*3d2bb8b6SBram Moolenaar	% cd vim/src
51*3d2bb8b6SBram Moolenaar	% make
52*3d2bb8b6SBram Moolenaar
53*3d2bb8b6SBram Moolenaar	Run tests to check there are no problems:
54*3d2bb8b6SBram Moolenaar	% make test
55*3d2bb8b6SBram Moolenaar
56*3d2bb8b6SBram Moolenaar	Install Vim in /usr/local:
57*3d2bb8b6SBram Moolenaar	% sudo make install
58*3d2bb8b6SBram Moolenaar
59*3d2bb8b6SBram Moolenaar	Add X windows clipboard support (also needed for GUI):
60*3d2bb8b6SBram Moolenaar	% sudo apt install libxt-dev
61*3d2bb8b6SBram Moolenaar	% make reconfig
62*3d2bb8b6SBram Moolenaar
63*3d2bb8b6SBram Moolenaar	Add GUI support (ignore compiler warnings):
64*3d2bb8b6SBram Moolenaar	% sudo apt install libgtk2.0-dev
65*3d2bb8b6SBram Moolenaar	% make reconfig
66*3d2bb8b6SBram Moolenaar
67*3d2bb8b6SBram Moolenaar	Add Python 3 support:
68*3d2bb8b6SBram Moolenaar	% sudo apt install libpython3-dev
69*3d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
70*3d2bb8b6SBram Moolenaar		"CONF_OPT_PYTHON3 = --enable-python3interp"
71*3d2bb8b6SBram Moolenaar	% make reconfig
72*3d2bb8b6SBram Moolenaar
73*3d2bb8b6SBram Moolenaar	Debugging:
74*3d2bb8b6SBram Moolenaar	% sudo apt install valgrind
75*3d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
76*3d2bb8b6SBram Moolenaar		CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
77*3d2bb8b6SBram Moolenaar	% make reconfig
78*3d2bb8b6SBram Moolenaar	% make test_{test-name}
79*3d2bb8b6SBram Moolenaar	See output in testdir/valgrind.test_{test-name}
80*3d2bb8b6SBram Moolenaar
81*3d2bb8b6SBram Moolenaar
82071d4279SBram MoolenaarSee the start of Makefile for more detailed instructions about how to compile
83071d4279SBram MoolenaarVim.
84071d4279SBram Moolenaar
85071d4279SBram MoolenaarIf you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
86071d4279SBram Moolenaarbefore starting configure.  Example:
87071d4279SBram Moolenaar
88071d4279SBram Moolenaar	env CFLAGS=-I/usr/local/include  LIBS=-lm  make
89071d4279SBram Moolenaar
90071d4279SBram MoolenaarThis is only needed for things that configure doesn't offer a specific argument
91071d4279SBram Moolenaarfor or figures out by itself.  First try running configure without extra
92071d4279SBram Moolenaararguments.
93071d4279SBram Moolenaar
94071d4279SBram MoolenaarGNU Autoconf and a few other tools have been used to make Vim work on many
95071d4279SBram Moolenaardifferent Unix systems.  The advantage of this is that Vim should compile
9664404479SBram Moolenaaron most systems without any adjustments.  The disadvantage is that when
97071d4279SBram Moolenaaradjustments are required, it takes some time to understand what is happening.
98071d4279SBram Moolenaar
99071d4279SBram MoolenaarIf configure finds all library files and then complains when linking that some
100071d4279SBram Moolenaarof them can't be found, your linker doesn't return an error code for missing
101071d4279SBram Moolenaarlibraries.  Vim should be linked fine anyway, mostly you can just ignore these
102071d4279SBram Moolenaarerrors.
103071d4279SBram Moolenaar
104071d4279SBram MoolenaarIf you run configure by hand (not using the Makefile), remember that any
105071d4279SBram Moolenaarchanges in the Makefile have no influence on configure.  This may be what you
106071d4279SBram Moolenaarwant, but maybe not!
107071d4279SBram Moolenaar
108071d4279SBram MoolenaarThe advantage of running configure separately, is that you can write a script
109071d4279SBram Moolenaarto build Vim, without changing the Makefile or feature.h.  Example (using sh):
110071d4279SBram Moolenaar
111071d4279SBram Moolenaar	CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
112071d4279SBram Moolenaar
113071d4279SBram MoolenaarOne thing to watch out for: If the configure script itself changes, running
114071d4279SBram Moolenaar"make" will execute it again, but without your arguments.  Do "make clean" and
115071d4279SBram Moolenaarrun configure again.
116071d4279SBram Moolenaar
117071d4279SBram MoolenaarIf you are compiling Vim for several machines, for each machine:
118071d4279SBram Moolenaar  a.    make shadow
119071d4279SBram Moolenaar  b.    mv shadow machine_name
120071d4279SBram Moolenaar  c.    cd machine_name
121071d4279SBram Moolenaar  d.    make; make install
122071d4279SBram Moolenaar
123071d4279SBram Moolenaar[Don't use a path for machine_name, just a directory name, otherwise the links
124071d4279SBram Moolenaarthat "make shadow" creates won't work.]
125071d4279SBram Moolenaar
126071d4279SBram Moolenaar
127071d4279SBram MoolenaarUnix: COMPILING WITH/WITHOUT GUI
128071d4279SBram Moolenaar
1294e32e4bcSBram MoolenaarNOTE: This is incomplete, look in Makefile for more info.
1304e32e4bcSBram Moolenaar
131071d4279SBram MoolenaarThese configure arguments can be used to select which GUI to use:
1324e32e4bcSBram Moolenaar--enable-gui=gtk      or: gtk2, motif, athena or auto
133071d4279SBram Moolenaar--disable-gtk-check
134071d4279SBram Moolenaar--disable-motif-check
135071d4279SBram Moolenaar--disable-athena-check
136071d4279SBram Moolenaar
137071d4279SBram Moolenaar--enable-gui defaults to "auto", so it will automatically look for a GUI (in
138071d4279SBram Moolenaarthe order of GTK, Motif, then Athena).  If one is found, then is uses it and
139071d4279SBram Moolenaardoes not proceed to check any of the remaining ones.  Otherwise, it moves on
140071d4279SBram Moolenaarto the next one.
141071d4279SBram Moolenaar
1424e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if
143071d4279SBram Moolenaar--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
144071d4279SBram Moolenaarbe checked for.  If you want to *exclude* a certain check, then you use
1454e32e4bcSBram Moolenaar--disable-{gtk,gtk2,kde,motif,athena}-check.
146071d4279SBram Moolenaar
147071d4279SBram MoolenaarFor example, if --enable-gui is set to "auto", but you don't want it look for
148071d4279SBram MoolenaarMotif, you then also specify --disable-motif-check.  This results in only
149071d4279SBram Moolenaarchecking for GTK and Athena.
150071d4279SBram Moolenaar
151071d4279SBram MoolenaarLastly, if you know which one you want to use, then you can just do
1524e32e4bcSBram Moolenaar--enable-gui={gtk,gtk2,kde,motif,athena}.  So if you wanted to only use Motif,
1534e32e4bcSBram Moolenaarthen you'd specify --enable-gui=motif.  Once you specify what you want, the
1544e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored.
1554e32e4bcSBram Moolenaar
1564e32e4bcSBram MoolenaarOn Linux you usually need GUI "-devel" packages.  You may already have GTK
1574e32e4bcSBram Moolenaarlibraries installed, but that doesn't mean you can compile Vim with GTK, you
1584e32e4bcSBram Moolenaaralso need the header files.
159071d4279SBram Moolenaar
160071d4279SBram MoolenaarFor compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
1614e32e4bcSBram MoolenaarConfigure checks for at least version 1.1.16.  An older version is not selected
1624e32e4bcSBram Moolenaarautomatically.  If you want to use it anyway, run configure with
1634e32e4bcSBram Moolenaar"--disable-gtktest".
164071d4279SBram MoolenaarGTK requires an ANSI C compiler.  If you fail to compile Vim with GTK+ (it
165071d4279SBram Moolenaaris the preferred choice), try selecting another one in the Makefile.
166071d4279SBram MoolenaarIf you are sure you have GTK installed, but for some reason configure says you
167071d4279SBram Moolenaardo not, you may have left-over header files and/or library files from an older
168071d4279SBram Moolenaar(and incompatible) version of GTK.  if this is the case, please check
169071d4279SBram Moolenaarauto/config.log for any error messages that may give you a hint as to what's
170071d4279SBram Moolenaarhappening.
171071d4279SBram Moolenaar
1724e32e4bcSBram MoolenaarThere used to be a KDE version of Vim, using Qt libraries, but since it didn't
1734e32e4bcSBram Moolenaarwork very well and there was no maintainer it was dropped.
174843ee41eSBram Moolenaar
175843ee41eSBram Moolenaar
176071d4279SBram MoolenaarUnix: COMPILING WITH MULTI-BYTE
177071d4279SBram Moolenaar
178071d4279SBram MoolenaarWhen you want to compile with the multi-byte features enabled, make sure you
17964404479SBram Moolenaarcompile on a machine where the locale settings actually work, otherwise the
180071d4279SBram Moolenaarconfigure tests may fail.  You need to compile with "big" features:
181071d4279SBram Moolenaar
182071d4279SBram Moolenaar    ./configure --with-features=big
183071d4279SBram Moolenaar
184071d4279SBram MoolenaarUnix: COMPILING ON LINUX
185071d4279SBram Moolenaar
186071d4279SBram MoolenaarOn Linux, when using -g to compile (which is default for gcc), the executable
187071d4279SBram Moolenaarwill probably be statically linked.  If you don't want this, remove the -g
188071d4279SBram Moolenaaroption from CFLAGS.
189071d4279SBram Moolenaar
190071d4279SBram MoolenaarUnix: PUTTING vimrc IN /etc
191071d4279SBram Moolenaar
192071d4279SBram MoolenaarSome Linux distributions prefer to put the global vimrc file in /etc, and the
193071d4279SBram MoolenaarVim runtime files in /usr.  This can be done with:
194071d4279SBram Moolenaar	./configure --prefix=/usr
195071d4279SBram Moolenaar	make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
196071d4279SBram Moolenaar
197071d4279SBram MoolenaarUnix: COMPILING ON NeXT
198071d4279SBram Moolenaar
199071d4279SBram MoolenaarAdd the "-posix" argument to the compiler by using one of these commands:
200071d4279SBram Moolenaar	setenv CC 'cc -posix' (csh)
201071d4279SBram Moolenaar	export CC='cc -posix' (sh)
202071d4279SBram MoolenaarAnd run configure with "--disable-motif-check".
203071d4279SBram Moolenaar
204c236c16dSBram MoolenaarUnix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local
205c236c16dSBram Moolenaar
206c236c16dSBram MoolenaarSometimes it is necessary to search different path than /usr/local for locally
207c236c16dSBram Moolenaarinstalled headers (/usr/local/include) and libraries (/usr/local/lib).
208c236c16dSBram MoolenaarTo search /stranger/include and /stranger/lib for locally installed
209c236c16dSBram Moolenaarheaders and libraries, use:
210c236c16dSBram Moolenaar	./configure --with-local-dir=/stranger
211c236c16dSBram MoolenaarAnd to not search for locally installed headers and libraries at all, use:
212c236c16dSBram Moolenaar	./configure --without-local-dir
213c236c16dSBram Moolenaar
214071d4279SBram Moolenaar
215b07269a5SBram Moolenaar3. OS/2
216071d4279SBram Moolenaar=======
217071d4279SBram Moolenaar
218e7fedb6eSBram MoolenaarOS/2 support was removed in patch 7.4.1008
219071d4279SBram Moolenaar
220071d4279SBram Moolenaar
221b07269a5SBram Moolenaar4. Atari MiNT
222071d4279SBram Moolenaar=============
223071d4279SBram Moolenaar
224e3f915d1SBram MoolenaarAtari MiNT support was removed in patch 8.2.1215.
225