本帖最后由 myzr_soft 于 2020-1-2 08:39 编辑
主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK200-6Q-1G
内核版本 :linux-4.1.15
交叉编译链:arm-linux-gnueabihf
文件系统:L4115-core-image-base-myimx6a9.tar.bz2
下载: tslib:
配置交叉工具: $ export PATH=/home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/PATH
创建工作目录及解压: $ mkdir Qt $ mv tslib-master.zip Qt $ mv qt-everywhere-opensource-src-5.5.1.tar.gz Qt $ cd Qt/ $ unzip tslib-master.zip $ tar xf qt-everywhere-opensource-src-5.5.1.tar.gz $ mkdir tslib-install
编译tslib(X86): $ cd tslib-master $ ./autogen.sh $ ./configure $ make $ make install
编译tslib(arm): $ make distclean $ ./autogen.sh $ ./configure --host=arm-linux-gnueabihf --prefix /home/myzr/Qt/tslib-install/ CC=arm-linux-gnueabihf-gcc $ make $ make install
编译qt库: $ cd .. $ cd qt-everywhere-opensource-src-5.5.1 $ cd qtbase/mkspecs/ $ cp linux-arm-gnueabi-g++/ linux-arm-poky-gnueabi-g++/ -r $ cd linux-arm-poky-gnueabi-g++/ $ vi qmake.conf
修改交叉工具链路径,且在QMAKE_CC、QMAKE_CXX、QMAKE_LINK、QMAKE_LINK_SHLIB后加上-lts: QMAKE_CC = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -lts QMAKE_CXX = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts QMAKE_LINK = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -lts QMAKE_LINK_SHLIB = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf -lts
# modifications to linux.conf QMAKE_AR = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs QMAKE_OBJCOPY = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy QMAKE_NM = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-nm -P QMAKE_STRIP = /home/myzr/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip
$ cd ~/Qt/qt-everywhere-opensource-src-5.5.1 $ vi qtbase/mkspecs/common/linux.conf
QMAKE_LIBS_THREAD = -lpthread 后加上-lts 即: QMAKE_LIBS_THREAD = -lpthread -lts
$ sudo ./configure -prefix /usr/local/qte5.5.1 -release -opensource -no-accessibility -make libs -xplatform linux-arm-poky-gnueabi-g++ -optimized-qmake -pch -qt-sql-sqlite -qt-zlib -tslib -no-opengl -no-sse2 -no-openssl -no-nis -no-cups -no-glib -no-pkg-config -no-separate-debug-info -tslib -I/home/myzr/Qt/tslib-install/include -L/home/myzr/Qt/tslib-install/lib
$ sudo make $ sudo make install
安装目录为/usr/local/qte5.5.1 可将这个文件移植到开发板相同的目录
将 tslib-install 移植到开发板的 /usr/local 目录下
# vi /usr/local/tslib-install/etc/ts.conf
"#module_raw input"把前面的#去掉
# vi /etc/profile 加上: export T_ROOT=/usr/local/tslib-install export LD_LIBRARY_PATH=/usr/local/tslib-install/libLD_LIBRARY_PATH export TSLIB_CONSOLEDEVICE=none export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_TSDEVICE=/dev/input/event0 export TSLIB_PLUGINDIR=$T_ROOT/lib/ts export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf export POINTERCAL_FILE=/etc/pointercal export TSLIB_CALIBFILE=/etc/pointercal
export QTEDIR=/usr/local/qte5.5.1 export LD_LIBRARY_PATH=/usr/local/qte5.5.1/libLD_LIBRARY_PATH export QT_QPA_GENERIC_PLUGINS=tslib export QT_QPA_FONTDIR=$QTEDIR/lib/fonts export QT_QPA_PLATFORM_PLUGIN_PATH=$QTEDIR/plugins export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x480:mmSize=800x480ffset=0x0:tty=/dev/tty1 export QT_QPA_FB_TSLIB=1
if [ -f /etc/pointercal ];then echo "MXS touchscreen have calibrate!" else /usr/local/tslib-install/bin/ts_calibrate sync fi
|