下载tslib 1.4 源码编译.
在linux下面解压,创建make.sh 脚本
export PATH=/hom/bbb/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin:$PATH
export CROSS_COMPILE=arm-linux-gnueabihf-
make clean
执行 ./autogen.sh 如报错下面信息,需要安装autoconf, automake,libtool 工具
./autogen.sh: 4: ./autogen.sh: autoreconf: not found
解决方法:
apt-get install autoconf
apt-get install automake
apt-get install libtool
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --cache-file=arm-linux.cache --prefix=/home/yangkun/yh/tslib/01test
make
报错
ts_test.c:(.text+0x208): undefined reference to `rpl_malloc'
fbutils.o: In function `open_framebuffer':
fbutils.c:(.text+0x598): undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status
make[2]: *** [ts_test] Error 1
如出现上面rpl_malloc 报错
屏蔽掉 config.h.in 里面的 #undef malloc
再次 make && make install
在目标目录下面会生成 文件 bin etc include lib
把文件拷贝到板子的/USR/LOCAL 目录下面
tslib 文件配置
1,/etc/ts.conf 文件 module_raw input 注释去掉
2,/bin/ts_calibrate 文件拷贝到usr/bin 可直接执行,
3,tslib配置文件 etc/profile.d/tslib.sh 修改
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export TSLIB_TSDEVICE=/dev/input/event0 /*触摸屏设备文件名*/
export TSLIB_CONFFILE=/usr/local/etc/ts.conf /*tslib配置文件*/
export TSLIB_PLUGINDIR=/usr/local/lib/ts /*tslib需要加载模块所在目录*/
export TSLIB_CALIBFILE=/etc/pointercal /*触摸屏校准信息保存文件*/
export TSLIB_CONSOLEDEVICE=none /*设备台设备文件名none*/
export TSLIB_FBDEVICE=/dev/fb0 /*framebuffer 设备文件名*/
至此 tslib 配置完全.