如果我想编译emacs,我需要安装什么库

我想在Ubuntu 12.04上编译emacs。 这是因为我想使用emacs 24.2。 但是我收到了这个错误。 我该如何解决?

checking for long file names... yes checking for X... no checking for X... true configure: error: You seem to be running X, but no X development libraries were found. You should install the relevant development files for X and for the toolkit you want, such as Gtk+, Lesstif or Motif. Also make sure you have development files for image handling, ie tiff, gif, jpeg, png and xpm. If you are sure you want Emacs compiled without X window support, pass --without-x to configure. 

我曾经这样做过:

 sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev # for gtk3 build replace libgtk2.0-dev with libgtk-3-dev git clone --depth=1 git://git.savannah.gnu.org/emacs.git ./autogen.sh # not needed when installing from tarball ./configure make bootstrap sudo make install 

要构建文档:

 make docs # or build just the format you want: make info make dvi make html make pdf 

但现在我只使用这个包

 sudo add-apt-repository -y ppa:ubuntu-elisp sudo apt-get update sudo apt-get install emacs-snapshot 

如果你跑

 sudo apt-get build-dep emacs23 

安装编译emacs23包所需的一切。 很可能这也足以编译Emacs 24.2。