Building QT5 for IMX6(all)

address:https://community.freescale.com/docs/DOC-94066

Prerequisites:
The build is verified on prebuilt rootfs(based on LTIB) which can be downloaded from freescale.com

EGL uses framebuffer backend
libEGL.so -> libEGL-fb.so
libGAL.so -> libGAL-fb.so

QT4.8

1. Download the git respository for qt4.8:

$ git clone http://git.gitorious.org/qt/qt.git qt
$ cd qt

Let us consider this as <QTDir>

2. Create /tftpboot and point your target fileystem. As like

$ mkdir -p /tftpboot

$ cd /tftpboot

$ ln -s $(ROOTFFS) rootfs

TBD:Need to work on this to use sysroot option

3. Create a build directory to install for the qt4 packages. This directory can be  in any location. For example,

$ mkdir /opt/qt4
$ sudo chown -R <username> /opt/qt4

Let us consider the the <installdir> as /opt/qt4

4. Extract the attached mkspecs(linux-imx6-g++.tar.gz) to  <QTDir>/mkspecs/qws/

5. Apply the attached cd 0001-add-i.MX6-EGL-support.patch attached to enable egl support for i.MX6

$ cd <QTDir>
$ patch -p1<0001-add-i.MX6-EGL-support.patch

6. Export CROSS-COMPILE location path to PATH

$ export PATH=$PATH:/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/

7. Enter to the <QTDir>. Do configure. You can select the options as you like. Here is an example

$ cd <QTDir>

$ ./configure -qpa -arch arm -xplatform qws/linux-imx6-g++ -no-largefile -no-accessibility \
-opensource -verbose -system-libpng -system-libjpeg -system-freetype -fast -opengl es2 -egl -confirm-license \
-qt-zlib  -qt-libpng  -no-webkit -no-multimedia \
-make examples -make demos \
-release -make libs -exceptions -no-qt3support -prefix <installdir>

8. When the configure summary is shown make sure the Qt has OpenGL ES 2.0 support. Do build

$ make
$ make install

9. Now need to build eglfs plugin

$ cd <QTDir>/src/plugins/platforms/eglfs
$ make
$ make install

Now the eglfs will be installed to the QT Install directory.

10. By now all required QT files are in <install directory>

11. Copy the install directory to target filesystem

$ cp -rf /opt/qt4 /tftpboot/rootfs/opt/.

12. Running Qt apps on target
    - Boot the target either with NFS or SD Image
    - Ensure that folder <installdir> is copied on target file system at “/usr/local”.
    - Launch application using

$ cd /opt/qt4/examples/opengl/hellogl_es2
$ ./hellogl_es2 -platform eglfs

QT5

These steps are performed on the host

1. Download the git respository for qt5:

$ git clone git://gitorious.org/qt/qt5.git qt5

$ cd qt5

Let us consider this as <QTDir>

2. Create a build directory to install for the qt5 packages. This directory can be  in any loctation. For example,

$ sudo mkdir /opt/qt5

$ sudo chown -R <username> /opt/qt5

Let us consider the the installdir as /opt/qt5

3. Enter the Qt5 directory and run the init-repository script to download all the source code for
   Qt5. To download all the source code will take about an hour.

$ ./init-repository

Update:  In the latest Qt5 release the webkit library is included by default and there are some issues trying to compile it.

use the next line to avoid problems if not desired to use webkit.

$ ./init-repository --no-webkit

4. From the following path

$ gedit qtbase/mkspecs/devices/linux-imx6-g++/qmake.conf

5. At the top of the qmake.conf, there is a configure line. Copy and paste the configure line into a text file located
   in your build build directory. Edit the configure line to find your toolchain and filesystem. Also make sure to
   include the options -no-pch, -no-opengl, -opengl es2, Here is an example of
   a configure line.

Update: In the latest Qt5 stable, the option to compile the examples/demos is -compile-examples, instead of -make examples -make demos

If you are running into problems with webkit,  use the option -no-icu, this will disable the webkit.

$ cd <QTDir>
$ cd qtbase
$ ./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -opengl es2  \
        -make libs -device imx6 \
       -compile-examples \
      -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \
       -sysroot <rootfs> -no-gcc-sysroot \
      -prefix <installdir>

7. Make the textfile that has the configure line and executable and run it. When the configure summary is shown make sure the Qt5 has openGL ES 2.0 support. Do build

$ make
$ sudo make install

When Qt5 has finished building, Qt5 will be installed in two places:

1. <location of rootfs>/<installdir>
           2. <HOST Machine>/<install dir>

This is good because now all the libraries and binaries for Qt5 are installed on the host and the target filesystem. Therefore, the target already has all the libraries and  binaries needed to run Qt5.

8. Also need to build qtjsbackend and qtdeclarative.

$ cd <location to Qt5 git>
$ cd qtjsbackend
$ ../qtbase/bin/qmake -r
$ make && sudo make install

$ cd <location to Qt5 git>
$ cd qtdeclarative
$ ../qtbase/bin/qmake -r
$ make && sudo sudo make install

9. Running Qt apps on target
    - Boot the target either with NFS or SD Image
    - Ensure that folder <installdir> is copied on target file system at “/usr/local”.
    - Launch application using

$ cd /opt/qt5/examples/opengl/hellowindow
$ ./hellowindow -platform eglfs

FAQ:
On the target file system, the location of target libaries and includes may present in arm-linux-gnueabi directory. Make sure to create soflinks to QT can find. For example

$ cd $(ROOTFS)/usr/lib
$ ln -s arm-linux-gnueabi/libffi.so.6 libffi.so.6

While building QT5, you may see a build error that libQt5V8.so.5 is not found. This might be some problem to be addressed in QT. Workaround is to
copy all the binaries to correct path as like this

$ cp  <ROOTFS>/<installdir>/lib/* <HOST Machine>/<installdir>/.

What is coming up next:
1. QT on X is already available on Yocto filesystem. Steps to enable GPU Acceleration TDB.
2. QT with Wayland support.

时间: 2024-10-30 23:06:52

Building QT5 for IMX6(all)的相关文章

QT嵌入式平台配置

Qt5 on ARM platforms - IntroductionQt5 ARM 平台移植#################################################### Introduction: This short post covers the background of Qt5, architec tural details, configuring for eglfs with Graphics drivers, building, and known i

Getting started with Yocto on Wandboard

Getting started with Yocto on Wandboard Here are the steps on how to get started with the Yocto Project based on the Freescale Community BSP for Wandboard. Contents [show] Requirements hardware and software Linux-based host system to use for building

Adeneo Embedded: Building Qt 5.1 for Freescale i.MX6Introduction on LTIB

Adeneo Embedded: Building Qt 5.1 for Freescale i.MX6Introduction Currently there is not an easy procedure to build Qt 5.1 with hardware acceleration support for Freescale i.MX6 platform. This document describes the steps necessary to download all the

用mingw静态编译Qt4.8.2和Qt5.1.1(需要修改不少源码)

因为一些乱七八糟的原因,我需要用mingw静态编译Qt4.8.2和Qt5.1.1.经历了一天的折腾之后,自觉编译一下Qt还是件颇为麻烦的事情,故将过程略作总结,以备不时之需. 首先,在编译之前,我需要下载mingw.qt-everywhere-opensource-src-4.8.2和qt-everywhere-opensource-src-5.1.1. 然后,准备开始编译了,当然先得把压缩包解压到一个合适的地方.我这里的路径是"C:\Qt"下面. 解压完毕后,先试着编译Qt4.8.2

移植qt5.3.1到arm

最近刚入手一款开发板(比较低端,刚毕业工作还没一个月,穷屌丝一个).在学校以前都是用的是Friendly Arm的6410,使用的qt版本是使用的最多的4.7.0版本,入手的板子是4.7.4.qt5出来也有好长的时间了,其中提供了很多的特性,所以这次移植的是qt5的最新版本5.3.1. 第一步准备好源码包,这里需要qt的源码包,和tslib包,tslib我使用的是开发板提供的包. 设置交叉编译环境,我使用的是friendly arm的交叉工具.将其加到PATH中. 然后看看是不是已经安装成功.

linux下编译qt5.6.0静态库——configure配置

 随笔 - 116  文章 - 4  评论 - 7 linux下编译qt5.6.0静态库--configure配置 linux下编译qt5.6.0静态库 linux下编译qt5.6.0静态库 configure生成makefile 安装选项 Configure选项 第三方库: 附加选项: QNX/Blackberry选项: Android 选项: 生成makefile 遇到链接检查失败的情况 生成makefile后进行编译 编译时的错误 多重定义'QT_MODBUS()'和'QT_MODBU

Qt5.7.0配置选项(configure非常详细的参数)

configure是一个命令行工具,用于配置Qt编译到指定平台.configure必须运行于Qt源码根目录.当运行configure时,编译源码使用的是所选工具链中的make工具. 一.源码目录.编译目录和安装目录 源码目录就是包含源码的目录.编译目录是包含Makefiles文件.object文件和其他中间文件的目录.安装目录是二进制文件和库文件安装的目录. 当编译目录和源码目录不一样时,称为影子编译(shadow build),比如说,Qt Creator默认是使用影子编译来编译工程的.这里也

Qt5构建出错问题解决办法

我之前用的Qt其他版本,因为一些原因我更换了Qt版本,从Qt5.9.1又更换到之前用的Qt5.3.2,但是发现无法build,问题提示如下: 19:54:03: 为项目untitled执行步骤 ... 19:54:03: 无法启动进程 "C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\qmake.exe" E:\Qt_Data\untitled\untitled.pro -r -spec win32-g++ "CONFIG+=debug" Err

ubuntu下安装Qt5.5.0

下载相应系统的Qt版本.http://www.qt.io/download-open-source/#section-2 安装的是32位的ubuntu,就下载x86的.就是这个qt-opensource-linux-x86-5.5.0.run. 下完之后,cd到下载的那个目录,更改文件权限chmod 700 qt-opensource-linux-x86-5.5.0.run 然后执行./qt-opensource-linux-x86-5.5.0.run 出现Qt安装对话框,下一步到完成. 编译的