一乐电子

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

QQ登录

只需一步,快速开始

微信扫码登录

手机号码,快捷登录

手机号码,快捷登录

搜索
查看: 5678|回复: 0

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

[复制链接]
发表于 2017-6-16 22:27 | 显示全部楼层 |阅读模式
1   平台说明
! B' G0 p+ F0 o& G主机平台: Ubuntu 14.04
5 q8 Y; m4 O- v+ i
5 ?% y# A2 x1 u; ]% ]2 w: w" ^交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz
  k2 \& n) `- |& c目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤)
. M9 Q$ H4 M& E/ [: }( ]+ `& l1 F( V& C& n2 |& e/ R
Qt版本: Qt-5.3.2
7 I( ^( V% A! k, C  g# c; v) s% S  n
2   Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植
/ u$ L9 c/ ~' V4 e7 `0 M' }进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。
% d% M3 b( x7 `: c6 ~2 V
. B/ Q4 U9 G) t3 q& w- D( h, @$ ./configure --help >help.txt ; vi help.txt
0 B, t+ I' G+ }' f
4 Q3 Z/ e5 t9 N. I% G
0 Y7 g4 X. Z. Z2 Y5 B4 \+ z配置时需要注意的几点是:
5 F9 p. y) O9 @
5 A: [& ]2 R2 ?' e如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;
# o3 t8 L" ~  D% m9 {, B) Y( g2 Y, H/ ?* n. p
最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;
" z2 y3 u/ P  A( S# r: k* h8 c' h; p
如果需要openGL,就需要用 -opengl选项指定opengl的api,对于嵌入式平台,一般使用 opengl ES2,配置选项中加入" -opengl es2 " 。不过想使用openGL可能会比较麻烦,因为openGL一般在有硬件图形加速的条件下才能高效运行,而这需要显卡或Soc厂家提供openGL的支持库,但并不是所有Soc都能找到对应的支持库,比如三星就没有提供S5PV210的openGL库,所以我这里编译的Qt也是没有opengl的。(openGL的替代方案:如果没有厂家提供的硬件图形库,可以考虑使用纯软件实现的opengl,这样的软件库有很多是开源的,如mesa3D库等,不过纯软件实现的opengl在效率方面肯定要比带硬件加速的低很多,而且要想在嵌入式平台上使用,必须将opengl的软件库也交叉编译出来,我在交叉编译mesa3D时遇到了些问题,所以目前还没能在开发板上用上openGL);
" Y2 q/ `2 z4 @  n3 k3 |8 x# a
0 v. \3 @6 I! h5 m- z/ U如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;
$ Z" z$ ~4 q0 G4 Z& Q9 B6 J0 M
. E# I7 i7 u8 q6 {3 E! r" C( j- ]另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。4 O2 q8 n$ H. c/ e( l. P& b) l
4 a( d$ ?# n0 ~
我的编译过程如下:, i6 T5 i0 Z) a4 \/ X5 V6 S

" l$ @/ s% ?+ H! {首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:
* x2 d  P. h' H
' V  ~! Q1 z: Q' J: @[html] view plain copy, g. P/ }" z+ {2 B( I% {
#  + U, [3 @  L# T
# qmake configuration for building with arm-linux-gnueabi-g++  : S& F( @6 I: t: R' j
#  
  B5 {. O4 B6 j" C; i, e  ; ^# L' z! T! g9 B1 \5 H' Z# U
MAKEFILE_GENERATOR      = UNIX  ; n2 [$ O3 s: [* k" d) g
CONFIG                 += incrementar gdb_dwarf_index  
# E2 Y; E8 H& |( N) D0 {1 VQMAKE_INCREMENTAL_STYLE = sublib    [( w4 {7 T; L" U/ _. R- X1 P# D( }
QT_QPA_DEFAULT_PLATFORM = linux #eglfs  
1 V( P4 C! L6 k4 X9 W  cQMAKE_CFLAGS_RELEASE   += -O2 -march=armv7-a    , F6 z4 z5 ^: B4 v
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a   
+ p7 h1 x+ [" o. y" l( o  1 [7 V8 a; C' `
include(../common/linux.conf)  # `( D) p, y9 o' t/ w) p1 J4 G
include(../common/gcc-base-unix.conf)  
( {, T+ b/ p* y( x0 ~) sinclude(../common/g++-unix.conf)  / C& b4 H; H' C3 f
  + i! R) Y, W7 _- |+ U
# modifications to g++.conf  9 k, F& _. h0 J' X* B. I7 a
QMAKE_CC                = arm-none-linux-gnueabi-gcc  9 R" f1 X+ }. J! U2 I9 f
QMAKE_CXX               = arm-none-linux-gnueabi-g++  
1 t) Z7 i* b3 N3 X9 u* p2 D" ?QMAKE_LINK              = arm-none-linux-gnueabi-g++  , q6 D( Y( x) E, |. Y0 G) k" P3 |
QMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++  0 s, E+ |* g! F. ?" U' S3 z; B
  9 s8 z1 {# |( U
# modifications to linux.conf  ) O3 W. v3 l* ]
QMAKE_AR                = arm-none-linux-gnueabi-ar cqs  
( g! i8 d5 c4 O+ u3 N( }' d: KQMAKE_OBJCOPY           = arm-none-linux-gnueabi-objcopy  2 o$ ]2 t; s7 r+ K2 y' i/ {
QMAKE_NM                = arm-none-linux-gnueabi-nm -P  / ^. Z4 f. X4 R0 ?; T* ^1 y# Y3 ?
QMAKE_STRIP             = arm-none-linux-gnueabi-strip  
! p8 Z- }& X- m$ c, g7 pload(qt_config)  " w3 N+ t9 e) E3 @1 V9 `6 o/ c: O, m

" N( R; m9 x  a1 k1 ?( U
; a: {% {! B+ P  R3 c0 Y然后执行:) J1 o& A" E5 K4 H! e
[html] view plain copy6 |) E7 \1 f5 c
$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float  $ Y  n5 r5 ~2 O: l
配置结果为:
4 _$ I0 u" g) [
6 j# _% ?$ `1 m1 F5 ]$ |# G[html] view plain copy
# f4 Z" D# H" y2 W4 @   Configure summary  
& Q- u+ t! G/ z# M) S! x( f  
. |6 Q1 i3 t9 m2 V; o, I3 kBuilding on:   linux-g++ (i386, CPU features:)  
& g& h, a4 c" M, H/ K" Z1 S7 L  nBuilding for:  linux-arm-gnueabi-g++ (arm, CPU features:)  3 j/ A0 n5 M" l$ L9 I. u" g
Platform notes:  & W( a  e2 F- u, p
  
! Q2 D2 b  O* |6 ]            - Also available for Linux: linux-kcc linux-icc linux-cxx  # h* ~3 m" H: F8 {) Z5 g
         
; P/ _/ }3 g* f/ n, yBuild options:    Y* q* y5 W& `, C4 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   
. U5 J8 D6 |2 ]* U" E3 r; |  Build parts ............ libs examples  
: S- i* y0 h, T  Mode ................... release  
8 _6 K/ Q3 j2 v8 Q4 c  Using C++11 ............ no  " C. w* C& [# {
  Using PCH .............. yes  
1 @/ @: l" ]& W) x: l+ r+ V  Target compiler supports:  ) k( x7 `7 z2 i' D
    iWMMXt/Neon .......... no/auto  
; d& @6 \6 n! a7 s: V  5 b! ?# \/ k' |+ Q% t
Qt modules and options:  - H$ p. _9 @+ I
  Qt D-Bus ............... no  1 n8 ]' z0 q% s; K
  Qt Concurrent .......... yes  - p3 A/ s* l1 i4 ?* M" g
  Qt GUI ................. yes  5 D) Q0 }2 l2 @5 V4 F
  Qt Widgets ............. yes  
) P- b5 g$ `# [- E  C- i1 F& }% D) _  Large File ............. yes  ( e; Z5 T* P5 a! V
  QML debugging .......... yes  6 q$ z2 F1 e6 U- O6 h/ h% w1 z' Z
  Use system proxies ..... no  
( G- u7 T' |9 h# k0 r  + U, B' A! W  l( _2 {7 |
Support enabled for:  
4 L  {" x( J  s& ], z  v1 p  Accessibility .......... yes  / }4 o, m; C. E& q
  ALSA ................... yes  1 T! u5 r# U5 Z5 T
  CUPS ................... no  7 t9 W7 a! n! t7 s. I
  Evdev .................. yes  " {* i0 v5 f6 Y" ~8 N" u
  FontConfig ............. no  ' U# ]. p3 l) p) |* X6 \. k4 \( ]
  FreeType ............... yes (bundled copy)  
& @; Z- u7 s) J% I2 ?) a+ d  Glib ................... no  , J! x* q# J1 A; g8 Q* e
  GTK theme .............. no  
$ w7 M( q  V& X+ O/ J9 e6 w5 |/ a  HarfBuzz ............... no  , c3 v& R, B' [- N
  Iconv .................. yes  2 e: [" X! [2 Q4 Z( y8 R" k
  ICU .................... no  
8 R, p: ]6 \+ g1 y  Image formats:   1 c; G8 E0 x+ ?0 `& ^1 B
    GIF .................. yes (plugin, using bundled copy)  
/ h. \% Y8 s( r+ [" X( w8 h' S    JPEG ................. yes (plugin, using system library)  
1 _' B7 I; Q& N) Y. U/ p    PNG .................. yes (in QtGui, using system library)  
- P" O0 \6 C" _: C7 t! z: T* k! G  journald ............... no  % g7 X1 K) M: o3 E' M
  mtdev .................. no  
7 V& w& j( {- q  k; u& _6 _  Networking:   
) k! |& b9 X4 ^    getaddrinfo .......... yes  
$ j- p$ m8 z7 D7 K3 @9 U    getifaddrs ........... yes  , z' @: x: O" R; Y' c
    IPv6 ifname .......... yes  
6 k5 N+ m: {8 i- k    OpenSSL .............. yes (loading libraries at run-time)  
  s0 s3 m+ P+ y) @  NIS .................... yes  
& p' P$ i# Z0 c5 T  OpenGL / OpenVG:   9 R3 A8 I+ w1 P  r3 @
    EGL .................. no  + T0 q$ P: ~* [5 H0 E% y; B
    OpenGL ............... no  
9 o% B; w7 [' B    OpenVG ............... no  
' [! L9 {6 i( D7 C! K; f4 Z. W  PCRE ................... yes (bundled copy)  
# B1 }& ?3 X% }! Z8 ]# ^* b  pkg-config ............. no   
& z+ h/ h  `5 [/ c0 E" A2 G" q  PulseAudio ............. no  ! n3 h# D2 M5 m8 I
  QPA backends:   
: I! H, Z* O; j6 C    DirectFB ............. no  0 X2 E1 J4 Y; D4 h8 L; W
    EGLFS ................ no  
( q, x* L  X) m" Q- L    KMS .................. no  9 h! |4 \7 @; e/ s& Q# W
    LinuxFB .............. yes  5 ?$ ?& e4 m6 p4 n# `, j
    XCB .................. no  
) P+ v  s- z, h5 V  G+ s; g* [  Session management ..... yes  + Q! p4 N' x6 G( c& Y  l- j* {
  SQL drivers:   2 n9 {2 e- R/ \- Y8 L
    DB2 .................. no  ; Z5 d2 p( L7 X5 h
    InterBase ............ no  : s7 K; P6 U6 p. i7 T+ H, `0 c1 c
    MySQL ................ no  6 p5 G+ I, r5 C" F# P4 v
    OCI .................. no  . S2 O3 O" M/ g$ j: g3 |4 m
    ODBC ................. no  
- S6 l1 V! _6 B    PostgreSQL ........... no  0 j1 k& g$ |# ?# r( e5 h/ F# p
    SQLite 2 ............. no  & Q1 c; n  a8 y
    SQLite ............... yes (plugin, using bundled copy)  
( ~5 \7 Q3 Y' K' |, h    TDS .................. no  
' {$ c9 `3 ]0 r9 J  udev ................... no  
$ K) w1 p. M6 C6 M0 b3 H7 q9 T$ c  xkbcommon .............. no  4 m6 r) X+ `- r7 c
  zlib ................... yes (system library)  
! a5 z$ U7 o' E; T( u  S+ }# y1 ~5 O4 E  i) r% R3 z8 s

7 b. ?. u, p6 j! l4 t3 p0 N配置完成后执行:/ e2 i6 a1 Q" q% f# k$ q! `
[html] view plain copy
% C, [$ E, F2 [% z) x0 S6 ~$ make -j4  
, [% i' w3 w9 C+ F5 k+ z$ sudo make install -j4  
# M4 L1 p5 z) t5 I: e  C' D+ _' Q: J+ \" B, O; D6 L+ c2 R
3   添加 tslib 支持
1 U  ^4 v) N4 Z/ y# f6 E为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:( u( Y: |& r6 l2 E, c6 ~* [& O
1 N" H: S5 f* C+ l" K& r* l
http://blog.csdn.net/newthinker_wei/article/details/8639276. \$ y1 A5 @3 w% T  u/ [/ F
友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。
2 f. X% n6 y2 `* H& F$ ~4 n
% e- T" u/ g! c3 O, z! N另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:
% Y" }/ E) z# X9 P2 K: n" n5 m3 r- y9 B" M& o3 y
http://www.arm9home.net/read.php?tid-16105.html
8 M7 F# D6 F7 d, W) K+ |4 m* ?+ n, ]: A5 ?1 C/ K# x
注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植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工作。  F1 b, s7 }# d: u! ^' B
将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:
. N- H4 |" {3 t$ {4 g/ _7 @+ f; G, S7 Z2 {4 s* H# _  c: r. F
[html] view plain copy
& X$ K3 V6 \+ B" {; I  r, g/ c' ]1 Z#! /bin/sh  
- L% v. a& s1 K' e# "source" this file when wanna run a Qt application on the ARM Board.  5 P# ]4 v9 H1 ^5 B
  - c0 i! E) s% o
###############  the below lines are for stardard TSLIB ##################  ! M/ N# A0 e- J
export TSLIB_ROOT=/opt/tslib  
3 C7 Q4 f# d4 v: Z) iexport TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal  
3 S+ m. R$ q1 N  [" gexport TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf  + s6 _- N+ x7 M% y7 e
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts  
! d; c/ x& ^8 K5 A+ o# lexport TSLIB_TSDEVICE=/dev/touchscreen-1wire  
- Q, \: U) i; {& `#export TSLIB_TSDEVICE=/dev/input/event2  5 j# P% g9 {: p/ C" C
  ! ?7 }. j8 u* D1 R2 z1 Y
################  the below lines are optional ##############  
8 o, Q3 _8 v5 e$ ]( r#export TSLIB_FBDEVICE=/dev/fb0  $ A/ O+ l( m) Q' _& j& J: u
#export TSLIB_CONSOLEDEVICE=none  1 B- ^, D+ p' l6 w* e8 S
! p  Y. N8 W9 ^& Z8 X. p
此外还要修改 ts.conf文件:
# P; k; l  O5 Z, d& Q& o0 m[html] view plain copy
- A4 b/ E! U1 t4 Y#module_raw one_wire_ts_input  " }8 @4 F7 N" s4 x
module_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中  
8 J% `( j1 L0 E+ {9 F! n+ r  
1 K3 B# ]( j$ h. G: O# H9 }& X/ Omodule pthres pmin=1  & ~- n5 X. [$ q- b4 J
module variance delta=30  
; n0 A6 s& g/ _( C2 ?module dejitter delta=100  
) J$ i' O6 J& ^, H1 B# U7 X& j. M  w$ }module linear  " b2 a$ @5 T  D( y3 c) _
到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。
* j. |+ X/ x. B! {, y# K' B有了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"这个库文件了。
# O+ f+ Y( k" i9 `  Z1 J+ G+ j+ Z/ H3 k' @! o/ A+ g$ I0 c  [
4   运行Qt程序; ]% q: I% i5 r$ i, E7 |
需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。
! }2 \/ T8 ]4 y" X5 |# [3 @
3 S$ A: C* O4 u9 `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% n$ M% g7 n# ^8 H# @8 W
, n2 N' [2 h6 n+ V9 f/ N. Q
编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:* @! E2 L: \6 j# P0 Q
, o# }: C3 T* {* |/ ]1 d. }$ Q
[html] view plain copy
* x0 s- H0 T2 B! D/ R  X. |  [export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms  8 M) {9 L  ^4 B$ a: c' C# M6 V
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0  
9 D+ s" f( G' I6 m' o7 cexport QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts  . n' p1 A# D9 S' G# c
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire  #使用tslib插件  0 @) o3 S5 S' q% L3 G" F
, \" Z8 y2 S- F
然后就可以运行Qt程序了! t" h' H* _  c* n! u2 W. I/ Z
% J3 d: F- W4 I! p$ F
以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。
6 U% K* l# d/ Z8 J
, n  U9 P& P: h9 a' Y+ \# N附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节), ]8 E) [' S' C2 S. D+ E
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。
. v: Q) S) R% ?: r
. B9 o9 x9 I7 H4 a9 j首先安装opengl支持(mesa3d),
) B; w  w/ \0 c% T8 y$ z, u- Q" G* c( Z. {1 d9 ?
[html] view plain copy
) C3 K& k% b1 C$ V, Osudo apt-get install mesa-common-dev  libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev  
2 A0 K1 y5 s: ?+ i6 L如果需要,再安装Qt D-Bus的支持。* A* R% R& }  |
- g3 T$ N+ S$ \% E4 f
然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。
; Q+ j& j4 N, g! x8 O
. I! t; `! V, U/ U+ F$ t+ y[html] view plain copy
$ K& u+ q3 L6 }./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl  ( |' I6 j8 o4 K0 M: L% A
配置结果为:
6 E& _& f$ R, ~3 f; D8 b* G  c4 N3 e; J2 O" s4 Y/ Y, E
[html] view plain copy
9 W6 i4 G# T: e( l   Configure summary  8 n# ?: W* I/ V: [
  
  s) l/ ]6 u* R+ _, p, I! q: NBuild type:    linux-g++ (i386, CPU features:)  
  M/ W6 c; ]8 u! \0 YPlatform notes:  
9 J( \; m* H; s" m. @4 v  
% f8 v0 Q6 s3 P            - Also available for Linux: linux-kcc linux-icc linux-cxx  
* D& T, [# d5 Y7 U          0 e! v" I1 q5 F1 m! G
Build options:  / `: @! k" J9 e: d0 O" C! K
  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   
! O. s0 \, ]! i  Build parts ............ libs tools examples  & r. ]9 s$ C( z
  Mode ................... release  4 b0 F$ L# g, r3 q$ e  b) v
  Using C++11 ............ no  ! x! T: K( k/ [2 ~$ `2 _
  Using PCH .............. yes  3 L9 M: R+ L  B3 B  @9 |
  Target compiler supports:  " v8 H* @( c8 `$ j% ~5 U
    SSE2/SSE3/SSSE3 ...... yes/yes/yes  1 ^5 S3 A; w$ c  _/ R5 P
    SSE4.1/SSE4.2 ........ yes/yes  , I  n5 E( r6 T3 |9 |  B
    AVX/AVX2 ............. yes/yes  . M$ ~4 k' o3 Z1 U( h' y
  ) R0 H" h# J0 B- Q( r; I5 i
Qt modules and options:  
. H4 d& I) f6 \7 Q# J" v; Q  Qt D-Bus ............... yes (loading dbus-1 at runtime)  
- R# I* [6 Z2 ~/ ^  Qt Concurrent .......... yes  
/ I! l* {& L8 G7 e/ N4 O3 `  Qt GUI ................. yes  
  v; c, i# T- `$ B  y  Qt Widgets ............. yes  
6 L! [' O% b3 x1 b  Large File ............. yes  
) l6 R. x* y; [0 K- R  QML debugging .......... yes  . W: \. B# l, D( n
  Use system proxies ..... no  6 i, w8 k/ z9 c2 r, R# @# K
  
6 {7 _6 [" L6 iSupport enabled for:  
, p# h- o+ z2 n* V" N9 V, M. q( Z: P  Accessibility .......... yes  , r& |9 }# Q2 c6 n: Y
  ALSA ................... no  7 v+ Z0 ~, B3 e
  CUPS ................... no  
: c* m4 H! ^8 s8 ]  N' G6 g% ?  Evdev .................. yes  
8 W& G. u) @* p+ F/ M' x  FontConfig ............. yes  
( u1 J" t% i2 f, [- ^% t  FreeType ............... yes (system library)  
2 w: m# c- U/ y7 f3 c  v" t2 f  Glib ................... yes  
4 i6 D3 o0 C/ o  GTK theme .............. no  
6 {5 o7 e/ Z3 Q* n/ h  HarfBuzz ............... no  
- N+ N2 k  h! |' E  Iconv .................. yes  
7 [* t5 a& u+ Y  \/ ^. R; Y  ICU .................... no  
$ D* U" w) A7 a0 X  Image formats:   * P) w! }* F# a! y& t2 D/ j
    GIF .................. yes (plugin, using bundled copy)  
9 `+ M7 d4 w0 |! C    JPEG ................. yes (plugin, using system library)  , R$ t) Q. t  g, `
    PNG .................. yes (in QtGui, using system library)  / W' F- B9 q+ ~  N
  journald ............... no  
5 ]# B6 @& Z6 ?3 E  mtdev .................. no  
+ A* P* s* A$ T  Networking:   8 s* D2 B: |: o# N
    getaddrinfo .......... yes  9 [; |5 |% q  [* }' K8 Q% q' q
    getifaddrs ........... yes  9 @( Y% r# O- L7 k
    IPv6 ifname .......... yes  + u% F+ x4 A2 G) m$ y9 s
    OpenSSL .............. no  
+ p/ e5 t" p' y$ X9 X% u6 O, I- k; s  NIS .................... yes  7 [3 Z" [8 F% S
  OpenGL / OpenVG:   
8 v1 c+ J) B7 G' K& {# x& e    EGL .................. no  0 x7 e7 f" c/ H5 W/ ~# F' _
    OpenGL ............... desktop  
9 y6 `! `$ ?2 F    OpenVG ............... no  8 X: w% X/ C% W4 U( ^/ D
  PCRE ................... yes (bundled copy)  
% A: I1 W9 z, {/ D  pkg-config ............. yes   
( _" z; H" n3 s  PulseAudio ............. no  " D" D1 }; h6 f  K( z
  QPA backends:   
' r: Y' n8 z6 e7 p' C0 G    DirectFB ............. no  7 J* m8 k8 h; f* |
    EGLFS ................ no  
- ~- l! b$ i4 |" ^    KMS .................. no  
" |3 I6 y4 B5 H" _, j: d2 [    LinuxFB .............. yes  " a# `! j* j* ]
    XCB .................. yes (system library)  
+ i9 L0 m  R& O& U2 p      EGL on X ........... no  
+ P: t* E3 b, s# U; D5 s      GLX ................ yes  
& P0 i/ e- u+ e1 Z3 b. I      MIT-SHM ............ yes  
: S5 A" G6 {' y8 @2 a      Xcb-Xlib ........... yes  
% B, l2 _/ ?% L) ^0 Y! D! `      Xcursor ............ yes (loaded at runtime)  0 h* V5 C8 @% W/ X- I' _
      Xfixes ............. yes (loaded at runtime)  * Z; K& s9 ~3 w
      Xi ................. no  
3 i: Q& z! J* P' A      Xi2 ................ yes  
4 v3 G& d' ?5 C9 k/ ^      Xinerama ........... yes (loaded at runtime)  $ ^: E9 o5 c( t" f  V- ?# W
      Xrandr ............. yes (loaded at runtime)  
, m' a9 @+ A3 N  N0 q& p  k; w      Xrender ............ yes  5 X, f" A2 F- p! s: ~2 S5 c# h5 s: }
      XKB ................ no  . n" j5 ~! ^6 N4 j
      XShape ............. yes  
, L/ j6 U  y) D% N) u3 i      XSync .............. yes  
# `0 h! t2 A  ~      XVideo ............. yes  % S6 p& D! @* v9 V, [2 u
  Session management ..... yes  . ^! [8 I2 `8 N- e; ]( \: S
  SQL drivers:   ( H) ^1 m$ Z+ I
    DB2 .................. no  / S/ j! R/ G) P  D, C0 X7 X! k
    InterBase ............ no  6 L/ A6 I- D' j' m
    MySQL ................ no  * k9 k9 ?/ `9 i5 S2 }! U
    OCI .................. no  % _+ A* U* U8 {4 z' D
    ODBC ................. no  
6 b# N. b3 S4 N9 ?7 P    PostgreSQL ........... no  ' `4 }% i3 {# q& m8 ^, C7 c3 \
    SQLite 2 ............. no  ' D& ?# U" {4 h3 A" A* f0 r
    SQLite ............... yes (plugin, using bundled copy)  
! X' l2 _8 D! g0 d; h    TDS .................. no  
6 S: Y, T6 I2 [2 _3 @  udev ................... yes  6 O5 ]! j3 l4 w5 A
  xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)  0 @! S9 v! C7 h
  zlib ................... yes (system library)  
! P+ d7 B1 b# P7 R, R  
% k8 [, E# v5 j$ U: d9 iNOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use   % s6 B$ M1 Q+ u- O* t! ]; ^
the bundled version from 3rd party directory.  1 o1 z* @; f( O4 \9 U  F8 g, o& y

# `8 |9 n' w4 W# E9 e最后make和make install即可。7 Y: m, T* Y5 x  Z
1 W' F  C; f; d% N3 y2 D$ \7 k7 u

3 _2 x& }8 V" J. F# c另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:. F: t3 u0 |* c. y: Q! z3 c$ C
3 M; D6 L9 l" s# u
进入已经编译过的Qt源码顶层目录,输入
4 Q9 i# W4 n, c) i9 c- _$ h' i[html] view plain copy
" ]) I4 v5 \0 }2 L. [$ make docs  , p# R" g2 ~1 E( V/ E( p3 O4 q
这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录)0 I8 z  F/ f, h: L; {* H
[html] view plain copy/ [* Z6 F( Q. @* d9 h- N- k
$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant  
* ]  F# C5 A5 i0 v$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant  ; s1 v" V  X; W4 ?
然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。

本版积分规则

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

GMT+8, 2026-4-17 16:25 , Processed in 0.036416 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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