Qt5 on ARM platforms - Introduction
Qt5 ARM 平台移植
####################################################

Introduction: This short post covers the background of Qt5, architec

tural details, configuring for eglfs with Graphics drivers, building, and known issues. This is to be used for porting Qt5 on ARM based platforms 这篇短文的内容涵盖了 Qt5 的背景结构以及显卡驱动 eglfs 的配置还有编译构建等 方面。这些内容都是移植 Qt5 到 ARM 平台所需要的。
##注释 Qt5.0.2 以后采用了 QPA 插件作为跨平台也就是说新版本中 qws 已经无效了。例如执行程序不再是./Hello –qws 而 是 ./Hello –platform linuxfb QPA 插件将不同硬件平台的图形显示底层抽象化通常在 mac 上是 cocoa, 在 window 上是 windows, 在 linux X11 下 是 xcb, 如果有 OPENGL 支持, 那么选 eglfs.对于无硬件加速的设备, 选择 linuxfb, 任何作用 如图可在 qmake.conf 配置文件中用 QT_QPA_DEFAULT_PLATFORM 指明图形程序实际运行的开发板是无硬件加 速 linuxfb 平台。 minimal 仅仅是让程序跑通, 不起

Qt5.2 (standalone) and QtWebEngine(preview) build steps available now at http://gpupowered.org/node/31 ################################################################ Qt5.2 和 QtWebEngine 的构建步骤在此网站

Qt5.2 and QtWebEngine build summary on ARM platforms
Qt5.2 rc1 can be cross compiled for ARM with OpenGLES2 support, with sgxconfiguro (https://github.com/prabindh/sgxconfiguro). The steps below outline this method. Qt5.2 rc1 进行 ARM 交叉编译时需要有 OpenGLES2 的支持 qt5.2 在为 ARM 配置 configure 时如果没有加入-opengl es2 选项编译 即便 configure 成功在 make 后仍旧会报出缺少 quick 模块的错误。而同样情况下我再用 qt5.0 版编 译就成功了也在 linuxfb 下成功运行了可能是 5.2 的某些部分必须有 opengl 支持 某网站好像是提到 5.2 只能用 opengl。 Opengl 的支持与获取是在 sgxconfiguro(https://github.com/prabindh/sgxconfiguro). sgx 应该是指 sgx 图形芯片 因为它支持 opengl 协议 所以可以临时拿来充当 opengl es2 的库编译本文的目的是演示如何用 OpenGL es2 配置编译 qt5.2不然没有安装 相应的头文件和库加入-opengl es2 时 qt 配置会报错无非继续演示。网站里给出的 应该就是安装包和配置方法。Opengl 不是具体的库文件而只是一个通用的图形接口 协议它统一了图形开发的.h 头文件和其中的函数接口像 sgx 一样支持 opengl es2 协议的库都应该可以拿来作为 qt 的 opengl es2 部分编译。实际开发要看开发板硬件配 置来决定不支持 opengl es2 的硬件自然没必要在编译 qt 时采用此选项但 qt5.2 必 须要有 opengl 支持 编译后才不会报错 为了简便我没有按照此文的方法 而是用 qt5.0。 2 不加-opengl es2 做了编译测试 Extract qt5.2 sources from the source package. Then perform below steps. 获取 qt5.2 的源码包然后按下面步骤操作
qt-everywhere-opensource-src-5.2.1.tar.gz 源码包 pkgconfig 我不太会用没按照以下方法而是参照网上博客中 qt4.8 移植的配置方法本文没有说明如何配 置 arm-linux-gcc 交叉编译环境可参考其他中文博客。 采用 arm-linux-gcc --target-help 命令可以查看你的 arm-linux-gcc 交叉编译器都支持哪些 arm 架构和指令 关于如何配置可百度“armv arm926”博客中有 arm 分类的详细统计介绍

cd qtbase //不知为何他是进入 qtbase 中执行 configure 而官方说明是在源码包主 目录下。但执行 make confclean 却要在 qtbase 目录下才行而按文档中-prefix $PWD/qtbase 操作就会安装到 qtbase/qtbase 目录下了很混乱的说明 export PKG_CONFIG_SYSROOT_DIR=/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/lin ux-devkit/sysroots/armv7ahf-vfp-neon-3.2-oe-linux-gnueabi export PKG_CONFIG_DIR= export

PKG_CONFIG_LIBDIR=/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit /sysroots/armv7ahf-vfp-neon-3.2-oe-linux-gnueabi/usr/lib/pkgconfig export PKG_CONFIG_PATH=/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/ sysroots/armv7ahf-vfp-neon-3.2-oe-linux-gnueabi/usr/lib/pkgconfig export PKG_CONFIG=/home/prabindh/work1/arm-qt5-5.2a-gst/qt-everywhere-opensource-s rc-5.2.0-alpha/qtbase/x86-cross-pkg-config export QMAKESPEC= export PATH=/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-ar ago-linux/usr/bin:/home/prabindh/work2/arm-qt5.2rc1/qt-everywhere-opensource-src5.2.0-rc1/qtbase/bin:$PATH configure 的配置都差不多但 qt5 以后已经没有 embedded 这个选项而是改用 -xplatform 指定开发板的编译方法如下面所示所有交叉编译工具链配置信息都统一 放在 mkspecs/linux-arm-gnueabi-ti-g++/qtmake.conf 中 ./configure -prefix /home1/prabu/qt5.2rc1_install -release -make libs -xplatform linux-arm-gnueabi-ti-g++ -opengl es2 -glib -confirm-license -opensource -no-xcb -no-pch -force-pkg-config -make examples -verbose The output of configure will be a configure summary with OpenGLES2 support properly configured as below:

显然作者的许多环境都已经提前配置好了他下面只做 configure 演示。。。xcb 这 些在 ubuntu 上也都得自己预先装好否则会报错的详细看文档 README http://qt-project.org/doc/qt-5/linux-requirements.html

执行 configure 命令以后就会打印出下面的配置信息 如果在 ubuntu 下执行失败得用 sudo 提升权限。 值得一提的是 qt5 中文档说明用-prefix $PWD/qtbase 前缀声明qt 所有的安装文 件都会放在 qtbase 目录下与以往版本放在根目录/usr/lib 不同以后只要删除这个 目录就能把 qt 完整卸载不在其他地方有残留文件而且此方法 make 后不需要再执行 make install 因为文件已经自动安装到 qtbase 中了。 当然本文中的例子还是要 make install看本段结尾注明了 make && make install

===== Configure summary

Building on: linux-g++ (i386, CPU features:) pc 机配置 Building for: linux-arm-gnueabi-ti-g++ (arm, CPU features:) 开发板配置 Platform notes: - Also available for Linux: linux-kcc linux-icc linux-cxx qmake vars .......... styles += mac fusion windows QT_CFLAGS_DBUS = -I/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/armv7ahf-vfpneon-3.2-oe-linux-gnueabi//usr/include/dbus-1.0 -I/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/armv7ahf-vfpneon-3.2-oe-linux-gnueabi//usr/lib/dbus-1.0/include QT_LIBS_DBUS = -ldbus-1 QT_CFLAGS_GLIB = -pthread -I/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/armv7ahf-vfpneon-3.2-oe-linux-gnueabi//usr/include/glib-2.0 -I/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/armv7ahf-vfpneon-3.2-oe-linux-gnueabi//usr/lib/glib-2.0/include QT_LIBS_GLIB = -pthread -lgthread-2.0 -lrt -lglib-2.0 QMAKE_CFLAGS_FONTCONFIG = -I/home/prabindh/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/armv7ahf-vfpneon-3.2-oe-linux-gnueabi//usr/include/freetype2 QMAKE_LIBS_FONTCONFIG = -lfontconfig -lfreetype QMAKE_INCDIR_LIBUDEV = QMAKE_LIBS_LIBUDEV = -ludev DEFINES += QT_NO_XCB DEFINES += QT_NO_XKBCOMMON sql-drivers = sql-plugins = sqlite qmake switches ......... Build options: Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus egl eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib iconv inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis no-harfbuzz opengl opengles2 openssl pcre png qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype system-jpeg system-png system-zlib Build parts ............ libs examples Mode ................... release Using C++11 ............ yes Using PCH .............. no Target compiler supports: iWMMXt/Neon .......... no/yes Qt modules and options: Qt D-Bus ............... yes (loading dbus-1 at runtime) 作者的环境中 Dbus 都已经装好了 Qt Concurrent .......... yes Qt GUI ................. yes Qt Widgets ............. yes JavaScriptCore JIT ..... yes (To be decided by JavaScriptCore) QML debugging .......... yes Use system proxies ..... no

Support enabled for: Accessibility .......... yes ALSA ................... yes CUPS ................... no FontConfig ............. yes FreeType ............... system Iconv .................. yes ICU .................... no Image formats: GIF .................. yes (plugin, using bundled copy) JPEG ................. yes (plugin, using system library) PNG .................. yes (in QtGui, using system library) Glib ................... yes GTK theme .............. no Large File ............. yes Networking: getaddrinfo .......... yes getifaddrs ........... yes IPv6 ifname .......... yes OpenSSL .............. yes (loading libraries at run-time) NIS .................... yes OpenGL ................. yes (OpenGL ES 2.x) OpenVG ................. no PCRE ................... yes (bundled copy) pkg-config ............. yes PulseAudio ............. no QPA backends: DirectFB ............. no EGLFS ................ yes KMS .................. no LinuxFB .............. yes XCB .................. no Session management ..... yes SQL drivers: DB2 .................. no InterBase ............ no MySQL ................ no OCI .................. no ODBC ................. no PostgreSQL ........... no SQLite 2 ............. no SQLite ............... yes (plugin, using bundled copy) TDS .................. no udev ................... yes

xkbcommon .............. no zlib ................... yes (system library) NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1. Configure with '-qreal float' to create a build that is binary compatible with 5.1. Info: creating cache file /home/prabindh/work2/arm-qt5.2rc1/qt-everywhere-opensource-src-5.2.0-rc1/qtbase/ .qmake.cache Qt is now configured for building. Just run 'make'. ==== Then perform make && make install 官网桌面版就只安装到这就可以了。。 http://qt-project.org/doc/qt-5/linux-building.html 下面可能是嵌入式版本不同环境额外需配置的 Then perform the same steps for the below modules. qtdeclarative qtscript qtsvg 接下来在三个目录中执行同样操作 make && make install不知道这几个是不是按需 求选择安装 我 make 出错了估计是哪些环境没装全所以没再装这几部分

网上关于 Embedded Linux 的说明部分却没连接

QtWebEngine build: 看来事情没完没了qtWebEngine 模块还要再配置什么也没详细说 After extracting qtwebengine preview package, perform qmake, followed by make.

For the AM335x based SDK root filesystem, the make step throws below errors. No external chromium sources were found, falling back to /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/3rdpa rty/chromium Using extra options found in /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core/ qtwebengine_extras.gypi Using extra options found in /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core/ qmake_extras.gypi Updating projects from gyp files... Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found gyp: Call to './pkg-config-wrapper "/home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/3rdp arty/chromium/arm-sysroot" "arm" --cflags gmodule-2.0 gtk+-2.0 gthread-2.0' returned exit status 1. while loading dependencies of /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/3rdpa rty/chromium/base/base.gyp while loading dependencies of /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/3rdpa rty/chromium/net/net.gyp while loading dependencies of /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/3rdpa rty/chromium/content/content.gyp while loading dependencies of /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core/ core_generated.gyp while loading dependencies of /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core/ core.gyp while trying to load /home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core/ core.gyp Project ERROR: -- running gyp_qtwebengine failed -make[2]: *** [sub-gyp_run-pro-make_first] Error 3 make[2]: Leaving directory `/home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src/core' make[1]: *** [sub-core-make_first] Error 2 make[1]: Leaving directory `/home/prabindh/work2/arm-qt5.2rc1/qtwebengine-opensource-src-0.1.0-tp1/src' make: *** [sub-src-make_first] Error 2 Looking into the build process, the below are dependencies for QtWebEngine for ARM cross compilation.

gtk nss gconf x11 xfixes pangocairo/ pangoft2 So need to get these in the filesystem first. Work in progress.

到此后面几个步骤也没法跟着他做只做到 make 那一步了 完

(Nov 2013 update) It is now possible to build Qt5 directly from Yocto with meta-ti recipes for AMSDK, as most of the standalone patches are pulled into meta-arago. http://arago-project.org/pipermail/meta-arago/2013-October/002103.html 本文更新于 2013.11也可能现在 Yocto 开源社区已经有了能直接构建 Qt5 的工具 meta-ti 配置 AMSDK这工具没用过。。

5.1.0 final version (Aug 2013) information and build based on TI Sitara AMSDK/OMAP5 GLSDK is available at, http://gpupowered.org/node/24 这个网站是 qt5.1 配置方法文中提到下载 Sitara SDK 包已经包含了 qt 构建所需提 前准备的三部分组件Linaro toolchain 工具Root filesystem 包含交叉编译工具链和 环境配置的根文件系统以及作为 opengl 选项所准备的 SGX 包吧。。总之大意是能帮 你把这三个环境自动构建好 Linaro toolchain 还包括内核自动构建等 Instructions for AM335x - Sitara platform: 看介绍也许这只针对德州 AM335x – Sitara 平台专用的。 。 。 。 提到了和 Linaro toolchain 的合作目的为开发人员建立一种嵌入式的快速开发环境。。 至于对其他开发板如何配置和开发包就有待以后去了解了。。 交叉编译环境已经按中文博客里搭建了目前需要的不是这个工具。。
.

5.1.0 final version - build without SGX http://gpupowered.org/node/25 这篇也是介绍在德州平台的基础上建立 qt5.1 编译环境区别就是不用 opengl es2也 就不需要 SGX 没有 opengl Configure 后 LinuxFB .............. yes linuxfb 有效了

然后 Because of a bug in Qt5.1.0, the below error occurs. Qt5.1.0 有个 bug所以正确配置后依旧报错。。 This bug is resolved in qt5.1.1 as per below change list for qt5.1.1 - so need to try with qt5.1.1. http://qt.gitorious.org/qt/qtbase/source/c15a8cc283d5d7b26677b9c71cabb1f... 这个 bug 在 qt5.1.1 中被解决了所以他又把 dist 目录中的 qt 版本更改记录列出来。。 这段说明了很多缘由 Running with linuxfb If a default Qt5 configuration is used with opengl es2 support, linuxfb can still be tried, for Widget based applications. QML (scenegraph) based applications will not work (segfault) when linuxfb is used, as an openGL context cannot be created with linuxfb. 意思是即便用 opengl es2 编译的也可以尝试用 linuxfb 模式来运行但只能支持基本 的窗口程序。在 linuxfb 模式下 QML 是无法正常工作的因为它依赖 opengl 的上下文 环境。 ######################################### Qt5 and C++, migrating widget applications / porting from Qt4 to Qt5: http://www.gpupowered.org/node/23 这篇说 qt5 相对于原来 qt4 有了大量变化qt4 写的代码在 qt5 上已经不能正常编译和 工作了如何折腾将原 Qt4 的代码改写将其移植到 Qt5 上编译。。。。 ######################################## 5.1 version (Alpha, Beta1) information is available at, http://gpupowered.org/node/21 Qt5.1 Alpha/Beta1 在德州的平台上如何能有效运行等等。。。 ########################################## For Qt5 (Dec 2012) release update, refer to

http://gpupowered.org/node/16 Qt5.0.0 在德州的平台上包括 SGX 能有效运行等等。。。 这段关于触屏 tslib For correct TSLIB operation on a platform, apply the patch below for building the tslib plugin - And ensure TSLIB_TSDEVICE is exported on target (ex, export TSLIB_TSDEVICE=/dev/input/event2). Without this patch, Qt5 tslib plugin will use only /dev/input/event1, and if this the touchscreen is not mounted at this point, tslib based access will not work for eglfs. To use the tslib plugin, add "-plugin Tslib" to the application invocation command line. 在一个平台上正确的操作 TSLIB: 接下来的补丁就是用来建立 tslib 插件。假设建立的目标开发板中 TSLIB_TSDEVICE 的输出口是 TSLIB_TSDEVICE=/dev/input/event2如果不使用这个补丁Qt5 的默认 tslib 插件只会是/dev/input/event1,。而触屏设备不是挂载在这个点上tslib 在 eglfs 模 式下将不会正常工作。 使用 tslib 的方法是在执行程序时命令行中加上-plugin Tslib。例如./hello –platform linuxfb -plugin Tslib https://github.com/prabindh/qt-configs/blob/master/qt5_1.0_Feb13/tslib.patch 源码部分也贴出来了

这个在 qtbase/src/plugins/generic/tslib/qtslib.cpp(自己动手改应该也行) Result of a successful configure should enable NEON, GLES2, ICU, linuxfb, eglfs. ICU is needed for Webkit to be built. Post-configure, a regular make can be done. After building qtbase, additional packages necessary for qt3d and qtwebkit can be built - qtdeclarative, qtjsbackend Configure 的结果列表中必须是 NEON, GLES2, ICU, linuxfb, eglfs 都能被成功配置编译 其中 ICU 是构建 Webkit 的先决条件configure 完后就是 make这个是德州平台开发 板的测试说明 至此 qtbase 部分都编译完了 额外的几个模块就是 qt3d 和 qtwebkit 能被- qtdeclarative, qtjsbackend 创建也许这也是在 qtbase 下执行 configure 的原因

########################################3 For Qt5 Webkit2 build, refer to http://www.gpupowered.org/node/15 在德州的平台上编译 qt5 以及 webkit Required dependencies 1. Qt5 to be built per the procedure described in the README at below repository. ICU support is mandatory for Webkit. https://github.com/prabindh/qt-configs/tree/master/qt5_1.0_Dec12 打补丁以及替换 linux-arm-gnueabi-ti-g++来成功编译 webkit。。。 Patch for eglfs issue of unable to create surface (0x3003 error) 打上补丁解决不能显示曲线的 bug。。。。。。 Steps to build - cd qtwebkit - qmake Webkit.pro If correctly done, the final configuration for this version of Webkit should show configuration as below. If gstreamer is enabled in the build, it would show as supported. >> Final configuration: Build ......................... webkit1 webkit2 Configuration ................. debug/release

##################################### For Xcb builds, refer to the next post http://gpupowered.org/node/10 Qt5 Alpha source package overview: Qt5 contains the absolute minimum required functionality - in "qtbase" folder. All other additional components (including Qt3D) are split into separate folders. Below is the folder structure of Qt5 (Alpha package) Qt5 在 qtbase 目录中包含了最小化功能模块所有附加的模块包括 Qt3D被分割到 一个个目录中下面就是目录结构

<>$ ls build qtdeclarative qt.pro qtwayland build.dependencies qtdoc qtquick1 qtwebkit configure qtgraphicaleffects qtscript qtwebkit-examples-and-demos configure.bat qtimageformats qtsensors qtwebkit.pri gnuwin32 qtjsbackend qtsvg qtxmlpatterns qt3d qtlocation qtsystems README qtbase qtmultimedia qttools Pre-requisites for Qt5 build (non-webkit): 编译 non-webkit 版本 Qt5 的准备工作 - Qt5 alpha source package Qt 源码 http://releases.qt-project.org/qt5.0/alpha/ - TI Graphics SDK (4.05 or later), with Xorg support 图形软件包 Xorg 支持 http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsd... http://processors.wiki.ti.com/index.php/AM35x-OMAP35x_Graphics_SDK_Getti... - Recent filesystem (based on GCC 4.5 or later) with X11. Dependencies are listed below X11 文件系统依赖的包 libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libx11-dev - ARM cross Toolchain (GCC 4.5 or later), example from below:交叉编译工具4.5 版

以上
http://people.linaro.org/~michaelh/incoming/binaries/

Configuring Qt5: 配置 Qt5 Configuring Qt5 is fairly easy - and can be done without messing with creating new mkspecs, if the below are met: 如果下面的东西都准备好了配置 Qt5 很容易。。。。 - a linaro toolchain (linux-arm-gnueabi-)制作交叉编译器 - sgxconfiguro is used (package config for TI Graphics SDK - egl and x11) Sgx 的配置安装包TI Graphics SDK - egl and x11 安装包 https://github.com/prabindh/sgxconfiguro - force-pkg-config is used If this does not seem clear, the older tried-and-tested-method of specifying all possible (and needed) paths in the qmake.conf as below will also work :

如果这些工具都难看懂还有下面古老直观的办法在 mkspecs 中添加配置 https://github.com/prabindh/qt-configs/tree/master/qt5.0_mar2012
Copy the directory linux-TIarmv7-sgx-gst-g++ into <QT5DIR>/qtbase/mkspecs/ folder.将 linux-TIarmv7-sgx-gst-g++拷贝到 mkspecs 目录下

cd <QT5DIR>/qtbase/ 到源码的 qtbase 目录下 export PATH=<TOOLCHAINPATH>:$PATH 将交叉编译器加入 PATH 路径 export QTDIR=<QT5DIR> 指定环境变量 QTDIR 的正确目录路径

Use the below configuration to build the configuration and generate Makefiles, then perform Make 然后 configure 配置 ./configure -prefix /home1/prabu/qt5_install -release -make libs -xplatform linux-TIarmv7-sgx-gst-g++ -opengl es2 -confirm-license -opensource -no-xcb -no-wayland -glib -gstreamer –verbose

linux-TIarmv7-sgx-gst-g++目录中 qmake 的配置信息 可以参照部分看得懂的修改适合自己 开发板的
qmake configuration for building Qt5 with arm-linux-g++ - DM3730 #

MAKEFILE_GENERATOR TARGET_PLATFORM TEMPLATE CONFIG QT

= UNIX = unix = app += qt warn_on release incremental link_prl gdb_dwarf_index += core gui

QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf)

#User specific Path - To Be edited by User QT_INSTALL_DIR SGX_SDK_ROOT TSLIB_INCDIR TSLIB_LIBDIR = = = /home/prabindh/work1/qt5/qt5 = /home/prabindh/Graphics_SDK_4_05_00_03

#aragogcc 4.3 #DVSDK_INSTALL_DIR = /home/prabindh/3730_dvsdk_targetfs #gcc4.5 DVSDK_INSTALL_DIR = /home/prabindh/work1/ARAGO_ROOTFS_4.5

ROOTFS_LIBDIR = $$DVSDK_INSTALL_DIR/usr/lib GLIB_LIBDIR = $$DVSDK_INSTALL_DIR/opt/gstreamer/lib/

GLIB_INCDIR GLIB_CONFIGINCLUDEDIR GST_INCLUDEDIR

= $$DVSDK_INSTALL_DIR/opt/gstreamer/include/glib-2.0 = $$DVSDK_INSTALL_DIR/opt/gstreamer/lib/glib-2.0/include

= $$DVSDK_INSTALL_DIR/opt/gstreamer/include/gstreamer-0.10

LIBXML_INCLUDEDIR = $$DVSDK_INSTALL_DIR/usr/include/libxml2 ALSA_INCLUDEDIR = $$DVSDK_INSTALL_DIR/usr/include

#Needed for Qt5 Webkit build ICU_INCLUDEDIR = /home/prabindh/work1/arm-icu-install/usr/local/include ICU_LIBDIR = /home/prabindh/work1/arm-icu-install/usr/local/lib

# modifications to g++.conf QMAKE_CFLAGS QMAKE_CXXFLAGS += -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp += -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CC QMAKE_CXX QMAKE_LINK QMAKE_LINK_SHLIB

= arm-arago-linux-gnueabi-gcc = arm-arago-linux-gnueabi-g++ = arm-arago-linux-gnueabi-g++ = arm-arago-linux-gnueabi-g++

# modifications to linux.conf QMAKE_AR QMAKE_OBJCOPY QMAKE_STRIP = arm-arago-linux-gnueabi-ar cqs = arm-arago-linux-gnueabi-objcopy = arm-arago-linux-gnueabi-strip

#Do not edit beyond this

QMAKE_INCDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/include/OGLES2 QMAKE_LIBDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/gfx_dbg_es5.x QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc

QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL QMAKE_LIBDIR_OPENGL_QT QMAKE_LIBS_OPENGL_ES1

+= $$QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL_ES2 = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lusc

QMAKE_INCDIR_OPENVG

= $$QMAKE_INCDIR_OPENGL_ES2

QMAKE_LIBDIR_OPENVG QMAKE_LIBS_OPENVG

= $$QMAKE_LIBDIR_OPENGL_ES2 = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lOpenVG -lOpenVGU

QMAKE_INCDIR_EGL QMAKE_INCDIR_EGL QMAKE_INCDIR_POWERVR QMAKE_LIBDIR_EGL QMAKE_LIBS_EGL

= $$QMAKE_INCDIR_OPENGL_ES2 += $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2 = $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2 = $$QMAKE_LIBDIR_OPENGL_ES2 = -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc

QMAKE_INCDIR += $$TSLIB_INCDIR QMAKE_INCDIR += $$GLIB_INCDIR QMAKE_INCDIR += $$GLIB_CONFIGINCLUDEDIR QMAKE_INCDIR += $$GST_INCLUDEDIR QMAKE_INCDIR += $$LIBXML_INCLUDEDIR QMAKE_INCDIR += $$ICU_INCLUDEDIR QMAKE_INCDIR += $$ALSA_INCLUDEDIR

QMAKE_INCDIR += $$QMAKE_INCDIR_OPENGL_ES2 QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2 QMAKE_LIBDIR += $$TSLIB_LIBDIR QMAKE_LIBDIR += $$ICU_LIBDIR

QMAKE_LIBDIR += $$ROOTFS_LIBDIR

QMAKE_LIBDIR += $$GLIB_LIBDIR

#QMAKE_LIBS += $$QMAKE_LIBS_OPENGL_ES2 -lts -lglib -lgthread-2.0 -lgstreamer-0.10 QMAKE_LIBS += $$QMAKE_LIBS_OPENGL_ES2 -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0

load(qt_config)

Modified Qt5 configure script that includes sgxconfiguro support is provided in github. https://github.com/prabindh/qt-configs/tree/master/qt5_alpha 而这一篇说明里提到在装有 linaro 工具的前提下不用更改 mkspecs 的简便配置方法
The below method adopts the first approach and uses the standard Qt5 supplied linux-arm-gnueabi-g++ mkspec without change $cd qtbase $export PATH=/opt/linaro/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux/bin:/h

ome/prabindh/work1/arm-qt5-tar/qt-everywhere-opensource-src-5.0.0/qtbase/bi n: linaro 下自带了交叉编译器 gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux $export PKG_CONFIG=./x86-cross-ubuntu-pkg-config pkgconfig 配置方式不熟 $./configure -prefix /home1/prabu/qt5_install -release -make libs -xplatform linux-arm-gnueabi-g++ -opengl es2 -confirm-license -opensource -no-xcb -no-wayland -force-pkg-config -make examples -make demos –verbose 上面是 opengl es2 的情况 下面由单独介绍 XCB 情况下的配置方式 后文说 Qt5 的配置脚本不能用 pkgconfig 自动找寻到 X11 依赖所以应该又修改了 mkspecs 采用 linux-TIarmv7-sgx-g++的配置 XCB build with SGX: For Xcb build use below configure options ./configure -prefix /home1/prabu/qt5_xcb_install -release -make libs -xplatform linux-TIarmv7-sgx-g++ -opengl es2 -confirm-license -opensource -xcb -no-wayland -force-pkg-config -make examples -make demos -verbose

The Qt5 configure script does not use pkg-config to detect presence of X11 (strange ?) so might need to provide the rootfs include path in qmake.conf 所以很麻烦的是要完整 configure则 opengl icu 这些依赖的库和头文件都必须装入环境并 在 mkspecs 中配置正确也许 linaro 工具有必要去了解。

Steps to build Qt3D :下一步构建 qt3d To build Qt3D, in addition to qtbase also need to build the below: 构建 qt3d 除了在 configure 配置基本的 qtbase还需要再配置如下模块 qtjsbackend (has v8) qtdeclarative qt3d To build the above, enter the directory, then perform (assuming qmake is in the path as specified earlier) 构建方法就是进入同名的目录中用 qmake 命令编译如下 $ qmake && make && make install Qmake 能生成 Makefile 文件然后 make make install 安装

Checking the build output: 检查 As a result of the build, the QtCore libraries, QtGui etc are all built. Also, the "eglfs" and "minimal" platform plugins are built by default. Note that "eglfs" draws onscreen using egl, while "minimal" draws to an offscreen pixmap image. The Xcb platform relies on presence of a X server in the system. 以上结果就是 QtCore libraries, QtGui 等等库都被构建了"eglfs" 和"minimal"平台插 件也一样默认构建了在 qtbase/plugins/platforms/下 注意eglfs 绘图实现是使用的 eglopengl"minimal 则是绘制到像素图上Xcb 是依赖系统已有的 X 图形服务系统 Example precompiled binary of Qt5:一个 Qt5 编译的例子 A set of binaries built from above approach is provided below. To use this in the target filesystem, extract the below archive into /home1/prabu/ (Qt expects the same path while executing). Any filesystem with a recent enough libc (from >= gcc4.5) should be sufficient. 上面已经介绍了这么多你现在就可以下载这个包在仿造在/home1/prabu/下建立和 编译确定路径目录和 qmake 中的配置信息是相同的libc (from >= gcc4.5) https://gforge.ti.com/gf/download/docmanfileversion/298/5546/qt5_xcb_ins Executing demos on target:在开发板上执行例子还是德州的平台。。。 Compared to eglfs approach, since the rendering is handled by Xserver, there is no need to set QPA basics (for ex. resolution). 与 eglfs 相似这里用的 Xserver 图形系统不需要设置 QPA 1) Ensure SGX drivers are installed, and standard GLES2 3D demos are functional without Qt (refer to below link for more details on Xorg build) 确保 SGX 驱动完整一个与 qt 无关的标准 GLES2 3D 程序下面是 Xorg 详细内 容 http://processors.wiki.ti.com/index.php/Graphics_SDK_Quick_installation_... 2) With the Graphics SDK correctly installed, the /etc/powervr.ini file will have the correct WindowSystem already set. WindowSystem=libpvrPVR2D_DRIWSEGL.so 3) Running QML demos: QMLScene can be used to run QML demos, with a command similar to below: /bin/qmlscene examples/qtdeclarative/qtquick/animation/pathanimation/pathanimation.qml

Qml 程序需要由 qmlscene 来启动例如.. /bin/qmlscene examples/qtdeclarative/qtquick/animation/pathanimation/pathanimation.qml

Note that if the SGX accelerated Xserver is not running on the system, the below message will be printed, and the demo will not run 如果 SGX 加速服务没有运行会出现以下信息qml 无法运行 No platform plugin argument was specified, defaulting to "xcb". QXcbConnection: Could not connect to display Aborted 4) Running standalone demos: Standalone qt5 demos (including qt3d demos, as well as classic qtbase demos like animatedtiles) can be invoked as below for Xcb platform (default), after entering into the demo folder 独立运行的 qt 程序也可以进入执行文件目录直接执行 ./ ex, ./collidingmice No arguments are necessary as Xcb platform is the default.不需要加平台参数因为 Xcb 是默认平台 Tslib support: Provided by default Cursor support: Provided by default Screen Rotation support: TODO CPU Loading: TODO Notes: - Qt5 documentation for the APIs still need to be updated. All Qt5 docs ex, below are misleading (they point to Qtembedded docs) Qt5 文档中的函数 API 都需要被更新是所有 Qt5 文档如下都有误导 http://doc.qt.nokia.com/qt5/qt-embedded-pointer.html ======== prabindh@yahoo.com, April 2012