版主
主题
帖子
积分10609
阅读权限200
注册时间2008-11-22
最后登录1970-1-1
在线时间 小时
|
1 平台说明6 h6 d4 a$ t1 m3 C2 t- b! D
主机平台: Ubuntu 14.04
6 O) V' i1 \0 p5 K; y9 W |" m" L
" ^6 I. h) e3 \& r V交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz
% R) e% y7 a. T4 D+ Y% a+ i; ~& g目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤)
: _% d+ u' P# n9 L: S/ O
9 O, Z5 t5 r8 R# @* [# AQt版本: Qt-5.3.29 s4 U# U7 ^9 k* u' E
' Y7 u6 _- o" @+ u$ \* I7 }
2 Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植
* V& E7 i! N' f! r' V9 J$ m$ s' L: p进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。
- o" z; O8 C) n$ _/ l
3 A6 u: P/ m/ n4 a* s% e4 @$ ./configure --help >help.txt ; vi help.txt
& x$ [, k9 G+ Q$ e, D/ s! d9 P. t7 A
& S* f7 H9 P0 [3 s4 X1 E. T
配置时需要注意的几点是:* m2 l6 ~1 q# c2 s* c( ?( D, E
6 f& D$ g: ?7 j* [8 A如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;" G* ? M; e( {" |; _
' p( M* z7 Q2 [3 m9 i
最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;; g. `: U9 v% ?( e: D4 @ ]
5 L& X/ C2 A/ Z D' [$ ^9 ?如果需要openGL,就需要用 -opengl选项指定opengl的api,对于嵌入式平台,一般使用 opengl ES2,配置选项中加入" -opengl es2 " 。不过想使用openGL可能会比较麻烦,因为openGL一般在有硬件图形加速的条件下才能高效运行,而这需要显卡或Soc厂家提供openGL的支持库,但并不是所有Soc都能找到对应的支持库,比如三星就没有提供S5PV210的openGL库,所以我这里编译的Qt也是没有opengl的。(openGL的替代方案:如果没有厂家提供的硬件图形库,可以考虑使用纯软件实现的opengl,这样的软件库有很多是开源的,如mesa3D库等,不过纯软件实现的opengl在效率方面肯定要比带硬件加速的低很多,而且要想在嵌入式平台上使用,必须将opengl的软件库也交叉编译出来,我在交叉编译mesa3D时遇到了些问题,所以目前还没能在开发板上用上openGL);1 C, v+ g) f% R% `% ~! f3 a. o
' m; X" @8 J5 a7 t, r* A6 G
如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;( N, [8 c3 O: X6 _ K; j7 i% Q
6 S: @! x' H- s0 o
另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。
( J$ b* r4 r# D! _8 T' C, P5 F3 _8 j# F7 v- F# r
我的编译过程如下:
& N/ S# U- C: m! E0 t7 L
4 G0 l% @" G) X首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:( C: T, M: r, }' m
- _' |$ t, U e1 K
[html] view plain copy/ h6 i2 k1 Y0 p, ]
# ' `" x' r4 p- |: ^
# qmake configuration for building with arm-linux-gnueabi-g++
: a- _# W k' M% _# , p' e' f2 D- F. T9 n$ B
7 j5 g" t% j- Q# G S1 g% QMAKEFILE_GENERATOR = UNIX
, |- o1 J0 ]# NCONFIG += incrementar gdb_dwarf_index
/ h1 ]% i3 w1 \: Y! FQMAKE_INCREMENTAL_STYLE = sublib " _: X# B% ~; b
QT_QPA_DEFAULT_PLATFORM = linux #eglfs
$ a8 {! L3 r" m5 k+ h* JQMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a
! [6 a8 {% K) R, C, T+ s, @+ {5 k9 T) MQMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a . _; A; G* o4 E( R6 L
/ a: \ m* u8 W$ [; Z; _
include(../common/linux.conf) 0 c. K# X7 N: }, D1 u
include(../common/gcc-base-unix.conf) / p' R6 H) X+ Q& w5 x( k% \! U. v9 [
include(../common/g++-unix.conf)
+ F& x1 N# Z* ^
2 U+ g. K7 w0 l4 a$ Z* l# modifications to g++.conf 0 ^7 |' ?$ o4 _3 V/ O/ I \" B% K4 i$ K: R
QMAKE_CC = arm-none-linux-gnueabi-gcc
+ e& j3 | q( j8 k# m( aQMAKE_CXX = arm-none-linux-gnueabi-g++ - F/ P1 o( T: w( J/ W
QMAKE_LINK = arm-none-linux-gnueabi-g++ ; c6 f3 V! B+ y, p) J1 G( Q
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
, b* R1 w( r# z! H
7 l4 `) z+ I/ C# modifications to linux.conf . R+ ~3 V8 E& W
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
5 U, @% ?# I7 `, f' o) D+ X. wQMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
' K3 W& _6 x" K5 G" kQMAKE_NM = arm-none-linux-gnueabi-nm -P - F F/ F/ P# p$ j7 M4 v
QMAKE_STRIP = arm-none-linux-gnueabi-strip : S3 a, i* ^ `8 i2 t
load(qt_config) ( S$ G3 f! l0 _$ v/ j3 U( u; Q3 E
8 c; |/ _& M; _! L
7 C8 h5 H o. z8 Q& Y8 w% N7 [
然后执行:
, h+ P6 W& Y' v z- H[html] view plain copy0 A K$ I5 Q7 F( C% _: {, g! E* w
$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float
" Y& z" i+ B' P3 T8 I1 c" l( Z; g配置结果为:
) I! n9 G( G J0 J7 |1 s) O# @
; L% ]: F2 A' J5 f0 D[html] view plain copy
D' }' d- w/ _, h Configure summary ! u( e1 v: E4 _2 O5 X. u
$ j& v A- @. ?+ J. S, `8 DBuilding on: linux-g++ (i386, CPU features:)
2 i& [2 ~- J7 `8 B, }, _# m2 F! jBuilding for: linux-arm-gnueabi-g++ (arm, CPU features:)
( g( F6 b' _) v6 F& KPlatform notes: - S* L* k7 g8 J3 Y3 U# i1 L9 J) ~
9 k0 n' Y3 I5 z: L5 }
- Also available for Linux: linux-kcc linux-icc linux-cxx
& {; l4 z* G5 }& M
0 A2 q$ E' p8 \Build options:
0 K) f. p3 z! O/ a 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
v/ W5 {3 p. g5 G9 i/ j- E9 S Build parts ............ libs examples
7 |" P0 E$ `0 j' K6 Q" ` Mode ................... release
8 [, ?6 N: L! F7 M Using C++11 ............ no
& _% s% ?) q) n; | Using PCH .............. yes
6 H, i1 S# D9 N1 J. T Target compiler supports: + I7 k z* q1 {- A: v
iWMMXt/Neon .......... no/auto
+ ^- [5 {& W j& `5 N/ K l% [% N
) c: a) K' b* w( I& b8 AQt modules and options:
6 a% Q/ s, z! b Qt D-Bus ............... no
7 l1 f! [# Q, D Qt Concurrent .......... yes 0 _- n k" E Y7 U
Qt GUI ................. yes B8 [6 [; r- C0 F
Qt Widgets ............. yes
( M, r( P$ j# |/ X( S# s* M G Large File ............. yes * z# _& I- }5 ` ^% f: Q
QML debugging .......... yes
- I- p1 n4 e$ j2 n Use system proxies ..... no " u( j& q1 w& g3 V
# z: U8 y/ Z) _- x0 t
Support enabLED for:
. ^& O) e9 G* X9 d/ b Accessibility .......... yes 5 L; j- ~: L9 h) @, m& ~& o# r
ALSA ................... yes 7 B% L4 P7 p+ q3 j
CUPS ................... no
: F4 R( U% v, @ Evdev .................. yes
2 V! u$ n6 S B% g/ x9 W FontConfig ............. no
$ y8 [( `( ~. N4 H& x$ S+ Z; l+ g FreeType ............... yes (bundled copy)
$ H& D. m: l# | Glib ................... no
5 s A, N p' `! K. ]/ K GTK theme .............. no
$ W. g* }; C% b" g5 O% \7 t+ Y* t/ c HarfBuzz ............... no $ v$ E' m- f6 n! L5 v9 i2 f) _
Iconv .................. yes * y+ c+ b6 m9 U3 D' `5 _7 K
ICU .................... no
$ v2 S' ~: {2 s Image formats:
$ u& l. D x1 R4 |7 B6 s/ H GIF .................. yes (plugin, using bundled copy) # N0 p( J# g o$ e# W! ]
JPEG ................. yes (plugin, using system library) * H* i# _* K* w6 t
PNG .................. yes (in QtGui, using system library) 4 `3 ]& t- H2 }& H8 x5 @" ?- L: T
journald ............... no ) T2 }8 x* {2 G6 O: W% C3 V( n
mtdev .................. no
E7 n8 \3 z/ U6 o2 E Networking:
% r0 Q' B& {8 g3 {' O getaddrinfo .......... yes
, T: o& f: ? q4 V! e getifaddrs ........... yes ) X2 s6 ?" J& W8 r
IPv6 ifname .......... yes * m4 O7 x% g" k- R% M$ v
OpenSSL .............. yes (loading libraries at run-time)
8 }, Y% H" s% ~; F NIS .................... yes - D- S0 w; A1 k6 [% D
OpenGL / OpenVG:
% u6 @' K8 T |2 a9 S. _0 r EGL .................. no & M2 Y! P8 H4 p6 a& T
OpenGL ............... no
e; M; O1 `# A4 ^9 J+ A OpenVG ............... no . U% p6 w- [9 |. U7 u
PCRE ................... yes (bundled copy)
/ i+ {* D* ?* U \' @ pkg-config ............. no $ ?( z5 O- R9 j* X0 [) i' ?
PulseAudio ............. no $ b- z. X# s( U- S
QPA backends:
9 t; ~" k" q7 A DirectFB ............. no
9 v9 M! `! D3 |% i! b) A EGLFS ................ no : k/ A) k& Q# Q
KMS .................. no 3 K8 U l( n$ |+ k. d; \
LinuxFB .............. yes
/ n/ q$ D; h! j. U XCB .................. no
0 B( I3 k* B/ }/ N Session management ..... yes 0 R8 \0 }/ T, i3 ?+ Q
SQL drivers: / t6 J: m, ^/ a/ m9 d; ]/ p$ ?
DB2 .................. no
" r/ k4 x8 T% v- p- F/ O* d InterBase ............ no
7 `3 e5 m, I3 U MySQL ................ no 2 v5 T- e' u9 p5 u, j# ~3 A3 ~4 d
OCI .................. no . ]! {# l6 ]$ Q: K
ODBC ................. no
. b/ r! O/ U( w9 S* Y PostgreSQL ........... no 4 y3 R# D U2 ^. G# D, H( {/ Q
SQLite 2 ............. no
0 x& w" m& w/ Q. Q! e& F SQLite ............... yes (plugin, using bundled copy) ]/ `4 m: f' [* m+ [8 N7 j/ e. h |
TDS .................. no 2 d# d8 _* j" b3 l1 Z
udev ................... no
# G* e; |) c0 t1 b @% }# ` xkbcommon .............. no 4 ~8 _7 @/ q# }) f6 O: E
zlib ................... yes (system library) " d+ p6 [' C& c' @0 u
7 H1 {, [1 A8 v- p0 z! f- H
8 j/ D! D t7 z) l; u2 t配置完成后执行:* g" L0 F0 b) H; f2 ~3 o
[html] view plain copy
- d, a w: B* I" ?$ g; F9 L$ make -j4 - p0 D0 A4 I9 z0 L2 }- D \
$ sudo make install -j4
2 V3 ~! c; y0 e* ^& x" B, v
0 w' }# }) m% [7 l1 g' Z* p$ ^4 u3 添加 tslib 支持
3 h1 e+ u% f2 Q! A3 o为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:
' Q( H7 v- l# ]
, s4 F$ l* n0 Y9 Chttp://blog.csdn.net/newthinker_wei/article/details/8639276
% j0 B) u2 Z! b2 b* V友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。$ V9 J0 }( j4 x9 [) C9 G
) B* Q3 \& l: }6 B
另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:
4 V0 e" y; [' E# h: Q5 P: Z' `4 z
http://www.arm9home.net/read.php?tid-16105.html
4 F0 {: [ U* b" f/ y" f0 [5 p5 x/ L6 H( [( \
注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植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工作。
" ]' ]5 W: u1 K! k将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:
: M1 |# `2 P! _* v9 }) I0 E0 K: ?7 y7 R4 D' D/ Z
[html] view plain copy; U# I2 {) M5 H3 ^
#! /bin/sh ' u: [$ _9 B3 \% n9 c/ y1 K m! F
# "source" this file when wanna run a Qt application on the ARM Board. / v# Y+ e' H5 @1 i/ K4 z
~- d" P, `( U9 k5 c
############### the below lines are for stardard TSLIB ##################
: W; ?" y' W7 A1 oexport TSLIB_ROOT=/opt/tslib
& }0 H- N- p2 z) R6 j, O/ Q! Gexport TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal
2 w0 W% Q) ~- L/ f' N9 b0 E$ t5 \export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
9 {; Z# b( m* h. w' i( F& bexport TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts & x2 c+ y# H7 F, Y" M Z. k
export TSLIB_TSDEVICE=/dev/touchscreen-1wire * g0 V; ^8 E& e/ s
#export TSLIB_TSDEVICE=/dev/input/event2
! O' `/ E4 y& A/ W1 I/ _
" K6 P `1 [0 d################ the below lines are optional ##############
/ V1 l4 {+ ?* \2 G9 g#export TSLIB_FBDEVICE=/dev/fb0
. f" M4 t9 a, @* E#export TSLIB_CONSOLEDEVICE=none . w+ T$ U/ r' W8 u8 k& N
' A7 K* C3 ]7 [: J( ^
此外还要修改 ts.conf文件:
/ G" c7 y( ^7 X( g. @3 \[html] view plain copy1 }0 I- \1 ?& c ]
#module_raw one_wire_ts_input - s) Y+ `; N7 w2 T: J, S( y
module_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中 ! S/ h. X! A1 a, ]6 }
+ S( O7 [" P D9 zmodule pthres pmin=1
3 K6 q1 J3 J. T) U% {3 ymodule variance delta=30 $ ]: {* t- n" P) u# R& q
module dejitter delta=100
' G9 l3 v6 y9 |: gmodule linear 4 {" [: H& m& W5 s5 s( V: U
到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。$ ~4 Y& @2 x' F
有了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"这个库文件了。
' R' b( I2 l# _! t M+ U/ ]+ G/ b$ O9 l# z n+ j! R' d6 C, p
4 运行Qt程序
: f# ~- @# ]2 C1 [需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。) }, w' r. f s) R. Q
( W' }8 ? X6 j( \4 r
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
+ B4 d; t+ U5 f7 p1 K( `7 t u: K4 Z' B$ u8 N0 C7 E/ y) X; S
编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:
8 |+ h+ L1 p3 R3 ^: V; X/ p; C" n- A' M( a8 f2 m! {
[html] view plain copy e; M% A) w2 g% B/ f6 q3 M- U
export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms 3 ^! c: G( j7 n1 I
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0 9 Q& ?) g3 P0 a$ G+ S* L$ f: s
export QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts " q( ~: V3 f; v* g( t6 v
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire #使用tslib插件 . f2 [" Z4 l) w4 ]+ \+ |6 I
! f7 a) `0 q( s$ ?9 t/ h然后就可以运行Qt程序了
9 F+ s) \/ k! S% \
* L8 T, o8 _: P$ S* }以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。
4 ]4 p" D* U# ?- Z7 d, P3 {1 |; [8 H6 g5 l
附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节)0 ~8 k6 M# z# U
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。
+ U( b' @3 n$ H I3 b: S+ l( i
, S2 m2 c- m; n首先安装opengl支持(mesa3d),5 X" J$ m- s1 Y' s( F9 e
: p& _. B# R" R% n; i: s$ z& d" k[html] view plain copy- k9 I5 A& {! x2 \$ o* `& ^
sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev 4 u+ m- i8 l1 W m
如果需要,再安装Qt D-Bus的支持。' D+ ]1 V8 x' d! `$ v. K; P
4 o' M S9 t, S' W
然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。" j: Y" a% Q/ ^1 v
~; ^4 }0 o H g$ u[html] view plain copy5 K9 o' [, [ o0 F3 n) D, [
./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl
2 R7 `/ H3 o9 {. ~: ]; V配置结果为:
6 _- r" ?6 }! _5 H& c9 f' F# v0 n, y4 A9 z. }+ {( `
[html] view plain copy' q7 o7 ?8 ` f
Configure summary
8 B# b# y# O- a5 `8 R2 \ z8 }4 i 8 N4 U4 G$ m) O
Build type: linux-g++ (i386, CPU features:) - u/ w% P8 `4 r6 U/ v7 q3 ]7 h& i
Platform notes:
! h$ O% Y, l5 N* [
# Q7 j/ m8 j3 i" x( J$ ^, ?$ [ - Also available for Linux: linux-kcc linux-icc linux-cxx
$ H/ Z- S' ^3 }* K! z
?7 ]! O0 E7 C' CBuild options:
; ~; t9 Z+ W# q8 J, H9 L0 j0 } 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 9 F& p+ N3 Y ~# a, X- J: |
Build parts ............ libs tools examples
. N# ^/ I9 B6 d Mode ................... release
' Q" u2 u X7 e" u6 L: w" L1 w3 P& F Using C++11 ............ no
9 N8 W% l( c. l2 k/ ^ Using PCH .............. yes % u2 Z! q0 E" P7 `7 n- }0 h, e/ O
Target compiler supports:
1 n. c# S, Q# ^7 @' Y; j* k SSE2/SSE3/SSSE3 ...... yes/yes/yes
. ]2 m+ Y1 [9 f SSE4.1/SSE4.2 ........ yes/yes
0 z1 q- \" n& C' [3 G) V4 [ AVX/AVX2 ............. yes/yes
7 B) ~/ i5 F. N+ z' _! S$ Z 5 S6 _+ S7 K) ^5 d W, N n
Qt modules and options: 7 e$ C2 L U$ L3 P! \% t
Qt D-Bus ............... yes (loading dbus-1 at runtime) 2 E) s2 K- y4 n% d6 x X0 u
Qt Concurrent .......... yes / B2 @* r3 T2 F* B* w3 H9 P, ?+ M
Qt GUI ................. yes : t8 g2 x5 t+ W1 X4 [$ y
Qt Widgets ............. yes
% Q/ k1 S2 @, A& N& Q Large File ............. yes " {2 [- u5 q( a& D- R
QML debugging .......... yes
2 j0 y9 _2 H' Y2 C" j! F. k Use system proxies ..... no
* t( V- ^# a) l7 @ 9 s1 U2 p0 T/ H' t8 I
Support enabled for:
5 n7 E f6 k2 m2 n5 t8 W& | Accessibility .......... yes 1 C: Q5 \7 g1 |& Z4 x0 T) J E$ D, x
ALSA ................... no
, [. K3 E/ w2 K+ @5 y. x+ S CUPS ................... no
1 ]1 q# D6 g2 S6 l5 B Evdev .................. yes 4 q6 {4 `* D8 M
FontConfig ............. yes
5 K& K& H+ M' J. m$ \, X FreeType ............... yes (system library) , f7 ]3 s4 Q0 y
Glib ................... yes
: i) ]* B4 [7 Z, A# W5 T% Z5 y GTK theme .............. no
( Y1 s& G. l% V+ p# b HarfBuzz ............... no ' \ s% K8 w4 F5 O
Iconv .................. yes
3 \* B, D2 K6 v4 w ICU .................... no
& w5 \7 c/ `3 n7 N' w Image formats: ! K- Q' f1 e! }1 @/ K6 Z! d3 N1 }
GIF .................. yes (plugin, using bundled copy)
4 ^4 l$ l. l. a% f* o) t6 y" h JPEG ................. yes (plugin, using system library)
) r% j# y: W* E: l2 D. u$ J PNG .................. yes (in QtGui, using system library)
& z8 g) r1 K( G journald ............... no ! `4 b: o. b0 ]; t% v0 n9 A& B
mtdev .................. no
I" ~( b( m* @) h( B" ^9 ] Networking:
' y) ~1 C- t9 I getaddrinfo .......... yes
# x, b( T H9 m) s# o getifaddrs ........... yes 6 I- a4 d1 a7 j1 d+ j- @* P
IPv6 ifname .......... yes
2 P+ M `8 j# D" a, r% D. Y OpenSSL .............. no w& F1 B" C% w2 C
NIS .................... yes 9 \0 ]8 a0 z& [6 O0 D+ j
OpenGL / OpenVG:
7 |/ ~% ^, |' a! t: A" }* ]0 W EGL .................. no
* V' @" }" `9 }, [9 H8 q4 D( Z OpenGL ............... desktop
. O; {: j& U2 q: d OpenVG ............... no
/ [& ?# w- w; Q PCRE ................... yes (bundled copy)
: `+ [: k" F6 k4 L+ a$ Q$ n& p" V pkg-config ............. yes
' e. N6 u1 y2 Y# K8 p) G3 d PulseAudio ............. no 7 k- V7 J" T# j+ X* t$ v8 h
QPA backends:
/ l8 \9 t6 ~9 m( ]( `7 e DirectFB ............. no
5 j5 G. ^/ P; {% f: i EGLFS ................ no # Z% K% t; H e+ [# R3 o
KMS .................. no 3 L3 a3 D, `# S4 g
LinuxFB .............. yes 3 S% Q% \5 l- x/ Z* h
XCB .................. yes (system library) " G- u: M! A9 f8 A/ o" s# V3 {. ?
EGL on X ........... no
7 n7 ~, N2 Z. F/ x2 i- a$ V1 f GLX ................ yes
& U0 g2 h- f, R8 \1 s MIT-SHM ............ yes * g% I. ]' e, b$ L
Xcb-Xlib ........... yes & A# M; L7 E0 |! P0 W: ~
Xcursor ............ yes (loaded at runtime)
, ~9 \4 S4 y4 `4 r Xfixes ............. yes (loaded at runtime) ) f) k, X. G Z- X! \! L! Y$ _- A
Xi ................. no 9 d0 e7 Z8 N z8 V; L4 U$ o
Xi2 ................ yes * g _; M9 I8 z0 F$ @6 C% ]+ P
Xinerama ........... yes (loaded at runtime)
) K6 ]$ V& d; y% l# m2 }% P Xrandr ............. yes (loaded at runtime) 0 d( I# b8 ?9 t7 l$ D1 E* ]" U
Xrender ............ yes , U: M: v3 _( {$ X9 `$ p
XKB ................ no
9 h& F7 ?0 U& R% i3 S5 ~* L" B9 y XShape ............. yes
+ w& m# S* q+ ~( A5 v XSync .............. yes
2 L o2 b; i5 V& l% L( a8 N, c, y8 e XVideo ............. yes ; x6 r& }2 r( Z/ ~- K) y, P
Session management ..... yes
: I& X: F, D* u5 y n7 d SQL drivers: / X. g: `" y; b" ] I7 D" h9 r
DB2 .................. no
% n+ w3 d1 `1 c" |$ f2 O InterBase ............ no ! L* z9 {: n: a* h5 R) a0 s
MySQL ................ no 4 s C' }, X9 B% V
OCI .................. no / F3 t5 V' j; t: Y+ @0 g+ [; c' y% k
ODBC ................. no % ^ W: @! [5 T) |; a% i7 K
PostgreSQL ........... no 5 f) E: ^5 Y2 J1 |% X
SQLite 2 ............. no / A7 n$ _+ o. G( x
SQLite ............... yes (plugin, using bundled copy)
1 [. p' t- X/ V# W- K/ m1 s TDS .................. no
$ \6 P' N& T0 [% G. J: _ udev ................... yes
4 v( B1 T- m& o @ xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
1 ]# G6 r* x* \/ W# T. I" D0 A zlib ................... yes (system library)
" n5 u- P* M6 R; H5 I6 W
* E0 u4 A$ B9 X5 W Z6 q% \. ANOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use
& l! N+ q5 D2 Cthe bundled version from 3rd party directory.
. U( z S& Z* f7 |9 o$ _+ I6 ~! S
8 ^/ N8 u1 z i& U- D n最后make和make install即可。) N2 j" E: P0 s
. p% v* ?" G; N& O8 i3 o4 h% \
j+ R8 ^0 q" q; o另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:5 X4 X" R9 a. J0 h
) d! p* _6 m" W. \8 `
进入已经编译过的Qt源码顶层目录,输入( P' ~/ {! s- T. \6 L
[html] view plain copy
- ?1 o# ~% q% {, ~1 k$ make docs 5 U, M3 F6 u% m$ H% s$ k
这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录)+ J7 _; C! ?: W3 e. L* H% ~
[html] view plain copy
4 }0 s, e0 `( q. d. D( U$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant ! C7 k# M+ d: K8 Q5 Q7 {; T
$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant 5 x) w# a8 z! b9 S
然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。 |
|