基于海思开发环境,交叉编译,安装tslib库
1.下载tslib源码包
- 链接:https://pan.baidu.com/s/1I4polpLf9dunFh03f4A-fA
- 提取码:pu2i
- 源码包名:tslib-1.4.tar.gz
2.安装自动编译软件
- sudo apt-get install autoconfsudo
- sudo apt-get install automakesudo
- sudo apt-get install libtool
3.拷贝源码包到海思开发平台,并解压源码包
- chmod 777 tslib-1.4.tar.gz
- tar -xvf tslib-1.4.tar.gz
- cd tslib
4.编写交叉编、安装脚本build.sh
- 内容
#!/bin/sh
export PATH=$PATH:/opt/hisi-linux/x86-arm/arm-himix400-linux/bin
export ARCH=arm
export CC=/opt/hisi-linux/x86-arm/arm-himix400-linux/bin/arm-himix400-linux-gcc
export CXX=/opt/hisi-linux/x86-arm/arm-himix400-linux/bin/arm-himix400-linux-g++
make clean && make distclean
./autogen-clean.sh
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes">arm-himix400-linux.cache
./configure --host=arm-himix400-linux --cache-file=arm-himix400-linux.cache --enable-inputapi=no --prefix=$(pwd)/arm-himix400-linux-target
make && make install - 参数解析
编译链: export PATH=$PATH:/opt/hisi-linux/x86-arm/arm-himix400-linux/bin
export ARCH=arm
export CC=/opt/hisi-linux/x86-arm/arm-himix400-linux/bin/arm-himix400-linux-gcc
export CXX=/opt/hisi-linux/x86-arm/arm-himix400-linux/bin/arm-himix400-linux-g++ 编清除前一次配置与编译结果 make clean && make distclean ./autogen-clean.sh ./autogen.sh 配置编译参数:(./configure -h查阅参数配置指南)echo "ac_cv_func_malloc_0_nonnull=yes">arm-hisiv300-linux.cache
./configure --host=arm-hisiv300-linux \
--cache-file=arm-hisiv300-linux.cache \
--enable-inputapi=no \
--prefix=$(pwd)/target
--host=交叉编译链名称:--host=arm-hisiv300-linux安装路径:--prefix=$(pwd)/target
编译安装
make && make install - 目标文件:
. ├── bin │ ├── ts_calibrate │ ├── ts_harvest │ ├── ts_print │ ├── ts_print_raw │ └── ts_test ├── etc │ └── ts.conf ├── include │ └── tslib.h └── lib ├── libts-0.0.so.0 -> libts-0.0.so.0.1.1 ├── libts-0.0.so.0.1.1 ├── libts.la ├── libts.so -> libts-0.0.so.0.1.1 ├── pkgconfig │ └── tslib-0.0.pc └── ts ├── arctic2.la ├── arctic2.so ├── collie.la ├── collie.so ├── corgi.la ├── corgi.so ├── dejitter.la ├── dejitter.so ├── h3600.la ├── h3600.so ├── input.la ├── input.so ├── linear_h2200.la ├── linear_h2200.so ├── linear.la ├── linear.so ├── mk712.la ├── mk712.so ├── pthres.la ├── pthres.so ├── ucb1x00.la ├── ucb1x00.so ├── variance.la └── variance.so 6 directories, 36 files
5.问题与处理方式
- 问题
checking host system type... Invalid configuration `arm-hisiv300-linux --cache-file=arm-hisiv300-linux.cache': machine `arm-hisiv300-linux --cache-file=arm-hisiv300' not recognized configure: error: /bin/bash ./config.sub arm-hisiv300-linux --cache-file=arm-hisiv300-linux.cache failed make: *** No targets specified and no makefile found. Stop.
- 处理方式
方法1:cp /usr/share/libtool/config.guess ./ cp /usr/share/libtool/config.sub ./ 方法2:rm -rf config.guess config.sub 方法3:更换运行脚本方式,从"./build.sh"改为“bash build.sh” 方法1,是网上一种处理方法,但是我尝试了不起效; 方法2,在Hisi3531a的开发环境,能够顺利安装tslib,但无法在hisi3521d开发环境中使用; 方法3,能在hisi3521d开发环境中顺利安装tslib。