LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1272|回复: 1

debian sid中编译安装emacs23

[复制链接]
发表于 2009-1-7 22:32:10 | 显示全部楼层 |阅读模式
从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源码:


  1. sudo apt-get install ssh cvs
  2. export CVS_RSH="ssh"
  3. cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/cvsroot/emacs co -r emacs-unicode-2 emacs
复制代码


根据帖子里说的要安装以下编译所需环境:

  1. texinfo libgpmg1-dev libungif4-dev libpng12-dev libgd2-xpm-dev libtiff4-dev libjpeg62-dev librsvg2-dev libgtk2.0-dev
复制代码


据以往经验,有些东西不一定要装,即使要装现在源里的版本也可能发生了变化。等./configure结果出来再说。
配置编译选项:


  1. cd emacs
  2. ./configure --prefix=/usr --enable-font-backend --with-gtk --with-xft --with-freetype
复制代码


出现以下提示:

  1. *   The Emacs "emacs-unicode-2" branch has been merged into      *
  2. *   the CVS trunk, and is now obsolete.  You should probably     *
  3. *   use the CVS trunk instead.                                   *
  4. *                                                                *
  5. *   To switch a CVS checkout to the trunk, use the command:      *
  6. *                                                                *
  7. *      cvs update -A
复制代码


emacs-unicode-2已经过时,已经被并入CVS trunk……也不完全是好事,意味着要重新下载一下。


  1. cvs update -A
复制代码


网速不快,耐心等吧。
更新完重新configure:


  1. ./configure --prefix=/usr --enable-font-backend --with-gtk --with-xft --with-freetype
复制代码


首先跳出的错误是:


  1. configure: error: --with-gtk has been removed.  Use --with-x-toolkit to
  2. specify a toolkit.
复制代码


看样子变化还不少,把--with-gtk改成--with-x-toolkit=gtk:


  1. ./configure --prefix=/usr/share --enable-font-backend --with-xft --with-freetype --with-x-toolkit=gtk
复制代码


让错误信息告诉我缺哪些东西了,虽然有点麻烦,但我有系统洁癖症,不喜欢装多余的东西:


  1. checking for gtk+-2.0 >= 2.6 glib-2.0 >= 2.6... no
  2. configure: error: Package gtk+-2.0 was not found in the pkg-config search path.
  3. Perhaps you should add the directory containing `gtk+-2.0.pc'
  4. to the PKG_CONFIG_PATH environment variable
  5. No package 'gtk+-2.0' found
复制代码


源里搜了一下,看到libgtk2.0-0比较接近,直接安装libgtk2.0-0,提示说libgtk2.0-0已经装了,回过头去看那两个帖子里提到要装的是libgtk2.0-dev。


  1. sudo apt-get install libgtk2.0-dev
复制代码


重新配置进了一步,出错为:


  1. configure: error: The following required libraries were not found:
  2.     libXpm libgif/libungif libtiff
  3. Maybe some development libraries/packages are missing?
  4. If you don't want to link with them give
  5.     --with-xpm=no --with-gif=no --with-tiff=no
复制代码


没见过这几个东西,搜了一下,有libxpm4、libXpm-dev,libgif4、libgif-dev, libtiff4、libtiff-dev,举一反三一次:


  1. sudo apt-get install libXpm-dev  libgif-dev libtiff-dev
复制代码


这一回配置成功了,可以make bootstrap了。


  1. make bootstrap
复制代码


出错:

  1. make[2]: *** No rule to make target `/home/simon22543/emacs23/emacs/lisp/org/org-agenda.elc', needed by `compile-main'.  Stop.
  2. make[2]: Leaving directory `/home/simon22543/emacs23/emacs/lisp'
  3. make[1]: *** [lisp] Error 2
  4. make[1]: Leaving directory `/home/simon22543/emacs23/emacs'
  5. make: *** [bootstrap] Error 2
复制代码


google了一下,找到
http://www.archivum.info/help-gn ... 08-07/msg00874.html

看来最初签出emacs-unicode-2,而且更新之后还是不行:
并换个cvs源重新下载:


  1. cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co emacs
复制代码


这个cvs源应该够保险,编译成功了。


  1. cd src
  2. ./emacs -q
复制代码


启动emacs成功。

安装


  1. cd ..
  2. make install
复制代码


这时发现自己最初设置--prefix=/usr/share有点画蛇添足了。
忘了拷出错信息了,提示大致为

  1. ……
  2. 没有足够权限创建/usr/share/share/emacs……
  3. ……
复制代码


哈哈,幸亏没加sudo,否则安装成功到/usr/share/share里面就怪怪的。
想到configure的配置结果写在Makefile里,在Makefile把安装路径修改掉,


  1. ……
  2. # ==================== Where To Install Things ====================

  3. # The default location for installation.  Everything is placed in
  4. # subdirectories of this directory.  The default values for many of
  5. # the variables below are expressed in terms of this one, so you may
  6. # not need to change them.  This defaults to /usr/local.
  7. prefix=/usr/share
  8. ……
复制代码


其中的"/usr/share"改成"/usr",如果写成"/usr/",就会出现更不想看到的结果:"/usr//share/emacs……"

OK,安装成功。
发表于 2009-1-8 09:11:23 | 显示全部楼层
不错,不错。

但如果不象自己编译,又想有一个支持xft的emacs可以用emacs-snapshot, 参考

http://emacs.orebokech.com/

如果不想看网站,最直接的就是添加源

deb http://emacs.orebokech.com sid main

然后添加key,不添加其实也能用

http://orebokech.com/Romain_Francoise.pgp
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表