Because these instructions have been repeated so many times on this wiki, a brief summary of the basic steps is provided here. Nevertheless you should really also read the official documentation. We won’t repeat everything said there just for the sake of it.
$ cd /where/you/unpacked/or/branched/emacs $ ./autogen.sh # not needed when installing from tarball $ ./configure $ make $ make install
CategoryBuilding contains links to dedicated pages explaining how Emacs can be installed on various platforms. These pages provide instructions on how to use your distributions / platforms package manager to install Emacs and additional packages; and/or tell you how to obtain snapshots of the development sources.
Here is how to install Emacs using stow:
$ ./configure $ make $ make install prefix=/usr/local/stow/emacs $ cd /usr/local/stow $ stow emacs
If you have several installations of Emacs and XEmacs, perhaps some Gnus installation on side as well, then stow will detect conflicts in the info subdirectories. In order to resolve these, you must delete the appropriate info files. Example: You have Emacs and a separate Gnus installation. Then you need to delete the Gnus specific info files from /usr/local/stow/emacs/info. What I usually do is run stow emacs, delete the offending file, and repeat until all offending files have been deleted.
You must have some of the Xlib libraries available, even when you do not use X. On Debian, this is the xlibs-devel package.
For a fully featured Emacs, you need the following libraries (on a single line for use in commands):
libc6-dev libjpeg62-dev libncurses5-dev libpng-dev libtiff4-dev libungif4-dev xaw3dg-dev zlib1g-dev libice-dev libsm-dev libx11-dev libxext-dev libxi-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxt-dev libxtrap-dev libxtst-dev libxv-dev x-dev xlibs-static-dev
On Debian Woody (thanks to MilesBader) that list should be:
libc6-dev libjpeg62-dev libncurses5-dev libpng-dev libtiff3g-dev libungif4-dev xaw3dg-dev zlib1g-dev xlibs-dev