zoukankan      html  css  js  c++  java
  • [转]交叉编译tslib1.4

    http://blog.163.com/li_nian_you/blog/static/44853721201131504741178/

    假设源码解压目录为:    /home/tslib-1.4
    1、cd /home/tslib-1.4
         export CC=arm-linux-gcc //编译时所用的编译器,确保能找到
         ./autogen.sh //生成congigure
        echo ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache //可以使make过程的错误不出现
    2、./configure --host=arm-linux --cache-file=arm-linux.cache //加上参数--prefix=/home/tslib-1.4可以看到头文件
    3、make

    出现错误:undefined reference 'rpl_malloc'
    解决:将config.h.in中的
     #undef malloc  行注释掉
    4、make install
    生 成的库文件分别在目录./src、./plugins的.lib目录中,其中./lib为隐藏目录,src/.lib中包含libts- 0.0.so.0.1.1,libts-0.0.so.0、libts.la、libts.lai、libts.so,plugins/.lib中包含 ucb1x00.so、pthres.so、linear.so、input.so、variance.so、dejitter.so等,库文件版本为 libts-0.0.so.0.1.1,头文件为tslib.h
    5、拷贝
    mkdir tslib-1.4
    cd tslib-1.4
    mkdir lib etc plugins include tests
    目录lib:将src/.lib/中的libts-0.0.so.0,libts-0.0.so.0.1.1,libts.so拷到其中。
    目录etc: 将etc/中的ts.conf拷到其中。//结合自己的触摸屏型号进行相应的修改
    目录plugins: 将plugins/.libs/中的*.so拷到其中。//结合自己的触摸屏型号,删除部分库文件
    目录tests: 将tests/中的ts_*拷到其中。//只需要保留ts_calibrate和ts_test
    目录include:将src/tslib.h拷到其中。

    6、测试
    执行测试程序ts_calibrate时一直出现错误:ts_open:no such device
    通过查找ts_calibrate.c发现,编译时如果没有加参数--enable-inputapi=no,则应将环境变量定义如下:
    export TSLIB_TSDEVICE=/dev/input/event0(出错时为TSLIB_TSDEVICE=/dev/touchscreen/ucb1x00,因为我的触摸屏型号为  ucb1x00)
    export TSLIBDIR=/home/tslib-1.4
    export TSLIB_CONFFILE=$TSLIBDIR/etc/ts.conf
    export TSLIB_PLUGINDIR=$TSLIBDIR/plugins
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CONSOLEDEVICE=none
    export POINTERCAL_FILE=/etc/pointercal //生成校准文件
    export LD_LIBRARY_PATH=$TSLIBDIR/lib
    export QWS_MOUSE_PROTO=TPanel:/dev/touchscreen/ucb1x00
    export TSLIB_CALIBFILE=/etc/pointercal //应用校准文件
    [ -f /etc/pointercal ] || /home/tslib-1.4/tests/ts_calibrate //检查是否存在校准文件
    另外,还要注意的是,ts.conf内容如下:
    module_raw input
    #module_raw ucb1x00 //如果注释前一句而保留该句,则会出现意想不到的问题。
    module pthres pmin=1
    module variance delta=30
    module dejitter delta=100
    module linear
    执行ts_calibrate顺利通过。

  • 相关阅读:
    poj 1743 Musical Theme 后缀数组
    poj 1743 Musical Theme 后缀数组
    cf 432D Prefixes and Suffixes kmp
    cf 432D Prefixes and Suffixes kmp
    hdu Data Structure? 线段树
    关于position和anchorPoint之间的关系
    ios POST 信息
    CALayers的代码示例
    CALayers详解
    ios中得sqlite使用基础
  • 原文地址:https://www.cnblogs.com/sky1991/p/3078290.html
Copyright © 2011-2022 走看看