ARM开发板上ncurses库的移植

来源:互联网 发布:男士防晒霜推荐知乎 编辑:程序博客网 时间:2024/05/17 08:07

1.下载库源码

库文件源码下载地址

http://mirror.bjtu.edu.cn/gnu/ncurses/

 

选择5.7版本

下载得到压缩文件

ncurses-5.7.tar.gz

 

将压缩解压,得到目录ncurses-5.7

 

2.编译

 

进入目录ncurses-5.7

 

以下配置与编译参考ncurses源文件中的INSTALL文件。

 

由于编译过程出现关于C++头文件的问题,所以配置时使用配置参数--without-cxx-binding,不对C++部分进行编译(具体说明详见源文件中的INSTALL文件)

2.1配置

[root@localhostncurses-5.7]# ./configure --host=arm-linux--prefix=/home/ncurses_cross --with-shared CC=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-gcc--without-cxx-binding

 

配置选项--host=arm-linux指明程序运行的系统平台,arm-linux

配置选项--prefix=/home/ncurses_cross指明编译结果安装路径

配置选项 --with-shared 指明编译生成共享库文件

配置选项--without-cxx-binding不对c++相关文件进行编译

配置选项CC=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-gc配置交叉编译器路径

配置的参数CC似乎不起作用,或者根本没有此参数。这与configure脚本文件配置的参数有关。可以通过 configure–help查看配置参数及含义

2.2编译与安装

编译

[root@localhostncurses-5.7]# make&&make install

可以查看安装的文件

[root@localhostncurses-5.7]# cd /home/ncurses_cross/

[root@localhostncurses_cross]# ls

bin include  lib man  share

[root@localhostncurses_cross]#

lib目录下就有我们需要的共享库文件libncurses.so.5.0

使用file命令查看文件的类型

查看交叉编译得到的共享库文件的类型

[root@localhostlib]# file libncurses.so.5.0

libncurses.so.5.7:ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamicallylinked, not stripped

处理器类型为ARM

3.移植

可以将交叉编译后的共享库文件拷贝到ARM开发板系统标准库目录 /lib /usr/lib,供开发板使用。


原文连接:http://blog.csdn.net/lanyang123456/article/details/7680710

0 0
原创粉丝点击