7 Compiling and installing Emacs
********************************
7.1 How do I install Emacs?
===========================
This answer is meant for users of Unix and Unix-like systems. Users
of other operating systems should see the series of questions beginning
with *Note Emacs for MS-DOS::, which describe where to get non-Unix
source and binaries, and how to install Emacs on those systems.
For Unix and Unix-like systems, the easiest way is often to compile
it from scratch. You will need:
* Emacs sources. *Note Current GNU distributions::, for a list of
ftp sites that make them available. On `ftp.gnu.org', the main GNU
distribution site, sources are available as
`ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.1.tar.gz'
The above will obviously change as new versions of Emacs come out.
For instance, when Emacs 21.42 is released, it will most probably
be available as
`ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.42.tar.gz'
Again, you should use one of the GNU mirror sites (see *Note
Current GNU distributions::, and adjust the URL accordingly) so as
to reduce load on `ftp.gnu.org'.
* `gzip', the GNU compression utility. You can get `gzip' via
anonymous ftp at mirrors of `ftp.gnu.org' sites; it should compile
and install without much trouble on most systems. Once you have
retrieved the Emacs sources, you will probably be able to
uncompress them with the command
gunzip --verbose emacs-21.1.tar.gz
changing the Emacs version (21.1), as necessary. Once `gunzip'
has finished doing its job, a file by the name of `emacs-21.1.tar'
should be in your build directory.
* `tar', the "tape archiving" program, which moves multiple files
into and out of archive files, or "tarfiles". All of the files
comprising the Emacs source come in a single tarfile, and must be
extracted using `tar' before you can build Emacs. Typically, the
extraction command would look like
tar -xvvf emacs-21.1.tar
The `x' indicates that we want to extract files from this tarfile,
the two `v's force verbose output, and the `f' tells `tar' to use
a disk file, rather than one on the tape drive.
If you're using GNU `tar' (available at mirrors of `ftp.gnu.org'),
you can combine this step and the previous one by using the command
tar -zxvvf emacs-21.1.tar.gz
The additional `z' at the beginning of the options list tells GNU
`tar' to uncompress the file with `gunzip' before extracting the
tarfile's components.
At this point, the Emacs sources (all 70+ megabytes of them) should
be sitting in a directory called `emacs-21.1'. On most common Unix and
Unix-like systems, you should be able to compile Emacs (with X Window
system support) with the following commands:
cd emacs-21.1 # change directory to emacs-21.1
./configure # configure Emacs for your particular system
make # use Makefile to build components, then Emacs
If the `make' completes successfully, the odds are fairly good that
the build has gone well. (*Note Problems building Emacs::, if you
weren't successful.)
By default, Emacs is installed in the following directories:
`/usr/local/bin'
binaries.
`/usr/local/share/emacs/21.1'
Lisp code and support files.
`/usr/local/info'
Info documentation.
To install files in those default directories, become the superuser
and type
make install
Note that `make install' will overwrite `/usr/local/bin/emacs' and
any Emacs Info files that might be in `/usr/local/info'.
Much more verbose instructions (with many more hints and suggestions)
come with the Emacs sources, in the file `INSTALL'.