[VIM插件]fedora22编译vim7.4对perl组件支持的问题

  在fedora22下,重新编译安装vim7.4的时,在编译perl组件支持时,出现如下错误:

/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c
/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
Makefile:2453: recipe for target 'auto/if_perl.c' failed
make[1]: *** [auto/if_perl.c] Error 2
make[1]: Leaving directory '/home/$usr/vim/src/vim74/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error 2

     找了下,发现fedora22的perl5的$lib路径和原先系统的竟然不一样了,在$PELR5/vendor_perl/ExtUtil/中才有连接文件xsubpp。

     接着修改了编译的指向路径,接着编译,却报错:

objects/buffer.o: In function `free_buffer':
/home/$usr/vim/src/vim74/src/buffer.c:661: undefined reference to `perl_buf_free'
objects/ex_docmd.o:(.rodata+0x4678): undefined reference to `ex_perl'
objects/ex_docmd.o:(.rodata+0x4690): undefined reference to `ex_perldo'
objects/window.o: In function `win_free':
/home/$usr/vim/src/vim74/src/window.c:4554: undefined reference to `perl_win_free'
objects/main.o: In function `getout':
/home/$usr/vim/src/vim74/src/main.c:1488: undefined reference to `perl_end'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
Makefile:1733: recipe for target 'vim' failed
make[1]: *** [vim] Error 1
make[1]: Leaving directory '/home/$USR/vim/src/vim74/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error 2

     检查src/auto/中的if_perl.c文件,发现竟然是空得,生成失败了。

     根据makefile或者第一个报错的指引,找到生成if_perl.c的命令,手动生成即可:

/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c
/bin/perl /usr/share/perl5/ExtUtils/xsubpp -prototypes -typemap \
    /usr/share/perl5/ExtUtils/typemap if_perl.xs >> auto/if_perl.c

     注意xsubpp的路径。

 

     

       

posted @ 2015-10-13 11:19  SimArchitect  阅读(1993)  评论(1编辑  收藏  举报