xref: /vim-8.2.3635/src/INSTALL (revision 89a9c159)
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
4211e3c5baSBram MoolenaarTo build Vim on Ubuntu from scratch on a clean system using git:
433d2bb8b6SBram Moolenaar	Install tools required to be able to get and build Vim:
443d2bb8b6SBram Moolenaar	% sudo apt install git
453d2bb8b6SBram Moolenaar	% sudo apt install make
463d2bb8b6SBram Moolenaar	% sudo apt install clang
47*89a9c159SBram Moolenaar	% sudo apt install libtool-bin
483d2bb8b6SBram Moolenaar
493d2bb8b6SBram Moolenaar	Build Vim with default features:
503d2bb8b6SBram Moolenaar	% git clone https://github.com/vim/vim.git
513d2bb8b6SBram Moolenaar	% cd vim/src
523d2bb8b6SBram Moolenaar	% make
533d2bb8b6SBram Moolenaar
543d2bb8b6SBram Moolenaar	Run tests to check there are no problems:
553d2bb8b6SBram Moolenaar	% make test
563d2bb8b6SBram Moolenaar
573d2bb8b6SBram Moolenaar	Install Vim in /usr/local:
583d2bb8b6SBram Moolenaar	% sudo make install
593d2bb8b6SBram Moolenaar
603d2bb8b6SBram Moolenaar	Add X windows clipboard support (also needed for GUI):
613d2bb8b6SBram Moolenaar	% sudo apt install libxt-dev
623d2bb8b6SBram Moolenaar	% make reconfig
633d2bb8b6SBram Moolenaar
64c8cdf0f8SBram Moolenaar	Add GUI support:
65c8cdf0f8SBram Moolenaar	% sudo apt install libgtk-3-dev
663d2bb8b6SBram Moolenaar	% make reconfig
673d2bb8b6SBram Moolenaar
683d2bb8b6SBram Moolenaar	Add Python 3 support:
693d2bb8b6SBram Moolenaar	% sudo apt install libpython3-dev
703d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
713d2bb8b6SBram Moolenaar		"CONF_OPT_PYTHON3 = --enable-python3interp"
723d2bb8b6SBram Moolenaar	% make reconfig
733d2bb8b6SBram Moolenaar
743d2bb8b6SBram Moolenaar	Debugging:
753d2bb8b6SBram Moolenaar	% sudo apt install valgrind
763d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
773d2bb8b6SBram Moolenaar		CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
783d2bb8b6SBram Moolenaar	% make reconfig
793d2bb8b6SBram Moolenaar	% make test_{test-name}
803d2bb8b6SBram Moolenaar	See output in testdir/valgrind.test_{test-name}
813d2bb8b6SBram Moolenaar
823d2bb8b6SBram Moolenaar
83071d4279SBram MoolenaarSee the start of Makefile for more detailed instructions about how to compile
84071d4279SBram MoolenaarVim.
85071d4279SBram Moolenaar
86071d4279SBram MoolenaarIf you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
87071d4279SBram Moolenaarbefore starting configure.  Example:
88071d4279SBram Moolenaar
89071d4279SBram Moolenaar	env CFLAGS=-I/usr/local/include  LIBS=-lm  make
90071d4279SBram Moolenaar
91071d4279SBram MoolenaarThis is only needed for things that configure doesn't offer a specific argument
92071d4279SBram Moolenaarfor or figures out by itself.  First try running configure without extra
93071d4279SBram Moolenaararguments.
94071d4279SBram Moolenaar
95071d4279SBram MoolenaarGNU Autoconf and a few other tools have been used to make Vim work on many
96071d4279SBram Moolenaardifferent Unix systems.  The advantage of this is that Vim should compile
9764404479SBram Moolenaaron most systems without any adjustments.  The disadvantage is that when
98071d4279SBram Moolenaaradjustments are required, it takes some time to understand what is happening.
99071d4279SBram Moolenaar
100071d4279SBram MoolenaarIf configure finds all library files and then complains when linking that some
101071d4279SBram Moolenaarof them can't be found, your linker doesn't return an error code for missing
102071d4279SBram Moolenaarlibraries.  Vim should be linked fine anyway, mostly you can just ignore these
103071d4279SBram Moolenaarerrors.
104071d4279SBram Moolenaar
105071d4279SBram MoolenaarIf you run configure by hand (not using the Makefile), remember that any
106071d4279SBram Moolenaarchanges in the Makefile have no influence on configure.  This may be what you
107071d4279SBram Moolenaarwant, but maybe not!
108071d4279SBram Moolenaar
109071d4279SBram MoolenaarThe advantage of running configure separately, is that you can write a script
110071d4279SBram Moolenaarto build Vim, without changing the Makefile or feature.h.  Example (using sh):
111071d4279SBram Moolenaar
112071d4279SBram Moolenaar	CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
113071d4279SBram Moolenaar
114071d4279SBram MoolenaarOne thing to watch out for: If the configure script itself changes, running
115071d4279SBram Moolenaar"make" will execute it again, but without your arguments.  Do "make clean" and
116071d4279SBram Moolenaarrun configure again.
117071d4279SBram Moolenaar
118071d4279SBram MoolenaarIf you are compiling Vim for several machines, for each machine:
119071d4279SBram Moolenaar  a.    make shadow
120071d4279SBram Moolenaar  b.    mv shadow machine_name
121071d4279SBram Moolenaar  c.    cd machine_name
122071d4279SBram Moolenaar  d.    make; make install
123071d4279SBram Moolenaar
124071d4279SBram Moolenaar[Don't use a path for machine_name, just a directory name, otherwise the links
125071d4279SBram Moolenaarthat "make shadow" creates won't work.]
126071d4279SBram Moolenaar
127071d4279SBram Moolenaar
128071d4279SBram MoolenaarUnix: COMPILING WITH/WITHOUT GUI
129071d4279SBram Moolenaar
1304e32e4bcSBram MoolenaarNOTE: This is incomplete, look in Makefile for more info.
1314e32e4bcSBram Moolenaar
132071d4279SBram MoolenaarThese configure arguments can be used to select which GUI to use:
1334e32e4bcSBram Moolenaar--enable-gui=gtk      or: gtk2, motif, athena or auto
134071d4279SBram Moolenaar--disable-gtk-check
135071d4279SBram Moolenaar--disable-motif-check
136071d4279SBram Moolenaar--disable-athena-check
137071d4279SBram Moolenaar
138c8cdf0f8SBram MoolenaarThis configure argument can be used to disable the GUI, even when the necessary
139c8cdf0f8SBram Moolenaarfiles are found:
140c8cdf0f8SBram Moolenaar--disable-gui
141c8cdf0f8SBram Moolenaar
142071d4279SBram Moolenaar--enable-gui defaults to "auto", so it will automatically look for a GUI (in
143c8cdf0f8SBram Moolenaarthe order of GTK, Motif, then Athena).  If one is found, then it is used and
144071d4279SBram Moolenaardoes not proceed to check any of the remaining ones.  Otherwise, it moves on
145071d4279SBram Moolenaarto the next one.
146071d4279SBram Moolenaar
1474e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if
148071d4279SBram Moolenaar--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
149071d4279SBram Moolenaarbe checked for.  If you want to *exclude* a certain check, then you use
1504e32e4bcSBram Moolenaar--disable-{gtk,gtk2,kde,motif,athena}-check.
151071d4279SBram Moolenaar
152071d4279SBram MoolenaarFor example, if --enable-gui is set to "auto", but you don't want it look for
153071d4279SBram MoolenaarMotif, you then also specify --disable-motif-check.  This results in only
154071d4279SBram Moolenaarchecking for GTK and Athena.
155071d4279SBram Moolenaar
156071d4279SBram MoolenaarLastly, if you know which one you want to use, then you can just do
1574e32e4bcSBram Moolenaar--enable-gui={gtk,gtk2,kde,motif,athena}.  So if you wanted to only use Motif,
1584e32e4bcSBram Moolenaarthen you'd specify --enable-gui=motif.  Once you specify what you want, the
1594e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored.
1604e32e4bcSBram Moolenaar
1614e32e4bcSBram MoolenaarOn Linux you usually need GUI "-devel" packages.  You may already have GTK
1624e32e4bcSBram Moolenaarlibraries installed, but that doesn't mean you can compile Vim with GTK, you
1634e32e4bcSBram Moolenaaralso need the header files.
164071d4279SBram Moolenaar
165071d4279SBram MoolenaarFor compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
1664e32e4bcSBram MoolenaarConfigure checks for at least version 1.1.16.  An older version is not selected
1674e32e4bcSBram Moolenaarautomatically.  If you want to use it anyway, run configure with
1684e32e4bcSBram Moolenaar"--disable-gtktest".
169071d4279SBram MoolenaarGTK requires an ANSI C compiler.  If you fail to compile Vim with GTK+ (it
170071d4279SBram Moolenaaris the preferred choice), try selecting another one in the Makefile.
171071d4279SBram MoolenaarIf you are sure you have GTK installed, but for some reason configure says you
172071d4279SBram Moolenaardo not, you may have left-over header files and/or library files from an older
173071d4279SBram Moolenaar(and incompatible) version of GTK.  if this is the case, please check
174071d4279SBram Moolenaarauto/config.log for any error messages that may give you a hint as to what's
175071d4279SBram Moolenaarhappening.
176071d4279SBram Moolenaar
1774e32e4bcSBram MoolenaarThere used to be a KDE version of Vim, using Qt libraries, but since it didn't
1784e32e4bcSBram Moolenaarwork very well and there was no maintainer it was dropped.
179843ee41eSBram Moolenaar
180843ee41eSBram Moolenaar
181071d4279SBram MoolenaarUnix: COMPILING WITH MULTI-BYTE
182071d4279SBram Moolenaar
183071d4279SBram MoolenaarWhen you want to compile with the multi-byte features enabled, make sure you
18464404479SBram Moolenaarcompile on a machine where the locale settings actually work, otherwise the
185071d4279SBram Moolenaarconfigure tests may fail.  You need to compile with "big" features:
186071d4279SBram Moolenaar
187071d4279SBram Moolenaar    ./configure --with-features=big
188071d4279SBram Moolenaar
189071d4279SBram MoolenaarUnix: COMPILING ON LINUX
190071d4279SBram Moolenaar
191071d4279SBram MoolenaarOn Linux, when using -g to compile (which is default for gcc), the executable
192071d4279SBram Moolenaarwill probably be statically linked.  If you don't want this, remove the -g
193071d4279SBram Moolenaaroption from CFLAGS.
194071d4279SBram Moolenaar
195071d4279SBram MoolenaarUnix: PUTTING vimrc IN /etc
196071d4279SBram Moolenaar
197071d4279SBram MoolenaarSome Linux distributions prefer to put the global vimrc file in /etc, and the
198071d4279SBram MoolenaarVim runtime files in /usr.  This can be done with:
199071d4279SBram Moolenaar	./configure --prefix=/usr
200071d4279SBram Moolenaar	make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
201071d4279SBram Moolenaar
202071d4279SBram MoolenaarUnix: COMPILING ON NeXT
203071d4279SBram Moolenaar
204071d4279SBram MoolenaarAdd the "-posix" argument to the compiler by using one of these commands:
205071d4279SBram Moolenaar	setenv CC 'cc -posix' (csh)
206071d4279SBram Moolenaar	export CC='cc -posix' (sh)
207071d4279SBram MoolenaarAnd run configure with "--disable-motif-check".
208071d4279SBram Moolenaar
209c236c16dSBram MoolenaarUnix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local
210c236c16dSBram Moolenaar
211c236c16dSBram MoolenaarSometimes it is necessary to search different path than /usr/local for locally
212c236c16dSBram Moolenaarinstalled headers (/usr/local/include) and libraries (/usr/local/lib).
213c236c16dSBram MoolenaarTo search /stranger/include and /stranger/lib for locally installed
214c236c16dSBram Moolenaarheaders and libraries, use:
215c236c16dSBram Moolenaar	./configure --with-local-dir=/stranger
216c236c16dSBram MoolenaarAnd to not search for locally installed headers and libraries at all, use:
217c236c16dSBram Moolenaar	./configure --without-local-dir
218c236c16dSBram Moolenaar
219071d4279SBram Moolenaar
220b07269a5SBram Moolenaar3. OS/2
221071d4279SBram Moolenaar=======
222071d4279SBram Moolenaar
223e7fedb6eSBram MoolenaarOS/2 support was removed in patch 7.4.1008
224071d4279SBram Moolenaar
225071d4279SBram Moolenaar
226b07269a5SBram Moolenaar4. Atari MiNT
227071d4279SBram Moolenaar=============
228071d4279SBram Moolenaar
229e3f915d1SBram MoolenaarAtari MiNT support was removed in patch 8.2.1215.
230