准备工作
ncurses-6.0.tar.gz
配置&编译&安装
1. 解压
tar zxvf ncurses-6.0.tar.gz
2. 配置
注意
- < targe-dir > 按实际安装路径填写
- –enable-widec 这个选项如果再移植alsa-utils时很重要,必填!
但是minicom只认libncurses.so所以不能带这个选项!
### cross-compile to ncurses (libncurses.so.6.0)
./configure --host=arm-linux-gnueabihf \
--prefix=<install-dir>/arm_ncurses \
--target=arm-linux-gnueabihf \
--with-shared \
--without-profile \
--disable-stripping \
--without-progs \
--with-manpages \
--without-tests
### cross-compile to ncursesw (libncursesw.so.6.0)
./configure --host=arm-linux-gnueabihf \
--prefix=<install-dir>/arm_ncurses_w \
--target=arm-linux-gnueabihf \
--with-shared \
--without-profile \
--disable-stripping \
--without-progs \
--with-manpages \
--without-tests \
--enable-widec
3. 编译&安装
make
make install
4. 目标环境配置
在目标机器目录 /etc/profile 下追加以下代码
# file path: /etc/profile
#! /bin/sh
LD_LIBRARY_PATH=/lib:/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
5. 拷贝文件至开发板
//cd arm_ncurses
mkdir -p ~/nfs/rootfs/usr/share
cp -arf lib/* ~/nfs/rootfs/usr/lib
cp -arf share/* ~/nfs/rootfs/usr/share
//cd arm_ncurses_w
cp -arf lib/* ~/nfs/rootfs/usr/lib
cp -arf share/* ~/nfs/rootfs/usr/share
X. 常见错误
Error opening terminal vt100
没有在 etc/profile
指定TERM的环境变量,在该文件下追加以下语句
export TERM=vt100
export TERMINFO=/usr/share/terminfo
configure 一些说明
常见的一些配置
--prefix= #安装路径
--host= #运行环境, 交叉编译链前缀
--target= #交叉编译链前缀
--enable-widec #开启wide-char/UTF-8
--with-shared #生成共享库
--with-manpages #应该是添加一些man指令可以看的帮助页面
--without-tests #禁止测试,不需要测试,测试会比较久?
--without-profile #分析使用的一些特性吧?
--disable-stripping #关闭压缩,因为在交叉编译程序上使用主机工具可能会引发错误
--without-progs #禁止程序安装?