xref: /vim-8.2.3635/src/INSTALL (revision c8cdf0f8)
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
423d2bb8b6SBram MoolenaarTo built 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
473d2bb8b6SBram Moolenaar
483d2bb8b6SBram Moolenaar	Build Vim with default features:
493d2bb8b6SBram Moolenaar	% git clone https://github.com/vim/vim.git
503d2bb8b6SBram Moolenaar	% cd vim/src
513d2bb8b6SBram Moolenaar	% make
523d2bb8b6SBram Moolenaar
533d2bb8b6SBram Moolenaar	Run tests to check there are no problems:
543d2bb8b6SBram Moolenaar	% make test
553d2bb8b6SBram Moolenaar
563d2bb8b6SBram Moolenaar	Install Vim in /usr/local:
573d2bb8b6SBram Moolenaar	% sudo make install
583d2bb8b6SBram Moolenaar
593d2bb8b6SBram Moolenaar	Add X windows clipboard support (also needed for GUI):
603d2bb8b6SBram Moolenaar	% sudo apt install libxt-dev
613d2bb8b6SBram Moolenaar	% make reconfig
623d2bb8b6SBram Moolenaar
63*c8cdf0f8SBram Moolenaar	Add GUI support:
64*c8cdf0f8SBram Moolenaar	% sudo apt install libgtk-3-dev
653d2bb8b6SBram Moolenaar	% make reconfig
663d2bb8b6SBram Moolenaar
673d2bb8b6SBram Moolenaar	Add Python 3 support:
683d2bb8b6SBram Moolenaar	% sudo apt install libpython3-dev
693d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
703d2bb8b6SBram Moolenaar		"CONF_OPT_PYTHON3 = --enable-python3interp"
713d2bb8b6SBram Moolenaar	% make reconfig
723d2bb8b6SBram Moolenaar
733d2bb8b6SBram Moolenaar	Debugging:
743d2bb8b6SBram Moolenaar	% sudo apt install valgrind
753d2bb8b6SBram Moolenaar	Uncomment this line in Makefile:
763d2bb8b6SBram Moolenaar		CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
773d2bb8b6SBram Moolenaar	% make reconfig
783d2bb8b6SBram Moolenaar	% make test_{test-name}
793d2bb8b6SBram Moolenaar	See output in testdir/valgrind.test_{test-name}
803d2bb8b6SBram Moolenaar
813d2bb8b6SBram 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
137*c8cdf0f8SBram MoolenaarThis configure argument can be used to disable the GUI, even when the necessary
138*c8cdf0f8SBram Moolenaarfiles are found:
139*c8cdf0f8SBram Moolenaar--disable-gui
140*c8cdf0f8SBram Moolenaar
141071d4279SBram Moolenaar--enable-gui defaults to "auto", so it will automatically look for a GUI (in
142*c8cdf0f8SBram Moolenaarthe order of GTK, Motif, then Athena).  If one is found, then it is used and
143071d4279SBram Moolenaardoes not proceed to check any of the remaining ones.  Otherwise, it moves on
144071d4279SBram Moolenaarto the next one.
145071d4279SBram Moolenaar
1464e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if
147071d4279SBram Moolenaar--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
148071d4279SBram Moolenaarbe checked for.  If you want to *exclude* a certain check, then you use
1494e32e4bcSBram Moolenaar--disable-{gtk,gtk2,kde,motif,athena}-check.
150071d4279SBram Moolenaar
151071d4279SBram MoolenaarFor example, if --enable-gui is set to "auto", but you don't want it look for
152071d4279SBram MoolenaarMotif, you then also specify --disable-motif-check.  This results in only
153071d4279SBram Moolenaarchecking for GTK and Athena.
154071d4279SBram Moolenaar
155071d4279SBram MoolenaarLastly, if you know which one you want to use, then you can just do
1564e32e4bcSBram Moolenaar--enable-gui={gtk,gtk2,kde,motif,athena}.  So if you wanted to only use Motif,
1574e32e4bcSBram Moolenaarthen you'd specify --enable-gui=motif.  Once you specify what you want, the
1584e32e4bcSBram Moolenaar--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored.
1594e32e4bcSBram Moolenaar
1604e32e4bcSBram MoolenaarOn Linux you usually need GUI "-devel" packages.  You may already have GTK
1614e32e4bcSBram Moolenaarlibraries installed, but that doesn't mean you can compile Vim with GTK, you
1624e32e4bcSBram Moolenaaralso need the header files.
163071d4279SBram Moolenaar
164071d4279SBram MoolenaarFor compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
1654e32e4bcSBram MoolenaarConfigure checks for at least version 1.1.16.  An older version is not selected
1664e32e4bcSBram Moolenaarautomatically.  If you want to use it anyway, run configure with
1674e32e4bcSBram Moolenaar"--disable-gtktest".
168071d4279SBram MoolenaarGTK requires an ANSI C compiler.  If you fail to compile Vim with GTK+ (it
169071d4279SBram Moolenaaris the preferred choice), try selecting another one in the Makefile.
170071d4279SBram MoolenaarIf you are sure you have GTK installed, but for some reason configure says you
171071d4279SBram Moolenaardo not, you may have left-over header files and/or library files from an older
172071d4279SBram Moolenaar(and incompatible) version of GTK.  if this is the case, please check
173071d4279SBram Moolenaarauto/config.log for any error messages that may give you a hint as to what's
174071d4279SBram Moolenaarhappening.
175071d4279SBram Moolenaar
1764e32e4bcSBram MoolenaarThere used to be a KDE version of Vim, using Qt libraries, but since it didn't
1774e32e4bcSBram Moolenaarwork very well and there was no maintainer it was dropped.
178843ee41eSBram Moolenaar
179843ee41eSBram Moolenaar
180071d4279SBram MoolenaarUnix: COMPILING WITH MULTI-BYTE
181071d4279SBram Moolenaar
182071d4279SBram MoolenaarWhen you want to compile with the multi-byte features enabled, make sure you
18364404479SBram Moolenaarcompile on a machine where the locale settings actually work, otherwise the
184071d4279SBram Moolenaarconfigure tests may fail.  You need to compile with "big" features:
185071d4279SBram Moolenaar
186071d4279SBram Moolenaar    ./configure --with-features=big
187071d4279SBram Moolenaar
188071d4279SBram MoolenaarUnix: COMPILING ON LINUX
189071d4279SBram Moolenaar
190071d4279SBram MoolenaarOn Linux, when using -g to compile (which is default for gcc), the executable
191071d4279SBram Moolenaarwill probably be statically linked.  If you don't want this, remove the -g
192071d4279SBram Moolenaaroption from CFLAGS.
193071d4279SBram Moolenaar
194071d4279SBram MoolenaarUnix: PUTTING vimrc IN /etc
195071d4279SBram Moolenaar
196071d4279SBram MoolenaarSome Linux distributions prefer to put the global vimrc file in /etc, and the
197071d4279SBram MoolenaarVim runtime files in /usr.  This can be done with:
198071d4279SBram Moolenaar	./configure --prefix=/usr
199071d4279SBram Moolenaar	make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
200071d4279SBram Moolenaar
201071d4279SBram MoolenaarUnix: COMPILING ON NeXT
202071d4279SBram Moolenaar
203071d4279SBram MoolenaarAdd the "-posix" argument to the compiler by using one of these commands:
204071d4279SBram Moolenaar	setenv CC 'cc -posix' (csh)
205071d4279SBram Moolenaar	export CC='cc -posix' (sh)
206071d4279SBram MoolenaarAnd run configure with "--disable-motif-check".
207071d4279SBram Moolenaar
208c236c16dSBram MoolenaarUnix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local
209c236c16dSBram Moolenaar
210c236c16dSBram MoolenaarSometimes it is necessary to search different path than /usr/local for locally
211c236c16dSBram Moolenaarinstalled headers (/usr/local/include) and libraries (/usr/local/lib).
212c236c16dSBram MoolenaarTo search /stranger/include and /stranger/lib for locally installed
213c236c16dSBram Moolenaarheaders and libraries, use:
214c236c16dSBram Moolenaar	./configure --with-local-dir=/stranger
215c236c16dSBram MoolenaarAnd to not search for locally installed headers and libraries at all, use:
216c236c16dSBram Moolenaar	./configure --without-local-dir
217c236c16dSBram Moolenaar
218071d4279SBram Moolenaar
219b07269a5SBram Moolenaar3. OS/2
220071d4279SBram Moolenaar=======
221071d4279SBram Moolenaar
222e7fedb6eSBram MoolenaarOS/2 support was removed in patch 7.4.1008
223071d4279SBram Moolenaar
224071d4279SBram Moolenaar
225b07269a5SBram Moolenaar4. Atari MiNT
226071d4279SBram Moolenaar=============
227071d4279SBram Moolenaar
228e3f915d1SBram MoolenaarAtari MiNT support was removed in patch 8.2.1215.
229