blob: b1aa6a879fe4cdcabf49c38177809cb4831de57b [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
93. RISC OS
104. Macintosh
115. OS/2 (with EMX 0.9b)
126. Atari MiNT
13
14For OS/390 Unix see ../runtime/doc/os_390.txt
15For BeBox see ../runtime/doc/os_beos.txt.
16For Amiga see INSTALLami.txt
17For PC (MS-DOS, Windows NT, Windows 95) see INSTALLpc.txt
18For Macintosh see INSTALLmac.txt
19
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
40to disable the GUI and X11. If you don't have Motif and/or X11, these
41features 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
57on most sytems without any adjustments. The disadvantage is that when
58adjustments 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
90These configure arguments can be used to select which GUI to use:
91--enable-gui= gtk, motif, athena or auto
92--disable-gtk-check
93--disable-motif-check
94--disable-athena-check
95
96--enable-gui defaults to "auto", so it will automatically look for a GUI (in
97the order of GTK, Motif, then Athena). If one is found, then is uses it and
98does not proceed to check any of the remaining ones. Otherwise, it moves on
99to the next one.
100
101--enable-{gtk,motif,athena}-check all default to "yes", such that if
102--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
103be checked for. If you want to *exclude* a certain check, then you use
104--disable-{gtk,motif,athena}-check.
105
106For example, if --enable-gui is set to "auto", but you don't want it look for
107Motif, you then also specify --disable-motif-check. This results in only
108checking for GTK and Athena.
109
110Lastly, if you know which one you want to use, then you can just do
111--enable-gui={gtk,motif,athena}. So if you wanted to only use Motif, then
112you'd specify --enable-gui=motif. Once you specify what you want, the
113--enable-{gtk,motif,athena}-check options are ignored.
114
115For compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
116Configure checks for at least version 1.1.16, but below 2.0. An older versions
117is not selected automatically. If you want to use it anyway, run configure
118with "--disable-gtktest". GTK 2.0 doesn't work yet.
119GTK requires an ANSI C compiler. If you fail to compile Vim with GTK+ (it
120is the preferred choice), try selecting another one in the Makefile.
121If you are sure you have GTK installed, but for some reason configure says you
122do not, you may have left-over header files and/or library files from an older
123(and incompatible) version of GTK. if this is the case, please check
124auto/config.log for any error messages that may give you a hint as to what's
125happening.
126
127Unix: COMPILING WITH MULTI-BYTE
128
129When you want to compile with the multi-byte features enabled, make sure you
130compile on a machine where the locale settings actually work. otherwise the
131configure tests may fail. You need to compile with "big" features:
132
133 ./configure --with-features=big
134
135Unix: COMPILING ON LINUX
136
137On Linux, when using -g to compile (which is default for gcc), the executable
138will probably be statically linked. If you don't want this, remove the -g
139option from CFLAGS.
140
141Unix: PUTTING vimrc IN /etc
142
143Some Linux distributions prefer to put the global vimrc file in /etc, and the
144Vim runtime files in /usr. This can be done with:
145 ./configure --prefix=/usr
146 make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
147
148Unix: COMPILING ON NeXT
149
150Add the "-posix" argument to the compiler by using one of these commands:
151 setenv CC 'cc -posix' (csh)
152 export CC='cc -posix' (sh)
153And run configure with "--disable-motif-check".
154
155
1563. RISC OS
157=============
158
159Much file renaming is needed before you can compile anything.
160You'll need UnixLib to link against, GCC and GNU make.
161
162I suggest you get the RISC OS binary distribution, which includes the
163Templates file and the loader.
164
165Try here: http://www.ecs.soton.ac.uk/~tal197
166
167Do
168 :help riscos
169
170within the editor for more information, or read the os_riscos.txt help file.
171
172
1734. Macintosh
174============
175
176Vim should work on the Macintosh, but I don't have a makefile for it.
177Work is being done to update the Macintosh port. It's a lot of work; don't
178expect it soon.
179
180
1815. OS/2
182=======
183
184Summary:
185ren Makefile Makefile.unix
186ren makefile.os2 Makefile
187make
188
189This port of Vim to OS/2 is based on the emx environment together
190with GNU C. The main design goal of emx is to simplify porting Unix
191software to OS/2 and DOS. Because of this, almost all the Unix defines
192etc. already existing in the Vim source code could be reused. Only where
193OS/2 specifics came into play were additional changes necessary. Those
194places can be found by searching for "OS2" and "__EMX__" (I've tried to
195keep emx-specific things separate from generic OS/2 stuff).
196
197Note: This OS/2 port works well for me and an additional OS/2 user on
198 the Vim development team (Karsten Sievert); however, since I
199 haven't had any other feedback from other people, that either
200 means no (OS/2-specific) bugs exist, or no one has yet created
201 a situation in which any bugs are apparent.
202 Report any problems or other comments to paul@wau.mis.ah.nl
203 (email valid up to at least September 1996, after that try
204 paul@wurtel.hobby.nl, paul@murphy.nl, or paulS@toecompst.nl).
205 Textmode/notextmode and binary mode both seem to work well.
206
207Prerequisites:
208- To compile, you need the emx environment (at least rev. 0.9b), GCC,
209 some make utility (GNU make works fine). These are generally
210 available as (ask Archie about them):
211 emxrt.zip emx runtime package
212 emxdev.zip emx development system (without compiler)
213 GNU programs compiled for emx, patches and patched sources:
214 gnudev1.zip GNU development tools compiled for emx (part 1)
215 gnudev2.zip GNU development tools compiled for emx (part 2)
216 gnumake.zip GNU make
217- Don't set a TERM environment variable; Vim defaults to os2ansi
218 which is available as a builtin termcap entry. Using other values
219 may give problems! (OS/2 ANSI emulation is quite limited.) If you
220 need to set TERM for other programs, you may consider putting
221 set term=os2ansi in the vimrc file.
222
223Check vim_os2.txt for additional info on running Vim.
224
225
2266. Atari MiNT
227=============
228
229
230To compile Vim for MiNT you may either copy makefile.mint to Makefile or use
231the Unix Makefile adapted for the MiNT configuration.
232
233Now proceed as described in the Unix section.
234
235Prerequisites:
236
237You need a curses or termcap library that supports non-alphanumeric
238termcap names. If you don't have any, link with termlib.o.
239
240-----------------------------------------------------------------------------
241
242The rest of this file is based on the INSTALL file that comes with GNU
243autoconf 2.12. Not everything applies to Vim. Read Makefile too!
244
245
246Basic Installation
247==================
248
249 These are generic installation instructions.
250
251 The `configure' shell script attempts to guess correct values for
252various system-dependent variables used during compilation. It uses
253those values to create a `Makefile' in each directory of the package.
254It may also create one or more `.h' files containing system-dependent
255definitions. Finally, it creates a shell script `config.status' that
256you can run in the future to recreate the current configuration, a file
257`config.cache' that saves the results of its tests to speed up
258reconfiguring, and a file `config.log' containing compiler output
259(useful mainly for debugging `configure').
260
261 If you need to do unusual things to compile the package, please try
262to figure out how `configure' could check whether to do them, and mail
263diffs or instructions to the address given in the `README' so they can
264be considered for the next release. If at some point `config.cache'
265contains results you don't want to keep, you may remove or edit it.
266
267 The file `configure.in' is used to create `configure' by a program
268called `autoconf'. You only need `configure.in' if you want to change
269it or regenerate `configure' using a newer version of `autoconf'.
270
271The simplest way to compile this package is:
272
273 1. `cd' to the directory containing the package's source code and type
274 `./configure' to configure the package for your system. If you're
275 using `csh' on an old version of System V, you might need to type
276 `sh ./configure' instead to prevent `csh' from trying to execute
277 `configure' itself.
278
279 Running `configure' takes awhile. While running, it prints some
280 messages telling which features it is checking for.
281
282 2. Type `make' to compile the package.
283
284 3. Optionally, type `make check' to run any self-tests that come with
285 the package.
286
287 4. Type `make install' to install the programs and any data files and
288 documentation.
289
290 5. You can remove the program binaries and object files from the
291 source code directory by typing `make clean'. To also remove the
292 files that `configure' created (so you can compile the package for
293 a different kind of computer), type `make distclean'. There is
294 also a `make maintainer-clean' target, but that is intended mainly
295 for the package's developers. If you use it, you may have to get
296 all sorts of other programs in order to regenerate files that came
297 with the distribution.
298
299Compilers and Options
300=====================
301
302 Some systems require unusual options for compilation or linking that
303the `configure' script does not know about. You can give `configure'
304initial values for variables by setting them in the environment. Using
305a Bourne-compatible shell, you can do that on the command line like
306this:
307 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
308
309Or on systems that have the `env' program, you can do it like this:
310 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
311
312Compiling For Multiple Architectures
313====================================
314
315 You can compile the package for more than one kind of computer at the
316same time, by placing the object files for each architecture in their
317own directory. To do this, you must use a version of `make' that
318supports the `VPATH' variable, such as GNU `make'. `cd' to the
319directory where you want the object files and executables to go and run
320the `configure' script. `configure' automatically checks for the
321source code in the directory that `configure' is in and in `..'.
322
323 If you have to use a `make' that does not supports the `VPATH'
324variable, you have to compile the package for one architecture at a time
325in the source code directory. After you have installed the package for
326one architecture, use `make distclean' before reconfiguring for another
327architecture.
328
329Installation Names
330==================
331
332 By default, `make install' will install the package's files in
333`/usr/local/bin', `/usr/local/man', etc. You can specify an
334installation prefix other than `/usr/local' by giving `configure' the
335option `--prefix=PATH'.
336
337 You can specify separate installation prefixes for
338architecture-specific files and architecture-independent files. If you
339give `configure' the option `--exec-prefix=PATH', the package will use
340PATH as the prefix for installing programs and libraries.
341Documentation and other data files will still use the regular prefix.
342
343 In addition, if you use an unusual directory layout you can give
344options like `--bindir=PATH' to specify different values for particular
345kinds of files. Run `configure --help' for a list of the directories
346you can set and what kinds of files go in them.
347
348 If the package supports it, you can cause programs to be installed
349with an extra prefix or suffix on their names by giving `configure' the
350option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
351
352Optional Features
353=================
354
355 Some packages pay attention to `--enable-FEATURE' options to
356`configure', where FEATURE indicates an optional part of the package.
357They may also pay attention to `--with-PACKAGE' options, where PACKAGE
358is something like `gnu-as' or `x' (for the X Window System). The
359`README' should mention any `--enable-' and `--with-' options that the
360package recognizes.
361
362 For packages that use the X Window System, `configure' can usually
363find the X include and library files automatically, but if it doesn't,
364you can use the `configure' options `--x-includes=DIR' and
365`--x-libraries=DIR' to specify their locations.
366
367Specifying the System Type
368==========================
369
370 There may be some features `configure' can not figure out
371automatically, but needs to determine by the type of host the package
372will run on. Usually `configure' can figure that out, but if it prints
373a message saying it can not guess the host type, give it the
374`--host=TYPE' option. TYPE can either be a short name for the system
375type, such as `sun4', or a canonical name with three fields:
376 CPU-COMPANY-SYSTEM
377
378See the file `config.sub' for the possible values of each field. If
379`config.sub' isn't included in this package, then this package doesn't
380need to know the host type.
381
382 If you are building compiler tools for cross-compiling, you can also
383use the `--target=TYPE' option to select the type of system they will
384produce code for and the `--build=TYPE' option to select the type of
385system on which you are compiling the package.
386
387Sharing Defaults
388================
389
390 If you want to set default values for `configure' scripts to share,
391you can create a site shell script called `config.site' that gives
392default values for variables like `CC', `cache_file', and `prefix'.
393`configure' looks for `PREFIX/share/config.site' if it exists, then
394`PREFIX/etc/config.site' if it exists. Or, you can set the
395`CONFIG_SITE' environment variable to the location of the site script.
396A warning: not all `configure' scripts look for a site script.
397
398Operation Controls
399==================
400
401 `configure' recognizes the following options to control how it
402operates.
403
404`--cache-file=FILE'
405 Use and save the results of the tests in FILE instead of
406 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
407 debugging `configure'.
408
409`--help'
410 Print a summary of the options to `configure', and exit.
411
412`--quiet'
413`--silent'
414`-q'
415 Do not print messages saying which checks are being made. To
416 suppress all normal output, redirect it to `/dev/null' (any error
417 messages will still be shown).
418
419`--srcdir=DIR'
420 Look for the package's source code in directory DIR. Usually
421 `configure' can determine that directory automatically.
422
423`--version'
424 Print the version of Autoconf used to generate the `configure'
425 script, and exit.
426
427`configure' also accepts some other, not widely useful, options.