明远智睿技术论坛

标题: 移植QT库4.8.5 [打印本页]

作者: myzr_soft    时间: 2019-12-9 16:48
标题: 移植QT库4.8.5
本帖最后由 myzr_soft 于 2019-12-30 09:43 编辑

主机平台: UBUNTU14.04
硬件平台:明远智睿MY-IMX6-EK200-6Q-1G
内核版本 :linux-3.0.35
交叉编译链:
arm-fsl-linux-gnueabi
文件系统:L4115-core-image-base-myimx6a9.tar.bz2

下载:
tslib:[attach]588[/attach]
qt库:http://mirrors.ustc.edu.cn/qtproject/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz

配置交叉工具:
$ export PATH=~/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/PATH

创建工作目录及解压:
$ mkdir Qt
$ mv tslib-master.zip Qt
$ mv qt-everywhere-opensource-src-4.8.5.tar.gz Qt
$ cd Qt/
$ unzip tslib-master.zip
$ tar xf qt-everywhere-opensource-src-4.8.5.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-fsl-linux-gnueabi --prefix /home/myzr/Qt/tslib-install/ CC=arm-fsl-linux-gnueabi-gcc
$ make
$ make install

编译qt库:
$ cd ..
$ cd qt-everywhere-opensource-src-4.8.5/
$ cd mkspecs/qws/
$ cp linux-arm-gnueabi-g++/ linux-arm-nane-gnueabi-g++/ -r
$ cd linux-arm-nane-gnueabi-g++/
$ vi qmake.conf

修改交叉工具链路径,且在QMAKE_CC、QMAKE_CXX、QMAKE_LINK、QMAKE_LINK_SHLIB后加上-lts:
# modifications to g++.conf
QMAKE_CC                = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-gcc -lts
QMAKE_CXX               = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK              = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK_SHLIB        = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-g++ -lts
# modifications to linux.conf
QMAKE_AR                = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY           = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-objcopy
QMAKE_STRIP             = /home/myzr/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-strip
load(qt_config)
[attach]589[/attach]

$ cd  ~/Qt/qt-everywhere-opensource-src-4.8.5/
$ vi mkspecs/common/linux.conf

QMAKE_LIBS_THREAD       = -lpthread 后加上-lts
即: QMAKE_LIBS_THREAD     = -lpthread -lts
[attach]590[/attach]

$ ./configure \
-opensource \
-confirm-license \
-release \
-shared \
-embedded arm \
-force-pkg-config \
-xplatform qws/linux-arm-nane-gnueabi-g++ \
-depths 16,18,24,32 \
-fast \
-optimized-qmake \
-pch \
-qt-sql-sqlite \
-qt-libjpeg \
-qt-zlib \
-qt-libpng \
-qt-freetype \
-little-endian -host-little-endian \
-no-qt3support \
-qt-libtiff -qt-libmng \
-make translations \
-qt-gfx-linuxfb -qt-gfx-transformed -qt-gfx-multiscreen \
-no-gfx-vnc -no-gfx-qvfb -qt-kbd-linuxinput \
-no-kbd-qvfb -armfpa  \
-no-mouse-qvfb \
-no-opengl \
-no-mmx -no-sse -no-sse2 \
-no-3dnow \
-no-openssl \
-webkit \
-no-qvfb \
-no-phonon \
-no-nis \
-no-opengl \
-no-cups \
-no-glib \
-no-xcursor -no-xfixes -no-xrandr -no-xrender \
-no-separate-debug-info \
-nomake examples -make tools -nomake docs \
-qt-mouse-tslib -DQT_QLOCALE_USES_FCVT \
-I/home/myzr/Qt/tslib-install/include \
-L/home/myzr/Qt/tslib-install/lib \
-importdir /usr/local/Trolltech/QtEmbedded-4.8.5-arm/qml

$ make
$ sudo make install


安装目录为
/usr/local/Trolltech/QtEmbedded-4.8.5-arm 可将这个文件移植到开发板相同的目录
tslib-install  移植到开发板的 /usr/local 目录下

在开发板上执行:

# vi /etc/profile
添加以下内容:

export TSLIB_ROOT=/usr/local/tslib-install
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_FBDEVICE=/dev/fb0
export PATH=/usr/local/tslib_instalPATH
export LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.8.5-arm/lib
export QT_QWS_FONTDIR=/usr/local/Trolltech/QtEmbedded-4.8.5-arm/lib/fonts
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export GST_PLUGIN_PATH=/usr/lib/fsl_mm_linux/lib/gstreamer-0.10
if [-f /etc/printercal ];then
        echo "MXS touchscreen have calibrate!"
else
        /usr/local/tslib-install/bin/ts_calibrate
fi
[attach]620[/attach]







欢迎光临 明远智睿技术论坛 (http://bbs.myzr.com.cn/) Powered by Discuz! X3.2