Emacs编译
出自Wesker的笔记
目录 |
获取源码
GNU网站上列举了所有的镜像站点,我是从北大的镜像下载的,速度很快
安装必要的包
如果是首次编译Emacs,则需要运行如下命令安装所需的包
sudo apt-get install build-essential
sudo apt-get install texinfo
sudo apt-get install libncurses5-dev libgtk2.0-dev libxpm-dev libgif-dev libtiff-dev libgpm-dev librsvg2-dev libdbus-1-dev libgconf2-dev libotf-dev libm17n-dev
还有几个包在./configure后,会有类似提示
Configured for `x86_64-unknown-linux-gnu'.
Where should the build process find the source code? /home/wesker/emacs-23.3What operating system and machine description files should Emacs use?`s/gnu-linux.h' and `m/amdx86-64.h'
What compiler should emacs be built with? gcc -g -O2 -Wdeclaration-after-statement -Wno-pointer-signShould Emacs use the GNU version of malloc? yes(Using Doug Lea's new malloc from the GNU C Library.)
Should Emacs use a relocating allocator for buffers? yes
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? x11
What toolkit should Emacs use? GTK
Where do we find X Windows header files? Standard dirs
Where do we find X Windows libraries? Standard dirs
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? yesDoes Emacs use -ljpeg? yesDoes Emacs use -ltiff? yesDoes Emacs use a gif library? yes -lgif
Does Emacs use -lpng? yesDoes Emacs use -lrsvg-2? yes
Does Emacs use -lgpm? yesDoes Emacs use -ldbus? yesDoes Emacs use -lgconf? yesDoes Emacs use -lfreetype? yesDoes Emacs use -lm17n-flt? yesDoes Emacs use -lotf? yesDoes Emacs use -lxft? yesDoes Emacs use toolkit scroll bars? yes
看见有no的项就apt安装 输入lib*再tab补全出来装上就行了,距离首次编译有些久了,我不确定前面安装包是否有遗漏。
-lXaw3d项我不知道什么是包,如果有谁知道,希望内指教一下,不甚感激
配置&编译
configure时有些个选项,比如--perfix,--with-x-toolkit,直接不管它就行了
./configuremake
测试
单独运行下编译好的Emacs,看有没啥毛病,注意启动参数
src/emacs -q
安装Emacs
确认Emacs没毛病后,安装之
sudo make install
删除Emacs
在安装新版本的Emacs前推荐删除旧版Emacs,首先得下到对应版本的源码,如果当时编译了没有删除最好,运行如下命令删除
./configuresudo make uninstall
注意在./configure时所给的参数需要和你安装时所给的参数相同
Tips
编译好后,如果更改系统名,运行Emacs会有警告提示,暂时不知到有啥影响