Commit | Line | Data |
---|---|---|
a0e671c7 JB |
1 | GNU Emacs Installation Guide |
2 | Copyright (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 | ||
18 | BUILDING AND INSTALLATION: | |
19 | ||
20 | 1) Make sure your system has enough swapping space allocated to handle | |
21 | a program whose pure code is 900k bytes and whose data area is at | |
22 | least 400k and can reach 8Mb or more. If the swapping space is | |
23 | insufficient, you will get an error in the command `temacs -batch -l | |
24 | loadup dump', found in `./src/ymakefile', or possibly when running the | |
25 | final dumped Emacs. | |
26 | ||
27 | Building Emacs requires about 30 Mb of disk space. Installed, Emacs | |
28 | occupies about 20 Mb; this includes the executable files, lisp | |
29 | libraries, miscellaneous data files, and on-line documentation. | |
30 | ||
31 | 2) Consult `./etc/MACHINES' to see what configuration name you should | |
32 | give to the `configure' program. That file sometimes offers hints for | |
33 | getting around some possible installation problems. | |
34 | ||
35 | 3) In the top directory of the Emacs distribution, run the program | |
36 | `configure' as follows: | |
37 | ||
38 | ./configure CONFIGURATION-NAME [--OPTION[=VALUE]] ... | |
39 | ||
40 | The CONFIGURATION-NAME argument should be a configuration name given | |
41 | in `./etc/MACHINES'. If omitted, `configure' will try to guess your | |
42 | system type by inspecting its environment; if it cannot, you must find | |
43 | the appropriate configuration name in `./etc/MACHINES' and specify it | |
44 | explicitly. | |
45 | ||
46 | The `--with-x', `--with-x11', and `--with-x10' options specify which | |
47 | window system Emacs should support. If you don't want X support, | |
48 | specify `--with-x=no'. If all of these options are omitted, | |
49 | `configure' will try to figure out for itself whether your system has | |
50 | X11, and arrange to use it if present. | |
51 | ||
52 | The `--x-includes=DIR' and `--x-libraries=DIR' options tell the build | |
53 | process where the compiler should look for the include files and | |
54 | object libraries used with the X Window System. Normally, your | |
55 | compiler should be able to find these by default; these options should | |
56 | only be necessary if you have your X Window System files installed in | |
57 | unusual places. | |
58 | ||
59 | The `--run-in-place' option sets up default values for the path | |
60 | variables in `./Makefile' so that Emacs will expect to find its data | |
61 | files (lisp libraries, runnable programs, and the like) in the same | |
62 | locations they occupy while Emacs builds. This means that you don't | |
63 | have to install Emacs in order to run it; it uses its data files as | |
64 | they were unpacked. | |
65 | ||
66 | The `--with-gcc' option specifies that the build process should | |
67 | compile Emacs using GCC. If you don't want to use GCC, specify | |
68 | `--with-gcc=no'. If this option is omitted, `configure' will search | |
69 | for GCC in your load path, and use it if present. | |
70 | ||
71 | The `--srcdir=DIR' option specifies that the configuration and build | |
72 | processes should look for the Emacs source code in DIR, when DIR is | |
73 | not the current directory. | |
74 | ||
75 | The `--prefix=PREFIXDIR' option specifies where the installation process | |
76 | should 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 | ||
86 | The `--exec-prefix=EXECDIR' option allows you to specify a separate | |
87 | portion of the directory tree for installing architecture-specific | |
88 | files, 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. | |
92 | EXECDIR/bin should be a directory that is normally in users' PATHs. | |
93 | ||
94 | For example, the command | |
95 | ||
96 | ./configure mips-dec-ultrix --with-x11 | |
97 | ||
98 | configures Emacs to build for a DECstation running Ultrix, with | |
99 | support for the X11 window system. | |
100 | ||
101 | The `configure' program does not accept abbreviations for its | |
102 | options. | |
103 | ||
104 | Note that `configure' doesn't do any compilation or installation | |
105 | itself. It just creates the files that influence those things: | |
106 | `./Makefile', `build-install', and `./src/config.h'. For details on | |
107 | exactly what it does, see the section called `CONFIGURATION BY HAND', | |
108 | below. | |
109 | ||
110 | When it is done, `configure' prints a description of what it did and | |
111 | leaves a copy in the file `config.status'. That file is also a shell | |
112 | script which, when run, recreates the same configuration; it contains | |
113 | the verbal description as a comment. If `configure' exits with an | |
114 | error after disturbing the status quo, it removes `config.status'. | |
115 | ||
116 | The work of `configure' can be done by editing various files in the | |
117 | distribution, but using `configure' is supposed to be simpler. See | |
118 | the section called "CONFIGURATION BY HAND" below if you want to do the | |
119 | configuration yourself. | |
120 | ||
121 | 4) Look at `./lisp/paths.el'; if some of those values are not right | |
122 | for your system, edit the file `./lisp/site-init.el' containing Emacs | |
123 | Lisp code to override them; you probably don't want to edit paths.el | |
124 | itself. YOU MUST USE THE LISP FUNCTION `setq' TO ASSIGN VALUES, | |
125 | rather than `defvar', as used by `./lisp/paths.el'. For example, | |
126 | ||
127 | (setq news-inews-program "/usr/bin/inews") | |
128 | ||
129 | is how you would override the default value of the variable | |
130 | news-inews-program (which is "/usr/local/inews"). | |
131 | ||
132 | Note that, on some systems, the code you place in site-init.el must | |
133 | not use expand-file-name or any other function which may look | |
134 | something up in the system's password and user information database. | |
135 | See `./PROBLEMS' for more details on which systems this affects. | |
136 | ||
137 | 5) Put into `./lisp/site-init.el' any Emacs Lisp code you want Emacs | |
138 | to load before it is dumped out. | |
139 | ||
140 | Note that, on some systems, the code you place in site-init.el must | |
141 | not use expand-file-name or any other function which may look | |
142 | something up in the system's password and user information database. | |
143 | See `./PROBLEMS' for more details on which systems this affects. | |
144 | ||
145 | This file is nonexistent in the distribution. You do not need to | |
146 | create it if you have nothing to put in it. | |
147 | ||
148 | 6) Refer to the file `./etc/TERMS' for information on fields you may | |
149 | wish to add to various termcap entries. The files `./etc/termcap.ucb' | |
150 | and `./etc/termcap.dat' may already contain appropriately-modified | |
151 | entries. | |
152 | ||
153 | 7) Run `make' in the top directory of the Emacs distribution to finish | |
154 | building Emacs in the standard way. The final executable file will be | |
155 | named `src/emacs'. If you want to have Emacs's executable programs | |
156 | and data files installed as well, run `make install'. | |
157 | ||
158 | By 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 | ||
210 | If these directories are not what you want, you can specify where to | |
211 | install Emacs's libraries and data files or where Emacs should search | |
212 | for its lisp files by giving values for `make' variables as part of | |
213 | the command. See the section below called `MAKE VARIABLES' for more | |
214 | information on this. | |
215 | ||
216 | 8) 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 | |
218 | info files. | |
219 | ||
220 | 9) You are done! | |
221 | ||
222 | ||
223 | MAKE VARIABLES | |
224 | ||
225 | You can change where the build process installs Emacs and its data | |
226 | files by specifying values for `make' variables as part of the `make' | |
227 | command line. For example, if you type | |
228 | ||
229 | make install bindir=/usr/local/gnubin | |
230 | ||
231 | the `bindir=/usr/local/gnubin' argument indicates that the Emacs | |
232 | executable files should go in `/usr/local/gnubin', not | |
233 | `/usr/local/bin'. | |
234 | ||
235 | Here 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 | ||
312 | The above variables serve analogous purposes in the makefiles for all | |
313 | GNU 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 | ||
346 | Remember that you must specify any variable values you need each time | |
347 | you run `make' in the top directory. If you run `make' once to build | |
348 | emacs, test it, and then run `make' again to install the files, you | |
349 | must provide the same variable settings each time. To make the | |
350 | settings persist, you can edit them into the `Makefile' in the top | |
351 | directory, but be aware that running the `configure' program erases | |
352 | `Makefile' and rebuilds it from `Makefile.in'. | |
353 | ||
354 | The top-level Makefile stores the variable settings it used in the | |
355 | Makefiles for the subdirectories, so you don't have to specify them | |
356 | when running make in the subdirectories. | |
357 | ||
358 | ||
359 | CONFIGURATION BY HAND | |
360 | ||
361 | Running the `configure' program performs the following steps. | |
362 | ||
363 | 1) Copy `./src/config.h.in' to `./src/config.h'. | |
364 | ||
365 | 2) Consult `./etc/MACHINES' to see what configuration name you should | |
366 | use for your system. Look at the code of the `configure' script to | |
367 | see 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 | |
370 | the appropriate system and architecture description files. | |
371 | ||
372 | 2) Edit `./src/config.h' to set the right options for your system. If | |
373 | you need to override any of the definitions in the s/*.h and m/*.h | |
374 | files for your system and machine, do so by editing config.h, not by | |
375 | changing the s/*.h and m/*.h files. Occasionally you may need to | |
376 | redefine parameters used in `./lib-src/movemail.c'. | |
377 | ||
378 | 3) 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 | |
380 | appropriate values for the variables in the sections entitled "Things | |
381 | `configure' Might Edit" and "Where To Install Things." Note that you | |
382 | may only need to change the variables `prefix' and `exec_prefix', | |
383 | since the rest of the variables have reasonable defaults based on | |
384 | them. | |
385 | ||
386 | 4) Typing `make src/Makefile lib-src/Makefile' builds the | |
387 | makefiles for the subdirectories, editing in the values for the path | |
388 | variables you establed in step 3. | |
389 | ||
390 | -- or -- | |
391 | ||
392 | 4) If you're going to use the build-install script to build Emacs, | |
393 | copy `./build-install.in' to `./build-install', and edit the similar | |
394 | definitions found at the top of the script. | |
395 | ||
396 | ||
397 | The `configure' script is built from `configure.in' by the `autoconf' | |
398 | program. However, since Emacs has configuration requirements that | |
399 | autoconf can't meet, `configure.in' uses an unholy marriage of | |
400 | custom-baked configuration code and autoconf macros. New versions of | |
401 | autoconf could very well break this arrangement, so it may be wise to | |
402 | avoid rebuilding `configure' from `configure.in' when possible. | |
403 | ||
404 | ||
405 | BUILDING GNU EMACS BY HAND | |
406 | ||
407 | Once Emacs is configured, running `make' or running the shell script | |
408 | `build-install' in the top directory performs the following steps. | |
409 | ||
410 | 1) Run `make src/paths.h' in the top directory. This produces | |
411 | `./src/paths.h' from the template file `./src/paths.h.in', changing | |
412 | the paths to the values specified in `./Makefile'. | |
413 | ||
414 | 2) Cd to `./lib-src' and run `make'. This creates executables named | |
415 | `ctags' and `etags' and `wakeup' and `make-docfile' and `digest-doc' | |
416 | and `test-distrib'. And others. | |
417 | ||
418 | 3) Cd to `./src' and Run `make'. This refers to files in the `./lisp' | |
419 | and `./lib-src' subdirectories using names `../lisp' and | |
420 | `../lib-src'. | |
421 | ||
422 | This creates a file `./src/emacs' which is the runnable Emacs, | |
423 | assigning it a new version number by incrementing the version stored | |
424 | in `./lisp/version.el'. | |
425 | ||
426 | It also creates a file in `./etc' whose name is `DOC' followed by the | |
427 | current Emacs version. This file contains documentation strings for | |
428 | all the functions in Emacs. Each time you run make to make a new | |
429 | emacs, a new DOC file with a new name is made. You must keep the DOC | |
430 | file for an Emacs version as long as you keep using that Emacs | |
431 | version. | |
432 | ||
433 | ||
434 | INSTALLATION BY HAND | |
435 | ||
436 | The steps below are done by the shell script `build-install' or by | |
437 | running `make install' in the main directory of the Emacs | |
438 | distribution. | |
439 | ||
440 | 1) Copy `./lisp' and its subdirectories, `./etc', and the executables | |
441 | in `./lib-src' to their final destinations, as selected in `./src/paths.h'. | |
442 | ||
443 | Strictly 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 | ||
454 | 2) Copy the files in `./info' to the place specified in | |
455 | `./lisp/site-init.el' or `./lisp/paths.el'. Note that if the | |
456 | destination directory already contains a file named `dir', you | |
457 | probably don't want to replace it with the `dir' file in the Emacs | |
458 | distribution. Instead, you should make sure that the existing `dir' | |
459 | file contains an appropriate menu entry for the Emacs info. | |
460 | ||
461 | 3) Create a directory for Emacs to use for clash detection, named as | |
462 | indicated by the PATH_LOCK macro in `./src/paths.h'. | |
463 | ||
464 | 4) Copy `./src/emacs' to `/usr/local/bin', or to some other directory | |
465 | in 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 | |
468 | of installing different versions. | |
469 | ||
470 | You can delete `./src/temacs'. | |
471 | ||
472 | 5) Copy the programs `b2m', `emacsclient', `ctags', `etags', and | |
473 | `rcs2log' from `./lib-src' to `/usr/local/bin'. These programs are | |
474 | intended for users to run. | |
475 | ||
476 | 6) Copy the man pages in `./etc' for emacs, ctags, and etags into the | |
477 | appropriate man directories. | |
478 | ||
479 | 7) The files in the `./src' subdirectory, except for `emacs', are not | |
480 | used by Emacs once it is built. The source would be handy for | |
481 | debugging. | |
482 | ||
483 | ||
484 | PROBLEMS | |
485 | ||
486 | See the file PROBLEMS in this directory for a list of various | |
487 | problems sometimes encountered, and what to do about them. | |
488 | ||
489 |