版主
主题
回帖0
积分10609
阅读权限200
注册时间2008-11-22
最后登录1970-1-1
在线时间 小时
|
1 平台说明
/ u; E2 ]* H$ D. o主机平台: Ubuntu 14.047 i; a$ k# _- v: H( S5 p
$ g9 E8 m- } J9 l4 z交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz
5 T/ N- s( W) z5 ]8 }目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤) p* U v2 T+ M- B f
% {7 A1 Q+ w% f. G" ]Qt版本: Qt-5.3.2
9 U" s! }; ]+ f5 F9 H+ J
8 ^, m, n+ _/ M& d$ O0 C4 e8 Z) x2 Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植8 m+ ~4 G; }! s9 Q
进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。3 t8 z8 c9 }" X7 x* W
7 [% [9 Z" I5 X* }: V$ M
$ ./configure --help >help.txt ; vi help.txt: a* l. r8 X; c0 Y( o6 t
; a6 f( Y4 x+ d$ U: h) U
- j; `" B% B2 Y* c: S配置时需要注意的几点是:
1 l! U% H) U4 I) `6 {, R* T
9 Q" W0 D# C, l如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;
# n' b. w) f4 X. E
( M. O1 s' J, P! x最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;$ Y R: C" O: t
1 o+ h# j* ~( r% w
如果需要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 n1 Y- d- d9 h; Z* f* P, `/ h* R& G; r, z) C' Y
如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;
) N) [5 k3 W1 m* {1 A' n7 d6 f; v" A1 c4 ?: `) O- r
另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。; U# {- n7 V6 D. i
5 y% }/ e4 d- Y: m/ g9 S q; W我的编译过程如下:
' m1 i% b, W3 |0 X2 n& l8 B
% l; s! g4 u! c5 M9 A首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:7 \2 Q( p* y; J
4 p2 t: ~. ?# ][html] view plain copy
3 S0 ^( B) S6 ?& I2 u#
( D$ q8 d! N y) d! P) ]* D* r# qmake configuration for building with arm-linux-gnueabi-g++
6 |4 j; r0 u4 N9 D% t# m( z# - v/ B: V% n# I" D
) C- C2 j6 v; j: O9 S
MAKEFILE_GENERATOR = UNIX : A0 f5 P- Q( F5 A
CONFIG += incrementar gdb_dwarf_index
2 ~6 y8 ]+ [/ zQMAKE_INCREMENTAL_STYLE = sublib
' F# H. | V* HQT_QPA_DEFAULT_PLATFORM = linux #eglfs ) G+ Q! H0 H" m
QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a - K* t* a% \$ X8 R4 K$ j8 I$ A" z; ]
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a
2 `, D0 `4 v1 ?! o" r4 O 7 j" E; a8 M+ Y! |$ ^
include(../common/linux.conf)
- q" s) N/ N: ]) B: Zinclude(../common/gcc-base-unix.conf)
: ^# `4 {2 N+ x9 L* Xinclude(../common/g++-unix.conf)
- u7 `5 e) R( y, ], ?. t
/ h9 x' k) e# ? j9 ~ i$ |1 \# modifications to g++.conf + c4 o% |0 Z3 o9 Y7 Z3 M1 E, s8 ]$ ]: `
QMAKE_CC = arm-none-linux-gnueabi-gcc 5 L8 R% N9 }, ]
QMAKE_CXX = arm-none-linux-gnueabi-g++ 3 f' ~2 M$ x: f0 E3 |( c
QMAKE_LINK = arm-none-linux-gnueabi-g++ $ @, Y5 d/ X* |6 `9 d/ g Z
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++ ( F& ^, M/ Z: N! V9 R+ b$ n
4 Y2 m0 J# z& s: \( r7 v; e4 k# modifications to linux.conf ; q1 T4 U- `! R$ K7 ~8 O# [0 t
QMAKE_AR = arm-none-linux-gnueabi-ar cqs " g: s* [1 T! s9 Z$ E7 S7 h- G, N
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy # f$ d9 {$ d! S# k, U9 l+ d
QMAKE_NM = arm-none-linux-gnueabi-nm -P
" |1 S; x. l1 c3 _QMAKE_STRIP = arm-none-linux-gnueabi-strip - Z+ v9 \; D! [) w0 Y+ n
load(qt_config) 7 M0 }( s" Y- j6 Z8 f4 Z' W: n% }
1 N5 K- E9 E5 }- I& W. t
* `8 \, H6 S. N7 i+ Z% J! m
然后执行:
1 i5 \- C! V$ u[html] view plain copy
/ ?1 s; I0 d+ J3 s5 d; D$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float " w* y8 T( F; U& y {' L6 `. {; [# Z
配置结果为:
* P8 X6 [ ^3 l, m3 Y
* W" l6 H) t* ?3 ?3 E n[html] view plain copy
% m: I* H, P. F Configure summary
- [- v& l+ V, e% H% q4 K; ` 9 t4 n, u M: Z6 w/ j5 l
Building on: linux-g++ (i386, CPU features:) 8 f* \6 m2 s3 C
Building for: linux-arm-gnueabi-g++ (arm, CPU features:)
* f$ {+ F0 ?3 e6 d- vPlatform notes: ) j) s+ b$ \+ [/ e) r0 R, M
8 ?( g" v! g' ~5 X+ p - Also available for Linux: linux-kcc linux-icc linux-cxx v" H0 F+ w0 M9 K$ L; S7 V. ]
) d" k4 \2 P4 }( O- j& d$ g- W
Build options: , P* s* u2 i1 b+ p0 x2 u
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 + l# ^9 X0 u2 n8 w
Build parts ............ libs examples
5 M" G; V4 p; _4 [- t1 S4 S Mode ................... release
. K. H2 ~. y* k; ^ Using C++11 ............ no
1 \, c- a2 w, d ` Using PCH .............. yes
2 G. Q) N" p' m( I/ }% f/ U- ` Target compiler supports: 8 z, K/ T9 {" _2 r
iWMMXt/Neon .......... no/auto ) g* M$ Y3 p7 Y1 S! Z1 i' Q
7 [; ?4 l- h: p& D y# L& z
Qt modules and options:
* R# y8 U- S8 m) { Qt D-Bus ............... no % M k& ?$ m6 b6 {5 `5 P
Qt Concurrent .......... yes
+ K7 F3 g( Y/ b" P4 }8 O+ J+ { Qt GUI ................. yes + r4 G$ X' I, }
Qt Widgets ............. yes
* x2 X; c. L) T' b' r- t Large File ............. yes
- z- i! c& G4 m9 L% n. K& Z QML debugging .......... yes 8 A1 V% }$ F* A) m, ?
Use system proxies ..... no , \$ f- y, c2 J2 ?, [) g7 \, _
" i" }3 e) Y7 t$ X9 k- ~
Support enabled for:
& a0 q4 X a4 F1 p# s& ?2 D, i! C Accessibility .......... yes + @. w- A H! D5 K. ?
ALSA ................... yes
' Y; Z% D5 f! u7 H' j CUPS ................... no ! h8 i- R! B* x( P! m
Evdev .................. yes . A" Y8 F$ G+ Q( W
FontConfig ............. no . b" E' w% p% o
FreeType ............... yes (bundled copy)
/ M D+ o- s$ k Glib ................... no + B) A1 N7 s! W" |
GTK theme .............. no 4 T( r& x/ B+ ]; R
HarfBuzz ............... no ! Y5 T# x6 }+ Z7 R+ Y( Z$ G, o% c- J
Iconv .................. yes 5 j+ ^" F2 g9 C: ~' d9 N
ICU .................... no 9 v* ~% S, E4 b# W4 P7 E. Q
Image formats:
1 w4 l! i0 `' e4 I- C GIF .................. yes (plugin, using bundled copy)
3 ~- u a2 B5 X0 H1 ^ A JPEG ................. yes (plugin, using system library)
* w. _- @$ ?5 v6 y/ ^ PNG .................. yes (in QtGui, using system library) , s) c- M, k/ I, {
journald ............... no + t4 T9 b3 L' g, e! P
mtdev .................. no ! p- L/ A( x0 g1 h
Networking:
' W* N/ r: w' q# L2 o6 j getaddrinfo .......... yes & o: Q5 _9 ?- ?1 B) J
getifaddrs ........... yes . X4 n3 d9 k! Q) x
IPv6 ifname .......... yes # o- g8 K/ _' M$ v1 ?- S
OpenSSL .............. yes (loading libraries at run-time)
( q" l6 E1 ?) ?2 ^! Q. k NIS .................... yes
8 g4 N/ l2 U7 `6 H OpenGL / OpenVG:
8 d& S4 [2 u; g7 M. p; x3 H EGL .................. no : M E! S( A8 P# V, l0 \
OpenGL ............... no 8 k0 p# W4 p, _; F e, H/ |- u
OpenVG ............... no
3 \+ T, r' k0 Y: Q' @: b; @ PCRE ................... yes (bundled copy)
1 D5 H# n/ |* P* D) n8 N& G! | pkg-config ............. no
+ |- j0 ]: y) K% @* W6 \ PulseAudio ............. no ' @5 j6 z) T" _/ X4 v% r8 |
QPA backends: ! E* H- W7 \! @: n0 T! i$ S. [
DirectFB ............. no
' O4 C& u6 R8 k+ E% x+ x0 }% ] EGLFS ................ no 3 q& m+ {$ B% M4 Q
KMS .................. no 2 [ K7 }+ L$ f4 I9 C; {
LinuxFB .............. yes # g; k W3 X* m1 e! b! Z
XCB .................. no 4 @# D( Y' b7 w( N5 m' q" P
Session management ..... yes % H) ~" ~' _$ S4 ^$ ~
SQL drivers: o- j2 L) P; B3 J+ C1 A
DB2 .................. no ! N: A6 B9 I4 |. o: \# {3 w) ~
InterBase ............ no
( G! N% f4 M$ |- h$ H( `( S. O p MySQL ................ no
1 ?# ^& Z5 Q# M% K7 d, K OCI .................. no
, l7 x" a9 L' }( q; P& d% K ODBC ................. no
6 G! ]! x }5 @. e/ u% F PostgreSQL ........... no ) u# t0 b" F5 }: S
SQLite 2 ............. no ( F J5 t: b( S2 ~
SQLite ............... yes (plugin, using bundled copy)
4 w1 d) O/ w. D2 z3 C+ {: X V TDS .................. no
" C* @% l- C, N, L: i! ?* Z5 ^ udev ................... no
" n0 V: s5 k0 R) K& d ^1 B xkbcommon .............. no $ d/ P" l: m0 N
zlib ................... yes (system library)
0 u: y# T) y0 J8 C6 u R
|" b$ M! z+ ^& m
t& K; _1 G) Z+ I& J& t0 t配置完成后执行:: p( P2 W# C: O. v: O8 k0 _. p& ]/ v
[html] view plain copy
+ V% ]8 U! H$ B* B$ make -j4
: n7 X+ n2 C9 a# `$ sudo make install -j4 2 ?+ e. [8 B3 ^+ Y9 g1 a
& O- k3 R/ v6 B
3 添加 tslib 支持
6 m! n! } c9 u) d H4 E为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:1 m0 f# I/ p$ F j; a
% g) V0 }) |' ?( P
http://blog.csdn.net/newthinker_wei/article/details/8639276
% x i& `3 s6 _: \2 h% |友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。
7 ]8 {& B- c, X j
$ q! i1 x' L; n% k4 h( g另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:8 v( `6 y3 V m3 {
: R0 h* c% m; e# o! n; thttp://www.arm9home.net/read.php?tid-16105.html
5 V v; i. z+ r! C7 C2 I4 d
" a, \) K1 Q1 O4 |+ j2 ?; x+ D注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植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工作。
4 ~3 k( s# m) _6 ?将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:
$ ^; b) n+ {' q# [
6 \% _: T8 M4 {7 S& z[html] view plain copy
, t7 A/ c1 C* u. _3 ]* J. k3 h! J#! /bin/sh
( \: y/ y$ g6 F/ ]9 |# "source" this file when wanna run a Qt application on the ARM Board.
7 M6 s& |: V, \! e, @1 ?
6 D" U3 L4 ^& U" V* e8 H; X############### the below lines are for stardard TSLIB ################## 9 V0 H* S5 }0 H4 B5 E
export TSLIB_ROOT=/opt/tslib 8 E# q8 K! ]5 L4 f( y
export TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal ; I7 w1 {3 j J; y9 U* A
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
. y: t7 Z+ W) R+ \% w& |1 I, vexport TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts , ^+ d3 p" d0 X# f+ i+ [9 t, F
export TSLIB_TSDEVICE=/dev/touchscreen-1wire * {. S H( E& v5 Q& H8 b
#export TSLIB_TSDEVICE=/dev/input/event2
1 P# Y6 {& G& E
3 A3 B7 c0 f0 N/ V################ the below lines are optional ############## % f, V, e0 b3 J2 F! F
#export TSLIB_FBDEVICE=/dev/fb0
8 k) X3 g6 z! M2 ]4 Y2 u#export TSLIB_CONSOLEDEVICE=none + F6 w- \ C* ?1 Z
" Z: ~8 u; W- @! T此外还要修改 ts.conf文件:
2 V R6 `5 O7 m3 ]+ D[html] view plain copy: k! f( n# b2 S
#module_raw one_wire_ts_input
. F2 t( x- Q2 j1 n8 m1 U6 \module_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中
4 L9 l; _6 D8 [
3 z. `9 b6 |3 c. g& |# dmodule pthres pmin=1
) c: n8 t! u: j* N+ T5 E$ A1 Qmodule variance delta=30 9 h- z4 }: E1 S2 T, A( {, b, h
module dejitter delta=100 ! Q% ?5 R7 k5 q
module linear
$ S$ O' ^5 q" k+ b" S! F. d到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。/ g$ u3 o7 V0 L4 G! O( C$ ^4 S5 z
有了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"这个库文件了。2 U3 m- @* U. Z8 U
: }9 A# D A8 u( n' R$ A- h
4 运行Qt程序4 h4 a0 f# S- Q
需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。
6 s+ [* n4 H, R) t' U3 c3 E* R" F. O% P) w
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# @9 W! A. G& _0 b
6 z( a6 J: }4 b; O3 v8 s+ b
编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:6 l, M% E3 W% P- L
0 f5 R/ g' O) l( _+ M
[html] view plain copy
% R0 i: n" G A9 {export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms
5 F+ C V4 C1 ?1 b; i3 nexport QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
* s' w7 d6 {" l" a$ Dexport QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts 7 ?& L# A& Q" F( s; s: N/ s3 @
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire #使用tslib插件
9 F7 d1 W( j2 V- C. p, a1 [1 n* ^* Z* J/ X# M
然后就可以运行Qt程序了
4 \$ I; W# Y5 J( m I6 `) y Q+ u1 x O0 T; z/ u1 k
以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。7 f! b& Q- O; v0 m0 N# P
/ ^* U- v0 R! ^/ N9 k- W; M附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节)! b( ?- {$ u* O' {, }! |8 F
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。( c1 _5 s* P0 k1 ]
$ f- _& k3 X- j
首先安装opengl支持(mesa3d),
6 L" }0 F) \0 a9 l+ X6 \+ S, y& x. y8 d% [- L8 S. D
[html] view plain copy% ~/ b$ A3 K, u: e: C# U7 ~/ q; M
sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev , y2 P/ V* I3 A8 z
如果需要,再安装Qt D-Bus的支持。
7 n/ [1 w5 n @- P
- m- D" D; n( H% S! K" ]; ~然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。: b) w9 n3 }- G2 A7 H( H% b
* Z: T3 _% y$ e; ~" [6 p: R5 o, {
[html] view plain copy
: _/ ?6 r9 l! u6 ]* L" c* z& P./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl
. t6 G( F5 E/ D- {/ x. w7 y* \6 A8 m配置结果为:
8 c0 f4 @& u$ j$ b; ?+ Z: C# x X
% |: `0 s6 P! x; a[html] view plain copy
" D! u: p( I' k a Configure summary
1 b, a2 A/ b" ^8 g: E
7 C% ^1 R2 U) Z2 y) Z; H8 T# tBuild type: linux-g++ (i386, CPU features:) - ]0 K, g# b3 r3 M2 b# k6 [% r
Platform notes:
% X8 K3 R6 c g- S/ ` . i* R8 O( k! J2 \# R# @
- Also available for Linux: linux-kcc linux-icc linux-cxx
$ {0 C/ z3 ^) m/ r& S% U) Y5 N
) i6 m4 T" j6 }2 a# R! v n$ ZBuild options: * ^& f% \2 V6 S5 e j6 h
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 1 j" B4 j/ U% q" S" O1 m
Build parts ............ libs tools examples
8 H% G: x. P/ i* \+ E2 w Mode ................... release - s, a) `& f$ K" B- Q
Using C++11 ............ no & r. U+ K5 J. Z! A j
Using PCH .............. yes 2 ]' b8 R# X8 \: Z" Z5 i8 V
Target compiler supports: ! H: v5 i/ S7 h; ^/ A. f
SSE2/SSE3/SSSE3 ...... yes/yes/yes
. p, e5 e4 x6 b+ e# h3 A SSE4.1/SSE4.2 ........ yes/yes
. u/ J+ n' l4 M; O* K( A AVX/AVX2 ............. yes/yes
- V- `4 M: |+ k6 t' P " T+ I/ L4 }8 ~: V |
Qt modules and options: # v* Q1 |* ~1 I, v8 { |+ N" |
Qt D-Bus ............... yes (loading dbus-1 at runtime)
& v( @ O( |. V1 g s# ]' Y( e. e2 w Qt Concurrent .......... yes
- x2 \7 G, o/ s Qt GUI ................. yes $ ^& U% q1 H# r5 p4 V: y9 q& f" f+ O
Qt Widgets ............. yes
1 I: M6 Z" u2 X: `1 [9 [: y+ H Large File ............. yes
& e. i. m) U; j4 A* l5 q e0 ] QML debugging .......... yes
" d5 C& K3 l, Y2 z* v Use system proxies ..... no
N% N; M. Z2 B0 g# p7 p
e% v+ y8 ?6 R3 ~Support enabled for:
! c4 c6 Y4 M+ W& s! ]7 }. e Accessibility .......... yes , N% F p6 g h$ e) D2 N$ u. @
ALSA ................... no 6 e& W' x$ q8 L* j
CUPS ................... no
* b( \* o+ |2 f) k- S/ o Evdev .................. yes
" j' H0 K; i$ a FontConfig ............. yes ; z+ X& h7 T1 y1 O/ @ c! M
FreeType ............... yes (system library)
/ F7 m- `1 K" g) [- t Glib ................... yes ( p# s% ?* Q$ D( ^: o
GTK theme .............. no
- H( K+ u9 @2 f5 d) V" L# ]9 G- { HarfBuzz ............... no
" ^$ _ o+ N# \. o Iconv .................. yes + Q) p9 j3 ]- c1 d5 B/ B: \( v
ICU .................... no
0 j/ H# T2 W9 J* h% h* H Image formats:
( w8 P2 H8 L8 F& b6 Y3 q" b6 h# j' r GIF .................. yes (plugin, using bundled copy) % k+ d8 d1 C9 K( V' W
JPEG ................. yes (plugin, using system library) 5 I. @$ _6 ]7 F3 d7 O# }# u
PNG .................. yes (in QtGui, using system library)
$ @# M$ b8 t% F1 m2 [1 t$ G1 j journald ............... no
( S3 H% p0 n9 @% k' G2 y# O( I mtdev .................. no ! V) ?/ E9 i( `) m' c% S
Networking: 7 G& s) T9 e2 @/ L" c' a
getaddrinfo .......... yes 3 l$ a) l& e& V
getifaddrs ........... yes
6 {$ O) V, F0 F- @, s' n7 Q IPv6 ifname .......... yes 9 f- S+ K8 E; h$ |+ U
OpenSSL .............. no 4 D4 t4 l: O* H" J
NIS .................... yes
& j) M" q" S% u, X* d7 l OpenGL / OpenVG:
. ^- r$ ?% f. V M# a8 a EGL .................. no
3 ^+ p3 D" X2 ^# N OpenGL ............... desktop ' S, E& x1 t/ n9 ~, C& A
OpenVG ............... no
" n0 e3 h0 q5 n# ` PCRE ................... yes (bundled copy) ! `; | B3 I* |
pkg-config ............. yes
3 B0 h3 X. K* I( D PulseAudio ............. no
* {. {- R' H. M/ j6 @( f- E QPA backends:
" s: Y" N9 f4 Y, f DirectFB ............. no
; g0 a/ h( A# s' m! x" ~- `6 d! _/ e% l EGLFS ................ no
) D! K: @1 I, U4 j& ] KMS .................. no
" L! v# c5 t1 P1 l. v9 P LinuxFB .............. yes
/ u! t* f. k K \& c XCB .................. yes (system library)
9 o" ~: j6 K8 a; h5 B, ~9 t EGL on X ........... no
0 C) {2 l& [1 O GLX ................ yes
# V! Y5 {$ N& g; Z, a MIT-SHM ............ yes
+ [4 p, J% C' u" M. n Xcb-Xlib ........... yes 1 W3 d& l) u/ e0 n$ A- r
Xcursor ............ yes (loaded at runtime) / V. e! }) ?5 t5 ^- s" H- M
Xfixes ............. yes (loaded at runtime)
* C' t: \- L2 V K; q0 g Xi ................. no
; J# h: A9 ~: [" k _ Xi2 ................ yes
: ~* H; ^, T3 V2 K: ?- V! _ Xinerama ........... yes (loaded at runtime) 2 Z) S8 |: }3 x+ x% N: A
Xrandr ............. yes (loaded at runtime)
$ r) I9 r8 L4 u0 M4 | Xrender ............ yes
( q+ q" m: \' c) r( ^4 x+ k XKB ................ no 2 G x% ?: z" c; { {
XShape ............. yes 6 Y" G- I/ g5 e0 K% A
XSync .............. yes
9 v# V6 z- i$ d9 T XVideo ............. yes ' }4 P2 w; t! w8 f9 `# P, \
Session management ..... yes J' m# n9 ^% v- A# T
SQL drivers: 0 S7 Z- x, i* z% G4 E5 z/ N
DB2 .................. no
3 X* O4 f- v3 u InterBase ............ no
5 ] v8 m6 \% k1 ? MySQL ................ no
; @ A1 Y9 U2 s" u; d; Y, _7 e OCI .................. no
2 W5 _6 e' b& G2 d1 f ODBC ................. no
6 g1 I6 c5 @0 b2 T+ W8 B& o( i PostgreSQL ........... no + I' P/ s+ O1 k5 {! |
SQLite 2 ............. no , s' b1 e, T7 A- H+ Q
SQLite ............... yes (plugin, using bundled copy) 2 \* h, o3 | H- U) J
TDS .................. no % p; }) y( y# D! W% X
udev ................... yes
% b( b" B, C& C1 p xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
1 ?5 I* G6 w$ K5 k) }" |0 e zlib ................... yes (system library)
; [; ], ?: d5 S0 A+ `
$ J' x/ Y' i% J* nNOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use
* e8 m: X/ L: Vthe bundled version from 3rd party directory. * i9 w, j" A# I) a/ \9 |: r5 M
2 N# ^; l- ]9 v2 x* N最后make和make install即可。
2 Q# } S* F, e; K) x5 E
9 x7 Z0 m I0 ~/ T Q, f/ e( N( z' m: ~. ]: u, r5 a* @
另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:3 M$ E. } T: h- E2 |/ a2 y
# e$ Y0 z! t' A进入已经编译过的Qt源码顶层目录,输入$ x# I# x" Q0 A6 _3 {
[html] view plain copy& ~; K5 u; R9 b$ G! }' @ z
$ make docs
" K/ y3 g; k2 F0 |% }这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录)+ F* }/ _/ D/ j* m) @ J1 y7 L9 P
[html] view plain copy
$ o$ P! T! u) s7 F6 h8 x$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant
7 }2 W! ~- E, Z$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant ) \* @; K0 H( I7 u P' T% O: C
然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。 |
|