如果要编译Emacs,我需要安装哪些库?


21

我正在尝试emacs在Ubuntu 12.04上进行编译。这是因为我要使用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, i.e.
tiff, gif, jpeg, png and xpm.
If you are sure you want Emacs compiled without X window support, pass
  --without-x
to configure.

Answers:


23

我曾经这样做:

sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk-3-dev libncurses-dev libgnutls28-dev
# for gtk2 build replace libgtk-3-dev with libgtk2.0-dev

git clone --depth=1 git://git.savannah.gnu.org/emacs.git
cd emacs
./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

15

如果你跑

sudo apt-get build-dep emacs23

它会安装编译emacs23软件包所需的所有内容。同样很可能足以编译Emacs 24.2。


5
或者,在Ubuntu 14中:sudo apt-get build-dep emacs24
nnyby 2014年

2
如果您正在运行> = 16.04并获取E: You must put some 'source' URIs in your sources.list,请参阅此问题
恐龙

非常有用,可以修改为在Ubuntu 18.04或Linux Mint 19“ Tara”上安装emacs 26.1:sudo apt-get build-dep emacs25
sebisnow
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.