1.下载qt-embedded-linux-opensource-src-4.5.2.tar.gz和 tslib-1.4.tar.gz
2.交叉编译
#cd tslib
#vi do.sh
#!/bin/sh
./configure --build=i386-linux --host=arm-linux ac_cv_func_malloc_0_nonnull=yes CC=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-gcc CXX=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-g++ --prefix=$PWD/build
#chmod 755
#./do.sh
#make
#make install
#cd qt-embedded-linux-opensource-src-4.5.2
#mkdir libts
#cp (***tslib)/build/lib/libts* libts/
#cp (***tslib)/build/include/* libts/
修改mkspecs/qws/linux-armv6-g++/qmake.conf,加入下面几行设置qmake的FLAGS:
#qwdu added
QMAKE_INCDIR = (****)/qt-embedded-linux-opensource-src-4.5.2/libts
QMAKE_LIBDIR = (****)/qt-embedded-linux-opensource-src-4.5.2/libts
#vi do.sh
#!/bin/sh
./configure \
-opensource \
-prefix /***/***(install dir) \
-release \
-shared \
-no-qt3support \
-no-xmlpatterns \
-no-svg \
-no-webkit \
-qt-zlib \
-qt-gif \
-qt-libtiff \
-qt-libpng \
-qt-libmng \
-qt-libjpeg \
-make libs \
-make tools \
-nomake examples \
-nomake docs \
-nomake demo \
-no-nis \
-no-cups \
-no-iconv \
-no-dbus \
-no-openssl \
-xplatform qws/linux-armv6-g++ \
-embedded arm \
-little-endian \
-qt-freetype \
-depths 16 \
-qt-gfx-linuxfb \
-no-gfx-transformed \
-no-gfx-multiscreen \
-no-gfx-vnc \
-no-gfx-qvfb \
-qt-kbd-tty \
-qt-kbd-usb \
-qt-mouse-tslib \
-qt-mouse-pc \
-no-glib
#chmod 755 do.sh
#./do.sh
#make
#make install
在开发板上设置环境变量
#vi /usr/etc/rc.local
#!/sh/bin
export TSDIR=/usr/tslib
export PATH=$TSDIR/bin:$PATH
export LD_LIBRARY_PATH=$TSDIR/lib:$LD_LIBRARY_PATH
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CALIBFILE=$TSDIR/etc/pointercal
export TSLIB_CONFFILE=$TSDIR/etc/ts.conf
export TSLIB_PLUGINDIR=$TSDIR/plugins
export TSLIB_TSDEVICE=/dev/ts0
export TSLIB_TSEVENTTYPE=H3600
export QTDIR=/usr/qt
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$QTDIR/plugins/
export QT_QWS_FONTDIR=$QTDIR/fonts
#export QWS_MOUSE_PROTO=LinuxTP:/dev/ts0
export QWS_MOUSE_PROTO=Tslib:/dev/ts0
#mkdir /usr/qt
把之前编译安装的QT库和程序(qt的install目录)copy到开发板的/usr/qt目录下,具体如下:
bin fonts lib plugins
bin下放入mousecalibration
fonts下放入*qpf字体(字体比较大,占用空间,可以只复制QT自己转化过的qpf字体)
lib下放入libQtCore.so.4.5.2,libQtGui.so.4.5.2,libQtNetwork.so.4.5.2,libQtSql.so.4.5.2
然后链接下
libQtCore.so.4 -> libQtCore.so.4.5.2
libQtGui.so.4 -> libQtGui.so.4.5.2
libQtNetwork.so.4 -> libQtNetwork.so.4.5.2
libQtSql.so.4 -> libQtSql.so.4.5.2
#mkdir /usr/tslib
再把之前编译安装的Tslib库和程序(tslib的bulid目录)copy到开发板的/usr/tslib目录下,具体如下:
bin etc include lib plugins
设置完毕
qt的库比较大,可以arm-linux-strip下
#sh /usr/etc/rc.local
#ts_calibrate
#mousecalibration
这两个程序测试结果成功
阅读(3079) | 评论(0) | 转发(0) |