一乐电子

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

QQ登录

只需一步,快速开始

微信扫码登录

搜索
查看: 5066|回复: 0

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

[复制链接]
发表于 2017-6-16 22:27 | 显示全部楼层 |阅读模式
1   平台说明
6 ]" d9 c, a( C5 k, J+ B6 @主机平台: Ubuntu 14.04
4 I7 [' i6 O2 q  b5 I6 _9 @' q  O7 R9 ]( D2 [4 Z9 c6 A1 S0 x4 x
交叉工具链: FrendlyARM的 arm-Linux-gcc-4.5.1-v6-vfp-20120301.tgz1 h5 b' B& x& y, t7 W+ Y
目标平台:FrendlyARM的Smart210开发板。(Soc是三星的S5PV210,内核是cortex-a8,下面的移植方法是普适的,不是此平台的也可参考下面的移植步骤)! l0 L- z* @8 Z- M3 ^+ v8 x9 F) d

+ c+ _2 @# J# N3 K9 i- ]1 w/ HQt版本: Qt-5.3.2
* f( d, y6 F% R9 ~9 K! l/ p3 e1 D% H# y. Q8 Q
2   Qt5.3.2在ARM-Linux平台(Mini210开发板)的移植7 Z/ s) \7 U2 v8 s' F
进入Qt5.3.2的源码顶级目录,按照linux系统中自编译软件通用的三个步骤依次执行 ./configure 、make 、make install 即可完成Qt5的编译安装。在执行之前,首先看一下configure的帮助,了解一下各个配置项的作用。
* O1 e4 I8 |! w- A, g  L* ]$ y& _
$ ./configure --help >help.txt ; vi help.txt9 x- O, n+ @4 Z" W+ j! u& f( i* Q

$ Q! ?' T$ Q6 ~& \
7 L+ ?5 Q; S' a8 n配置时需要注意的几点是:
- a! \' m" m4 f$ J& `' g, Z+ ]% I5 J  m" e, Q% I
如果是交叉编译,需要配置 xplatform选项,比如要在arm-linux平台上移植Qt的话,就在配置项中加上 -xplatform linux-arm-gnueabi-g++ ,Qt5支持的交叉平台都可在源码顶层目录中的 /qtbase/mkspecs/ 下找到,每个子目录名代表一个交叉平台的名字,移植Qt时应根据自己的实际情况修改平台对应的子目录下的qmake.conf文件,它定义了一些与平台相关的环境变量,如交叉编译器等;7 j1 p% j" r5 D! q# `" w/ i4 K4 n( r
8 d2 @" g% [  ^- z) b  D  |2 Z
最好不要在编译Qt时使能 C++11,一方面你的编译器可能不支持,另一方面使能这一项后可能出现一部分编译错误;
) J7 v+ K# W3 k/ H" l
' R7 K: O1 _& I2 e+ t+ z7 b" g- h如果需要openGL,就需要用 -opengl选项指定opengl的api,对于嵌入式平台,一般使用 opengl ES2,配置选项中加入" -opengl es2 " 。不过想使用openGL可能会比较麻烦,因为openGL一般在有硬件图形加速的条件下才能高效运行,而这需要显卡或Soc厂家提供openGL的支持库,但并不是所有Soc都能找到对应的支持库,比如三星就没有提供S5PV210的openGL库,所以我这里编译的Qt也是没有opengl的。(openGL的替代方案:如果没有厂家提供的硬件图形库,可以考虑使用纯软件实现的opengl,这样的软件库有很多是开源的,如mesa3D库等,不过纯软件实现的opengl在效率方面肯定要比带硬件加速的低很多,而且要想在嵌入式平台上使用,必须将opengl的软件库也交叉编译出来,我在交叉编译mesa3D时遇到了些问题,所以目前还没能在开发板上用上openGL);
) q( L$ \8 D! l" D0 [, I, X# q2 f% |8 B- K# O
如果想让Qt程序支持多点触摸,在配置时可能需要加上 -mtdev 和 -xinput2 选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。在我这里加上这两个选项的话配置会出错,可能还缺乏一些库,所以最后我没有使用这两个选项;; d8 {( \" W' o$ c

8 z/ G) V- n/ _% C7 h. z另外,Qt5默认的qreal类型是64bit的double,如果希望用float类型定义qreal,则在配置选项中加入"-qreal float"。
. P  s2 ]" c& F1 Z9 B5 W; K1 A) A" q1 _0 T" n! b  U" }8 E2 E; F
我的编译过程如下:
4 r" J2 {  }7 v. N. D( @
4 |- S+ C% x4 N8 p8 e首先修改 qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf,内容如下:
4 H# V/ Z: x. A  P! u
& Y$ Q) U; c5 w" C* f' H0 z7 Z[html] view plain copy
! ~5 Y8 O1 p! x. t: M#  6 D2 c7 l1 H$ b0 f  Q6 `
# qmake configuration for building with arm-linux-gnueabi-g++  " b, h6 B6 v9 @8 K8 Y1 V
#  8 V2 z8 S7 Y6 J
  ; v% H" A3 C$ X/ r9 m  j# S' D$ {
MAKEFILE_GENERATOR      = UNIX  
9 h6 `& N9 u+ d5 c+ YCONFIG                 += incrementar gdb_dwarf_index  , T# v/ }9 m6 |( D# J8 \3 `
QMAKE_INCREMENTAL_STYLE = sublib  # V  c7 K2 ~9 E' i$ y
QT_QPA_DEFAULT_PLATFORM = linux #eglfs  
! B9 V9 w* W' q2 }+ g5 L" i. g: b& hQMAKE_CFLAGS_RELEASE   += -O2 -march=armv7-a   
: F! G9 R, }1 L" i5 ?QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a   
, }5 M* k7 [- B  @  + V. o/ n& C" h8 b" o4 j6 Y
include(../common/linux.conf)  
, N7 R2 F) F5 s. Y) B$ [( Sinclude(../common/gcc-base-unix.conf)  + r% h0 v. W1 s. I3 a2 o/ o5 T% u
include(../common/g++-unix.conf)  : k9 _  O( ?! }: [+ F* g2 R
  ) f9 o8 |+ j" U7 P5 q$ Q
# modifications to g++.conf  
7 u" {! f# g+ @' y7 b6 w: Z3 HQMAKE_CC                = arm-none-linux-gnueabi-gcc  - z# v  y" o9 E8 [
QMAKE_CXX               = arm-none-linux-gnueabi-g++  5 m  J2 P4 `' d7 ~4 V& _" ]4 A+ p* u
QMAKE_LINK              = arm-none-linux-gnueabi-g++  5 ]1 s! S7 g. K( p; j2 |* j
QMAKE_LINK_SHLIB        = arm-none-linux-gnueabi-g++  
3 T0 y: T- n: K& C! I6 o3 ^  
6 q( L, n9 Q, ^  A+ q# modifications to linux.conf  
  V' T8 k" E4 L( l2 OQMAKE_AR                = arm-none-linux-gnueabi-ar cqs  . d2 x! ~: U$ o, |1 k
QMAKE_OBJCOPY           = arm-none-linux-gnueabi-objcopy  3 Q# A( y' E. b: B+ R! S* Z
QMAKE_NM                = arm-none-linux-gnueabi-nm -P  # X& i% K% @9 J6 K) V0 I
QMAKE_STRIP             = arm-none-linux-gnueabi-strip  
1 v! ]" l/ c3 U# ~+ ~( |0 M2 vload(qt_config)  
( n8 C$ v5 Y  U9 @% R: w
* Z( J7 M* q$ K$ {+ C
; U2 N1 j. ]& Z7 T4 @4 P, ?然后执行:
7 J- Y2 t4 p" t- G[html] view plain copy
9 s5 m- f9 r7 T$ ./configure -release -opensource -xplatform linux-arm-gnueabi-g++ -prefix /opt/Qt-5.3.2/armv7-a -no-c++11 -qreal float  ) Z1 R5 ~* }/ P+ l2 B
配置结果为:
- {0 ]3 ^; W8 A0 D
( C3 ]/ T% d3 x+ O( d[html] view plain copy
- Z- h. l1 ?' [2 Z   Configure summary  
2 l3 L, N6 r9 w9 f  9 Y7 |- q6 E( {. N/ T7 s# D
Building on:   linux-g++ (i386, CPU features:)  & R. o7 g( j9 S; [" X
Building for:  linux-arm-gnueabi-g++ (arm, CPU features:)  
2 k" |3 ?: {& f4 p) u, DPlatform notes:  * b8 t& X' f0 U9 V
  
6 u6 N' J: d' X- z* [- R- I; _            - Also available for Linux: linux-kcc linux-icc linux-cxx  - }: E  E( ^4 k& T: s( |
         
' P( |3 P9 f  tBuild options:  
; T" `, a6 k/ Y) m0 I  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   ( @2 ?, T" o( A6 H, P
  Build parts ............ libs examples  0 z( y: o5 L3 L/ V0 Q9 p8 Q
  Mode ................... release  
9 S) g1 \; l+ \  n0 U4 d1 s" z  |  Using C++11 ............ no  % g! ]4 e5 ?7 z/ E% B1 Q
  Using PCH .............. yes  
3 i. P: C- `7 N$ @  Target compiler supports:  
3 V3 U5 B0 Y/ `    iWMMXt/Neon .......... no/auto  0 f. n8 o1 ^, l# [$ I  _# Z2 c/ i$ \
  
6 y; m3 W) O& E; IQt modules and options:  + Z- x, S# g8 ]9 |( b0 U& ^
  Qt D-Bus ............... no  9 L8 ~! X! A1 G9 I8 r2 b  i
  Qt Concurrent .......... yes  ( j& c: K  U3 B1 t1 ?$ N
  Qt GUI ................. yes  " h1 T$ h+ J& l' l
  Qt Widgets ............. yes  / J: b' Q) {, t6 Z0 E% G8 B
  Large File ............. yes  + S# i2 p9 u& _  C
  QML debugging .......... yes  $ W  P, t  p6 ^1 w; N! N" M% M' w
  Use system proxies ..... no  
, O  Q6 l& N5 r5 |7 {- l1 ^  5 `% `( j7 w$ [; C' Q7 O
Support enabLED for:  3 K' M' F+ {" t4 s) s
  Accessibility .......... yes  2 @: A) z, u: D4 A8 j+ K
  ALSA ................... yes  # g- {* W" q" G2 N. o; q9 e: k. r
  CUPS ................... no  
1 Z6 J3 t& H, ]- R- Y  Evdev .................. yes  
- z$ ]8 j8 [+ P7 a/ n3 Y7 E4 j) C  FontConfig ............. no  9 h8 G5 k, ~" Q; O
  FreeType ............... yes (bundled copy)  
1 g6 x3 i" E$ r; S: q6 Q  Glib ................... no  2 E- M" j8 O( w" H3 R+ i
  GTK theme .............. no  ' \  p" `8 P4 a
  HarfBuzz ............... no  
  p; ~$ z0 G% Y; {  Iconv .................. yes  ( N' _  a  Y% S
  ICU .................... no  9 p5 h8 u1 g; n+ ~7 n  @# E; K" X
  Image formats:   
* {' ]! q5 }$ b    GIF .................. yes (plugin, using bundled copy)  
- [+ H* d' i8 ]/ B    JPEG ................. yes (plugin, using system library)  
9 }, l! m2 s) s2 L/ O    PNG .................. yes (in QtGui, using system library)  ! {# s" b+ Y* K7 H3 W, `0 S
  journald ............... no  
- }& k( j$ [& V0 Z  mtdev .................. no  % `3 V, }. ?: A% t7 [
  Networking:   
5 U8 \$ G* Q8 k! t, o% `9 i    getaddrinfo .......... yes  9 V3 U$ v8 Z- H4 Z( O/ g- }
    getifaddrs ........... yes  
- X2 M6 z5 M% C1 y    IPv6 ifname .......... yes  
9 c: R/ c2 E, Q& w) V+ E/ ]    OpenSSL .............. yes (loading libraries at run-time)  0 G7 k; N5 \* g
  NIS .................... yes  
. {; l7 @- `: {) D% A  OpenGL / OpenVG:   " v- `6 r! D9 n7 _  }9 i8 S
    EGL .................. no  
& y  b! E0 U6 c; a9 B  r6 I    OpenGL ............... no  
3 h; D+ t- k! I* D- c+ K; ]5 Z7 l    OpenVG ............... no  ' t& E0 G# q* B% [% r8 u. A1 Q; V: h
  PCRE ................... yes (bundled copy)  
' I1 U6 F( B- H& ^# d0 L7 o% e7 `  pkg-config ............. no   
/ V- ~- [  F3 v& l1 c. P  PulseAudio ............. no  / J& [4 f/ M' o3 @! X
  QPA backends:   4 L% y& S$ g4 T# C; f( M0 d
    DirectFB ............. no  
" n8 E& ^; S# k  I7 w7 C' J    EGLFS ................ no  + f& J; }' L: b2 v' A# W& ?$ C
    KMS .................. no  
" A" V4 o6 ^5 i9 j    LinuxFB .............. yes  
8 S" Z3 K1 V/ z5 A; H    XCB .................. no  ' ~) _6 H, J6 I5 h9 e' ^, K9 |
  Session management ..... yes  
5 Q) {- D, K# D% Z  SQL drivers:   
7 V4 E" ^  t. }    DB2 .................. no  " {( Q; n, p2 E
    InterBase ............ no  5 j9 M9 J+ K: h, E
    MySQL ................ no  
6 i5 U. f6 V; L0 ~    OCI .................. no  
" _0 N+ j) q$ X7 z/ G    ODBC ................. no  6 d& H" |& u/ p2 r8 f8 R
    PostgreSQL ........... no  / J- A2 h" B/ C9 Q
    SQLite 2 ............. no  
3 ~9 m) h& R6 K% I$ R# N    SQLite ............... yes (plugin, using bundled copy)  
+ }& e  \- }  O    TDS .................. no    }0 D$ @3 B: E+ I% `' E
  udev ................... no  # T$ I& f5 }% a, p) M+ l/ M
  xkbcommon .............. no  9 B# D1 m: Q$ z9 ?
  zlib ................... yes (system library)  ; l6 _! g) i' T# v1 g

- \% e+ A3 x/ o, J+ h- |
3 a% J6 J* w$ e9 h* ]8 l配置完成后执行:' N# H5 P& S- j) X- a1 i/ h
[html] view plain copy$ W$ h! u! w% }# w
$ make -j4  
7 h- c9 J% o7 ]7 Y3 H9 r1 _$ sudo make install -j4  " v5 B2 Y/ n% B- k

: W9 |7 }4 v/ H' ]# }+ _9 p, j3   添加 tslib 支持$ V1 o5 Y% ~0 o9 v( W
为了使单点触摸屏可用,还需要编译Qt的tslib插件,这需要首先交叉编译好tslib,tslib的编译过程参见:
: d: o5 [7 y: j. Z# x: e. s
$ C, @9 }# {; v, shttp://blog.csdn.net/newthinker_wei/article/details/8639276( ~/ y7 K6 e1 s8 |, z
友善之臂的板子使用了 touchscreen-1wire,这需要按照上文中的步骤对tslib的源码打上补丁(在tslib的源码中添加了一个一线触摸屏的插件)。非友善之臂的板子一般不用打补丁。- R8 |7 K* e9 f
8 @; f1 X3 Q% |) \% l
另一个有用的链接在这儿,这是友善专门为tslib做的一线触摸屏的插件,有源码,上面那篇文章应该也是参考这个源码的:% a& t% ]6 R& y# b5 [( f! @2 p+ K

. X; y5 s, X5 I' v7 e2 xhttp://www.arm9home.net/read.php?tid-16105.html5 _& ]1 j4 G6 x2 M) \! G# P# m3 u

/ q. x* _6 k" C& r( d6 D- c3 L9 ?7 ^' y注意,对于友善之臂的开发板,如果使用的是单点电阻触摸屏,使用上面的方式移植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工作。
8 f0 k9 A5 k) y将编译出来的tslib拷贝到库开发板后,还需要在板子上设置TSLIB的环境变量,主要的几个变量如下:$ g, k" R. W+ Z+ w& u4 W$ s

) h0 K  v% S9 @1 T  Z/ C+ ]/ S; K+ `[html] view plain copy
1 i* f) V8 D2 C6 _5 I+ \- c#! /bin/sh  
& R8 t/ \2 \% k: d* a' u, N# "source" this file when wanna run a Qt application on the ARM Board.  . E; O; |( n# A2 j# X' L5 ]3 N
  
7 Y6 u' |1 g% x  J: a1 P+ E###############  the below lines are for stardard TSLIB ##################  
4 s+ v6 i! u" \export TSLIB_ROOT=/opt/tslib  
: B5 A2 S2 v, T% v0 x8 g  c$ N8 Bexport TSLIB_CALIBFILE=$TSLIB_ROOT/etc/pointercal  , k$ f' u2 O, i
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf  ! r" C" e, @# Z
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts  , _2 X1 m! U1 H2 n
export TSLIB_TSDEVICE=/dev/touchscreen-1wire  ; t/ D$ w0 l0 a; L7 S/ O
#export TSLIB_TSDEVICE=/dev/input/event2  
5 z6 b" e; m$ h, s  ' \+ e' E$ O2 n! ]# P; Q0 X
################  the below lines are optional ##############  + `4 T% o/ @/ S% y5 ]2 D
#export TSLIB_FBDEVICE=/dev/fb0  
3 M) Y7 p8 x  Z( T5 K#export TSLIB_CONSOLEDEVICE=none  0 f1 I" ^" r2 U  [' V# \

  L/ b! a9 Y! L5 o  l1 J此外还要修改 ts.conf文件:
6 P0 N! j; D. c! L0 C0 ^% W/ @[html] view plain copy
+ f+ C$ ?' c* k/ d! g/ _#module_raw one_wire_ts_input  2 v" j2 K8 J* z2 O' m
module_raw friendlyarm-ts-mtinput #使用友善提供的电容屏TSLIB插件。需要先将friendlyarm-ts-mtinput.so拷贝到TSLIB_PLUGINDIR目录中  
' J0 ~# k, A. z  C  - w( E! D, e, r3 ~
module pthres pmin=1  0 f" _# g! C6 V6 v" H5 E0 Z
module variance delta=30  6 P0 l) K6 {. N9 ?
module dejitter delta=100  
3 W3 ^9 ]( R4 Q3 F* ]2 w3 V/ q5 _module linear  8 w5 Z2 }4 a) @( v# {# P
到此为止 tslib 就基本能用了,首次使用时应先运行 ts_calibrate 进行触摸屏校准。我用的这个版本的tslib自带的ts_calibrate程序不太好用,所以我依然使用友善提供的ts_calibrate进行校准。0 |' {  _( V! G! u9 b4 g3 Q: N* ]: t- 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"这个库文件了。
" [& m4 I% [+ S# |1 R. s& w/ I) Z# p) c8 q4 `) A
4   运行Qt程序1 i5 A! f9 v- {& U1 L( R* ?
需要说明的是,Qt5.0开始,Qt自身不再单独实现窗口系统,QWS不复存在,取而代之的新机制是QPA(Qt平台抽象),QPA使得Qt对不同平台的支持变得更加灵活,当需要支持一个新平台时,只需为该平台编写一个QPA插件。/ \# k8 x1 b7 g. E$ C

/ p9 D. y- G4 {: tWith 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.html7 l( j' e0 v& Z$ D& m
7 L, E7 S5 }: @: k
编译完Qt后,只需将生成的lib和plugins文件夹拷贝到开发板,另外,当在嵌入式Linux平台上运行应用程序前,应根据自己平台的实际情况提前设置好下面几个环境变量:
3 N3 M* z9 u* M: C" a4 f& Y2 d8 u7 x6 m) c7 b+ G! L. x9 d
[html] view plain copy
( F( N8 x  I* t& t7 t# Q* Cexport QT_QPA_PLATFORM_PLUGIN_PATH=/opt/Qt-5.3.2/armv7-a/plugins/platforms  % o9 n0 I; w2 T/ _% T) W, B/ f
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0  
" g6 C8 n% V. t, Xexport QT_QPA_FONTDIR=/opt/Qt-5.3.2/armv7-a/lib/fonts  
& v2 a; z- I% L" N- ]  K/ sexport QT_QPA_GENERIC_PLUGINS=tslib:/dev/touchscreen-1wire  #使用tslib插件    F7 ^. R# a) g# z: r

2 k. s) S: N. j! j+ \- J然后就可以运行Qt程序了% b; e+ i5 n9 {' r- }
; K# Q& i, T# o
以前Qt4的程序在嵌入式Linux平台运行时,需要在命令行输入-qws选项以启动Qt窗口系统服务,如" ./HelloWorld -qws";而使用Qt5后,不再需要-qws,而需要通过-platform来指定要使用的QPA插件,如" ./HelloWorld -platform linuxfb",如果不指定,则用默认的QPA插件,默认的QPA插件通过上面的QT_QPA_PLATFORM变量指定。" J& h. G2 ~" ]' Q+ b+ f- Q: A+ v
1 n5 x" \' ]. G, h+ Q: x/ W! m& {
附: 在Ubuntu 14.04上编译Qt ---(请注意,本小节编译的是PC版Qt,不是ARM版,ARM版Qt的编译过程请参考本文第2节)) ?, r, _( W. P% `+ J- R
在Ubuntu 14.04上编译Qt就简单多了,缺少的组件可以很容易下载到。: d+ s  ~6 ]  c0 _" _

# Q, D0 m& M4 @6 f首先安装opengl支持(mesa3d),
3 F6 w& b7 Z$ d! x7 I4 j7 t2 t* F/ Y+ C* ^
[html] view plain copy: S: l/ V! U6 V! }4 H
sudo apt-get install mesa-common-dev  libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev  
7 m! z/ F( f% |, k% Z- ?; U+ o如果需要,再安装Qt D-Bus的支持。
4 M% M/ `( q9 m! E0 Y* J6 v+ `: {- J
. O' a3 \' P( F& z然后configure,configure过程中可能出现一些错误,基本都是缺少某个库引起的,配置过程中根据错误提示,用apt-get install或Ubuntu Software Center搜索安装缺少的组件。' c' ]2 E+ R# _3 o- @

* u9 z. O$ y' C4 `[html] view plain copy1 w6 ?, V+ B  Y- \2 @
./configure -release -opensource -prefix /opt/Qt-5.3.2/x86 -no-c++11 -qreal float -opengl  
' B7 v" f! C' ]' R配置结果为:) m* W0 t5 y: `$ \6 i% H% a
) E& Y$ Y' K# l0 [& U* Z( k- n7 ?
[html] view plain copy
, p; X/ S; F" R: n* R   Configure summary  ) }& ?6 J, F6 F' I/ {
  
/ O8 Q7 P& V. H2 l& RBuild type:    linux-g++ (i386, CPU features:)  
2 q- v, E& [7 X8 Y. vPlatform notes:  
5 @. f- k4 o+ i% N  " v/ Q. P9 Z5 v2 H
            - Also available for Linux: linux-kcc linux-icc linux-cxx  ' D; `( C2 A: k2 Y
          / {7 L4 V5 C; W4 \2 D9 ^4 e
Build options:  
- L9 S% A6 R, p4 t9 Z  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   
% M& f7 d7 T3 [# j! z  Build parts ............ libs tools examples  
2 A3 O6 n0 x& a  Mode ................... release  
. K( H/ G" `, E1 r/ _& |+ D  Using C++11 ............ no  % W3 D7 R: w- {- f4 T/ v
  Using PCH .............. yes  9 E1 H5 e  ]( K- l
  Target compiler supports:  
4 Y' m& n% j( H) t: K    SSE2/SSE3/SSSE3 ...... yes/yes/yes  
+ j5 z. {+ I+ o, g; {    SSE4.1/SSE4.2 ........ yes/yes  6 |+ M# V- \* z2 e4 B6 x! q6 x
    AVX/AVX2 ............. yes/yes  
$ G& ^+ U4 F3 o# a  : e- o) G: _  E
Qt modules and options:  
4 C8 u- J7 @6 \) ^( X8 v4 k  Qt D-Bus ............... yes (loading dbus-1 at runtime)  * v# O6 B) F; F- ~& D
  Qt Concurrent .......... yes  
6 J) _- _- x% P! k$ q4 x- n" E! T  Qt GUI ................. yes  $ Y" R5 A* l8 x8 A# U! {+ T# D9 i
  Qt Widgets ............. yes  5 `9 Q4 J5 h8 Q; n& O" ^
  Large File ............. yes  0 H& A" z- f1 _% S& o# F2 O
  QML debugging .......... yes  
1 @# n$ i  `& s2 D6 ?  Use system proxies ..... no  ) k4 T- y1 M; {2 b+ h4 y/ G/ z
  2 P0 {/ a! i' d  c# ~/ _/ y
Support enabled for:  
# c% ~, F* g. q: J* \, \. U  W3 t  Accessibility .......... yes  " u/ e4 M' X" C; d" z6 s) l
  ALSA ................... no  9 L+ `. A* u8 ~8 }: n
  CUPS ................... no  
0 r% W( C! o1 }1 R  Evdev .................. yes  3 N7 P2 _& e0 u' @" ~  s% M0 V
  FontConfig ............. yes  % r& H+ {0 [! [: U' y
  FreeType ............... yes (system library)  
4 Q+ B0 [5 C3 l  Glib ................... yes  
+ j+ `5 Q% k9 [: {$ [( P6 `  GTK theme .............. no  . k( d4 A# J4 ^2 |- y! t
  HarfBuzz ............... no  $ N  T! \; q, X5 w
  Iconv .................. yes  
# W. j5 c) j) |, P  ICU .................... no  
  |. E8 G/ Y. v5 z( _  Image formats:   
: S+ X) T/ |  P8 B4 r! D" X! @    GIF .................. yes (plugin, using bundled copy)  " E6 o' _) [' c( [: X  E4 {( M3 `0 m( b
    JPEG ................. yes (plugin, using system library)  
8 P7 o( ]+ e- |    PNG .................. yes (in QtGui, using system library)  
" O" R! T( _, W$ E  journald ............... no  
2 w" W% ?" a/ o5 s' U+ c, A. n8 b  mtdev .................. no  
- b0 O9 W( R* l8 L5 B  Networking:   
+ U4 V6 U0 b$ ?0 j3 k    getaddrinfo .......... yes  & D& V7 ]7 x" {# J
    getifaddrs ........... yes  
5 a8 L( b/ A% \% W' |. O7 w9 q9 Q    IPv6 ifname .......... yes  
# v! V; F2 l. [. S    OpenSSL .............. no  * F0 S- v6 o. ?( j) V- c1 |  t) l
  NIS .................... yes  
# ~% `" @/ V7 b, J; x  OpenGL / OpenVG:     L, o% O* \1 L$ x) s
    EGL .................. no  2 [( l* r1 B) r0 f+ _6 B8 I
    OpenGL ............... desktop  3 h8 J. v. Z  A/ B9 k2 ]5 w
    OpenVG ............... no  ) y7 {" ]) [+ {9 k: Q% C3 A3 x9 L/ O( G
  PCRE ................... yes (bundled copy)  6 T3 I/ b& G2 U2 ^' N4 Q
  pkg-config ............. yes   9 m5 p7 ^3 F4 |* [8 r3 L
  PulseAudio ............. no  
: C7 u! y3 M. M  QPA backends:   # C+ x. u' T% s' ~& A, D- ^' [
    DirectFB ............. no  
& g3 ]% D9 l. P5 w! t2 t7 B! X7 t    EGLFS ................ no  ! \: |- A5 U! v! N/ g
    KMS .................. no  
7 l& X6 f- X% H, j( w& ]& [    LinuxFB .............. yes  / f4 Y( c+ P$ I0 h. {0 w
    XCB .................. yes (system library)  # a( Y  Y! }8 `8 G9 S8 l
      EGL on X ........... no  - i) ^1 X  O+ z/ T
      GLX ................ yes  1 G+ P6 n( X8 B8 Y+ g
      MIT-SHM ............ yes  7 s7 @$ V9 o4 C& `4 S* m# X: z
      Xcb-Xlib ........... yes  
; Z! P2 s4 l0 ]( |  }, a5 k4 K8 \      Xcursor ............ yes (loaded at runtime)  7 g- `$ T  _+ \  r
      Xfixes ............. yes (loaded at runtime)  # p; d) H9 @7 s1 P3 e" }) e( |$ }8 O3 {. ?
      Xi ................. no  0 ?& X9 `2 C" s, J) D# y" s
      Xi2 ................ yes  ( i' {4 V8 U" b$ m$ a# Y+ f
      Xinerama ........... yes (loaded at runtime)  ! b- d; o5 H3 Z: w+ V7 o) D9 }
      Xrandr ............. yes (loaded at runtime)  
4 M; J) ?2 l; d& K& `9 w      Xrender ............ yes  " O- R$ g- ~- G0 |, i$ a9 S$ }9 Q
      XKB ................ no  7 f1 w0 I' U3 [
      XShape ............. yes  
8 x# Z& o. a; r) D      XSync .............. yes  
' X* V& w3 m/ c      XVideo ............. yes  
0 c& l4 M+ N5 X# I) O" q( c  Session management ..... yes  
2 Q; |. E/ I0 c% @7 A% w  SQL drivers:   3 x, G# }/ \3 G0 c/ K4 G2 R, S0 N, s
    DB2 .................. no    D6 P0 F2 ?) b) F+ ^: W; O' m) v
    InterBase ............ no  " [, J/ B' j, p
    MySQL ................ no  
5 O& h7 [5 }; J8 E- w    OCI .................. no  0 {; [5 e, l5 u
    ODBC ................. no  & B* `' K3 ~' T
    PostgreSQL ........... no  $ ~  c' i' G2 V' ?: E  H
    SQLite 2 ............. no  
+ U" U% b0 o' u; f  ^3 h    SQLite ............... yes (plugin, using bundled copy)  
/ x, H0 R/ N' O9 H( e8 s  u    TDS .................. no  
0 J0 c% q% H5 y% f6 u% M- _7 o  udev ................... yes  3 L: m* Q/ t5 d1 B% y* o# d9 ?  T
  xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)  
% ?$ B% e% @9 c2 N1 {  zlib ................... yes (system library)  
* S6 o( Y& s: e5 A% @0 f6 S- q  
6 ]  b# d7 ~% v! Z  cNOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use   8 b) F8 j' X! P5 g/ Z. B; V3 E
the bundled version from 3rd party directory.  
! h! z- M- i# u' {
8 G. Z  I# g3 p/ q最后make和make install即可。
7 y/ E, A6 H7 m  N: w' B
" `% I. E0 h2 W1 i4 e
+ k6 `! Q4 o! ^, \另外,编译完Qt5.3.2后,发现Qt assistant打开之后内容是空的,查询不到任何东西。需要打开assistant,点击Edit->preference菜单,选择Documents选项卡,点击add向assistant添加文档,文档类型为 *.qch 。但Qt5中似乎文档并不是现成的,需要在编译完Qt后再去编译他的文档。步骤为:: ~: w6 u# R0 x$ x+ _9 E. e
4 E- [- V  X1 ^  ~/ A/ A. @$ d
进入已经编译过的Qt源码顶层目录,输入
6 G1 n0 H* |# i/ w0 ~: y- D; ]9 U7 V[html] view plain copy
/ z/ z& B# j* ^8 o% x$ make docs  
* T% r9 {2 H0 B% C这条指令会生成Qt各个模块的文档,但这些文档分散于不同的子源码目录中,最好将他们集中拷贝出来放到Qt的安装目录中,我的做法如下,当执行完make docs后,在源码顶层目录输入:(/opt/Qt-5.3.2是我的安装目录). F6 i' L6 J( r: B. Z, ^
[html] view plain copy/ c' d" u. O: G
$ sudo mkdir /opt/Qt-5.3.2/docs_for_assistant  
% k) k/ E& D. X9 w$ K7 z% d$ sudo cp `find ./ -name *.qch` /opt/Qt-5.3.2/docs_for_assistant  - B. ^) ?! L2 y. h5 u
然后打开assistant,将 /opt/Qt-5.3.2/docs_for_assistant 目录中的*.qch文件全部add进去。

本版积分规则

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

GMT+8, 2025-8-20 09:02 , Processed in 0.032280 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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