Mon Sep 20 18:06:12 1993 Francesco Potorti` (pot at fly)
[bpt/emacs.git] / INSTALL
CommitLineData
a0e671c7
JB
1GNU Emacs Installation Guide
2Copyright (c) 1992 Free software Foundation, Inc.
3
4 Permission is granted to anyone to make or distribute verbatim copies
5 of this document as received, in any medium, provided that the
6 copyright notice and permission notice are preserved,
7 and that the distributor grants the recipient permission
8 for further redistribution as permitted by this notice.
9
10 Permission is granted to distribute modified versions
11 of this document, or of portions of it,
12 under the above conditions, provided also that they
13 carry prominent notices stating who last changed them,
14 and that any new or changed statements about the activities
15 of the Free Software Foundation are approved by the Foundation.
16
17
18BUILDING AND INSTALLATION:
19
201) Make sure your system has enough swapping space allocated to handle
21a program whose pure code is 900k bytes and whose data area is at
22least 400k and can reach 8Mb or more. If the swapping space is
23insufficient, you will get an error in the command `temacs -batch -l
24loadup dump', found in `./src/ymakefile', or possibly when running the
25final dumped Emacs.
26
27Building Emacs requires about 30 Mb of disk space. Installed, Emacs
28occupies about 20 Mb; this includes the executable files, lisp
29libraries, miscellaneous data files, and on-line documentation.
30
312) Consult `./etc/MACHINES' to see what configuration name you should
32give to the `configure' program. That file sometimes offers hints for
33getting around some possible installation problems.
34
353) In the top directory of the Emacs distribution, run the program
36`configure' as follows:
37
38 ./configure CONFIGURATION-NAME [--OPTION[=VALUE]] ...
39
40The CONFIGURATION-NAME argument should be a configuration name given
41in `./etc/MACHINES'. If omitted, `configure' will try to guess your
42system type by inspecting its environment; if it cannot, you must find
43the appropriate configuration name in `./etc/MACHINES' and specify it
44explicitly.
45
46The `--with-x', `--with-x11', and `--with-x10' options specify which
47window system Emacs should support. If you don't want X support,
48specify `--with-x=no'. If all of these options are omitted,
49`configure' will try to figure out for itself whether your system has
50X11, and arrange to use it if present.
51
52The `--x-includes=DIR' and `--x-libraries=DIR' options tell the build
53process where the compiler should look for the include files and
54object libraries used with the X Window System. Normally, your
55compiler should be able to find these by default; these options should
56only be necessary if you have your X Window System files installed in
57unusual places.
58
59The `--run-in-place' option sets up default values for the path
60variables in `./Makefile' so that Emacs will expect to find its data
61files (lisp libraries, runnable programs, and the like) in the same
62locations they occupy while Emacs builds. This means that you don't
63have to install Emacs in order to run it; it uses its data files as
64they were unpacked.
65
66The `--with-gcc' option specifies that the build process should
67compile Emacs using GCC. If you don't want to use GCC, specify
68`--with-gcc=no'. If this option is omitted, `configure' will search
69for GCC in your load path, and use it if present.
70
71The `--srcdir=DIR' option specifies that the configuration and build
72processes should look for the Emacs source code in DIR, when DIR is
73not the current directory.
74
75The `--prefix=PREFIXDIR' option specifies where the installation process
76should put emacs and its data files. This defaults to `/usr/local'.
77- Emacs (and the other utilities users run) go in PREFIXDIR/bin
78 (unless the `--exec-prefix' option says otherwise).
79- The architecture-independent files go in PREFIXDIR/lib/emacs/VERSION
80 (where VERSION is the version number of Emacs, like `19.7').
81- The architecture-dependent files go in
82 PREFIXDIR/lib/emacs/VERSION/CONFIGURATION
83 (where CONFIGURATION is the configuration name, like mips-dec-ultrix4.2),
84 unless the `--exec-prefix' option says otherwise.
85
86The `--exec-prefix=EXECDIR' option allows you to specify a separate
87portion of the directory tree for installing architecture-specific
88files, like executables and utility programs. If specified,
89- Emacs (and the other utilities users run) go in EXECDIR/bin, and
90- The architecture-dependent files go in
91 EXECDIR/lib/emacs/VERSION/CONFIGURATION.
92EXECDIR/bin should be a directory that is normally in users' PATHs.
93
94For example, the command
95
96 ./configure mips-dec-ultrix --with-x11
97
98configures Emacs to build for a DECstation running Ultrix, with
99support for the X11 window system.
100
101The `configure' program does not accept abbreviations for its
102options.
103
104Note that `configure' doesn't do any compilation or installation
105itself. It just creates the files that influence those things:
106`./Makefile', `build-install', and `./src/config.h'. For details on
107exactly what it does, see the section called `CONFIGURATION BY HAND',
108below.
109
110When it is done, `configure' prints a description of what it did and
111leaves a copy in the file `config.status'. That file is also a shell
112script which, when run, recreates the same configuration; it contains
113the verbal description as a comment. If `configure' exits with an
114error after disturbing the status quo, it removes `config.status'.
115
116The work of `configure' can be done by editing various files in the
117distribution, but using `configure' is supposed to be simpler. See
118the section called "CONFIGURATION BY HAND" below if you want to do the
119configuration yourself.
120
1214) Look at `./lisp/paths.el'; if some of those values are not right
122for your system, edit the file `./lisp/site-init.el' containing Emacs
123Lisp code to override them; you probably don't want to edit paths.el
124itself. YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES,
125rather than `defvar', as used by `./lisp/paths.el'. For example,
126
127 (setq news-inews-program "/usr/bin/inews")
128
129is how you would override the default value of the variable
130news-inews-program (which is "/usr/local/inews").
131
132Note that, on some systems, the code you place in site-init.el must
133not use expand-file-name or any other function which may look
134something up in the system's password and user information database.
135See `./PROBLEMS' for more details on which systems this affects.
136
1375) Put into `./lisp/site-init.el' any Emacs Lisp code you want Emacs
138to load before it is dumped out.
139
140Note that, on some systems, the code you place in site-init.el must
141not use expand-file-name or any other function which may look
142something up in the system's password and user information database.
143See `./PROBLEMS' for more details on which systems this affects.
144
145This file is nonexistent in the distribution. You do not need to
146create it if you have nothing to put in it.
147
1486) Refer to the file `./etc/TERMS' for information on fields you may
149wish to add to various termcap entries. The files `./etc/termcap.ucb'
150and `./etc/termcap.dat' may already contain appropriately-modified
151entries.
152
1537) Run `make' in the top directory of the Emacs distribution to finish
154building Emacs in the standard way. The final executable file will be
155named `src/emacs'. If you want to have Emacs's executable programs
156and data files installed as well, run `make install'.
157
158By default, Emacs installs its files in the following directories:
159
160`/usr/local/bin' holds the executable programs users normally run -
161 `emacs', `etags', `ctags', `b2m', and `emacsclient'.
162
163`/usr/local/lib/emacs/VERSION/lisp' holds the Emacs Lisp library;
164 `VERSION' stands for the number of the Emacs version
165 you are installing, like `18.59' or `19.0'. Since the
166 lisp library changes from one version of Emacs to
167 another, including the version number in the path
168 allows you to have several versions of Emacs installed
169 at the same time; this means that you don't have to
170 make Emacs unavailable while installing a new
171 version.
172
173 Emacs searches for its lisp files in
174 `/usr/local/lib/emacs/site-lisp', then in this
175 directory.
176
177`/usr/local/lib/emacs/VERSION/etc' holds the Emacs tutorial, the DOC
178 file, the `yow' database, and other
179 architecture-independent files Emacs might need while
180 running. VERSION is as specified for `.../lisp'.
181
182`/usr/local/lib/emacs/lock' contains files indicating who is editing
183 what, so Emacs can detect editing clashes between
184 users.
185
186`/usr/local/lib/emacs/VERSION/CONFIGURATION-NAME' contains executable
187 programs used by Emacs that users are not expected to
188 run themselves.
189 `VERSION' is the number of the Emacs version you are
190 installing, and `CONFIGURATION-NAME' is the argument
191 you gave to the `configure' program to identify the
192 architecture and operating system of your machine,
193 like `mips-dec-ultrix' or `sparc-sun-sunos'. Since
194 these files are specific to the version of Emacs,
195 operating system, and architecture in use, including
196 the configuration name in the path allows you to have
197 several versions of Emacs for any mix of machines and
198 operating systems installed at the same time; this is
199 useful for sites at which different kinds of machines
200 share the file system Emacs is installed on.
201
202`/usr/local/info' holds the on-line documentation for Emacs, known as
203 "info files". Many other GNU programs are documented
204 using info files as well, so this directory stands
205 apart from the other, Emacs-specific directories.
206
207`/usr/local/man/man1' holds the man pages for the programs installed
208 in `/usr/local/bin'.
209
210If these directories are not what you want, you can specify where to
211install Emacs's libraries and data files or where Emacs should search
212for its lisp files by giving values for `make' variables as part of
213the command. See the section below called `MAKE VARIABLES' for more
214information on this.
215
2168) Check the file `dir' in your site's info directory (usually
217/usr/local/info) to make sure that it has a menu entry for the Emacs
218info files.
219
2209) You are done!
221
222
223MAKE VARIABLES
224
225You can change where the build process installs Emacs and its data
226files by specifying values for `make' variables as part of the `make'
227command line. For example, if you type
228
229 make install bindir=/usr/local/gnubin
230
231the `bindir=/usr/local/gnubin' argument indicates that the Emacs
232executable files should go in `/usr/local/gnubin', not
233`/usr/local/bin'.
234
235Here is a complete list of the variables you may want to set.
236
237`bindir' indicates where to put executable programs that users can
238 run. This defaults to /usr/local/bin.
239
240`datadir' indicates where to put the architecture-independent
241 read-only data files that Emacs refers to while it runs; it
242 defaults to /usr/local/lib. We create the following
243 subdirectories under `datadir':
244 - `emacs/VERSION/lisp', containing the Emacs lisp library, and
245 - `emacs/VERSION/etc', containing the Emacs tutorial, the DOC
246 file, and the `yow' database.
247 `VERSION' is the number of the Emacs version you are installing,
248 like `18.59' or `19.0'. Since these files vary from one version
249 of Emacs to another, including the version number in the path
250 allows you to have several versions of Emacs installed at the
251 same time; this means that you don't have to make Emacs
252 unavailable while installing a new version.
253
254`statedir' indicates where to put architecture-independent data files
255 that Emacs modifies while it runs; it defaults to
256 /usr/local/lib as well. We create the following
257 subdirectories under `statedir':
258 - `emacs/lock', containing files indicating who is editing
259 what, so Emacs can detect editing clashes between
260 users.
261
262`libdir' indicates where to put architecture-specific data files that
263 Emacs refers to as it runs; it too defaults to `/usr/local/lib'.
264 We create the following subdirectories under `libdir':
265 - `emacs/VERSION/CONFIGURATION-NAME', containing executable
266 programs used by Emacs that users are not expected to run
267 themselves.
268 `VERSION' is the number of the Emacs version you are installing,
269 and `CONFIGURATION-NAME' is the argument you gave to the
270 `configure' program to identify the architecture and operating
271 system of your machine, like `mips-dec-ultrix' or
272 `sparc-sun-sunos'. Since these files are specific to the version
273 of Emacs, operating system, and architecture in use, including
274 the configuration name in the path allows you to have several
275 versions of Emacs for any mix of machines and operating systems
276 installed at the same time; this is useful for sites at which
277 different kinds of machines share the file system Emacs is
278 installed on.
279
280`infodir' indicates where to put the info files distributed with
281 Emacs; it defaults to `/usr/local/info'.
282
283`mandir' indicates where to put the man pages for Emacs and its
284 utilities (like `etags'); it defaults to
285 `/usr/local/man/man1'.
286
287`manext' gives the extension the man pages should be installed with.
288 It should contain a period, followed by the appropriate
289 digit. It defaults to `.1'. For example given the default
290 values for `mandir' and `manext', the Emacs man page would be
291 installed as `/usr/local/man/man1/emacs.1'.
292
293`prefix' doesn't give a path for any specific part of Emacs; instead,
294 its value is used to determine the defaults for all the
295 architecture-independent path variables - `datadir',
296 `statedir', `infodir', and `mandir'. Its default value is
297 `/usr/local'; the other variables add on `lib' or `man' to it
298 by default.
299
300 For example, suppose your site generally places GNU software
301 under `/usr/users/software/gnusoft' instead of `/usr/local'.
302 By including
303 `prefix=/usr/users/software/gnusoft'
304 in the arguments to `make', you can instruct the build process
305 to place all of the Emacs data files in the appropriate
306 directories under that path.
307
308`exec_prefix' serves the same purpose as `prefix', but instead
309 determines the default values for the architecture-dependent
310 path variables - `bindir' and `libdir'.
311
312The above variables serve analogous purposes in the makefiles for all
313GNU software; here are some variables specific to Emacs.
314
315`lispdir' indicates where Emacs installs and expects its lisp
316 library. Its default value, based on `datadir' (which see),
317 is `/usr/local/lib/emacs/VERSION/lisp' (where `VERSION' is as
318 described above).
319
320`locallisppath' indicates where Emacs should search for lisp files
321 specific to your site. It should be a colon-separated list of
322 directories; Emacs checks them in order before checking
323 `lispdir'.
324
325`lisppath' is the complete list of directories Emacs should search for
326 its lisp files; its default value is the concatenation of
327 `lispdir' and `locallisppath'. It should be a colon-separated
328 list of directories; Emacs checks them in the order they
329 appear.
330
331`etcdir' indicates where Emacs should install and expect the rest of
332 its architecture-independent data, like the tutorial, DOC
333 file, and yow database. Its default value, based on `datadir'
334 (which see), is `/usr/local/lib/emacs/VERSION/etc'.
335
336`lockdir' indicates the directory where Emacs keeps track of its
337 locking information. Its default value, based on `statedir'
338 (which see), is `/usr/local/lib/emacs/lock'.
339
340`archlibdir' indicates where Emacs installs and expects the
341 executable files and other architecture-dependent data it uses
342 while running. Its default value, based on `libdir' (which
343 see), is `/usr/local/lib/emacs/VERSION/CONFIGURATION-NAME'
344 (where VERSION and CONFIGURATION-NAME are as described above).
345
346Remember that you must specify any variable values you need each time
347you run `make' in the top directory. If you run `make' once to build
348emacs, test it, and then run `make' again to install the files, you
349must provide the same variable settings each time. To make the
350settings persist, you can edit them into the `Makefile' in the top
351directory, but be aware that running the `configure' program erases
352`Makefile' and rebuilds it from `Makefile.in'.
353
354The top-level Makefile stores the variable settings it used in the
355Makefiles for the subdirectories, so you don't have to specify them
356when running make in the subdirectories.
357
358
359CONFIGURATION BY HAND
360
361Running the `configure' program performs the following steps.
362
3631) Copy `./src/config.h.in' to `./src/config.h'.
364
3652) Consult `./etc/MACHINES' to see what configuration name you should
366use for your system. Look at the code of the `configure' script to
367see which operating system and architecture description files from
368`src/s' and `src/m' should be used for that configuration name. Edit
369`src/config.h', and change the two `#include' directives to include
370the appropriate system and architecture description files.
371
3722) Edit `./src/config.h' to set the right options for your system. If
373you need to override any of the definitions in the s/*.h and m/*.h
374files for your system and machine, do so by editing config.h, not by
375changing the s/*.h and m/*.h files. Occasionally you may need to
376redefine parameters used in `./lib-src/movemail.c'.
377
3783) If you're going to use the make utility to build Emacs, copy
379`./Makefile.in' to `./Makefile', and then edit that to specify the
380appropriate values for the variables in the sections entitled "Things
381`configure' Might Edit" and "Where To Install Things." Note that you
382may only need to change the variables `prefix' and `exec_prefix',
383since the rest of the variables have reasonable defaults based on
384them.
385
3864) Typing `make src/Makefile lib-src/Makefile' builds the
387makefiles for the subdirectories, editing in the values for the path
388variables you establed in step 3.
389
390-- or --
391
3924) If you're going to use the build-install script to build Emacs,
393copy `./build-install.in' to `./build-install', and edit the similar
394definitions found at the top of the script.
395
396
397The `configure' script is built from `configure.in' by the `autoconf'
398program. However, since Emacs has configuration requirements that
399autoconf can't meet, `configure.in' uses an unholy marriage of
400custom-baked configuration code and autoconf macros. New versions of
401autoconf could very well break this arrangement, so it may be wise to
402avoid rebuilding `configure' from `configure.in' when possible.
403
404
405BUILDING GNU EMACS BY HAND
406
407Once Emacs is configured, running `make' or running the shell script
408`build-install' in the top directory performs the following steps.
409
4101) Run `make src/paths.h' in the top directory. This produces
411`./src/paths.h' from the template file `./src/paths.h.in', changing
412the paths to the values specified in `./Makefile'.
413
4142) Cd to `./lib-src' and run `make'. This creates executables named
415`ctags' and `etags' and `wakeup' and `make-docfile' and `digest-doc'
416and `test-distrib'. And others.
417
4183) Cd to `./src' and Run `make'. This refers to files in the `./lisp'
419and `./lib-src' subdirectories using names `../lisp' and
420`../lib-src'.
421
422This creates a file `./src/emacs' which is the runnable Emacs,
423assigning it a new version number by incrementing the version stored
424in `./lisp/version.el'.
425
426It also creates a file in `./etc' whose name is `DOC' followed by the
427current Emacs version. This file contains documentation strings for
428all the functions in Emacs. Each time you run make to make a new
429emacs, a new DOC file with a new name is made. You must keep the DOC
430file for an Emacs version as long as you keep using that Emacs
431version.
432
433
434INSTALLATION BY HAND
435
436The steps below are done by the shell script `build-install' or by
437running `make install' in the main directory of the Emacs
438distribution.
439
4401) Copy `./lisp' and its subdirectories, `./etc', and the executables
441in `./lib-src' to their final destinations, as selected in `./src/paths.h'.
442
443Strictly speaking, not all of the executables in `./lib-src' need be copied.
444- The programs `cvtmail', `emacsserver', `env', `fakemail', `hexl',
445 `movemail', `timer', `vcdiff', `wakeup', and `yow' are used by
446 Emacs; they do need to be copied.
447- The programs `etags', `ctags', `emacsclient', `b2m', and `rcs2log'
448 are intended to be run by users; they are handled below.
449- The programs `make-docfile', `make-path', and `test-distrib' were
450 used in building Emacs, and are not needed any more.
451- The programs `digest-doc' and `sorted-doc' convert a `DOC' file into
452 a file for users to read. There is no important reason to move them.
453
4542) Copy the files in `./info' to the place specified in
455`./lisp/site-init.el' or `./lisp/paths.el'. Note that if the
456destination directory already contains a file named `dir', you
457probably don't want to replace it with the `dir' file in the Emacs
458distribution. Instead, you should make sure that the existing `dir'
459file contains an appropriate menu entry for the Emacs info.
460
4613) Create a directory for Emacs to use for clash detection, named as
462indicated by the PATH_LOCK macro in `./src/paths.h'.
463
4644) Copy `./src/emacs' to `/usr/local/bin', or to some other directory
465in users' search paths. `./src/emacs' has an alternate name
466`./src/emacs-EMACSVERSION'; you may wish to make a symbolic link named
467`/usr/local/bin/emacs' pointing to that alternate name, as an easy way
468of installing different versions.
469
470You can delete `./src/temacs'.
471
4725) Copy the programs `b2m', `emacsclient', `ctags', `etags', and
473`rcs2log' from `./lib-src' to `/usr/local/bin'. These programs are
474intended for users to run.
475
4766) Copy the man pages in `./etc' for emacs, ctags, and etags into the
477appropriate man directories.
478
4797) The files in the `./src' subdirectory, except for `emacs', are not
480used by Emacs once it is built. The source would be handy for
481debugging.
482
483
484PROBLEMS
485
486See the file PROBLEMS in this directory for a list of various
487problems sometimes encountered, and what to do about them.
488
489