|
|
从sid源里装的emacs22字体很不舒服,搜了一下貌似解决起来很麻烦。据说emacs23对中文支持最好,google了一下,照着以下两个帖子试着编译安装,具体过程有一些不同,本文主要记录编译安装过程。写得很傻,算是抛砖引玉。
http://lixudong.blogbus.com/logs/7959927.html
http://www.blogjava.net/jarod/archive/2007/12/19/168662.html
安装cvs和ssh,并使用cvs下载emacs源码:
- sudo apt-get install ssh cvs
- export CVS_RSH="ssh"
- cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/cvsroot/emacs co -r emacs-unicode-2 emacs
复制代码
根据帖子里说的要安装以下编译所需环境:
- texinfo libgpmg1-dev libungif4-dev libpng12-dev libgd2-xpm-dev libtiff4-dev libjpeg62-dev librsvg2-dev libgtk2.0-dev
复制代码
据以往经验,有些东西不一定要装,即使要装现在源里的版本也可能发生了变化。等./configure结果出来再说。
配置编译选项:
- cd emacs
- ./configure --prefix=/usr --enable-font-backend --with-gtk --with-xft --with-freetype
复制代码
出现以下提示:
- * The Emacs "emacs-unicode-2" branch has been merged into *
- * the CVS trunk, and is now obsolete. You should probably *
- * use the CVS trunk instead. *
- * *
- * To switch a CVS checkout to the trunk, use the command: *
- * *
- * cvs update -A
复制代码
emacs-unicode-2已经过时,已经被并入CVS trunk……也不完全是好事,意味着要重新下载一下。
网速不快,耐心等吧。
更新完重新configure:
- ./configure --prefix=/usr --enable-font-backend --with-gtk --with-xft --with-freetype
复制代码
首先跳出的错误是:
- configure: error: --with-gtk has been removed. Use --with-x-toolkit to
- specify a toolkit.
复制代码
看样子变化还不少,把--with-gtk改成--with-x-toolkit=gtk:
- ./configure --prefix=/usr/share --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk
复制代码
让错误信息告诉我缺哪些东西了,虽然有点麻烦,但我有系统洁癖症,不喜欢装多余的东西:
- checking for gtk+-2.0 >= 2.6 glib-2.0 >= 2.6... no
- configure: error: Package gtk+-2.0 was not found in the pkg-config search path.
- Perhaps you should add the directory containing `gtk+-2.0.pc'
- to the PKG_CONFIG_PATH environment variable
- No package 'gtk+-2.0' found
复制代码
源里搜了一下,看到libgtk2.0-0比较接近,直接安装libgtk2.0-0,提示说libgtk2.0-0已经装了,回过头去看那两个帖子里提到要装的是libgtk2.0-dev。
- sudo apt-get install libgtk2.0-dev
复制代码
重新配置进了一步,出错为:
- configure: error: The following required libraries were not found:
- libXpm libgif/libungif libtiff
- Maybe some development libraries/packages are missing?
- If you don't want to link with them give
- --with-xpm=no --with-gif=no --with-tiff=no
复制代码
没见过这几个东西,搜了一下,有libxpm4、libXpm-dev,libgif4、libgif-dev, libtiff4、libtiff-dev,举一反三一次:
- sudo apt-get install libXpm-dev libgif-dev libtiff-dev
复制代码
这一回配置成功了,可以make bootstrap了。
出错:
- make[2]: *** No rule to make target `/home/simon22543/emacs23/emacs/lisp/org/org-agenda.elc', needed by `compile-main'. Stop.
- make[2]: Leaving directory `/home/simon22543/emacs23/emacs/lisp'
- make[1]: *** [lisp] Error 2
- make[1]: Leaving directory `/home/simon22543/emacs23/emacs'
- make: *** [bootstrap] Error 2
复制代码
google了一下,找到
http://www.archivum.info/help-gn ... 08-07/msg00874.html
看来最初签出emacs-unicode-2,而且更新之后还是不行:
并换个cvs源重新下载:
- cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs
复制代码
这个cvs源应该够保险,编译成功了。
启动emacs成功。
安装
这时发现自己最初设置--prefix=/usr/share有点画蛇添足了。
忘了拷出错信息了,提示大致为
- ……
- 没有足够权限创建/usr/share/share/emacs……
- ……
复制代码
哈哈,幸亏没加sudo,否则安装成功到/usr/share/share里面就怪怪的。
想到configure的配置结果写在Makefile里,在Makefile把安装路径修改掉,
- ……
- # ==================== Where To Install Things ====================
- # The default location for installation. Everything is placed in
- # subdirectories of this directory. The default values for many of
- # the variables below are expressed in terms of this one, so you may
- # not need to change them. This defaults to /usr/local.
- prefix=/usr/share
- ……
复制代码
其中的"/usr/share"改成"/usr",如果写成"/usr/",就会出现更不想看到的结果:"/usr//share/emacs……"
OK,安装成功。 |
|