版主
主题
回帖0
积分10609
阅读权限200
注册时间2008-11-22
最后登录1970-1-1
在线时间 小时
|
1 平台说明
5 m& Y3 {# u9 j7 u主机平台: Ubuntu 14.04
7 D7 ?, s6 e( a$ _5 f) j% _
- e$ k9 n+ ~( F d$ |* N8 O交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz' `6 @7 G- z7 @ D. ?4 s" ^) ~* `
目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤): l$ p* y" [: r9 K4 k0 g' T1 {# [
3 {8 Y( [9 E4 A5 N: {; B
Qt版本: Qt-5.3.2 u7 S2 o6 L8 Z' h1 G3 ]2 G4 }1 V: D) b- A- I
3 n# N* f8 w/ ^0 a
2 Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植
e; M9 v; {4 q5 s0 R5 ]* b; v进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。8 A+ W" l8 B( M/ Q3 q! h+ u
$ g4 f8 e5 c$ X5 k$ ./configure --help >help.txt ; vi help.txt# |3 q* D) r: V
% _7 L8 X( R. o- Q1 |8 e2 Z# I/ N
. u# |8 k+ i* P0 J配置时需要注意的几点是:
- Z& W8 z# v" @& h8 C$ d2 J
" O0 }( H6 w+ Q如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;
- U2 n% o8 v- T
. Y I6 p1 }! @5 U/ ?4 I最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;
4 p4 \2 I) R* O8 P' G' E6 s5 k: u1 [1 }+ b0 l" O; ~9 r( L# Q
如果需要openGL,就需要用 -opengl选项指定opengl的api,对于嵌入式平台,一般使用 opengl ES2,配置选项中加入" -opengl es2 " 。不过想使用openGL可能会比较麻烦,因为openGL一般在有硬件图形加速的条件下才能高效运行,而这需要显卡或Soc厂家提供openGL的支持库,但并不是所有Soc都能找到对应的支持库,比如三星就没有提供S5PV210的openGL库,所以我这里编译的Qt也是没有opengl的。(openGL的替代方案:如果没有厂家提供的硬件图形库,可以考虑使用纯软件实现的opengl,这样的软件库有很多是开源的,如mesa3D库等,不过纯软件实现的opengl在效率方面肯定要比带硬件加速的低很多,而且要想在嵌入式平台上使用,必须将opengl的软件库也交叉编译出来,我在交叉编译mesa3D时遇到了些问题,所以目前还没能在开发板上用上openGL);
/ n& ~3 j: M* O( _! A% I4 l
2 Z r: g( o0 W3 f如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;( O& J+ m. U5 X+ a$ j$ n1 s
' ?" X% x' c O0 w2 @7 N* B6 m另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。
3 q; f: l0 p T, j. I8 Y) W# ]6 L0 M! j k. \( Y: i
我的编译过程如下:3 k7 q- @3 ]) z( \. H. s6 z
- {; {( Z6 e# j2 T2 |+ [/ i5 k* c首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:
: C) d% p4 C' q( b" n0 E' V# B$ z0 @6 H2 O
[html] view plain copy
% P+ |/ B. G2 H5 m) w" S1 y" r# 6 m. E" k9 d4 M h, x( I
# qmake configuration for building with arm-linux-gnueabi-g++
; T }) `3 ?: A! n' ^, H# 9 ~/ h7 t1 M7 P7 l
2 }" d3 {4 T+ p# \( F
MAKEFILE_GENERATOR = UNIX ( u( T6 `3 s5 X8 R" o/ W# |
CONFIG += incrementar gdb_dwarf_index 4 q7 K8 a2 N$ B3 F; k& Z3 M! L
QMAKE_INCREMENTAL_STYLE = sublib 2 [* i0 g7 E9 g% D' g
QT_QPA_DEFAULT_PLATFORM = linux #eglfs
, Z6 c2 ~* Y8 ?. Z5 ~# m& cQMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a
3 `: \9 u. ^2 U& w: i2 vQMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a
" r6 _1 b+ W; f/ i Y8 W
5 a3 b4 o8 L8 W. i" [1 {( c% rinclude(../common/linux.conf)
" F& \7 X7 W5 Hinclude(../common/gcc-base-unix.conf)
5 W2 t5 C) d( Winclude(../common/g++-unix.conf)
2 z3 L, G" v/ P9 z. C; f
/ z" L+ z( V0 @, W n% V# V# modifications to g++.conf
7 p5 m4 o: e5 F( G( L- QQMAKE_CC = arm-none-linux-gnueabi-gcc ! n8 x( n0 t: K$ G! _
QMAKE_CXX = arm-none-linux-gnueabi-g++
9 ~! z9 a. ?7 Q- [QMAKE_LINK = arm-none-linux-gnueabi-g++ # ^) _" b( K5 U5 w: K( w
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
$ w$ ] i' _% U, B4 q* U" M. N
. C9 n2 [: A i% _/ ?4 |# modifications to linux.conf
4 }3 C2 ~4 f# \( f0 s5 R8 QQMAKE_AR = arm-none-linux-gnueabi-ar cqs
) |" q0 U7 ]& [3 R! F( RQMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy + L k: n$ a, V
QMAKE_NM = arm-none-linux-gnueabi-nm -P 1 \7 d( \* k8 }) Q
QMAKE_STRIP = arm-none-linux-gnueabi-strip 1 v9 |" e; v# k1 ?
load(qt_config) 9 l# _' y+ [7 _: G& o+ r9 J( L H% [
- `- ]9 D( |0 k; |9 O
% u( u3 ]; ]2 T/ L2 H- K然后执行:
8 X6 a1 l! m# w W$ f& D[html] view plain copy
) a' q$ ~0 _; \+ C5 \8 G$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float 9 J: @9 l( h( k; s. M. k8 d4 J
配置结果为:4 n* r& u6 R3 Y3 b+ Y6 G F
4 ^/ w/ Q) Z6 S7 \6 t[html] view plain copy
. I% H; ~/ {4 w8 D% \0 F* U" z8 { } Configure summary
- F) L: _) A2 Y, }7 p n
7 x% _+ A& q, o5 Z9 @7 p( w1 ?Building on: linux-g++ (i386, CPU features:) 7 r# A5 R, I8 @4 J! y
Building for: linux-arm-gnueabi-g++ (arm, CPU features:)
: C& J4 h1 B' b$ GPlatform notes: * J. p0 O8 f9 A* H6 d4 U% T
: a' O3 k5 a% j0 A' M! ~
- Also available for Linux: linux-kcc linux-icc linux-cxx
4 V0 K- B; p% z8 h# P- Q2 d: [" S& ? " k1 K( ~4 C( }# {) j
Build options:
$ r$ c( L* A* j. R Configuration .......... accessibility alsa audio-backend clock-gettime clock-monotonic compile_examples concurrent cross_compile evdev eventfd freetype full-config getaddrinfo getifaddrs iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-harfbuzz no-pkg-config openssl pcre png posix_fallocate precompile_header qpa qpa reduce_exports release rpath shared small-config system-jpeg system-png system-zlib + X1 `( Q& I, {# K$ i& w
Build parts ............ libs examples 4 I) P9 ?1 w0 K2 R: _$ i
Mode ................... release $ X6 T* V: D' i$ O/ b8 Z5 X4 a
Using C++11 ............ no
) L2 ^* h- M) \* x& Z, m, } Using PCH .............. yes
' U! |4 P/ E3 c. G: ` Target compiler supports:
1 g& u" d) [% S* z- C. i5 a iWMMXt/Neon .......... no/auto
6 p, q6 I* K6 d$ }0 R% Z: h
$ T8 J- ^4 e9 K. L, R8 W% N. IQt modules and options:
* H/ [- U6 O. ^$ r% B Qt D-Bus ............... no
: w( g* ?# O5 a5 }( x. l7 _5 d Qt Concurrent .......... yes 6 T) ]' b5 G: w+ h& D9 I5 A. l
Qt GUI ................. yes
+ V0 Q0 p+ x+ y: D+ U Qt Widgets ............. yes
% k4 e8 T& \ S5 l; d& X4 ~+ k Large File ............. yes ! b0 g3 b+ B2 E( G6 g: M8 G1 {
QML debugging .......... yes . f2 y+ i: h6 p( s/ L; B$ `2 Z- G* C
Use system proxies ..... no
% U2 O8 O e$ \( l6 H 9 b6 R% E- y6 c( f0 T
Support enabLED for:
% ]$ c+ `0 w6 D& Z Accessibility .......... yes
9 ]& _ C& h3 L) t. ?. R- q ALSA ................... yes
* Y0 O5 O$ @3 Y3 f; M- l CUPS ................... no ; v+ `5 ^6 D) n& L" j" [
Evdev .................. yes
$ x/ v, v) ^) E7 i+ ? FontConfig ............. no ; U/ e1 C6 w! A% M
FreeType ............... yes (bundled copy)
& i0 e3 M/ [2 x0 [ Glib ................... no
6 @3 Z* e# b6 B. R GTK theme .............. no # z! J) O4 d* {0 [" B
HarfBuzz ............... no I- U5 N6 Z. U9 y) x. Q
Iconv .................. yes : W1 f9 S2 k8 O; Z) j
ICU .................... no 3 {9 a$ A0 F, s
Image formats:
# R3 L( h& A# ` GIF .................. yes (plugin, using bundled copy)
h5 H$ G7 K$ f0 c JPEG ................. yes (plugin, using system library) 6 P, K3 w7 G: i5 q% C* v$ h& v2 v
PNG .................. yes (in QtGui, using system library) ' @& Z# C7 e' r# {8 x7 f3 S
journald ............... no
6 e& Q9 K; x, l+ b% _4 Q1 R D" h mtdev .................. no 1 _3 {- _2 }& e! F" ?( m; h3 s: x
Networking:
& {; T2 P/ U- R0 v6 \: e) l getaddrinfo .......... yes
4 `) p1 _2 H1 Y" l3 U5 l getifaddrs ........... yes
' W9 |, c4 l4 t8 `: D! d IPv6 ifname .......... yes 4 t) G! E0 ?9 {7 h% N5 }4 L
OpenSSL .............. yes (loading libraries at run-time)
% J7 j; B. U; l' s/ s+ K- A NIS .................... yes
6 \& p' }* C' c& B' g OpenGL / OpenVG: : q8 R) |" c' e6 I1 a$ e0 L4 @1 C
EGL .................. no # B# k" q' e3 L9 [0 W+ O* G& f
OpenGL ............... no 9 u4 X* ?+ X; O& s1 K5 p. f
OpenVG ............... no
: R$ Q! {$ G9 M' H: ` PCRE ................... yes (bundled copy) 8 i5 Y, L0 p# t: p- y& X* K9 K
pkg-config ............. no 2 L) I# W3 g$ [- |! ?* P" `9 R
PulseAudio ............. no
* b) q( x; h4 `( U% X& t QPA backends: 8 r/ T( @; S( s. I9 D) f
DirectFB ............. no ( b+ Y: f1 R' s7 @6 R# Z6 P
EGLFS ................ no
" h4 J" w8 {( e( J( A6 j; M" _( n' L KMS .................. no ( N- x5 @2 r9 s; F" a- m5 k
LinuxFB .............. yes , I2 U6 I* C; Q) r! K
XCB .................. no 4 l( r- ` w" U) p. H9 [0 C
Session management ..... yes
6 w$ `9 E1 X3 q) N$ b SQL drivers:
; m9 o! m. G. c# m9 E DB2 .................. no
& n& `8 c6 B- } InterBase ............ no
}9 o+ n* _# E/ _' E# @+ l MySQL ................ no
* D* E. f+ g% K+ m5 v5 B( T" I OCI .................. no 9 H/ j2 K6 H; S3 R8 m" ~
ODBC ................. no ; y+ K# e" ~5 k) h' ?. b/ \" z8 ^
PostgreSQL ........... no % d" e0 O3 n- A" a1 r
SQLite 2 ............. no
8 T+ {% P O, s( x" U' }# R* {8 I. M SQLite ............... yes (plugin, using bundled copy) 5 R- H, V. o; |) e4 h$ ~/ n
TDS .................. no
+ N2 b7 r* \) X udev ................... no
0 I' ?% e+ D9 n1 A( q* A& B0 @, d* } xkbcommon .............. no 9 V, d! A: `2 d; e
zlib ................... yes (system library)
2 w; E+ I/ j8 j c/ O
. n9 k" ]' j V" A- |. d. k6 \
8 V( H+ t: P6 |" _) X9 \$ }配置完成后执行:
, k( U" a8 ~( L% M8 k2 g( w1 k[html] view plain copy
" c! Z v2 H& `0 Q$ make -j4 ! p+ {2 O( ?2 H8 F# a I
$ sudo make install -j4 ! C0 ? N4 n. ? x$ [: r3 e
6 m4 N. q0 I" q
3 添加 tslib 支持2 N3 Y2 Y, t. P. e. R
为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:/ C+ F1 ?5 w6 o7 T/ c r3 _
6 ^' s! i( v* [$ v# ?
http://blog.csdn.net/newthinker_wei/article/details/8639276
+ g" h1 K" I8 F2 R友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。- ?* X, ]% @ `' t( J7 t& F/ I
: D) B$ w) H5 h8 k7 D
另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:
$ S- o# ?1 n5 U4 q& p7 e/ B
: J x" x p5 P9 | {1 }http://www.arm9home.net/read.php?tid-16105.html, Y( }7 B, X d) B) W( ^/ b
: E6 Z- B, ?6 O) G注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植tslib就可以了。但是对于多点的电容触摸屏,上面的两个网址给出的源码都不适用了,友善的多点触摸屏使用的是goodix公司出的触摸屏,goodix驱动的接口跟友善之前用的触摸屏不一样。因此如果想使用tslib,需要再单独为goodix写个TSLIB插件。tslib源码的plugins目录中就是各个插件的代码,可以参考一下他们,都很简单(主要是实现一个read函数)。但要自己写电容屏的插件貌似比较困难,因为要对驱动程序中多点触摸的数据协议有所了解,这样才能从电容屏的数据中提取出单点数据。友善提供了friendlyarm-ts-mtinput.so 文件(但并没有源码),该文件就在友善自带的tslib中,默认目录为/usr/lib/ts/friendlyarm-ts-mtinput.so。把这个库拷贝到自己编译的tslib插件目录中,再修改配置文件ts.conf,即可使tslib工作。! H3 z3 u9 }. T% K
将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:
+ r5 h! V" {5 G$ A ?& m5 T/ p5 u* w6 f! @- F& {
[html] view plain copy
9 P6 c4 {/ H6 r; _#! /bin/sh + @ T! m$ j/ i
# "source" this file when wanna run a Qt application on the ARM Board.
1 v5 o2 Q4 {+ z% [ & c4 L; D3 ~" _& g: N# ^) X/ U
############### the below lines are for stardard TSLIB ##################
* S9 t/ K1 O' ]5 o' Bexport TSLIB_ROOT=/opt/tslib : Y( H% }, F5 o( d- [
export TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal
' f, t" h0 M" b; u- ^( Eexport TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf 2 V6 |3 o: x& I0 V# k% B
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
+ S! A a8 i1 o' iexport TSLIB_TSDEVICE=/dev/touchscreen-1wire 5 M- _( I( h9 f0 J/ ~
#export TSLIB_TSDEVICE=/dev/input/event2
! [! m& N5 L6 V/ X
) C/ f- v6 z7 `# ?################ the below lines are optional ############## % {9 ~4 p z* U: \3 y' ?% Y' E
#export TSLIB_FBDEVICE=/dev/fb0 ! i6 s- T+ ~2 X: U( w
#export TSLIB_CONSOLEDEVICE=none
6 s' W: ~- V; Q; D s) o9 |* Z0 Z6 n+ p8 Z3 i2 W
此外还要修改 ts.conf文件:
% {' y$ r! U) I[html] view plain copy; e1 j" Y: m$ `" `% }7 ~8 K
#module_raw one_wire_ts_input
) ]# {, Q3 U2 Kmodule_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中 8 @# ~9 z) n0 e( t* W8 ~3 n8 l
2 J* i: o* e2 R4 |: i' v! n9 Emodule pthres pmin=1
7 ]# G; o0 P; w, h8 l+ b2 umodule variance delta=30 ( j l$ W, w, j8 |
module dejitter delta=100 ~& A; N+ R$ V' r
module linear
- c. Z1 n% I; S& I" K到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。
/ J; L; X+ B/ s+ Z9 d+ C1 e有了tslib后,进入Qt源码目录中的 "qtbase/src/plugins/generic/tslib/",运行 qmake 生成 Makefile,并在Makefile中将tslib的头文件和库文件路径添加到编译链接选项中(-I /...tslib/include -L/.../tslib/lib);然后运行 make 和 make install即可。这时,Qt5安装目录的 "plugins/generic/"目录下就出现"libqtslibplugin.so"这个库文件了。( ^1 Z! V! T8 c& r% c; y i8 J
5 j5 ?- x6 r' B0 w0 p% r7 m4 ], B
4 运行Qt程序& r# d1 K9 K% O& ?8 r
需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。: r$ v$ P( P, t
+ I* J1 z( \" h% `' b
With the release of Qt 5.0, Qt no longer contains its own window system implementation: QWS is no longer a supported platform. For single-process use cases, theQt Platform Abstraction is a superior solution......参考 http://qt-project.org/doc/qt-5/embedded-linux.html
, a2 a" ` K4 A p
) c5 K$ r$ R7 ^, K- |编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:3 a4 T1 |* q( j+ q! k# v# {
( S$ n6 V3 L6 t* j" o3 c0 }5 Q% t: L. f[html] view plain copy0 I2 e' Z% d/ H, w
export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms
* k- }% E' r8 U/ e8 R3 q' u: }! Zexport QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0 / p g9 U) C6 D: x D
export QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts
( ]% C& `+ s k5 _4 O+ Rexport QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire #使用tslib插件 # S# E- z7 u ]
' }6 D3 J) V& g) l然后就可以运行Qt程序了
6 f" B6 U6 h6 e* J& @; P8 e: S& Z- |" P4 o7 H
以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。5 p+ Z! P' T7 p3 G
( @: R9 |1 \0 a* L/ a* _) [
附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节)0 }& j6 c2 [9 o4 e
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。. H, N n8 ]: A0 I" y
1 P- n* _2 J3 W' r+ Q首先安装opengl支持(mesa3d),
3 m8 X! G. C) p, _ B+ U. h
& ~' P7 k" r8 p6 k$ i[html] view plain copy3 l* c6 @$ |1 Q
sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
* `9 Y8 U/ Y4 Y' F& V- y, a如果需要,再安装Qt D-Bus的支持。
$ V/ F1 K6 G& Q. g: x) l, @' @- n# b U5 F4 l! K, `. J
然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。9 a/ `' c- _$ l" e2 L" ^' | ~3 p7 b
5 R ~: N1 e5 v% E+ d
[html] view plain copy
8 K& V3 }; j$ |! J9 o./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl
3 U/ L. \- }5 @$ |, \配置结果为:
9 ^5 y i3 m( I( b0 z" _1 }5 P6 S$ P) H' n: Y. P
[html] view plain copy& j6 H0 G- V, x g- G. }( r8 p
Configure summary - g: |! l. i% N! n* X- X Q
! Z3 Y5 C, J/ V( L4 ~& KBuild type: linux-g++ (i386, CPU features:)
6 q( {# e* n1 w& F3 f# zPlatform notes:
5 P \+ n5 g/ e; P' y ' }1 E+ B9 i; S6 M
- Also available for Linux: linux-kcc linux-icc linux-cxx
" v: a; Z! M$ Y) q ; u( K" l$ U& i& c# s' _3 I$ w0 i
Build options:
! a" N2 c }0 h( Q Configuration .......... accessibility accessibility-atspi-bridge audio-backend avx avx2 clock-gettime clock-monotonic compile_examples concurrent dbus evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib iconv inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap nis no-harfbuzz opengl pcre png posix_fallocate precompile_header qpa qpa reduce_exports reduce_relocations release rpath shared small-config sse2 sse3 sse4_1 sse4_2 ssse3 system-freetype system-jpeg system-png system-zlib xcb xcb-glx xcb-plugin xcb-render xcb-sm xcb-xlib xinput2 xkbcommon-qt xlib xrender $ x9 y6 j t* Y5 C3 ?1 x2 l
Build parts ............ libs tools examples
! g* G/ \ I) ?3 g6 i Mode ................... release 1 _* l/ j$ G1 `. R7 L
Using C++11 ............ no ' a' b& O) ~& U" G9 a# |/ ]' E
Using PCH .............. yes
% n. c2 C! \2 ^& p. g; O3 W Target compiler supports:
! B9 v. F. D" x5 |: e SSE2/SSE3/SSSE3 ...... yes/yes/yes ' Q8 K! |2 L% G
SSE4.1/SSE4.2 ........ yes/yes
, K8 t& ^. F9 g& |3 b) m8 c AVX/AVX2 ............. yes/yes / B7 K o. ?1 e; l3 ]9 d
2 T% H7 P3 R% F0 l: @
Qt modules and options:
; Y/ N5 O! V! I, ]) \- u! \1 i Qt D-Bus ............... yes (loading dbus-1 at runtime) / P- V C" w7 D3 n# d
Qt Concurrent .......... yes
+ M# z" J' r- N) c. }' R Qt GUI ................. yes ) k+ u" d6 ~/ Y; P
Qt Widgets ............. yes
" T5 `3 q( m$ A1 a' n- L$ [( ` Large File ............. yes
3 _- Q X+ V- n" o1 M& k. V! ] QML debugging .......... yes
4 y0 K$ m8 W4 @4 {+ M2 T Use system proxies ..... no 7 u9 \6 A" F' K9 U2 s
3 i1 H0 M( R+ [ WSupport enabled for: 6 S, \# Z7 T+ e( w
Accessibility .......... yes
3 E1 f) ]* p) S ALSA ................... no
( M! d! \$ ]* A/ G8 n CUPS ................... no 2 X4 i) q1 x. I6 s% q1 \ C$ f
Evdev .................. yes
% G% g1 X: U" p5 ] FontConfig ............. yes
G8 M2 z0 E: s3 P& |, ~! H9 N- i FreeType ............... yes (system library)
7 G! @2 M: f% I7 B A- N/ V Glib ................... yes
/ c. v, f" a" i3 [$ a, t; f GTK theme .............. no 1 O4 n6 W( t; `' v8 N
HarfBuzz ............... no
7 F; @; @3 \1 B& Y& C% I Iconv .................. yes . _$ n) ?6 P4 n! H D7 O0 G9 P
ICU .................... no , f, v1 T% L1 F0 q$ _
Image formats:
# g% A. e. l6 X$ n! v$ i GIF .................. yes (plugin, using bundled copy)
2 f- i) r o6 d; f JPEG ................. yes (plugin, using system library) 3 {# L; ^1 B/ Z. S# @" {. E
PNG .................. yes (in QtGui, using system library)
" M6 N- c' T8 l/ L journald ............... no ' p3 i& V, X2 ^8 L% @ p* z& N
mtdev .................. no ! L) D; ^+ _2 t& E% r8 K; J! ^
Networking:
) h2 W: V; k! h! o- l7 p getaddrinfo .......... yes
) e v9 D" y$ J, ?8 W2 k5 v3 d: z getifaddrs ........... yes
' H7 V$ f3 T; t8 P/ w IPv6 ifname .......... yes , {) s$ ?0 b, [7 U1 n8 [5 _
OpenSSL .............. no
2 Z( y; G( @0 w* | s" V NIS .................... yes # }/ d2 `# G. e
OpenGL / OpenVG: - ^3 _2 [3 v! z& f
EGL .................. no
4 l7 X' s. Y4 ?! g1 n" ~, ? OpenGL ............... desktop % }7 Z: O. F* H, R$ o: M1 @
OpenVG ............... no 8 n* r9 V( u+ I/ l
PCRE ................... yes (bundled copy) 2 i& S1 ^, _4 l
pkg-config ............. yes
7 u# g3 U# p W0 h% K) L PulseAudio ............. no 9 c* @5 g. ]5 o' p! j
QPA backends: # X+ O/ ~( F( b) o% O4 Z" p, G% N
DirectFB ............. no ! \) T' I- T1 j7 U
EGLFS ................ no 3 T. v* T$ ]& l+ S% s, b+ ^
KMS .................. no
& X6 y, O6 y) X6 ?. i" u9 `. [ LinuxFB .............. yes
+ U8 W. l; B. v1 a. T; H: k( g XCB .................. yes (system library)
. _, E6 V( n, [- {4 \) U3 \/ q# o8 @; ] EGL on X ........... no , f7 f3 F! j, f+ m, \1 Z0 i- C4 O
GLX ................ yes ) k5 {) I* D4 o$ V6 p
MIT-SHM ............ yes " l" {+ K2 {4 r0 k7 S( j5 J8 w
Xcb-Xlib ........... yes
3 F4 c+ X$ c7 j2 o2 X. n Xcursor ............ yes (loaded at runtime)
! U' Q; ~% b9 s3 d, E$ ?- { Xfixes ............. yes (loaded at runtime) ' R% `% x! S! W% y2 P
Xi ................. no 8 w L! s8 y: m0 z
Xi2 ................ yes ( r7 W9 }# j! Z P1 S
Xinerama ........... yes (loaded at runtime) 5 _3 ~8 D% c6 K4 A4 r
Xrandr ............. yes (loaded at runtime)
; k6 S7 E! y( I* o# k0 N Xrender ............ yes - x, X! v: Y' `
XKB ................ no
0 {1 P1 B. F9 L) T: } k# u XShape ............. yes
Q! ]4 i( N, M5 }' U; U" @ XSync .............. yes / {4 U3 m- ~0 d: g
XVideo ............. yes 8 r4 C, d$ y- O$ K
Session management ..... yes 0 w$ o L, [/ R/ W) \
SQL drivers: ; z8 s e5 {4 F& A
DB2 .................. no 0 w: ^) j2 s; I8 `& p8 O
InterBase ............ no , N3 L6 G# f( U& T6 m4 \
MySQL ................ no 3 i2 T: K# }% ~2 U. Y
OCI .................. no + S- h, c: S" I" R6 z
ODBC ................. no
) g8 M2 M+ z5 k- b" L7 V PostgreSQL ........... no
% ]1 l, a1 Z, s! k+ I! N0 ?6 J7 k SQLite 2 ............. no
. n5 o5 A% E7 k" M; D SQLite ............... yes (plugin, using bundled copy) 3 t O) o- e# W. y) H
TDS .................. no
8 F8 F: v- i- f# o udev ................... yes , Z% f6 k( `9 b$ J, A/ _1 l4 @+ J6 u
xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb) ' J, W# e( B' R# Q8 F" J
zlib ................... yes (system library) % A7 C7 F/ h4 u1 ^( _3 W5 N
/ k# W# z( q4 @$ D0 D1 y3 C' INOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use , y6 i: x0 R" c/ s" V. f
the bundled version from 3rd party directory. 5 h; x" T* A1 d2 N. s5 T$ O
: ]3 ?8 D$ f7 C' G, j最后make和make install即可。% N& s4 c, Y+ Y2 R( i
% x0 k6 f& z1 G9 Z+ N9 v6 D
, w# O2 r0 F5 E' l( @1 h# p另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:" c+ W% G' ?" `! @+ |3 _/ K8 y$ q
; d& j/ i' e4 H8 _ o: \9 [2 U进入已经编译过的Qt源码顶层目录,输入
, X& \( R u) V[html] view plain copy
9 U' C" t. r! t7 L" _$ make docs
3 D# _7 y; C5 c3 k这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录)0 G# |9 v$ n! ]) @. k/ M
[html] view plain copy7 e2 s" N) G. |- p' |- z
$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant + H: k; }# e/ S' ]3 Y3 `
$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant
6 ~0 x) A+ |& Z) U- m L6 r然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。 |
|