Building QT5 for i.MX53

Document created by Prabhu Sundararaj Employee on Feb 21, 2013Last modified by Jodi Paul on Mar 13, 2013
Version 2Show Document
  • View in full screen mode

Prerequisites:


The build is verified on prebuilt rootfs(based on LTIB) which can be downloaded from freescale.com or built from Yocto fsl-image-gui

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, 
$ 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 perl init-repository script to download all the source code for
   Qt5. To download all the source code will take about an hour.
$ perl init-repository

 

4. Download the attached linux-imx5-g++.tar.gz and copy to  qtbase/mkspecs/devices.
Will try to get updstreamed.

 

5. From the following path

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

6. 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.

    $ cd <QTDir>
    $ cd qtbase
    $  ./configure -v -opensource -confirm-license -no-pch -opengl es2 -make libs -device imx5 \
    -nomake examples -nomake demos \
-device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/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
    $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 && make install
  

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

 

9. Run 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 /usr/local/qt5/examples/opengl/hellogl_es2
    $ ./hellogl_es2 -platform eglfs

Attachments

Outcomes