blob: 99f1047a48d69d8dc296b4220392c447d558cd77 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001INSTALL - 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
Bram Moolenaarb07269a2011-05-19 13:41:14 +020093. OS/2 (with EMX 0.9b)
104. Atari MiNT
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000012See INSTALLami.txt for Amiga
13See INSTALLmac.txt for Macintosh
Bram Moolenaarfd89d7e2016-06-04 20:25:05 +020014See INSTALLpc.txt for PC (Windows 95/98/NT/XP/Vista/7/8/10)
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000015See INSTALLvms.txt for VMS
Bram Moolenaarc1a11ed2008-06-24 22:09:24 +000016See INSTALLx.txt for cross-compiling on Unix
Bram Moolenaar2c704a72010-06-03 21:17:25 +020017See ../README_390.txt for OS/390 Unix
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000018See ../runtime/doc/os_beos.txt for BeBox
Bram Moolenaar071d4272004-06-13 20:20:40 +000019
20
211. Generic
22==========
23
24If you compile Vim without specifying anything, you will get the default
25behaviour as is documented, which should be fine for most people.
26
27For features that you can't enable/disable in another way, you can edit the
28file "feature.h" to match your preferences.
29
30
312. Unix
32=======
33
34Summary:
351. make run configure, compile and link
362. make install installation in /usr/local
37
38This will include the GUI and X11 libraries, if you have them. If you want a
39version of Vim that is small and starts up quickly, see the Makefile for how
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000040to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
Bram Moolenaar071d4272004-06-13 20:20:40 +000041features will be disabled automatically.
42
43See the start of Makefile for more detailed instructions about how to compile
44Vim.
45
46If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
47before starting configure. Example:
48
49 env CFLAGS=-I/usr/local/include LIBS=-lm make
50
51This is only needed for things that configure doesn't offer a specific argument
52for or figures out by itself. First try running configure without extra
53arguments.
54
55GNU Autoconf and a few other tools have been used to make Vim work on many
56different Unix systems. The advantage of this is that Vim should compile
Bram Moolenaar64404472010-06-26 06:24:45 +020057on most systems without any adjustments. The disadvantage is that when
Bram Moolenaar071d4272004-06-13 20:20:40 +000058adjustments are required, it takes some time to understand what is happening.
59
60If configure finds all library files and then complains when linking that some
61of them can't be found, your linker doesn't return an error code for missing
62libraries. Vim should be linked fine anyway, mostly you can just ignore these
63errors.
64
65If you run configure by hand (not using the Makefile), remember that any
66changes in the Makefile have no influence on configure. This may be what you
67want, but maybe not!
68
69The advantage of running configure separately, is that you can write a script
70to build Vim, without changing the Makefile or feature.h. Example (using sh):
71
72 CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
73
74One thing to watch out for: If the configure script itself changes, running
75"make" will execute it again, but without your arguments. Do "make clean" and
76run configure again.
77
78If you are compiling Vim for several machines, for each machine:
79 a. make shadow
80 b. mv shadow machine_name
81 c. cd machine_name
82 d. make; make install
83
84[Don't use a path for machine_name, just a directory name, otherwise the links
85that "make shadow" creates won't work.]
86
87
88Unix: COMPILING WITH/WITHOUT GUI
89
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000090NOTE: This is incomplete, look in Makefile for more info.
91
Bram Moolenaar071d4272004-06-13 20:20:40 +000092These configure arguments can be used to select which GUI to use:
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +000093--enable-gui=gtk or: gtk2, motif, athena or auto
Bram Moolenaar071d4272004-06-13 20:20:40 +000094--disable-gtk-check
95--disable-motif-check
96--disable-athena-check
97
98--enable-gui defaults to "auto", so it will automatically look for a GUI (in
99the order of GTK, Motif, then Athena). If one is found, then is uses it and
100does not proceed to check any of the remaining ones. Otherwise, it moves on
101to the next one.
102
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000103--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
105be checked for. If you want to *exclude* a certain check, then you use
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000106--disable-{gtk,gtk2,kde,motif,athena}-check.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000107
108For example, if --enable-gui is set to "auto", but you don't want it look for
109Motif, you then also specify --disable-motif-check. This results in only
110checking for GTK and Athena.
111
112Lastly, if you know which one you want to use, then you can just do
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000113--enable-gui={gtk,gtk2,kde,motif,athena}. So if you wanted to only use Motif,
114then you'd specify --enable-gui=motif. Once you specify what you want, the
115--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored.
116
117On Linux you usually need GUI "-devel" packages. You may already have GTK
118libraries installed, but that doesn't mean you can compile Vim with GTK, you
119also need the header files.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000120
121For compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000122Configure checks for at least version 1.1.16. An older version is not selected
123automatically. If you want to use it anyway, run configure with
124"--disable-gtktest".
Bram Moolenaar071d4272004-06-13 20:20:40 +0000125GTK requires an ANSI C compiler. If you fail to compile Vim with GTK+ (it
126is the preferred choice), try selecting another one in the Makefile.
127If you are sure you have GTK installed, but for some reason configure says you
128do not, you may have left-over header files and/or library files from an older
129(and incompatible) version of GTK. if this is the case, please check
130auto/config.log for any error messages that may give you a hint as to what's
131happening.
132
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000133There used to be a KDE version of Vim, using Qt libraries, but since it didn't
134work very well and there was no maintainer it was dropped.
Bram Moolenaar843ee412004-06-30 16:16:41 +0000135
136
Bram Moolenaar071d4272004-06-13 20:20:40 +0000137Unix: COMPILING WITH MULTI-BYTE
138
139When you want to compile with the multi-byte features enabled, make sure you
Bram Moolenaar64404472010-06-26 06:24:45 +0200140compile on a machine where the locale settings actually work, otherwise the
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141configure tests may fail. You need to compile with "big" features:
142
143 ./configure --with-features=big
144
145Unix: COMPILING ON LINUX
146
147On Linux, when using -g to compile (which is default for gcc), the executable
148will probably be statically linked. If you don't want this, remove the -g
149option from CFLAGS.
150
151Unix: PUTTING vimrc IN /etc
152
153Some Linux distributions prefer to put the global vimrc file in /etc, and the
154Vim runtime files in /usr. This can be done with:
155 ./configure --prefix=/usr
156 make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
157
158Unix: COMPILING ON NeXT
159
160Add the "-posix" argument to the compiler by using one of these commands:
161 setenv CC 'cc -posix' (csh)
162 export CC='cc -posix' (sh)
163And run configure with "--disable-motif-check".
164
Bram Moolenaarc236c162008-07-13 17:41:49 +0000165Unix: LOCAL HEADERS AND LIBRARIES NOT IN /usr/local
166
167Sometimes it is necessary to search different path than /usr/local for locally
168installed headers (/usr/local/include) and libraries (/usr/local/lib).
169To search /stranger/include and /stranger/lib for locally installed
170headers and libraries, use:
171 ./configure --with-local-dir=/stranger
172And to not search for locally installed headers and libraries at all, use:
173 ./configure --without-local-dir
174
Bram Moolenaar071d4272004-06-13 20:20:40 +0000175
Bram Moolenaarb07269a2011-05-19 13:41:14 +02001763. OS/2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177=======
178
Bram Moolenaare7fedb62015-12-31 19:07:19 +0100179OS/2 support was removed in patch 7.4.1008
Bram Moolenaar071d4272004-06-13 20:20:40 +0000180
181
Bram Moolenaarb07269a2011-05-19 13:41:14 +02001824. Atari MiNT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000183=============
184
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000185[NOTE: this is quite old, it might not work anymore]
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186
Bram Moolenaar4e32e4b2007-05-12 14:46:25 +0000187To compile Vim for MiNT you may either copy Make_mint.mak to Makefile or use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188the Unix Makefile adapted for the MiNT configuration.
189
190Now proceed as described in the Unix section.
191
192Prerequisites:
193
194You need a curses or termcap library that supports non-alphanumeric
195termcap names. If you don't have any, link with termlib.o.
196
197-----------------------------------------------------------------------------
198
199The rest of this file is based on the INSTALL file that comes with GNU
200autoconf 2.12. Not everything applies to Vim. Read Makefile too!
201
202
203Basic Installation
204==================
205
206 These are generic installation instructions.
207
208 The `configure' shell script attempts to guess correct values for
209various system-dependent variables used during compilation. It uses
210those values to create a `Makefile' in each directory of the package.
211It may also create one or more `.h' files containing system-dependent
212definitions. Finally, it creates a shell script `config.status' that
213you can run in the future to recreate the current configuration, a file
214`config.cache' that saves the results of its tests to speed up
215reconfiguring, and a file `config.log' containing compiler output
216(useful mainly for debugging `configure').
217
218 If you need to do unusual things to compile the package, please try
219to figure out how `configure' could check whether to do them, and mail
220diffs or instructions to the address given in the `README' so they can
221be considered for the next release. If at some point `config.cache'
222contains results you don't want to keep, you may remove or edit it.
223
Bram Moolenaar3f7d0902016-11-12 21:13:42 +0100224 The file `configure.ac' is used to create `configure' by a program
225called `autoconf'. You only need `configure.ac' if you want to change
Bram Moolenaar071d4272004-06-13 20:20:40 +0000226it or regenerate `configure' using a newer version of `autoconf'.
227
228The simplest way to compile this package is:
229
230 1. `cd' to the directory containing the package's source code and type
231 `./configure' to configure the package for your system. If you're
232 using `csh' on an old version of System V, you might need to type
233 `sh ./configure' instead to prevent `csh' from trying to execute
234 `configure' itself.
235
236 Running `configure' takes awhile. While running, it prints some
237 messages telling which features it is checking for.
238
239 2. Type `make' to compile the package.
240
241 3. Optionally, type `make check' to run any self-tests that come with
242 the package.
243
244 4. Type `make install' to install the programs and any data files and
245 documentation.
246
247 5. You can remove the program binaries and object files from the
248 source code directory by typing `make clean'. To also remove the
249 files that `configure' created (so you can compile the package for
250 a different kind of computer), type `make distclean'. There is
251 also a `make maintainer-clean' target, but that is intended mainly
252 for the package's developers. If you use it, you may have to get
253 all sorts of other programs in order to regenerate files that came
254 with the distribution.
255
256Compilers and Options
257=====================
258
259 Some systems require unusual options for compilation or linking that
260the `configure' script does not know about. You can give `configure'
261initial values for variables by setting them in the environment. Using
262a Bourne-compatible shell, you can do that on the command line like
263this:
264 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
265
266Or on systems that have the `env' program, you can do it like this:
267 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
268
269Compiling For Multiple Architectures
270====================================
271
272 You can compile the package for more than one kind of computer at the
273same time, by placing the object files for each architecture in their
274own directory. To do this, you must use a version of `make' that
275supports the `VPATH' variable, such as GNU `make'. `cd' to the
276directory where you want the object files and executables to go and run
277the `configure' script. `configure' automatically checks for the
278source code in the directory that `configure' is in and in `..'.
279
Bram Moolenaarcaad4f02014-12-17 14:36:14 +0100280 If you have to use a `make' that does not support the `VPATH'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281variable, you have to compile the package for one architecture at a time
282in the source code directory. After you have installed the package for
283one architecture, use `make distclean' before reconfiguring for another
284architecture.
285
286Installation Names
287==================
288
289 By default, `make install' will install the package's files in
290`/usr/local/bin', `/usr/local/man', etc. You can specify an
291installation prefix other than `/usr/local' by giving `configure' the
292option `--prefix=PATH'.
293
294 You can specify separate installation prefixes for
295architecture-specific files and architecture-independent files. If you
296give `configure' the option `--exec-prefix=PATH', the package will use
297PATH as the prefix for installing programs and libraries.
298Documentation and other data files will still use the regular prefix.
299
300 In addition, if you use an unusual directory layout you can give
301options like `--bindir=PATH' to specify different values for particular
302kinds of files. Run `configure --help' for a list of the directories
303you can set and what kinds of files go in them.
304
305 If the package supports it, you can cause programs to be installed
306with an extra prefix or suffix on their names by giving `configure' the
307option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
308
309Optional Features
310=================
311
312 Some packages pay attention to `--enable-FEATURE' options to
313`configure', where FEATURE indicates an optional part of the package.
314They may also pay attention to `--with-PACKAGE' options, where PACKAGE
315is something like `gnu-as' or `x' (for the X Window System). The
316`README' should mention any `--enable-' and `--with-' options that the
317package recognizes.
318
319 For packages that use the X Window System, `configure' can usually
320find the X include and library files automatically, but if it doesn't,
321you can use the `configure' options `--x-includes=DIR' and
322`--x-libraries=DIR' to specify their locations.
323
324Specifying the System Type
325==========================
326
327 There may be some features `configure' can not figure out
328automatically, but needs to determine by the type of host the package
329will run on. Usually `configure' can figure that out, but if it prints
330a message saying it can not guess the host type, give it the
331`--host=TYPE' option. TYPE can either be a short name for the system
332type, such as `sun4', or a canonical name with three fields:
333 CPU-COMPANY-SYSTEM
334
335See the file `config.sub' for the possible values of each field. If
336`config.sub' isn't included in this package, then this package doesn't
337need to know the host type.
338
339 If you are building compiler tools for cross-compiling, you can also
340use the `--target=TYPE' option to select the type of system they will
341produce code for and the `--build=TYPE' option to select the type of
342system on which you are compiling the package.
343
344Sharing Defaults
345================
346
347 If you want to set default values for `configure' scripts to share,
348you can create a site shell script called `config.site' that gives
349default values for variables like `CC', `cache_file', and `prefix'.
350`configure' looks for `PREFIX/share/config.site' if it exists, then
351`PREFIX/etc/config.site' if it exists. Or, you can set the
352`CONFIG_SITE' environment variable to the location of the site script.
353A warning: not all `configure' scripts look for a site script.
354
355Operation Controls
356==================
357
358 `configure' recognizes the following options to control how it
359operates.
360
361`--cache-file=FILE'
362 Use and save the results of the tests in FILE instead of
363 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
364 debugging `configure'.
365
366`--help'
367 Print a summary of the options to `configure', and exit.
368
369`--quiet'
370`--silent'
371`-q'
372 Do not print messages saying which checks are being made. To
373 suppress all normal output, redirect it to `/dev/null' (any error
374 messages will still be shown).
375
376`--srcdir=DIR'
377 Look for the package's source code in directory DIR. Usually
378 `configure' can determine that directory automatically.
379
380`--version'
381 Print the version of Autoconf used to generate the `configure'
382 script, and exit.
383
384`configure' also accepts some other, not widely useful, options.