1、下载
使用下面连接进行下载
ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
2、编译
在编译之前,需要安装vim所依赖的开发包
sudo yum install python-devel python3-devel ruby-devel libX11-devel gtk-devel gtk2-devel gtk3-devel ncurses-devel
成功后,进行编译
cd vim74/
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config/ --enable-perlinterp --enable-gui=gtk2 --enable-cscope --prefix=/usr --enable-luainterp
make VIMRUNTIMEDIR=/usr/share/vim/vim74
中途可能会出现以下错误:
/usr/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c
/usr/bin/perl /usr/share/perl5/ExtUtils/xsubpp -prototypes -typemap \
/usr/share/perl5/ExtUtils/typemap if_perl.xs >> auto/if_perl.c
Can't open perl script "/usr/share/perl5/ExtUtils/xsubpp": No such file or directory
make[1]: *** [auto/if_perl.c] Error 2
make[1]: Leaving directory `/home/eric/Downloads/vim74/src'
make: *** [first] Error 2
原因是xsubpp工具目录发生了变化,修改Makefile
1)首先找到是执行到哪条语句出现了问题
[eric@localhost vim74]$ grep xsubpp -Rn *
runtime/doc/version7.txt:12136:Solution: Use xsubpp if needed. (Yasuhiro Matsumoto)
src/Make_bc5.mak:1006: $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \
src/main.aap:420: :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \
src/Make_mvc.mak:839:XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
src/Make_mvc.mak:843:XSUBPP = xsubpp
src/Make_ming.mak:117:XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
src/Make_ming.mak:122:XSUBPP=xsubpp
src/Makefile:2454: $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
src/Make_vms.mms:372: -@ $(PERL) PERL_ROOT:[LIB.ExtUtils]xsubpp -prototypes -typemap -
src/Make_cyg.mak:661: $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
结合错误信息,不难发现,一定是执行了下面这句出现了问题
src/Makefile:2454: $(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
编辑src/Makefile
$(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
修改为
$(PERL) $(PERLLIB)/vendor_perl/ExtUtils/xsubpp -prototypes -typemap \
继续编译
make clean
make VIMRUNTIMEDIR=/usr/share/vim/vim74
3、安装
sudo make install
4、验证
vim --version
阅读(5412) | 评论(1) | 转发(0) |