一乐电子

一乐电子百科

 找回密码
 请使用微信账号登录和注册会员

QQ登录

只需一步,快速开始

快捷登录

手机号码,快捷登录

搜索
查看: 3689|回复: 0
收起左侧

Qt-5.3.2 在友善Smart210开发板的移植记录

[复制链接]
发表于 2017-6-16 22:27 | 显示全部楼层 |阅读模式
1   平台说明5 _9 l* p5 t' S; ]4 U8 J. _
主机平台: Ubuntu 14.04
  s: a1 X& ]2 {) f3 N3 t6 t
+ G, b4 t2 F  S5 R6 t- D交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz) \- ]0 W  _& f8 {
目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤)4 z: l/ G/ G( v, n, e' ~! W; y4 i
. a1 ]* q6 f/ ^
Qt版本: Qt-5.3.2
( m7 M' W( Q+ Z
" m; |8 M. t& k. \$ Z* \2 T( i5 ~2   Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植
  k0 y, B+ T: n# J1 y, `' U* s进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。
6 c9 h% [! ?1 N+ t* }! C
, E  O1 k* I2 P: t0 E$ x5 e9 X$ ./configure --help >help.txt ; vi help.txt
9 G! M" H% N3 s; @6 H7 N3 u3 q4 Y# G( L9 c/ m

% S7 b( ~# x9 ?( I( e# x2 f& X配置时需要注意的几点是:7 p- j  p+ Z# _

. l9 C( ]2 R5 L. {; u* s7 o3 V: g如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;
- R3 K7 Z  V* s6 ]2 ]" k
9 H! _( t' K3 x7 |$ _最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;
, `+ l# V: M& p
+ _3 t# w7 N  _- i( F2 s9 R如果需要openGL,就需要用 -opengl选项指定opengl的api,对于嵌入式平台,一般使用 opengl ES2,配置选项中加入" -opengl es2 " 。不过想使用openGL可能会比较麻烦,因为openGL一般在有硬件图形加速的条件下才能高效运行,而这需要显卡或Soc厂家提供openGL的支持库,但并不是所有Soc都能找到对应的支持库,比如三星就没有提供S5PV210的openGL库,所以我这里编译的Qt也是没有opengl的。(openGL的替代方案:如果没有厂家提供的硬件图形库,可以考虑使用纯软件实现的opengl,这样的软件库有很多是开源的,如mesa3D库等,不过纯软件实现的opengl在效率方面肯定要比带硬件加速的低很多,而且要想在嵌入式平台上使用,必须将opengl的软件库也交叉编译出来,我在交叉编译mesa3D时遇到了些问题,所以目前还没能在开发板上用上openGL);
; ^9 R) W5 m/ g8 K3 b; s
" N' ^- J: j5 o& x如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;
( _5 ?9 g% @- o: L0 W1 j
3 a3 O& H  j! P5 [( h另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。- ~; r1 C( b7 w7 t2 t
( q) i0 V" u! a( L% u* w
我的编译过程如下:9 U: Y. k: I3 e6 h" E

4 u) c6 A9 w4 s  i首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:
2 D5 s/ ~7 B  I- e. ]
% U  U! d$ O4 h( R! C/ y[html] view plain copy
9 q  t' t8 U6 q1 K#  
& y: t6 S/ r8 b2 T# qmake configuration for building with arm-linux-gnueabi-g++  : K3 Q- @- a$ o4 w' J) S
#  & L$ A* ]& e1 I4 F: ]3 X6 h
  
: @7 ?2 U6 f% s+ |/ O) OMAKEFILE_GENERATOR      = UNIX  3 ~+ O3 M- P% I4 y, w
CONFIG                 += incrementar gdb_dwarf_index  
6 ~- p- B. R5 {, N( k  zQMAKE_INCREMENTAL_STYLE = sublib  * D/ a* A1 N! p$ X# J
QT_QPA_DEFAULT_PLATFORM = linux #eglfs  6 d+ C. I1 s1 |* o
QMAKE_CFLAGS_RELEASE   += -O2 -march=armv7-a    ; m. d3 E7 f  b3 E8 T; T6 i+ d
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a   
0 b% f8 E) D4 d& B; d- L3 s  
; A# F7 A% i: D* m) [include(../common/linux.conf)  ' S4 _& v/ {) b" m# j" v
include(../common/gcc-base-unix.conf)  
- l7 o5 N- F" w: D( A+ g7 d8 q: }include(../common/g++-unix.conf)  
! R( k4 ^$ ]2 \7 D: e  Z  w  
, a" `6 e6 K5 ?4 N# s! V! V* j: U# modifications to g++.conf  
" Y0 K# Y/ k2 W: s) O$ Q* \QMAKE_CC                = arm-none-linux-gnueabi-gcc  & j% s% r* B# ]; p6 I4 h- ^
QMAKE_CXX               = arm-none-linux-gnueabi-g++  8 [$ s/ V  C( f& ]* O& W4 q
QMAKE_LINK              = arm-none-linux-gnueabi-g++  
- k: G7 o; d$ ?) J, B0 Q$ t1 |# F3 p' ZQMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++  ) l  _% ?$ q1 n7 s) q* U% ]
  , z, O+ [9 O( R0 e1 x
# modifications to linux.conf  , e& S1 y) i) N3 O8 ]& u0 Z1 H& ~
QMAKE_AR                = arm-none-linux-gnueabi-ar cqs  
6 |7 K$ O6 [/ P% \4 L7 \QMAKE_OBJCOPY           = arm-none-linux-gnueabi-objcopy  7 J/ ^* v9 _, L" ]
QMAKE_NM                = arm-none-linux-gnueabi-nm -P  . l& {& ?$ |: R8 P. z  B
QMAKE_STRIP             = arm-none-linux-gnueabi-strip  
3 {9 s( \. n% ]- [* iload(qt_config)  + w6 k) s) t4 M# X, G9 f; u
" I8 ?. m8 R) ]3 D& v2 I* e

* u* ~  G/ _9 J. Y7 g然后执行:, v* e/ b  ~2 u/ |; {- t' W
[html] view plain copy' t5 w3 z- e2 e* k5 a& k9 O: Q
$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float  
( V, F+ r; X. u7 t* E1 x配置结果为:
$ n) T' V" D+ A1 e$ d5 c3 ~: g2 U4 C: m+ e
[html] view plain copy
( y& X/ |9 k( }: N4 F& L2 K   Configure summary  
" T8 T) v6 `$ f# \9 B  
# n* z2 |& N9 |6 V9 p( C2 ?/ KBuilding on:   linux-g++ (i386, CPU features:)  3 [* s3 N& _9 I1 X9 f% J
Building for:  linux-arm-gnueabi-g++ (arm, CPU features:)  7 S( Z) I* E& g
Platform notes:  
0 ~) ^1 {1 q9 v) x, C& L1 ^+ ^0 s  
: b  g  V8 }$ H+ d4 ?/ X, V$ g            - Also available for Linux: linux-kcc linux-icc linux-cxx  
6 S- T4 @% X1 w$ P9 y; t8 Y& V          - u4 s- v3 n! [5 ^: ]& l  b* a
Build options:  % K! \' U( Y- v" _# h' _7 p
  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   
8 d& ]2 a% s  }  k  Build parts ............ libs examples  1 ^. l1 q2 Z# z7 x& m+ f2 w7 r+ D
  Mode ................... release  - g* K& r7 c  T+ m! A
  Using C++11 ............ no  
9 _) q& R9 n' e* w0 x  Using PCH .............. yes  
4 @' @& h* \8 r- m$ @  Target compiler supports:  
1 R& m- i6 d" w* y: p9 R* a! R    iWMMXt/Neon .......... no/auto  - i, `' j/ B$ H* U  Z) [/ j& n& L
    {; z1 C/ a+ n; L6 R) t) D
Qt modules and options:  ' _' @% t. c' o4 S' B
  Qt D-Bus ............... no  4 B" A6 b. P6 \7 c) B' K: l# n
  Qt Concurrent .......... yes  # e" t! f- W. ~# Q1 U3 j: i
  Qt GUI ................. yes  ' h+ F; Z& c% n; E) y
  Qt Widgets ............. yes  
0 `- ?6 x' r( A, G8 o" O  Large File ............. yes  
4 d6 l, T/ ?# y+ |  QML debugging .......... yes  
0 I3 }5 k4 Y8 B  Use system proxies ..... no  
5 j% V% ?, o- k: R. a  ( j3 g0 O/ O* W# b
Support enabLED for:  : s  \; h' A1 v5 j  m
  Accessibility .......... yes  
  d1 d' t; F6 U) |$ {  ALSA ................... yes  ' A6 A0 I  e% q
  CUPS ................... no  
2 Q0 A* @3 F8 u6 C0 S/ g  Evdev .................. yes  
- x; p1 @5 [7 e+ _  FontConfig ............. no  
; \% a, T4 E* M* S2 O  FreeType ............... yes (bundled copy)  
/ L% o* P; B$ u4 |% L$ R) b  Glib ................... no  ' \3 E5 ^5 {8 [# Z% Z; b- g1 S' a
  GTK theme .............. no  
& A" b3 e. g) m9 A( N& G  HarfBuzz ............... no  # T1 S5 o$ e: F- k
  Iconv .................. yes  
" [' h0 o$ n# _* b  ICU .................... no  * J, `9 ]9 r) r6 S
  Image formats:   
  Q4 ?% C: q: g; @8 C    GIF .................. yes (plugin, using bundled copy)  
8 \2 Z- X- C, s3 L8 G    JPEG ................. yes (plugin, using system library)  . v1 @& E) o, E; p
    PNG .................. yes (in QtGui, using system library)  
9 M+ Z) S5 g1 f$ o4 }1 q6 h  journald ............... no  
2 i" v  k/ B$ N4 _! f8 V7 X1 X6 r  mtdev .................. no  
' H; m: e, Z- ?% R* b  P  Networking:   
9 i, G$ O; [3 `1 L5 l    getaddrinfo .......... yes  
- M" u" C) H, s) Y/ l; N' M    getifaddrs ........... yes  
" ?- x) ^  G+ c' O$ d    IPv6 ifname .......... yes  
) d  Y9 p" `1 c3 j# i3 {    OpenSSL .............. yes (loading libraries at run-time)  
( L. Q9 D# Y+ Q) s  NIS .................... yes    v  C% h6 F: |9 A1 I+ }
  OpenGL / OpenVG:   
+ c- F1 E3 B6 ~5 J. q6 y    EGL .................. no  " N/ {. _) F' O9 m1 I0 ?" Y4 E
    OpenGL ............... no  & D7 p: I8 M* G& z' v7 M9 m
    OpenVG ............... no  
9 @' V3 K/ P5 F  X  PCRE ................... yes (bundled copy)  ) K$ C5 b7 L) {% O
  pkg-config ............. no   
( p3 h8 F( D  Y8 D( R  PulseAudio ............. no  8 u6 G& x8 S, x. L6 t
  QPA backends:   
9 p! o. R) e* t3 {9 U! V8 o    DirectFB ............. no  " h/ x" f* B; Y; p8 s8 q
    EGLFS ................ no  : t' s9 ?* o# C# {  m
    KMS .................. no  / U, X/ T0 H- q* `) I
    LinuxFB .............. yes  7 F  F( g- b  Y. q( [2 \3 B
    XCB .................. no  ; S( O( [/ o2 e' n+ A7 L
  Session management ..... yes  3 n# z$ {$ d9 U
  SQL drivers:   
* C+ W  S% q' Y  a    DB2 .................. no  & i% q1 _9 G- `- n* J
    InterBase ............ no    S) N8 h+ [0 J- ?4 E, i' U
    MySQL ................ no  
2 m! d# x" [1 R) f3 V0 N1 M    OCI .................. no  1 ~4 f) K2 c* g. t4 d7 T
    ODBC ................. no  + X7 g! X& V' o- L
    PostgreSQL ........... no  1 C) ^9 h! J4 n2 }
    SQLite 2 ............. no  2 |/ a, k+ z& v! Y) Q: a- W
    SQLite ............... yes (plugin, using bundled copy)  
. O7 c" K; v8 a1 g    TDS .................. no  ) p1 C% m/ \5 l; l
  udev ................... no  1 P* ]/ D: h' f
  xkbcommon .............. no  
' C, p4 P0 U6 A  zlib ................... yes (system library)  & Z. S- c( v# B
& T* I3 B3 W( ^8 }+ q
! }& X1 t, J& T& C4 b2 a( W/ D
配置完成后执行:
6 t8 [+ ]% e3 O/ C4 |6 Q1 D[html] view plain copy
4 c) ^! a! C( U$ z% A- T$ make -j4  * T& z0 s+ X/ r7 A4 c! q
$ sudo make install -j4  
0 z, U1 A1 F/ t5 U. C% _0 R% }: C$ u! }3 O& h) G& P; C7 V
3   添加 tslib 支持
+ _% a& s" \3 {2 n& m# d, M为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:
$ v3 o8 p: d9 l! o
, y1 `6 ?! G2 [3 |  G  ~8 X& x/ ~http://blog.csdn.net/newthinker_wei/article/details/8639276/ J: g6 Z6 D. E
友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。2 m% B2 x1 E$ Q/ i% u& ]8 o

6 `4 t1 h! @2 B7 w9 ^( h另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:; J5 {8 |- _( g6 ]
3 j1 {/ K3 s$ F/ q/ J
http://www.arm9home.net/read.php?tid-16105.html6 x: f& |- X3 X( v1 W+ p

5 g( v9 j8 n, j( u* m! e, U6 |- ^注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植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工作。
& |7 F$ L/ A0 X+ Q将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:( F: \  k  u3 O

6 J5 T( `3 L8 A1 ]- [; g6 y[html] view plain copy. g: q" d) L6 [4 B8 p
#! /bin/sh  & {8 D( m' f$ U) h6 b/ R" N
# "source" this file when wanna run a Qt application on the ARM Board.  
, T5 m) ~3 b" f( i  % X8 H4 Z9 Y) Z1 F0 L# q
###############  the below lines are for stardard TSLIB ##################  
; @9 d+ U1 |2 w2 a/ Xexport TSLIB_ROOT=/opt/tslib  
7 U' E) F6 @/ I! Qexport TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal  " Y, ]/ n/ w8 s3 o' X! k! M* D
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf  ) K! Q# e! _4 Q, Z2 B8 B3 @8 Q4 h, }
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts  
- I! d8 d9 j+ w7 a) C* v  ~export TSLIB_TSDEVICE=/dev/touchscreen-1wire  
3 y2 f* b" j$ A( `' `/ r4 |#export TSLIB_TSDEVICE=/dev/input/event2  
! a0 W, z- q0 V% o( ]+ d  
; n6 j6 ^3 M$ D, _. f################  the below lines are optional ##############  1 `$ O# o% {6 |3 U2 c
#export TSLIB_FBDEVICE=/dev/fb0  
8 U+ V5 j7 J  H0 x( Z#export TSLIB_CONSOLEDEVICE=none  $ N8 ^* Z: i& f7 P
  q- _0 S; d+ p: b8 e7 _) O
此外还要修改 ts.conf文件:1 h+ ]& k' g. n' c5 K' I1 M: ^2 ^
[html] view plain copy) Z% G8 P1 D" a0 u  n" j$ ^4 I
#module_raw one_wire_ts_input  0 X1 x- x8 |7 e- |
module_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中  ' q9 x3 s1 R" F6 I; Q# i6 U2 w
  1 N  ~+ v/ i4 y$ U8 z6 [/ M7 F
module pthres pmin=1  
, K* @0 A% r- Dmodule variance delta=30  : Z6 n' w: Z( h  K' `
module dejitter delta=100  
: u; ]7 P% ?: x- ?$ Mmodule linear  " m! s, o. p' F! r: |8 s+ w
到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。
. a9 x+ ]2 R8 @! \/ c有了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"这个库文件了。) A' e) n' c7 `) ^* r
: g7 v- f- C- q- L/ Q
4   运行Qt程序8 y( O7 p1 G9 Q9 I. x8 R
需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。
! `$ i9 N0 L1 k5 x
& J. c+ x3 B  ~( r5 ~/ A6 v1 p: wWith 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, x& H# @! X% H4 G
" t+ n: z; v6 f3 r  d# {
编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:0 q) U& ]8 q. E* R
- h$ x; z. n4 c% k# y& y
[html] view plain copy
# J& g: ?; G' Uexport QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms  ( m+ |7 p4 f5 ^1 Q, i& w
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0  
; E7 a; a0 c0 A4 L0 Zexport QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts  * h0 g0 o# b2 Z7 ^1 W3 ?" @( x
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire  #使用tslib插件  6 ^% \1 D+ Z( B% O  _$ Y& a
4 n# ^0 q* S! R  _1 l
然后就可以运行Qt程序了
+ u  u" V4 A- ~( b; Q3 O# A6 x/ _' @
4 ?. V9 y" B" q* |, {5 x以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。
0 y- g" z  D- T$ ~0 p/ F/ u5 S; V) l: x1 J8 L# _' y
附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节)" S) a. U' \7 p
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。2 r9 ?/ J5 N# K/ q- M
( n3 E# [! A8 F% V- y
首先安装opengl支持(mesa3d),9 B5 s' v7 x) _. Q; m5 a9 M

1 k0 y' m( ^; C5 p% ?: C' ][html] view plain copy
$ n3 [9 Y8 a) U$ Lsudo apt-get install mesa-common-dev  libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev  
( f' N0 F/ s8 h# `" F7 n" x如果需要,再安装Qt D-Bus的支持。9 s9 Q8 W& f% Z
7 e9 Q1 O7 m7 K4 `
然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。
* B% U8 ?: _, |; J/ T3 q& Q
6 M& T7 r2 Z# A& l& ~+ L[html] view plain copy
! \2 _9 w3 ]2 d& v% h+ l8 H9 i./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl  
! e- e) X' r# b5 y+ G" c配置结果为:
+ G5 `- S$ s- Z* U: _1 E& a& [7 Q5 f. ~6 R+ V1 e
[html] view plain copy
- ?( o& B  {( b( A- N/ j   Configure summary  
" _- q3 K- x. p. Q0 g, m  + w2 n( R9 z) l2 e, A1 v
Build type:    linux-g++ (i386, CPU features:)  
% x$ ?/ r, U- L# |2 ZPlatform notes:  ' ]: ?" X/ }8 O+ m9 A% i7 z
  : W( p7 X9 H$ E4 u. G" v
            - Also available for Linux: linux-kcc linux-icc linux-cxx  8 Y) }' ]5 o- c6 b7 Z
         
, A  y) W5 Z0 t5 p. yBuild options:  3 U7 Q: S* ^! d* C3 J3 R
  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   ) U: F0 j1 [/ @) U
  Build parts ............ libs tools examples  
4 x1 ~: Q: ?' @2 n9 g  Mode ................... release  
+ m8 {" Q" h1 p( Z5 x  Using C++11 ............ no  2 h* I. Q# r5 `
  Using PCH .............. yes  
; k4 {5 R7 E: W' }7 y$ J: u  Target compiler supports:  . p* C- e/ Q8 \6 a2 C: _* }5 H  B+ K
    SSE2/SSE3/SSSE3 ...... yes/yes/yes  . m2 N5 _4 c) P
    SSE4.1/SSE4.2 ........ yes/yes  
7 f" C: n. S0 _4 o    AVX/AVX2 ............. yes/yes  - U* w! }7 U, k
  
4 e& w" `& n$ O6 q/ |/ VQt modules and options:  + ~6 s- ^4 F: q5 J. n
  Qt D-Bus ............... yes (loading dbus-1 at runtime)  " V6 @7 Y( r' _; Z, P/ R  S
  Qt Concurrent .......... yes  
0 O& h2 E# G/ i  Qt GUI ................. yes  / b& b! J! i) W7 u! k
  Qt Widgets ............. yes  ' E8 m5 ~6 X6 r: s' o. m
  Large File ............. yes  
! t6 `# q+ D  X" u0 |* B" F  QML debugging .......... yes  
& @" b2 u1 a: q( Q& T6 V. }7 k  Use system proxies ..... no  
* C7 q4 ?) y, ^- k) |2 }; w8 N  # L! h4 G, E0 N
Support enabled for:  & H1 z- R* U; _! S9 v! [: L/ x  m! R
  Accessibility .......... yes  
. u1 }8 i* q$ Y& a  ALSA ................... no  
2 r( d$ n# O2 j+ ^  CUPS ................... no  5 B9 a) F: [8 m
  Evdev .................. yes  
& H3 k7 J' C. w$ g  FontConfig ............. yes  
. \7 U( z: b1 @  FreeType ............... yes (system library)  
1 l( W2 [( T  f  N1 y4 c+ q' s6 c  Glib ................... yes  " L$ l2 W( d1 J# S8 R7 H4 W/ M
  GTK theme .............. no  
! P( |4 b1 _' M1 \  HarfBuzz ............... no  
/ z: V' g' x. M: u, F* `8 T  Iconv .................. yes  ( K( E, T: E8 `- [9 k
  ICU .................... no  6 ~" m$ J# N, z- ^- ^& ]1 i
  Image formats:   
$ S, u$ g  z! N4 }0 @2 j; r    GIF .................. yes (plugin, using bundled copy)  
& v! b7 \. W% s0 E: b# p, B& U    JPEG ................. yes (plugin, using system library)  
6 k' N2 c( }$ j    PNG .................. yes (in QtGui, using system library)  0 v9 h/ s" _6 B  [$ G
  journald ............... no  $ P8 i3 u. x7 C, Y
  mtdev .................. no  
2 a* N/ R1 n1 z' ~5 e7 w8 o  Networking:   
- f) {- T) n: v( v3 {4 I    getaddrinfo .......... yes  2 |; h/ C6 _/ p0 B
    getifaddrs ........... yes  
! j. E9 y) D) S8 m" i6 b9 P8 h    IPv6 ifname .......... yes  ( D$ n% F: A: {6 h9 G% X! d$ t
    OpenSSL .............. no  ( t: ]; p! D, D5 m- K
  NIS .................... yes  9 A7 l, e: L( c( Y& H
  OpenGL / OpenVG:   
( N' X+ l' M! `  Q: Q- @    EGL .................. no  
% W* R& D2 e8 x+ y- B; J    OpenGL ............... desktop  
( v  _6 n% f- e    OpenVG ............... no  
1 k. r' ^( Y1 |; U  ]& ]! O  PCRE ................... yes (bundled copy)  9 H3 [' [9 d7 v4 R) Y( X
  pkg-config ............. yes   1 v/ t$ ^$ I" {& I
  PulseAudio ............. no  
' L4 u, S8 w0 n. ]  QPA backends:   ( T( d6 ?& W. X0 D5 b! _
    DirectFB ............. no  
5 F7 W0 ^7 Y% k0 r8 ?1 h    EGLFS ................ no  
. M, ~4 K( G, K( u    KMS .................. no  
. B% W& L$ j) b2 k1 f0 Q    LinuxFB .............. yes  - }% Z$ t) V2 y/ n- s; v- T
    XCB .................. yes (system library)  1 h* v5 S' Q5 d4 o6 i- M* y; |- q
      EGL on X ........... no  ) y' J# `1 G, Y
      GLX ................ yes  & j' n+ x. u+ u" k. @, q
      MIT-SHM ............ yes  ! K: ~: h4 M' _0 ^, p+ N) @0 g* O
      Xcb-Xlib ........... yes  3 J% F* @9 K7 _; j3 @# J! i
      Xcursor ............ yes (loaded at runtime)  & ~$ q9 ]6 J+ u% n
      Xfixes ............. yes (loaded at runtime)  
( S( M) P" ^$ m* R3 k9 l      Xi ................. no  
1 U: B$ o" F! M: ^8 @0 g      Xi2 ................ yes  3 n/ t- i+ x& q8 ?5 j# r
      Xinerama ........... yes (loaded at runtime)  2 V) [) h, U/ |' L  T/ s8 ~
      Xrandr ............. yes (loaded at runtime)  * W6 |8 `1 P0 J, F. m
      Xrender ............ yes  
! Z* Y7 g- {! @$ Q5 x6 ~      XKB ................ no  
, r% h- A( V: |      XShape ............. yes  8 `5 L" F: B. q  m& v" h
      XSync .............. yes  
4 e3 u7 |" |4 x2 Y& M" L3 C: d! q( v) _      XVideo ............. yes  
: r! w. T6 [; l( {  Session management ..... yes  
( @7 `* W7 u& \( N  SQL drivers:   $ ]0 v% v% m0 D! \5 ~+ i1 |- r: _
    DB2 .................. no  
  y1 w6 c; [, n# W6 P, s6 b: s    InterBase ............ no  ; {: h% i; S# D$ [: y; L0 N
    MySQL ................ no  
! w8 H/ y5 Q# ?8 X    OCI .................. no  ' z( w' t: H2 C. |: k! N
    ODBC ................. no  
, `7 h) d. [9 r/ R: a/ l    PostgreSQL ........... no  & O6 n4 ]8 T& ~" f
    SQLite 2 ............. no  
; t7 @. Y5 Z3 _    SQLite ............... yes (plugin, using bundled copy)  
% l8 F" j' `- T4 A    TDS .................. no    Z; x( B& C% e
  udev ................... yes  $ i3 B+ g& Z, x$ S9 a
  xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)  
! J& J/ Q5 q5 T4 L5 V- d1 }& O+ W  zlib ................... yes (system library)  
/ C. c( N0 g$ S) O  0 b9 F; i  `; g1 e9 Y9 d; a9 `" a
NOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use   
4 \7 _2 Q) m: X9 wthe bundled version from 3rd party directory.  0 O7 N& W& _7 ^. `+ o: A4 j( x7 E, C
& e8 b& K6 Y, w
最后make和make install即可。$ }3 p2 V1 }4 i6 V# P6 c& r+ _' L

3 W; Z% u; L! o7 z- W# c7 @) A
7 [8 h  f& v( o% T$ ]& n" ?/ |另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:
% _# v5 u5 f4 L4 K7 Z, X1 h5 b0 H! B' `- ]
进入已经编译过的Qt源码顶层目录,输入
# L9 V5 w! F2 A) w. Q[html] view plain copy
! f2 A4 J& ^! U$ make docs  8 \9 v3 y( c; @  I1 W! U
这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录)
/ ]/ F- N) U+ Z! o0 ~  R3 ]+ `% D5 ~[html] view plain copy
- M& G4 L  Z# i$ b. j; r* t2 i$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant  
6 }3 Q6 F$ b" Q& e0 t6 T8 ^$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant  
, V; n5 g( x( E$ g! W7 M然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。

本版积分规则

QQ|一淘宝店|手机版|商店|电子DIY套件|一乐电子 ( 粤ICP备09076165号 ) 公安备案粤公网安备 44522102000183号

GMT+8, 2024-4-19 05:32 , Processed in 0.054917 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表