编译环境:Ubuntu 12.04 TLS
交叉编译器:fsl-linaro-toolchain
tslib1.4编译
解压tslib-1.4.tar.gz
安装依赖库:sudo apt-get install autoconf automake libtool
./autogen.sh
在执行./autogen.sh
Vim configTslib14.sh
!/bin/sh
make distclean
echo “ac_cv_func_malloc_0_nonnull=yes”>arm-linux.cache
CC=/usr/local/arm/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-gcc ./configure –host=arm-none-linux-gnueabi –prefix=/work/Qt/Qt_Install/tslib1.4 –cache-file=arm-none-linux-gnueabi.cache
make && make install
最后
chmod 777 configTslib14.sh && sudo ./configTslib14.sh
编译过程中可能出现错误:
Make:
1、C++ no found
则下载库:sudo apt-get install build-essential
/usr/include/bits/fcntl2.h:51:
error: call to ‘__open_missing_mode’ declared with attribute
error: open with O_CREAT in second argument needs 3 arguments
/tests/ts_calibrate.c 中
/* 源文件
if ((calfile = getenv(“TSLIB_CALIBFILE”)) != NULL) {
cal_fd = open (calfile, O_CREAT | O_RDWR);
} else {
cal_fd = open (“/etc/pointercal”, O_CREAT | O_RDWR);
}*/
需要更改成如下形式
if ((calfile = getenv(“TSLIB_CALIBFILE”)) != NULL) {
cal_fd = open (calfile, O_CREAT | O_RDWR, 0777);
} else {
cal_fd = open (“/etc/pointercal”, O_CREAT | O_RDWR, 0777);
}保存后重新编译即可
或者查看交叉工具链是否加到环境变量中
Make install :
在交叉工具链已经加到环境变量出现arm-none-linux-gnueabi-gcc no found
对照 configTslib14.sh中地址是否与环境变量的交叉工具链的地址一致。
触摸屏校准:
启动imx6开发板后,在根文件系统中运行/tslib1.4文件下的/bin/tslib_calibrate