【问题标题】:vim cross-compiling for ARMARM 的 vim 交叉编译
【发布时间】:2015-09-23 12:13:50
【问题描述】:

我正在使用 arm-linux-gnueabi 并尝试为我的设备编译 vim。经过一段时间的搜索和研究,我成功了,但是当我从设备启动它时,我看到了这个:

# /usr/tmp/vim/bin/vim
~
...
~
~VIM - Vi IMprovedversion 7.4.873by Bram Moolenaar et al.Vim is open source and freely distributableSponsor Vim development!type  :help sponsor<Enter>    for informationtype  :q<Enter>to exittype  :help<Enter>  or  <F1>  for on-line helptype  :help version7<Enter>   for version infoRunning in Vi compatible modetype  :set nocp<Enter>for Vim defaultstype  :help cp-default<Enter> for info on this

光标不会向任何方向移动,并且我输入的文本在最后一行。Vim 命令可以正常工作。

如果重要的话,在编译过程中我编译了 ncurses 库并使用标志定位它:

export LD_LIBRARY_PATH="<my_path>/lib/"
export CPPFLAGS="-L<my_path>/ncurses"
export LDFLAGS="-L<my_path>/lib"

但没有--with-tlib=ncurses 我有一个错误:

checking for tgetent in -lncurses... yes
ncurses library is not usable

我使用安装手册交叉编译vim源,根据我设置了一些变量:

export vim_cv_terminfo=yes
export vim_cv_tty_group=world
export vim_cv_getcwd_broken=no
export vim_cv_stat_ignores_slash=yes
export vim_cv_memmove_handles_overlap=yes
export vim_cv_bcopy_handles_overlap=yes
export vim_cv_memcpy_handles_overlap=yes
export vim_cv_tgetent=non-zero

我不太确定他们...

我做了更多的研究,但没有找到任何有用的信息。 此问题可能与错误的 term 检测或 ncurses 编译有关...

也许在编译期间我必须设置一些标志?有人见过这个吗?

【问题讨论】:

  • 您能否提供您使用的资源的链接或完成此操作的说明或工作脚本?我猜你也必须从源代码交叉编译所有依赖项?根据您下面的回答,terminfo 数据库是否只需要在运行时出现在目标上?
  • 据我所知,我只交叉编译 ncurses lib。我在 vim 的源代码中找到了编译 vim 的说明。是的,必须在目标机器上提供带有术语文件的 terminfo 目录。它有点大,但你只能留下你需要的文件。如果您卡住了 - 请随时向我寻求帮助。也许我能记住一些有用的东西。

标签: linux vim cross-compiling ncurses


【解决方案1】:

想办法。

看来 vim 需要 terminfo 数据库(ncurses lib 创建它)才能正常工作。

我使用我使用的终端(vt100 和 xterm)将部分数据库添加到设备中,现在它工作正常。 为了找出 terminfo 数据库的位置,我使用了 strace 命令:

strace vim
...
stat64("/root/.terminfo", 0xc7a4c8)     = -1 ENOENT (No such file or directory)
stat64("/opt/share/terminfo", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
...

【讨论】:

    猜你喜欢
    • 2014-06-13
    • 1970-01-01
    • 2016-05-26
    • 2013-01-19
    • 2021-02-17
    • 2016-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多