Just Do It

qt4.7.3-arm移植

下载源码解压

tar jxvf qt-everywhere-opensource-src-4.7.3.tar.gz

tslib地址/home/user/work/nfs/tslib

在mkspec/qws/linux-arm-gnueabi-g++/qmake.conf 文件添加-lts 参数和在
文件末尾添加如下两行:

QMAKE_INCDIR = /home/user/work/nfs/tslib/include
QMAKE_LIBDIR = /home/user/work/nfs/tslib/lib

改完如下

#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
QMAKE_CC                = arm-none-linux-gnueabi-gcc -lts
QMAKE_CXX               = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK              = arm-none-linux-gnueabi-g++ -lts
QMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++ -lts

# modifications to linux.conf
QMAKE_AR                = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY           = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP             = arm-none-linux-gnueabi-strip

load(qt_config)

QMAKE_INCDIR = /home/user/work/nfs/tslib/include
QMAKE_LIBDIR = /home/user/work/nfs/tslib/lib

配置
./configure \
-prefix /home/user/work/nfs/qt-4.7.3-arm \
-opensource -confirm-license -release -embedded arm \
-xplatform qws/linux-arm-gnueabi-g++ -no-qt3support \
-depths 16,18,24,32 -no-qvfb -no-svg -no-cups -no-mmx \
-no-3dnow -no-sse -no-sse2 -no-glib -no-openssl -shared \
-no-largefile -no-accessibility -no-xrender -no-webkit \
-no-gtkstyle -nomake examples -nomake docs -nomake demos\
-plugin-mouse-pc -plugin-mouse-tslib -little-endian \
-plugin-mouse-linuxtp -fast -lrt -qt-mouse-tslib \
-D QT_NO_QWS_CURSOR \
-D QT_QWS_CLIENTBLIT \
-I /home/user/work/nfs/tslib/include \
-L /home/user/work/nfs/tslib/lib

./configure 的选项可以通过./configure -help 查看
-prefix为安装路径

编译安装

make
make install

将安装目录下的 lib 和 plugins 拷贝到开发板(我这里使用/opt/qt/)
开发板/etc/profile下添加

export QTDIR=/opt/qt                
export LD_LIBRARY_PATH=$QTDIR/lib:$QTDIR/plugins/imageformats:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$QTDIR/plugins
export QT_QWS_FONTDIR=$QTDIR/lib/fonts

QT_QWS_FONTDIR为字体路径,需要添加字体直接拷贝进该文件夹

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注